34 return BmnHodoAddress::GetFlatIndex(address);
40 canvas_array->
SetName(
"Canvas");
44 int variantes = BmnHodoAddress::GetMaxFlatIndex();
45 TH2F* profile_hist =
new TH2F(
"profile",
"profile", 18, 0, 18, 100, 0, 50);
46 profile_hist->
SetTitle(
"Hodoscope profile; Strip # ; Z^{2} ");
61 double ScWallCtrEnergy = 0.;
63 int n_events = (max_entries > 0 && tree->
GetEntries() > max_entries) ? max_entries : tree->
GetEntries();
64 cout << n_events << endl;
65 for (
int ev = 0; ev < n_events; ev++)
69 cout <<
"Event: " << ev << endl;
72 auto BT = !(TrigPattern ^ (1 << 7));
73 auto ArmAnd = !(TrigPattern ^ (1 << 2));
74 auto ArmOr = !(TrigPattern ^ (1 << 3));
84 if (ThisDigi->
fFitR2 > 0.5)
87 if (cell_id != 17 && cell_id != 18 && cell_id != 27 && cell_id != 28)
101 if (ThisDigi->
fFitR2 > 0.4)
109 auto gain = ThisDigi->
GetGain();
114 responses[strip][side] = ThisDigi->
GetSignal();
118 if (responses[
i][0] * responses[
i][1] > 0.001)
119 profile_hist->
Fill(
i, (responses[
i][0] + responses[
i][1]));
123 canvas_array->
Add(prof);
124 result_array->
Add(profile_hist);
125 profile_hist->
Draw(
"colz");
129 canvas_array->
Add(canv_ptr);
132 result_array->
Add(hist_ptr);
136 TFile* result_file =
new TFile((result_file_name +
".root").Data(),
"RECREATE");
139 while ((obj_ptr = (
TObjArray*)nx_iter())) {
140 if (obj_ptr ==
nullptr)
142 printf(
"Writing %s object\n", obj_ptr->
GetName());
145 printf(
"file %s was written\n", (result_file_name +
".root").Data());
146 result_file->
Close();
150 ((
TCanvas*)canvas_array->
At(
i))->
SaveAs((result_file_name +
".pdf(").Data());
151 ((
TCanvas*)canvas_array->
At(canvas_array->
GetLast()))->SaveAs((result_file_name +
".pdf)").Data());
152 printf(
"file %s was written\n", (result_file_name +
".pdf").Data());
void memset(T *dest, T i, size_t num)
Copy to memory block [@dest, @dest+@num] num number of times the value of i of type @T with size @typ...
char * Form(const char *fmt,...)
float fFitR2
Energy deposition from fit of waveform [adc counts].
int fTimeMax
Energy deposition from waveform [adc counts].
static uint32_t GetAddress(uint32_t StripId, uint32_t StripSide, uint32_t Gain)
Return address from system ID, StripId, StripSide, Gain.
Data class for BmnHodo digital signal processing.
uint32_t GetGain() const
Gain.
uint32_t GetStripSide() const
Strip Side.
uint32_t GetStripId() const
Class for experimental data at digi level.
uint32_t GetCellId() const
void SetName(const char *name)
T * Get(const char *namecycle)
static TFile * Open(const char *name, Option_t *option="", const char *ftitle="", Int_t compress=ROOT::RCompressionSetting::EDefaults::kUseCompiledDefault, Int_t netopt=0)
void Close(Option_t *option="") override
void SetTitle(const char *title) override
void Draw(Option_t *option="") override
virtual void SetStats(Bool_t stats=kTRUE)
TH1D * ProjectionY(const char *name="_py", Int_t firstxbin=0, Int_t lastxbin=-1, Option_t *option="") const
virtual Int_t Fill(const char *namex, const char *namey, Double_t w)
Int_t GetEntriesFast() const
TObject * At(Int_t idx) const override
Int_t GetLast() const override
void Add(TObject *obj) override
virtual const char * GetName() const
virtual Int_t Write(const char *name=nullptr, Int_t option=0, Int_t bufsize=0)
virtual void SaveAs(const char *filename="", Option_t *option="") const
virtual Int_t GetEntry(Long64_t entry, Int_t getall=0)
virtual Long64_t GetEntries() const
Int_t SetBranchAddress(const char *bname, T **add, TBranch **ptr=nullptr)
void hodo_profile(TString converted_root_file, TString result_file_name, int max_entries)
int make_flat_index(uint32_t StripId, uint32_t StripSide, uint32_t Gain)