CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
ZMuMuMuonUserData Class Reference
Inheritance diagram for ZMuMuMuonUserData:
edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

Public Member Functions

 ZMuMuMuonUserData (const edm::ParameterSet &)
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
boost::function< void(const
BranchDescription &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 

Private Member Functions

template<typename T >
vector< double > isolation (const T &t, double ptThreshold, double etEcalThreshold, double etHcalThreshold, double dRVetoTrk, double dRTrk, double dREcal, double dRHcal, double alpha, double beta)
 
void produce (edm::Event &, const edm::EventSetup &)
 

Private Attributes

double alpha_
 
InputTag beamSpot_
 
double beta_
 
double dREcal_
 
double dRHcal_
 
double dRTrk_
 
double dRVetoTrk_
 
double etEcalThreshold_
 
double etHcalThreshold_
 
string hltPath_
 
InputTag primaryVertices_
 
double ptThreshold_
 
InputTag src_
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
typedef WorkerT< EDProducerWorkerType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDProducer
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::ProducerBase
template<class TProducer , class TMethod >
void callWhenNewProductsRegistered (TProducer *iProd, TMethod iMethod)
 

Detailed Description

Definition at line 28 of file ZMuMuMuonUserData.cc.

Constructor & Destructor Documentation

ZMuMuMuonUserData::ZMuMuMuonUserData ( const edm::ParameterSet cfg)

Definition at line 89 of file ZMuMuMuonUserData.cc.

89  :
90  src_( cfg.getParameter<InputTag>( "src" ) ),
91  beamSpot_(cfg.getParameter<InputTag>( "beamSpot" ) ),
92  primaryVertices_(cfg.getParameter<InputTag>( "primaryVertices" ) ),
93  alpha_(cfg.getParameter<double>("alpha") ),
94  beta_(cfg.getParameter<double>("beta") ),
95  ptThreshold_(cfg.getParameter<double >("ptThreshold") ),
96  etEcalThreshold_(cfg.getParameter<double >("etEcalThreshold") ),
97  etHcalThreshold_(cfg.getParameter<double >("etHcalThreshold") ),
98  dRVetoTrk_(cfg.getParameter<double >("dRVetoTrk") ),
99  dRTrk_(cfg.getParameter<double >("dRTrk") ),
100  dREcal_(cfg.getParameter<double >("dREcal") ),
101  dRHcal_(cfg.getParameter<double >("dRHcal") ),
102  hltPath_(cfg.getParameter<std::string >("hltPath") ){
103  produces<std::vector<pat::Muon> >();
104 }
T getParameter(std::string const &) const

Member Function Documentation

template<typename T >
vector< double > ZMuMuMuonUserData::isolation ( const T &  t,
double  ptThreshold,
double  etEcalThreshold,
double  etHcalThreshold,
double  dRVetoTrk,
double  dRTrk,
double  dREcal,
double  dRHcal,
double  alpha,
double  beta 
)
private

Definition at line 43 of file ZMuMuMuonUserData.cc.

References beta, dir, pat::EcalIso, pat::HcalIso, ExpressReco_HICollisions_FallBack::iso, reco::IsoDeposit::sumWithin(), and pat::TrackIso.

Referenced by produce().

43  {
44 
45  vector<double> iso;
46  const pat::IsoDeposit * trkIso = t.isoDeposit(pat::TrackIso);
47  const pat::IsoDeposit * ecalIso = t.isoDeposit(pat::EcalIso);
48  const pat::IsoDeposit * hcalIso = t.isoDeposit(pat::HcalIso);
49 
50  Direction dir = Direction(t.eta(), t.phi());
51 
53  vetosTrk.push_back(new ConeVeto( dir, dRVetoTrk ));
54  vetosTrk.push_back(new ThresholdVeto( ptThreshold ));
55 
56  pat::IsoDeposit::AbsVetos vetosEcal;
57  vetosEcal.push_back(new ConeVeto( dir, 0.));
58  vetosEcal.push_back(new ThresholdVeto( etEcalThreshold ));
59 
60  pat::IsoDeposit::AbsVetos vetosHcal;
61  vetosHcal.push_back(new ConeVeto( dir, 0. ));
62  vetosHcal.push_back(new ThresholdVeto( etHcalThreshold ));
63 
64  double isovalueTrk = (trkIso->sumWithin(dRTrk,vetosTrk));
65  double isovalueEcal = (ecalIso->sumWithin(dREcal,vetosEcal));
66  double isovalueHcal = (hcalIso->sumWithin(dRHcal,vetosHcal));
67 
68  iso.push_back(isovalueTrk);
69  //cout<<"isoTrk"<<isovalueTrk<<" "<<t.trackIso()<<endl;
70  iso.push_back(isovalueEcal);
71  //cout<<"isoEcal"<<isovalueEcal<<" "<<t.ecalIso()<<endl;
72  iso.push_back(isovalueHcal);
73  //cout<<"isoHcal"<<isovalueHcal<<" "<<t.hcalIso()<<endl;
74  //double isovalueTrk = t.trackIso();
75  //double isovalueEcal = t.ecalIso();
76  //double isovalueHcal = t.hcalIso();
77 
78  //double iso = isovalueTrk + isovalueEcal + isovalueHcal;
79  double combIso = alpha*( ((1+beta)/2*isovalueEcal) + ((1-beta)/2*isovalueHcal) ) + ((1-alpha)*isovalueTrk);
80  iso.push_back(combIso);
81  //cout<<"combIso"<<iso[3]<<endl;
82 
83  double relIso = combIso /= t.pt();
84  iso.push_back(relIso);
85  //cout<<"relIso"<<iso[4]<<endl;
86  return iso;
87 }
const double beta
float alpha
Definition: AMPTWrapper.h:95
double sumWithin(double coneSize, const AbsVetos &vetos=AbsVetos(), bool skipDepositVeto=false) const
Definition: IsoDeposit.cc:138
dbl *** dir
Definition: mlp_gen.cc:35
isodeposit::AbsVetos AbsVetos
Definition: IsoDeposit.h:50
void ZMuMuMuonUserData::produce ( edm::Event evt,
const edm::EventSetup  
)
privatevirtual

Implements edm::EDProducer.

Definition at line 106 of file ZMuMuMuonUserData.cc.

References pat::PATObject< ObjectType >::addUserFloat(), alpha_, beamSpot_, beta_, reco::Muon::calEnergy(), dREcal_, dRHcal_, dRTrk_, dRVetoTrk_, reco::MuonEnergy::em, etEcalThreshold_, etHcalThreshold_, edm::Event::getByLabel(), pat::Muon::globalTrack(), reco::MuonEnergy::had, hltPath_, i, pat::Muon::innerTrack(), reco::Muon::isGlobalMuon(), edm::Ref< C, T, F >::isNonnull(), ExpressReco_HICollisions_FallBack::iso, isolation(), reco::Muon::isStandAloneMuon(), reco::Muon::isTrackerMuon(), m, ExpressReco_HICollisions_FallBack::muons, reco::Muon::numberOfChambers(), reco::Muon::numberOfMatches(), pat::Muon::outerTrack(), primaryVertices_, ptThreshold_, edm::Event::put(), pat::Lepton< LeptonType >::setIsolation(), src_, pat::PATObject< ObjectType >::triggerObjectMatchesByPath(), pat::User1Iso, pat::User2Iso, pat::User3Iso, pat::User4Iso, and pat::User5Iso.

Referenced by python.JSONExport.JsonExport::export(), and python.HTMLExport.HTMLExport::export().

106  {
108  evt.getByLabel(src_,muons);
109 
110  Handle<BeamSpot> beamSpotHandle;
111  evt.getByLabel(beamSpot_, beamSpotHandle);
112 
113  Handle<VertexCollection> primaryVertices; // Collection of primary Vertices
114  evt.getByLabel(primaryVertices_, primaryVertices);
115 
116  auto_ptr<vector<pat::Muon> > muonColl( new vector<pat::Muon> (*muons) );
117  for (unsigned int i = 0; i< muonColl->size();++i){
118  pat::Muon & m = (*muonColl)[i];
119  //pat::Muon *mu = new pat::Muon(m);
121  m.setIsolation(pat::User1Iso, iso[0]);
122  //cout<<"muon User1Iso "<<iso[0]<<endl;
123  m.setIsolation(pat::User2Iso, iso[1]);
124  //cout<<"iso2 "<<iso[1]<<endl;
125  m.setIsolation(pat::User3Iso, iso[2]);
126  //cout<<"iso3 "<<iso[2]<<endl;
127  m.setIsolation(pat::User4Iso, iso[3]);
128  //cout<<"iso4 "<<iso[3]<<endl;
129  m.setIsolation(pat::User5Iso, iso[4]);
130  //cout<<"iso5 "<<iso[4]<<endl;
131  float zDauMuEnergyEm = m.calEnergy().em;
132  float zDauMuEnergyHad = m.calEnergy().had;
133  TrackRef muGlbRef = m.globalTrack();
134  TrackRef muTrkRef = m.innerTrack();
135  TrackRef muSaRef = m.outerTrack();
136  float zDaudxyFromBS = -1;
137  float zDaudzFromBS = -1;
138  float zDaudxyFromPV = -1;
139  float zDaudzFromPV = -1;
140  int zDauNofMuChambers = m.numberOfChambers();
141  int zDauNofMuMatches = m.numberOfMatches();
142  // for the following variables looking at global/trk and sta at the same time
143  float zDauChi2 = -1;
144  float zDauTrkChi2 = -1;
145  float zDauSaChi2 = -1;
146  float zDauNofMuonHits = -1;
147  float zDauSaNofMuonHits = -1;
148  float zDauNofStripHits = -1;
149  float zDauTrkNofStripHits = -1;
150  float zDauNofPixelHits = -1;
151  float zDauTrkNofPixelHits = -1;
152 
153 
154 
155 
156  if (muGlbRef.isNonnull() && m.isGlobalMuon() == true){
157  zDaudxyFromBS = muGlbRef->dxy(beamSpotHandle->position());
158  zDaudzFromBS = muGlbRef->dz(beamSpotHandle->position());
159  zDaudxyFromPV = muGlbRef->dxy(primaryVertices->begin()->position() );
160  zDaudzFromPV = muGlbRef->dz(primaryVertices->begin()->position() );
161  zDauChi2 = muGlbRef->normalizedChi2();
162  zDauTrkChi2 = muTrkRef->normalizedChi2();
163  zDauSaChi2 = muSaRef->normalizedChi2();
164  zDauNofMuonHits = muGlbRef->hitPattern().numberOfValidMuonHits();
165  zDauSaNofMuonHits = muSaRef->hitPattern().numberOfValidMuonHits();
166  zDauNofStripHits = muGlbRef->hitPattern().numberOfValidStripHits();
167  zDauTrkNofStripHits = muTrkRef->hitPattern().numberOfValidStripHits();
168  zDauNofPixelHits = muGlbRef->hitPattern().numberOfValidPixelHits();
169  zDauTrkNofPixelHits = muTrkRef->hitPattern().numberOfValidPixelHits();
170  }
171  else if (muSaRef.isNonnull() && m.isStandAloneMuon() == true){
172  zDaudxyFromBS = muSaRef->dxy(beamSpotHandle->position());
173  zDaudzFromBS = muSaRef->dz(beamSpotHandle->position());
174  zDaudxyFromPV = muSaRef->dxy(primaryVertices->begin()->position() );
175  zDaudzFromPV = muSaRef->dz(primaryVertices->begin()->position() );
176  zDauSaChi2 = muSaRef->normalizedChi2();
177  zDauSaNofMuonHits = muSaRef->hitPattern().numberOfValidMuonHits();
178 
179  }
180  else if (muTrkRef.isNonnull() && m.isTrackerMuon() == true){
181  zDaudxyFromBS = muTrkRef->dxy(beamSpotHandle->position());
182  zDaudzFromBS = muTrkRef->dz(beamSpotHandle->position());
183  zDaudxyFromPV = muTrkRef->dxy(primaryVertices->begin()->position() );
184  zDaudzFromPV = muTrkRef->dz(primaryVertices->begin()->position() );
185  zDauTrkChi2 = muTrkRef->normalizedChi2();
186  zDauTrkNofStripHits = muTrkRef->hitPattern().numberOfValidStripHits();
187  zDauTrkNofPixelHits = muTrkRef->hitPattern().numberOfValidPixelHits();
188 
189  }
190 
192  float muHLTBit;
193  int dimTrig = muHLTMatches.size();
194  if(dimTrig !=0 ){
195  muHLTBit = 1;
196  } else {
197  muHLTBit = 0;
198  }
199  m.addUserFloat("zDau_dxyFromBS", zDaudxyFromBS);
200  m.addUserFloat("zDau_dzFromBS", zDaudzFromBS);
201  m.addUserFloat("zDau_dxyFromPV", zDaudxyFromPV);
202  m.addUserFloat("zDau_dzFromPV", zDaudzFromPV);
203  m.addUserFloat("zDau_HLTBit",muHLTBit);
204  m.addUserFloat("zDau_dzFromPV", zDaudzFromPV);
205  m.addUserFloat("zDau_Chi2", zDauChi2);
206  m.addUserFloat("zDau_TrkChi2", zDauTrkChi2);
207  m.addUserFloat("zDau_SaChi2", zDauSaChi2);
208  m.addUserFloat("zDau_NofMuonHits" , zDauNofMuonHits );
209  m.addUserFloat("zDau_SaNofMuonHits" , zDauSaNofMuonHits );
210  m.addUserFloat("zDau_NofStripHits" , zDauNofStripHits );
211  m.addUserFloat("zDau_TrkNofStripHits" , zDauTrkNofStripHits );
212  m.addUserFloat("zDau_NofPixelHits" , zDauNofPixelHits );
213  m.addUserFloat("zDau_TrkNofPixelHits" , zDauTrkNofPixelHits );
214  m.addUserFloat("zDau_NofMuChambers" , zDauNofMuChambers );
215  m.addUserFloat("zDau_NofMuMatches" , zDauNofMuMatches );
216  m.addUserFloat("zDau_MuEnergyEm", zDauMuEnergyEm );
217  m.addUserFloat("zDau_MuEnergyHad", zDauMuEnergyHad );
218  }
219 
220  evt.put( muonColl);
221 }
int i
Definition: DBlmapReader.cc:9
reco::TrackRef innerTrack() const
reference to Track reconstructed in the tracker only (reimplemented from reco::Muon) ...
Definition: Muon.h:70
vector< double > isolation(const T &t, double ptThreshold, double etEcalThreshold, double etHcalThreshold, double dRVetoTrk, double dRTrk, double dREcal, double dRHcal, double alpha, double beta)
void setIsolation(IsolationKeys key, float value)
Definition: Lepton.h:99
bool isTrackerMuon() const
Definition: Muon.h:149
bool isGlobalMuon() const
Definition: Muon.h:148
std::vector< TriggerObjectStandAlone > TriggerObjectStandAloneCollection
Collection of TriggerObjectStandAlone.
bool isStandAloneMuon() const
Definition: Muon.h:150
reco::TrackRef outerTrack() const
reference to Track reconstructed in the muon detector only (reimplemented from reco::Muon) ...
Definition: Muon.h:74
const TriggerObjectStandAloneCollection triggerObjectMatchesByPath(const std::string &namePath, const bool pathLastFilterAccepted=true) const
Definition: PATObject.h:584
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:248
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:84
void addUserFloat(const std::string &label, float data)
Set user-defined float.
Definition: PATObject.h:753
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:359
reco::TrackRef globalTrack() const
reference to Track reconstructed in both tracked and muon detector (reimplemented from reco::Muon) ...
Definition: Muon.h:78
int numberOfMatches(ArbitrationType type=SegmentAndTrackArbitration) const
get number of chambers with matched segments
Definition: Muon.cc:40
MuonEnergy calEnergy() const
get energy deposition information
Definition: Muon.h:62
int numberOfChambers() const
Definition: Muon.h:121
Analysis-level muon class.
Definition: Muon.h:47

Member Data Documentation

double ZMuMuMuonUserData::alpha_
private

Definition at line 35 of file ZMuMuMuonUserData.cc.

Referenced by produce().

InputTag ZMuMuMuonUserData::beamSpot_
private

Definition at line 34 of file ZMuMuMuonUserData.cc.

Referenced by produce().

double ZMuMuMuonUserData::beta_
private

Definition at line 35 of file ZMuMuMuonUserData.cc.

Referenced by produce().

double ZMuMuMuonUserData::dREcal_
private

Definition at line 36 of file ZMuMuMuonUserData.cc.

Referenced by produce().

double ZMuMuMuonUserData::dRHcal_
private

Definition at line 36 of file ZMuMuMuonUserData.cc.

Referenced by produce().

double ZMuMuMuonUserData::dRTrk_
private

Definition at line 36 of file ZMuMuMuonUserData.cc.

Referenced by produce().

double ZMuMuMuonUserData::dRVetoTrk_
private

Definition at line 36 of file ZMuMuMuonUserData.cc.

Referenced by produce().

double ZMuMuMuonUserData::etEcalThreshold_
private

Definition at line 36 of file ZMuMuMuonUserData.cc.

Referenced by produce().

double ZMuMuMuonUserData::etHcalThreshold_
private

Definition at line 36 of file ZMuMuMuonUserData.cc.

Referenced by produce().

string ZMuMuMuonUserData::hltPath_
private

Definition at line 37 of file ZMuMuMuonUserData.cc.

Referenced by produce().

InputTag ZMuMuMuonUserData::primaryVertices_
private

Definition at line 34 of file ZMuMuMuonUserData.cc.

Referenced by produce().

double ZMuMuMuonUserData::ptThreshold_
private

Definition at line 36 of file ZMuMuMuonUserData.cc.

Referenced by produce().

InputTag ZMuMuMuonUserData::src_
private

Definition at line 34 of file ZMuMuMuonUserData.cc.

Referenced by produce().