ATLAS Offline Software
Loading...
Searching...
No Matches
CheckFlow_New Class Reference

#include <CheckFlow_New.h>

Inheritance diagram for CheckFlow_New:
Collaboration diagram for CheckFlow_New:

Public Member Functions

 CheckFlow_New (const std::string &name, ISvcLocator *pSvcLocator)
virtual StatusCode initialize () override
virtual StatusCode execute (const EventContext &ctx) override
 Execute method.
virtual StatusCode finalize () override
virtual StatusCode sysInitialize () override
 Override sysInitialize.
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies.
bool filterPassed (const EventContext &ctx) const
void setFilterPassed (bool state, const EventContext &ctx) const
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const
const EventContext & getContext () const
 Deprecated methods (use the ones with EventContext).
bool filterPassed () const
void setFilterPassed (bool state) const

Public Attributes

 InputCollections
 job = AlgSequence()
 EvtMax
 OutputLevel
 Output
 CheckFlow_New = job.CheckFlow_New
 McEventKey
 RapidityCutMax

Protected Member Functions

virtual bool isReEntrant () const override final
 Legacy algorithms are not thread-safe.
void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed.

Private Types

enum  { n_ptbin =16 , n_etabin =8 }
typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

StringProperty m_key {this, "McEventKey", "FLOW_EVENT"}
BooleanProperty m_produceHistogram {this, "HistogramFlag", true}
DoubleProperty m_bcut_min {this, "ImpactCutMin", 0.}
DoubleProperty m_bcut_max {this, "ImpactCutMax", 99.}
DoubleProperty m_ptcut_min {this, "PtCutMin", 0.}
DoubleProperty m_ptcut_max {this, "PtCutMax", 999999.}
DoubleProperty m_rapcut_min {this, "RapidityCutMin", 0.}
DoubleProperty m_rapcut_max {this, "RapidityCutMax", 5.5}
TH1D * m_hist_Psi_n_true [6] {}
TH1D * m_hist_Psi_n_reco [6] {}
TH1D * m_hist_psi_corr_true [36] {}
TH1D * m_hist_psi_corr_reco [36] {}
TH1D * m_hist_Psi_n_ebe [6] {}
TH1D * m_hist_Psi_n_ebe_pt [6] {}
TH1D * m_hist_vn_ebe [6] {}
TProfile * m_profile_pt_dep [6][n_etabin] {}
TProfile * m_profile_eta_dep [6][n_ptbin] {}
TProfile * m_profile_pt_dep_reco [6][n_etabin] {}
TProfile * m_profile_eta_dep_reco [6][n_ptbin] {}
TProfile * m_profile_resolution {}
SG::ReadHandleKey< HijingEventParamsm_hijingKey {this, "HijingEventParmsKey","Hijing_event_params"}
TruthHelper::GenAccessIOm_tesIO {}
DataObjIDColl m_extendedExtraObjects
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default).
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default).
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Detailed Description

Definition at line 28 of file CheckFlow_New.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
private
Enumerator
n_ptbin 
n_etabin 

Definition at line 47 of file CheckFlow_New.h.

47 {
48 n_ptbin=16,
49 n_etabin=8
50 };

Constructor & Destructor Documentation

◆ CheckFlow_New()

CheckFlow_New::CheckFlow_New ( const std::string & name,
ISvcLocator * pSvcLocator )

