30 theMuonCollectionLabel_ = consumes<reco::MuonCollection>(
parameters.getParameter<
InputTag>(
"MuonCollection"));
33 emNoBin =
parameters.getParameter<
int>(
"emSizeBin");
34 emNoMin =
parameters.getParameter<
double>(
"emSizeMin");
35 emNoMax =
parameters.getParameter<
double>(
"emSizeMax");
37 hadNoBin =
parameters.getParameter<
int>(
"hadSizeBin");
38 hadNoMin =
parameters.getParameter<
double>(
"hadSizeMin");
39 hadNoMax =
parameters.getParameter<
double>(
"hadSizeMax");
41 emS9NoBin =
parameters.getParameter<
int>(
"emS9SizeBin");
42 emS9NoMin =
parameters.getParameter<
double>(
"emS9SizeMin");
43 emS9NoMax =
parameters.getParameter<
double>(
"emS9SizeMax");
45 hadS9NoBin =
parameters.getParameter<
int>(
"hadS9SizeBin");
46 hadS9NoMin =
parameters.getParameter<
double>(
"hadS9SizeMin");
47 hadS9NoMax =
parameters.getParameter<
double>(
"hadS9SizeMax");
49 hoNoBin =
parameters.getParameter<
int>(
"hoSizeBin");
50 hoNoMin =
parameters.getParameter<
double>(
"hoSizeMin");
51 hoNoMax =
parameters.getParameter<
double>(
"hoSizeMax");
53 hoS9NoBin =
parameters.getParameter<
int>(
"hoS9SizeBin");
54 hoS9NoMin =
parameters.getParameter<
double>(
"hoS9SizeMin");
55 hoS9NoMax =
parameters.getParameter<
double>(
"hoS9SizeMax");
66 std::string histname =
"ecalDepositedEnergyBarrel_";
67 ecalDepEnergyBarrel = ibooker.
book1D(histname+AlgoName,
"Energy deposited in the ECAL barrel cells", emNoBin, emNoMin, emNoMax);
70 histname =
"ecalDepositedEnergyEndcap_";
71 ecalDepEnergyEndcap = ibooker.
book1D(histname+AlgoName,
"Energy deposited in the ECAL endcap cells", emNoBin, emNoMin, emNoMax);
74 histname =
"ecalS9DepositedEnergyBarrel_";
75 ecalS9DepEnergyBarrel = ibooker.
book1D(histname+AlgoName,
"Energy deposited in the ECAL barrel 3*3 towers", emS9NoBin, emS9NoMin, emS9NoMax);
77 histname =
"ecalS9DepositedEnergyEndcap_";
78 ecalS9DepEnergyEndcap = ibooker.
book1D(histname+AlgoName,
"Energy deposited in the ECAL endcap 3*3 towers", emS9NoBin, emS9NoMin, emS9NoMax);
80 histname =
"ecalS9PointingMuDepositedEnergy_Glb_";
81 ecalS9PointingMuDepEnergy_Glb = ibooker.
book1D(histname+AlgoName,
"Pointing glb muons energy deposited in the ECAL 3*3 towers", emS9NoBin, emS9NoMin, emS9NoMax);
83 histname =
"ecalS9PointingMuDepositedEnergy_Tk_";
84 ecalS9PointingMuDepEnergy_Tk = ibooker.
book1D(histname+AlgoName,
"Pointing tk muons energy deposited in the ECAL 3*3 towers", emS9NoBin, emS9NoMin, emS9NoMax);
86 histname =
"ecalS9PointingMuDepositedEnergy_Sta_";
87 ecalS9PointingMuDepEnergy_Sta = ibooker.
book1D(histname+AlgoName,
"Pointing sta muons energy deposited in the ECAL 3*3 towers", emS9NoBin, emS9NoMin, emS9NoMax);
90 histname =
"hadDepositedEnergyBarrel_";
91 hcalDepEnergyBarrel = ibooker.
book1D(histname+AlgoName,
"Energy deposited in the HCAL barrel cells", hadNoBin, hadNoMin, hadNoMax);
93 histname =
"hadDepositedEnergyEndcap_";
94 hcalDepEnergyEndcap = ibooker.
book1D(histname+AlgoName,
"Energy deposited in the HCAL endcap cells", hadNoBin, hadNoMin, hadNoMax);
97 histname =
"hadS9DepositedEnergyBarrel_";
98 hcalS9DepEnergyBarrel = ibooker.
book1D(histname+AlgoName,
"Energy deposited in the HCAL barrel 3*3 towers", hadS9NoBin, hadS9NoMin, hadS9NoMax);
100 histname =
"hadS9DepositedEnergyEndcap_";
101 hcalS9DepEnergyEndcap = ibooker.
book1D(histname+AlgoName,
"Energy deposited in the HCAL endcap 3*3 towers", hadS9NoBin, hadS9NoMin, hadS9NoMax);
103 histname =
"hadS9PointingMuDepositedEnergy_Glb_";
104 hcalS9PointingMuDepEnergy_Glb = ibooker.
book1D(histname+AlgoName,
"Pointing glb muons energy deposited in the HCAL endcap 3*3 towers", hadS9NoBin, hadS9NoMin, hadS9NoMax);
106 histname =
"hadS9PointingMuDepositedEnergy_Tk_";
107 hcalS9PointingMuDepEnergy_Tk = ibooker.
book1D(histname+AlgoName,
"Pointing tk muons energy deposited in the HCAL endcap 3*3 towers", hadS9NoBin, hadS9NoMin, hadS9NoMax);
109 histname =
"hadS9PointingMuDepositedEnergy_Sta_";
110 hcalS9PointingMuDepEnergy_Sta = ibooker.
book1D(histname+AlgoName,
"Pointing sta muons energy deposited in the HCAL endcap 3*3 towers", hadS9NoBin, hadS9NoMin, hadS9NoMax);
113 histname =
"hoDepositedEnergy_";
114 hoDepEnergy = ibooker.
book1D(histname+AlgoName,
"Energy deposited in the HO cells", hoNoBin, hoNoMin, hoNoMax);
117 histname =
"hoS9DepositedEnergy_";
118 hoS9DepEnergy = ibooker.
book1D(histname+AlgoName,
"Energy deposited in the HO 3*3 towers", hoS9NoBin, hoS9NoMin, hoS9NoMax);
120 histname =
"hoS9PointingMuDepositedEnergy_Glb_";
121 hoS9PointingMuDepEnergy_Glb = ibooker.
book1D(histname+AlgoName,
"Pointing glb muons energy deposited in the HO 3*3 towers", hoS9NoBin, hoS9NoMin, hoS9NoMax);
123 histname =
"hoS9PointingMuDepositedEnergy_Tk_";
124 hoS9PointingMuDepEnergy_Tk = ibooker.
book1D(histname+AlgoName,
"Pointing tk muons energy deposited in the HO 3*3 towers", hoS9NoBin, hoS9NoMin, hoS9NoMax);
126 histname =
"hoS9PointingMuDepositedEnergy_Sta_";
127 hoS9PointingMuDepEnergy_Sta = ibooker.
book1D(histname+AlgoName,
"Pointing sta muons energy deposited in the HO 3*3 towers", hoS9NoBin, hoS9NoMin, hoS9NoMax);
132 theService->update(iSetup);
136 iEvent.
getByToken(theMuonCollectionLabel_,muons);
140 for (reco::MuonCollection::const_iterator recoMu = muons->begin(); recoMu!=muons->end(); ++recoMu){
146 if (fabs(recoMu->eta()) > 1.479)
147 ecalDepEnergyEndcap->Fill(muEnergy.
em);
149 ecalDepEnergyBarrel->Fill(muEnergy.
em);
153 if (fabs(recoMu->eta()) > 1.4)
154 hcalDepEnergyEndcap->Fill(muEnergy.
had);
156 hcalDepEnergyBarrel->Fill(muEnergy.
had);
160 if (fabs(recoMu->eta()) < 1.26)
161 hoDepEnergy->Fill(muEnergy.
ho);
165 if (fabs(recoMu->eta()) > 1.479)
166 ecalS9DepEnergyEndcap->Fill(muEnergy.
emS9);
168 ecalS9DepEnergyBarrel->Fill(muEnergy.
emS9);
172 if (fabs(recoMu->eta()) > 1.4)
173 hcalS9DepEnergyEndcap->Fill(muEnergy.
hadS9);
175 hcalS9DepEnergyBarrel->Fill(muEnergy.
hadS9);
179 if (fabs(recoMu->eta()) < 1.26)
180 hoS9DepEnergy->Fill(muEnergy.
hoS9);
187 if(recoMu->isGlobalMuon())
188 TransTrack = theB->build(recoMu->globalTrack());
189 if(recoMu->isTrackerMuon() && !(recoMu->isGlobalMuon()))
190 TransTrack = theB->build(recoMu->innerTrack());
191 if(recoMu->isStandAloneMuon() && !(recoMu->isGlobalMuon()))
192 TransTrack = theB->build(recoMu->outerTrack());
199 if(recoMu->isGlobalMuon()){
200 ecalS9PointingMuDepEnergy_Glb->Fill(muEnergy.
emS9);
201 hcalS9PointingMuDepEnergy_Glb->Fill(muEnergy.
hadS9);
202 hoS9PointingMuDepEnergy_Glb->Fill(muEnergy.
hoS9);
205 if(recoMu->isTrackerMuon() && !(recoMu->isGlobalMuon())){
206 ecalS9PointingMuDepEnergy_Tk->Fill(muEnergy.
emS9);
207 hcalS9PointingMuDepEnergy_Tk->Fill(muEnergy.
hadS9);
208 hoS9PointingMuDepEnergy_Tk->Fill(muEnergy.
hoS9);
211 if(recoMu->isStandAloneMuon() && !(recoMu->isGlobalMuon())){
212 ecalS9PointingMuDepEnergy_Sta->Fill(muEnergy.
emS9);
213 hcalS9PointingMuDepEnergy_Sta->Fill(muEnergy.
hadS9);
214 hoS9PointingMuDepEnergy_Sta->Fill(muEnergy.
hoS9);
MuonEnergyDepositAnalyzer(const edm::ParameterSet &)
Constructor.
void analyze(const edm::Event &, const edm::EventSetup &)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
const std::string metname
float emS9
energy deposited in 3x3 ECAL crystal shape around central crystal
GlobalPoint globalPosition() const
float ho
energy deposited in crossed HO towers
virtual ~MuonEnergyDepositAnalyzer()
Destructor.
MonitorElement * book1D(Args &&...args)
Abs< T >::type abs(const T &t)
float hoS9
energy deposited in 3x3 HO tower shape around central tower
TrajectoryStateOnSurface TSOS
void setCurrentFolder(const std::string &fullpath)
TrajectoryStateOnSurface impactPointState() const
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
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override