Report problems to ATLAS LXR Team (with time and IP address indicated)

The LXR Cross Referencer

source navigation ]
diff markup ]
identifier search ]
general search ]
 
 
Architecture: linux ]
Version: head ] [ nightly ] [ GaudiDev ]
  Links to LXR source navigation pages for stable releases [ 12.*.* ]   [ 13.*.* ]   [ 14.*.* ] 

001 #ifndef EWANALYSISTOOLS_EWTOOLBASE_H
002 #define EWANALYSISTOOLS_EWTOOLBASE_H
003 
004 #ifndef EWPA_STANDALONE
005 // Athena include(s):
006 #include "GaudiKernel/ISvcLocator.h"
007 #include "StoreGate/StoreGateSvc.h"
008 #endif
009 
010 // EWPA includes
011 #include "EWCore/EventLibrary.h"
012 
013 // ROOT includes
014 #include "TFile.h"
015 #include "TH1F.h"
016 #include "TH2F.h"
017 #include "TH3F.h"
018 #include "TProfile.h"
019 #include "TTree.h"
020 #include "TCanvas.h"
021 #include "TMath.h"
022 #include "TMarker.h"
023 #include "TLine.h"
024 #include "TPave.h"
025 #include "TLatex.h"
026 #include "TLegend.h"
027 #include "TPaveText.h"
028 #include "TText.h"
029 #include "TF1.h"
030 
031 /**
032  * The EWToolBase class.
033  * This class is designed as base class for all analysis tools in EWPA.
034  */
035 
036 class EWToolBase {
037   
038  public:
039   
040   /**
041    * Constructor
042    * @param[in] source Name of analysis class, to be displayed in log messages
043    * passed to EWMessage constructor
044    */
045   EWToolBase(std::string name="EWToolBase");
046   virtual ~EWToolBase();
047   
048   void declareProperty(std::string name, std::string& val) 
049     {m_stringProperty.insert(std::pair<std::string, std::string*>(name,&val));}
050   void declareProperty(std::string name, int& val)         
051     {m_intProperty.insert(std::pair<std::string, int*>(name,&val));}
052   void declareProperty(std::string name, float& val)       
053     {m_floatProperty.insert(std::pair<std::string, float*>(name,&val));}
054   void declareProperty(std::string name, double& val)       
055     {m_doubleProperty.insert(std::pair<std::string, double*>(name,&val));}
056   void declareProperty(std::string name, bool& val)        
057     {m_boolProperty.insert(std::pair<std::string, bool*>(name,&val));}
058   void declareProperty(std::string name, std::vector<int>& val) 
059     {m_intVecProperty.insert(std::pair<std::string, std::vector<int>*>(name,&val));}
060   void declareProperty(std::string name, std::vector<float>& val) 
061     {m_floatVecProperty.insert(std::pair<std::string, std::vector<float>*>(name,&val));}
062   void declareProperty(std::string name, std::vector<double>& val) 
063     {m_doubleVecProperty.insert(std::pair<std::string, std::vector<double>*>(name,&val));}
064   void declareProperty(std::string name, std::vector<bool>& val) 
065     {m_boolVecProperty.insert(std::pair<std::string, std::vector<bool>*>(name,&val));}
066   void declareProperty(std::string name, std::vector<std::string>& val) 
067     {m_stringVecProperty.insert(std::pair<std::string, std::vector<std::string>*>(name,&val));}
068 
069   void getProperty(std::map<std::string, std::string*>& prop) {prop = m_stringProperty;}
070   void getProperty(std::map<std::string, int*>& prop)         {prop = m_intProperty;}
071   void getProperty(std::map<std::string, float*>& prop)       {prop = m_floatProperty;}
072   void getProperty(std::map<std::string, double*>& prop)       {prop = m_doubleProperty;}
073   void getProperty(std::map<std::string, bool*>& prop)        {prop = m_boolProperty;}
074   void getProperty(std::map<std::string, std::vector<int>*>& prop)   {prop = m_intVecProperty;}
075   void getProperty(std::map<std::string, std::vector<float>*>& prop) {prop = m_floatVecProperty;}
076   void getProperty(std::map<std::string, std::vector<double>*>& prop) {prop = m_doubleVecProperty;}
077   void getProperty(std::map<std::string, std::vector<bool>*>& prop)  {prop = m_boolVecProperty;}
078   void getProperty(std::map<std::string, std::vector<std::string>*>& prop) {prop = m_stringVecProperty;}
079 
080   virtual StatusCode initialize();       
081   virtual StatusCode execute(EventLibrary* evtLib);
082   virtual StatusCode finalize()          {return StatusCode::SUCCESS;} //!< pure virtual finalize
083 
084   /**
085    * return the name of the dual tool.
086    * @return m_name name of the dual tool, used in log messages 
087    */
088   std::string name() {return m_name;}
089 
090   /**
091    * set the name of the dual tool.
092    * @param[in] name name of the dual tool, used in log messages 
093    */
094   void setName(std::string name);
095   
096   /**
097    * set the pointer to the transient events store in ROOT (the ARA tree).
098    * @param[in] araGate name of the pointer to the ARA tree
099    */
100   void setAraGate(TTree* araGate) {m_araGate = araGate;}
101 
102   /**
103    * Print the ATLAS label on the plot
104    * @param[in] x,y coordinates of the label
105    * @param[in] color (optional) color
106    * @param[in] tsize size of the label
107    */
108   void ATLAS_LABEL(double x, double y, double tsize, int color);
109 
110   /**
111    * Print text label on the plot
112    * @param[in] x,y coordinates of the label
113    * @param[in] color (optional) color
114    * @param[in] text text of the label
115    * @param[in] tsize size of the label
116    */
117   void myText(double x, double y, int color, double tsize, const char *text, double angle=0);
118 
119   /**
120    * Print text box label on the plot
121    * @param[in] x,y coordinates of the label
122    * @param[in] color (optional) color
123    * @param[in] boxsize dimension of the box
124    * @param[in] text text of the label
125    * @param[in] tsize size of the label (in pixel!)
126    * @param[in] angle angle of the label (default = 0)
127    */
128   void myBoxText(double x, double y, double boxsize, int mcolor, double tsize, const char *text);
129 
130   /**
131    * Print text beside marker label on the plot
132    * @param[in] x,y coordinates of the label
133    * @param[in] color (optional) color
134    * @param[in] mystyle style of the marker
135    * @param[in] text text of the label
136    * @param[in] tsize size of the label
137    */
138   void myMarkerText(double x, double y, int color, int mstyle, double tsize, const char *text);
139 
140   /** To set and get the data type*/
141   void setDataType(std::string dataType);
142   bool dataType(std::string type);
143 
144   /** To set/get if code is running inside Athena */
145   bool isAthenaAware() {return m_athenaAware;}
146   void setAthenaAware(bool aware) {m_athenaAware = aware;}
147 
148   //!< skimming tool 
149   virtual bool skimmingTest(EventLibrary* evtLib) {
150     m_Log << WARNING << "SkimmingTest always TRUE : not defined for " << m_name << endmsg;
151     m_Log << WARNING << "EventLibrary version : " << evtLib->version() << endmsg;
152     return true;
153   } 
154   
155   /**
156    * Method to get production vertex for MC truth particles
157    * @param[in] part EventObject pointer
158    * @param[out] vx x-coordinate for the vertex
159    * @param[out] vy y-coordinate for the vertex
160    * @param[out] vz z-coordinate for the vertex
161    * @param[out] vbarcode barcode of the vertex
162    * @return error code (0=fine, 11=no genParticle, 12=no genVertex)
163    */
164   int getProdVertex(EventObject *part, double& vx, double& vy, double& vz, int& vbarcode);
165 
166   int getEndVertex(EventObject *part, double& vx, double& vy, double& vz, int& vbarcode);
167   /**
168    * Method to get end vertex for MC truth particles
169    * @param[in] part EventObject pointer
170    * @param[out] vx x-coordinate for the vertex
171    * @param[out] vy y-coordinate for the vertex
172    * @param[out] vz z-coordinate for the vertex
173    * @param[out] vbarcode barcode of the vertex
174    * @return error code (0=fine, 11=no genParticle, 12=no genVertex)
175    */
176 
177 #ifndef EWPA_STANDALONE
178   int getProdVertex(const TruthParticle *par, double& vx, double& vy, double& vz, int& vbarcode); 
179   /**
180    * Method to get production vertex for MC truth particles
181    * @param[in] part TruthParticle pointer
182    * @param[out] vx x-coordinate for the vertex
183    * @param[out] vy y-coordinate for the vertex
184    * @param[out] vz z-coordinate for the vertex
185    * @param[out] vbarcode barcode of the vertex
186    * @return error code (0=fine, 11=no genParticle, 12=no genVertex)
187    */
188 
189   int getEndVertex(const TruthParticle *par, double& vx, double& vy, double& vz, int& vbarcode);
190   /**
191    * Method to get end vertex for MC truth particles
192    * @param[in] part TruthParticle pointer
193    * @param[out] vx x-coordinate for the vertex
194    * @param[out] vy y-coordinate for the vertex
195    * @param[out] vz z-coordinate for the vertex
196    * @param[out] vbarcode barcode of the vertex
197    * @return error code (0=fine, 11=no genParticle, 12=no genVertex)
198    */
199 #endif
200 
201   void splitString(const std::string& str,
202                    std::vector<std::string>& tokens,
203                    const std::string& delimiters);
204 
205  protected:
206   
207 #ifndef EWPA_STANDALONE
208   StoreGateSvc* m_storeGate;
209 #endif
210  
211   bool m_athenaAware;
212   std::string m_name;            //!< name of the dual tool (used in log messages)
213   std::string m_dataType;        //!< type of data (REAL or SIMUL)
214 
215   std::map<std::string, std::string*> m_stringProperty;
216   std::map<std::string, int*> m_intProperty;
217   std::map<std::string, float*> m_floatProperty;
218   std::map<std::string, double*> m_doubleProperty;
219   std::map<std::string, bool*> m_boolProperty;
220   std::map<std::string, std::vector<std::string>*> m_stringVecProperty;
221   std::map<std::string, std::vector<int>*> m_intVecProperty;
222   std::map<std::string, std::vector<float>*> m_floatVecProperty;
223   std::map<std::string, std::vector<double>*> m_doubleVecProperty;
224   std::map<std::string, std::vector<bool>*> m_boolVecProperty;
225  
226   //  EWStatManager* m_StatMgr;      //!< the Statistical Manager
227   TTree *m_araGate;              //!< the ARA transient tree
228   EWMessage m_Log;               //!< the log stream
229 };
230 
231 #ifndef EWPA_STANDALONE
232 CLASS_DEF(EWToolBase, 259593343, 1)
233 #endif
234 
235 #endif // end of EWToolBase
236 

source navigation ] diff markup ] identifier search ] general search ]

Due to the LXR bug, the updates fail sometimes to remove references to deleted files. The Saturday's full rebuilds fix these problems
This page was automatically generated by the LXR engine. Valid HTML 4.01!