From 373dd137dfad1d558ae3a7d731309d033d45172e Mon Sep 17 00:00:00 2001 From: Nazar Bartosik Date: Fri, 13 Nov 2020 14:36:03 +0100 Subject: [PATCH 01/12] Python3 compatibility of Reader class Changed the __iter__ method to follow the Python 3 convention --- src/python/pyLCIO/io/Reader.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/python/pyLCIO/io/Reader.py b/src/python/pyLCIO/io/Reader.py index ab47240f4..110b75d4f 100644 --- a/src/python/pyLCIO/io/Reader.py +++ b/src/python/pyLCIO/io/Reader.py @@ -26,7 +26,7 @@ def __init__( self, reader, fileName=None ): self.addFileList( fileName ) def __iter__( self ): - return self + return self.reader.__iter__() def getNumberOfEvents( self ): ''' Get the number of events in the stream ''' From eb1e41fbf04b349244ad7bfbc884e4dde60eb96f Mon Sep 17 00:00:00 2001 From: Federico Meloni Date: Tue, 3 May 2022 17:56:53 +0200 Subject: [PATCH 02/12] adding number of holes to track class --- src/aid/EVENT/Track.aid | 3 +++ src/cpp/include/IMPL/TrackImpl.h | 6 ++++++ src/cpp/src/IMPL/TrackImpl.cc | 7 +++++++ 3 files changed, 16 insertions(+) diff --git a/src/aid/EVENT/Track.aid b/src/aid/EVENT/Track.aid index cd4ec7768..9b404aa58 100644 --- a/src/aid/EVENT/Track.aid +++ b/src/aid/EVENT/Track.aid @@ -95,6 +95,9 @@ public interface Track extends LCObject { */ public float getdEdxError() const ; + /** Number of holes. + */ + public int getNholes() const ; /** The radius of the innermost hit that has been used in the track fit. * Helps to detect V0 tracks with small impact paramters or heavy mesons. diff --git a/src/cpp/include/IMPL/TrackImpl.h b/src/cpp/include/IMPL/TrackImpl.h index 04099d70c..f56e25271 100644 --- a/src/cpp/include/IMPL/TrackImpl.h +++ b/src/cpp/include/IMPL/TrackImpl.h @@ -113,6 +113,10 @@ namespace IMPL { */ virtual float getdEdxError() const; + /** Number of holes of the track. + */ + virtual int getNholes() const; + /** The radius of the innermost hit that has been used in the track fit. * Helps to detect V0 tracks with small impact paramters or haevy mesons. * To be used as convenient information or if hits are not stored in @@ -174,6 +178,7 @@ namespace IMPL { virtual void setNdf( int ndf ) ; virtual void setdEdx( float dEdx ) ; virtual void setdEdxError( float dEdxError ) ; + virtual void setNholes( int nholes ) ; virtual void addTrack( EVENT::Track* trk ) ; virtual void addTrackState( EVENT::TrackState* trkstate ) ; @@ -202,6 +207,7 @@ namespace IMPL { int _ndf{0} ; float _dEdx{0} ; float _dEdxError{0} ; + int _nholes{0} ; float _radiusOfInnermostHit{0} ; EVENT::IntVec _subdetectorHitNumbers{} ; diff --git a/src/cpp/src/IMPL/TrackImpl.cc b/src/cpp/src/IMPL/TrackImpl.cc index 097238283..d655ea847 100644 --- a/src/cpp/src/IMPL/TrackImpl.cc +++ b/src/cpp/src/IMPL/TrackImpl.cc @@ -16,6 +16,7 @@ namespace IMPL { _ndf(0), _dEdx(0), _dEdxError(0), + _nholes(0), _radiusOfInnermostHit(0) { } @@ -34,6 +35,7 @@ namespace IMPL { _ndf = o._ndf ; _dEdx = o._dEdx ; _dEdxError = o._dEdxError ; + _nholes = o._nholes ; _radiusOfInnermostHit = o._radiusOfInnermostHit ; std::copy( o._subdetectorHitNumbers.begin() , o._subdetectorHitNumbers.end() , std::back_inserter( _subdetectorHitNumbers ) ) ; @@ -110,6 +112,7 @@ namespace IMPL { int TrackImpl::getNdf() const { return _ndf ;} float TrackImpl::getdEdx() const { return _dEdx ; } float TrackImpl::getdEdxError() const { return _dEdxError ; } + int TrackImpl::getNholes() const { return _nholes ; } float TrackImpl::getRadiusOfInnermostHit() const { @@ -337,6 +340,10 @@ namespace IMPL { checkAccess("TrackImpl::setdEdxError") ; _dEdxError = dEdxError ; } + void TrackImpl::setNholes( int nholes ){ + checkAccess("TrackImpl::setNholes") ; + _nholes = nholes ; + } void TrackImpl::addHit( TrackerHit* hit) { _hits.push_back( hit ) ; From 74b29a178eb603d715beaa1454909f22cec5c590 Mon Sep 17 00:00:00 2001 From: Federico Meloni Date: Thu, 12 May 2022 07:57:36 -0400 Subject: [PATCH 03/12] missing nholes bits --- src/cpp/include/pre-generated/EVENT/Track.h | 4 ++++ src/cpp/src/EXAMPLE/recjob.cc | 1 + src/cpp/src/SIO/SIOTrackHandler.cc | 2 ++ src/cpp/src/TESTS/test_tracks.cc | 6 ++++++ src/cpp/src/UTIL/Operators.cc | 6 ++++-- src/java/hep/lcio/implementation/event/ITrack.java | 12 ++++++++++++ src/java/hep/lcio/implementation/sio/SIOTrack.java | 3 +++ src/java/hep/lcio/util/Printer.java | 3 ++- src/latex/manual/f77summary.tex | 2 ++ 9 files changed, 36 insertions(+), 3 deletions(-) diff --git a/src/cpp/include/pre-generated/EVENT/Track.h b/src/cpp/include/pre-generated/EVENT/Track.h index 2c69590d9..5ea712de3 100644 --- a/src/cpp/include/pre-generated/EVENT/Track.h +++ b/src/cpp/include/pre-generated/EVENT/Track.h @@ -104,6 +104,10 @@ class Track : public LCObject { */ virtual float getdEdxError() const = 0; + /** Number of holes. + */ + virtual int getNholes() const = 0; + /** The radius of the innermost hit that has been used in the track fit. * Helps to detect V0 tracks with small impact paramters or heavy mesons. * To be used as convenient information or if hits are not stored in diff --git a/src/cpp/src/EXAMPLE/recjob.cc b/src/cpp/src/EXAMPLE/recjob.cc index dda37a127..12b8f5939 100644 --- a/src/cpp/src/EXAMPLE/recjob.cc +++ b/src/cpp/src/EXAMPLE/recjob.cc @@ -191,6 +191,7 @@ class RunEventProcessor : public LCRunListener, public LCEventListener{ trk->setZ0( (i+1)*10. ) ; trk->setChi2( 1.01 ) ; trk->setNdf( 42 ) ; + trk->setNholes( 2 ) ; trk->setRadiusOfInnermostHit( 3.141592 ) ; diff --git a/src/cpp/src/SIO/SIOTrackHandler.cc b/src/cpp/src/SIO/SIOTrackHandler.cc index cf62b0daf..c06cedf49 100644 --- a/src/cpp/src/SIO/SIOTrackHandler.cc +++ b/src/cpp/src/SIO/SIOTrackHandler.cc @@ -50,6 +50,7 @@ namespace SIO { SIO_DATA( device , &(trk->_ndf) , 1 ) ; SIO_DATA( device , &(trk->_dEdx) , 1 ) ; SIO_DATA( device , &(trk->_dEdxError) , 1 ) ; + SIO_DATA( device , &(trk->_nholes) , 1 ) ; SIO_DATA( device , &( trk->_radiusOfInnermostHit ) , 1 ) ; int nHitNumbers ; SIO_DATA( device, &nHitNumbers , 1 ) ; @@ -100,6 +101,7 @@ namespace SIO { SIO_SDATA( device, trk->getNdf() ) ; SIO_SDATA( device, trk->getdEdx() ) ; SIO_SDATA( device, trk->getdEdxError() ) ; + SIO_SDATA( device, trk->getNholes() ) ; SIO_SDATA( device , trk->getRadiusOfInnermostHit() ) ; auto hitNums = trk->getSubdetectorHitNumbers() ; int nHitNumbers = hitNums.size() ; diff --git a/src/cpp/src/TESTS/test_tracks.cc b/src/cpp/src/TESTS/test_tracks.cc index 60c5e1d18..8d6f69fdc 100644 --- a/src/cpp/src/TESTS/test_tracks.cc +++ b/src/cpp/src/TESTS/test_tracks.cc @@ -79,6 +79,7 @@ int main(int /*argc*/, char** /*argv*/ ){ trk->setRadiusOfInnermostHit( 3.14159265 ) ; trk->setdEdx( 3.14159265 ) ; trk->setdEdxError( 42. ) ; + trk->setNholes( 2. ) ; float cov[15] = { 1.,2.,3.,4.,5.,6.,7.,8.,9.,10.,11.,12.,13.,14.,15. } ; trk->setCovMatrix( cov ) ; @@ -113,6 +114,7 @@ int main(int /*argc*/, char** /*argv*/ ){ trk->setRadiusOfInnermostHit( 3.14159265 ) ; trk->setdEdx( 3.14159265 ) ; trk->setdEdxError( 42. ) ; + trk->setNholes( 2. ) ; float cov[15] = { 1.,2.,3.,4.,5.,6.,7.,8.,9.,10.,11.,12.,13.,14.,15. } ; trk->setCovMatrix( cov ) ; @@ -203,6 +205,7 @@ int main(int /*argc*/, char** /*argv*/ ){ MYTEST( trk->getNdf(), 42 , "getNdf" ) ; MYTEST( trk->getdEdx(), float(3.14159265) , "getdEdx" ) ; MYTEST( trk->getdEdxError(), float(42.) , "getdEdxError" ) ; + MYTEST( trk->getNholes(), int(2.) , "getNholes" ) ; MYTEST( trk->getRadiusOfInnermostHit(), float(3.14159265) , "getRadiusOfInnermostHit" ) ; const FloatVec& cov = trk->getCovMatrix() ; @@ -256,6 +259,7 @@ int main(int /*argc*/, char** /*argv*/ ){ MYTEST( trk->getNdf(), 42 , "getNdf" ) ; MYTEST( trk->getdEdx(), float(3.14159265) , "getdEdx" ) ; MYTEST( trk->getdEdxError(), float(42.) , "getdEdxError" ) ; + MYTEST( trk->getNholes(), int(2.) , "getNholes" ) ; MYTEST( trk->getRadiusOfInnermostHit(), float(3.14159265) , "getRadiusOfInnermostHit" ) ; const FloatVec& cov = trk->getCovMatrix() ; @@ -304,6 +308,7 @@ int main(int /*argc*/, char** /*argv*/ ){ MYTEST( trk->getNdf(), 42 , "getNdf" ) ; MYTEST( trk->getdEdx(), float(3.14159265) , "getdEdx" ) ; MYTEST( trk->getdEdxError(), float(42.) , "getdEdxError" ) ; + MYTEST( trk->getNholes(), int(2.) , "getNholes" ) ; MYTEST( trk->getRadiusOfInnermostHit(), float(3.14159265) , "getRadiusOfInnermostHit" ) ; const FloatVec& cov = trk->getCovMatrix() ; @@ -367,6 +372,7 @@ int main(int /*argc*/, char** /*argv*/ ){ MYTEST( trkc->getNdf(), 42 , "getNdf" ) ; MYTEST( trkc->getdEdx(), float(3.14159265) , "getdEdx" ) ; MYTEST( trkc->getdEdxError(), float(42.) , "getdEdxError" ) ; + MYTEST( trkc->getNholes(), int(2.) , "getNholes" ) ; MYTEST( trkc->getRadiusOfInnermostHit(), float(3.14159265) , "getRadiusOfInnermostHit" ) ; const FloatVec& covc = trkc->getCovMatrix() ; diff --git a/src/cpp/src/UTIL/Operators.cc b/src/cpp/src/UTIL/Operators.cc index 6e4be789d..a9894b86c 100644 --- a/src/cpp/src/UTIL/Operators.cc +++ b/src/cpp/src/UTIL/Operators.cc @@ -2420,12 +2420,12 @@ namespace UTIL{ //============================================================================ const std::string& header(const EVENT::Track *){ //hauke - static const std::string _h(" [ id ] | type | d0 | phi | omega | z0 | tan lambda| reference point(x,y,z) | dEdx | dEdxErr | chi2 | ndf \n"); + static const std::string _h(" [ id ] | type | d0 | phi | omega | z0 | tan lambda| reference point(x,y,z) | dEdx | dEdxErr | nholes | chi2 | ndf \n"); return _h; } const std::string& tail(const EVENT::Track *){ //hauke - static const std::string _t("------------|----------|----------|----------|----------|-----------|-----------|---------------------------------|----------|----------|-------- \n"); + static const std::string _t("------------|----------|----------|----------|----------|-----------|-----------|---------------------------------|----------|----------|----------|-------- \n"); return _t; } @@ -2449,6 +2449,7 @@ namespace UTIL{ out << " |(" << setprecision(2) << trk->getReferencePoint()[0] << ", " << trk->getReferencePoint()[1] << ", " <getReferencePoint()[2]; out << ")|" << trk->getdEdx(); out << " |" << trk->getdEdxError(); + out << " |" << trk->getNholes(); out << " |" << trk->getChi2(); out << " |" << noshowpos << setw(5) << trk->getNdf() ; out << endl; @@ -2542,6 +2543,7 @@ namespace UTIL{ // out << setw(30) << setfill(' ') << left << "ReferencePoint" << right << setw(40) << tmp.str() << endl; out << setw(30) << setfill(' ') << left << "dEdx" << right << setw(40) << part->getdEdx() << endl; out << setw(30) << setfill(' ') << left << "dEdx Error" << right << setw(40) << part->getdEdxError() << endl; + out << setw(30) << setfill(' ') << left << "N holes" << right << setw(40) << part->getNholes() << endl; out << setw(30) << setfill(' ') << left << "Chi2" << right << setw(40) << part->getChi2() << endl; out << setw(30) << setfill(' ') << left << "Ndf" << right << setw(40) << noshowpos << part->getNdf() << endl; diff --git a/src/java/hep/lcio/implementation/event/ITrack.java b/src/java/hep/lcio/implementation/event/ITrack.java index 2ae8d8c8d..12092eedc 100644 --- a/src/java/hep/lcio/implementation/event/ITrack.java +++ b/src/java/hep/lcio/implementation/event/ITrack.java @@ -31,6 +31,7 @@ public class ITrack extends ILCObject implements Track protected float chi2; protected float dEdx; protected float dEdxError; + protected int nholes; protected int ndf; protected List tracks = new ArrayList(); protected List trackStates = new ArrayList(); @@ -239,6 +240,11 @@ public float getdEdxError() { return dEdxError; } + + public int getNholes() + { + return nholes; + } public void setChi2(float chi2) { @@ -256,6 +262,12 @@ public void setDEdxError(float dEdxError) { checkAccess(); this.dEdxError = dEdxError; + } + + public void setNholes(int nholes) + { + checkAccess(); + this.nholes = nholes; } protected void setType(int type) diff --git a/src/java/hep/lcio/implementation/sio/SIOTrack.java b/src/java/hep/lcio/implementation/sio/SIOTrack.java index e6d910245..ec887cfdd 100644 --- a/src/java/hep/lcio/implementation/sio/SIOTrack.java +++ b/src/java/hep/lcio/implementation/sio/SIOTrack.java @@ -78,6 +78,7 @@ class SIOTrack extends ITrack ndf = in.readInt() ; dEdx = in.readFloat(); dEdxError = in.readFloat(); + nholes = in.readInt() ; radiusOfInnermostHit = in.readFloat() ; int nHitNumbers = in.readInt() ; int[] hitNumbers = new int[nHitNumbers] ; @@ -152,6 +153,7 @@ static void write(Track track, SIOOutputStream out, int flag) throws IOException out.writeInt(track.getNdf()); out.writeFloat(track.getdEdx()); out.writeFloat(track.getdEdxError()); + out.writeFloat(track.getNholes()); out.writeFloat(track.getRadiusOfInnermostHit()) ; int[] hitNumbers = track.getSubdetectorHitNumbers(); out.writeInt( hitNumbers.length ) ; @@ -217,6 +219,7 @@ private void write(SIOOutputStream out, int flag) throws IOException out.writeFloat(ndf); out.writeFloat(dEdx); out.writeFloat(dEdxError); + out.writeInt(nholes); out.writeFloat(radiusOfInnermostHit) ; out.writeInt( subdetectorHitNumbers.length ) ; for (int i = 0; i < subdetectorHitNumbers.length; i++) diff --git a/src/java/hep/lcio/util/Printer.java b/src/java/hep/lcio/util/Printer.java index 34dabb9a1..ecd3d9a35 100644 --- a/src/java/hep/lcio/util/Printer.java +++ b/src/java/hep/lcio/util/Printer.java @@ -859,7 +859,7 @@ void print(LCCollection coll, int nprint) { boolean havehits = ((flag & (1 << LCIO.TRBIT_HITS)) != 0); - ps.println(" [ id ] | type | d0 | phi | omega | z0 | tan lambda| reference point(x,y,z) | dEdx | dEdxErr | chi2 "); + ps.println(" [ id ] | type | d0 | phi | omega | z0 | tan lambda| reference point(x,y,z) | dEdx | dEdxErr | nholes | chi2 "); for (int i = 0; i < nprint; i++) { Track trk = (Track) coll.getElementAt(i); @@ -878,6 +878,7 @@ void print(LCCollection coll, int nprint) { Double.valueOf(trk.getReferencePoint()[2]), Double.valueOf(trk.getdEdx()), Double.valueOf(trk.getdEdxError()), + Integer.valueOf(trk.getNholes()), Double.valueOf(trk.getChi2())); // Print errors. diff --git a/src/latex/manual/f77summary.tex b/src/latex/manual/f77summary.tex index 77953e32d..d08721ec2 100644 --- a/src/latex/manual/f77summary.tex +++ b/src/latex/manual/f77summary.tex @@ -288,6 +288,7 @@ setNdf -> status = lctrksetndf( ptrk, ndf ) setdEdx -> status = lctrksetdedx( ptrk, dedx ) setdEdxError -> status = lctrksetdedxerror( ptrk, dedxerr ) +setNholes -> status = lctrksetnholes( ptrk, nholes ) setRadiusOfInnermostHit-> status = lctrksetradiusofinnermosthit( ptrk, radius) addTrack -> status = lctrkaddtrack( ptrk, ptrack ) addHit -> status = lctrkaddhit( ptrk, phit ) @@ -306,6 +307,7 @@ getNdf -> ndf = lctrkgetndf( ptrk ) getdEdx -> dedx = lctrkgetdedx( ptrk ) getdEdxError -> dedxerr = lctrkgetdedxerror( ptrk ) +getNholes -> nholes = lctrkgetnholes( ptrk ) getRadiusOfInnermostHit-> radius = lctrkgetradiusofinnermosthit( ptrk ) subdetectorHitNumbers -> status = lctrkgetsubdetectorhitnumbers( ptrk, intv, nintv) getTracks -> ptrackv = lctrkgettracks( ptrk ) From ca450c9abcd1fd2ac06aa116a6edfd03d414ba7e Mon Sep 17 00:00:00 2001 From: Karol Krizka Date: Thu, 30 Jun 2022 14:40:33 -0700 Subject: [PATCH 04/12] Add subdetectorHoleNumbers to count holes by subdetector. --- cmake/lcio.xml.in | 4 ++++ src/cpp/include/IMPL/TrackImpl.h | 16 +++++++++++++++- src/cpp/include/pre-generated/EVENT/Track.h | 8 ++++++++ src/cpp/src/EXAMPLE/recjob.cc | 5 +++++ src/cpp/src/IMPL/TrackImpl.cc | 10 ++++++++++ src/cpp/src/SIO/SIOTrackHandler.cc | 10 ++++++++++ .../hep/lcio/implementation/event/ITrack.java | 18 +++++++++++++++--- .../hep/lcio/implementation/sio/SIOTrack.java | 7 +++++++ src/latex/manual/f77summary.tex | 2 ++ 9 files changed, 76 insertions(+), 4 deletions(-) diff --git a/cmake/lcio.xml.in b/cmake/lcio.xml.in index 0aa50c038..c4e72aa52 100644 --- a/cmake/lcio.xml.in +++ b/cmake/lcio.xml.in @@ -599,6 +599,10 @@ number of hits in particular subdetectors. TODO need way to define mapping in run/event header + + + number of holes in particular subdetectors. TODO need way to define mapping in run/event header + tracks that have been combined to this track diff --git a/src/cpp/include/IMPL/TrackImpl.h b/src/cpp/include/IMPL/TrackImpl.h index f56e25271..f1c06a5de 100644 --- a/src/cpp/include/IMPL/TrackImpl.h +++ b/src/cpp/include/IMPL/TrackImpl.h @@ -132,6 +132,13 @@ namespace IMPL { */ virtual const EVENT::IntVec & getSubdetectorHitNumbers() const ; + /** A vector that holds the number of holes in particular subdetectors. + * The mapping of indices to subdetectors is implementation dependent. + * To be used as convenient information or if holes are not stored in + * the data set, e.g. DST or FastMC. + * TODO: Provide way to store mapping in event/run header. + */ + virtual const EVENT::IntVec & getSubdetectorHoleNumbers() const ; /** The tracks (as Track objects) that have been combined to this track. */ @@ -191,11 +198,17 @@ namespace IMPL { virtual void setRadiusOfInnermostHit( float r ) ; /** Allows modification of the subdetectorHitNumbers, e.g.
- * track->subdetectorHitNumbers().resize(5) ;
+ * track->subdetectorHitNumbers().resize(5) ;
* track->subdetectorHitNumbers()[4] = 42 ; */ virtual EVENT::IntVec & subdetectorHitNumbers() ; + /** Allows modification of the subdetectorHoleNumbers, e.g.
+ * track->subdetectorHoleNumbers().resize(5) ;
+ * track->subdetectorHoleNumbers()[4] = 42 ; + */ + virtual EVENT::IntVec & subdetectorHoleNumbers() ; + protected: virtual void setType( int type ) ; @@ -210,6 +223,7 @@ namespace IMPL { int _nholes{0} ; float _radiusOfInnermostHit{0} ; EVENT::IntVec _subdetectorHitNumbers{} ; + EVENT::IntVec _subdetectorHoleNumbers{} ; EVENT::TrackVec _tracks{} ; EVENT::TrackerHitVec _hits{} ; diff --git a/src/cpp/include/pre-generated/EVENT/Track.h b/src/cpp/include/pre-generated/EVENT/Track.h index 5ea712de3..bd5e5da93 100644 --- a/src/cpp/include/pre-generated/EVENT/Track.h +++ b/src/cpp/include/pre-generated/EVENT/Track.h @@ -123,6 +123,14 @@ class Track : public LCObject { */ virtual const IntVec & getSubdetectorHitNumbers() const = 0; + /** A vector that holds the number of holes in particular subdetectors. + * The mapping of indices to subdetectors is implementation dependent. + * To be used as convenient information or if holes are not stored in + * the data set, e.g. DST or FastMC. + * Check/set collection variable TrackSubdetectorNames for decoding the indices. + */ + virtual const IntVec & getSubdetectorHoleNumbers() const = 0; + /** The tracks that have been combined to this track. */ virtual const TrackVec & getTracks() const = 0; diff --git a/src/cpp/src/EXAMPLE/recjob.cc b/src/cpp/src/EXAMPLE/recjob.cc index 12b8f5939..9f69fd004 100644 --- a/src/cpp/src/EXAMPLE/recjob.cc +++ b/src/cpp/src/EXAMPLE/recjob.cc @@ -213,6 +213,11 @@ class RunEventProcessor : public LCRunListener, public LCEventListener{ trk->subdetectorHitNumbers()[ SITINDEX ] = 24 ; trk->subdetectorHitNumbers()[ TPCINDEX ] = 36 ; + trk->subdetectorHoleNumbers().resize( NTRACKER ) ; + trk->subdetectorHoleNumbers()[ VTXINDEX ] = 0 ; + trk->subdetectorHoleNumbers()[ SITINDEX ] = 0 ; + trk->subdetectorHoleNumbers()[ TPCINDEX ] = 0 ; + trk->setdEdx( 3.14159 ) ; trk->setdEdxError( 42. ) ; float cov[15] = { 1.,2.,3.,4.,5.,6.,7.,8.,9.,10.,11.,12.,13.,14.,15. } ; diff --git a/src/cpp/src/IMPL/TrackImpl.cc b/src/cpp/src/IMPL/TrackImpl.cc index d655ea847..45b7a5e42 100644 --- a/src/cpp/src/IMPL/TrackImpl.cc +++ b/src/cpp/src/IMPL/TrackImpl.cc @@ -39,6 +39,7 @@ namespace IMPL { _radiusOfInnermostHit = o._radiusOfInnermostHit ; std::copy( o._subdetectorHitNumbers.begin() , o._subdetectorHitNumbers.end() , std::back_inserter( _subdetectorHitNumbers ) ) ; + std::copy( o._subdetectorHoleNumbers.begin() , o._subdetectorHoleNumbers.end() , std::back_inserter( _subdetectorHoleNumbers ) ) ; std::copy( o._hits.begin() , o._hits.end() , std::back_inserter( _hits ) ) ; @@ -122,6 +123,10 @@ namespace IMPL { const IntVec & TrackImpl::getSubdetectorHitNumbers() const { return _subdetectorHitNumbers ; } + const IntVec & TrackImpl::getSubdetectorHoleNumbers() const { + return _subdetectorHoleNumbers ; + } + const TrackerHitVec & TrackImpl::getTrackerHits() const { return _hits ; } @@ -376,6 +381,11 @@ namespace IMPL { return _subdetectorHitNumbers ; } + IntVec & TrackImpl::subdetectorHoleNumbers(){ + checkAccess("TrackImpl::subdetectorHoleNumbers") ; + return _subdetectorHoleNumbers ; + } + void TrackImpl::setRadiusOfInnermostHit( float r ){ checkAccess("TrackImpl::setRadiusOfInnermostHit") ; _radiusOfInnermostHit = r ; diff --git a/src/cpp/src/SIO/SIOTrackHandler.cc b/src/cpp/src/SIO/SIOTrackHandler.cc index c06cedf49..45795f992 100644 --- a/src/cpp/src/SIO/SIOTrackHandler.cc +++ b/src/cpp/src/SIO/SIOTrackHandler.cc @@ -58,6 +58,10 @@ namespace SIO { for( int i=0 ; i_subdetectorHitNumbers[i] ), 1 ) ; } + trk->subdetectorHoleNumbers().resize( nHoleNumbers ) ; + for( int i=0 ; i_subdetectorHoleNumbers[i] ), 1 ) ; + } int nTracks ; SIO_DATA( device, &nTracks , 1 ) ; trk->_tracks.resize( nTracks ) ; @@ -109,6 +113,12 @@ namespace SIO { for( int i=0 ; igetSubdetectorHoleNumbers() ; + int nHoleNumbers = holeNums.size() ; + SIO_DATA( device, &nHoleNumbers , 1 ) ; + for( int i=0 ; igetTracks() ; int nTracks = tracks.size() ; SIO_DATA( device, &nTracks , 1 ) ; diff --git a/src/java/hep/lcio/implementation/event/ITrack.java b/src/java/hep/lcio/implementation/event/ITrack.java index 12092eedc..04924166c 100644 --- a/src/java/hep/lcio/implementation/event/ITrack.java +++ b/src/java/hep/lcio/implementation/event/ITrack.java @@ -40,6 +40,7 @@ public class ITrack extends ILCObject implements Track //public final static int BITISREFERENCEPOINTPCA = 31; protected int[] subdetectorHitNumbers = null0; + protected int[] subdetectorHoleNumbers = null0; public float getD0() { @@ -321,21 +322,32 @@ public float getRadiusOfInnermostHit() { return radiusOfInnermostHit; } - + public void setRadiusOfInnermostHit(float f) { checkAccess(); radiusOfInnermostHit = f; } - + public int[] getSubdetectorHitNumbers() { return subdetectorHitNumbers ; } - + public void setSubdetectorHitNumbers(int[] is) { checkAccess(); subdetectorHitNumbers = is; } + + public int[] getSubdetectorHoleNumbers() + { + return subdetectorHoleNumbers ; + } + + public void setSubdetectorHoleNumbers(int[] is) + { + checkAccess(); + subdetectorHoleNumbers = is; + } } diff --git a/src/java/hep/lcio/implementation/sio/SIOTrack.java b/src/java/hep/lcio/implementation/sio/SIOTrack.java index ec887cfdd..e889e0959 100644 --- a/src/java/hep/lcio/implementation/sio/SIOTrack.java +++ b/src/java/hep/lcio/implementation/sio/SIOTrack.java @@ -87,6 +87,13 @@ class SIOTrack extends ITrack hitNumbers[i] = in.readInt() ; } setSubdetectorHitNumbers(hitNumbers) ; + int nHoleNumbers = in.readInt() ; + int[] holeNumbers = new int[nHoleNumbers] ; + for (int i = 0; i < nHoleNumbers; i++) + { + holeNumbers[i] = in.readInt() ; + } + setSubdetectorHoleNumbers(holeNumbers) ; int nTracks = in.readInt(); tempTracks = new ArrayList(nTracks); tracks = null; diff --git a/src/latex/manual/f77summary.tex b/src/latex/manual/f77summary.tex index d08721ec2..e7bd75935 100644 --- a/src/latex/manual/f77summary.tex +++ b/src/latex/manual/f77summary.tex @@ -293,6 +293,7 @@ addTrack -> status = lctrkaddtrack( ptrk, ptrack ) addHit -> status = lctrkaddhit( ptrk, phit ) subdetectorHitNumbers -> status = lctrksetsubdetectorhitnumbers( ptrk, intv, nintv) (not in C++ API) +subdetectorHoleNumbers -> status = lctrksetsubdetectorholenumbers( ptrk, intv, nintv) (not in C++ API) id -> id = lctrkid( ptrk ) getType -> itype = lctrkgettype( ptrk ) @@ -310,6 +311,7 @@ getNholes -> nholes = lctrkgetnholes( ptrk ) getRadiusOfInnermostHit-> radius = lctrkgetradiusofinnermosthit( ptrk ) subdetectorHitNumbers -> status = lctrkgetsubdetectorhitnumbers( ptrk, intv, nintv) +subdetectorHoleNumbers -> status = lctrkgetsubdetectorholenumbers( ptrk, intv, nintv) getTracks -> ptrackv = lctrkgettracks( ptrk ) getTrackerHits -> ptrhitv = lctrkgettrackerhits( ptrk ) From 9f099e15334bf23bb6fd535fadbc13605ec46f21 Mon Sep 17 00:00:00 2001 From: Karol Krizka Date: Thu, 30 Jun 2022 15:22:21 -0700 Subject: [PATCH 05/12] Add missing Nholes entry in xml description. --- cmake/lcio.xml.in | 1 + 1 file changed, 1 insertion(+) diff --git a/cmake/lcio.xml.in b/cmake/lcio.xml.in index c4e72aa52..cfae2a07d 100644 --- a/cmake/lcio.xml.in +++ b/cmake/lcio.xml.in @@ -594,6 +594,7 @@ ndf of fit dEdx Error of dEdx + number of holes in track radius of innermost hit used in track fit From 737984f69068a0cbd8ce68f2372409714bc2e7c3 Mon Sep 17 00:00:00 2001 From: Karol Krizka Date: Thu, 30 Jun 2022 15:23:51 -0700 Subject: [PATCH 06/12] Add missing variable. --- src/cpp/src/SIO/SIOTrackHandler.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/cpp/src/SIO/SIOTrackHandler.cc b/src/cpp/src/SIO/SIOTrackHandler.cc index 45795f992..aa506c7c9 100644 --- a/src/cpp/src/SIO/SIOTrackHandler.cc +++ b/src/cpp/src/SIO/SIOTrackHandler.cc @@ -58,6 +58,8 @@ namespace SIO { for( int i=0 ; i_subdetectorHitNumbers[i] ), 1 ) ; } + int nHoleNumbers ; + SIO_DATA( device, &nHoleNumbers , 1 ) ; trk->subdetectorHoleNumbers().resize( nHoleNumbers ) ; for( int i=0 ; i_subdetectorHoleNumbers[i] ), 1 ) ; From f241bb3bccd1d50564c38e31011c0ac6cc271696 Mon Sep 17 00:00:00 2001 From: Federico Meloni Date: Tue, 28 May 2024 09:54:18 +0200 Subject: [PATCH 07/12] version check in SIOTrackHandler.cc Co-authored-by: Thomas Madlener --- src/cpp/src/SIO/SIOTrackHandler.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/cpp/src/SIO/SIOTrackHandler.cc b/src/cpp/src/SIO/SIOTrackHandler.cc index aa506c7c9..07dfdeeb2 100644 --- a/src/cpp/src/SIO/SIOTrackHandler.cc +++ b/src/cpp/src/SIO/SIOTrackHandler.cc @@ -50,7 +50,9 @@ namespace SIO { SIO_DATA( device , &(trk->_ndf) , 1 ) ; SIO_DATA( device , &(trk->_dEdx) , 1 ) ; SIO_DATA( device , &(trk->_dEdxError) , 1 ) ; - SIO_DATA( device , &(trk->_nholes) , 1 ) ; + if (vers >= SIO_VERSION_ENCODE(2, 21) { + SIO_DATA( device , &(trk->_nholes) , 1 ) ; + } SIO_DATA( device , &( trk->_radiusOfInnermostHit ) , 1 ) ; int nHitNumbers ; SIO_DATA( device, &nHitNumbers , 1 ) ; From ce8d1fd7521b21489dbf359a15d8e0bbe0bfb5f5 Mon Sep 17 00:00:00 2001 From: Federico Meloni Date: Tue, 28 May 2024 09:55:07 +0200 Subject: [PATCH 08/12] Version check in src/java/hep/lcio/implementation/sio/SIOTrack.java Co-authored-by: Thomas Madlener --- src/java/hep/lcio/implementation/sio/SIOTrack.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/java/hep/lcio/implementation/sio/SIOTrack.java b/src/java/hep/lcio/implementation/sio/SIOTrack.java index e889e0959..1ef2bec1b 100644 --- a/src/java/hep/lcio/implementation/sio/SIOTrack.java +++ b/src/java/hep/lcio/implementation/sio/SIOTrack.java @@ -78,7 +78,9 @@ class SIOTrack extends ITrack ndf = in.readInt() ; dEdx = in.readFloat(); dEdxError = in.readFloat(); - nholes = in.readInt() ; + if (SIOVersion.encode(major,minor) > SIOVersion.encode(2,21) { + nholes = in.readInt() ; + } radiusOfInnermostHit = in.readFloat() ; int nHitNumbers = in.readInt() ; int[] hitNumbers = new int[nHitNumbers] ; From 35155c18e02f240c2323d46a0dd3b96b78bf4253 Mon Sep 17 00:00:00 2001 From: Federico Meloni Date: Tue, 28 May 2024 10:28:36 +0200 Subject: [PATCH 09/12] Version checks for SIOTrackHandler.cc --- src/cpp/src/SIO/SIOTrackHandler.cc | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/cpp/src/SIO/SIOTrackHandler.cc b/src/cpp/src/SIO/SIOTrackHandler.cc index 07dfdeeb2..a3d2d01d9 100644 --- a/src/cpp/src/SIO/SIOTrackHandler.cc +++ b/src/cpp/src/SIO/SIOTrackHandler.cc @@ -50,7 +50,7 @@ namespace SIO { SIO_DATA( device , &(trk->_ndf) , 1 ) ; SIO_DATA( device , &(trk->_dEdx) , 1 ) ; SIO_DATA( device , &(trk->_dEdxError) , 1 ) ; - if (vers >= SIO_VERSION_ENCODE(2, 21) { + if (vers >= SIO_VERSION_ENCODE(2, 21)) { SIO_DATA( device , &(trk->_nholes) , 1 ) ; } SIO_DATA( device , &( trk->_radiusOfInnermostHit ) , 1 ) ; @@ -60,11 +60,13 @@ namespace SIO { for( int i=0 ; i_subdetectorHitNumbers[i] ), 1 ) ; } - int nHoleNumbers ; - SIO_DATA( device, &nHoleNumbers , 1 ) ; - trk->subdetectorHoleNumbers().resize( nHoleNumbers ) ; - for( int i=0 ; i_subdetectorHoleNumbers[i] ), 1 ) ; + if (vers >= SIO_VERSION_ENCODE(2, 21)) { + int nHoleNumbers ; + SIO_DATA( device, &nHoleNumbers , 1 ) ; + trk->subdetectorHoleNumbers().resize( nHoleNumbers ) ; + for( int i=0 ; i_subdetectorHoleNumbers[i] ), 1 ) ; + } } int nTracks ; SIO_DATA( device, &nTracks , 1 ) ; From 10a1c3e627b7a1458c4131ba5496b91d13dc266c Mon Sep 17 00:00:00 2001 From: Federico Meloni Date: Tue, 28 May 2024 10:33:44 +0200 Subject: [PATCH 10/12] Version checks in SIOTrack.java --- src/java/hep/lcio/implementation/sio/SIOTrack.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/java/hep/lcio/implementation/sio/SIOTrack.java b/src/java/hep/lcio/implementation/sio/SIOTrack.java index 1ef2bec1b..5ce01f0a9 100644 --- a/src/java/hep/lcio/implementation/sio/SIOTrack.java +++ b/src/java/hep/lcio/implementation/sio/SIOTrack.java @@ -89,13 +89,15 @@ class SIOTrack extends ITrack hitNumbers[i] = in.readInt() ; } setSubdetectorHitNumbers(hitNumbers) ; - int nHoleNumbers = in.readInt() ; - int[] holeNumbers = new int[nHoleNumbers] ; - for (int i = 0; i < nHoleNumbers; i++) - { - holeNumbers[i] = in.readInt() ; + if (SIOVersion.encode(major,minor) > SIOVersion.encode(2,21) { + int nHoleNumbers = in.readInt() ; + int[] holeNumbers = new int[nHoleNumbers] ; + for (int i = 0; i < nHoleNumbers; i++) + { + holeNumbers[i] = in.readInt() ; + } + setSubdetectorHoleNumbers(holeNumbers) ; } - setSubdetectorHoleNumbers(holeNumbers) ; int nTracks = in.readInt(); tempTracks = new ArrayList(nTracks); tracks = null; From 51bdf3e659437c3e719b39fbcf7ba25627eff310 Mon Sep 17 00:00:00 2001 From: Federico Meloni Date: Tue, 28 May 2024 11:40:43 +0200 Subject: [PATCH 11/12] Version check with > for SIOTrackHandler.cc --- src/cpp/src/SIO/SIOTrackHandler.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cpp/src/SIO/SIOTrackHandler.cc b/src/cpp/src/SIO/SIOTrackHandler.cc index a3d2d01d9..ef71de027 100644 --- a/src/cpp/src/SIO/SIOTrackHandler.cc +++ b/src/cpp/src/SIO/SIOTrackHandler.cc @@ -50,7 +50,7 @@ namespace SIO { SIO_DATA( device , &(trk->_ndf) , 1 ) ; SIO_DATA( device , &(trk->_dEdx) , 1 ) ; SIO_DATA( device , &(trk->_dEdxError) , 1 ) ; - if (vers >= SIO_VERSION_ENCODE(2, 21)) { + if (vers > SIO_VERSION_ENCODE(2, 21)) { SIO_DATA( device , &(trk->_nholes) , 1 ) ; } SIO_DATA( device , &( trk->_radiusOfInnermostHit ) , 1 ) ; @@ -60,7 +60,7 @@ namespace SIO { for( int i=0 ; i_subdetectorHitNumbers[i] ), 1 ) ; } - if (vers >= SIO_VERSION_ENCODE(2, 21)) { + if (vers > SIO_VERSION_ENCODE(2, 21)) { int nHoleNumbers ; SIO_DATA( device, &nHoleNumbers , 1 ) ; trk->subdetectorHoleNumbers().resize( nHoleNumbers ) ; From 9d88fd86074f3532b1de21ff84d61c8fe7ae81eb Mon Sep 17 00:00:00 2001 From: Federico Meloni Date: Wed, 29 May 2024 21:02:35 +0200 Subject: [PATCH 12/12] version bump --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index bc25cd37c..2f3b15300 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,8 +12,8 @@ include(GNUInstallDirs) # project version SET( LCIO_VERSION_MAJOR 2 ) -SET( LCIO_VERSION_MINOR 21 ) -SET( LCIO_VERSION_PATCH 0 ) +SET( LCIO_VERSION_MINOR 22 ) +SET( LCIO_VERSION_PATCH 99 ) ### set correct LCIO version in relevant files ############################