48 TSelEvent::TSelEvent(TTree *)
49 : fReadType(0), fDebug(kFALSE), fCHist(0), fPtHist(0),
50 fNTracksHist(0), fEventName(0), fTracks(0), fHighPt(0), fMuons(0),
51 fH(0), b_event_fType(0), b_fEventName(0), b_event_fNtrack(0), b_event_fNseg(0),
52 b_event_fNvertex(0), b_event_fFlag(0), b_event_fTemperature(0),
53 b_event_fMeasures(0), b_event_fMatrix(0), b_fClosestDistance(0),
54 b_event_fEvtHdr(0), b_fTracks(0), b_fHighPt(0), b_fMuons(0),
55 b_event_fLastTrack(0), b_event_fWebHistogram(0), b_fH(0),
56 b_event_fTriggerBits(0), b_event_fIsValid(0)
63 TSelEvent::TSelEvent()
64 : fReadType(0), fDebug(kFALSE), fCHist(0), fPtHist(0),
65 fNTracksHist(0), fEventName(0), fTracks(0), fHighPt(0), fMuons(0),
66 fH(0), b_event_fType(0), b_fEventName(0), b_event_fNtrack(0), b_event_fNseg(0),
67 b_event_fNvertex(0), b_event_fFlag(0), b_event_fTemperature(0),
68 b_event_fMeasures(0), b_event_fMatrix(0), b_fClosestDistance(0),
69 b_event_fEvtHdr(0), b_fTracks(0), b_fHighPt(0), b_fMuons(0),
70 b_event_fLastTrack(0), b_event_fWebHistogram(0), b_fH(0),
71 b_event_fTriggerBits(0), b_event_fIsValid(0)
80 void TSelEvent::Begin(TTree *)
82 TString option = GetOption();
86 Bool_t found_readtype=kFALSE;
87 Bool_t found_debug=kFALSE;
92 while ((obj = nxt())){
93 sinput=obj->GetName();
95 if (sinput.Contains(
"PROOF_Benchmark_ReadType")){
96 if ((fReadType = dynamic_cast<TPBReadType *>(obj))) found_readtype = kTRUE;
99 if (sinput.Contains(
"PROOF_BenchmarkDebug")){
100 TParameter<Int_t>* a=
dynamic_cast<TParameter<Int_t>*
>(obj);
107 Error(
"Begin",
"PROOF_BenchmarkDebug not type TParameter<Int_t>*");
113 if (!found_readtype){
114 fReadType =
new TPBReadType(TPBReadType::kReadOpt);
115 Warning(
"Begin",
"PROOF_Benchmark_ReadType not found; using default: %d",
116 fReadType->GetType());
119 Warning(
"Begin",
"PROOF_BenchmarkDebug not found; using default: %d",
129 void TSelEvent::SlaveBegin(TTree *tree)
133 TString option = GetOption();
135 Bool_t found_readtype=kFALSE;
136 Bool_t found_debug=kFALSE;
142 while ((obj = nxt())){
143 sinput=obj->GetName();
145 if (sinput.Contains(
"PROOF_Benchmark_ReadType")){
146 if ((fReadType = dynamic_cast<TPBReadType *>(obj))) found_readtype = kTRUE;
149 if (sinput.Contains(
"PROOF_BenchmarkDebug")){
150 TParameter<Int_t>* a=
dynamic_cast<TParameter<Int_t>*
>(obj);
157 Error(
"SlaveBegin",
"PROOF_BenchmarkDebug not type TParameter"
164 if (!found_readtype){
165 fReadType =
new TPBReadType(TPBReadType::kReadOpt);
166 Warning(
"SlaveBegin",
"PROOF_Benchmark_ReadType not found; using default: %d",
167 fReadType->GetType());
170 Warning(
"SlaveBegin",
"PROOF_BenchmarkDebug not found; using default: %d",
174 fPtHist =
new TH1F(
"pt_dist",
"p_{T} Distribution", 100, 0, 5);
175 fPtHist->SetDirectory(0);
176 fPtHist->GetXaxis()->SetTitle(
"p_{T}");
177 fPtHist->GetYaxis()->SetTitle(
"dN/p_{T}dp_{T}");
179 fNTracksHist =
new TH1F(
"ntracks_dist",
"N_{Tracks} per Event"
180 " Distribution", 100, 50, 150);
182 fNTracksHist->SetCanExtend(TH1::kAllAxes);
183 fNTracksHist->SetDirectory(0);
184 fNTracksHist->GetXaxis()->SetTitle(
"N_{Tracks}");
185 fNTracksHist->GetYaxis()->SetTitle(
"N_{Events}");
201 Bool_t TSelEvent::Process(Long64_t entry)
209 if (fReadType->GetType() != TPBReadType::kReadNotSpecified){
210 switch (fReadType->GetType()){
211 case TPBReadType::kReadFull:
213 fChain->GetTree()->GetEntry(entry);
214 fNTracksHist->Fill(fNtrack);
216 for(Int_t j=0;j<fTracks->GetEntries();j++){
217 Track* curtrack =
dynamic_cast<Track*
>(fTracks->At(j));
218 fPtHist->Fill(curtrack->GetPt(),1./curtrack->GetPt());
222 case TPBReadType::kReadOpt:
224 b_event_fNtrack->GetEntry(entry);
226 fNTracksHist->Fill(fNtrack);
229 b_fTracks->GetEntry(entry);
230 for(Int_t j=0;j<fTracks->GetEntries();j++){
231 Track* curtrack =
dynamic_cast<Track*
>(fTracks->At(j));
232 fPtHist->Fill(curtrack->GetPt(),1./curtrack->GetPt());
237 case TPBReadType::kReadNo:
241 Error(
"Process",
"Read type not supported; %d", fReadType->GetType());
254 void TSelEvent::SlaveTerminate()
263 void TSelEvent::Terminate()