Skip to content
Snippets Groups Projects

Draft: Rich: add hit acceptance restriction to HitProducer

Closed Martin Beyer requested to merge ma.beyer/cbmroot:rich_small into master
2 files
+ 40
1
Compare changes
  • Side-by-side
  • Inline

Files

@@ -19,6 +19,7 @@
#include "CbmRichGeoManager.h"
#include "CbmRichHit.h"
#include "CbmRichPoint.h"
#include "CbmSetup.h"
#include <FairRootManager.h>
#include <Logger.h>
@@ -60,6 +61,7 @@ InitStatus CbmRichHitProducer::Init()
manager->Register("RichHit", "RICH", fRichHits, IsOutputBranchPersistent("RichHit"));
CbmRichDigiMapManager::GetInstance();
CbmSetup::Instance()->GetGeoTag(ECbmModuleId::kRich, fGeoTag);
return kSUCCESS;
}
@@ -89,16 +91,18 @@ void CbmRichHitProducer::Exec(Option_t* /*option*/)
}
timer.Stop();
Int_t nHits = fRichHits->GetEntriesFast();
stringstream logOut;
logOut << setw(20) << left << GetName() << " [";
logOut << fixed << setw(8) << setprecision(1) << right << timer.RealTime() * 1000. << " ms] ";
logOut << "TS " << fNofTs;
if (fCbmEvents != nullptr) logOut << ", events " << nEvents;
logOut << ", digis " << nDigisUsed << " / " << nDigisAll;
logOut << ", digis " << nDigisUsed << " / " << nDigisAll << ", hits " << nHits;
LOG(info) << logOut.str();
fNofTs++;
fNofDigisAll += nDigisAll;
fNofDigisUsed += nDigisUsed;
fNofHitsAll += nHits;
fTime += timer.RealTime();
}
@@ -134,9 +138,25 @@ void CbmRichHitProducer::ProcessDigi(CbmEvent* event, Int_t digiIndex)
TVector3 detPoint;
CbmRichGeoManager::GetInstance().RotatePoint(&posPoint, &detPoint, !fRotationNeeded);
if (!RestrictToAccDay1(detPoint)) return;
AddHit(event, detPoint, digi->GetTime(), digiIndex);
}
Bool_t CbmRichHitProducer::RestrictToAccDay1(TVector3& posHit)
{
if (!fRestrictToAccDay1) return true;
// cut 2 strips & 1 column, on each side (in x) of the detector -> 784 pmts total remaining
if (fGeoTag.Contains("v21a")) {
if (posHit.X() > -75. && posHit.X() < 75.) return true;
}
else if (fGeoTag.Contains("v22") || fGeoTag.Contains("v23a")) {
if (posHit.X() > -75.5 && posHit.X() < 75.5) return true;
}
else {
return true;
}
return false;
}
void CbmRichHitProducer::AddHit(CbmEvent* event, TVector3& posHit, Double_t time, Int_t index)
{
@@ -162,6 +182,7 @@ void CbmRichHitProducer::Finish()
if (fCbmEvents) LOG(info) << "Events : " << fNofEvents;
LOG(info) << "Digis / TS : " << fixed << setprecision(2) << Double_t(fNofDigisAll) / Double_t(fNofTs);
LOG(info) << "Used digis / TS : " << fixed << setprecision(2) << Double_t(fNofDigisUsed) / Double_t(fNofTs);
LOG(info) << "Hits / TS : " << fixed << setprecision(2) << Double_t(fNofHitsAll) / Double_t(fNofTs);
LOG(info) << "Time / TS : " << fixed << setprecision(2) << 1000. * fTime / Double_t(fNofTs) << " ms";
LOG(info) << "=====================================\n";
}
Loading