Member Function Documentation

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareGaudiProperty ( Gaudi::Property< T, V, H > & hndl,
const SG::VarHandleKeyType &  )
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareProperty ( Gaudi::Property< T, V, H > & t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ detStore()

const ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

◆ evtStore()

ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

◆ execute()

StatusCode CheckFlow_New::execute ( const EventContext & ctx)
overridevirtual

Execute method.

Provides access to the EventContext if needed but is non-const as opposed to AthReentrantAlgorithm.

Implements AthAlgorithm.

Definition at line 203 of file CheckFlow_New.cxx.

203 {
204 msg(MSG::INFO) << ">>> CheckFlow_New from execute" << endmsg;
205
206 float pt_binvals[n_ptbin+1]={0.0,0.25,0.5,1.0,1.5,2.0,2.5,3.0,3.5,4.0,6.0,8.0,12.0,16.0,20.0,30.0,40.0};
207 float eta_bin_max = 4.0;
208
209 SG::ReadHandle<HijingEventParams> hijing_pars{m_hijingKey, ctx};
210 float b = hijing_pars->get_b();
211 float Psi_n[6]{},Psi_n_reco[6]{};
212 float Psi_n_reco_pos[6]{},Psi_n_reco_neg[6]{};
213 for(int ihar=0;ihar<6;ihar++){Psi_n[ihar]=hijing_pars->get_psi(ihar+1);}
214 msg(MSG::INFO)<<"SOUMYA "<<hijing_pars->get_psi(1)<<" "<<hijing_pars->get_psi(2)<<" "<<hijing_pars->get_psi(3)
215 <<hijing_pars->get_psi(4)<<" "<<hijing_pars->get_psi(5)<<" "<<hijing_pars->get_psi(6)<<" "<<b << endmsg;
216
217
218 // Check cut on impact parameter b
219 if(b<m_bcut_min || b>m_bcut_max) return StatusCode::SUCCESS;
220
221 using TrigArr = std::array<double, 6>;
222 double ngenerated_pos = 0,ngenerated_pt_pos=0;
223 TrigArr cos_n_pos{},sin_n_pos{},cos_n_pt_pos{},sin_n_pt_pos{};
224 double ngenerated_neg = 0,ngenerated_pt_neg=0;
225 TrigArr cos_n_neg{},sin_n_neg{},cos_n_pt_neg{},sin_n_pt_neg{};
226
227
228 // Iterate over all MC particles
229 std::vector<HepMC::ConstGenParticlePtr> particles;
230 StatusCode stat = m_tesIO->getMC(particles, false, m_key);
231 if (stat.isFailure()) {
232 msg(MSG::ERROR) << "Could not find " << m_key << endmsg;
233 return stat;
234 }
235 for (auto pitr: particles) {
236 int pid = pitr->pdg_id();
237 double pt = pitr->momentum().perp();
238 double rapid = pitr->momentum().pseudoRapidity();
239 double phi = pitr->momentum().phi();
240 msg(MSG::DEBUG)
241 << " PID = " << pid << " Status = " << pitr->status()
242 << " Eta = " << rapid << " Phi = " << phi<< endmsg;
243
244 if( (std::abs(rapid) >= m_rapcut_min) && (std::abs(rapid) <= m_rapcut_max) &&
245 (std::abs(pt) >= m_ptcut_min) && (std::abs(pt) <= m_ptcut_max) ) {
246
247 for(int ihar=0;ihar<6;ihar++){
248 float temp=(ihar+1)*(phi-Psi_n[ihar]);
249
250 int ieta= (int)(std::abs(rapid)*n_etabin/eta_bin_max);
251 if(ieta>=0 && ieta<n_etabin) m_profile_pt_dep [ihar][ieta]->Fill(pt/1000,cos(temp));
252
253
254 float temp_pt=pt/1000;
255 for(int ipt=0;ipt<n_ptbin;ipt++){
256 if(temp_pt<pt_binvals[ipt+1]){
257 m_profile_eta_dep[ihar][ipt]->Fill(rapid ,cos(temp));
258 break;
259 }
260 }
261 //
262 const auto cosTerm = std::cos( (ihar+1)*phi);
263 const auto sinTerm = std::sin( (ihar+1)*phi);
264 //
265 if( rapid >3.2 && rapid< 4.9){
266 cos_n_pos[ihar]+=cosTerm;
267 sin_n_pos[ihar]+=sinTerm;
268 ngenerated_pos++;
269
270 cos_n_pt_pos[ihar]+=pt*cosTerm;
271 sin_n_pt_pos[ihar]+=pt*sinTerm;
272 ngenerated_pt_pos +=pt;
273 }
274 if( rapid <-3.2 && rapid >-4.9){
275 cos_n_neg[ihar]+=cosTerm;
276 sin_n_neg[ihar]+=sinTerm;
277 ngenerated_neg++;
278
279 cos_n_pt_neg[ihar]+=pt*cosTerm;
280 sin_n_pt_neg[ihar]+=pt*sinTerm;
281 ngenerated_pt_neg +=pt;
282 }
283
284 }
285 }
286 }
287
288
289// Calculate the event by event vn and also the reconstructed Psi_n angles
290// Also make correlation histos between Psi_n_truth and Psi_n_reco
291 float cos_n[6]{},sin_n[6]{},cos_n_pt[6]{},sin_n_pt[6]{};
292 const auto total = ngenerated_pos+ngenerated_neg;
293 const auto nTotalPt = ngenerated_pt_pos+ngenerated_pt_neg;
294 if ((total != 0) and (nTotalPt !=0)) [[likely]]{
295 for(int ihar=0;ihar<6;ihar++){
296 //coverity[DIVIDE_BY_ZERO:FALSE]
297 cos_n[ihar] = ( cos_n_pos[ihar]+ cos_n_neg[ihar] ) / total;
298 //coverity[DIVIDE_BY_ZERO:FALSE]
299 sin_n[ihar] = ( sin_n_pos[ihar]+ sin_n_neg[ihar] ) / total;
300
301 float psi_reco=std::atan2(sin_n[ihar],cos_n[ihar])/(ihar+1);
302 m_hist_Psi_n_ebe[ihar]->Fill( (ihar+1)*(psi_reco-Psi_n[ihar]) );
303 m_hist_vn_ebe [ihar]->Fill(std::sqrt(cos_n[ihar]*cos_n[ihar] +sin_n[ihar]*sin_n[ihar] ));
304
305 Psi_n_reco_pos[ihar]=std::atan2(sin_n_pos[ihar],cos_n_pos[ihar])/ (ihar+1);
306 Psi_n_reco_neg[ihar]=std::atan2(sin_n_neg[ihar],cos_n_neg[ihar])/ (ihar+1);
307 Psi_n_reco [ihar]=psi_reco;
308
309 //coverity[DIVIDE_BY_ZERO:FALSE]
310 cos_n_pt[ihar] = ( cos_n_pt_pos[ihar]+ cos_n_pt_neg[ihar] ) / nTotalPt;
311 //coverity[DIVIDE_BY_ZERO:FALSE]
312 sin_n_pt[ihar] = ( sin_n_pt_pos[ihar]+ sin_n_pt_neg[ihar] ) / nTotalPt;
313
314 psi_reco=std::atan2(sin_n_pt[ihar],cos_n_pt[ihar])/(ihar+1);
315 m_hist_Psi_n_ebe_pt[ihar]->Fill( (ihar+1)*(psi_reco-Psi_n[ihar]) );
316 }
317 }
318
319// Make the plots for the correlation between Psi_n truth (for different n) (same for Psi_n reco)
320 for(int ihar=0;ihar<6;ihar++){
321 m_hist_Psi_n_true[ihar]->Fill((ihar+1)*Psi_n[ihar]);
322 m_hist_Psi_n_reco[ihar]->Fill((ihar+1)*Psi_n_reco[ihar]);
323
324 float psi1,psi2;
325 for(int ihar2=0;ihar2<6;ihar2++){
326 psi1=(ihar+1)*Psi_n[ihar];psi2=(ihar2+1)*Psi_n[ihar2];
327 m_hist_psi_corr_true[ihar*6+ihar2]->Fill( std::atan2( std::sin(psi1-psi2),std::cos(psi1-psi2) ) );
328
329 psi1=(ihar+1)*Psi_n_reco[ihar];psi2=(ihar2+1)*Psi_n_reco[ihar2];
330 m_hist_psi_corr_reco[ihar*6+ihar2]->Fill( std::atan2( std::sin(psi1-psi2),std::cos(psi1-psi2) ) );
331 }
332 }
333
334
335
336
337
338// calculate the pt and eta dependence using the Psi_reco angles also fill the resolution TProfile
339 for(int ihar=0;ihar<6;ihar++){
340 m_profile_resolution->Fill( ihar+1, cos( (ihar+1) * (Psi_n_reco_pos[ihar] - Psi_n_reco_neg[ihar]) ) );
341 }
342 for (auto pitr: particles) {
343 double pt = pitr->momentum().perp();
344 double rapid = pitr->momentum().pseudoRapidity();
345 double phi = pitr->momentum().phi();
346 if( (std::abs(rapid) >= m_rapcut_min) && (std::abs(rapid) <= m_rapcut_max) &&
347 (std::abs(pt) >= m_ptcut_min) && (std::abs(pt) <= m_ptcut_max) ) {
348
349 for(int ihar=0;ihar<6;ihar++){
350 float temp=(ihar+1)*(phi-Psi_n_reco_pos[ihar]);
351 if(rapid>0) temp=(ihar+1)*(phi-Psi_n_reco_neg[ihar]);
352
353
354 int ieta= (int)(std::abs(rapid)*n_etabin/eta_bin_max);
355 if(ieta>=0 && ieta<n_etabin) m_profile_pt_dep_reco [ihar][ieta]->Fill(pt/1000,std::cos(temp));
356
357 float temp_pt=pt/1000;
358 for(int ipt=0;ipt<n_ptbin;ipt++){
359 if(temp_pt<pt_binvals[ipt+1]){
360 m_profile_eta_dep_reco[ihar][ipt]->Fill(rapid ,cos(temp));
361 break;
362 }
363 }
364 }
365 }
366 }
367
368
369
370
371
372 return StatusCode::SUCCESS;
373}
Scalar phi() const
phi method
#define endmsg
TH1D * m_hist_psi_corr_reco[36]
TH1D * m_hist_vn_ebe[6]
TProfile * m_profile_pt_dep_reco[6][n_etabin]
StringProperty m_key
TH1D * m_hist_Psi_n_true[6]
TProfile * m_profile_eta_dep[6][n_ptbin]
TProfile * m_profile_resolution
TH1D * m_hist_Psi_n_ebe_pt[6]
TProfile * m_profile_eta_dep_reco[6][n_ptbin]
TH1D * m_hist_Psi_n_reco[6]
TH1D * m_hist_Psi_n_ebe[6]
TruthHelper::GenAccessIO * m_tesIO
TProfile * m_profile_pt_dep[6][n_etabin]
TH1D * m_hist_psi_corr_true[36]
StatusCode getMC(MCParticleCollection &mcParticles, const bool ifgen=false, const std::string &key="GEN_EVENT") const
::StatusCode StatusCode
StatusCode definition for legacy code.
#define likely(x)
MsgStream & msg
Definition testRead.cxx:32

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase & ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ extraOutputDeps()

const DataObjIDColl & AthAlgorithm::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

This list is extended to include symlinks implied by inheritance relations.

Definition at line 50 of file AthAlgorithm.cxx.

51{
52 // If we didn't find any symlinks to add, just return the collection
53 // from the base class. Otherwise, return the extended collection.
54 if (!m_extendedExtraObjects.empty()) {
56 }
57 return Algorithm::extraOutputDeps();
58}
DataObjIDColl m_extendedExtraObjects

◆ filterPassed() [1/2]

bool AthAlgorithm::filterPassed ( ) const
inherited

Definition at line 94 of file AthAlgorithm.cxx.

94 {
95 return filterPassed( Gaudi::Hive::currentContext() );
96}
bool filterPassed() const

◆ filterPassed() [2/2]

bool AthAlgorithm::filterPassed ( const EventContext & ctx) const
inherited

Definition at line 98 of file AthAlgorithm.cxx.

98 {
99 return execState( ctx ).filterPassed();
100}

◆ finalize()

StatusCode CheckFlow_New::finalize ( )
overridevirtual

Definition at line 375 of file CheckFlow_New.cxx.

375 {
376 msg(MSG::INFO) << ">>> CheckFlow_New from finalize" << endmsg;
377
378 return StatusCode::SUCCESS;
379}

◆ getContext()

const EventContext & AthAlgorithm::getContext ( ) const
inherited

Deprecated methods (use the ones with EventContext).

Definition at line 90 of file AthAlgorithm.cxx.

90 {
91 return Gaudi::Hive::currentContext();
92}

◆ initialize()

StatusCode CheckFlow_New::initialize ( )
overridevirtual

Definition at line 45 of file CheckFlow_New.cxx.

45 {
46 ATH_CHECK(m_hijingKey.initialize());
47
48 ATH_MSG_INFO(">>> CheckFlow_New from Initialize");
49
50 float pt_binvals[n_ptbin+1]={0.0,0.25,0.5,1.0,1.5,2.0,2.5,3.0,3.5,4.0,6.0,8.0,12.0,16.0,20.0,30.0,40.0};
51 float eta_bin_max = 4.0;
52
53
54 SmartIF<ITHistSvc> rootHistSvc{Gaudi::svcLocator()->service("THistSvc")};
55 if (!rootHistSvc) {
56 ATH_MSG_ERROR( "Unable to locate THistSvc" );
57 return StatusCode::FAILURE;
58 }
59
60 std::string histPath = "/FlowOutPut/";
61 char name[100],name1[100];
62 for (int ihar=0;ihar<6;ihar++){
63
64// /*
65 sprintf(name,"hist_Psi_%d_true",ihar+1);
66 sprintf(name1,"Truth Psi_{%d} distribution;%dPsi_{%d} Truth;events",ihar+1,ihar+1,ihar+1);
67 m_hist_Psi_n_true [ihar]=new TH1D (name,name1,1000,-M_PI,M_PI);
68 if ( rootHistSvc->regHist(histPath+m_hist_Psi_n_true[ihar]->GetName(),m_hist_Psi_n_true[ihar]).isFailure() ){
69 msg(MSG::WARNING) << "Can't book "<< histPath+m_hist_Psi_n_true[ihar]->GetName() << endmsg;
70 }
71 m_hist_Psi_n_true[ihar]->GetXaxis()->CenterTitle();
72 m_hist_Psi_n_true[ihar]->GetYaxis()->CenterTitle();
73
74 sprintf(name,"hist_Psi_%d_reco",ihar+1);
75 sprintf(name1,"Reconstructed Psi_{%d} distribution;%dPsi_{%d} Reco;events",ihar+1,ihar+1,ihar+1);
76 m_hist_Psi_n_reco [ihar]=new TH1D (name,name1,1000,-M_PI,M_PI);
77 if ( rootHistSvc->regHist(histPath+m_hist_Psi_n_reco[ihar]->GetName(),m_hist_Psi_n_reco[ihar]).isFailure() ){
78 msg(MSG::WARNING) << "Can't book "<< histPath+m_hist_Psi_n_reco[ihar]->GetName() << endmsg;
79 }
80 m_hist_Psi_n_reco[ihar]->GetXaxis()->CenterTitle();
81 m_hist_Psi_n_reco[ihar]->GetYaxis()->CenterTitle();
82
83
84 for (int ihar2=0;ihar2<6;ihar2++)
85 {
86 int ihar_i=ihar*6+ihar2;
87
88 sprintf(name,"hist_Psi_corr_true_%d_%d",ihar+1,ihar2+1);
89 sprintf(name1,"true Psi_{%d} -Psi_{%d};%dPsi_{%d} -%dPsi_{%d} ;events",ihar+1,ihar2+1,ihar+1,ihar+1,ihar2+1,ihar2+1);
90 m_hist_psi_corr_true [ihar_i]=new TH1D (name,name1,1000,-2*M_PI,2*M_PI);
91 if ( rootHistSvc->regHist(histPath+m_hist_psi_corr_true[ihar_i]->GetName(),m_hist_psi_corr_true[ihar_i]).isFailure() ){
92 msg(MSG::WARNING) << "Can't book "<< histPath+m_hist_psi_corr_true[ihar_i]->GetName() << endmsg;
93 }
94 m_hist_psi_corr_true[ihar_i]->GetXaxis()->CenterTitle();
95 m_hist_psi_corr_true[ihar_i]->GetYaxis()->CenterTitle();
96
97
98 sprintf(name,"hist_Psi_corr_reco_%d_%d",ihar+1,ihar2+1);
99 sprintf(name1,"reco Psi_{%d} -Psi_{%d};%dPsi_{%d} -%dPsi_{%d} ;events",ihar+1,ihar2+1,ihar+1,ihar+1,ihar2+1,ihar2+1);
100 m_hist_psi_corr_reco [ihar_i]=new TH1D (name,name1,1000,-2*M_PI,2*M_PI);
101 if ( rootHistSvc->regHist(histPath+m_hist_psi_corr_reco[ihar_i]->GetName(),m_hist_psi_corr_reco[ihar_i]).isFailure() ){
102 msg(MSG::WARNING) << "Can't book "<< histPath+m_hist_psi_corr_reco[ihar_i]->GetName() << endmsg;
103 }
104 m_hist_psi_corr_reco[ihar_i]->GetXaxis()->CenterTitle();
105 m_hist_psi_corr_reco[ihar_i]->GetYaxis()->CenterTitle();
106 }
107
108
109
110 //integrated vn event by event
111 sprintf(name,"hist_v%d_ebe",ihar+1);
112 sprintf(name1,"v%d;v%d;events",ihar+1,ihar+1);
113 m_hist_vn_ebe [ihar]=new TH1D (name,name1,1000,-0.5,0.5);
114 if ( rootHistSvc->regHist(histPath+m_hist_vn_ebe[ihar]->GetName(),m_hist_vn_ebe[ihar]).isFailure() ){
115 msg(MSG::WARNING) << "Can't book "<< histPath+m_hist_vn_ebe[ihar]->GetName() << endmsg;
116 }
117 m_hist_vn_ebe[ihar]->GetXaxis()->CenterTitle();
118 m_hist_vn_ebe[ihar]->GetYaxis()->CenterTitle();
119
120 sprintf(name ,"hist_Psi%d_ebe",ihar+1);
121 sprintf(name1,"%d#Delta#Psi;%d(#Psi_{reco}-#Psi_{Truth});events",ihar+1,ihar+1);
122 m_hist_Psi_n_ebe [ihar]=new TH1D (name,name1,1000,-M_PI,M_PI);
123 if ( rootHistSvc->regHist(histPath+m_hist_Psi_n_ebe[ihar]->GetName(),m_hist_Psi_n_ebe[ihar]).isFailure() ){
124 msg(MSG::WARNING) << "Can't book "<< histPath+m_hist_Psi_n_ebe[ihar]->GetName() << endmsg;
125 }
126 m_hist_Psi_n_ebe[ihar]->GetXaxis()->CenterTitle();
127 m_hist_Psi_n_ebe[ihar]->GetYaxis()->CenterTitle();
128
129 sprintf(name ,"hist_Psi%d_ebe_pt",ihar+1);
130 sprintf(name1,"%d#Delta#Psi (pT weighted);%d(#Psi_{reco}-#Psi_{Truth});events",ihar+1,ihar+1);
131 m_hist_Psi_n_ebe_pt [ihar]=new TH1D (name,name1,1000,-M_PI,M_PI);
132 if ( rootHistSvc->regHist(histPath+m_hist_Psi_n_ebe_pt[ihar]->GetName(),m_hist_Psi_n_ebe_pt[ihar]).isFailure() ){
133 msg(MSG::WARNING) << "Can't book "<< histPath+m_hist_Psi_n_ebe_pt[ihar]->GetName() << endmsg;
134 }
135 m_hist_Psi_n_ebe_pt[ihar]->GetXaxis()->CenterTitle();
136 m_hist_Psi_n_ebe_pt[ihar]->GetYaxis()->CenterTitle();
137
138
139
140
141
142
143 for(int ieta=0;ieta<n_etabin;ieta++){
144 sprintf(name ,"profile_pt_dep_%d_eta%d" ,ihar+1,ieta);
145 sprintf(name1,"v%d vs pT (eta%d);pT;v%d",ihar+1,ieta,ihar+1);
146 m_profile_pt_dep [ihar][ieta]=new TProfile (name,name1,n_ptbin,pt_binvals);
147 if ( rootHistSvc->regHist(histPath+m_profile_pt_dep[ihar][ieta]->GetName(),m_profile_pt_dep[ihar][ieta]).isFailure() ){
148 msg(MSG::WARNING) << "Can't book "<< histPath+m_profile_pt_dep[ihar][ieta]->GetName() << endmsg;
149 }
150 m_profile_pt_dep [ihar][ieta]->GetXaxis()->CenterTitle();
151 m_profile_pt_dep [ihar][ieta]->GetYaxis()->CenterTitle();
152 }
153
154 for(int ipt=0;ipt<n_ptbin;ipt++){
155 sprintf(name ,"profile_eta_dep_%d_pt%d",ihar+1,ipt);
156 sprintf(name1,"v%d vs #eta; (ipt%d)#eta;v%d",ihar+1,ipt,ihar+1);
157 m_profile_eta_dep [ihar][ipt]=new TProfile (name,name1,2*n_etabin, -eta_bin_max,eta_bin_max);
158 if ( rootHistSvc->regHist(histPath+m_profile_eta_dep[ihar][ipt]->GetName(),m_profile_eta_dep[ihar][ipt]).isFailure() ){
159 msg(MSG::WARNING) << "Can't book "<< histPath+m_profile_eta_dep[ihar][ipt]->GetName() << endmsg;
160 }
161 m_profile_eta_dep [ihar][ipt]->GetXaxis()->CenterTitle();
162 m_profile_eta_dep [ihar][ipt]->GetYaxis()->CenterTitle();
163 }
164
165
166 for(int ieta=0;ieta<n_etabin;ieta++){
167 sprintf(name ,"profile_pt_dep_reco_%d_eta%d",ihar+1,ieta);
168 sprintf(name1,"v%d vs pT (eta%d);pT;v%d",ihar+1,ieta,ihar+1);
169 m_profile_pt_dep_reco [ihar][ieta]=new TProfile (name,name1,n_ptbin,pt_binvals);
170 if ( rootHistSvc->regHist(histPath+m_profile_pt_dep_reco[ihar][ieta]->GetName(),m_profile_pt_dep_reco[ihar][ieta]).isFailure() ){
171 msg(MSG::WARNING) << "Can't book "<< histPath+m_profile_pt_dep_reco[ihar][ieta]->GetName() << endmsg;
172 }
173 m_profile_pt_dep_reco [ihar][ieta]->GetXaxis()->CenterTitle();
174 m_profile_pt_dep_reco [ihar][ieta]->GetYaxis()->CenterTitle();
175 }
176
177
178 for(int ipt=0;ipt<n_ptbin;ipt++){
179 sprintf(name ,"profile_eta_dep_reco_%d_pt%d",ihar+1,ipt);
180 sprintf(name1,"v%d vs #eta (pt%d);#eta;v%d",ihar+1,ipt,ihar+1);
181 m_profile_eta_dep_reco [ihar][ipt]=new TProfile (name,name1,2*n_etabin, -eta_bin_max,eta_bin_max);
182 if ( rootHistSvc->regHist(histPath+m_profile_eta_dep_reco[ihar][ipt]->GetName(),m_profile_eta_dep_reco[ihar][ipt]).isFailure() ){
183 msg(MSG::WARNING) << "Can't book "<< histPath+m_profile_eta_dep_reco[ihar][ipt]->GetName() << endmsg;
184 }
185 m_profile_eta_dep_reco [ihar][ipt]->GetXaxis()->CenterTitle();
186 m_profile_eta_dep_reco [ihar][ipt]->GetYaxis()->CenterTitle();
187 }
188
189
190 }
191 m_profile_resolution=new TProfile("profile_resolution","vn resolution;n;resolution",6, 0.5,6.5);
192 if(rootHistSvc->regHist(histPath+m_profile_resolution->GetName(),m_profile_resolution).isFailure() ){
193 msg(MSG::WARNING) << "Can't book "<< histPath+m_profile_resolution->GetName() << endmsg;
194 }
195
196 msg(MSG::DEBUG) << "Histograms have been booked " << endmsg;
197 m_tesIO = new TruthHelper::GenAccessIO();
198 return StatusCode::SUCCESS;
199}
#define M_PI
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
#define ATH_MSG_INFO(x)
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ isReEntrant()

virtual bool AthAlgorithm::isReEntrant ( ) const
inlinefinaloverrideprotectedvirtualinherited

Legacy algorithms are not thread-safe.

Definition at line 111 of file AthAlgorithm.h.

111{ return false; }

◆ msg()

MsgStream & AthCommonMsg< Gaudi::Algorithm >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24 {
25 return this->msgStream();
26 }

◆ msgLvl()

bool AthCommonMsg< Gaudi::Algorithm >::msgLvl ( const MSG::Level lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30 {
31 return this->msgLevel(lvl);
32 }

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ renounce()

std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381 {
382 h.renounce();
384 }
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ setFilterPassed() [1/2]

void AthAlgorithm::setFilterPassed ( bool state) const
inherited

Definition at line 102 of file AthAlgorithm.cxx.

102 {
103 setFilterPassed( state, Gaudi::Hive::currentContext() );
104}
void setFilterPassed(bool state) const

◆ setFilterPassed() [2/2]

void AthAlgorithm::setFilterPassed ( bool state,
const EventContext & ctx ) const
inherited

Definition at line 106 of file AthAlgorithm.cxx.

106 {
107 execState( ctx ).setFilterPassed(state);
108}

◆ sysInitialize()

StatusCode AthAlgorithm::sysInitialize ( )
overridevirtualinherited

Override sysInitialize.

Override sysInitialize from the base class.

Loop through all output handles, and if they're WriteCondHandles, automatically register them and this Algorithm with the CondSvc.

Scan through all outputHandles, and if they're WriteCondHandles, register them with the CondSvc

Reimplemented from AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >.

Reimplemented in AthAnalysisAlgorithm, AthFilterAlgorithm, AthHistogramAlgorithm, and PyAthena::Alg.

Definition at line 66 of file AthAlgorithm.cxx.

66 {
68
69 if (sc.isFailure()) {
70 return sc;
71 }
72 ServiceHandle<ICondSvc> cs("CondSvc",name());
73 for (auto h : outputHandles()) {
74 if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
75 // do this inside the loop so we don't create the CondSvc until needed
76 if ( cs.retrieve().isFailure() ) {
77 ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
78 return StatusCode::SUCCESS;
79 }
80 if (cs->regHandle(this,*h).isFailure()) {
81 sc = StatusCode::FAILURE;
82 ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
83 << " with CondSvc");
84 }
85 }
86 }
87 return sc;
88}
#define ATH_MSG_WARNING(x)
static Double_t sc
virtual StatusCode sysInitialize() override
Override sysInitialize.
AthCommonDataStore(const std::string &name, T... args)
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::updateVHKA ( Gaudi::Details::PropertyBase & )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308 {
309 // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310 // << " size: " << m_vhka.size() << endmsg;
311 for (auto &a : m_vhka) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }

