20 LOG(debug) <<
"Loading charge calibration ...";
21 fModuleParSet = std::make_unique<CbmStsParSetModule>(
"CbmParSetModule",
"STS parameters",
"Default");
25 FairRootManager* ioman = FairRootManager::Instance();
26 if (ioman ==
nullptr)
return kERROR;
28 fCbmEvtArray = (TClonesArray*) ioman->GetObject(
"CbmEvent");
30 fGlbTrkArray = (TClonesArray*) ioman->GetObject(
"GlobalTrack");
31 fStsTrkArray = (TClonesArray*) ioman->GetObject(
"StsTrack");
32 fRchTrkArray = (TClonesArray*) ioman->GetObject(
"RichTrack");
33 fMchTrkArray = (TClonesArray*) ioman->GetObject(
"MuchTrack");
34 fTrdTrkArray = (TClonesArray*) ioman->GetObject(
"TrdTrack");
35 fTofTrkArray = (TClonesArray*) ioman->GetObject(
"TofTrack");
37 fStsHitArray = (TClonesArray*) ioman->GetObject(
"StsHit");
38 fStsCluArray = (TClonesArray*) ioman->GetObject(
"StsCluster");
49 LOG(debug) << Form(
"Booking histograms for module: 0x%x", address);
69 h_name = Form(
"0x%x_Q_asymmetry%s", address, mod);
70 fH1D[h_name] = std::make_unique<TH1D>(h_name.c_str(), h_name.c_str(), 1000, -1.01, +1.01);
72 h_name = Form(
"0x%x_Qp_vs_Qn%s", address, mod);
73 fH2D[h_name] = std::make_unique<TH2D>(h_name.c_str(), h_name.c_str(), n_side_binning.n_of_bins,
74 n_side_binning.x_min, n_side_binning.x_max, p_side_binning.n_of_bins,
75 p_side_binning.x_min, p_side_binning.x_max);
77 h_name = Form(
"0x%x_Qp_vs_size%s", address, mod);
78 fH2D[h_name] = std::make_unique<TH2D>(h_name.c_str(), h_name.c_str(), p_side_binning.n_of_bins,
81 h_name = Form(
"0x%x_Qn_vs_size%s", address, mod);
82 fH2D[h_name] = std::make_unique<TH2D>(h_name.c_str(), h_name.c_str(), n_side_binning.n_of_bins,
85 h_name = Form(
"0x%x_psize_vs_nsize%s", address, mod);
89 h_name = Form(
"0x%x_y_vs_x%s", address, mod);
90 fH2D[h_name] = std::make_unique<TH2D>(h_name.c_str(), h_name.c_str(), x_binning.n_of_bins, x_binning.x_min,
91 x_binning.x_max, y_binning.n_of_bins, y_binning.x_min, y_binning.x_max);
93 h_name = Form(
"0x%x_cluster_dt%s", address, mod);
95 std::make_unique<TH1D>(h_name.c_str(), h_name.c_str(), t_binning.n_of_bins, t_binning.x_min, t_binning.x_max);
104 for (
int hit_evt_idx = 0; hit_evt_idx < nb_sts_hits; hit_evt_idx++) {
111 for (
int evt_glob_trk_idx = 0; evt_glob_trk_idx < nb_of_glob_trk; evt_glob_trk_idx++) {
120 if (hit ==
nullptr)
return;
141 fH2D[Form(
"0x%x_Qp_vs_Qn%s", address, mod)]->Fill(q_n, q_p);
142 fH2D[Form(
"0x%x_Qp_vs_size%s", address, mod)]->Fill(q_p, size_p);
143 fH2D[Form(
"0x%x_Qn_vs_size%s", address, mod)]->Fill(q_n, size_n);
144 fH2D[Form(
"0x%x_psize_vs_nsize%s", address, mod)]->Fill(size_p, size_n);
145 fH2D[Form(
"0x%x_y_vs_x%s", address, mod)]->Fill(hit->
GetX(), hit->
GetY());
157 float trk_p_val = TMath::Prob(trk->
GetChi2(), trk->
GetNDF());
160 int32_t mvd_trk_size = sts_trk_idx != -1 &&
fStsTrkArray !=
nullptr
164 int32_t sts_trk_size = sts_trk_idx != -1 &&
fStsTrkArray !=
nullptr
168 int32_t rich_trk_size = rich_trk_idx != -1 &&
fRchTrkArray !=
nullptr
172 int32_t much_trk_size = much_trk_idx != -1 &&
fMchTrkArray !=
nullptr
176 int32_t trd_trk_size = trd_trk_idx != -1 &&
fTrdTrkArray !=
nullptr
180 int32_t tof_trk_size = tof_trk_idx != -1 &&
fTofTrkArray !=
nullptr
195 LOG(debug) << Form(
"Processing %d StsHit that were attached to a CATrack", sts_trk_size);
201 for (
int hit_idx = 0; hit_idx < sts_trk_size; hit_idx++) {
213 double avg_nb_sts_hits = 0;
214 double avg_nb_of_glob_trk = 0;
215 for (uint32_t evt_idx = 0; evt_idx < nb_events; evt_idx++) {
220 LOG_IF(info, nb_events) <<
"Running CbmStsHitAna - Event-like - Entry: " <<
entry_ <<
"\tEvents: " << nb_events
221 <<
"\tAvg StsHit/Events: " << avg_nb_sts_hits / nb_events
222 <<
"\tAvg GlobalTrk/Events: " << avg_nb_of_glob_trk / nb_events;
223 LOG_IF(info, !nb_events) <<
"Running CbmStsHitAna - Event-like - Entry: " <<
entry_ <<
"\tEvents: " << nb_events;
227 LOG(info) <<
"Running CbmStsHitAna - Time-like - Entry: " <<
entry_ <<
"\tStsHits: " << n_of_hits;
228 for (uint32_t hit_idx = 0; hit_idx < n_of_hits; hit_idx++) {
Data class for STS tracks.
Class characterising one event by a collection of links (indices) to data objects,...
size_t GetNofData() const
uint32_t GetIndex(ECbmDataType type, uint32_t iData) const
int32_t GetStsTrackIndex() const
int32_t GetRichRingIndex() const
int32_t GetTofTrackIndex() const
int32_t GetMuchTrackIndex() const
int32_t GetTrdTrackIndex() const
int32_t GetAddress() const
CbmCutMap * fAnalysisCuts
std::unordered_set< int32_t > fAddressBook
std::map< std::string, std::unique_ptr< TH2D > > fH2D
void SaveToFile()
It write all mapped objects to the FairRunAna sink file.
void LoadSetup()
Load the STS setup and fill the map with XYZ boundaries for each STS setup element....
std::unordered_map< int32_t, std::vector< double > > fStsGeoInfo
std::map< std::string, std::unique_ptr< TH1D > > fH1D
TClonesArray * fStsHitArray
TClonesArray * fStsCluArray
TClonesArray * fTofTrkArray
void BookHistograms(int32_t)
std::unique_ptr< CbmStsParSetModule > fModuleParSet
void ProcessHit(CbmStsHit *hit, bool belong_to_trk=false)
Process an STS hit It filters hits based on the provided CbmCutMap and fill the corresponding histogr...
TClonesArray * fTrdTrkArray
TClonesArray * fMchTrkArray
std::vector< const char * > fHitModifier
TClonesArray * fGlbTrkArray
void ProcessEvent(CbmEvent *)
Process an Cbm events It filters event based on the provided CbmCutMap.
void ProcessGlobalTrack(CbmGlobalTrack *)
Process an STS hit attached to a Track It filters hits based on the provided CbmCutMap and check the ...
std::string fCalibrationFile
TClonesArray * fStsTrkArray
TClonesArray * fCbmEvtArray
TClonesArray * fRchTrkArray
data class for a reconstructed 3-d hit in the STS
Parameters for one STS module.
int32_t GetStsHitIndex(int32_t iHit) const
int32_t GetHitCluSizeB(CbmStsHit *hit=nullptr, TClonesArray *clusters=nullptr)
Get the cluster size of a hit from the back side.
double GetHitChargeAsy(CbmStsHit *hit=nullptr, TClonesArray *clusters=nullptr)
Get the charge asymmetry of a hit.
static const double kStsDy
double GetHitChargeF(CbmStsHit *hit=nullptr, TClonesArray *clusters=nullptr)
Get the charge of a hit from the front side.
double GetHitTimeB(CbmStsHit *hit=nullptr, TClonesArray *clusters=nullptr)
Get the charge of a hit from the back side.
std::pair< HBinning, HBinning > ChargeBinning(const CbmStsParModule &par_module, const uint32_t max_clu_size=1)
Generate the charge binning from module config obj.
static const double kStsClock
double GetHitChargeB(CbmStsHit *hit=nullptr, TClonesArray *clusters=nullptr)
Get the charge of a hit from the back side.
double GetHitTimeF(CbmStsHit *hit=nullptr, TClonesArray *clusters=nullptr)
Get the charge of a hit from the front side.
static const double kStsDx
int32_t GetHitCluSizeF(CbmStsHit *hit=nullptr, TClonesArray *clusters=nullptr)
Get the cluster size of a hit from the front side.
Structure to hold the binning for 1D histogram.