CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
MuonEnergyDepositAnalyzer.cc
Go to the documentation of this file.
1 
2 /*
3  * See header file for a description of this class.
4  *
5  * $Date: 2009/12/22 17:42:07 $
6  * $Revision: 1.15 $
7  * \author G. Mila - INFN Torino
8  */
9 
11 
16 
18 
24 
25 #include <cmath>
26 #include <string>
27 using namespace std;
28 using namespace edm;
29 
30 
31 
33 
34  parameters = pSet;
35 }
36 
37 
39 
40 
42 
43  metname = "muEnergyDepositAnalyzer";
44 
45  LogTrace(metname)<<"[MuonEnergyDepositAnalyzer] Parameters initialization";
46  dbe->setCurrentFolder("Muons/MuonEnergyDepositAnalyzer");
47  std::string AlgoName = parameters.getParameter<std::string>("AlgoName");
48 
49  emNoBin = parameters.getParameter<int>("emSizeBin");
50  emNoMin = parameters.getParameter<double>("emSizeMin");
51  emNoMax = parameters.getParameter<double>("emSizeMax");
52  std::string histname = "ecalDepositedEnergyBarrel_";
53  ecalDepEnergyBarrel = dbe->book1D(histname+AlgoName, "Energy deposited in the ECAL barrel cells", emNoBin, emNoMin, emNoMax);
55  histname = "ecalDepositedEnergyEndcap_";
56  ecalDepEnergyEndcap = dbe->book1D(histname+AlgoName, "Energy deposited in the ECAL endcap cells", emNoBin, emNoMin, emNoMax);
58 
59  emS9NoBin = parameters.getParameter<int>("emS9SizeBin");
60  emS9NoMin = parameters.getParameter<double>("emS9SizeMin");
61  emS9NoMax = parameters.getParameter<double>("emS9SizeMax");
62  histname = "ecalS9DepositedEnergyBarrel_";
63  ecalS9DepEnergyBarrel = dbe->book1D(histname+AlgoName, "Energy deposited in the ECAL barrel 3*3 towers", emS9NoBin, emS9NoMin, emS9NoMax);
65  histname = "ecalS9DepositedEnergyEndcap_";
66  ecalS9DepEnergyEndcap = dbe->book1D(histname+AlgoName, "Energy deposited in the ECAL endcap 3*3 towers", emS9NoBin, emS9NoMin, emS9NoMax);
68  histname = "ecalS9PointingMuDepositedEnergy_Glb_";
69  ecalS9PointingMuDepEnergy_Glb = dbe->book1D(histname+AlgoName, "Pointing glb muons energy deposited in the ECAL 3*3 towers", emS9NoBin, emS9NoMin, emS9NoMax);
71  histname = "ecalS9PointingMuDepositedEnergy_Tk_";
72  ecalS9PointingMuDepEnergy_Tk = dbe->book1D(histname+AlgoName, "Pointing tk muons energy deposited in the ECAL 3*3 towers", emS9NoBin, emS9NoMin, emS9NoMax);
74  histname = "ecalS9PointingMuDepositedEnergy_Sta_";
75  ecalS9PointingMuDepEnergy_Sta = dbe->book1D(histname+AlgoName, "Pointing sta muons energy deposited in the ECAL 3*3 towers", emS9NoBin, emS9NoMin, emS9NoMax);
77 
78  hadNoBin = parameters.getParameter<int>("hadSizeBin");
79  hadNoMin = parameters.getParameter<double>("hadSizeMin");
80  hadNoMax = parameters.getParameter<double>("hadSizeMax");
81  histname = "hadDepositedEnergyBarrel_";
82  hcalDepEnergyBarrel = dbe->book1D(histname+AlgoName, "Energy deposited in the HCAL barrel cells", hadNoBin, hadNoMin, hadNoMax);
84  histname = "hadDepositedEnergyEndcap_";
85  hcalDepEnergyEndcap = dbe->book1D(histname+AlgoName, "Energy deposited in the HCAL endcap cells", hadNoBin, hadNoMin, hadNoMax);
87 
88  hadS9NoBin = parameters.getParameter<int>("hadS9SizeBin");
89  hadS9NoMin = parameters.getParameter<double>("hadS9SizeMin");
90  hadS9NoMax = parameters.getParameter<double>("hadS9SizeMax");
91  histname = "hadS9DepositedEnergyBarrel_";
92  hcalS9DepEnergyBarrel = dbe->book1D(histname+AlgoName, "Energy deposited in the HCAL barrel 3*3 towers", hadS9NoBin, hadS9NoMin, hadS9NoMax);
94  histname = "hadS9DepositedEnergyEndcap_";
95  hcalS9DepEnergyEndcap = dbe->book1D(histname+AlgoName, "Energy deposited in the HCAL endcap 3*3 towers", hadS9NoBin, hadS9NoMin, hadS9NoMax);
97  histname = "hadS9PointingMuDepositedEnergy_Glb_";
98  hcalS9PointingMuDepEnergy_Glb = dbe->book1D(histname+AlgoName, "Pointing glb muons energy deposited in the HCAL endcap 3*3 towers", hadS9NoBin, hadS9NoMin, hadS9NoMax);
100  histname = "hadS9PointingMuDepositedEnergy_Tk_";
101  hcalS9PointingMuDepEnergy_Tk = dbe->book1D(histname+AlgoName, "Pointing tk muons energy deposited in the HCAL endcap 3*3 towers", hadS9NoBin, hadS9NoMin, hadS9NoMax);
103  histname = "hadS9PointingMuDepositedEnergy_Sta_";
104  hcalS9PointingMuDepEnergy_Sta = dbe->book1D(histname+AlgoName, "Pointing sta muons energy deposited in the HCAL endcap 3*3 towers", hadS9NoBin, hadS9NoMin, hadS9NoMax);
106 
107  hoNoBin = parameters.getParameter<int>("hoSizeBin");
108  hoNoMin = parameters.getParameter<double>("hoSizeMin");
109  hoNoMax = parameters.getParameter<double>("hoSizeMax");
110  histname = "hoDepositedEnergy_";
111  hoDepEnergy = dbe->book1D(histname+AlgoName, "Energy deposited in the HO cells", hoNoBin, hoNoMin, hoNoMax);
112  hoDepEnergy->setAxisTitle("GeV");
113 
114  hoS9NoBin = parameters.getParameter<int>("hoS9SizeBin");
115  hoS9NoMin = parameters.getParameter<double>("hoS9SizeMin");
116  hoS9NoMax = parameters.getParameter<double>("hoS9SizeMax");
117  histname = "hoS9DepositedEnergy_";
118  hoS9DepEnergy = dbe->book1D(histname+AlgoName, "Energy deposited in the HO 3*3 towers", hoS9NoBin, hoS9NoMin, hoS9NoMax);
119  hoS9DepEnergy->setAxisTitle("GeV");
120  histname = "hoS9PointingMuDepositedEnergy_Glb_";
121  hoS9PointingMuDepEnergy_Glb = dbe->book1D(histname+AlgoName, "Pointing glb muons energy deposited in the HO 3*3 towers", hoS9NoBin, hoS9NoMin, hoS9NoMax);
123  histname = "hoS9PointingMuDepositedEnergy_Tk_";
124  hoS9PointingMuDepEnergy_Tk = dbe->book1D(histname+AlgoName, "Pointing tk muons energy deposited in the HO 3*3 towers", hoS9NoBin, hoS9NoMin, hoS9NoMax);
126  histname = "hoS9PointingMuDepositedEnergy_Sta_";
127  hoS9PointingMuDepEnergy_Sta = dbe->book1D(histname+AlgoName, "Pointing sta muons energy deposited in the HO 3*3 towers", hoS9NoBin, hoS9NoMin, hoS9NoMax);
129 
130 }
131 
132 
133 
135 
136  LogTrace(metname)<<"[MuonEnergyDepositAnalyzer] Filling the histos";
137 
138  // get all the mu energy deposits
139  reco::MuonEnergy muEnergy = recoMu.calEnergy();
140 
141  // energy deposited in ECAL
142  LogTrace(metname) << "Energy deposited in ECAL: "<<muEnergy.em;
143  if (fabs(recoMu.eta()) > 1.479)
144  ecalDepEnergyEndcap->Fill(muEnergy.em);
145  else
146  ecalDepEnergyBarrel->Fill(muEnergy.em);
147 
148  // energy deposited in HCAL
149  LogTrace(metname) << "Energy deposited in HCAL: "<<muEnergy.had;
150  if (fabs(recoMu.eta()) > 1.4)
151  hcalDepEnergyEndcap->Fill(muEnergy.had);
152  else
153  hcalDepEnergyBarrel->Fill(muEnergy.had);
154 
155  // energy deposited in HO
156  LogTrace(metname) << "Energy deposited in HO: "<<muEnergy.ho;
157  if (fabs(recoMu.eta()) < 1.26)
158  hoDepEnergy->Fill(muEnergy.ho);
159 
160  // energy deposited in ECAL in 3*3 towers
161  LogTrace(metname) << "Energy deposited in ECAL: "<<muEnergy.emS9;
162  if (fabs(recoMu.eta()) > 1.479)
163  ecalS9DepEnergyEndcap->Fill(muEnergy.emS9);
164  else
165  ecalS9DepEnergyBarrel->Fill(muEnergy.emS9);
166 
167  // energy deposited in HCAL in 3*3 crystals
168  LogTrace(metname) << "Energy deposited in HCAL: "<<muEnergy.hadS9;
169  if (fabs(recoMu.eta()) > 1.4)
170  hcalS9DepEnergyEndcap->Fill(muEnergy.hadS9);
171  else
172  hcalS9DepEnergyBarrel->Fill(muEnergy.hadS9);
173 
174  // energy deposited in HO in 3*3 crystals
175  LogTrace(metname) << "Energy deposited in HO: "<<muEnergy.hoS9;
176  if (fabs(recoMu.eta()) < 1.26)
177  hoS9DepEnergy->Fill(muEnergy.hoS9);
178 
179  // plot for energy tests
181  iSetup.get<TransientTrackRecord>().get("TransientTrackBuilder",theB);
182  reco::TransientTrack TransTrack;
183 
184  if(recoMu.isGlobalMuon())
185  TransTrack = theB->build(recoMu.globalTrack());
186  if(recoMu.isTrackerMuon() && !(recoMu.isGlobalMuon()))
187  TransTrack = theB->build(recoMu.innerTrack());
188  if(recoMu.isStandAloneMuon() && !(recoMu.isGlobalMuon()))
189  TransTrack = theB->build(recoMu.outerTrack());
190 
192  TSOS = TransTrack.impactPointState();
193  // section for vertex pointing muon
194  if((abs(TSOS.globalPosition().z())<30) && (abs(TSOS.globalPosition().perp())<20)){
195  // GLB muon
196  if(recoMu.isGlobalMuon()){
200  }
201  // TK muon
202  if(recoMu.isTrackerMuon() && !(recoMu.isGlobalMuon())){
206  }
207  // STA muon
208  if(recoMu.isStandAloneMuon() && !(recoMu.isGlobalMuon())){
212  }
213  }
214 
215 }
216 
217 
T getParameter(std::string const &) const
T perp() const
Definition: PV3DBase.h:72
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:722
MuonEnergyDepositAnalyzer(const edm::ParameterSet &, MuonServiceProxy *theService)
Constructor.
virtual TrackRef innerTrack() const
Definition: Muon.h:49
bool isTrackerMuon() const
Definition: Muon.h:220
#define abs(x)
Definition: mlp_lapack.h:159
bool isGlobalMuon() const
Definition: Muon.h:219
float emS9
energy deposited in 3x3 ECAL crystal shape around central crystal
Definition: MuonEnergy.h:18
GlobalPoint globalPosition() const
void analyze(const edm::Event &, const edm::EventSetup &, const reco::Muon &recoMu)
Get the analysis.
bool isStandAloneMuon() const
Definition: Muon.h:221
float ho
energy deposited in crossed HO towers
Definition: MuonEnergy.h:32
void Fill(long long x)
MonitorElement * hoS9PointingMuDepEnergy_Sta
virtual ~MuonEnergyDepositAnalyzer()
Destructor.
int iEvent
Definition: GenABIO.cc:243
T z() const
Definition: PV3DBase.h:64
float hoS9
energy deposited in 3x3 HO tower shape around central tower
Definition: MuonEnergy.h:34
#define LogTrace(id)
virtual TrackRef outerTrack() const
reference to Track reconstructed in the muon detector only
Definition: Muon.h:52
virtual float eta() const GCC11_FINAL
momentum pseudorapidity
MuonEnergy calEnergy() const
get energy deposition information
Definition: Muon.h:112
TrajectoryStateOnSurface TSOS
Definition: TestHits.cc:19
MonitorElement * ecalS9PointingMuDepEnergy_Sta
const T & get() const
Definition: EventSetup.h:55
MonitorElement * ecalS9PointingMuDepEnergy_Tk
MonitorElement * hcalS9PointingMuDepEnergy_Tk
MonitorElement * hoS9PointingMuDepEnergy_Glb
MonitorElement * hcalS9PointingMuDepEnergy_Glb
TrajectoryStateOnSurface impactPointState() const
MonitorElement * ecalS9PointingMuDepEnergy_Glb
MonitorElement * hcalS9PointingMuDepEnergy_Sta
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
float hadS9
energy deposited in 3x3 HCAL tower shape around central tower
Definition: MuonEnergy.h:28
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:434
void beginJob(DQMStore *dbe)
Inizialize parameters for histo binning.
virtual TrackRef globalTrack() const
reference to Track reconstructed in both tracked and muon detector
Definition: Muon.h:55