Member Data Documentation

◆ CheckFlow_New

CheckFlow_New.CheckFlow_New = job.CheckFlow_New
Todo
Migrate to a GenBase class or at least AthAlgorithm

Definition at line 54 of file CheckFlow_New.py.

◆ EvtMax

CheckFlow_New.EvtMax

Definition at line 38 of file CheckFlow_New.py.

◆ InputCollections

CheckFlow_New.InputCollections

Definition at line 16 of file CheckFlow_New.py.

◆ job

CheckFlow_New.job = AlgSequence()

Definition at line 30 of file CheckFlow_New.py.

◆ m_bcut_max

DoubleProperty CheckFlow_New::m_bcut_max {this, "ImpactCutMax", 99.}
private

Definition at line 41 of file CheckFlow_New.h.

41{this, "ImpactCutMax", 99.};

◆ m_bcut_min

DoubleProperty CheckFlow_New::m_bcut_min {this, "ImpactCutMin", 0.}
private

Definition at line 40 of file CheckFlow_New.h.

40{this, "ImpactCutMin", 0.};

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default).

Definition at line 393 of file AthCommonDataStore.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default).

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthAlgorithm::m_extendedExtraObjects
privateinherited

Definition at line 114 of file AthAlgorithm.h.

◆ m_hijingKey

