CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CaloRecoTauDiscriminationAgainstElectron.cc
Go to the documentation of this file.
2 
5 
6 /* class CaloRecoTauDiscriminationAgainstElectron
7  * created : Feb 17 2008,
8  * revised : ,
9  * contributors : Konstantinos Petridis, Sebastien Greder,
10  * Maiko Takahashi, Alexandre Nikitenko (Imperial College, London),
11  * Evan Friis (UC Davis)
12  */
13 
14 using namespace reco;
15 
17  public:
19  CaloTauProducer_ = iConfig.getParameter<edm::InputTag>("CaloTauProducer");
20  leadTrack_HCAL3x3hitsEtSumOverPt_minvalue_ = iConfig.getParameter<double>("leadTrack_HCAL3x3hitsEtSumOverPt_minvalue");
21  ApplyCut_maxleadTrackHCAL3x3hottesthitDEta_ = iConfig.getParameter<bool>("ApplyCut_maxleadTrackHCAL3x3hottesthitDEta");
22  maxleadTrackHCAL3x3hottesthitDEta_ = iConfig.getParameter<double>("maxleadTrackHCAL3x3hottesthitDEta");
23  ApplyCut_leadTrackavoidsECALcrack_ = iConfig.getParameter<bool>("ApplyCut_leadTrackavoidsECALcrack");
24  }
26  double discriminate(const CaloTauRef& theCaloTauRef);
27  void beginEvent(const edm::Event& event, const edm::EventSetup& eventSetup);
28  private:
35 };
36 
38 {
39  if (ApplyCut_leadTrackavoidsECALcrack_)
40  {
41  // get the magnetic field, if we need it
42  eventSetup.get<IdealMagneticFieldRecord>().get(theMagneticField);
43  }
44 }
45 
46 
48 {
49  if (ApplyCut_maxleadTrackHCAL3x3hottesthitDEta_){
50  // optional selection : ask for small |deta| between direction of propag. leading Track - ECAL inner surf. contact point and direction of highest Et hit among HCAL hits inside a 3x3 calo. tower matrix centered on direction of propag. leading Track - ECAL inner surf. contact point
51  if (std::isnan((*theCaloTauRef).leadTrackHCAL3x3hottesthitDEta()) || (*theCaloTauRef).leadTrackHCAL3x3hottesthitDEta()>maxleadTrackHCAL3x3hottesthitDEta_) return 0.;
52  }
53  if (ApplyCut_leadTrackavoidsECALcrack_){
54  // optional selection : ask that leading track - ECAL inner surface contact point does not fall inside any ECAL eta crack
55  math::XYZPoint thepropagleadTrackECALSurfContactPoint = TauTagTools::propagTrackECALSurfContactPoint(theMagneticField.product(),(*theCaloTauRef).leadTrack());
56  if(thepropagleadTrackECALSurfContactPoint.R()==0. ||
57  fabs(thepropagleadTrackECALSurfContactPoint.eta())<ECALBounds::crack_absEtaIntervalA().second ||
58  (fabs(thepropagleadTrackECALSurfContactPoint.eta())>ECALBounds::crack_absEtaIntervalB().first && fabs(thepropagleadTrackECALSurfContactPoint.eta())<ECALBounds::crack_absEtaIntervalB().second) ||
59  (fabs(thepropagleadTrackECALSurfContactPoint.eta())>ECALBounds::crack_absEtaIntervalC().first && fabs(thepropagleadTrackECALSurfContactPoint.eta())<ECALBounds::crack_absEtaIntervalC().second) ||
60  (fabs(thepropagleadTrackECALSurfContactPoint.eta())>ECALBounds::crack_absEtaIntervalD().first && fabs(thepropagleadTrackECALSurfContactPoint.eta())<ECALBounds::crack_absEtaIntervalD().second) ||
61  (fabs(thepropagleadTrackECALSurfContactPoint.eta())>ECALBounds::crack_absEtaIntervalE().first && fabs(thepropagleadTrackECALSurfContactPoint.eta())<ECALBounds::crack_absEtaIntervalE().second))
62  {
63  return 0.;
64  }
65  }
66  if (std::isnan((*theCaloTauRef).leadTrackHCAL3x3hitsEtSum()))
67  {
68  return 0.;
69  } else
70  {
71  if ((*theCaloTauRef).leadTrackHCAL3x3hitsEtSum()/(*theCaloTauRef).leadTrack()->pt()<=leadTrack_HCAL3x3hitsEtSumOverPt_minvalue_) return 0.;
72  else return 1.;
73  }
74 }
75 
76  /*
77 void CaloRecoTauDiscriminationAgainstElectron::produce(edm::Event& iEvent,const edm::EventSetup& iEventSetup){
78  edm::Handle<CaloTauCollection> theCaloTauCollection;
79  iEvent.getByLabel(CaloTauProducer_,theCaloTauCollection);
80 
81  // fill the AssociationVector object
82  auto_ptr<CaloTauDiscriminator> theCaloTauDiscriminatorAgainstElectron(new CaloTauDiscriminator(CaloTauRefProd(theCaloTauCollection)));
83 
84  for(size_t iCaloTau=0;iCaloTau<theCaloTauCollection->size();++iCaloTau) {
85  CaloTauRef theCaloTauRef(theCaloTauCollection,iCaloTau);
86  if (!(*theCaloTauRef).leadTrack()){
87  theCaloTauDiscriminatorAgainstElectron->setValue(iCaloTau,0);
88  continue;
89  }
90  if (ApplyCut_maxleadTrackHCAL3x3hottesthitDEta_){
91  // optional selection : ask for small |deta| between direction of propag. leading Track - ECAL inner surf. contact point and direction of highest Et hit among HCAL hits inside a 3x3 calo. tower matrix centered on direction of propag. leading Track - ECAL inner surf. contact point
92  if (std::isnan((*theCaloTauRef).leadTrackHCAL3x3hottesthitDEta()) || (*theCaloTauRef).leadTrackHCAL3x3hottesthitDEta()>maxleadTrackHCAL3x3hottesthitDEta_){
93  theCaloTauDiscriminatorAgainstElectron->setValue(iCaloTau,0);
94  continue;
95  }
96  }
97  if (ApplyCut_leadTrackavoidsECALcrack_){
98  // optional selection : ask that leading track - ECAL inner surface contact point does not fall inside any ECAL eta crack
99  edm::ESHandle<MagneticField> theMagneticField;
100  iEventSetup.get<IdealMagneticFieldRecord>().get(theMagneticField);
101  math::XYZPoint thepropagleadTrackECALSurfContactPoint=TauTagTools::propagTrackECALSurfContactPoint(theMagneticField.product(),(*theCaloTauRef).leadTrack());
102  if(thepropagleadTrackECALSurfContactPoint.R()==0. ||
103  fabs(thepropagleadTrackECALSurfContactPoint.eta())<ECALBounds::crack_absEtaIntervalA().second ||
104  (fabs(thepropagleadTrackECALSurfContactPoint.eta())>ECALBounds::crack_absEtaIntervalB().first && fabs(thepropagleadTrackECALSurfContactPoint.eta())<ECALBounds::crack_absEtaIntervalB().second) ||
105  (fabs(thepropagleadTrackECALSurfContactPoint.eta())>ECALBounds::crack_absEtaIntervalC().first && fabs(thepropagleadTrackECALSurfContactPoint.eta())<ECALBounds::crack_absEtaIntervalC().second) ||
106  (fabs(thepropagleadTrackECALSurfContactPoint.eta())>ECALBounds::crack_absEtaIntervalD().first && fabs(thepropagleadTrackECALSurfContactPoint.eta())<ECALBounds::crack_absEtaIntervalD().second) ||
107  (fabs(thepropagleadTrackECALSurfContactPoint.eta())>ECALBounds::crack_absEtaIntervalE().first && fabs(thepropagleadTrackECALSurfContactPoint.eta())<ECALBounds::crack_absEtaIntervalE().second)
108  ){
109  theCaloTauDiscriminatorAgainstElectron->setValue(iCaloTau,0);
110  continue;
111  }
112  }
113  if (std::isnan((*theCaloTauRef).leadTrackHCAL3x3hitsEtSum())){
114  theCaloTauDiscriminatorAgainstElectron->setValue(iCaloTau,0);
115  }else{
116  if ((*theCaloTauRef).leadTrackHCAL3x3hitsEtSum()/(*theCaloTauRef).leadTrack()->pt()<=leadTrack_HCAL3x3hitsEtSumOverPt_minvalue_) theCaloTauDiscriminatorAgainstElectron->setValue(iCaloTau,0);
117  else theCaloTauDiscriminatorAgainstElectron->setValue(iCaloTau,1);
118  }
119  }
120 
121  iEvent.put(theCaloTauDiscriminatorAgainstElectron);
122 }
123 */
T getParameter(std::string const &) const
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
math::XYZPoint propagTrackECALSurfContactPoint(const MagneticField *, reco::TrackRef)
Definition: TauTagTools.cc:184
static std::pair< float, float > crack_absEtaIntervalA()
Definition: ECALBounds.h:32
static std::pair< float, float > crack_absEtaIntervalB()
Definition: ECALBounds.h:33
static std::pair< float, float > crack_absEtaIntervalE()
Definition: ECALBounds.h:36
bool isnan(float x)
Definition: math.h:13
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
CaloRecoTauDiscriminationAgainstElectron(const edm::ParameterSet &iConfig)
static std::pair< float, float > crack_absEtaIntervalC()
Definition: ECALBounds.h:34
static std::pair< float, float > crack_absEtaIntervalD()
Definition: ECALBounds.h:35
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:13
const T & get() const
Definition: EventSetup.h:55
void beginEvent(const edm::Event &event, const edm::EventSetup &eventSetup)