--- DarthVader/OrbitalInfo/src/OrbitalInfo.cpp 2014/03/28 20:47:15 1.16 +++ DarthVader/OrbitalInfo/src/OrbitalInfo.cpp 2014/10/15 12:06:49 1.17 @@ -61,6 +61,16 @@ if ( !OrbitalInfoTrk ) OrbitalInfoTrk = new TClonesArray("OrbitalInfoTrkVar",2); //ELENA} // if ( !Iij ) Iij = new TMatrixD(3,3); }//ELENA +//-------------------------------------- +// +// +//-------------------------------------- +void OrbitalInfo::SetTrackArray(TClonesArray *track){//ELENA +// if(track && strcmp(track->GetClass()->GetName(),"OrbitalInfoTrkVar")==0){ + if(OrbitalInfoTrk)OrbitalInfoTrk->Clear("C"); + OrbitalInfoTrk = track; +// } +} OrbitalInfoTrkVar *OrbitalInfo::GetOrbitalInfoTrkVar(Int_t itrk){ // @@ -75,6 +85,32 @@ OrbitalInfoTrkVar *orbtrack = (OrbitalInfoTrkVar*)t[itrk]; return orbtrack; } +/** + * Retrieves the tof track matching the seqno-th tracker stored track. + * + */ +OrbitalInfoTrkVar *OrbitalInfo::GetOrbitalInfoStoredTrack(int seqno){ + + if( ntrk()==0 ){ + printf("OrbitalInfo::GetOrbitalInfoStoredTrack(int) : requested tracker SeqNo %i but no OrbitalInforimeter tracks are stored\n",seqno); + return NULL; + }; + + OrbitalInfoTrkVar *c = 0; + Int_t it_tof=0; + + do { + c = GetOrbitalInfoTrkVar(it_tof); + it_tof++; + } while( c && seqno != c->trkseqno && it_tof < ntrk()); + + if(!c || seqno != c->trkseqno){ + c = 0; + if(seqno!=-1 ) printf("OrbitalInfo::GetOrbitalInfoStoredTrack(int) : requested tracker SeqNo %i does not match OrbitalInfo stored tracks\n",seqno); + }; + return c; + +} void OrbitalInfo::Clear(Option_t *t){ //