SG::ReadHandleKey<HijingEventParams> CheckFlow_New::m_hijingKey {this, "HijingEventParmsKey","Hijing_event_params"}
private

Definition at line 69 of file CheckFlow_New.h.

69{this, "HijingEventParmsKey","Hijing_event_params"};

◆ m_hist_psi_corr_reco

TH1D* CheckFlow_New::m_hist_psi_corr_reco[36] {}
private

Definition at line 56 of file CheckFlow_New.h.

56{};

◆ m_hist_psi_corr_true

TH1D* CheckFlow_New::m_hist_psi_corr_true[36] {}
private

Definition at line 55 of file CheckFlow_New.h.

55{};

◆ m_hist_Psi_n_ebe

TH1D* CheckFlow_New::m_hist_Psi_n_ebe[6] {}
private

Definition at line 58 of file CheckFlow_New.h.

58{};

◆ m_hist_Psi_n_ebe_pt

TH1D* CheckFlow_New::m_hist_Psi_n_ebe_pt[6] {}
private

Definition at line 59 of file CheckFlow_New.h.

59{};

◆ m_hist_Psi_n_reco

TH1D* CheckFlow_New::m_hist_Psi_n_reco[6] {}
private

Definition at line 54 of file CheckFlow_New.h.

54{};

◆ m_hist_Psi_n_true

