diff --git a/reco/detectors/trd/CbmTrdModuleRecR.cxx b/reco/detectors/trd/CbmTrdModuleRecR.cxx index 48ff955921b5fb70a5b0404e71bfe69fe3939b0a..274d36e619014c7b9bb8bcec986022d3afdbe9e4 100644 --- a/reco/detectors/trd/CbmTrdModuleRecR.cxx +++ b/reco/detectors/trd/CbmTrdModuleRecR.cxx @@ -33,14 +33,13 @@ using std::vector; //_______________________________________________________________________________ CbmTrdModuleRecR::CbmTrdModuleRecR() - : CbmTrdModuleRec(), fDigiCounter(0), fDigiMap(), fClusterMap() { + : CbmTrdModuleRec(), fDigiCounter(0), fDigiMap(), fClusterMap() { SetNameTitle("TrdModuleRecR", "Reconstructor for rectangular pad TRD module"); } //_______________________________________________________________________________ CbmTrdModuleRecR::CbmTrdModuleRecR(Int_t mod, Int_t ly, Int_t rot) - : CbmTrdModuleRec(mod, ly, rot), fDigiCounter(0), fDigiMap(), - fClusterMap() { + : CbmTrdModuleRec(mod, ly, rot), fDigiCounter(0), fDigiMap(), fClusterMap() { SetNameTitle(Form("TrdModuleRecR%02d", mod), "Reconstructor for rectangular pad TRD module"); } @@ -49,7 +48,7 @@ CbmTrdModuleRecR::CbmTrdModuleRecR(Int_t mod, Int_t ly, Int_t rot) CbmTrdModuleRecR::~CbmTrdModuleRecR() {} //_______________________________________________________________________________ -Bool_t CbmTrdModuleRecR::AddDigi(const CbmTrdDigi *digi, Int_t id) { +Bool_t CbmTrdModuleRecR::AddDigi(const CbmTrdDigi* digi, Int_t id) { // fill the digimap fDigiMap.push_back(make_tuple(id, false, digi)); @@ -58,7 +57,7 @@ Bool_t CbmTrdModuleRecR::AddDigi(const CbmTrdDigi *digi, Int_t id) { } //_______________________________________________________________________________ -void CbmTrdModuleRecR::Clear(Option_t *opt) { +void CbmTrdModuleRecR::Clear(Option_t* opt) { if (strcmp(opt, "cls") == 0) { fDigiMap.erase(fDigiMap.begin(), fDigiMap.end()); fClusterMap.erase(fClusterMap.begin(), fClusterMap.end()); @@ -70,10 +69,10 @@ void CbmTrdModuleRecR::Clear(Option_t *opt) { //_______________________________________________________________________________ Int_t CbmTrdModuleRecR::FindClusters() { - deque<tuple<Int_t, Bool_t, const CbmTrdDigi *>>::iterator - mainit; // subiterator for the deques in each module; searches for - // main-trigger to then add the neighbors - deque<tuple<Int_t, Bool_t, const CbmTrdDigi *>>::iterator FNit; // last + deque<tuple<Int_t, Bool_t, const CbmTrdDigi*>>::iterator + mainit; // subiterator for the deques in each module; searches for + // main-trigger to then add the neighbors + deque<tuple<Int_t, Bool_t, const CbmTrdDigi*>>::iterator FNit; // last // iterator to // find the FN // digis which @@ -84,7 +83,18 @@ Int_t CbmTrdModuleRecR::FindClusters() { // adjacent // main // triggers - deque<tuple<Int_t, Bool_t, const CbmTrdDigi *>>::iterator start; // marker to + deque<tuple<Int_t, Bool_t, const CbmTrdDigi*>>::iterator start; // marker to + // erase + // already + // processed + // entries + // from the + // map to + // reduce the + // complexity + // of the + // algorithm + deque<tuple<Int_t, Bool_t, const CbmTrdDigi*>>::iterator stop; // marker to // erase // already // processed @@ -95,26 +105,15 @@ Int_t CbmTrdModuleRecR::FindClusters() { // complexity // of the // algorithm - deque<tuple<Int_t, Bool_t, const CbmTrdDigi *>>::iterator stop; // marker to - // erase - // already - // processed - // entries - // from the - // map to - // reduce the - // complexity - // of the - // algorithm // reset time information; used to erase processed digis from the map - Double_t time = 0; + Double_t time = 0; Double_t lasttime = 0; Double_t timediff = -1000; Int_t Clustercount = 0; - Double_t interval = CbmTrdDigi::Clk(CbmTrdDigi::kSPADIC); - Bool_t print = false; + Double_t interval = CbmTrdDigi::Clk(CbmTrdDigi::kSPADIC); + Bool_t print = false; // iterator for the main trigger; searches for an unprocessed main triggered // digi and then starts a subloop to directly construct the cluster @@ -123,13 +122,13 @@ Int_t CbmTrdModuleRecR::FindClusters() { if (print) { std::cout << fDigiMap.size() << std::endl; for (mainit = fDigiMap.begin(); mainit != fDigiMap.end(); mainit++) { - const CbmTrdDigi *digi = (const CbmTrdDigi *)get<2>(*mainit); - Double_t ptime = digi->GetTime(); + const CbmTrdDigi* digi = (const CbmTrdDigi*) get<2>(*mainit); + Double_t ptime = digi->GetTime(); // Int_t digiAddress = digi->GetAddress(); Float_t Charge = digi->GetCharge(); // Int_t digiId = get<0>(*mainit); - Int_t channel = digi->GetAddressChannel(); - Int_t ncols = fDigiPar->GetNofColumns(); + Int_t channel = digi->GetAddressChannel(); + Int_t ncols = fDigiPar->GetNofColumns(); Int_t triggerId = digi->GetTriggerType(); std::cout << " module: " << fModAddress << " time: " << ptime @@ -143,44 +142,38 @@ Int_t CbmTrdModuleRecR::FindClusters() { for (mainit = fDigiMap.begin(); mainit != fDigiMap.end(); mainit++) { // block to erase processed entries - const CbmTrdDigi *digi = (const CbmTrdDigi *)get<2>(*mainit); - if (!digi) - continue; + const CbmTrdDigi* digi = (const CbmTrdDigi*) get<2>(*mainit); + if (!digi) continue; time = digi->GetTime(); - if (lasttime > 0) - timediff = time - lasttime; + if (lasttime > 0) timediff = time - lasttime; lasttime = time; // if(timediff < -interval) start=mainit; - if (timediff > interval && lasttime > 0) { - start = mainit; - } + if (timediff > interval && lasttime > 0) { start = mainit; } // if(timediff > interval) {start=mainit;stop=mainit;break;} if (timediff > interval) { fDigiMap.erase(fDigiMap.begin(), stop + 1); start = mainit; - stop = mainit; + stop = mainit; } - if (timediff < interval) - stop = mainit; + if (timediff < interval) stop = mainit; Int_t triggerId = digi->GetTriggerType(); - Bool_t marked = get<1>(*mainit); - if (triggerId != CbmTrdDigi::kSelf || marked) - continue; + Bool_t marked = get<1>(*mainit); + if (triggerId != CbmTrdDigi::kSelf || marked) continue; // variety of neccessary address information; uses the "combiId" for the // comparison of digi positions // Int_t digiAddress = digi->GetAddress(); Float_t Charge = digi->GetCharge(); - Int_t digiId = get<0>(*mainit); - Int_t channel = digi->GetAddressChannel(); - Int_t ncols = fDigiPar->GetNofColumns(); + Int_t digiId = get<0>(*mainit); + Int_t channel = digi->GetAddressChannel(); + Int_t ncols = fDigiPar->GetNofColumns(); // some logic information which is used to process and find the clusters - Int_t lowcol = channel; + Int_t lowcol = channel; Int_t highcol = channel; - Int_t lowrow = channel; + Int_t lowrow = channel; Int_t highrow = channel; // counter which is used to easily break clusters which are at the edge and @@ -190,9 +183,9 @@ Int_t CbmTrdModuleRecR::FindClusters() { // information buffer to handle neighbor rows and cluster over two rows; the // identification of adjacent rows is done by comparing their center of // gravity - Int_t counterrow = 1; - Int_t countertop = 0; - Int_t counterbot = 0; + Int_t counterrow = 1; + Int_t countertop = 0; + Int_t counterbot = 0; Double_t buffertop[3] = {0, 0, 0}; Double_t bufferbot[3] = {0, 0, 0}; Double_t bufferrow[3] = {Charge, 0, 0}; @@ -202,26 +195,28 @@ Int_t CbmTrdModuleRecR::FindClusters() { Double_t CoGtop = 0.; Double_t CoGbot = 0.; Double_t CoGrow = 0.; - tuple<const CbmTrdDigi *, const CbmTrdDigi *, const CbmTrdDigi *> - topdigi; // used to store the necassary digis for the CoG calculation - // without the need to revisit those digis - tuple<const CbmTrdDigi *, const CbmTrdDigi *, const CbmTrdDigi *> botdigi; + tuple<const CbmTrdDigi*, const CbmTrdDigi*, const CbmTrdDigi*> + topdigi; // used to store the necassary digis for the CoG calculation + // without the need to revisit those digis + tuple<const CbmTrdDigi*, const CbmTrdDigi*, const CbmTrdDigi*> botdigi; // //some logical flags to reject unnecessary steps - Bool_t finished = false; // is turned true either if the implemented trigger - // logic is fullfilled or if there are no more - // adjacend pads due to edges,etc. - Bool_t sealtopcol = false; // the "seal" bools register when the logical end - // of the cluster was found + Bool_t finished = + false; // is turned true either if the implemented trigger + // logic is fullfilled or if there are no more + // adjacend pads due to edges,etc. + Bool_t sealtopcol = + false; // the "seal" bools register when the logical end + // of the cluster was found Bool_t sealbotcol = false; Bool_t sealtoprow = false; Bool_t sealbotrow = false; - Bool_t rowchange = false; // flags that there is a possible two row cluster - Bool_t addtop = false; // adds the buffered information of the second row + Bool_t rowchange = false; // flags that there is a possible two row cluster + Bool_t addtop = false; // adds the buffered information of the second row Bool_t addbot = false; // //deque which contains the actual cluster - deque<std::pair<Int_t, const CbmTrdDigi *>> cluster; + deque<std::pair<Int_t, const CbmTrdDigi*>> cluster; cluster.push_back(make_pair(digiId, digi)); if (print) std::cout << " module: " << fModAddress << " time: " << time @@ -246,32 +241,29 @@ Int_t CbmTrdModuleRecR::FindClusters() { // digis // continue; - const CbmTrdDigi *d = (const CbmTrdDigi *)get<2>(*FNit); - Double_t newtime = d->GetTime(); - Double_t dt = newtime - time; - Bool_t filled = get<1>(*FNit); - if (filled) - continue; - if (dt < -interval) - continue; - if (dt > interval) - break; + const CbmTrdDigi* d = (const CbmTrdDigi*) get<2>(*FNit); + Double_t newtime = d->GetTime(); + Double_t dt = newtime - time; + Bool_t filled = get<1>(*FNit); + if (filled) continue; + if (dt < -interval) continue; + if (dt > interval) break; // position information of the possible neighbor digis Double_t charge = d->GetCharge(); // digiAddress = d->GetAddress(); - Int_t digiid = get<0>(*FNit); - Int_t ch = d->GetAddressChannel(); - Int_t col = ch % ncols; + Int_t digiid = get<0>(*FNit); + Int_t ch = d->GetAddressChannel(); + Int_t col = ch % ncols; Int_t trigger = d->GetTriggerType(); if (mergerow) { // multiple row processing // first buffering - if (ch == channel - ncols && !rowchange && - trigger == CbmTrdDigi::kSelf && !get<1>(*FNit)) { - rowchange = true; + if (ch == channel - ncols && !rowchange + && trigger == CbmTrdDigi::kSelf && !get<1>(*FNit)) { + rowchange = true; bufferbot[0] = charge; counterbot++; get<0>(botdigi) = d; @@ -286,9 +278,9 @@ Int_t CbmTrdModuleRecR::FindClusters() { counterbot++; get<2>(botdigi) = d; } - if (ch == channel + ncols && !rowchange && - trigger == CbmTrdDigi::kSelf && !get<1>(*FNit)) { - rowchange = true; + if (ch == channel + ncols && !rowchange + && trigger == CbmTrdDigi::kSelf && !get<1>(*FNit)) { + rowchange = true; buffertop[0] = charge; countertop++; get<0>(topdigi) = d; @@ -319,30 +311,30 @@ Int_t CbmTrdModuleRecR::FindClusters() { // identification of common CoGs if (countertop == 3) { CoGtop = - (buffertop[2] / buffertop[0]) - (buffertop[1] / buffertop[0]); + (buffertop[2] / buffertop[0]) - (buffertop[1] / buffertop[0]); } if (counterbot == 3) { CoGbot = - (bufferbot[2] / bufferbot[0]) - (bufferbot[1] / bufferbot[0]); + (bufferbot[2] / bufferbot[0]) - (bufferbot[1] / bufferbot[0]); } if (counterrow == 3) { CoGrow = - (bufferrow[2] / bufferrow[0]) - (bufferrow[1] / bufferrow[0]); + (bufferrow[2] / bufferrow[0]) - (bufferrow[1] / bufferrow[0]); } - if (countertop == 3 && counterrow == 3 && !addtop && - TMath::Abs((CoGtop - CoGrow)) < 0.25 * CoGrow) { + if (countertop == 3 && counterrow == 3 && !addtop + && TMath::Abs((CoGtop - CoGrow)) < 0.25 * CoGrow) { addtop = true; } - if (counterbot == 3 && counterrow == 3 && !addbot && - TMath::Abs((CoGbot - CoGrow)) < 0.25 * CoGrow) { + if (counterbot == 3 && counterrow == 3 && !addbot + && TMath::Abs((CoGbot - CoGrow)) < 0.25 * CoGrow) { addbot = true; } } // logical implementation of the trigger logic in the same row as the // main trigger - if (ch == lowcol - 1 && trigger == CbmTrdDigi::kSelf && - !get<1>(*FNit)) { + if (ch == lowcol - 1 && trigger == CbmTrdDigi::kSelf + && !get<1>(*FNit)) { cluster.push_back(make_pair(digiid, d)); lowcol = ch; dmain++; @@ -352,8 +344,8 @@ Int_t CbmTrdModuleRecR::FindClusters() { << " col: " << col << " row: " << ch / ncols << " trigger: " << trigger << std::endl; } - if (ch == highcol + 1 && trigger == CbmTrdDigi::kSelf && - !get<1>(*FNit)) { + if (ch == highcol + 1 && trigger == CbmTrdDigi::kSelf + && !get<1>(*FNit)) { cluster.push_back(make_pair(digiid, d)); highcol = ch; dmain++; @@ -363,8 +355,8 @@ Int_t CbmTrdModuleRecR::FindClusters() { << " col: " << col << " row: " << ch / ncols << " trigger: " << trigger << std::endl; } - if (ch == highcol + 1 && trigger == CbmTrdDigi::kNeighbor && - !get<1>(*FNit) && !sealtopcol) { + if (ch == highcol + 1 && trigger == CbmTrdDigi::kNeighbor + && !get<1>(*FNit) && !sealtopcol) { cluster.push_back(make_pair(digiid, d)); sealtopcol = true; dmain++; @@ -374,8 +366,8 @@ Int_t CbmTrdModuleRecR::FindClusters() { << " col: " << col << " row: " << ch / ncols << " trigger: " << trigger << std::endl; } - if (ch == lowcol - 1 && trigger == CbmTrdDigi::kNeighbor && - !get<1>(*FNit) && !sealbotcol) { + if (ch == lowcol - 1 && trigger == CbmTrdDigi::kNeighbor + && !get<1>(*FNit) && !sealbotcol) { cluster.push_back(make_pair(digiid, d)); sealbotcol = true; dmain++; @@ -385,54 +377,50 @@ Int_t CbmTrdModuleRecR::FindClusters() { << " col: " << col << " row: " << ch / ncols << " trigger: " << trigger << std::endl; } - if (col == ncols) { - sealtopcol = true; - } - if (col == 0) { - sealbotcol = true; - } + if (col == ncols) { sealtopcol = true; } + if (col == 0) { sealbotcol = true; } if (mergerow) { // adding of the neighboring row if (ch == channel - ncols && addbot && !get<1>(*FNit)) { cluster.push_back(make_pair(digiid, d)); - lowrow = ch; + lowrow = ch; highrow = ch; dmain++; get<1>(*FNit) = true; } if (ch == channel + ncols && addtop && !get<1>(*FNit)) { cluster.push_back(make_pair(digiid, d)); - lowrow = ch; + lowrow = ch; highrow = ch; dmain++; get<1>(*FNit) = true; } - if (rowchange && ch == lowrow - 1 && lowrow != channel && - trigger == CbmTrdDigi::kSelf && !get<1>(*FNit)) { + if (rowchange && ch == lowrow - 1 && lowrow != channel + && trigger == CbmTrdDigi::kSelf && !get<1>(*FNit)) { cluster.push_back(make_pair(digiid, d)); lowrow = ch; dmain++; get<1>(*FNit) = true; } - if (rowchange && ch == highrow + 1 && highrow != channel && - trigger == CbmTrdDigi::kSelf && !get<1>(*FNit)) { + if (rowchange && ch == highrow + 1 && highrow != channel + && trigger == CbmTrdDigi::kSelf && !get<1>(*FNit)) { cluster.push_back(make_pair(digiid, d)); highrow = ch; dmain++; get<1>(*FNit) = true; } - if (rowchange && ch == highrow + 1 && highrow != channel && - trigger == CbmTrdDigi::kNeighbor && !get<1>(*FNit) && - !sealtoprow) { + if (rowchange && ch == highrow + 1 && highrow != channel + && trigger == CbmTrdDigi::kNeighbor && !get<1>(*FNit) + && !sealtoprow) { cluster.push_back(make_pair(digiid, d)); sealtoprow = true; dmain++; get<1>(*FNit) = true; } - if (rowchange && ch == lowrow - 1 && lowrow != channel && - trigger == CbmTrdDigi::kNeighbor && !get<1>(*FNit) && - !sealbotrow) { + if (rowchange && ch == lowrow - 1 && lowrow != channel + && trigger == CbmTrdDigi::kNeighbor && !get<1>(*FNit) + && !sealbotrow) { cluster.push_back(make_pair(digiid, d)); sealbotrow = true; dmain++; @@ -447,17 +435,14 @@ Int_t CbmTrdModuleRecR::FindClusters() { if ((sealbotcol && sealtopcol && sealtoprow && sealbotrow) || dmain == 0) finished = true; // finished=true; - if (print) - cout << dmain << endl; - } // end of cluster completion - if (print) - cout << dmain << endl; - if (print) - cout << endl; + if (print) cout << dmain << endl; + } // end of cluster completion + if (print) cout << dmain << endl; + if (print) cout << endl; // fClusterMap.push_back(cluster); Clustercount++; addClusters(cluster); - } // end of main trigger loop + } // end of main trigger loop // fDigiMap.erase(fDigiMap.begin(),fDigiMap.end()); // } @@ -472,16 +457,17 @@ Int_t CbmTrdModuleRecR::FindClusters() { //_____________________________________________________________________ void CbmTrdModuleRecR::addClusters( - deque<std::pair<Int_t, const CbmTrdDigi *>> cluster) { + deque<std::pair<Int_t, const CbmTrdDigi*>> cluster) { // create vector for indice matching vector<Int_t> digiIndices(cluster.size()); Int_t idigi = 0; CbmDigiManager::Instance()->Init(); - for (std::deque<std::pair<Int_t, const CbmTrdDigi *>>::iterator iDigi = - cluster.begin(); - iDigi != cluster.end(); iDigi++) { + for (std::deque<std::pair<Int_t, const CbmTrdDigi*>>::iterator iDigi = + cluster.begin(); + iDigi != cluster.end(); + iDigi++) { // add digi id to vector digiIndices[idigi] = iDigi->first; idigi++; @@ -490,8 +476,8 @@ void CbmTrdModuleRecR::addClusters( // add the clusters to the Array // const CbmDigi* digi = static_cast<const // CbmDigi*>(fDigis->At(digiIndices.front())); - Int_t size = fClusters->GetEntriesFast(); - CbmTrdCluster *newcluster = new ((*fClusters)[size]) CbmTrdCluster(); + Int_t size = fClusters->GetEntriesFast(); + CbmTrdCluster* newcluster = new ((*fClusters)[size]) CbmTrdCluster(); // std::cout<<idigi<<std::endl; newcluster->SetAddress(fModAddress); @@ -505,55 +491,54 @@ void CbmTrdModuleRecR::addClusters( Bool_t CbmTrdModuleRecR::MakeHits() { return kTRUE; } //_______________________________________________________________________________ -CbmTrdHit *CbmTrdModuleRecR::MakeHit(Int_t clusterId, - const CbmTrdCluster * /*cluster*/, - std::vector<const CbmTrdDigi *> *digis) { +CbmTrdHit* CbmTrdModuleRecR::MakeHit(Int_t clusterId, + const CbmTrdCluster* /*cluster*/, + std::vector<const CbmTrdDigi*>* digis) { TVector3 hit_posV; TVector3 local_pad_posV; TVector3 local_pad_dposV; for (Int_t iDim = 0; iDim < 3; iDim++) { - hit_posV[iDim] = 0.0; - local_pad_posV[iDim] = 0.0; + hit_posV[iDim] = 0.0; + local_pad_posV[iDim] = 0.0; local_pad_dposV[iDim] = 0.0; } - Double_t xVar = 0; - Double_t yVar = 0; + Double_t xVar = 0; + Double_t yVar = 0; Double_t totalCharge = 0; // Double_t totalChargeTR = 0; // Double_t momentum = 0.; // Int_t moduleAddress = 0; - Double_t time = 0.; + Double_t time = 0.; Int_t errorclass = 0.; - Bool_t EB = false; - Bool_t EBP = false; - for (std::vector<const CbmTrdDigi *>::iterator id = digis->begin(); - id != digis->end(); id++) { - const CbmTrdDigi *digi = (*id); + Bool_t EB = false; + Bool_t EBP = false; + for (std::vector<const CbmTrdDigi*>::iterator id = digis->begin(); + id != digis->end(); + id++) { + const CbmTrdDigi* digi = (*id); if (!digi) { continue; std::cout << " no digi " << std::endl; } Double_t digiCharge = digi->GetCharge(); - errorclass = digi->GetErrorClass(); - EB = digi->IsFlagged(0); - EBP = digi->IsFlagged(1); + errorclass = digi->GetErrorClass(); + EB = digi->IsFlagged(0); + EBP = digi->IsFlagged(1); // if (digiCharge <= 0) {std::cout<<" charge 0 " << // std::endl;continue;} - if (digiCharge <= 0.05) { - continue; - } + if (digiCharge <= 0.05) { continue; } time += digi->GetTime(); // time += digi->GetTimeDAQ(); totalCharge += digi->GetCharge(); - fDigiPar->GetPadPosition(digi->GetAddressChannel(), true, local_pad_posV, - local_pad_dposV); + fDigiPar->GetPadPosition( + digi->GetAddressChannel(), true, local_pad_posV, local_pad_dposV); Double_t xMin = local_pad_posV[0] - local_pad_dposV[0]; Double_t xMax = local_pad_posV[0] + local_pad_dposV[0]; @@ -569,8 +554,7 @@ CbmTrdHit *CbmTrdModuleRecR::MakeHit(Int_t clusterId, } time /= digis->size(); - if (totalCharge <= 0) - return NULL; + if (totalCharge <= 0) return NULL; Double_t hit_pos[3]; for (Int_t iDim = 0; iDim < 3; iDim++) { @@ -601,9 +585,7 @@ CbmTrdHit *CbmTrdModuleRecR::MakeHit(Int_t clusterId, else if (errorclass == 4) yVar = 0.0291146; } else { - if (EBP) - time -= - 46; // due to the event time of 0 in the EB + if (EBP) time -= 46; // due to the event time of 0 in the EB // mode and the ULong in the the digi time // TODO: move variables to parameter file if (errorclass == 0) @@ -635,8 +617,8 @@ CbmTrdHit *CbmTrdModuleRecR::MakeHit(Int_t clusterId, Double_t global[3]; LocalToMaster(hit_pos, global); - if (!EB) { // preliminary correction for angle dependence in the position - // reconsutrction + if (!EB) { // preliminary correction for angle dependence in the position + // reconsutrction global[0] = global[0] + (0.00214788 + global[0] * 0.000195394); global[1] = global[1] + (0.00370566 + global[1] * 0.000213235); } @@ -656,33 +638,44 @@ CbmTrdHit *CbmTrdModuleRecR::MakeHit(Int_t clusterId, // cluster_pad_dposV, 0, clusterId,0, 0, // totalCharge/1e6,time,Double_t(CbmTrdDigi::Clk(CbmTrdDigi::kSPADIC))); return new ((*fHits)[nofHits]) - CbmTrdHit(fModAddress, global, cluster_pad_dposV, 0, clusterId, - totalCharge / 1e6, time, - Double_t(8.5)); // TODO: move to parameter file + CbmTrdHit(fModAddress, + global, + cluster_pad_dposV, + 0, + clusterId, + totalCharge / 1e6, + time, + Double_t(8.5)); // TODO: move to parameter file } Double_t CbmTrdModuleRecR::GetSpaceResolution(Double_t val) { - std::pair<Double_t, Double_t> res[12] = { - make_pair(0.5, 0.4), make_pair(1, 0.35), make_pair(2, 0.3), - make_pair(2.5, 0.3), make_pair(3.5, 0.28), make_pair(4.5, 0.26), - make_pair(5.5, 0.26), make_pair(6.5, 0.26), make_pair(7.5, 0.26), - make_pair(8.5, 0.26), make_pair(8.5, 0.26), make_pair(9.5, 0.26)}; + std::pair<Double_t, Double_t> res[12] = {make_pair(0.5, 0.4), + make_pair(1, 0.35), + make_pair(2, 0.3), + make_pair(2.5, 0.3), + make_pair(3.5, 0.28), + make_pair(4.5, 0.26), + make_pair(5.5, 0.26), + make_pair(6.5, 0.26), + make_pair(7.5, 0.26), + make_pair(8.5, 0.26), + make_pair(8.5, 0.26), + make_pair(9.5, 0.26)}; Double_t selval = 0.; for (Int_t n = 0; n < 12; n++) { - if (val < res[0].first) - selval = res[0].second; + if (val < res[0].first) selval = res[0].second; if (n == 11) { selval = res[11].second; break; } if (val >= res[n].first && val <= res[n + 1].first) { - Double_t dx = res[n + 1].first - res[n].first; - Double_t dy = res[n + 1].second - res[n].second; + Double_t dx = res[n + 1].first - res[n].first; + Double_t dy = res[n + 1].second - res[n].second; Double_t slope = dy / dx; - selval = (val - res[n].first) * slope + res[n].second; + selval = (val - res[n].first) * slope + res[n].second; break; } }