32 theMuonCollectionLabel_ = consumes<reco::MuonCollection>(
parameters.getParameter<
InputTag>(
"MuonCollection"));
42 metname =
"muEnergyDepositAnalyzer";
49 theDbe->setCurrentFolder(
"Muons/MuonEnergyDepositAnalyzer");
51 LogTrace(
metname)<<
"[MuonEnergyDepositAnalyzer] Parameters initialization";
52 LogTrace(
metname)<<
"[MuonEnergyDepositAnalyzer] Run, Event" << iRun <<
" , "<< iSetup;
54 emNoBin =
parameters.getParameter<
int>(
"emSizeBin");
55 emNoMin =
parameters.getParameter<
double>(
"emSizeMin");
56 emNoMax =
parameters.getParameter<
double>(
"emSizeMax");
58 hadNoBin =
parameters.getParameter<
int>(
"hadSizeBin");
59 hadNoMin =
parameters.getParameter<
double>(
"hadSizeMin");
60 hadNoMax =
parameters.getParameter<
double>(
"hadSizeMax");
62 emS9NoBin =
parameters.getParameter<
int>(
"emS9SizeBin");
63 emS9NoMin =
parameters.getParameter<
double>(
"emS9SizeMin");
64 emS9NoMax =
parameters.getParameter<
double>(
"emS9SizeMax");
66 hadS9NoBin =
parameters.getParameter<
int>(
"hadS9SizeBin");
67 hadS9NoMin =
parameters.getParameter<
double>(
"hadS9SizeMin");
68 hadS9NoMax =
parameters.getParameter<
double>(
"hadS9SizeMax");
70 hoNoBin =
parameters.getParameter<
int>(
"hoSizeBin");
71 hoNoMin =
parameters.getParameter<
double>(
"hoSizeMin");
72 hoNoMax =
parameters.getParameter<
double>(
"hoSizeMax");
74 hoS9NoBin =
parameters.getParameter<
int>(
"hoS9SizeBin");
75 hoS9NoMin =
parameters.getParameter<
double>(
"hoS9SizeMin");
76 hoS9NoMax =
parameters.getParameter<
double>(
"hoS9SizeMax");
78 std::string histname =
"ecalDepositedEnergyBarrel_";
79 ecalDepEnergyBarrel = theDbe->book1D(histname+AlgoName,
"Energy deposited in the ECAL barrel cells", emNoBin, emNoMin, emNoMax);
80 ecalDepEnergyBarrel->setAxisTitle(
"GeV");
82 histname =
"ecalDepositedEnergyEndcap_";
83 ecalDepEnergyEndcap = theDbe->book1D(histname+AlgoName,
"Energy deposited in the ECAL endcap cells", emNoBin, emNoMin, emNoMax);
84 ecalDepEnergyEndcap->setAxisTitle(
"GeV");
86 histname =
"ecalS9DepositedEnergyBarrel_";
87 ecalS9DepEnergyBarrel = theDbe->book1D(histname+AlgoName,
"Energy deposited in the ECAL barrel 3*3 towers", emS9NoBin, emS9NoMin, emS9NoMax);
88 ecalS9DepEnergyBarrel->setAxisTitle(
"GeV");
89 histname =
"ecalS9DepositedEnergyEndcap_";
90 ecalS9DepEnergyEndcap = theDbe->book1D(histname+AlgoName,
"Energy deposited in the ECAL endcap 3*3 towers", emS9NoBin, emS9NoMin, emS9NoMax);
91 ecalS9DepEnergyEndcap->setAxisTitle(
"GeV");
92 histname =
"ecalS9PointingMuDepositedEnergy_Glb_";
93 ecalS9PointingMuDepEnergy_Glb = theDbe->book1D(histname+AlgoName,
"Pointing glb muons energy deposited in the ECAL 3*3 towers", emS9NoBin, emS9NoMin, emS9NoMax);
94 ecalS9PointingMuDepEnergy_Glb->setAxisTitle(
"GeV");
95 histname =
"ecalS9PointingMuDepositedEnergy_Tk_";
96 ecalS9PointingMuDepEnergy_Tk = theDbe->book1D(histname+AlgoName,
"Pointing tk muons energy deposited in the ECAL 3*3 towers", emS9NoBin, emS9NoMin, emS9NoMax);
97 ecalS9PointingMuDepEnergy_Tk->setAxisTitle(
"GeV");
98 histname =
"ecalS9PointingMuDepositedEnergy_Sta_";
99 ecalS9PointingMuDepEnergy_Sta = theDbe->book1D(histname+AlgoName,
"Pointing sta muons energy deposited in the ECAL 3*3 towers", emS9NoBin, emS9NoMin, emS9NoMax);
100 ecalS9PointingMuDepEnergy_Sta->setAxisTitle(
"GeV");
102 histname =
"hadDepositedEnergyBarrel_";
103 hcalDepEnergyBarrel = theDbe->book1D(histname+AlgoName,
"Energy deposited in the HCAL barrel cells", hadNoBin, hadNoMin, hadNoMax);
104 hcalDepEnergyBarrel->setAxisTitle(
"GeV");
105 histname =
"hadDepositedEnergyEndcap_";
106 hcalDepEnergyEndcap = theDbe->book1D(histname+AlgoName,
"Energy deposited in the HCAL endcap cells", hadNoBin, hadNoMin, hadNoMax);
107 hcalDepEnergyEndcap->setAxisTitle(
"GeV");
109 histname =
"hadS9DepositedEnergyBarrel_";
110 hcalS9DepEnergyBarrel = theDbe->book1D(histname+AlgoName,
"Energy deposited in the HCAL barrel 3*3 towers", hadS9NoBin, hadS9NoMin, hadS9NoMax);
111 hcalS9DepEnergyBarrel->setAxisTitle(
"GeV");
112 histname =
"hadS9DepositedEnergyEndcap_";
113 hcalS9DepEnergyEndcap = theDbe->book1D(histname+AlgoName,
"Energy deposited in the HCAL endcap 3*3 towers", hadS9NoBin, hadS9NoMin, hadS9NoMax);
114 hcalS9DepEnergyEndcap->setAxisTitle(
"GeV");
115 histname =
"hadS9PointingMuDepositedEnergy_Glb_";
116 hcalS9PointingMuDepEnergy_Glb = theDbe->book1D(histname+AlgoName,
"Pointing glb muons energy deposited in the HCAL endcap 3*3 towers", hadS9NoBin, hadS9NoMin, hadS9NoMax);
117 hcalS9PointingMuDepEnergy_Glb->setAxisTitle(
"GeV");
118 histname =
"hadS9PointingMuDepositedEnergy_Tk_";
119 hcalS9PointingMuDepEnergy_Tk = theDbe->book1D(histname+AlgoName,
"Pointing tk muons energy deposited in the HCAL endcap 3*3 towers", hadS9NoBin, hadS9NoMin, hadS9NoMax);
120 hcalS9PointingMuDepEnergy_Tk->setAxisTitle(
"GeV");
121 histname =
"hadS9PointingMuDepositedEnergy_Sta_";
122 hcalS9PointingMuDepEnergy_Sta = theDbe->book1D(histname+AlgoName,
"Pointing sta muons energy deposited in the HCAL endcap 3*3 towers", hadS9NoBin, hadS9NoMin, hadS9NoMax);
123 hcalS9PointingMuDepEnergy_Sta->setAxisTitle(
"GeV");
125 histname =
"hoDepositedEnergy_";
126 hoDepEnergy = theDbe->book1D(histname+AlgoName,
"Energy deposited in the HO cells", hoNoBin, hoNoMin, hoNoMax);
127 hoDepEnergy->setAxisTitle(
"GeV");
129 histname =
"hoS9DepositedEnergy_";
130 hoS9DepEnergy = theDbe->book1D(histname+AlgoName,
"Energy deposited in the HO 3*3 towers", hoS9NoBin, hoS9NoMin, hoS9NoMax);
131 hoS9DepEnergy->setAxisTitle(
"GeV");
132 histname =
"hoS9PointingMuDepositedEnergy_Glb_";
133 hoS9PointingMuDepEnergy_Glb = theDbe->book1D(histname+AlgoName,
"Pointing glb muons energy deposited in the HO 3*3 towers", hoS9NoBin, hoS9NoMin, hoS9NoMax);
134 hoS9PointingMuDepEnergy_Glb->setAxisTitle(
"GeV");
135 histname =
"hoS9PointingMuDepositedEnergy_Tk_";
136 hoS9PointingMuDepEnergy_Tk = theDbe->book1D(histname+AlgoName,
"Pointing tk muons energy deposited in the HO 3*3 towers", hoS9NoBin, hoS9NoMin, hoS9NoMax);
137 hoS9PointingMuDepEnergy_Tk->setAxisTitle(
"GeV");
138 histname =
"hoS9PointingMuDepositedEnergy_Sta_";
139 hoS9PointingMuDepEnergy_Sta = theDbe->book1D(histname+AlgoName,
"Pointing sta muons energy deposited in the HO 3*3 towers", hoS9NoBin, hoS9NoMin, hoS9NoMax);
140 hoS9PointingMuDepEnergy_Sta->setAxisTitle(
"GeV");
145 theService->update(iSetup);
149 iEvent.
getByToken(theMuonCollectionLabel_,muons);
153 for (reco::MuonCollection::const_iterator recoMu = muons->begin(); recoMu!=muons->end(); ++recoMu){
159 if (fabs(recoMu->eta()) > 1.479)
160 ecalDepEnergyEndcap->Fill(muEnergy.
em);
162 ecalDepEnergyBarrel->Fill(muEnergy.
em);
166 if (fabs(recoMu->eta()) > 1.4)
167 hcalDepEnergyEndcap->Fill(muEnergy.
had);
169 hcalDepEnergyBarrel->Fill(muEnergy.
had);
173 if (fabs(recoMu->eta()) < 1.26)
174 hoDepEnergy->Fill(muEnergy.
ho);
178 if (fabs(recoMu->eta()) > 1.479)
179 ecalS9DepEnergyEndcap->Fill(muEnergy.
emS9);
181 ecalS9DepEnergyBarrel->Fill(muEnergy.
emS9);
185 if (fabs(recoMu->eta()) > 1.4)
186 hcalS9DepEnergyEndcap->Fill(muEnergy.
hadS9);
188 hcalS9DepEnergyBarrel->Fill(muEnergy.
hadS9);
192 if (fabs(recoMu->eta()) < 1.26)
193 hoS9DepEnergy->Fill(muEnergy.
hoS9);
200 if(recoMu->isGlobalMuon())
201 TransTrack = theB->build(recoMu->globalTrack());
202 if(recoMu->isTrackerMuon() && !(recoMu->isGlobalMuon()))
203 TransTrack = theB->build(recoMu->innerTrack());
204 if(recoMu->isStandAloneMuon() && !(recoMu->isGlobalMuon()))
205 TransTrack = theB->build(recoMu->outerTrack());
212 if(recoMu->isGlobalMuon()){
213 ecalS9PointingMuDepEnergy_Glb->Fill(muEnergy.
emS9);
214 hcalS9PointingMuDepEnergy_Glb->Fill(muEnergy.
hadS9);
215 hoS9PointingMuDepEnergy_Glb->Fill(muEnergy.
hoS9);
218 if(recoMu->isTrackerMuon() && !(recoMu->isGlobalMuon())){
219 ecalS9PointingMuDepEnergy_Tk->Fill(muEnergy.
emS9);
220 hcalS9PointingMuDepEnergy_Tk->Fill(muEnergy.
hadS9);
221 hoS9PointingMuDepEnergy_Tk->Fill(muEnergy.
hoS9);
224 if(recoMu->isStandAloneMuon() && !(recoMu->isGlobalMuon())){
225 ecalS9PointingMuDepEnergy_Sta->Fill(muEnergy.
emS9);
226 hcalS9PointingMuDepEnergy_Sta->Fill(muEnergy.
hadS9);
227 hoS9PointingMuDepEnergy_Sta->Fill(muEnergy.
hoS9);
MuonEnergyDepositAnalyzer(const edm::ParameterSet &)
Constructor.
void analyze(const edm::Event &, const edm::EventSetup &)
Get the analysis.
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
void beginJob()
Inizialize parameters for histo binning.
void beginRun(const edm::Run &run, const edm::EventSetup &iSetup)
float ho
energy deposited in crossed HO towers
virtual ~MuonEnergyDepositAnalyzer()
Destructor.
Abs< T >::type abs(const T &t)
float hoS9
energy deposited in 3x3 HO tower shape around central tower
TrajectoryStateOnSurface TSOS
TrajectoryStateOnSurface impactPointState() const
float hadS9
energy deposited in 3x3 HCAL tower shape around central tower