TH1D* CheckFlow_New::m_hist_Psi_n_true[6] {}
private

Definition at line 53 of file CheckFlow_New.h.

53{};

◆ m_hist_vn_ebe

TH1D* CheckFlow_New::m_hist_vn_ebe[6] {}
private

Definition at line 60 of file CheckFlow_New.h.

60{};

◆ m_key

StringProperty CheckFlow_New::m_key {this, "McEventKey", "FLOW_EVENT"}
private

Definition at line 37 of file CheckFlow_New.h.

37{this, "McEventKey", "FLOW_EVENT"};

◆ m_produceHistogram

BooleanProperty CheckFlow_New::m_produceHistogram {this, "HistogramFlag", true}
private

Definition at line 38 of file CheckFlow_New.h.

38{this, "HistogramFlag", true};

◆ m_profile_eta_dep

TProfile* CheckFlow_New::m_profile_eta_dep[6][n_ptbin] {}
private

Definition at line 63 of file CheckFlow_New.h.

63{};

◆ m_profile_eta_dep_reco

TProfile* CheckFlow_New::m_profile_eta_dep_reco[6][n_ptbin] {}
private

Definition at line 65 of file CheckFlow_New.h.

65{};

◆ m_profile_pt_dep

TProfile* CheckFlow_New::m_profile_pt_dep[6][n_etabin] {}
private

