10 #define ProofEventProc_cxx 33 Info(
"Begin",
"starting a simple exercise with process option: %s", option.
Data());
37 void ProofEventProc::SlaveBegin(
TTree * )
49 if ((nm = dynamic_cast<TNamed *>(fInput->FindObject(
"ProofEventProc_Read")))) {
55 if (option ==
"readall") fFullRead =
kTRUE;
57 Info(
"SlaveBegin",
"'%s' reading", (fFullRead ?
"full" :
"optimized"));
59 fPtHist =
new TH1F(
"pt_dist",
"p_{T} Distribution",100,0,5);
60 fPtHist->SetDirectory(0);
61 fPtHist->GetXaxis()->SetTitle(
"p_{T}");
62 fPtHist->GetYaxis()->SetTitle(
"dN/p_{T}dp_{T}");
64 fOutput->Add(fPtHist);
66 fPzHist =
new TH1F(
"pz_dist",
"p_{Z} Distribution",100,0,5.);
67 fPzHist->SetDirectory(0);
68 fPzHist->GetXaxis()->SetTitle(
"p_{Z}");
69 fPzHist->GetYaxis()->SetTitle(
"dN/dp_{Z}");
71 fOutput->Add(fPzHist);
73 fPxPyHist =
new TH2F(
"px_py",
"p_{X} vs p_{Y} Distribution",100,-5.,5.,100,-5.,5.);
74 fPxPyHist->SetDirectory(0);
75 fPxPyHist->GetXaxis()->SetTitle(
"p_{X}");
76 fPxPyHist->GetYaxis()->SetTitle(
"p_{Y}");
78 fOutput->Add(fPxPyHist);
83 pi =
dynamic_cast<TParameter<Int_t> *
>(fInput->FindObject(
"ProofEventProc_TestAbort"));
84 if (pi) fTestAbort = pi->
GetVal();
85 if (fTestAbort < -1 || fTestAbort > 1) {
86 Info(
"SlaveBegin",
"unsupported value for the abort test: %d not in [-1,1] - ignore", fTestAbort);
88 }
else if (fTestAbort > -1) {
89 Info(
"SlaveBegin",
"running abort test: %d", fTestAbort);
93 Abort(
"Test abortion during init", kAbortProcess);
117 if (fEntMin == -1 || entry < fEntMin) fEntMin = entry;
118 if (fEntMax == -1 || entry > fEntMax) fEntMax = entry;
120 if (fTestAbort == 1) {
123 Info(
"Process",
"%lld -> %f", entry, rr);
124 Abort(
"Testing file abortion", kAbortFile);
130 fChain->GetTree()->GetEntry(entry);
132 b_event_fNtrack->GetEntry(entry);
136 if (!fFullRead) b_fTracks->GetEntry(entry);
138 for (
Int_t j=0;j<fTracks->GetEntries();j++){
139 Track *curtrack =
dynamic_cast<Track*
>(fTracks->At(j));
141 fPtHist->Fill(curtrack->GetPt(),1./curtrack->GetPt());
142 fPxPyHist->Fill(curtrack->GetPx(),curtrack->GetPy());
143 if (j == 0) fPzHist->Fill(curtrack->GetPz());
154 void ProofEventProc::SlaveTerminate()
161 if (fProcElem) fProcElem->Add(fEntMin, fEntMax);
164 Warning(
"SlaveTerminate",
"no proc elements list found!");
169 TIter nxpe(fProcElems);
171 while ((o = nxpe())) { fOutput->Add(o); };
175 void ProofEventProc::Terminate()
184 if (
gROOT->IsBatch())
return;
196 TH1F *
hi =
dynamic_cast<TH1F*
>(fOutput->FindObject(
"pz_dist"));
202 }
else {
Warning(
"Terminate",
"no pz dist found"); }
207 TH1F *hf =
dynamic_cast<TH1F*
>(fOutput->FindObject(
"pt_dist"));
213 }
else {
Warning(
"Terminate",
"no pt dist found"); }
216 TH2F *h2f =
dynamic_cast<TH2F*
>(fOutput->FindObject(
"px_py"));
225 Warning(
"Terminate",
"no px py found");
234 void ProofEventProc::CheckRanges()
240 if (!fOutput || (fOutput && fOutput->GetSize() <= 0))
return;
247 if (!fInput || (fInput && fInput->GetSize() <= 0)) {
251 TNamed *ffst =
dynamic_cast<TNamed *
>(fInput->FindObject(
"Range_First_File"));
256 TNamed *flst =
dynamic_cast<TNamed *
>(fInput->FindObject(
"Range_Last_File"));
264 nout->
SetTitle(
"No number of files");
272 nout->
SetTitle(
"No first entry information in first file name");
276 sfst.Remove(0, ifst +
sizeof(
"?fst=") - 1);
277 if (!sfst.IsDigit()) {
278 nout->
SetTitle(
"Badly formatted first entry information in first file name");
282 ProcFileElements *pfef =
dynamic_cast<ProcFileElements *
>(fOutput->FindObject(fn));
284 nout->
SetTitle(
"ProcFileElements for first file not found in the output list");
287 if (pfef->GetFirst() != fst) {
298 nout->
SetTitle(
"No last entry information in last file name");
302 slst.Remove(0, ilst +
sizeof(
"?lst=") - 1);
303 if (!slst.IsDigit()) {
304 nout->
SetTitle(
"Badly formatted last entry information in last file name");
308 ProcFileElements *pfel =
dynamic_cast<ProcFileElements *
>(fOutput->FindObject(fn));
310 nout->
SetTitle(
"ProcFileElements for last file not found in the output list");
313 if (pfel->GetLast() != lst) {
314 nout->
SetTitle(
"Last entry differs");
322 while ((o = nxo())) {
323 if (dynamic_cast<ProcFileElements *>(o)) nproc++;
325 if (fnum->
GetVal() != nproc) {
326 nout->
SetTitle(
"Number of processed files differs");
virtual void Clear(Option_t *="")
virtual void SetLineWidth(Width_t lwidth)
Set the line width.
static constexpr double pi
virtual TVirtualPad * GetPad(Int_t subpadnumber) const
Get a pointer to subpadnumber of this pad.
THist< 1, float, THistStatContent, THistStatUncertainty > TH1F
TVirtualPad * cd(Int_t subpadnumber=0)
Set current canvas & pad.
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
1-D histogram with a float per channel (see TH1 documentation)}
virtual TH1 * DrawCopy(Option_t *option="", const char *name_postfix="_copy") const
Copy this histogram and Draw in the current pad.
Empty file to test TProof::Load in runProof.C and StressProof.cxx in conjunction with ProcFileElement...
Selector to process trees containing Event structures.
TVirtualPad * cd(Int_t subpadnumber=0)
Set Current pad.
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString...
The TNamed class is the base class for all named ROOT classes.
void Info(const char *location, const char *msgfmt,...)
virtual Double_t Rndm()
Machine independent random number generator.
virtual void SetLineColor(Color_t lcolor)
Set the line color.
Named parameter, streamable and storable.
virtual void SetFillColor(Color_t fcolor)
Set the fill area color.
2-D histogram with a float per channel (see TH1 documentation)}
The most important graphics class in the ROOT system.
void Warning(const char *location, const char *msgfmt,...)
R__EXTERN TRandom * gRandom
static constexpr double nm
Mother of all ROOT objects.
virtual void Divide(Int_t nx=1, Int_t ny=1, Float_t xmargin=0.01, Float_t ymargin=0.01, Int_t color=0)
Automatic pad generation by division.
A TTree object has a header with a name and a title.
const AParamType & GetVal() const
float type_of_call hi(const int &, const int &)
virtual void Update()
Update canvas pad buffers.
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
THist< 2, float, THistStatContent, THistStatUncertainty > TH2F
virtual const char * GetTitle() const
Returns title of object.
const char * Data() const
virtual void SetLogy(Int_t value=1)
Set Lin/Log scale for Y.