All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
BCalTagEfficiency.h
Go to the documentation of this file.
1 #ifndef BCalTagEfficiency_h
2 #define BCalTagEfficiency_h 1
3 
4 #include "marlin/Processor.h"
5 #include "lcio.h"
6 #include <string>
7 
8 
9 // includes for the BcEnergyDensity
10 
11 #include "BcEnergyDensity.h"
12 
13 // root includes
14 
15 #include <TTree.h>
16 #include <TFile.h>
17 #include <TH2D.h>
18 #include <TLorentzVector.h>
19 #include <TMath.h>
20 #include <TObjArray.h>
21 #include <TClonesArray.h>
22 
23 
24 using namespace lcio ;
25 using namespace marlin ;
26 
27 
28 /** Marlin processor to calculate BCAL tagging efficiency
29  *
30  * If compiled with MARLIN_USE_AIDA
31  * it creates a histogram (cloud) of the MCParticle energies.
32  *
33  * <h4>Input - Prerequisites</h4>
34  * Needs the collection of MCParticles.
35  *
36  * <h4>Output</h4>
37  * A histogram.
38  *
39  * @param CollectionName Name of the MCParticle collection
40  *
41  * @author F. Gaede, DESY
42  * @version $Id$
43  */
44 
45 class BCalTagEfficiency : public Processor {
46 
47  public:
48 
49  virtual Processor* newProcessor() { return new BCalTagEfficiency ; }
50 
51 
53 
54  /** Called at the begin of the job before anything is read.
55  * Use to initialize the processor, e.g. book histograms.
56  */
57  virtual void init() ;
58 
59  /** Called for every run.
60  */
61  virtual void processRunHeader( LCRunHeader* run ) ;
62 
63  /** Called for every event - the working horse.
64  */
65  virtual void processEvent( LCEvent * evt ) ;
66 
67 
68  virtual void check( LCEvent * evt ) ;
69 
70 
71  /** Called after data processing for clean up.
72  */
73  virtual void end() ;
74 
75 
76  protected:
77 
78  /** Input collection name.
79  */
80  std::string _MCParticleName ;
83  std::string _BCALClusterName;
84  std::string _BCALParticleName ;
85 
86 
87  int _nRun ;
88  int _nEvt ;
89 
90 
91  // root variables to create tree
92 
93  TFile* rootfile;
94  TTree* tree;
95  std::string rootFileName;
96 
97  // per particle
98  int mcp;
99  enum {MCP = 100};
100  int pdg[MCP];
101  float energy[MCP], ePrime[MCP], pxPrime[MCP], pxIP[MCP], pyIP[MCP], pzIP[MCP];
102  float phiIP[MCP], theIP[MCP];
103  float lposx[MCP], lposy[MCP], lposz[MCP];
104  float gposx[MCP], gposy[MCP], gposz[MCP];
105  float radius[MCP], phi[MCP], ebkg[MCP], ebkg_err[MCP];
106  float efficiency[MCP], rand[MCP];
107  int tag[MCP];
108  float scaleP[MCP];
109 
110  // parameters of detector
111  std::string backgroundfilename;
112  std::string SGVmapfilename;
114  float bField;
115  float eBeam;
116  float zbcal;
117  float thresholdMin, thresholdMax;
118  float xingangle;
119 
120  //
121  bool DBDsample;
122  bool newMap;
123  bool writeTree;
124  bool detectAll;
128 
129  // background handler
131 
132  //helpers
133  double alpha;
134  double gamma;
135  double betagamma;
136  double PI;
137 
138 
139  // binning for SGV map
140  int nbinx, nbiny;
141  float xmin, xmax, ymin, ymax;
142  TH2D* SGVmapP;
143  TH2D* SGVmapN;
144 } ;
145 
146 #endif
147 
148 
149 
std::string _BCALInputTruthLinkName
virtual Processor * newProcessor()
std::string backgroundfilename
std::string _BCALEffiMCTruthLinkName
std::string _BCALClusterName
Marlin processor to calculate BCAL tagging efficiency.
std::string rootFileName
std::string _MCParticleName
Input collection name.
std::string _BCALParticleName
BcEnergyDensity * bc_en
std::string SGVmapfilename