4 #include<TApplication.h>
10 #include<TClonesArray.h>
34 TApplication myapp(
"myapp", 0, 0);
41 cout <<
" lmd time based studies " << endl;
42 TCanvas* canvas =
new TCanvas(
"canvas",
"canvas", 600, 600);
47 tMC.Add(
"./Lumi_MC_0.root");
50 TClonesArray* true_tracks =
new TClonesArray(
"PndMCTrack");
51 tMC.SetBranchAddress(
"MCTrack", &true_tracks);
53 TClonesArray* true_points =
new TClonesArray(
"PndSdsMCPoint");
54 tMC.SetBranchAddress(
"LMDPoint", &true_points);
82 int nEvents_counted(0);
85 cout <<
" reading " << nEvents <<
" Events " << endl;
86 for (Int_t j = 0; j <
nEvents ; j++) {
91 int nHits = true_points->GetEntriesFast();
93 for (Int_t iHit = 0; iHit <
nHits; iHit++) {
101 int ihalf, iplane, imodule, iside, idie, isensor;
102 lmddim.
Get_sensor_by_id(sensID, ihalf, iplane, imodule, iside, idie, isensor);
108 cout << mcpoint->GetTime() << endl;
111 if (iplane == 3 && iside == 0){
138 double sig_total = 124.63e-27;
141 double lumi_ref = 1e32;
143 double rate_total = sig_total * lumi_ref;
144 cout <<
"\n The total rate at 1.5 GeV/c and " << lumi_ref <<
" mean luminosity to normalize to is " << rate_total <<
" Hz" << endl;
146 double tsim = nEvents_counted / rate_total;
147 cout << nEvents_counted <<
" events correspond to a real time of " << tsim <<
" s " << endl;
180 gROOT->SetStyle(
"Plain");
181 const Int_t NRGBs = 5;
182 const Int_t NCont = 255;
183 Double_t stops[NRGBs] = { 0.00, 0.34, 0.61, 0.84, 1.00 };
184 Double_t red[NRGBs] = { 0.00, 0.00, 0.87, 1.00, 0.51 };
185 Double_t green[NRGBs] = { 0.00, 0.81, 1.00, 0.20, 0.00 };
186 Double_t blue[NRGBs] = { 0.51, 1.00, 0.12, 0.00, 0.00 };
187 TColor::CreateGradientColorTable(NRGBs, stops, red, green, blue, NCont);
188 gStyle->SetNumberContours(NCont);
189 gStyle->SetTitleFont(10*13+2,
"xyz");
190 gStyle->SetTitleSize(0.06,
"xyz");
191 gStyle->SetTitleOffset(1,
"xy");
192 gStyle->SetTitleOffset(1.3,
"z");
193 gStyle->SetLabelFont(10*13+2,
"xyz");
194 gStyle->SetLabelSize(0.06,
"xyz");
195 gStyle->SetLabelOffset(0.009,
"xyz");
196 gStyle->SetPadBottomMargin(0.2);
197 gStyle->SetPadTopMargin(0.15);
198 gStyle->SetPadLeftMargin(0.15);
199 gStyle->SetPadRightMargin(0.20);
200 gStyle->SetOptTitle(0);
201 gStyle->SetOptStat(0);
203 gStyle->SetFrameFillColor(0);
204 gStyle->SetFrameFillStyle(0);
205 TGaxis::SetMaxDigits(3);
210 if ((
int) (
last_percent * 100) == (
int) (percent * 100))
216 for (
int i = 0;
i < len; ++
i) {
217 if (
i < static_cast<int> (len * percent)) {
223 cout <<
"[" << progress <<
"] " << (
static_cast<int> (100 * percent))
int main(int argc, char **argv)
TVector3 hit_pos(hit->GetX(), hit->GetY(), hit->GetZ())
TVector3 Transform_global_to_lmd_local(const TVector3 &point, bool isvector=false, bool aligned=true)
void DrawProgressBar(int len, double percent)
Int_t GetSensorID() const
void Get_sensor_by_id(const int sensor_id, int &ihalf, int &iplane, int &imodule, int &iside, int &idie, int &isensor)
TVector3 GetPosition() const
static PndLmdDim & Get_instance()