18 srcMuons_(cfg.getParameter<edm::InputTag>(
"srcMuons")),
19 srcDistanceMapMuPlus_(cfg.getParameter<edm::InputTag>(
"distanceMapMuPlus")),
20 srcDistanceMapMuMinus_(cfg.getParameter<edm::InputTag>(
"distanceMapMuMinus")),
21 sfAbsEtaLt12_(cfg.getParameter<double>(
"H_Calo_AbsEtaLt12")),
22 sfAbsEta12to17_(cfg.getParameter<double>(
"H_Calo_AbsEta12to17")),
23 sfAbsEtaGt17_(cfg.getParameter<double>(
"H_Calo_AbsEtaGt17"))
58 for ( l1extra::L1EtMissParticleCollection::const_iterator met1_i = met1->begin();
59 met1_i != met1->end(); ++met1_i ) {
60 bx_set.insert(met1_i->bx());
62 for ( l1extra::L1EtMissParticleCollection::const_iterator met2_i = met2->begin();
63 met2_i != met2->end(); ++met2_i ) {
64 bx_set.insert(met2_i->bx());
67 std::vector<int> bx_vector;
68 for ( std::set<int>::const_iterator
bx = bx_set.begin();
69 bx != bx_set.end(); ++
bx ) {
70 bx_vector.push_back(*
bx);
72 std::sort(bx_vector.begin(), bx_vector.end());
74 for ( std::vector<int>::const_iterator
bx = bx_vector.begin();
75 bx != bx_vector.end(); ++
bx ) {
76 bool errorFlag =
false;
79 for ( l1extra::L1EtMissParticleCollection::const_iterator met1_i = met1->begin();
80 met1_i != met1->end(); ++met1_i ) {
81 if ( met1_i->bx() == (*bx) ) {
82 if ( met1_bx ) errorFlag =
true;
88 for ( l1extra::L1EtMissParticleCollection::const_iterator met2_i = met2->begin();
89 met2_i != met2->end(); ++met2_i ) {
90 if ( met2_i->bx() == (*bx) ) {
91 if ( met2_bx ) errorFlag =
true;
98 <<
" Failed to find unique match of MET objects for BX = " << (*bx) <<
" !!\n";
99 assert(met1_bx || met2_bx);
102 if ( met1_bx && met2_bx && met1_bx->
type() != met2_bx->
type() )
104 <<
" Mismatch in type between MET objects stored in collections 'src1' and 'src2' !!\n";
106 double metSumPx = 0.;
107 double metSumPy = 0.;
108 double metSumEt = 0.;
113 metSumPx += met1_bx->
px();
114 metSumPy += met1_bx->
py();
115 metSumEt += met1_bx->
etTotal();
116 type = met1_bx->
type();
121 metSumPx += met2_bx->
px();
122 metSumPy += met2_bx->
py();
123 metSumEt += met2_bx->
etTotal();
124 type = met2_bx->
type();
129 for ( reco::CandidateCollection::const_iterator
muon = muons->begin();
134 double distance_ecal = 0.;
135 double distance_hcal = 0.;
137 (*distanceMapMuPlus) : (*distanceMapMuMinus);
138 for ( detIdToFloatMap::const_iterator dist_iter = distanceMap.begin();
139 dist_iter != distanceMap.end(); ++dist_iter ) {
140 const DetId&
id = dist_iter->first;
141 if (
id.det() ==
DetId::Ecal ) distance_ecal += dist_iter->second;
156 double muonEnLoss = muonEnLoss_theory;
163 double muonEnLoss_transverse = muonEnLoss*
sin(
muon->theta());
164 if ( muonEnLoss_transverse > metSumEt ) muonEnLoss_transverse = metSumEt;
168 double muonMetCorrPx = muonEnLoss_transverse*
cos(
muon->phi());
169 double muonMetCorrPy = muonEnLoss_transverse*
sin(
muon->phi());
170 double muonMetCorrSumEt = muonEnLoss_transverse;
172 metSumPx += muonMetCorrPx;
173 metSumPy += muonMetCorrPy;
174 metSumEt -= muonMetCorrSumEt;
178 const double metSumPt = TMath::Sqrt(metSumPx*metSumPx + metSumPy*metSumPy);
191 metSum->push_back(metSum_bx);
const double DENSITY_PBWO4
Sin< T >::type sin(const T &t)
virtual double py() const GCC11_FINAL
y coordinate of momentum vector
const double DENSITY_BRASS
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
double getDeDxForPbWO4(double)
Cos< T >::type cos(const T &t)
virtual double px() const GCC11_FINAL
x coordinate of momentum vector
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
math::XYZTLorentzVector LorentzVector
Lorentz vector.
const double & etTotal() const
#define DEFINE_EDM_PLUGIN(factory, type, name)