diff --git a/analysis/PWGHAD/hadron/CbmHadronAnalysis.cxx b/analysis/PWGHAD/hadron/CbmHadronAnalysis.cxx index 023acd1b841d986c0a90c4b9ea0f4c3534374b7d..09fba3f950c545c00385f91f0808a4f2976fe411 100644 --- a/analysis/PWGHAD/hadron/CbmHadronAnalysis.cxx +++ b/analysis/PWGHAD/hadron/CbmHadronAnalysis.cxx @@ -11,6 +11,7 @@ using namespace std; #include "TH1F.h" #include "TH2F.h" #include "TMath.h" +#include "TROOT.h" #include "TRandom.h" #include "TString.h" @@ -75,384 +76,8 @@ Float_t refMass[3] = {0.139, 0.494, 0.938}; // // ------------------------------------------------------------------ CbmHadronAnalysis::CbmHadronAnalysis() - : FairTask("HadronAnalysis") - , fEvents(0) - , fBeamMomentum(10) - , fMidY(0.) - , fDY(0.) - , fFlowMinPtm(0.) - , fBSelMin(0.) - , fBSelMax(0.) - , fwxy2(0.) - , fWMax(0.) - , fVtxBMax(0.) - , fPdfFileName("") - , fFlowFileName("") - , fflowFile(NULL) - , fMCEventHeader(NULL) - , fGeoHandler(NULL) - , fCellInfo(NULL) - , fMCTracks(NULL) - , fStsPoints(NULL) - , fMCTracksColl(NULL) - , fStsPointsColl(NULL) - , fStsHits(NULL) - , fStsClusters(NULL) - , fStsTracks(NULL) - , fStsDigis(NULL) - , fStsDigiMatchColl(NULL) - , fTrdPoints(NULL) - , fTrdHits(NULL) - , fTofPoints(NULL) - , fTofHits(NULL) - , fTofDigis(NULL) - , fTofDigiMatchColl(NULL) - , fTofDigiMatchPointsColl(NULL) - , fGlobalTracks(NULL) - , fHadrons(NULL) - , fPrimVertex(NULL) - , fTrackFitter() - , fa_ptm_rap_gen_pip(NULL) - , fa_ptm_rap_gen_pim(NULL) - , fa_ptm_rap_gen_kp(NULL) - , fa_ptm_rap_gen_km(NULL) - , fa_ptm_rap_gen_p(NULL) - , fa_ptm_rap_gen_pbar(NULL) - , fa_ptm_rap_gen_d(NULL) - , fa_ptm_rap_gen_t(NULL) - , fa_ptm_rap_gen_h(NULL) - , fa_ptm_rap_gen_a(NULL) - , fa_ptm_rap_gen_imf(NULL) - , fa_plab_sts_pip(NULL) - , fa_plab_sts_pim(NULL) - , fa_plab_sts_kp(NULL) - , fa_plab_sts_km(NULL) - , fa_plab_sts_p(NULL) - , fa_plab_sts_pbar(NULL) - , fa_ptm_rap_sts_pip(NULL) - , fa_ptm_rap_sts_pim(NULL) - , fa_ptm_rap_sts_kp(NULL) - , fa_ptm_rap_sts_km(NULL) - , fa_ptm_rap_sts_p(NULL) - , fa_ptm_rap_sts_pbar(NULL) - , fa_ptm_rap_sts_d(NULL) - , fa_ptm_rap_sts_t(NULL) - , fa_ptm_rap_sts_h(NULL) - , fa_ptm_rap_sts_a(NULL) - , fa_ptm_rap_sts_imf(NULL) - , fa_ptm_rap_poi_pip(NULL) - , fa_ptm_rap_poi_pim(NULL) - , fa_ptm_rap_poi_kp(NULL) - , fa_ptm_rap_poi_km(NULL) - , fa_ptm_rap_poi_p(NULL) - , fa_ptm_rap_poi_pbar(NULL) - , fa_ptm_rap_poi_d(NULL) - , fa_ptm_rap_poi_t(NULL) - , fa_ptm_rap_poi_h(NULL) - , fa_ptm_rap_poi_a(NULL) - , fa_ptm_rap_poi_imf(NULL) - , fa_ptm_rap_hit_pip(NULL) - , fa_ptm_rap_hit_pim(NULL) - , fa_ptm_rap_hit_kp(NULL) - , fa_ptm_rap_hit_km(NULL) - , fa_ptm_rap_hit_p(NULL) - , fa_ptm_rap_hit_pbar(NULL) - , fa_ptm_rap_hit_d(NULL) - , fa_ptm_rap_hit_t(NULL) - , fa_ptm_rap_hit_h(NULL) - , fa_ptm_rap_hit_a(NULL) - , fa_ptm_rap_hit_imf(NULL) - , fa_ptm_rap_glo_pip(NULL) - , fa_ptm_rap_glo_pim(NULL) - , fa_ptm_rap_glo_kp(NULL) - , fa_ptm_rap_glo_km(NULL) - , fa_ptm_rap_glo_p(NULL) - , fa_ptm_rap_glo_pbar(NULL) - , fa_ptm_rap_glo_d(NULL) - , fa_ptm_rap_glo_t(NULL) - , fa_ptm_rap_glo_h(NULL) - , fa_ptm_rap_glo_a(NULL) - , fa_ptm_rap_glo_imf(NULL) - , fa_mul_b_gen(NULL) - , fa_mul_b_poi(NULL) - , fa_mul_b_hit(NULL) - , fa_mul_b_glo(NULL) - , fa_mul_b_had(NULL) - , fa_phirp_b_gen(NULL) - , fa_phgrp_b_gen(NULL) - , fa_phphrp_gen(NULL) - , fa_delrp_b_gen(NULL) - , fa_delrp_b_poi(NULL) - , fa_delrp_b_hit(NULL) - , fa_delrp_b_glo(NULL) - , fa_drp_b_gen(NULL) - , fa_cdrp_b_gen(NULL) - , fa_drp_b_poi(NULL) - , fa_cdrp_b_poi(NULL) - , fa_drp_b_hit(NULL) - , fa_cdrp_b_hit(NULL) - , fa_drp_b_glo(NULL) - , fa_cdrp_b_glo(NULL) - , fa_drp_b_had(NULL) - , fa_cdrp_b_had(NULL) - , fa_cdelrp_b_gen(NULL) - , fa_cdelrp_b_poi(NULL) - , fa_cdelrp_b_hit(NULL) - , fa_cdelrp_b_glo(NULL) - , fa_cdelrp_b_had(NULL) - , fa_phirp_gen(NULL) - , fa_phirp_poi(NULL) - , fa_phirp_hit(NULL) - , fa_phirp_glo(NULL) - , fa_phirp_had(NULL) - , fa_phirps_gen(NULL) - , fa_phirps_poi(NULL) - , fa_phirps_hit(NULL) - , fa_phirps_glo(NULL) - , fa_phirps_had(NULL) - , fa_v1_rap_gen_pip(NULL) - , fa_v1_rap_gen_pim(NULL) - , fa_v1_rap_gen_kp(NULL) - , fa_v1_rap_gen_km(NULL) - , fa_v1_rap_gen_p(NULL) - , fa_v1_rap_gen_pbar(NULL) - , fa_v1_rap_gen_d(NULL) - , fa_v1_rap_gen_t(NULL) - , fa_v1_rap_gen_h(NULL) - , fa_v1_rap_gen_a(NULL) - , fa_v1_rap_gen_imf(NULL) - , fa_v2_rap_gen_pip(NULL) - , fa_v2_rap_gen_pim(NULL) - , fa_v2_rap_gen_kp(NULL) - , fa_v2_rap_gen_km(NULL) - , fa_v2_rap_gen_p(NULL) - , fa_v2_rap_gen_pbar(NULL) - , fa_v2_rap_gen_d(NULL) - , fa_v2_rap_gen_t(NULL) - , fa_v2_rap_gen_h(NULL) - , fa_v2_rap_gen_a(NULL) - , fa_v2_rap_gen_imf(NULL) - , fa_v1_rap_poi_pip(NULL) - , fa_v1_rap_poi_pim(NULL) - , fa_v1_rap_poi_kp(NULL) - , fa_v1_rap_poi_km(NULL) - , fa_v1_rap_poi_p(NULL) - , fa_v1_rap_poi_pbar(NULL) - , fa_v1_rap_poi_d(NULL) - , fa_v1_rap_poi_t(NULL) - , fa_v1_rap_poi_h(NULL) - , fa_v1_rap_poi_a(NULL) - , fa_v1_rap_poi_imf(NULL) - , fa_v2_rap_poi_pip(NULL) - , fa_v2_rap_poi_pim(NULL) - , fa_v2_rap_poi_kp(NULL) - , fa_v2_rap_poi_km(NULL) - , fa_v2_rap_poi_p(NULL) - , fa_v2_rap_poi_pbar(NULL) - , fa_v2_rap_poi_d(NULL) - , fa_v2_rap_poi_t(NULL) - , fa_v2_rap_poi_h(NULL) - , fa_v2_rap_poi_a(NULL) - , fa_v2_rap_poi_imf(NULL) - , fa_v1_rap_hit_pip(NULL) - , fa_v1_rap_hit_pim(NULL) - , fa_v1_rap_hit_kp(NULL) - , fa_v1_rap_hit_km(NULL) - , fa_v1_rap_hit_p(NULL) - , fa_v1_rap_hit_pbar(NULL) - , fa_v1_rap_hit_d(NULL) - , fa_v1_rap_hit_t(NULL) - , fa_v1_rap_hit_h(NULL) - , fa_v1_rap_hit_a(NULL) - , fa_v1_rap_hit_imf(NULL) - , fa_v2_rap_hit_pip(NULL) - , fa_v2_rap_hit_pim(NULL) - , fa_v2_rap_hit_kp(NULL) - , fa_v2_rap_hit_km(NULL) - , fa_v2_rap_hit_p(NULL) - , fa_v2_rap_hit_pbar(NULL) - , fa_v2_rap_hit_d(NULL) - , fa_v2_rap_hit_t(NULL) - , fa_v2_rap_hit_h(NULL) - , fa_v2_rap_hit_a(NULL) - , fa_v2_rap_hit_imf(NULL) - , fa_v1_rap_glo_pip(NULL) - , fa_v1_rap_glo_pim(NULL) - , fa_v1_rap_glo_kp(NULL) - , fa_v1_rap_glo_km(NULL) - , fa_v1_rap_glo_p(NULL) - , fa_v1_rap_glo_pbar(NULL) - , fa_v1_rap_glo_d(NULL) - , fa_v1_rap_glo_t(NULL) - , fa_v1_rap_glo_h(NULL) - , fa_v1_rap_glo_a(NULL) - , fa_v1_rap_glo_imf(NULL) - , fa_v2_rap_glo_pip(NULL) - , fa_v2_rap_glo_pim(NULL) - , fa_v2_rap_glo_kp(NULL) - , fa_v2_rap_glo_km(NULL) - , fa_v2_rap_glo_p(NULL) - , fa_v2_rap_glo_pbar(NULL) - , fa_v2_rap_glo_d(NULL) - , fa_v2_rap_glo_t(NULL) - , fa_v2_rap_glo_h(NULL) - , fa_v2_rap_glo_a(NULL) - , fa_v2_rap_glo_imf(NULL) - , fa_xy_poi1(NULL) - , fa_xy_poi2(NULL) - , fa_xy_poi3(NULL) - , fa_xy_hit1(NULL) - , fa_xy_hit2(NULL) - , fa_xy_hit3(NULL) - , fa_xy_glo1(NULL) - , fa_xy_glo_pip(NULL) - , fa_xy_glo_pim(NULL) - , fa_xy_glo_kp(NULL) - , fa_xy_glo_km(NULL) - , fa_xy_glo_p(NULL) - , fa_xy_glo_pbar(NULL) - , fa_xy_glo_d(NULL) - , fa_xy_glo_t(NULL) - , fa_xy_glo_h(NULL) - , fa_xy_glo_a(NULL) - , fa_pv_poi(NULL) - , fa_tm_poi(NULL) - , fa_tm_poiprim(NULL) - , fa_dxx(NULL) - , fa_dxy(NULL) - , fa_dxz(NULL) - , fa_dyx(NULL) - , fa_dyy(NULL) - , fa_dyz(NULL) - , fa_dzx(NULL) - , fa_dzy(NULL) - , fa_dzz(NULL) - , fa_hit_ch(NULL) - , fa_dhit_ch(NULL) - , fa_tof_hit(NULL) - , fa_dtof_hit(NULL) - , fa_tof_hitprim(NULL) - , fa_pv_hit(NULL) - , fa_tm_hit(NULL) - , fa_tm_hitprim(NULL) - , fa_tn_hit(NULL) - , fa_t0_hit(NULL) - , fa_t0m_hit(NULL) - , fa_t0mn_hit(NULL) - , fa_t0m_b_hit(NULL) - , fa_t0mn_b_hit(NULL) - , fa_t0m_f_hit(NULL) - , fa_t0mn_f_hit(NULL) - , fa_t0m_f_b_hit(NULL) - , fa_t0mn_f_b_hit(NULL) - , fa_t0m_nf_hit(NULL) - , fa_t0mn_nf_hit(NULL) - , fa_t0m_nf_b_hit(NULL) - , fa_t0mn_nf_b_hit(NULL) - , fa_TofTrackMul(NULL) - , fa_VtxB(NULL) - , fa_chi2_mom_glo(NULL) - , fa_chi2_mom_gloprim(NULL) - , fa_len_mom_glo(NULL) - , fa_pv_glo(NULL) - , fa_tm_glo(NULL) - , fa_tm_glo_pip(NULL) - , fa_tm_glo_pim(NULL) - , fa_tm_glo_kp(NULL) - , fa_tm_glo_km(NULL) - , fa_tm_glo_p(NULL) - , fa_tm_glo_pbar(NULL) - , fa_tm_glo_d(NULL) - , fa_tm_glo_t(NULL) - , fa_tm_glo_h(NULL) - , fa_tm_glo_a(NULL) - , fa_tm_gloprim(NULL) - , fa_tm_glomis(NULL) - , fa_tm_glovtxb(NULL) - , fa_tm_gloprimvtxb(NULL) - , fa_m2mom_glo(NULL) - , fa_m2mom_glovtxb(NULL) - , fa_m2mom_gloprim(NULL) - , fa_m2mom_gloprimvtxb(NULL) - , fa_m2mom_glo_pip(NULL) - , fa_m2mom_glo_pim(NULL) - , fa_m2mom_glo_kp(NULL) - , fa_m2mom_glo_km(NULL) - , fa_m2mom_glo_p(NULL) - , fa_m2mom_glo_pbar(NULL) - , fa_m2mom_glo_d(NULL) - , fa_m2mom_glo_t(NULL) - , fa_m2mom_glo_h(NULL) - , fa_m2mom_glo_a(NULL) - , fa_pMCmom_glo(NULL) - , fa_pMCmom_glo_pip(NULL) - , fa_pMCmom_glo_pim(NULL) - , fa_pMCmom_glo_kp(NULL) - , fa_pMCmom_glo_km(NULL) - , fa_pMCmom_glo_p(NULL) - , fa_pMCmom_glo_pbar(NULL) - , fa_pMCmom_glo_d(NULL) - , fa_pMCmom_glo_t(NULL) - , fa_pMCmom_glo_h(NULL) - , fa_pMCmom_glo_a(NULL) - , fa_w_mom_glo(NULL) - , fa_w_mom_glo_pip(NULL) - , fa_w_mom_glo_pim(NULL) - , fa_w_mom_glo_kp(NULL) - , fa_w_mom_glo_km(NULL) - , fa_w_mom_glo_p(NULL) - , fa_w_mom_glo_pbar(NULL) - , fa_w_mom_glo_d(NULL) - , fa_w_mom_glo_t(NULL) - , fa_w_mom_glo_h(NULL) - , fa_w_mom_glo_a(NULL) - , fa_w_mom_gloprim(NULL) - , fa_w_mom_glomis(NULL) - , fa_LenDismom_glo(NULL) - , fa_LenDismom_glo_pip(NULL) - , fa_LenDismom_glo_pim(NULL) - , fa_LenDismom_glo_kp(NULL) - , fa_LenDismom_glo_km(NULL) - , fa_LenDismom_glo_p(NULL) - , fa_LenDismom_glo_pbar(NULL) - , fa_LenDismom_glo_d(NULL) - , fa_LenDismom_glo_t(NULL) - , fa_LenDismom_glo_h(NULL) - , fa_LenDismom_glo_a(NULL) - , fa_LenMcLenGlomom_glo(NULL) - , fa_LenMcDismom_glo(NULL) - , fhwdist(NULL) - , fhwmindelmass(NULL) - , fhwminlen(NULL) - , fhwdelp(NULL) - , fhTofTrkDx(NULL) - , fhTofTrkDy(NULL) - , fhTofTrkDxsel(NULL) - , fhTofTrkDysel(NULL) - , bRecSec(kFALSE) - , fdDistPrimLim(1.5) - , // Ext Parameter: Max Tof-Sts trans distance for primaries - fdDistPrimLim2(0.3) - , // Ext Parameter: Max Sts-Sts trans distance for primaries - fdDistSecLim2(0.5) - , // Ext Parameter: Max Sts-Sts trans distance from TOF direction for secondaries - fdD0ProtLim(0.4) - , // Ext Parameter: Min impact parameter for secondary proton - fdOpAngMin(0.01) - , // Ext Parameter: Min opening angle for accepting pair - fdDCALim(0.2) - , // Ext Parameter: Max DCA for accepting pair - fdVLenMin(5.) - , // Ext Parameter: Min Lambda flight path length for accepting pair - fdVLenMax(25.) - , // Ext Parameter: Max Lambda flight path length for accepting pair - fdDistTRD(10.) - , // max accepted distance of Trd Hit from STS-TOF line - fdTRDHmulMin(0.) - , // min associated Trd Hits to Track candidates - fNMixedEvents(1) { - CreateHistogramms(); - cout << "CbmHadronAnalysis: Task started " << endl; + : CbmHadronAnalysis::CbmHadronAnalysis("Hadron Analysis", 0) { + cout << "CbmHadronAnalysis: Task started with defaults" << endl; } // ------------------------------------------------------------------ @@ -833,11 +458,7 @@ CbmHadronAnalysis::CbmHadronAnalysis(const char* name, Int_t verbose) , // max accepted distance of Trd Hit from STS-TOF line fdTRDHmulMin(0.) , // min associated Trd Hits to Track candidates - fNMixedEvents(1) - -{ - CreateHistogramms(); -} + fNMixedEvents(1) {} // ------------------------------------------------------------------ @@ -852,6 +473,8 @@ CbmHadronAnalysis::~CbmHadronAnalysis() { // ------------------------------------------------------------------ void CbmHadronAnalysis::CreateHistogramms() { // Create histogramms + gROOT->cd(); + LOG(info) << "CreateHistograms in " << gDirectory->GetName(); Float_t ymin = -1.; Float_t ymax = 4.; @@ -3449,6 +3072,8 @@ InitStatus CbmHadronAnalysis::Init() { << " rap:" << GetMidY() << endl; } + CreateHistogramms(); + cout << "-I- CbmHadronAnalysis::Init : " << "initialisation completed." << endl; @@ -3473,6 +3098,9 @@ void CbmHadronAnalysis::Exec(Option_t* option) { for (Int_t iEvent = 0; iEvent < fEventsColl->GetEntriesFast(); iEvent++) { CbmEvent* tEvent = dynamic_cast<CbmEvent*>(fEventsColl->At(iEvent)); + // Inspect CbmEvent + LOG(debug) << "CbmEvent with " << tEvent->GetNofData() << " total data"; + LOG(debug) << " " << tEvent->ToString(); // copy TOF hits fTofHits->Clear(); Int_t iNbHits = 0; @@ -3491,7 +3119,8 @@ void CbmHadronAnalysis::Exec(Option_t* option) { iNbHits = 0; fStsHits->Clear(); LOG(debug) << "Fill Sts array with mul " - << tEvent->GetNofData(ECbmDataType::kStsHit); + << tEvent->GetNofData(ECbmDataType::kStsHit) << " out of " + << fStsHitsColl->GetEntriesFast(); for (Int_t iHit = 0; iHit < tEvent->GetNofData(ECbmDataType::kStsHit); iHit++) { Int_t iHitIndex = @@ -3589,6 +3218,7 @@ void CbmHadronAnalysis::ExecEvent(Option_t*) { if (NULL == TofHit) continue; if (TofHit->GetZ() == 0.) dT0 = TofHit->GetTime(); } + if (dT0 != 0.) { for (Int_t j = 0; j < nTofHits; j++) { TofHit = (CbmTofHit*) fTofHits->At(j); @@ -4446,7 +4076,7 @@ void CbmHadronAnalysis::ExecEvent(Option_t*) { */ } else { lp = -1; - LOG(WARNING) << "No Link to MCTofPoint found for hit " << j; + LOG(debug) << "No Link to MCTofPoint found for hit " << j; continue; } TofPoint = (CbmTofPoint*) fTofPoints->At(lp); @@ -4959,11 +4589,11 @@ void CbmHadronAnalysis::ExecEvent(Option_t*) { Double_t vtxb = fTrackFitter.GetChiToVertex( StsTrack, fPrimVertex); //impact paramter ??? if (verbose > 10) { // nh-debug - cout << Form( - "<D> Extrapolate Glob Track %d to prim. vertex %6.2f with chi2 %6.2f", - i, - fPrimVertex->GetZ(), - vtxb) + cout << Form("<D> Extrapolate Glob Track %d to prim. vertex %6.2f with " + "chi2 %6.2f", + i, + fPrimVertex->GetZ(), + vtxb) << endl; //GlobTrack->GetParamFirst()->Print(); } @@ -5117,8 +4747,11 @@ void CbmHadronAnalysis::ExecEvent(Option_t*) { Bthi = thi; // best TofHit index Btt = tt; // best TofTrack index if (verbose > 5) { - cout << Form( - "<DMin> gt %d, hit %d, tt %d, w: %6.2f", i, Bthi, Btt, w) + cout << Form("<DMin> gt %d, hit %d, tt %d, w: %6.2f", + i, + Bthi, + Btt, + w) << endl; } } @@ -5248,8 +4881,10 @@ void CbmHadronAnalysis::ExecEvent(Option_t*) { } // decide now! - if (Weight_THMUL[i][0] < Weight_THMUL - [io][0]) { // new assignment better than old one -> change + if (Weight_THMUL[i][0] + < Weight_THMUL + [io] + [0]) { // new assignment better than old one -> change if (verbose > 1) { //nh-debug cout << "<D> New cand. is better, invalidate entry for gt " << io << endl; @@ -5262,12 +4897,13 @@ void CbmHadronAnalysis::ExecEvent(Option_t*) { GlobTrack2->SetLength(0.); // signal entry invalid } else { // old assignment better than current candidate if (verbose > 0) { //nh-debug - cout << Form( - "<D> Stick to old assignment, Bthi %d, TM %d, THM %d", - Bthi, - NTofHitTMul[Bthi], - NTHMUL[i]) - << endl; + cout + << Form( + "<D> Stick to old assignment, Bthi %d, TM %d, THM %d", + Bthi, + NTofHitTMul[Bthi], + NTHMUL[i]) + << endl; } NTofHitTMul[Bthi]--; // deregister toftrack if (NTHMUL[i] > 1) { // take next one from list @@ -6147,6 +5783,7 @@ void CbmHadronAnalysis::ReconstructSecondaries() { #include "TVector3.h" static TH1F* fhTofHitMul; + static TH1F* fhStsHitMul; static TH1F* fhTofChi; static TH1F* fhDperp; static TH2F* fhdEdxMul; @@ -6228,6 +5865,11 @@ void CbmHadronAnalysis::ReconstructSecondaries() { fiTofHitMulMax, 0., (Double_t) fiTofHitMulMax); + fhStsHitMul = new TH1F(Form("hStsHitMul"), + Form("StsHit Multiplicity; M_{StsHit} "), + fiTofHitMulMax, + 0., + (Double_t) fiTofHitMulMax); fhTofChi = new TH1F( Form("hTofChi"), Form("TofHit Merger; #chi "), 100, 0., dChiTofLim * 2.); fhDperp = new TH1F(Form("hDperp"), @@ -6378,6 +6020,7 @@ void CbmHadronAnalysis::ReconstructSecondaries() { } fhTofHitMul->Fill((Double_t) nTofHits); + fhStsHitMul->Fill((Double_t) nStsHits); fvP.resize(fiNMixClasses); fvX.resize(fiNMixClasses); @@ -6421,11 +6064,13 @@ void CbmHadronAnalysis::ReconstructSecondaries() { for (Int_t i = 0; i < nTofHits; i++) { CbmTofHit* pTofHit = (CbmTofHit*) fTofHits->At(i); if (NULL == pTofHit) continue; - if (pTofHit->GetZ() == 0) continue; // don't merge with fake beam counter + if (pTofHit->GetZ() == 0.) continue; // don't merge with fake beam counter for (Int_t i2 = 0; i2 < nTofHits; i2++) { if (i2 != i) { CbmTofHit* pTofHit2 = (CbmTofHit*) fTofHits->At(i2); if (NULL == pTofHit2) continue; + if (pTofHit2->GetZ() == 0.) + continue; // don't merge with fake beam counter // Project to plane with smallest z coordinate if (pTofHit2->GetZ() < pTofHit->GetZ()) { //invert order CbmTofHit* pTofHittmp = pTofHit; @@ -6447,7 +6092,7 @@ void CbmHadronAnalysis::ReconstructSecondaries() { * 0.5); // update time fTofHits->Remove(pTofHit2); //pTofHit2->Delete(); // remove from TClonesArray - LOG(DEBUG) << "Tof Hits " << i << " and " << i2 << " merged "; + LOG(debug) << "Tof Hits " << i << " and " << i2 << " merged "; LOG(debug) << "Tof " << i << ", xyz " << pTofHit->GetX() << ", " << pTofHit->GetY() << ", " << pTofHit->GetZ(); } @@ -6459,7 +6104,7 @@ void CbmHadronAnalysis::ReconstructSecondaries() { for (Int_t i = 0; i < nTofHits; i++) { CbmTofHit* pTofHit = (CbmTofHit*) fTofHits->At(i); if (NULL == pTofHit) continue; - if (pTofHit->GetZ() == 0) continue; // skip fake beam counter + if (pTofHit->GetZ() == 0.) continue; // skip fake beam counter dStsDistMin[i] = 1.E3; dSts2DistMin[i] = 1.E3; for (Int_t l = 0; l < NTrdStations; l++) @@ -6595,15 +6240,17 @@ void CbmHadronAnalysis::ReconstructSecondaries() { << " < " << fdDistTRD; fhDTRDprim->Fill(dDtrans); if (dDtrans < fdDistTRD - && dDtrans < dTrdDistMin - [i][iTrdLayer]) { // check if acceptable and take best match + && dDtrans + < dTrdDistMin + [i] + [iTrdLayer]) { // check if acceptable and take best match Int_t iMul = iTRD[i].size(); if (dTrdDistMin[i][iTrdLayer] < 1.E3) { // modify previous entry //find old entry in vector Int_t ll = 0; for (; ll < iMul; ll++) - if (static_cast<UInt_t>(CbmTrdAddress::GetLayerId( - ((CbmTrdHit*) fTrdHits->At(iTRD[i][ll]))->GetAddress())) + if (CbmTrdAddress::GetLayerId( + ((CbmTrdHit*) fTrdHits->At(iTRD[i][ll]))->GetAddress()) == iTrdLayer) break; iTRD[i][ll] = l; @@ -6667,8 +6314,10 @@ void CbmHadronAnalysis::ReconstructSecondaries() { << " < " << fdDistTRD; fhDTRDprim->Fill(dDtrans); if (dDtrans < fdDistTRD - && dDtrans < dTrdDistMin - [i][iTrdLayer]) { // check if acceptable and take best match + && dDtrans + < dTrdDistMin + [i] + [iTrdLayer]) { // check if acceptable and take best match Int_t iMul = iTRD[i].size(); if (dTrdDistMin[i][iTrdLayer] < 1.E3) { // modify previous entry //find old entry in vector @@ -6710,7 +6359,7 @@ void CbmHadronAnalysis::ReconstructSecondaries() { for (Int_t i = 0; i < nTofHits; i++) { CbmTofHit* pTofHit = (CbmTofHit*) fTofHits->At(i); if (NULL == pTofHit) continue; - if (pTofHit->GetZ() == 0) continue; // skip fake beam counter + if (pTofHit->GetZ() == 0.) continue; // skip fake beam counter if (iStsMin[i][0] > -1 && iStsMin[i][1] > -1) { CbmStsHit* pStsHit = (CbmStsHit*) fStsHits->At(iStsMin[i][0]); CbmStsHit* pSts2Hit = (CbmStsHit*) fStsHits->At(iStsMin[i][1]); @@ -6766,7 +6415,7 @@ void CbmHadronAnalysis::ReconstructSecondaries() { Int_t kbest = -1; CbmTofHit* pTofHit = (CbmTofHit*) fTofHits->At(i); if (NULL == pTofHit) continue; - if (pTofHit->GetZ() == 0) continue; // skip fake beam counter + if (pTofHit->GetZ() == 0.) continue; // skip fake beam counter for (Int_t j = 0; j < nStsHits; j++) { LOG(debug) << "Tof " << i << ", Sts " << j << Form(" ? sec cand %6.3f Min %6.3f ", @@ -6792,7 +6441,7 @@ void CbmHadronAnalysis::ReconstructSecondaries() { + TMath::Power(pSts2Hit->GetY() - sPos2Yext, 2); Double_t dDist = TMath::Sqrt(dDist2); fhDperpS->Fill(dDist); - LOG(DEBUG) << "Sec Tof " << i << ", Sts " << j + LOG(debug) << "Sec Tof " << i << ", Sts " << j << Form(" Sts2 %d -> dist %6.3f < %6.3f ? at z = %4.1f", k, dDist, @@ -6803,13 +6452,12 @@ void CbmHadronAnalysis::ReconstructSecondaries() { dDistMin = dDist; jbest = j; kbest = k; - ; } } // for (Int_t k=0; k<nStsHits; k++) { } //if( dTofDistMin[j] > dDistPrimLim) { // Sts hit not in the primary class } // for (Int_t j=0; j<nStsHits; j++) { - LOG(DEBUG) << "Sec Dist for TofHit " << i << ": " << dDistMin << ", j " + LOG(debug) << "Sec Dist for TofHit " << i << ": " << dDistMin << ", j " << jbest << ", k " << kbest; if (dDistMin < 100.) { // secondary candidate found, store vectors @@ -6836,7 +6484,7 @@ void CbmHadronAnalysis::ReconstructSecondaries() { + TMath::Power(dYexp - pTrdHit->GetY(), 2)); UInt_t iTrdLayer = CbmTrdAddress::GetLayerId(pTrdHit->GetAddress()); fhDTRDsec->Fill(dDtrans); - LOG(DEBUG) << "Inspect sec. TRD hit " << l << " in " + LOG(debug) << "Inspect sec. TRD hit " << l << " in " << Form("Module 0x%08x, layer %d", pTrdHit->GetAddress(), CbmTrdAddress::GetLayerId(pTrdHit->GetAddress())) @@ -6844,16 +6492,17 @@ void CbmHadronAnalysis::ReconstructSecondaries() { << " < " << fdDistTRD; if ( dDtrans < fdDistTRD - && dDtrans < dTrdDistMin - [i] - [iTrdLayer]) { // check if acceptable and take best match + && dDtrans + < dTrdDistMin + [i] + [iTrdLayer]) { // check if acceptable and take best match Int_t iMul = iTRD[i].size(); if (dTrdDistMin[i][iTrdLayer] < 1.E3) { // modify previous entry //find old entry in vector Int_t ll = 0; for (; ll < iMul; ll++) - if (static_cast<UInt_t>(CbmTrdAddress::GetLayerId( - ((CbmTrdHit*) fTrdHits->At(iTRD[i][ll]))->GetAddress())) + if (CbmTrdAddress::GetLayerId( + ((CbmTrdHit*) fTrdHits->At(iTRD[i][ll]))->GetAddress()) == iTrdLayer) break; iTRD[i][ll] = l; @@ -6934,9 +6583,10 @@ void CbmHadronAnalysis::ReconstructSecondaries() { << " < " << fdDistTRD; if ( dDtrans < fdDistTRD - && dDtrans < dTrdDistMin - [i] - [iTrdLayer]) { // check if acceptable and take best match + && dDtrans + < dTrdDistMin + [i] + [iTrdLayer]) { // check if acceptable and take best match Int_t iMul = iTRD[i].size(); if (dTrdDistMin[i][iTrdLayer] < 1.E3) { // modify previous entry //find old entry in vector diff --git a/reco/detectors/tof/CbmTofEventClusterizer.cxx b/reco/detectors/tof/CbmTofEventClusterizer.cxx index c560def25718d98c3f77e6370c6c5f72bdb5ffe3..f307e1023cd06a916a0341910533b566f08ae2f7 100644 --- a/reco/detectors/tof/CbmTofEventClusterizer.cxx +++ b/reco/detectors/tof/CbmTofEventClusterizer.cxx @@ -19,6 +19,7 @@ #include "CbmTofCreateDigiPar.h" // in tof/TofTools #include "CbmTofDetectorId_v12b.h" // in cbmdata/tof #include "CbmTofDetectorId_v14a.h" // in cbmdata/tof +#include "CbmTofDetectorId_v20a.h" // in cbmdata/tof #include "CbmTofDigi.h" // in cbmdata/tof #include "CbmTofDigiBdfPar.h" // in tof/TofParam #include "CbmTofDigiPar.h" // in tof/TofParam @@ -86,7 +87,7 @@ CbmTofEventClusterizer* CbmTofEventClusterizer::fInstance = 0; /************************************************************************************/ CbmTofEventClusterizer::CbmTofEventClusterizer() : CbmTofEventClusterizer("TestbeamClusterizer", 0, 0) { - if (!fInstance) fInstance = this; + // if ( !fInstance ) fInstance = this; } CbmTofEventClusterizer::CbmTofEventClusterizer(const char* name, @@ -247,16 +248,15 @@ CbmTofEventClusterizer::CbmTofEventClusterizer(const char* name, , fTotMax(0.) , fTotMin(0.) , fTotOff(0.) - , fTotMean(0.) + , fTotMean(0.) , fdDelTofMax(60.) , fTotPreRange(0.) , fMaxTimeDist(0.) , fdChannelDeadtime(0.) , fdMemoryTime(0.) , fdYFitMin(1.E6) - , fdToDAv(0.033) - , // in ns/cm - fEnableMatchPosScaling(kTRUE) + , fdToDAv(0.033) // in ns/cm + , fEnableMatchPosScaling(kTRUE) , fEnableAvWalk(kFALSE) , fbPs2Ns(kFALSE) , fCalParFileName("") @@ -393,10 +393,10 @@ void CbmTofEventClusterizer::Exec(Option_t* option) { // update content of match object, not necessary if event definition is kept ! /* for (Int_t iLink=0; iLink<pDigiMatch->GetNofLinks(); iLink++) { // loop over digis - CbmLink Link = pDigiMatch->GetLink(iLink); - Link.SetIndex(Link.GetIndex()+iDigi0); - } - */ + CbmLink Link = pDigiMatch->GetLink(iLink); + Link.SetIndex(Link.GetIndex()+iDigi0); + } + */ new ((*fTofDigiMatchCollOut)[iNbHits]) CbmMatch(*pDigiMatch); iNbHits++; @@ -600,7 +600,10 @@ Bool_t CbmTofEventClusterizer::InitParameters() { "with geometries after v14a !!!"; return kFALSE; } - fTofId = new CbmTofDetectorId_v14a(); + if (iGeoVersion == k14a) + fTofId = new CbmTofDetectorId_v14a(); + else + fTofId = new CbmTofDetectorId_v20a(); // create digitization parameters from geometry file CbmTofCreateDigiPar* tofDigiPar = @@ -2732,8 +2735,9 @@ Bool_t CbmTofEventClusterizer::FillHistos() { || (TMath::Sqrt( TMath::Power( pHit->GetX() - dzscal * pTrig[iSel]->GetX(), 2.) - + TMath::Power( - pHit->GetY() - dzscal * pTrig[iSel]->GetY(), 2.)) + + TMath::Power(pHit->GetY() + - dzscal * pTrig[iSel]->GetY(), + 2.)) < fdCaldXdYMax)) { BSel[iSel] = kTRUE; Double_t dX2Y2 = TMath::Sqrt(dSEl2dXdz * dSEl2dXdz @@ -3017,12 +3021,12 @@ Bool_t CbmTofEventClusterizer::FillHistos() { Int_t iS0 = pDig0->GetSide(); Int_t iS1 = pDig1->GetSide(); if (iCh0 != iCh1 || iS0 == iS1) { - LOG(fatal) << Form( - " MT2 for Tofhit %d in iDetIndx %d, Ch %d from %3.0f strips: ", - iHitInd, - iDetIndx, - iCh, - dNstrips) + LOG(fatal) << Form(" MT2 for Tofhit %d in iDetIndx %d, Ch %d from " + "%3.0f strips: ", + iHitInd, + iDetIndx, + iCh, + dNstrips) << Form(" Dig0: Ind %d, Ch %d, Side %d, T: %6.1f ", iDigInd0, iCh0, @@ -3176,11 +3180,11 @@ Bool_t CbmTofEventClusterizer::FillHistos() { * (pHit->GetZ() - (pTrig[iSel]->GetZ()))), 2.) + TMath::Power( - pHit->GetY() - - (pTrig[iSel]->GetY() - + ddYdZ[iSel] - * (pHit->GetZ() - (pTrig[iSel]->GetZ()))), - 2.)) + pHit->GetY() + - (pTrig[iSel]->GetY() + + ddYdZ[iSel] + * (pHit->GetZ() - (pTrig[iSel]->GetZ()))), + 2.)) > 0.5 * fdCaldXdYMax) continue; // refine position selection cut in cosmic measurement dTcor[iSel] = 0.; // precaution @@ -6180,23 +6184,26 @@ Bool_t CbmTofEventClusterizer::AddNextChan(Int_t iSmType, iDetId = CbmTofAddress::GetUniqueAddress(iSm, iRpc, iChm, 0, iSmType); Int_t iNbChanInHit = vDigiIndRef.size() / 2; + + TString cstr = "Save A-Hit "; + cstr += Form(" %3d %3d 0x%08x %3d 0x%08x %8.2f %6.2f", // %3d %3d + fiNbHits, + iNbChanInHit, + iDetId, + iLastChan, + 0, //vPtsRef.size(),vPtsRef[0]) + dLastTime, + dLastPosY); + cstr += Form(", DigiSize: %lu ", vDigiIndRef.size()); + cstr += ", DigiInds: "; + fviClusterMul[iSmType][iSm][iRpc]++; - LOG(debug1) << "Save A-Hit " - << Form("%2d %2d 0x%08x %3d t %f, y %f ", - fiNbHits, - iNbChanInHit, - iDetId, - iLastChan, - dLastTime, - dLastPosY) - << ", DigiSize: " << vDigiIndRef.size(); - LOG(debug1) << ", DigiInds: "; for (UInt_t i = 0; i < vDigiIndRef.size(); i++) { - LOG(debug1) << " " << vDigiIndRef.at(i) << "(M" - << fviClusterMul[iSmType][iSm][iRpc] << ")"; + cstr += + Form(" %d (M,%d)", vDigiIndRef.at(i), fviClusterMul[iSmType][iSm][iRpc]); } - LOG(debug1); + LOG(debug) << cstr; CbmTofHit* pHit = new CbmTofHit( iDetId, @@ -6545,14 +6552,15 @@ Bool_t CbmTofEventClusterizer::BuildHits() { iChId = fTofId->SetDetectorInfo(xDetInfo); Int_t iUCellId = CbmTofAddress::GetUniqueAddress(iSm, iRpc, iCh, 0, iSmType); - LOG(debug1) << Form( - " TSRC %d%d%d%d size %3lu ", - iSmType, - iSm, - iRpc, - iCh, - fStorDigiExp[iSmType][iSm * iNbRpc + iRpc][iCh].size()) - << Form(" ChId: 0x%08x 0x%08x ", iChId, iUCellId); + LOG(debug1) + << Form( + " TSRC %d%d%d%d size %3lu ", + iSmType, + iSm, + iRpc, + iCh, + fStorDigiExp[iSmType][iSm * iNbRpc + iRpc][iCh].size()) + << Form(" ChId: 0x%08x 0x%08x ", iChId, iUCellId); fChannelInfo = fDigiPar->GetCell(iChId); if (NULL == fChannelInfo) { @@ -7147,13 +7155,15 @@ Bool_t CbmTofEventClusterizer::BuildHits() { Int_t iRefId = 0; // Index of the correspondng TofPoint //if(NULL != fTofPointsColl) iRefId = fTofPointsColl->IndexOf( vPtsRef[0] ); TString cstr = "Save V-Hit "; - cstr += Form(" %3d %3d 0x%08x %3d 0x%08x", // %3d %3d + cstr += Form(" %3d %3d 0x%08x %3d 0x%08x %8.2f %6.2f", // %3d %3d fiNbHits, iNbChanInHit, iDetId, iLastChan, - iRefId); //vPtsRef.size(),vPtsRef[0]) - // dWeightedTime,dWeightedPosY) + iRefId, //vPtsRef.size(),vPtsRef[0]) + dWeightedTime, + dWeightedPosY); + cstr += Form(", DigiSize: %lu ", vDigiIndRef.size()); cstr += ", DigiInds: "; diff --git a/reco/detectors/tof/CbmTofFindTracks.cxx b/reco/detectors/tof/CbmTofFindTracks.cxx index fbd3083dee6eb94426021dfb640336d6221aa4fe..c3ebf38d937f67261689e791d1f4a25d42e3d57a 100644 --- a/reco/detectors/tof/CbmTofFindTracks.cxx +++ b/reco/detectors/tof/CbmTofFindTracks.cxx @@ -1710,7 +1710,9 @@ void CbmTofFindTracks::FindVertex() { w, fMinNofHits); - if (w > (Double_t) + if ( + w + > (Double_t) fMinNofHits) { // for further analysis request minimum number of hits fVTXNorm += w; fVTX_T += w * pTrk->GetFitT(0.); @@ -1844,24 +1846,23 @@ void CbmTofFindTracks::FillHistograms() { if (pTrk->GetNofHits() < GetNReqStations()) continue; // fill Pull histos only for complete tracks CbmTofHit* pHit = (CbmTofHit*) fTofHitArray->At(iH); - //if (0 == fMapStationRpcId[iSt]) pHit->SetTime(pTrk->GetT0()); // set time of fake hit, abandoned /* - cout << " -D- CbmTofFindTracks::FillHistograms: "<< iSt <<", " - <<fMapStationRpcId[iSt]<<", "<< iH <<", "<< iH0 <<", "<<pHit->ToString() << endl; - */ + cout << " -D- CbmTofFindTracks::FillHistograms: "<< iSt <<", " + <<fMapStationRpcId[iSt]<<", "<< iH <<", "<< iH0 <<", "<<pHit->ToString() << endl; + */ Double_t dDZ = pHit->GetZ() - tPar->GetZ(); // z- Distance to reference point Double_t dDX = pHit->GetX() - pTrk->GetFitX( - pHit->GetZ()); // - tPar->GetX() - tPar->GetTx()*dDZ; + pHit->GetZ()); // - tPar->GetX() - tPar->GetTx()*dDZ; Double_t dDY = pHit->GetY() - pTrk->GetFitY(pHit->GetZ()); // - tPar->GetTy()*dDZ; Double_t dDT = pHit->GetTime() - pTrk->GetFitT( - pHit->GetZ()); // pTrk->GetTdif(fMapStationRpcId[iSt]); + pHit->GetZ()); // pTrk->GetTdif(fMapStationRpcId[iSt]); Double_t dDTB = fTrackletTools->GetTdif(pTrk, fMapStationRpcId[iSt], @@ -1869,20 +1870,21 @@ void CbmTofFindTracks::FillHistograms() { Double_t dTOT = pHit->GetCh() / 10.; // misuse of channel field Double_t dZZ = pHit->GetZ() - tPar->GetZy(pHit->GetY()); - LOG(debug) << Form( - " St %d Id 0x%08x Hit %2d, Z %6.2f - DX %6.2f, DY %6.2f, Z %6.2f, " - "DT %6.2f, %6.2f, ZZ %6.2f, Tt %6.4f ", - iSt, - fMapStationRpcId[iSt], - iH, - pHit->GetZ(), - dDX, - dDY, - dDZ, - dDT, - dDTB, - dZZ, - dTt) << tPar->ToString(); + LOG(debug) + << Form(" St %d Id 0x%08x Hit %2d, Z %6.2f - DX %6.2f, DY %6.2f, " + "Z %6.2f, DT %6.2f, %6.2f, ZZ %6.2f, Tt %6.4f ", + iSt, + fMapStationRpcId[iSt], + iH, + pHit->GetZ(), + dDX, + dDY, + dDZ, + dDT, + dDTB, + dZZ, + dTt) + << tPar->ToString(); vhPullX[iSt]->Fill(dDX); vhPullY[iSt]->Fill(dDY); @@ -1899,10 +1901,10 @@ void CbmTofFindTracks::FillHistograms() { fhPullY_Smt->Fill((Double_t) fMapRpcIdParInd[fMapStationRpcId[iSt]], dDY); /* - fhPullT_Smt->Fill((Double_t)fMapRpcIdParInd[fMapStationRpcId[iSt]], fTrackletTools->GetTdif(pTrk,fMapStationRpcId[iSt], pHit) ); - fhPullX_Smt->Fill((Double_t)fMapRpcIdParInd[fMapStationRpcId[iSt]], fTrackletTools->GetXdif(pTrk,fMapStationRpcId[iSt], pHit) ); - fhPullY_Smt->Fill((Double_t)fMapRpcIdParInd[fMapStationRpcId[iSt]], fTrackletTools->GetYdif(pTrk,fMapStationRpcId[iSt], pHit) ); - */ + fhPullT_Smt->Fill((Double_t)fMapRpcIdParInd[fMapStationRpcId[iSt]], fTrackletTools->GetTdif(pTrk,fMapStationRpcId[iSt], pHit) ); + fhPullX_Smt->Fill((Double_t)fMapRpcIdParInd[fMapStationRpcId[iSt]], fTrackletTools->GetXdif(pTrk,fMapStationRpcId[iSt], pHit) ); + fhPullY_Smt->Fill((Double_t)fMapRpcIdParInd[fMapStationRpcId[iSt]], fTrackletTools->GetYdif(pTrk,fMapStationRpcId[iSt], pHit) ); + */ fhPullZ_Smt->Fill((Double_t) fMapRpcIdParInd[fMapStationRpcId[iSt]], dZZ); @@ -1991,7 +1993,7 @@ void CbmTofFindTracks::FillHistograms() { Double_t dDX = pHit->GetX() - pTrk->GetFitX( - pHit->GetZ()); // - tPar->GetX() - tPar->GetTx()*dDZ; + pHit->GetZ()); // - tPar->GetX() - tPar->GetTx()*dDZ; Double_t dDY = pHit->GetY() - pTrk->GetFitY(pHit->GetZ()); // - tPar->GetTy()*dDZ; //Double_t dDT = pHit->GetTime() - pTrk->GetFitT(pHit->GetR()); //pTrk->GetTdif(fMapStationRpcId[iSt]); @@ -2136,7 +2138,6 @@ void CbmTofFindTracks::FillHistograms() { hitpos[2] = fChannelInfo->GetZ(); /* TGeoNode* cNode=*/gGeoManager->GetCurrentNode(); gGeoManager->MasterToLocal(hitpos, hitpos_local); - // Check for consistency of geometry Int_t iChTrafo = CbmTofAddress::GetChannelId(iAddr); Int_t iChMiss = @@ -2152,6 +2153,21 @@ void CbmTofFindTracks::FillHistograms() { 0, CbmTofAddress::GetSmType(iAddr)); CbmTofCell* fChannelInfoMiss = fDigiPar->GetCell(iAddrMiss); + if (NULL == fChannelInfoMiss) { + LOG(fatal) + << Form("Geo consistency check 0x%08x, 0x%08x failed at " + "St%d, z=%7.2f,%7.2f: iChTrafo %d, Miss %d , " + "xloc %6.2f, dx %4.2f", + iAddr, + iAddrMiss, + iSt, + zPos, + zPosMiss, + iChTrafo, + iChMiss, + hitpos_local[0], + fChannelInfo->GetSizex()); + } zPosMiss = fChannelInfoMiss->GetZ() + (Double_t) fhPullZ_Smt_Off->GetBinContent(iRpcInd + 1); @@ -2201,7 +2217,7 @@ void CbmTofFindTracks::FillHistograms() { if ( iH1 < 0) { // find geo element for the missing Station iSt - // Int_t iSmType1 = fMapStationRpcId[iSt1]; (FU) not used + //Int_t iSmType1 = fMapStationRpcId[iSt1]; (FU) not used //if (iSmType1 < 1) continue; fhTrklDT0StMis2->Fill(Double_t(iSt * 10 + iSt1), pTrk->GetFitT(0.) diff --git a/sim/detectors/tof/CbmTofDigitize.cxx b/sim/detectors/tof/CbmTofDigitize.cxx index bbdea0f4674a56db44a34b7b5155c96964b1a874..29d32484959a1380583b8662c35aff6f2d929614 100644 --- a/sim/detectors/tof/CbmTofDigitize.cxx +++ b/sim/detectors/tof/CbmTofDigitize.cxx @@ -456,12 +456,15 @@ Bool_t CbmTofDigitize::LoadBeamtimeValues() { for (Int_t iSm = 0; iSm < iNbSm; iSm++) { fvdSignalVelocityRpc[iSmType][iSm].resize(iNbRpc); - for (Int_t iRpc = 0; iRpc < iNbRpc; iRpc++) + for (Int_t iRpc = 0; iRpc < iNbRpc; iRpc++) { if (0.0 < fDigiBdfPar->GetSigVel(iSmType, iSm, iRpc)) fvdSignalVelocityRpc[iSmType][iSm][iRpc] = fDigiBdfPar->GetSigVel( iSmType, iSm, iRpc); // convert into cm/ns if necessary (FIXME) else fvdSignalVelocityRpc[iSmType][iSm][iRpc] = fdSignalPropSpeed; + LOG(debug) << "Init signal velocity of TSR " << iSmType << iSm << iRpc + << " to " << fvdSignalVelocityRpc[iSmType][iSm][iRpc]; + } } for (Int_t iSm = 0; iSm < iNbSm; iSm++) { @@ -1217,9 +1220,7 @@ Bool_t CbmTofDigitize::MergeSameChanDigis() { fhNbDigiEvtElCh->Fill(fvRpcChOffs[iSmType][iSm][iRpc] + iNbSides * iCh + iSide, iNbDigis); - fhDigiNbElecCh->Fill(iNbDigis); - fhFiredEvtElCh->Fill(fvRpcChOffs[iSmType][iSm][iRpc] + iNbSides * iCh + iSide); if (1 < iNbDigis) @@ -2358,7 +2359,7 @@ Bool_t CbmTofDigitize::DigitizeFlatDisc() { Double_t dChargeCentral = dClustCharge * ComputeClusterAreaOnChannel( - iChanId, dClusterSize, poipos_local[0], poipos_local[1]); + iChanId, dClusterSize, poipos_local[0], poipos_local[1]); LOG(debug2) << "CbmTofDigitize::DigitizeFlatDisc: ChargeCentral " << dChargeCentral << ", " << dClustCharge << Form(", 0x%08x", iChanId) << ", " << dClusterSize << ", " @@ -2717,7 +2718,7 @@ Bool_t CbmTofDigitize::DigitizeFlatDisc() { Double_t dChargeSideCh = dClustCharge * ComputeClusterAreaOnChannel( - iSideChId, dClusterSize, poipos_local[0], poipos_local[1]); + iSideChId, dClusterSize, poipos_local[0], poipos_local[1]); dChargeSideCh /= dClustArea; if (dClustCharge + 0.0000001 < dChargeSideCh) { LOG(error) << "CbmTofDigitize::DigitizeFlatDisc => Side Charge " @@ -2966,7 +2967,7 @@ Bool_t CbmTofDigitize::DigitizeFlatDisc() { Double_t dChargeSideCh = dClustCharge * ComputeClusterAreaOnChannel( - iSideChId, dClusterSize, poipos_local[0], poipos_local[1]); + iSideChId, dClusterSize, poipos_local[0], poipos_local[1]); dChargeSideCh /= dClustArea; // Fee Threshold on charge @@ -3043,7 +3044,7 @@ Bool_t CbmTofDigitize::DigitizeFlatDisc() { Double_t dChargeSideCh = dClustCharge * ComputeClusterAreaOnChannel( - iSideChId, dClusterSize, poipos_local[0], poipos_local[1]); + iSideChId, dClusterSize, poipos_local[0], poipos_local[1]); // Fee Threshold on charge if (dChargeSideCh @@ -4130,16 +4131,16 @@ Bool_t CbmTofDigitize::DigitizeGaussCharge() { dClustToReadout = TMath::Sqrt( TMath::Power(poipos_local[1], 2) + TMath::Power( - poipos_local[0] - - (+(1 - 2 * iRow) * fChannelInfo->GetSizex() / 2.0), - 2)); + poipos_local[0] + - (+(1 - 2 * iRow) * fChannelInfo->GetSizex() / 2.0), + 2)); else // Horizontal => base = bottom/upper edge dClustToReadout = TMath::Sqrt( TMath::Power(poipos_local[0], 2) + TMath::Power( - poipos_local[1] - - (-(1 - 2 * iRow) * fChannelInfo->GetSizey() / 2.0), - 2)); + poipos_local[1] + - (-(1 - 2 * iRow) * fChannelInfo->GetSizey() / 2.0), + 2)); dPadTime += gRandom->Gaus(0.0, fdTimeResElec)