CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
HcalForwardAnalysis.h
Go to the documentation of this file.
1 #ifndef ShowerLibraryProducer_HcalForwardAnalysis_h
2 #define ShowerLibraryProducer_HcalForwardAnalysis_h
3 
4 #include <iostream>
5 #include <memory>
6 #include <vector>
7 #include <string>
8 
9 // user include files
12 
15 
18 
19 
20 #include "G4Step.hh"
21 #include "G4Track.hh"
22 #include "G4ThreeVector.hh"
23 
24 #include "TFile.h"
25 #include "TTree.h"
26 
27 #include <boost/cstdint.hpp>
28 #include <vector>
29 #include <string>
30 
31 class BeginOfRun;
32 class BeginOfEvent;
33 class EndOfEvent;
34 
36  public Observer<const BeginOfRun *>,
37  public Observer<const BeginOfEvent *>,
38  public Observer<const EndOfEvent *>,
39  public Observer<const G4Step *> {
40 
41 public:
42 
43  struct Photon {
44  Photon(int id, float X, float Y, float Z, float T, float Lambda):
45  fiberId(id), x(X), y(Y), z(Z), t(T), lambda(Lambda) {}
46  int fiberId;
47  float x;
48  float y;
49  float z;
50  float t;
51  float lambda;
52  };
53 
55  virtual ~HcalForwardAnalysis();
56 
57  virtual void produce(edm::Event&, const edm::EventSetup&);
58 
59 private:
60 
61  HcalForwardAnalysis(const HcalForwardAnalysis&); // stop default
63 
64  void init();
65 
66  // observer methods
67  void update(const BeginOfRun * run);
68  void update(const BeginOfEvent * evt);
69  void update(const G4Step * step);
70  void update(const EndOfEvent * evt);
71 // void write(const EndOfRun * run);
72 
73  //User methods
74  void setPhotons(const EndOfEvent * evt);
75  //void fillEvent(PHcalForwardLibInfo&);
76  void fillEvent();
77  void parseDetId(int id, int& tower, int& cell, int& fiber);
78  void clear();
80  //TFile * theFile;
81  TTree* theTree;
83  int count;
84  int evNum;
85  float x[10000],y[10000],z[10000],t[10000],lambda[10000];
88  int nphot;
89  int fiberId[10000];
90  std::vector<Photon> thePhotons;
91  std::vector<std::string> theNames;
92 };
93 #endif
const double Z[kNumberCalorimeter]
list step
Definition: launcher.py:15
const HcalForwardAnalysis & operator=(const HcalForwardAnalysis &)
#define X(str)
Definition: MuonsGrabber.cc:49
void setPhotons(const EndOfEvent *evt)
void update(const BeginOfRun *run)
This routine will be called when the appropriate signal arrives.
Photon(int id, float X, float Y, float Z, float T, float Lambda)
std::vector< Photon > thePhotons
edm::Service< TFileService > theFile
std::vector< std::string > theNames
HcalForwardAnalysis(const edm::ParameterSet &p)
long double T
void parseDetId(int id, int &tower, int &cell, int &fiber)
virtual void produce(edm::Event &, const edm::EventSetup &)