Definition at line 62 of file CheckFlow_New.h.

62{};

◆ m_profile_pt_dep_reco

TProfile* CheckFlow_New::m_profile_pt_dep_reco[6][n_etabin] {}
private

Definition at line 64 of file CheckFlow_New.h.

64{};

◆ m_profile_resolution

TProfile* CheckFlow_New::m_profile_resolution {}
private

Definition at line 67 of file CheckFlow_New.h.

67{};

◆ m_ptcut_max

DoubleProperty CheckFlow_New::m_ptcut_max {this, "PtCutMax", 999999.}
private

Definition at line 43 of file CheckFlow_New.h.

43{this, "PtCutMax", 999999.};

◆ m_ptcut_min

DoubleProperty CheckFlow_New::m_ptcut_min {this, "PtCutMin", 0.}
private

Definition at line 42 of file CheckFlow_New.h.

42{this, "PtCutMin", 0.};

◆ m_rapcut_max

DoubleProperty CheckFlow_New::m_rapcut_max {this, "RapidityCutMax", 5.5}
private

Definition at line 45 of file CheckFlow_New.h.

45{this, "RapidityCutMax", 5.5};

◆ m_rapcut_min

DoubleProperty CheckFlow_New::m_rapcut_min {this, "RapidityCutMin", 0.}
private

Definition at line 44 of file CheckFlow_New.h.

44{this, "RapidityCutMin", 0.};

◆ m_tesIO

TruthHelper::GenAccessIO* CheckFlow_New::m_tesIO {}
private

Definition at line 70 of file CheckFlow_New.h.

70{};

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.

◆ McEventKey

CheckFlow_New.McEventKey

Definition at line 55 of file CheckFlow_New.py.

◆ Output

CheckFlow_New.Output

Definition at line 47 of file CheckFlow_New.py.

◆ OutputLevel

CheckFlow_New.OutputLevel

Definition at line 39 of file CheckFlow_New.py.

◆ RapidityCutMax

CheckFlow_New.RapidityCutMax

Definition at line 56 of file CheckFlow_New.py.


The documentation for this class was generated from the following files: