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 
6 
7 /* class CaloRecoTauDiscriminationAgainstElectron
8  * created : Feb 17 2008,
9  * revised : ,
10  * contributors : Konstantinos Petridis, Sebastien Greder,
11  * Maiko Takahashi, Alexandre Nikitenko (Imperial College, London),
12  * Evan Friis (UC Davis)
13  */
14 
15 using namespace reco;
16 
18  public:
20  CaloTauProducer_ = iConfig.getParameter<edm::InputTag>("CaloTauProducer");
21  leadTrack_HCAL3x3hitsEtSumOverPt_minvalue_ = iConfig.getParameter<double>("leadTrack_HCAL3x3hitsEtSumOverPt_minvalue");
22  ApplyCut_maxleadTrackHCAL3x3hottesthitDEta_ = iConfig.getParameter<bool>("ApplyCut_maxleadTrackHCAL3x3hottesthitDEta");
23  maxleadTrackHCAL3x3hottesthitDEta_ = iConfig.getParameter<double>("maxleadTrackHCAL3x3hottesthitDEta");
24  ApplyCut_leadTrackavoidsECALcrack_ = iConfig.getParameter<bool>("ApplyCut_leadTrackavoidsECALcrack");
25  }
27  double discriminate(const CaloTauRef& theCaloTauRef) override;
28  void beginEvent(const edm::Event& event, const edm::EventSetup& eventSetup) override;
29  private:
36 };
37 
39 {
40  if (ApplyCut_leadTrackavoidsECALcrack_)
41  {
42  // get the magnetic field, if we need it
43  eventSetup.get<IdealMagneticFieldRecord>().get(theMagneticField);
44  }
45 }
46 
47 
49 {
50  if (ApplyCut_maxleadTrackHCAL3x3hottesthitDEta_){
51  // 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
52  if (edm::isNotFinite((*theCaloTauRef).leadTrackHCAL3x3hottesthitDEta()) || (*theCaloTauRef).leadTrackHCAL3x3hottesthitDEta()>maxleadTrackHCAL3x3hottesthitDEta_) return 0.;
53  }
54  if (ApplyCut_leadTrackavoidsECALcrack_){
55  // optional selection : ask that leading track - ECAL inner surface contact point does not fall inside any ECAL eta crack
56  math::XYZPoint thepropagleadTrackECALSurfContactPoint = TauTagTools::propagTrackECALSurfContactPoint(theMagneticField.product(),(*theCaloTauRef).leadTrack());
57  if(thepropagleadTrackECALSurfContactPoint.R()==0. ||
58  fabs(thepropagleadTrackECALSurfContactPoint.eta())<ECALBounds::crack_absEtaIntervalA().second ||
59  (fabs(thepropagleadTrackECALSurfContactPoint.eta())>ECALBounds::crack_absEtaIntervalB().first && fabs(thepropagleadTrackECALSurfContactPoint.eta())<ECALBounds::crack_absEtaIntervalB().second) ||
60  (fabs(thepropagleadTrackECALSurfContactPoint.eta())>ECALBounds::crack_absEtaIntervalC().first && fabs(thepropagleadTrackECALSurfContactPoint.eta())<ECALBounds::crack_absEtaIntervalC().second) ||
61  (fabs(thepropagleadTrackECALSurfContactPoint.eta())>ECALBounds::crack_absEtaIntervalD().first && fabs(thepropagleadTrackECALSurfContactPoint.eta())<ECALBounds::crack_absEtaIntervalD().second) ||
62  (fabs(thepropagleadTrackECALSurfContactPoint.eta())>ECALBounds::crack_absEtaIntervalE().first && fabs(thepropagleadTrackECALSurfContactPoint.eta())<ECALBounds::crack_absEtaIntervalE().second))
63  {
64  return 0.;
65  }
66  }
67  if (edm::isNotFinite((*theCaloTauRef).leadTrackHCAL3x3hitsEtSum()))
68  {
69  return 0.;
70  } else
71  {
72  if ((*theCaloTauRef).leadTrackHCAL3x3hitsEtSum()/(*theCaloTauRef).leadTrack()->pt()<=leadTrack_HCAL3x3hitsEtSumOverPt_minvalue_) return 0.;
73  else return 1.;
74  }
75 }
76 
77  /*
78 void CaloRecoTauDiscriminationAgainstElectron::produce(edm::Event& iEvent,const edm::EventSetup& iEventSetup){
79  edm::Handle<CaloTauCollection> theCaloTauCollection;
80  iEvent.getByLabel(CaloTauProducer_,theCaloTauCollection);
81 
82  // fill the AssociationVector object
83  auto_ptr<CaloTauDiscriminator> theCaloTauDiscriminatorAgainstElectron(new CaloTauDiscriminator(CaloTauRefProd(theCaloTauCollection)));
84 
85  for(size_t iCaloTau=0;iCaloTau<theCaloTauCollection->size();++iCaloTau) {
86  CaloTauRef theCaloTauRef(theCaloTauCollection,iCaloTau);
87  if (!(*theCaloTauRef).leadTrack()){
88  theCaloTauDiscriminatorAgainstElectron->setValue(iCaloTau,0);
89  continue;
90  }
91  if (ApplyCut_maxleadTrackHCAL3x3hottesthitDEta_){
92  // 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
93  if (edm::isNotFinite((*theCaloTauRef).leadTrackHCAL3x3hottesthitDEta()) || (*theCaloTauRef).leadTrackHCAL3x3hottesthitDEta()>maxleadTrackHCAL3x3hottesthitDEta_){
94  theCaloTauDiscriminatorAgainstElectron->setValue(iCaloTau,0);
95  continue;
96  }
97  }
98  if (ApplyCut_leadTrackavoidsECALcrack_){
99  // optional selection : ask that leading track - ECAL inner surface contact point does not fall inside any ECAL eta crack
100  edm::ESHandle<MagneticField> theMagneticField;
101  iEventSetup.get<IdealMagneticFieldRecord>().get(theMagneticField);
102  math::XYZPoint thepropagleadTrackECALSurfContactPoint=TauTagTools::propagTrackECALSurfContactPoint(theMagneticField.product(),(*theCaloTauRef).leadTrack());
103  if(thepropagleadTrackECALSurfContactPoint.R()==0. ||
104  fabs(thepropagleadTrackECALSurfContactPoint.eta())<ECALBounds::crack_absEtaIntervalA().second ||
105  (fabs(thepropagleadTrackECALSurfContactPoint.eta())>ECALBounds::crack_absEtaIntervalB().first && fabs(thepropagleadTrackECALSurfContactPoint.eta())<ECALBounds::crack_absEtaIntervalB().second) ||
106  (fabs(thepropagleadTrackECALSurfContactPoint.eta())>ECALBounds::crack_absEtaIntervalC().first && fabs(thepropagleadTrackECALSurfContactPoint.eta())<ECALBounds::crack_absEtaIntervalC().second) ||
107  (fabs(thepropagleadTrackECALSurfContactPoint.eta())>ECALBounds::crack_absEtaIntervalD().first && fabs(thepropagleadTrackECALSurfContactPoint.eta())<ECALBounds::crack_absEtaIntervalD().second) ||
108  (fabs(thepropagleadTrackECALSurfContactPoint.eta())>ECALBounds::crack_absEtaIntervalE().first && fabs(thepropagleadTrackECALSurfContactPoint.eta())<ECALBounds::crack_absEtaIntervalE().second)
109  ){
110  theCaloTauDiscriminatorAgainstElectron->setValue(iCaloTau,0);
111  continue;
112  }
113  }
114  if (edm::isNotFinite((*theCaloTauRef).leadTrackHCAL3x3hitsEtSum())){
115  theCaloTauDiscriminatorAgainstElectron->setValue(iCaloTau,0);
116  }else{
117  if ((*theCaloTauRef).leadTrackHCAL3x3hitsEtSum()/(*theCaloTauRef).leadTrack()->pt()<=leadTrack_HCAL3x3hitsEtSumOverPt_minvalue_) theCaloTauDiscriminatorAgainstElectron->setValue(iCaloTau,0);
118  else theCaloTauDiscriminatorAgainstElectron->setValue(iCaloTau,1);
119  }
120  }
121 
122  iEvent.put(theCaloTauDiscriminatorAgainstElectron);
123 }
124 */
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:30
double discriminate(const CaloTauRef &theCaloTauRef) override
static std::pair< float, float > crack_absEtaIntervalB()
Definition: ECALBounds.h:31
static std::pair< float, float > crack_absEtaIntervalE()
Definition: ECALBounds.h:34
void beginEvent(const edm::Event &event, const edm::EventSetup &eventSetup) override
bool isNotFinite(T x)
Definition: isFinite.h:10
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:32
static std::pair< float, float > crack_absEtaIntervalD()
Definition: ECALBounds.h:33
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
const T & get() const
Definition: EventSetup.h:55