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 Attributes
RecoConversionMaker Class Reference

#include <RecoConversionMaker.h>

Public Member Functions

 RecoConversionMaker (const edm::ParameterSet &, edm::ConsumesCollector)
 
void SetVars (HWW &, const edm::Event &, const edm::EventSetup &)
 

Private Attributes

edm::EDGetTokenT< reco::BeamSpotBeamSpot_
 
edm::EDGetTokenT< edm::View
< reco::Conversion > > 
Conversion_
 

Detailed Description

Definition at line 9 of file RecoConversionMaker.h.

Constructor & Destructor Documentation

RecoConversionMaker::RecoConversionMaker ( const edm::ParameterSet iConfig,
edm::ConsumesCollector  iCollector 
)

Definition at line 9 of file RecoConversionMaker.cc.

References edm::ConsumesCollector::consumes(), and edm::ParameterSet::getParameter().

9  {
10 
11  Conversion_ = iCollector.consumes<edm::View<reco::Conversion> >(iConfig.getParameter<edm::InputTag>("recoConversionInputTag"));
12  BeamSpot_ = iCollector.consumes<reco::BeamSpot>(iConfig.getParameter<edm::InputTag>("beamSpotTag"));
13 
14 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
edm::EDGetTokenT< edm::View< reco::Conversion > > Conversion_
edm::EDGetTokenT< reco::BeamSpot > BeamSpot_

Member Function Documentation

void RecoConversionMaker::SetVars ( HWW hww,
const edm::Event iEvent,
const edm::EventSetup iSetup 
)

Definition at line 30 of file RecoConversionMaker.cc.

References HWW::convs_chi2(), HWW::convs_dl(), HWW::convs_isConverted(), HWW::convs_ndof(), HWW::convs_nHitsBeforeVtx(), HWW::convs_quality(), HWW::convs_tkalgo(), HWW::convs_tkidx(), edm::Event::getByToken(), i, HWW::Load_convs_chi2(), HWW::Load_convs_dl(), HWW::Load_convs_isConverted(), HWW::Load_convs_ndof(), HWW::Load_convs_nHitsBeforeVtx(), HWW::Load_convs_quality(), HWW::Load_convs_tkalgo(), HWW::Load_convs_tkidx(), and lxy().

Referenced by HWWAnalyzer::analyze().

30  {
31 
33  hww.Load_convs_quality();
34  hww.Load_convs_tkidx();
35  hww.Load_convs_tkalgo();
37  hww.Load_convs_ndof();
38  hww.Load_convs_chi2();
39  hww.Load_convs_dl();
40 
41  bool validToken;
42 
43  // get reco Conversions
44  Handle<View<Conversion> > convs_h;
45  validToken = iEvent.getByToken(Conversion_, convs_h);
46  if(!validToken) return;
47 
48  Handle<BeamSpot> beamSpotH;
49  validToken = iEvent.getByToken(BeamSpot_, beamSpotH);
50  if(!validToken) return;
51 
52  for(View<Conversion>::const_iterator it = convs_h->begin();
53  it != convs_h->end(); it++) {
54 
55  hww.convs_isConverted().push_back(it->isConverted());
56  //quality
57  int qualityMask = 0;
58  for(int iM = 0; iM < 32; ++iM) {
59  if(it->quality((Conversion::ConversionQuality)iM)) qualityMask |= 1 << iM;
60  }
61 
62  hww.convs_quality().push_back(qualityMask);
63 
64  vector<edm::RefToBase<reco::Track> > v_temp_trks = it->tracks();
65  vector<int> v_temp_out;
66  vector<int> v_temp_outalgo;
67  for(unsigned int i = 0; i < v_temp_trks.size(); i++) {
68  v_temp_out.push_back(v_temp_trks.at(i).key());
69  v_temp_outalgo.push_back(v_temp_trks.at(i)->algo());
70  }
71 
72 
73  hww.convs_tkidx().push_back(v_temp_out);
74  hww.convs_tkalgo().push_back(v_temp_outalgo);
75 
76  v_temp_out.clear();
77  v_temp_outalgo.clear();
78  vector<uint8_t> v_temp_nhits = it->nHitsBeforeVtx();
79 
80  for(unsigned int i = 0; i < v_temp_nhits.size(); i++) v_temp_out.push_back(v_temp_nhits.at(i));
81 
82  hww.convs_nHitsBeforeVtx().push_back(v_temp_out);
83  hww.convs_ndof().push_back(it->conversionVertex().ndof() );
84  hww.convs_chi2().push_back(it->conversionVertex().chi2() );
85  hww.convs_dl().push_back(lxy(beamSpotH->position(), *it));
86 
87  }//reco conversion loop
88 }
double lxy(const math::XYZPoint &myBeamSpot, const Conversion &conv)
void Load_convs_isConverted()
Definition: HWW.cc:1283
int i
Definition: DBlmapReader.cc:9
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Definition: View.h:81
void Load_convs_tkalgo()
Definition: HWW.cc:1286
void Load_convs_nHitsBeforeVtx()
Definition: HWW.cc:1292
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:434
edm::EDGetTokenT< edm::View< reco::Conversion > > Conversion_
void Load_convs_quality()
Definition: HWW.cc:1295
void Load_convs_dl()
Definition: HWW.cc:1280
void Load_convs_ndof()
Definition: HWW.cc:1274
std::vector< std::vector< int > > & convs_nHitsBeforeVtx()
Definition: HWW.cc:673
std::vector< std::vector< int > > & convs_tkalgo()
Definition: HWW.cc:665
std::vector< float > & convs_chi2()
Definition: HWW.cc:653
std::vector< float > & convs_ndof()
Definition: HWW.cc:649
std::vector< int > & convs_quality()
Definition: HWW.cc:677
std::vector< float > & convs_dl()
Definition: HWW.cc:657
void Load_convs_chi2()
Definition: HWW.cc:1277
edm::EDGetTokenT< reco::BeamSpot > BeamSpot_
void Load_convs_tkidx()
Definition: HWW.cc:1289
std::vector< int > & convs_isConverted()
Definition: HWW.cc:661
std::vector< std::vector< int > > & convs_tkidx()
Definition: HWW.cc:669

Member Data Documentation

edm::EDGetTokenT<reco::BeamSpot> RecoConversionMaker::BeamSpot_
private

Definition at line 19 of file RecoConversionMaker.h.

edm::EDGetTokenT<edm::View<reco::Conversion> > RecoConversionMaker::Conversion_
private

Definition at line 18 of file RecoConversionMaker.h.