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 #include "G4Step.hh"
20 #include "G4Track.hh"
21 #include "G4ThreeVector.hh"
22 
23 #include "TFile.h"
24 #include "TTree.h"
25 
26 #include <vector>
27 #include <string>
28 
29 class BeginOfRun;
30 class BeginOfEvent;
31 class EndOfEvent;
32 
34  public Observer<const BeginOfRun*>,
35  public Observer<const BeginOfEvent*>,
36  public Observer<const EndOfEvent*>,
37  public Observer<const G4Step*> {
38 public:
39  struct Photon {
40  Photon(int id, float X, float Y, float Z, float T, float Lambda)
41  : fiberId(id), x(X), y(Y), z(Z), t(T), lambda(Lambda) {}
42  int fiberId;
43  float x;
44  float y;
45  float z;
46  float t;
47  float lambda;
48  };
49 
51  ~HcalForwardAnalysis() override;
52 
53  void produce(edm::Event&, const edm::EventSetup&) override;
54 
55 private:
56  HcalForwardAnalysis(const HcalForwardAnalysis&) = delete; // stop default
57  const HcalForwardAnalysis& operator=(const HcalForwardAnalysis&) = delete;
58 
59  void init();
60 
61  // observer methods
62  void update(const BeginOfRun* run) override;
63  void update(const BeginOfEvent* evt) override;
64  void update(const G4Step* step) override;
65  void update(const EndOfEvent* evt) override;
66  // void write(const EndOfRun * run);
67 
68  //User methods
69  void setPhotons(const EndOfEvent* evt);
70  //void fillEvent(PHcalForwardLibInfo&);
71  void fillEvent();
72  void parseDetId(int id, int& tower, int& cell, int& fiber);
73  void clear();
75  //TFile * theFile;
76  TTree* theTree;
78  int count;
79  int evNum;
80  float x[10000], y[10000], z[10000], t[10000], lambda[10000];
81  float primX, primY, primZ, primT;
83  int nphot;
84  int fiberId[10000];
85  std::vector<Photon> thePhotons;
86  std::vector<std::string> theNames;
87 };
88 #endif
Definition: Photon.py:1
#define X(str)
Definition: MuonsGrabber.cc:38
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
Definition: StallMonitor.cc:94
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