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
ElectronConversionRejectionVars Class Reference

Store electron partner track conversion-rejection quantities ("dist" and "dcot") in the TP tree. More...

Inheritance diagram for ElectronConversionRejectionVars:
edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 ElectronConversionRejectionVars (const edm::ParameterSet &iConfig)
 
virtual void produce (edm::Event &iEvent, const edm::EventSetup &iSetup)
 
virtual ~ElectronConversionRejectionVars ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndex indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Attributes

edm::InputTag probes_
 

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)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDProducer
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Store electron partner track conversion-rejection quantities ("dist" and "dcot") in the TP tree.

Author
Kalanand Mishra Fermi National Accelerator Laboratory

Definition at line 33 of file ElectronConversionRejectionVars.cc.

Constructor & Destructor Documentation

ElectronConversionRejectionVars::ElectronConversionRejectionVars ( const edm::ParameterSet iConfig)
explicit

Definition at line 44 of file ElectronConversionRejectionVars.cc.

44  :
45  probes_(iConfig.getParameter<edm::InputTag>("probes"))
46 {
47  produces<edm::ValueMap<float> >("dist");
48  produces<edm::ValueMap<float> >("dcot");
49  produces<edm::ValueMap<float> >("convradius");
50  produces<edm::ValueMap<float> >("passConvRej");
51 }
T getParameter(std::string const &) const
ElectronConversionRejectionVars::~ElectronConversionRejectionVars ( )
virtual

Definition at line 54 of file ElectronConversionRejectionVars.cc.

55 {
56 }

Member Function Documentation

void ElectronConversionRejectionVars::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
virtual

Implements edm::EDProducer.

Definition at line 59 of file ElectronConversionRejectionVars.cc.

References ConversionInfo::dcot(), ConversionInfo::dist(), edm::Event::getByLabel(), probes_, edm::Event::put(), ConversionInfo::radiusOfConversion(), and makeHLTPrescaleTable::values.

59  {
60  using namespace edm;
61 
62  // read input
66 
67  iEvent.getByLabel(probes_, probes);
68  iEvent.getByLabel("generalTracks", tracks_h );
69  iEvent.getByLabel("gsfElectrons", elHandle);
70 
71  float evt_bField = 3.8;
72 
73 
74  // prepare vector for output
75  std::vector<float> values;
76  std::vector<float> values2;
77  std::vector<float> values3;
78  std::vector<float> values4;
79 
80  // fill: use brute force
81  double dist = 0.0;
82  double dcot = 0.0;
83  double convradius = 0.0;
84  double passConvRej = 0.0;
85  ConversionFinder convFinder;
86 
87  View<reco::Candidate>::const_iterator probe, endprobes = probes->end();
88  const reco::GsfElectronCollection* electronCollection = elHandle.product();
89  reco::GsfElectronCollection::const_iterator eleIt = electronCollection->begin();
90 
91  for (probe = probes->begin(); probe != endprobes; ++probe) {
92  for (eleIt=electronCollection->begin(); eleIt!=electronCollection->end(); eleIt++) {
93  if( fabs(eleIt->et() - probe->et() ) < 0.05 && fabs(eleIt->eta() - probe->eta() ) < 0.01
94  && fabs(eleIt->phi() - probe->phi() ) < 0.01 ){
95  //we have a match
96  ConversionInfo convInfo = convFinder.getConversionInfo(*eleIt, tracks_h, evt_bField);
97  dist = convInfo.dist();
98  dcot = convInfo.dcot();
99  convradius = convInfo.radiusOfConversion();
100  if( fabs(dist)>0.02 && fabs(dcot)>0.02) passConvRej = 1.0;
101  break; //got our guy, so break
102  }
103  }
104  values.push_back(dist);
105  values2.push_back(dcot);
106  values3.push_back(convradius);
107  values4.push_back(passConvRej);
108  }
109 
110 
111  // convert into ValueMap and store
112  std::auto_ptr<ValueMap<float> > valMap(new ValueMap<float>());
113  ValueMap<float>::Filler filler(*valMap);
114  filler.insert(probes, values.begin(), values.end());
115  filler.fill();
116  iEvent.put(valMap, "dist");
117 
118 
119  // ---> same for dcot
120  std::auto_ptr<ValueMap<float> > valMap2(new ValueMap<float>());
121  ValueMap<float>::Filler filler2(*valMap2);
122  filler2.insert(probes, values2.begin(), values2.end());
123  filler2.fill();
124  iEvent.put(valMap2, "dcot");
125 
126  // ---> same for convradius
127  std::auto_ptr<ValueMap<float> > valMap3(new ValueMap<float>());
128  ValueMap<float>::Filler filler3(*valMap3);
129  filler3.insert(probes, values3.begin(), values3.end());
130  filler3.fill();
131  iEvent.put(valMap3, "convradius");
132 
133 
134  // ---> same for passConvRej
135  std::auto_ptr<ValueMap<float> > valMap4(new ValueMap<float>());
136  ValueMap<float>::Filler filler4(*valMap4);
137  filler4.insert(probes, values4.begin(), values4.end());
138  filler4.fill();
139  iEvent.put(valMap4, "passConvRej");
140 }
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Definition: View.h:81
double radiusOfConversion() const
double dist() const
std::vector< GsfElectron > GsfElectronCollection
collection of GsfElectron objects
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:94
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:361
double dcot() const

Member Data Documentation

edm::InputTag ElectronConversionRejectionVars::probes_
private

Definition at line 41 of file ElectronConversionRejectionVars.cc.

Referenced by produce().