diff --git a/reco/L1/CbmL1.cxx b/reco/L1/CbmL1.cxx index 3be7a99a57c096319f77e64a777ed9ff947d6baf..0687c0be7bced5b2fa5b850b8360cbcb1359cce2 100644 --- a/reco/L1/CbmL1.cxx +++ b/reco/L1/CbmL1.cxx @@ -1126,8 +1126,8 @@ void CbmL1::Reconstruct(CbmEvent* event) if (fSTAPDataMode >= 2) { // 2,3 fData->ReadHitsFromFile(fSTAPDataDir.Data(), 1, fVerbose); - algo->SetData(fData->GetStsHits(), fData->GetNStsStrips(), fData->GetStsZPos(), fData->GetSFlag(), - fData->GetStsHitsStartIndex(), fData->GetStsHitsStopIndex()); + algo->SetData(fData->GetStsHits(), fData->GetNStsStrips(), fData->GetSFlag(), fData->GetStsHitsStartIndex(), + fData->GetStsHitsStopIndex()); } else { ReadEvent(fData, TsStart, TsLength, TsOverlap, FstHitinTs, newTS, event); @@ -1135,7 +1135,7 @@ void CbmL1::Reconstruct(CbmEvent* event) if (0) { // correct hits on MC // dbg TRandom3 random; - L1Vector<int> strips("CbmL1::strips"), zP("CbmL1::zP"); + L1Vector<int> strips("CbmL1::strips"); for (unsigned int iH = 0; iH < (*algo->vStsHits).size(); ++iH) { L1Hit& h = const_cast<L1Hit&>((*algo->vStsHits)[iH]); #ifdef USE_EVENT_NUMBER @@ -1164,11 +1164,6 @@ void CbmL1::Reconstruct(CbmEvent* event) algo->NStsStrips++; } strips.push_back(h.b); - if (std::find(zP.begin(), zP.end(), h.iz) != zP.end()) { // TODO why do we need it??gives prob=0 - h.iz = algo->vStsZPos->size(); - algo->vStsZPos->push_back(0.f); - } - zP.push_back(h.iz); double u = mcp.x * sta.frontInfo.cos_phi[0] + mcp.y * sta.frontInfo.sin_phi[0]; double v = mcp.x * sta.backInfo.cos_phi[0] + mcp.y * sta.backInfo.sin_phi[0]; @@ -1182,7 +1177,7 @@ void CbmL1::Reconstruct(CbmEvent* event) #endif h.u = u; h.v = v; - const_cast<float&>((*algo->vStsZPos)[h.iz]) = mcp.z; + h.z = mcp.z; } } @@ -1618,16 +1613,6 @@ void CbmL1::WriteSTAPAlgoData() // must be called after ReadEvent cout << "vStsStrips[" << n << "]" << " have been written." << endl; } - // write vStsZPos - n = (*algo->vStsZPos).size(); - fadata << n << endl; - for (int i = 0; i < n; i++) { - fadata << (*algo->vStsZPos)[i] << endl; - }; - if (fVerbose >= 4) { - cout << "vStsZPos[" << n << "]" - << " have been written." << endl; - } // write fStripFlag n = (*algo->fStripFlag).size(); fadata << n << endl; @@ -1654,7 +1639,7 @@ void CbmL1::WriteSTAPAlgoData() // must be called after ReadEvent #ifdef USE_EVENT_NUMBER fadata << static_cast<unsigned short int>(h.n) << " "; #endif - fadata << static_cast<int>(h.iz) << " "; + fadata << h.z << " "; fadata << h.u << " "; fadata << h.v << " "; // fadata << (*algo->vStsHits)[i].time << endl; @@ -1877,7 +1862,6 @@ void CbmL1::ReadSTAPAlgoData() if (algo->vStsHits) algo->vStsHits->clear(); algo->NStsStrips = 0; - if (algo->vStsZPos) algo->vStsZPos->clear(); if (algo->fStripFlag) algo->fStripFlag->clear(); // check correct position in file @@ -1896,17 +1880,6 @@ void CbmL1::ReadSTAPAlgoData() cout << "vStsStrips[" << n << "]" << " have been read." << endl; } - // read algo->vStsZPos - fadata >> n; - for (int i = 0; i < n; i++) { - fscal element; - fadata >> element; - algo->vStsZPos->push_back(element); - } - if (fVerbose >= 4) { - cout << "vStsZPos[" << n << "]" - << " have been read." << endl; - } // read algo->fStripFlag fadata >> n; for (int i = 0; i < n; i++) { @@ -1923,13 +1896,11 @@ void CbmL1::ReadSTAPAlgoData() int element_f; // for convert int element_b; int element_n; - int element_iz; for (int i = 0; i < n; i++) { L1Hit element; - fadata >> element_f >> element_b >> element_n >> element_iz >> element.u >> element.v >> element.t; + fadata >> element_f >> element_b >> element_n >> element.z >> element.u >> element.v >> element.t; element.f = static_cast<THitI>(element_f); element.b = static_cast<THitI>(element_b); - element.iz = static_cast<TZPosI>(element_iz); algo->vStsHits->push_back(element); } if (fVerbose >= 4) { diff --git a/reco/L1/CbmL1ReadEvent.cxx b/reco/L1/CbmL1ReadEvent.cxx index 4a2bca850c69cf773644e22c4cc65fd76de5478f..cdc456c5805a6f325510322d720730730cee86f2 100644 --- a/reco/L1/CbmL1ReadEvent.cxx +++ b/reco/L1/CbmL1ReadEvent.cxx @@ -65,11 +65,11 @@ struct TmpHit { // used for sort Hits before writing in the normal arrays int iStation; int ExtIndex; // index of hit in the TClonesArray array ( negative for MVD ) double u_front, u_back; // positions of strips - double x, y; // position of hit + double x, y, z; // position of hit double dx, dy, dxy; double du, dv; int iMC; // index of MCPoint in the vMCPoints array - double time, dt, z; + double time, dt; int Det; int id; int track; @@ -167,8 +167,9 @@ void CbmL1::ReadEvent(L1AlgoInputData* fData_, float& TsStart, float& TsLength, if (!ReadMCPoint(&MC, iMC, iFile, iEvent, 1)) { MC.iStation = -1; L1Station* sta = algo->vStations; - for (Int_t iSt = 0; iSt < NStsStations; iSt++) + for (Int_t iSt = 0; iSt < NStsStations; iSt++) { MC.iStation = (MC.z > sta[iSt].z[0] - 1) ? iSt : MC.iStation; + } Double_t dtrck = dFEI(iFile, iEvent, MC.ID); DFEI2I::iterator trk_it = dFEI2vMCTracks.find(dtrck); @@ -428,6 +429,7 @@ void CbmL1::ReadEvent(L1AlgoInputData* fData_, float& TsStart, float& TsLength, th.x = pos.X(); th.y = pos.Y(); + th.z = pos.Z(); L1Station& st = algo->vStations[th.iStation]; th.u_front = th.x * st.frontInfo.cos_phi[0] + th.y * st.frontInfo.sin_phi[0]; @@ -436,56 +438,19 @@ void CbmL1::ReadEvent(L1AlgoInputData* fData_, float& TsStart, float& TsLength, th.Det = 0; th.iMC = -1; int iMC = -1; - // int iMCTr = -1; - // if( listMvdHitMatches ){ - // CbmMvdHitMatch *match = (CbmMvdHitMatch*) listMvdHitMatches->At(j); - // if( match){ - // iMC = match->GetPointId(); - // iMCTr = match->GetTrackId(); - // } - // } if (fPerformance) { if (listMvdHitMatches) { CbmMatch* mvdHitMatch = L1_DYNAMIC_CAST<CbmMatch*>(listMvdHitMatches->At(j)); - - if (mvdHitMatch->GetNofLinks() > 0) if (mvdHitMatch->GetLink(0).GetIndex() < nMvdPoints) { iMC = mvdHitMatch->GetLink(0).GetIndex(); th.iMC = iMC; // th.track = iMC; +#ifdef MVDIDEALHITS +//TODO +#endif } } - // if( listMvdPts && iMC>=0 ){ // TODO1: don't need this with FairLinks - // CbmL1MCPoint MC; - // if( ! ReadMCPoint( &MC, iMC, 1 ) ){ - // MC.iStation = th.iStation; - // // isUsedMvdPoint[iMC] = 1; - // - // // MC.ID = iMCTr; // because atch->GetPointId() == 0 !!! and ReadMCPoint don't work - // // MC.z = th.iStation; // for sort in right order - // - // vMCPoints.push_back( MC ); - // nMvdPoints++; - // vMCPoints_in_Time_Slice.push_back(0); - // th.iMC = vMCPoints.size()-1; - // } - // Int_t iFile =-1; - // Int_t iEvent=-1; - // - // - // if ( !fTimesliceMode ) - // { - // iFile = vFileEvent.begin()->first; - // iEvent = vFileEvent.begin()->second; - // } - // - // Double_t dtrck =dFEI(iFile, iEvent, iMC); - // DFEI2I::iterator trk_it = dFEI2vMCPoints.find(dtrck); - // if (trk_it==dFEI2vMCPoints.end()) continue; - // iMC = trk_it->second; - // - // } // if listStsPts } //if( h.MC_Point >=0 ) // DEBUG !!!! { @@ -550,6 +515,7 @@ void CbmL1::ReadEvent(L1AlgoInputData* fData_, float& TsStart, float& TsLength, th.x = pos.X(); th.y = pos.Y(); + th.z = pos.Z(); th.dx = mh->GetDx(); th.dy = mh->GetDy(); @@ -603,10 +569,16 @@ void CbmL1::ReadEvent(L1AlgoInputData* fData_, float& TsStart, float& TsLength, } } } +#ifdef STSIDEALHITS + // TODO + // CbmStsPoint* point = L1_DYNAMIC_CAST<CbmStsPoint*>(listStsPts->At(s.ExtIndex)); + // h.z = 0.5 * (point->GetZOut() + point->GetZIn()); +#endif } - else + else { iMC = sh->GetRefId(); // TODO1: don't need this with FairLinks - } //fPerformance + } + } //fPerformance if (iMC > -1) { th.iMC = iMC; @@ -948,10 +920,6 @@ void CbmL1::ReadEvent(L1AlgoInputData* fData_, float& TsStart, float& TsLength, SortedIndex.reset(max(nEntSts, maxHitIndex)); - L1Vector<float> vStsZPos_temp( - "CbmL1ReadEvent::vStsZPos_temp"); // temp array for unsorted z positions of detectors segments - vStsZPos_temp.reserve(100 * NStation); - vStsHits.reserve(nHits); fData_->vStsHits.reserve(nHits); @@ -997,72 +965,8 @@ void CbmL1::ReadEvent(L1AlgoInputData* fData_, float& TsStart, float& TsLength, // h.q = th.q; // h.ista = th.iStation; - // find and save z positions - float z_tmp = -111.; - int ist = th.iStation; - if (ist < NMvdStations) { -#ifdef MVDIDEALHITS - CbmMvdPoint* point = L1_DYNAMIC_CAST<CbmMvdPoint*>(listMvdPts->At(-s.ExtIndex - 1)); - z_tmp = 0.5 * (point->GetZOut() + point->GetZ()); -#else - CbmMvdHit* mh_m = L1_DYNAMIC_CAST<CbmMvdHit*>(listMvdHits->At(-s.ExtIndex - 1)); - z_tmp = mh_m->GetZ(); -#endif - } + h.z = th.z; - if ((ist >= NMvdStations) && (ist < (NStsStations + NMvdStations))) { -#ifdef STSIDEALHITS - CbmStsPoint* point = L1_DYNAMIC_CAST<CbmStsPoint*>(listStsPts->At(s.ExtIndex)); - z_tmp = 0.5 * (point->GetZOut() + point->GetZIn()); -#else - CbmStsHit* mh_m = L1_DYNAMIC_CAST<CbmStsHit*>(listStsHits->At(s.ExtIndex)); - z_tmp = mh_m->GetZ(); -#endif - } - - if ((ist >= NStsStations + NMvdStations) && (ist < (NStsStations + NMvdStations + NMuchStations))) { - //#ifdef STSIDEALHITS - // CbmStsPoint* point = L1_DYNAMIC_CAST<CbmStsPoint*>(listStsPts->At(s.ExtIndex)); - // z_tmp = 0.5 * ( point->GetZOut() + point->GetZIn() ); - //#else - CbmMuchPixelHit* mh = static_cast<CbmMuchPixelHit*>(fMuchPixelHits->At(s.ExtIndex)); - z_tmp = mh->GetZ(); - //#endif - } - - if ((ist >= NStsStations + NMvdStations + NMuchStations) - && (ist < (NStsStations + NMvdStations + NMuchStations + NTrdStations))) { - //#ifdef STSIDEALHITS - // CbmStsPoint* point = L1_DYNAMIC_CAST<CbmStsPoint*>(listStsPts->At(s.ExtIndex)); - // z_tmp = 0.5 * ( point->GetZOut() + point->GetZIn() ); - //#else - CbmTrdHit* mh = static_cast<CbmTrdHit*>(listTrdHits->At(s.ExtIndex)); - z_tmp = mh->GetZ(); - //#endif - } - - if ((ist >= NStsStations + NMvdStations + NMuchStations + NTrdStations) - && (ist < (NStsStations + NMvdStations + NMuchStations + NTrdStations + NTOFStation))) { - //#ifdef STSIDEALHITS - // CbmStsPoint* point = L1_DYNAMIC_CAST<CbmStsPoint*>(listStsPts->At(s.ExtIndex)); - // z_tmp = 0.5 * ( point->GetZOut() + point->GetZIn() ); - //#else - CbmTofHit* mh = static_cast<CbmTofHit*>(fTofHits->At(s.ExtIndex)); - z_tmp = mh->GetZ(); - //#endif - } - - unsigned int k; - for (k = 0; k < vStsZPos_temp.size(); k++) { - if (vStsZPos_temp[k] == z_tmp) { - h.iz = k; - break; - } - } - if (k == vStsZPos_temp.size()) { - h.iz = vStsZPos_temp.size(); - vStsZPos_temp.push_back(z_tmp); - } // save hit vStsHits.push_back(CbmL1Hit(fData->vStsHits.size(), th.ExtIndex, th.Det)); @@ -1096,57 +1000,10 @@ void CbmL1::ReadEvent(L1AlgoInputData* fData_, float& TsStart, float& TsLength, fData_->StsHitsStartIndex[i] = fData_->StsHitsStopIndex[i]; } - if (fVerbose >= 10) cout << "ReadEvent: mvd and sts are saved." << endl; - // sort z-pos - if (vStsZPos_temp.size() != 0) { - L1Vector<float> vStsZPos_temp2("CbmL1ReadEvent::vStsZPos_temp2"); - vStsZPos_temp2.reserve(vStsZPos_temp.size()); - vStsZPos_temp2.push_back(vStsZPos_temp[0]); - - L1Vector<int> newToOldIndex("CbmL1ReadEvent::newToOldIndex"); - newToOldIndex.reserve(vStsZPos_temp.size()); - newToOldIndex.push_back(0); - - for (unsigned int k = 1; k < vStsZPos_temp.size(); k++) { - L1Vector<float>::iterator itpos = vStsZPos_temp2.begin() + 1; - L1Vector<int>::iterator iti = newToOldIndex.begin() + 1; - for (; itpos < vStsZPos_temp2.end(); itpos++, iti++) { - if (vStsZPos_temp[k] < *itpos) { - vStsZPos_temp2.insert(itpos, vStsZPos_temp[k]); - newToOldIndex.insert(iti, k); - break; - } - } - if (itpos == vStsZPos_temp2.end()) { - vStsZPos_temp2.push_back(vStsZPos_temp[k]); - newToOldIndex.push_back(k); - } - } // k - - if (fVerbose >= 10) cout << "ReadEvent: z-pos are sorted." << endl; - - fData_->vStsZPos.reserve(vStsZPos_temp2.size()); - for (unsigned int k = 0; k < vStsZPos_temp2.size(); k++) { - fData_->vStsZPos.push_back(vStsZPos_temp2[k]); - } - - int size_nto_tmp = newToOldIndex.size(); - L1Vector<int> oldToNewIndex("CbmL1ReadEvent::oldToNewIndex", size_nto_tmp); - for (int k = 0; k < size_nto_tmp; k++) { - oldToNewIndex[newToOldIndex[k]] = k; - } - int size_hs_tmp = vHitStore.size(); - for (int k = 0; k < size_hs_tmp; k++) { - fData_->vStsHits[k].iz = oldToNewIndex[fData_->vStsHits[k].iz]; - } - } - - if (fVerbose >= 10) cout << "ReadEvent: z-pos are saved." << endl; - - algo->SetData(fData_->GetStsHits(), fData_->GetNStsStrips(), fData_->GetStsZPos(), fData_->GetSFlag(), - fData_->GetStsHitsStartIndex(), fData_->GetStsHitsStopIndex()); + algo->SetData(fData_->GetStsHits(), fData_->GetNStsStrips(), fData_->GetSFlag(), fData_->GetStsHitsStartIndex(), + fData_->GetStsHitsStopIndex()); if (fPerformance) { diff --git a/reco/L1/L1Algo/L1Algo.cxx b/reco/L1/L1Algo/L1Algo.cxx index 81233e32dd29d20f303bec15a4f931520f7045a1..4e893a1596642a4df94e3d1bed1055ada8085152 100644 --- a/reco/L1/L1Algo/L1Algo.cxx +++ b/reco/L1/L1Algo/L1Algo.cxx @@ -223,13 +223,12 @@ void L1Algo::Init(const L1Vector<fscal>& geo, const bool UseHitErrors, const boo } -void L1Algo::SetData(L1Vector<L1Hit>& StsHits_, int nStsStrips_, L1Vector<fscal>& StsZPos_, - L1Vector<unsigned char>& SFlag_, const THitI* StsHitsStartIndex_, const THitI* StsHitsStopIndex_) +void L1Algo::SetData(L1Vector<L1Hit>& StsHits_, int nStsStrips_, L1Vector<unsigned char>& SFlag_, + const THitI* StsHitsStartIndex_, const THitI* StsHitsStopIndex_) { vStsHits = &StsHits_; NStsStrips = nStsStrips_; - vStsZPos = &StsZPos_; fStripFlag = &SFlag_; StsHitsStartIndex = StsHitsStartIndex_; @@ -292,10 +291,8 @@ void L1Algo::GetHitCoor(const L1Hit& _h, fscal& _x, fscal& _y, char iS) L1Station& sta = vStations[int(iS)]; fscal u = _h.u; fscal v = _h.v; - // const fscal &z = (*vStsZPos)[_h.iz]; - // fscal x, y; - _x = (sta.xInfo.sin_phi[0] * u + sta.xInfo.cos_phi[0] * v) / (*vStsZPos)[_h.iz]; - _y = (sta.yInfo.cos_phi[0] * u + sta.yInfo.sin_phi[0] * v) / (*vStsZPos)[_h.iz]; + _x = (sta.xInfo.sin_phi[0] * u + sta.xInfo.cos_phi[0] * v) / _h.z; + _y = (sta.yInfo.cos_phi[0] * u + sta.yInfo.sin_phi[0] * v) / _h.z; } void L1Algo::GetHitCoor(const L1Hit& _h, fscal& _x, fscal& _y, fscal& _z, const L1Station& sta) @@ -306,7 +303,7 @@ void L1Algo::GetHitCoor(const L1Hit& _h, fscal& _x, fscal& _y, fscal& _z, const StripsToCoor(u, v, x, y, sta); _x = x; _y = y; - _z = (*vStsZPos)[_h.iz]; + _z = _h.z; } void L1Algo::StripsToCoor( @@ -359,27 +356,16 @@ void L1Algo::StripsToCoor( y = sta.yInfo.cos_phi * u + sta.yInfo.sin_phi * v; } -/// full the hit point by hit information: takes hit as input (2 strips) and creates hit_point with all coordinates (x,y,z,u,v, n - event number); -L1HitPoint L1Algo::CreateHitPoint(const L1Hit& hit, char /*ista*/) -/// hit and station number +L1HitPoint L1Algo::CreateHitPoint(const L1Hit& hit) { - // L1Station& sta = vStations[int(ista)]; - const float& z = (*vStsZPos)[hit.iz]; - const float& time = hit.t; - return L1HitPoint(z, hit.u, hit.v, hit.du, hit.dv, time, hit.dt); + /// full the hit point by hit information: takes hit as input (2 strips) + /// and creates hit_point with all coordinates (x,y,z,u,v,t); + return L1HitPoint(hit.z, hit.u, hit.v, hit.du, hit.dv, hit.t, hit.dt); } -void L1Algo::CreateHitPoint(const L1Hit& hit, char /*ista*/, L1HitPoint& point) -/// hit and station number +void L1Algo::CreateHitPoint(const L1Hit& hit, L1HitPoint& point) { - // L1Station& sta = vStations[int(ista)]; - const float& z = (*vStsZPos)[hit.iz]; - const float& time = hit.t; - const float& du_ = hit.du; - const float& dv_ = hit.dv; - - point.Set(z, hit.u, hit.v, du_, dv_, time, hit.dt); - // point.Set(x,y,z,v.f,u.f, time, n1, hit.time1, 2.9 ); // TODO put correct time error from the hit + point.Set(hit.z, hit.u, hit.v, hit.du, hit.dv, hit.t, hit.dt); } // bool L1Algo::SortTrip(TripSort const& a, TripSort const& b) { diff --git a/reco/L1/L1Algo/L1Algo.h b/reco/L1/L1Algo/L1Algo.h index b6798a39fdaccb540a8817289191f4407be291ed..7f5aa238c4b73a056df0edef8ccc51ad91b33764 100644 --- a/reco/L1/L1Algo/L1Algo.h +++ b/reco/L1/L1Algo/L1Algo.h @@ -135,7 +135,7 @@ public: void Init(const L1Vector<fscal>& geo, const bool UseHitErrors, const bool mCBMmode); - void SetData(L1Vector<L1Hit>& StsHits_, int nStsStrips_, L1Vector<fscal>& StsZPos_, L1Vector<unsigned char>& SFlag_, + void SetData(L1Vector<L1Hit>& StsHits_, int nStsStrips_, L1Vector<unsigned char>& SFlag_, const THitI* StsHitsStartIndex_, const THitI* StsHitsStopIndex_); void PrintHits(); @@ -170,7 +170,6 @@ public: L1Vector<L1Material> fRadThick {"fRadThick"}; // material for each station int NStsStrips {0}; // number of strips - L1Vector<fscal>* vStsZPos {nullptr}; // all possible z-positions of hits L1Vector<L1Hit>* vStsHits {nullptr}; // hits as a combination of front-, backstrips and z-position L1Grid vGrid[MaxNStations]; // hits as a combination of front-, backstrips and z-position L1Grid vGridTime[MaxNStations]; @@ -302,10 +301,9 @@ public: void StripsToCoor(const fscal& u, const fscal& v, fvec& x, fvec& y, const L1Station& sta) const; // convert strip positions to coordinates void StripsToCoor(const fvec& u, const fvec& v, fvec& x, fvec& y, const L1Station& sta) const; - L1HitPoint CreateHitPoint(const L1Hit& hit, - char ista); // full the hit point by hit information. + L1HitPoint CreateHitPoint(const L1Hit& hit); // full the hit point by hit information. - void CreateHitPoint(const L1Hit& hit, char ista, L1HitPoint& point); + void CreateHitPoint(const L1Hit& hit, L1HitPoint& point); inline int PackIndex(const int& a, const int& b, const int& c); inline int UnPackIndex(const int& i, int& a, int& b, int& c); diff --git a/reco/L1/L1Algo/L1CATrackFinder.cxx b/reco/L1/L1Algo/L1CATrackFinder.cxx index 5108201d93f4c465874723b41dd3bf1f58a3ee09..ee530ed33ea7fe576c423783f335921a35378b94 100644 --- a/reco/L1/L1Algo/L1CATrackFinder.cxx +++ b/reco/L1/L1Algo/L1CATrackFinder.cxx @@ -950,7 +950,7 @@ inline void L1Algo::f32( // input // TODO not updated after gaps introduction u[ih] = hit.u; v[ih] = hit.v; StripsToCoor(u[ih], v[ih], x[ih], y[ih], sta[ih]); - z[ih] = (*vStsZPos)[hit.iz]; + z[ih] = hit.z; }; // initialize parameters @@ -1722,7 +1722,7 @@ void L1Algo::CATrackFinder() #pragma omp parallel for schedule(dynamic, 5) #endif for (THitI ih = StsHitsStartIndex[ista]; ih < StsHitsStopIndex[ista]; ++ih) { - CreateHitPoint(vStsDontUsedHits_Buf[ih], ista, vStsDontUsedHitsxy_B[ih]); + CreateHitPoint(vStsDontUsedHits_Buf[ih], vStsDontUsedHitsxy_B[ih]); } } @@ -2322,7 +2322,7 @@ void L1Algo::CATrackFinder() const L1Hit& hit = (*vStsHits)[*phIt]; - L1HitPoint tempPoint = CreateHitPoint(hit, 0); //TODO take number of station from hit + L1HitPoint tempPoint = CreateHitPoint(hit); //TODO take number of station from hit float xcoor, ycoor = 0; L1Station stah = vStations[0]; diff --git a/reco/L1/L1Algo/L1Hit.h b/reco/L1/L1Algo/L1Hit.h index 472ce181777767f0fa12250ff4ebbd693cc90ab5..4852b0db033c99b1ba3b23cd259cea320493c1c3 100644 --- a/reco/L1/L1Algo/L1Hit.h +++ b/reco/L1/L1Algo/L1Hit.h @@ -13,7 +13,6 @@ #define L1Hit_h typedef unsigned /*short*/ int THitI; // hit index type -typedef unsigned short int TZPosI; // strip z-coor index type typedef unsigned /*short*/ int TStripI; // strip index type /// @@ -24,12 +23,12 @@ struct L1Hit { TStripI b = 0; // back strip index float u = 0.f; // measured U coordinate float v = 0.f; // measured V coordinate + float t = 0.f; // measured time + float z = 0.f; // fixed Z coordinate float du = 0.f; // mean squared error of u float dv = 0.f; // mean squared error of v - float t = 0.f; // measured time float dt = 0.f; // mean squared error of t int ID = 0; // TODO: check if this ID is redundant - TZPosI iz = 0; // index of z coordinate in L1Algo::vStsZPos }; #endif diff --git a/reco/L1/L1Algo/L1TrackExtender.cxx b/reco/L1/L1Algo/L1TrackExtender.cxx index afb5d127407377c53450cf75af12ecb6ee58106c..bc9fddc3d9cf300a374078c572d52be1d16281d7 100644 --- a/reco/L1/L1Algo/L1TrackExtender.cxx +++ b/reco/L1/L1Algo/L1TrackExtender.cxx @@ -56,19 +56,19 @@ void L1Algo::BranchFitterFast(const L1Branch& t, L1TrackPar& T, const bool dir, fvec v0 = hit0.v; fvec x0, y0; StripsToCoor(u0, v0, x0, y0, sta0); - fvec z0 = (*vStsZPos)[hit0.iz]; + fvec z0 = hit0.z; fvec u1 = hit1.u; fvec v1 = hit1.v; fvec x1, y1; StripsToCoor(u1, v1, x1, y1, sta1); - fvec z1 = (*vStsZPos)[hit1.iz]; + fvec z1 = hit1.z; fvec u2 = hit2.u; fvec v2 = hit2.v; fvec x2, y2; StripsToCoor(u2, v2, x2, y2, sta2); - // fvec z2 = (*vStsZPos)[hit2.iz]; + // fvec z2 = hit2.z; fvec dzi = 1. / (z1 - z0); @@ -128,14 +128,14 @@ void L1Algo::BranchFitterFast(const L1Branch& t, L1TrackPar& T, const bool dir, L1Station& sta = vStations[ista]; - float z_sta = (*vStsZPos)[hit.iz]; + float z_sta = hit.z; fvec dz = z_sta - T.z; #if defined(mCBM) || defined(GLOBAL) - L1ExtrapolateLine(T, (*vStsZPos)[hit.iz]); + L1ExtrapolateLine(T, hit.z); #else - L1Extrapolate(T, (*vStsZPos)[hit.iz], qp0, fld); + L1Extrapolate(T, hit.z, qp0, fld); #endif L1ExtrapolateTime(T, dz); @@ -318,7 +318,7 @@ void L1Algo::FindMoreHits(L1Branch& t, L1TrackPar& T, const bool dir, fvec v = hit.v; fvec x, y, z; StripsToCoor(u, v, x, y, sta); - z = (*vStsZPos)[hit.iz]; + z = hit.z; fvec dz1 = z - T.z; diff --git a/reco/L1/L1Algo/L1TrackFitter.cxx b/reco/L1/L1Algo/L1TrackFitter.cxx index e2fe29694d4c1fe45a9f71c0a75990dacb644903..bfbfd7358354f002220494a2f3e68add58e00f6f 100644 --- a/reco/L1/L1Algo/L1TrackFitter.cxx +++ b/reco/L1/L1Algo/L1TrackFitter.cxx @@ -69,19 +69,19 @@ void L1Algo::KFTrackFitter_simple() // TODO: Add pipe. fvec v0 = hit0.v; fvec x0, y0; StripsToCoor(u0, v0, x0, y0, sta0); - fvec z0 = (*vStsZPos)[hit0.iz]; + fvec z0 = hit0.z; fvec u1 = hit1.u; fvec v1 = hit1.v; fvec x1, y1; StripsToCoor(u1, v1, x1, y1, sta1); - fvec z1 = (*vStsZPos)[hit1.iz]; + fvec z1 = hit1.z; fvec u2 = hit2.u; fvec v2 = hit2.v; fvec x2, y2; StripsToCoor(u2, v2, x2, y2, sta2); - // fvec z2 = (*vStsZPos)[hit2.iz]; + // fvec z2 = hit2.z; fvec dzi = 1. / (z1 - z0); @@ -126,13 +126,13 @@ void L1Algo::KFTrackFitter_simple() // TODO: Add pipe. //cout<<"\nfit, iter=:"<<iter<<endl; for (int i = nHits - 2; i >= 0; i--) { // if( fabs(T.qp[0])>2. ) break; // iklm. Don't know it need for - const L1Hit& hit = (*vStsHits)[hits[i]]; - ista = (*fStripFlag)[hit.f] / 4; + const L1Hit& hit = (*vStsHits)[hits[i]]; + ista = (*fStripFlag)[hit.f] / 4; L1Station& sta = vStations[ista]; - // L1Extrapolate( T, (*vStsZPos)[hit.iz], qp0, fld ); - L1ExtrapolateLine(T, (*vStsZPos)[hit.iz]); + // L1Extrapolate( T, hit.z, qp0, fld ); + L1ExtrapolateLine(T, hit.z); // T.L1Extrapolate( sta.z, qp0, fld ); // L1Extrapolate( T, hit.z, qp0, fld ); #ifdef USE_RL_TABLE @@ -209,19 +209,18 @@ void L1Algo::KFTrackFitter_simple() // TODO: Add pipe. fvec v0 = hit0.v; fvec x0, y0; StripsToCoor(u0, v0, x0, y0, sta0); - fvec z0 = (*vStsZPos)[hit0.iz]; - + fvec z0 = hit0.z; fvec u1 = hit1.u; fvec v1 = hit1.v; fvec x1, y1; StripsToCoor(u1, v1, x1, y1, sta1); - // fvec z1 = (*vStsZPos)[hit1.iz]; + // fvec z1 = hit1.z; fvec u2 = hit2.u; fvec v2 = hit2.v; fvec x2, y2; StripsToCoor(u2, v2, x2, y2, sta2); - // fvec z2 = (*vStsZPos)[hit2.iz]; + // fvec z2 = hit2.z; // fvec dzi = 1./(z1-z0); @@ -262,16 +261,16 @@ void L1Algo::KFTrackFitter_simple() // TODO: Add pipe. int ista = ista2; for (int i = 1; i < nHits; i++) { - const L1Hit& hit = (*vStsHits)[hits[i]]; - ista = (*fStripFlag)[hit.f] / 4; - L1Station& sta = vStations[ista]; - fvec u = hit.u; - fvec v = hit.v; + const L1Hit& hit = (*vStsHits)[hits[i]]; + ista = (*fStripFlag)[hit.f] / 4; + L1Station& sta = vStations[ista]; + fvec u = hit.u; + fvec v = hit.v; fvec x, y; StripsToCoor(u, v, x, y, sta); - // L1Extrapolate( T, (*vStsZPos)[hit.iz], qp0, fld ); - L1ExtrapolateLine(T, (*vStsZPos)[hit.iz]); + // L1Extrapolate( T, hit.z, qp0, fld ); + L1ExtrapolateLine(T, hit.z); // T.L1Extrapolate( sta.z, qp0, fld ); // L1Extrapolate( T, hit.z, qp0, fld ); #ifdef USE_RL_TABLE @@ -387,10 +386,10 @@ void L1Algo::L1KFTrackFitter() int nHitsTrack = t[iVec]->NHits; int iSta[MaxNStations]; for (i = 0; i < nHitsTrack; i++) { - const L1Hit& hit = (*vStsHits)[fRecoHits[start_hit++]]; - const int ista = (*fStripFlag)[hit.f] / 4; - iSta[i] = ista; - w[ista][iVec] = 1.; + const L1Hit& hit = (*vStsHits)[fRecoHits[start_hit++]]; + const int ista = (*fStripFlag)[hit.f] / 4; + iSta[i] = ista; + w[ista][iVec] = 1.; if (ista > NMvdStations) w_time[ista][iVec] = 1.; u[ista][iVec] = hit.u; @@ -402,7 +401,7 @@ void L1Algo::L1KFTrackFitter() y[ista][iVec] = y_temp[iVec]; time[ista][iVec] = hit.t; timeEr[ista][iVec] = hit.dt; - z[ista][iVec] = (*vStsZPos)[hit.iz]; + z[ista][iVec] = hit.z; sta[ista].fieldSlice.GetFieldValue(x[ista], y[ista], fB_temp); dUdV_to_dX(d_u[ista], d_v[ista], d_x[ista], sta[ista]); dUdV_to_dY(d_u[ista], d_v[ista], d_y[ista], sta[ista]); @@ -816,8 +815,8 @@ void L1Algo::L1KFTrackFitterMuch() int nHitsTrack = t[iVec]->NHits; int nHitsTrackSts = 0; for (i = 0; i < nHitsTrack; i++) { - const L1Hit& hit = (*vStsHits)[fRecoHits[start_hit++]]; - const int ista = (*fStripFlag)[hit.f] / 4; + const L1Hit& hit = (*vStsHits)[fRecoHits[start_hit++]]; + const int ista = (*fStripFlag)[hit.f] / 4; if (ista < 8) nHitsTrackSts++; iSta[i] = ista; w[ista][iVec] = 1.; @@ -838,7 +837,7 @@ void L1Algo::L1KFTrackFitterMuch() dUdV_to_dY(d_u[ista], d_v[ista], d_y[ista], sta[ista]); dUdV_to_dXdY(d_u[ista], d_v[ista], d_xy[ista], sta[ista]); // mom[ista][iVec] = hit.p; - z[ista][iVec] = (*vStsZPos)[hit.iz]; + z[ista][iVec] = hit.z; sta[ista].fieldSlice.GetFieldValue(x[ista], y[ista], fB_temp); fB[ista].x[iVec] = fB_temp.x[iVec]; fB[ista].y[iVec] = fB_temp.y[iVec]; diff --git a/reco/L1/L1AlgoInputData.cxx b/reco/L1/L1AlgoInputData.cxx index 677221fba3fb321a514202b06fa9a607187a4bd1..cd782e207be131610bc9b8ecad797c167008e987 100644 --- a/reco/L1/L1AlgoInputData.cxx +++ b/reco/L1/L1AlgoInputData.cxx @@ -11,14 +11,14 @@ using std::ios; /* L1AlgoInputData::L1AlgoInputData( const L1AlgoInputData& a) { - SetData( a.GetStsHits(), a.GetStsStrips(), a.GetStsStripsB(), a.GetStsZPos(), + SetData( a.GetStsHits(), a.GetStsStrips(), a.GetStsStripsB(), a.GetSFlag(), a.GetSFlagB(), a.GetStsHitsStartIndex(), a.GetStsHitsStopIndex()); } const L1AlgoInputData& L1AlgoInputData::operator=( const L1AlgoInputData& a) { - SetData( a.GetStsHits(), a.GetStsStrips(), a.GetStsStripsB(), a.GetStsZPos(), + SetData( a.GetStsHits(), a.GetStsStrips(), a.GetStsStripsB(), a.GetSFlag(), a.GetSFlagB(), a.GetStsHitsStartIndex(), a.GetStsHitsStopIndex()); return a; } @@ -27,7 +27,6 @@ const L1AlgoInputData& L1AlgoInputData::operator=( const L1AlgoInputData& a) void L1AlgoInputData::SetData( const vector< L1Hit > & StsHits_, const vector< L1Strip > & StsStrips_, const vector< L1Strip > & StsStripsB_, - const vector< fscal > & StsZPos_, const vector< unsigned char > & SFlag_, const vector< unsigned char > & SFlagB_, const THitI* StsHitsStartIndex_, @@ -36,7 +35,6 @@ void L1AlgoInputData::SetData( const vector< L1Hit > & StsHits_, vStsHits.resize(StsHits_.size()); vStsStrips.resize(StsStrips_.size()); vStsStripsB.resize(StsStripsB_.size()); - vStsZPos.resize(StsZPos_.size()); fStripFlag.resize(SFlag_.size()); fStripFlagB.resize(SFlagB_.size()); @@ -44,8 +42,7 @@ void L1AlgoInputData::SetData( const vector< L1Hit > & StsHits_, } for(unsigned int i=0; i<StsStrips_.size(); ++i ) vStsStrips[i] = StsStrips_[i]; - for(unsigned int i=0; i<StsStripsB_.size(); ++i ) vStsStripsB[i] = StsStripsB_[i]; - for(unsigned int i=0; i<StsZPos_.size(); ++i ) vStsZPos[i] = StsZPos_[i]; + for(unsigned int i=0; i<StsStripsB_.size(); ++i ) vStsStripsB[i] = StsStripsB_[i]; for(unsigned int i=0; i<SFlag_.size(); ++i ) fStripFlag[i] = SFlag_[i]; for(unsigned int i=0; i<SFlagB_.size(); ++i ) fStripFlagB[i] = SFlagB_[i]; @@ -86,7 +83,6 @@ bool L1AlgoInputData::ReadHitsFromFile(const char work_dir[100], const int maxNE vStsHits.clear(); NStsStrips = 0; - vStsZPos.clear(); fStripFlag.clear(); // check correct position in file @@ -108,18 +104,6 @@ bool L1AlgoInputData::ReadHitsFromFile(const char work_dir[100], const int maxNE cout << "vStsStrips[" << n << "]" << " have been read." << endl; } - // read algo->vStsZPos - fadata >> n; - // cout << n<< " vStsZPos"<<endl; - for (int i = 0; i < n; i++) { - fscal element; - fadata >> element; - vStsZPos.push_back(element); - } - if (iVerbose >= 4) { - cout << "vStsZPos[" << n << "]" - << " have been read." << endl; - } // read algo->fStripFlag fadata >> n; // cout << n<< " fStripFlagB"<<endl; @@ -139,16 +123,14 @@ bool L1AlgoInputData::ReadHitsFromFile(const char work_dir[100], const int maxNE int element_f; // for convert int element_b; int element_n; - int element_iz; for (int i = 0; i < n; i++) { L1Hit element; - fadata >> element_f >> element_b >> element_n >> element_iz >> element.u >> element.v >> element.t; + fadata >> element_f >> element_b >> element_n >> element.z >> element.u >> element.v >> element.t; element.f = static_cast<THitI>(element_f); element.b = static_cast<THitI>(element_b); #ifdef USE_EVENT_NUMBER element.n = static_cast<unsigned short int>(element_n); #endif - element.iz = static_cast<TZPosI>(element_iz); vStsHits.push_back(element); } if (iVerbose >= 4) { @@ -200,11 +182,6 @@ void L1AlgoInputData::PrintHits() std::cout << vStsStripsB[i] << std::endl; } - n = vStsZPos.size(); - std::cout << n << std::endl; - for (int i = 0; i < n; i++){ - std::cout << vStsZPos[i] << std::endl; - } n = fStripFlag.size(); std::cout << n << std::endl; @@ -223,7 +200,7 @@ void L1AlgoInputData::PrintHits() for (int i = 0; i < n; i++){ std::cout << static_cast<int>(vStsHits[i].f) << " "; std::cout << static_cast<int>(vStsHits[i].b) << " "; - std::cout << static_cast<int>(vStsHits[i].iz) << std::endl; + std::cout << (vStsHits[i].z) << std::endl; } n = 20; diff --git a/reco/L1/L1AlgoInputData.h b/reco/L1/L1AlgoInputData.h index 2fbfd1d0f1782b023f1d56b490d1f9e5c6bb739e..6b21c9c59987fdc0e36e474a2e41ea8dcdb1bcb4 100644 --- a/reco/L1/L1AlgoInputData.h +++ b/reco/L1/L1AlgoInputData.h @@ -22,7 +22,6 @@ public: L1Vector<L1Hit>& GetStsHits() { return vStsHits; } int GetNStsStrips() const { return NStsStrips; } - L1Vector<fscal>& GetStsZPos() { return vStsZPos; } L1Vector<unsigned char>& GetSFlag() { return fStripFlag; } const THitI* GetStsHitsStartIndex() const { return StsHitsStartIndex; } const THitI* GetStsHitsStopIndex() const { return StsHitsStopIndex; } @@ -48,7 +47,6 @@ public: vStsHits.clear(); NStsStrips = 0; - vStsZPos.clear(); fStripFlag.clear(); { @@ -71,7 +69,6 @@ public: }; L1Vector<L1Hit> vStsHits {"L1AlgoInputData::vStsHits"}; // hits as a combination of front-, backstrips and z-position int NStsStrips {0}; // Number of strips in sts - L1Vector<fscal> vStsZPos {"L1AlgoInputData::vStsZPos"}; // all possible z-positions of hits L1Vector<unsigned char> fStripFlag { "L1AlgoInputData::fStripFlag"}; // information of hits station & using hits in tracks;