Commit d8ee7a8d authored by Norbert Herrmann's avatar Norbert Herrmann
Browse files

introduce tracking station assignment to tof counters

parent 560ad9df
...@@ -38,11 +38,13 @@ ClassImp(CbmTofDigiBdfPar) ...@@ -38,11 +38,13 @@ ClassImp(CbmTofDigiBdfPar)
, fdDeadtime(5.0) , fdDeadtime(5.0)
, fdSignalPropSpeed(0.0) , fdSignalPropSpeed(0.0)
, fiNbSmTypes(0) , fiNbSmTypes(0)
, fiNbTrackingStations(0)
, fiNbSm() , fiNbSm()
, fiNbRpc() , fiNbRpc()
, fiNbGaps() , fiNbGaps()
, fdGapSize() , fdGapSize()
, fdSigVel() , fdSigVel()
, fiTrkStation()
, fiNbCh() , fiNbCh()
, fiChType() , fiChType()
, fiChOrientation() , fiChOrientation()
...@@ -109,6 +111,8 @@ void CbmTofDigiBdfPar::putParams(FairParamList* l) { ...@@ -109,6 +111,8 @@ void CbmTofDigiBdfPar::putParams(FairParamList* l) {
l->add(Form("GapSize%03d", iSmType), fdGapSize[iSmType]); l->add(Form("GapSize%03d", iSmType), fdGapSize[iSmType]);
for (Int_t iSmType = 0; iSmType < fiNbSmTypes; iSmType++) for (Int_t iSmType = 0; iSmType < fiNbSmTypes; iSmType++)
l->add(Form("SigVel%03d", iSmType), fdSigVel[iSmType]); l->add(Form("SigVel%03d", iSmType), fdSigVel[iSmType]);
for (Int_t iSmType = 0; iSmType < fiNbSmTypes; iSmType++)
l->add(Form("TrkStation%03d", iSmType), fiTrkStation[iSmType]);
for (Int_t iSmType = 0; iSmType < fiNbSmTypes; iSmType++) for (Int_t iSmType = 0; iSmType < fiNbSmTypes; iSmType++)
l->add(Form("NbCh%03d", iSmType), fiNbCh[iSmType]); l->add(Form("NbCh%03d", iSmType), fiNbCh[iSmType]);
for (Int_t iSmType = 0; iSmType < fiNbSmTypes; iSmType++) for (Int_t iSmType = 0; iSmType < fiNbSmTypes; iSmType++)
...@@ -224,6 +228,23 @@ Bool_t CbmTofDigiBdfPar::getParams(FairParamList* l) { ...@@ -224,6 +228,23 @@ Bool_t CbmTofDigiBdfPar::getParams(FairParamList* l) {
} // for( Int_t iSmType = 0; iSmType < fiNbSmTypes; iSmType ++) } // for( Int_t iSmType = 0; iSmType < fiNbSmTypes; iSmType ++)
fiTrkStation.resize(fiNbSmTypes);
for (Int_t iSmType = 0; iSmType < fiNbSmTypes; iSmType++) {
fiTrkStation[iSmType].Set(fiNbSm[iSmType] * fiNbRpc[iSmType]);
if (!l->fill(Form("TrkStation%03d", iSmType), &(fiTrkStation[iSmType]))) {
LOG(info) << "CbmTofDigiBdfPar::getParams => parameter "
<< Form("TrkStation%03d", iSmType)
<< " not found in the text file. "
<< "Initialized to 0 ";
for (Int_t iRpc = 0; iRpc < fiNbSm[iSmType] * fiNbRpc[iSmType]; iRpc++)
fiTrkStation[iSmType].SetAt(0, iRpc);
//return kFALSE;
} // if ( ! l->fill( Form("SigVel%03d", iSmType), &(fdSigVel[iSmType]) ) )
for (Int_t iRpc = 0; iRpc < fiNbSm[iSmType] * fiNbRpc[iSmType]; iRpc++)
fiNbTrackingStations =
TMath::Max(fiNbTrackingStations, fiTrkStation[iSmType][iRpc] + 1);
} // for( Int_t iSmType = 0; iSmType < fiNbSmTypes; iSmType ++)
fiNbCh.resize(fiNbSmTypes); fiNbCh.resize(fiNbSmTypes);
for (Int_t iSmType = 0; iSmType < fiNbSmTypes; iSmType++) { for (Int_t iSmType = 0; iSmType < fiNbSmTypes; iSmType++) {
fiNbCh[iSmType].Set(fiNbRpc[iSmType]); fiNbCh[iSmType].Set(fiNbRpc[iSmType]);
...@@ -567,6 +588,18 @@ void CbmTofDigiBdfPar::SetSigVel(Int_t iSmType, ...@@ -567,6 +588,18 @@ void CbmTofDigiBdfPar::SetSigVel(Int_t iSmType,
LOG(error) << "Invalid SMType " << iSmType; LOG(error) << "Invalid SMType " << iSmType;
} }
} }
Int_t CbmTofDigiBdfPar::GetTrackingStation(Int_t iSmType,
Int_t iSm,
Int_t iRpc) const {
if (iSmType < fiNbSmTypes) {
if (iSm < fiNbSm[iSmType] && iRpc < fiNbRpc[iSmType])
return fiTrkStation[iSmType][iSm * fiNbRpc[iSmType] + iRpc];
else
return 0.0;
} // if( iSmType < fiNbSmTypes )
else
return 0.0;
}
Int_t CbmTofDigiBdfPar::GetNbChan(Int_t iSmType, Int_t iRpc) const { Int_t CbmTofDigiBdfPar::GetNbChan(Int_t iSmType, Int_t iRpc) const {
if (iSmType < fiNbSmTypes) { if (iSmType < fiNbSmTypes) {
if (iRpc < fiNbRpc[iSmType]) if (iRpc < fiNbRpc[iSmType])
...@@ -705,22 +738,26 @@ void CbmTofDigiBdfPar::printParams() { ...@@ -705,22 +738,26 @@ void CbmTofDigiBdfPar::printParams() {
sIndex = " Rpc index |-- "; sIndex = " Rpc index |-- ";
Int_t iMaxRpcNb = 0; Int_t iMaxRpcNb = 0;
TString* sGapsNb = new TString[fiNbSmTypes]; TString* sGapsNb = new TString[fiNbSmTypes];
TString* sGapsSz = new TString[fiNbSmTypes]; TString* sGapsSz = new TString[fiNbSmTypes];
TString* sSigVel = new TString[fiNbSmTypes]; TString* sSigVel = new TString[fiNbSmTypes];
TString* sChNb = new TString[fiNbSmTypes]; TString* sChNb = new TString[fiNbSmTypes];
TString* sChType = new TString[fiNbSmTypes]; TString* sChType = new TString[fiNbSmTypes];
TString* sChOrient = new TString[fiNbSmTypes]; TString* sChOrient = new TString[fiNbSmTypes];
TString* sTrkStation = new TString[fiNbSmTypes];
for (Int_t iSmType = 0; iSmType < fiNbSmTypes; iSmType++) { for (Int_t iSmType = 0; iSmType < fiNbSmTypes; iSmType++) {
sSmNb += Form("%3d ", GetNbSm(iSmType)); sSmNb += Form("%3d ", GetNbSm(iSmType));
sRpcNb += Form("%3d ", GetNbRpc(iSmType)); sRpcNb += Form("%3d ", GetNbRpc(iSmType));
sGapsNb[iSmType] = Form(" Nb of Gaps in SM type %3d:|-> ", iSmType); sGapsNb[iSmType] = Form(" Nb of Gaps in SM type %3d:|-> ", iSmType);
sGapsSz[iSmType] = Form(" Gap Size(mm) in SM type %3d:|-> ", iSmType); sGapsSz[iSmType] = Form(" Gap Size(mm) in SM type %3d:|-> ", iSmType);
sSigVel[iSmType] = Form(" SigVel(cm/ps) in SM type %3d:|-> ", iSmType); sSigVel[iSmType] = Form(" SigVel(cm/ps) in SM type %3d:|-> ", iSmType);
sChNb[iSmType] = Form(" Nb of Chan in SM type %3d:|-> ", iSmType); sChNb[iSmType] = Form(" Nb of Chan in SM type %3d:|-> ", iSmType);
sChType[iSmType] = Form(" Chan Type in SM type %3d:|-> ", iSmType); sChType[iSmType] = Form(" Chan Type in SM type %3d:|-> ", iSmType);
sChOrient[iSmType] = Form(" Chan orient. in SM type %3d:|-> ", iSmType); sChOrient[iSmType] =
Form(" Chan Orientation in SM type %3d:|-> ", iSmType);
sTrkStation[iSmType] =
Form(" TrackStations in SM type %3d:|-> ", iSmType);
if (iMaxRpcNb < fiNbRpc[iSmType]) iMaxRpcNb = fiNbRpc[iSmType]; if (iMaxRpcNb < fiNbRpc[iSmType]) iMaxRpcNb = fiNbRpc[iSmType];
...@@ -734,10 +771,11 @@ void CbmTofDigiBdfPar::printParams() { ...@@ -734,10 +771,11 @@ void CbmTofDigiBdfPar::printParams() {
sChType[iSmType] += "pad "; sChType[iSmType] += "pad ";
else else
sChType[iSmType] += "str "; sChType[iSmType] += "str ";
if (1 == GetChanOrient(iSmType, iRpc))
sChOrient[iSmType] += "hor "; sChOrient[iSmType] += Form(" %d ", GetChanOrient(iSmType, iRpc));
else for (Int_t iSm = 0; iSm < fiNbSm[iSmType]; iSm++)
sChOrient[iSmType] += "ver "; sTrkStation[iSmType] +=
Form(" %d ", GetTrackingStation(iSmType, iSm, iRpc));
} }
} // for( Int_t iSmType = 0; iSmType < fiNbSmTypes; iSmType ++) } // for( Int_t iSmType = 0; iSmType < fiNbSmTypes; iSmType ++)
for (Int_t iRpc = 0; iRpc < iMaxRpcNb; iRpc++) for (Int_t iRpc = 0; iRpc < iMaxRpcNb; iRpc++)
...@@ -753,6 +791,7 @@ void CbmTofDigiBdfPar::printParams() { ...@@ -753,6 +791,7 @@ void CbmTofDigiBdfPar::printParams() {
LOG(info) << sChNb[iSmType]; LOG(info) << sChNb[iSmType];
LOG(info) << sChType[iSmType]; LOG(info) << sChType[iSmType];
LOG(info) << sChOrient[iSmType]; LOG(info) << sChOrient[iSmType];
LOG(info) << sTrkStation[iSmType];
} // for( Int_t iSmType = 0; iSmType < fiNbSmTypes; iSmType ++) } // for( Int_t iSmType = 0; iSmType < fiNbSmTypes; iSmType ++)
// Beamtime variables // Beamtime variables
......
...@@ -13,6 +13,9 @@ ...@@ -13,6 +13,9 @@
#ifndef CBMTOFDIGIBDFPAR_H #ifndef CBMTOFDIGIBDFPAR_H
#define CBMTOFDIGIBDFPAR_H 1 #define CBMTOFDIGIBDFPAR_H 1
#include <CbmTofAddress.h> // for accessors
#include <CbmTofHit.h> // for accessors
#include <Rtypes.h> // for THashConsistencyHolder, ClassDef #include <Rtypes.h> // for THashConsistencyHolder, ClassDef
#include <RtypesCore.h> // for Int_t, Double_t, Bool_t #include <RtypesCore.h> // for Int_t, Double_t, Bool_t
#include <TArrayD.h> // for TArrayD #include <TArrayD.h> // for TArrayD
...@@ -66,6 +69,13 @@ public: ...@@ -66,6 +69,13 @@ public:
Int_t GetNbDet() const; Int_t GetNbDet() const;
Int_t GetDetUId(Int_t iDet); Int_t GetDetUId(Int_t iDet);
Int_t GetDetInd(Int_t iAddr); Int_t GetDetInd(Int_t iAddr);
Int_t GetTrackingStation(Int_t iSmType, Int_t iSm, Int_t iRpc) const;
Int_t GetTrackingStation(CbmTofHit* pHit) const {
return GetTrackingStation(CbmTofAddress::GetSmType(pHit->GetAddress()),
CbmTofAddress::GetSmId(pHit->GetAddress()),
CbmTofAddress::GetRpcId(pHit->GetAddress()));
};
Int_t GetNbTrackingStations() const { return fiNbTrackingStations; };
// Beamtime variables // Beamtime variables
TString GetInputFileName() const { return fsBeamInputFile; }; TString GetInputFileName() const { return fsBeamInputFile; };
...@@ -127,12 +137,15 @@ private: ...@@ -127,12 +137,15 @@ private:
// Geometry variables, text to be generated in the CreateGeometry macros // Geometry variables, text to be generated in the CreateGeometry macros
Double_t fdSignalPropSpeed; // -> in parameter? Double_t fdSignalPropSpeed; // -> in parameter?
Int_t fiNbSmTypes; // Int_t fiNbSmTypes; //
Int_t fiNbTrackingStations; //
TArrayI fiNbSm; // [fiNbSmTypes] TArrayI fiNbSm; // [fiNbSmTypes]
TArrayI fiNbRpc; // [fiNbSmTypes] TArrayI fiNbRpc; // [fiNbSmTypes]
std::vector<TArrayI> fiNbGaps; // [fiNbSmTypes][fiNbRpc] std::vector<TArrayI> fiNbGaps; // [fiNbSmTypes][fiNbRpc]
std::vector<TArrayD> fdGapSize; // [fiNbSmTypes][fiNbRpc] std::vector<TArrayD> fdGapSize; // [fiNbSmTypes][fiNbRpc]
std::vector<TArrayD> std::vector<TArrayD>
fdSigVel; // [fiNbSmTypes][fiNbSm*fiNbRpc] // Signal velocity fdSigVel; // [fiNbSmTypes][fiNbSm*fiNbRpc] // Signal velocity
std::vector<TArrayI>
fiTrkStation; // [fiNbSmTypes][fiNbSm*fiNbRpc] // Signal velocity
std::vector<TArrayI> fiNbCh; // [fiNbSmTypes][fiNbRpc] std::vector<TArrayI> fiNbCh; // [fiNbSmTypes][fiNbRpc]
std::vector<TArrayI> fiChType; // [fiNbSmTypes][fiNbRpc] std::vector<TArrayI> fiChType; // [fiNbSmTypes][fiNbRpc]
std::vector<TArrayI> std::vector<TArrayI>
......
...@@ -1042,7 +1042,7 @@ Bool_t CbmTofFindTracks::WriteHistos() { ...@@ -1042,7 +1042,7 @@ Bool_t CbmTofFindTracks::WriteHistos() {
// ----- Public method Exec -------------------------------------------- // ----- Public method Exec --------------------------------------------
void CbmTofFindTracks::Exec(Option_t* opt) { void CbmTofFindTracks::Exec(Option_t* opt) {
if (gLogger->IsLogNeeded(fair::Severity::debug)) { if (gLogger->IsLogNeeded(fair::Severity::debug)) {
fDigiBdfPar->printParams(); fDigiBdfPar->printParams();
} }
if (!fEventsColl) { if (!fEventsColl) {
// fTofHitArray = (TClonesArray*)fTofHitArrayIn->Clone(); // fTofHitArray = (TClonesArray*)fTofHitArrayIn->Clone();
...@@ -1171,29 +1171,30 @@ void CbmTofFindTracks::ExecFind(Option_t* /*opt*/) { ...@@ -1171,29 +1171,30 @@ void CbmTofFindTracks::ExecFind(Option_t* /*opt*/) {
Int_t iSt = GetStationOfAddr(iDetId); Int_t iSt = GetStationOfAddr(iDetId);
MarkStationFired(iSt); MarkStationFired(iSt);
LOG(debug) << Form( LOG(debug) << Form("Exec found Hit %02d, addr 0x%08x, sta %02d, %02d, HM "
"Exec found Hit %02d, addr 0x%08x, sta %02d, %02d, HM %02d, X %6.2f(%3.2f) Y " "%02d, X %6.2f(%3.2f) Y "
"%6.2f(%3.2f) Z %6.2f(%3.2f) T %6.2f(%3.2f) (%6.2f)", "%6.2f(%3.2f) Z %6.2f(%3.2f) T %6.2f(%3.2f) (%6.2f)",
iHit, iHit,
pHit->GetAddress(), pHit->GetAddress(),
GetStationOfAddr(iDetId), GetStationOfAddr(iDetId),
fDigiBdfPar->GetTrackingStation(pHit), fDigiBdfPar->GetTrackingStation(pHit),
fStationHMul[GetStationOfAddr(iDetId)], fStationHMul[GetStationOfAddr(iDetId)],
pHit->GetX(), pHit->GetX(),
pHit->GetDx(), pHit->GetDx(),
pHit->GetY(), pHit->GetY(),
pHit->GetDy(), pHit->GetDy(),
pHit->GetZ(), pHit->GetZ(),
pHit->GetDz(), pHit->GetDz(),
pHit->GetTime(), pHit->GetTime(),
pHit->GetTimeError(), pHit->GetTimeError(),
dTcor); dTcor);
} }
LOG(debug) << Form("CbmTofFindTracks::Exec NStationsFired %d > %d Min ?, NbStations %d", LOG(debug) << Form(
GetNStationsFired(), "CbmTofFindTracks::Exec NStationsFired %d > %d Min ?, NbStations %d",
GetMinNofHits(), GetNStationsFired(),
fDigiBdfPar->GetNbTrackingStations()); GetMinNofHits(),
fDigiBdfPar->GetNbTrackingStations());
if (GetNStationsFired() < GetMinNofHits()) { if (GetNStationsFired() < GetMinNofHits()) {
fInspectEvent = kFALSE; // mark event as non trackable fInspectEvent = kFALSE; // mark event as non trackable
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment