68 cout <<
" BmnQaOffline::Init() " << endl;
70 ioman = FairRootManager::Instance();
74 printf(
"BmnEventHeader. found\n");
78 printf(
"DstEventHeader. found\n");
101 for (
Int_t iTrigger = 0; iTrigger < nTrigs; iTrigger++)
121 for (
Int_t iDet = 0; iDet < nTrigs; iDet++)
134 cout <<
"Geometry '" << setupTag <<
"' can't be loaded from the Geometry Database" << endl;
145 vector<TString> detectors;
150 detectors.push_back(
"TRIGGERS");
153 vector<BmnQaHistoManager*> managers;
155 managers.push_back(
coordinate[iDet]->GetManager());
158 managers.push_back(
time[iDet]->GetManager());
161 managers.push_back(
calorimeter[iDet]->GetManager());
163 managers.push_back(
triggers->GetManager());
166 for (
Int_t iDet = 0; iDet <
nDets + 1; iDet++) {
167 directories[iDet] =
ioman->GetOutFile()->mkdir(detectors[iDet].Data());
168 directories[iDet]->
cd();
169 managers[iDet]->WriteToFile();
172 ioman->GetOutFile()->mkdir(
"DST")->cd();
173 dst->GetManager()->WriteToFile();
202 vector<TString> dets = {
"MWPC",
"SILICON",
"GEM",
"CSC",
"TOF400",
"TOF700",
"DCH"};
205 for (
size_t iDet = 0; iDet < dets.size(); iDet++)
206 for (
size_t iHit = 0; iHit < dets.size(); iHit++) {
218 for (
auto hit : hits) {
233 }
else if (detName.
Contains(
"SILICON")) {
235 }
else if (detName.
Contains(
"CSC")) {
249 }
else if (detName.
Contains(
"TOF700")) {
252 }
else if (detName.
Contains(
"DCH")) {
255 }
else if (detName.
Contains(
"MWPC")) {
269 }
else if (detName.
Contains(
"ZDC")) {
296 Int_t module = dig->GetModule();
297 Int_t station = dig->GetStation();
298 Int_t layer = dig->GetStripLayer();
300 ->
H1(
TString::Format(
"%s_1d, Distribution of fired strips, Stat %d Mod %d Lay %d", detName.
Data(), station,
302 ->
Fill(dig->GetStripNumber());
315 Int_t module = dig->GetModule();
316 Int_t station = dig->GetStation();
317 Int_t layer = dig->GetStripLayer();
319 ->
H2(
TString::Format(
"%s_2d, Distribution of fired strips vs. signal, Stat %d Mod %d Lay %d",
320 detName.
Data(), station, module, layer))
321 ->
Fill(dig->GetStripNumber(), dig->GetStripSignal());
334 ->
Fill(dig->GetPlane());
337 ->
Fill(dig->GetTime());
348 ->
Fill(dig->GetWireNumber());
359 ->
Fill(dig->GetStrip());
362 ->
Fill(dig->GetAmplitude());
375 ->
Fill(dig->GetIX());
378 ->
Fill(dig->GetIY());
383 ->
Fill(dig->GetChannel());
386 ->
Fill(dig->GetAmp());
399 ->
Fill(dig->GetMod());
402 ->
Fill(dig->GetTime());
405 ->
Fill(dig->GetAmp());
416 const Int_t nDims = 3;
420 ->H1(
Form(
"%sDST_1d, Distribution of total multiplicity",
prefix.Data()))
426 ->H1(
Form(
"%sDST_1d, Distribution of momenta",
prefix.Data()))
428 dst->GetManager()->H1(
Form(
"%sDST_1d, Distribution of Nhits",
prefix.Data()))->Fill(track->
GetNHits());
433 Double_t xyzFirst[nDims] = {parFirst->GetX(), parFirst->GetY(), parFirst->GetZ()};
434 Double_t xyzLast[nDims] = {parLast->GetX(), parLast->GetY(), parLast->GetZ()};
436 Double_t txtyFirst[] = {parFirst->GetTx(), parFirst->GetTy()};
437 Double_t txtyLast[] = {parLast->GetTx(), parLast->GetTy()};
439 for (
Int_t iDim = 0; iDim < nDims; iDim++) {
441 ->H1(
Form(
"%sDST_1d, Distribution of start%s",
prefix.Data(),
dim[iDim].Data()))
442 ->Fill(xyzFirst[iDim]);
443 if (!
dim[iDim].Contains(
"Z"))
445 ->H1(
Form(
"%sDST_1d, Distribution of start T%s",
prefix.Data(),
dim[iDim].Data()))
446 ->Fill(txtyFirst[iDim]);
448 ->H1(
Form(
"%sDST_1d, Distribution of last%s",
prefix.Data(),
dim[iDim].Data()))
449 ->Fill(xyzLast[iDim]);
450 if (!
dim[iDim].Contains(
"Z"))
452 ->H1(
Form(
"%sDST_1d, Distribution of last T%s",
prefix.Data(),
dim[iDim].Data()))
453 ->Fill(txtyLast[iDim]);
461 ->H1(
Form(
"%sDST_1d, Distribution of Nhits, %s track",
prefix.Data(),
"SILICON"))
466 for (
Int_t iTrack = 0; iTrack <
fGemTracks->GetEntriesFast(); iTrack++) {
469 ->H1(
Form(
"%sDST_1d, Distribution of Nhits, %s track",
prefix.Data(),
"GEM"))
475 ->H2(
Form(
"%sDST_2d, Vp_{z} vs. Ntracks",
prefix.Data()))
481 const Int_t nDims = 3;
491 for (
Int_t iDim = 0; iDim < nDims; iDim++) {
493 ->
H1(
Form(
"%sDST_1d, %s, Distribution of %s",
prefix.Data(), detName.
Data(),
dim[iDim].Data()))
494 ->
Fill((iDim == 0) ? hit->GetX()
495 : (iDim == 1) ? hit->GetY()
500 ->
H1(
Form(
"%sDST_1d, %s, Distribution of d%s",
prefix.Data(), detName.
Data(),
dim[iDim].Data()))
501 ->
Fill((iDim == 0) ? hit->GetDx() : hit->GetDy());
511 ->
H1(
Form(
"%sDST_1d, %s, Distribution of X cluster size",
prefix.Data(), detName.
Data()))
514 ->
H1(
Form(
"%sDST_1d, %s, Distribution of X' cluster size",
prefix.Data(), detName.
Data()))
518 ->
H1(
Form(
"%sDST_1d, %s, Distribution of X cluster signals",
prefix.Data(), detName.
Data()))
521 ->
H1(
Form(
"%sDST_1d, %s, Distribution of X' cluster signals",
prefix.Data(), detName.
Data()))
529 ->
H1(
Form(
"%sDST_1d, %s, Distribution of X cluster size",
prefix.Data(), detName.
Data()))
532 ->
H1(
Form(
"%sDST_1d, %s, Distribution of X' cluster size",
prefix.Data(), detName.
Data()))
536 ->
H1(
Form(
"%sDST_1d, %s, Distribution of X cluster signals",
prefix.Data(), detName.
Data()))
539 ->
H1(
Form(
"%sDST_1d, %s, Distribution of X' cluster signals",
prefix.Data(), detName.
Data()))
547 ->
H1(
Form(
"%sDST_1d, %s, Distribution of X cluster size",
prefix.Data(), detName.
Data()))
550 ->
H1(
Form(
"%sDST_1d, %s, Distribution of X' cluster size",
prefix.Data(), detName.
Data()))
554 ->
H1(
Form(
"%sDST_1d, %s, Distribution of X cluster signals",
prefix.Data(), detName.
Data()))
557 ->
H1(
Form(
"%sDST_1d, %s, Distribution of X' cluster signals",
prefix.Data(), detName.
Data()))
564 FairTrackParam minPar;
575 map<Double_t, FairTrackParam> zParamMap;
582 minZ =
Min(minZ, hit->GetZ());
583 zParamMap[hit->GetZ()] = FairTrackParam();
585 FairTrackParam par(*parTrack);
588 for (map<Double_t, FairTrackParam>::iterator it = zParamMap.begin(); it != zParamMap.end(); ++it) {
599 if (zParamMap.find(hit->GetZ()) == zParamMap.end()) {
600 std::cout <<
"-E- CbmLitNearestHitTofMerger::DoMerge: Z position " << hit->GetZ()
601 <<
" not found in map. Something is wrong.\n";
603 FairTrackParam tpar(zParamMap[hit->GetZ()]);
604 Double_t dX = tpar.GetX() - hit->GetX();
605 Double_t dY = tpar.GetY() - hit->GetY();
606 if (
Abs(dX) < xCut &&
Abs(dY) < yCut &&
Abs(dX) < minDX &&
Abs(dY) < minDY) {
617 *(parTrack) = minPar;
620 kalman->
Update(parTrack, minHit, chi);
630 for (
Int_t iTrack = 0; iTrack <
fGemTracks->GetEntriesFast(); iTrack++) {
633 const Int_t ndets = 4;
634 const Int_t nSeqs = 4;
635 TString dets[ndets] = {
"CSC",
"DCH1",
"TOF700",
"DCH2"};
641 Int_t idx[ndets][nSeqs] = {{0, -1, 1, 0}, {0, -1, 1, 0}, {0, 0, 1, -1}, {0, 0, -1, 1}};
647 for (
Int_t iDet = 0; iDet < ndets; iDet++) {
649 if (
MatchDetector(&parLast, detSequence[iDet][0], doUpdate[iDet][0], idx[iDet][0]))
650 if (
MatchDetector(&parLast, detSequence[iDet][1], doUpdate[iDet][1], idx[iDet][1]))
651 if (
MatchDetector(&parLast, detSequence[iDet][2], doUpdate[iDet][2], idx[iDet][2])) {
652 BmnHit* hit =
MatchDetector(&parLast, detSequence[iDet][3], doUpdate[iDet][3], idx[iDet][3]);
654 ->H1(
Form(
"%sDST_1d, hAllNo%s",
prefix.Data(), dets[iDet].
Data()))
655 ->Fill(1.0 / parLast.GetQp());
657 ->H2(
Form(
"%sDST_2d, hAllNo%sXY",
prefix.Data(), dets[iDet].
Data()))
658 ->Fill(parLast.GetX(), parLast.GetY());
661 ->H1(
Form(
"%sDST_1d, hAllYes%s",
prefix.Data(), dets[iDet].
Data()))
662 ->Fill(1.0 / parLast.GetQp());
664 ->H2(
Form(
"%sDST_2d, hAllYes%sXY",
prefix.Data(), dets[iDet].
Data()))
665 ->Fill(parLast.GetX(), parLast.GetY());
674 const Int_t ndets = 4;
675 TString dets[ndets] = {
"CSC",
"DCH1",
"TOF700",
"DCH2"};
677 for (
Int_t iDet = 0; iDet < ndets; iDet++) {
685 eff1->
Divide(nom1, denom1);
697 eff2->
Divide(nom2, denom2);
703 const Int_t ndets = 8;
704 TString dets[ndets] = {
"MWPC",
"SILICON",
"GEM",
"CSC",
"TOF400",
"DCH1",
"TOF700",
"DCH2"};
710 for (
Int_t iDet = 0; iDet < ndets; iDet++) {
711 if (!detSequence[iDet])
714 BmnHit* hit = (
BmnHit*)detSequence[iDet]->UncheckedAt(iHit);
716 if (dets[iDet].Contains(
"DCH")) {
717 dets[iDet] = (hit->
GetStation() == 0) ?
"DCH1" :
"DCH2";
745 for (
Int_t iHit = 0; iHit <
fDchHits->GetEntriesFast(); iHit++) {
756 FairTrackParam par(*first);
760 dst->GetManager()->H1(
Form(
"%sDST_1d, hPullX%s",
prefix.Data(), det.
Data()))->Fill(((par.GetX() - X) / dX));
761 dst->GetManager()->H1(
Form(
"%sDST_1d, hPullY%s",
prefix.Data(), det.
Data()))->Fill(((par.GetY() - Y) / dY));
764 vector<TString> trackDets = {
"MWPC",
"SILICON",
"GEM"};
787 FairTrackParam par(*first);
792 ->Fill(((par.GetX() - X) / dX));
795 ->Fill(((par.GetY() - Y) / dY));
800 vector<TString> hitDets = {
"CSC",
"TOF400",
"TOF700"};
816 FairTrackParam par(*first);
821 ->Fill(((par.GetX() - X) / dX));
824 ->Fill(((par.GetY() - Y) / dY));
846 : (className.
Contains(
"Silicon")) ?
"SILICON"
847 : (className.
Contains(
"CSC")) ?
"CSC"
851 if (className.
Contains(
"Tof") && (z < zBorder))
853 else if (className.
Contains(
"Tof") && (z > zBorder))
858 for (
Int_t iStat = 0; iStat <
fDetGem->GetNStations(); iStat++)
861 ->H2(
Form(
"%sDST_2d, hOccupancy%s, stat %d",
prefix.Data(), detName.
Data(), iStat))
863 }
else if (detName.
Contains(
"SILICON")) {
867 ->H2(
Form(
"%sDST_2d, hOccupancy%s, stat %d",
prefix.Data(), detName.
Data(), iStat))
869 }
else if (detName.
Contains(
"CSC")) {
870 for (
Int_t iStat = 0; iStat <
fDetCsc->GetNStations(); iStat++)
873 ->H2(
Form(
"%sDST_2d, hOccupancy%s, stat %d",
prefix.Data(), detName.
Data(), iStat))
876 dst->GetManager()->H2(
Form(
"%sDST_2d, hOccupancy%s",
prefix.Data(), detName.
Data()))->Fill(x, y);
882 const Int_t ndets = 5;
883 TString dets[ndets] = {
"SILICON",
"GEM",
"CSC",
"TOF400",
"TOF700"};
885 for (
Int_t iDet = 0; iDet < ndets; iDet++) {
886 if (dets[iDet].Contains(
"GEM"))
887 for (
Int_t iStat = 0; iStat <
fDetGem->GetNStations(); iStat++)
889 Form(
"%sDST_2d, hOccupancy%s, stat %d",
prefix.Data(), dets[iDet].
Data(), iStat)));
891 else if (dets[iDet].Contains(
"SILICON"))
894 Form(
"%sDST_2d, hOccupancy%s, stat %d",
prefix.Data(), dets[iDet].
Data(), iStat)));
896 else if (dets[iDet].Contains(
"CSC"))
897 for (
Int_t iStat = 0; iStat <
fDetCsc->GetNStations(); iStat++)
899 Form(
"%sDST_2d, hOccupancy%s, stat %d",
prefix.Data(), dets[iDet].
Data(), iStat)));
925 const Int_t nLayers = 2;
926 TString layers[nLayers] = {
"X",
"X'"};
933 : (className.
Contains(
"Silicon")) ?
"SILICON"
934 : (className.
Contains(
"CSC")) ?
"CSC"
943 ->H1(
Form(
"%sDST_1d, Ave. strip value per hit in %s (%s)",
prefix.Data(), detName.
Data(),
947 ->H1(
Form(
"%sDST_1d, Ave. strip value per hit in %s (%s)",
prefix.Data(), detName.
Data(),
950 }
else if (detName.
Contains(
"SILICON")) {
953 ->H1(
Form(
"%sDST_1d, Ave. strip value per hit in %s (%s)",
prefix.Data(), detName.
Data(),
957 ->H1(
Form(
"%sDST_1d, Ave. strip value per hit in %s (%s)",
prefix.Data(), detName.
Data(),
960 }
else if (detName.
Contains(
"CSC")) {
963 ->H1(
Form(
"%sDST_1d, Ave. strip value per hit in %s (%s)",
prefix.Data(), detName.
Data(),
967 ->H1(
Form(
"%sDST_1d, Ave. strip value per hit in %s (%s)",
prefix.Data(), detName.
Data(),
979 const Int_t nLayers = 2;
980 TString layers[nLayers] = {
"X",
"X'"};
982 vector<TString> trackDets = {
"SILICON",
"GEM"};
1019 if (
detector.Contains(
"SILICON")) {
1025 for (
Int_t iLayer = 0; iLayer < nLayers; iLayer++) {
1027 ->H1(
Form(
"%sDST_1d, Ave. strip value per track in %s (%s)",
prefix.Data(),
detector.Data(),
1029 ->Fill(sumLower / track->
GetNHits());
1031 ->H1(
Form(
"%sDST_1d, Ave. strip value per track in %s (%s)",
prefix.Data(),
detector.Data(),
1033 ->Fill(sumUpper / track->
GetNHits());
1041 for (
Int_t iLayer = 0; iLayer < nLayers; iLayer++) {
1043 ->H1(
Form(
"%sDST_1d, Ave. strip value per track in %s (%s)",
prefix.Data(),
detector.Data(),
1045 ->Fill(sumLower / track->
GetNHits());
1047 ->H1(
Form(
"%sDST_1d, Ave. strip value per track in %s (%s)",
prefix.Data(),
detector.Data(),
1049 ->Fill(sumUpper / track->
GetNHits());
char * Form(const char *fmt,...)
Double_t GetStripTotalSignalInLowerLayer()
Strip layer characteristics of the hit (total signal, cluster size, strip position as the cluster mea...
Double_t GetStripTotalSignalInUpperLayer()
Int_t GetClusterSizeInLowerLayer()
Int_t GetClusterSizeInUpperLayer()
BmnQaHistoManager * GetManager()
BmnQaHistoManager * GetManager()
BmnQaHistoManager * GetManager()
Int_t GetClusterSizeInUpperLayer()
Double_t GetStripTotalSignalInUpperLayer()
Int_t GetClusterSizeInLowerLayer()
Double_t GetStripTotalSignalInLowerLayer()
Strip layer characteristics of the hit (total signal, cluster size, strip position as the cluster mea...
Int_t GetTof2HitIndex() const
Int_t GetGemTrackIndex() const
Accessors.
Int_t GetTof1HitIndex() const
TH2 * H2(const TString &name) const
Return pointer to TH2 histogram.
TH1 * H1(const TString &name) const
Return pointer to TH1 histogram.
Short_t GetStation() const
BmnStatus TGeoTrackPropagate(FairTrackParam *par, Double_t zOut, Int_t pdg, vector< Double_t > *F, Double_t *length, Bool_t isField)
BmnStatus Update(FairTrackParam *par, const BmnHit *hit, Double_t &chiSq)
void GetCommonInfo(TClonesArray *, BmnTimeDetQa *, TString)
TClonesArray * fGemTracks
TClonesArray ** DETECTORS
void doOccupancy(TClonesArray *)
void doResidualsPullsAnal()
void GetDistributionOfFiredStripsVsSignal(TClonesArray *, BmnCoordinateDetQa *, TString)
BmnSiliconStationSet * fDetSilicon
BmnCSCStationSet * fDetCsc
TClonesArray * fDchTracks
void doAverageStripValuePerTrack()
virtual InitStatus Init()
BmnHit * MatchDetector(FairTrackParam *, TClonesArray *, Bool_t, Int_t)
void doHitsDistributions(TClonesArray *, BmnDstQa *, TString)
Bool_t ReadDstTree(TString)
BmnEventHeader * fBmnHeader
static Int_t fCurrentEvent
void changeHistoContent(TH2F *)
void GetDistributionOfFiredStrips(TClonesArray *, BmnCoordinateDetQa *, TString)
void GetMwpcDchInfo(TClonesArray *, BmnTimeDetQa *, TString)
map< TClonesArray *, TString > fTrigCorr
TClonesArray * fSiliconTracks
virtual void Exec(Option_t *opt)
void GetTofInfo(TClonesArray *, BmnTimeDetQa *, TString)
void doAverageStripValuePerHit(TClonesArray *)
TClonesArray * fTof400Hits
BmnCalorimeterDetQa ** calorimeter
BmnCoordinateDetQa ** coordinate
TClonesArray * fGlobalTracks
DstEventHeader * fDstHeader
TClonesArray * fSiliconHits
BmnGemStripStationSet * fDetGem
TClonesArray * fTof700Hits
TClonesArray * fMwpcTracks
void GetBasicTrackDistributions()
BmnOfflineQaSteering * fSteering
Double_t GetStripTotalSignalInLowerLayer()
Strip layer characteristics of the hit (total signal, cluster size, strip position as the cluster mea...
Double_t GetStripTotalSignalInUpperLayer()
Int_t GetClusterSizeInLowerLayer()
Int_t GetClusterSizeInUpperLayer()
BmnQaHistoManager * GetManager()
FairTrackParam * GetParamFirst()
Int_t GetNHits() const
Accessors.
Int_t GetHitIndex(Int_t iHit) const
FairTrackParam * GetParamLast()
BmnQaHistoManager * GetManager()
int LoadSetupToGeoManager(string_view setup_tag)
Load selected geometry setup from the Local Geometry Database and create gGeoManager instance.
string GetLastApprovedSetupTag(string_view tag_prefix)
Get tag for the last approved setup corresponding to the pattern.
virtual Double_t GetBinWidth(Int_t bin) const
virtual Int_t GetNbinsY() const
virtual Int_t GetNbinsX() const
virtual void SetMaximum(Double_t maximum=-1111)
virtual Int_t Fill(const char *name, Double_t w)
virtual void SetMinimum(Double_t minimum=-1111)
virtual Bool_t Divide(const TH1 *h1)
virtual void Scale(Double_t c1=1, Option_t *option="")
virtual void Sumw2(Bool_t flag=kTRUE)
virtual Int_t Fill(const char *namex, const char *namey, Double_t w)
void SetBinContent(Int_t bin, Double_t content) override
virtual Double_t GetBinContent(Int_t bin) const
Int_t GetEntriesFast() const
TObject * At(Int_t idx) const override
TObject * UncheckedAt(Int_t i) const
const char * Data() const
static TString Format(const char *fmt,...)
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
UniRun.h Class for the table: run_.
static UniRun * GetRun(int period_number, int run_number)
get run from the database
double * GetFieldVoltage()
get field voltage of the current run
Double_t Min(Double_t a, Double_t b)