CMS 3D CMS Logo

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  ~HcalForwardAnalysis() override;
56 
57  void produce(edm::Event&, const edm::EventSetup&) override;
58 
59 private:
60 
61  HcalForwardAnalysis(const HcalForwardAnalysis&) = delete; // stop default
62  const HcalForwardAnalysis& operator=(const HcalForwardAnalysis&) = delete;
63 
64  void init();
65 
66  // observer methods
67  void update(const BeginOfRun * run) override;
68  void update(const BeginOfEvent * evt) override;
69  void update(const G4Step * step) override;
70  void update(const EndOfEvent * evt) override;
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
Definition: Photon.py:1
#define X(str)
Definition: MuonsGrabber.cc:48
void setPhotons(const EndOfEvent *evt)
Photon(int id, float X, float Y, float Z, float T, float Lambda)
std::vector< Photon > thePhotons
const HcalForwardAnalysis & operator=(const HcalForwardAnalysis &)=delete
void update(const BeginOfRun *run) override
This routine will be called when the appropriate signal arrives.
edm::Service< TFileService > theFile
std::vector< std::string > theNames
step
HcalForwardAnalysis(const edm::ParameterSet &p)
long double T
void parseDetId(int id, int &tower, int &cell, int &fiber)
void produce(edm::Event &, const edm::EventSetup &) override