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 Types | Private Member Functions | Private Attributes
GoodSeedProducer Class Reference

#include <GoodSeedProducer.h>

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

Public Member Functions

 GoodSeedProducer (const edm::ParameterSet &)
 
 ~GoodSeedProducer ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
ModuleDescription const & moduleDescription () const
 
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 ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Types

typedef TrajectoryStateOnSurface TSOS
 

Private Member Functions

virtual void beginRun (const edm::Run &run, const edm::EventSetup &) override
 
virtual void endRun (const edm::Run &run, const edm::EventSetup &) override
 
void fillPreIdRefValueMap (edm::Handle< reco::TrackCollection > tkhandle, const edm::OrphanHandle< reco::PreIdCollection > &, edm::ValueMap< reco::PreIdRef >::Filler &filler)
 
int getBin (float, float)
 Find the bin in pt and eta. More...
 
int getBin (float)
 
bool IsIsolated (float charge, float P, math::XYZPointF, const reco::PFClusterCollection &ecalColl, const reco::PFClusterCollection &hcalColl)
 
virtual void produce (edm::Event &, const edm::EventSetup &) override
 
void PSforTMVA (const math::XYZTLorentzVector &mom, const math::XYZTLorentzVector &pos)
 

Private Attributes

bool applyIsolation_
 ISOLATION REQUEST AS DONE IN THE TAU GROUP. More...
 
math::XYZVector B_
 B field. More...
 
float chi
 
float chiRatio
 
float chired
 
double clusThreshold_
 Cut on the energy of the clusters. More...
 
edm::ParameterSet conf_
 
bool disablePreId_
 switch to disable the pre-id More...
 
float dpt
 
double EcalStripSumE_deltaEta_
 
double EcalStripSumE_deltaPhiOverQ_maxValue_
 
double EcalStripSumE_deltaPhiOverQ_minValue_
 
double EcalStripSumE_minClusEnergy_
 
float eP
 VARIABLES NEEDED FOR TMVA. More...
 
float eta
 
edm::ESHandle< TrajectoryFitterfitter_
 Fitter. More...
 
std::string fitterName_
 
double HcalIsolWindow_
 
double maxEp_
 
double maxEta_
 
double maxHoverP_
 
double maxPt_
 
std::string method_
 TMVA method. More...
 
double minEoverP_
 
double minEp_
 Min and MAx allowed values forEoverP. More...
 
double minPt_
 Minimum transverse momentum and maximum pseudorapidity. More...
 
float nhit
 
int nHitsInSeed_
 Number of hits in the seed;. More...
 
edm::InputTag pfCLusTagECLabel_
 
edm::InputTag pfCLusTagHCLabel_
 
edm::InputTag pfCLusTagPSLabel_
 
PFTrackTransformerpfTransformer_
 PFTrackTransformer. More...
 
std::string preidckf_
 Name of the Seed(Ckf) Collection. More...
 
std::string preidgsf_
 Name of the Seed(Gsf) Collection. More...
 
std::string preidname_
 Name of the preid Collection (FB) More...
 
bool produceCkfseed_
 Produce the Seed for Ckf tracks? More...
 
bool producePreId_
 Produce the pre-id debugging collection. More...
 
std::string propagatorName_
 
float ps1chi
 
std::vector< reco::PFClusterps1Clus
 Vector of clusters of the PreShower. More...
 
float ps1En
 
float ps2chi
 
std::vector< reco::PFClusterps2Clus
 
float ps2En
 
float pt
 
double PtThresholdSavePredId_
 Threshold to save Pre Idinfo. More...
 
TMVA::Reader * reader
 READER FOR TMVA. More...
 
std::map< reco::TrackRef,
unsigned > 
refMap_
 Map used to create the TrackRef, PreIdRef value map. More...
 
PFResolutionMapresMapEtaECAL_
 
PFResolutionMapresMapPhiECAL_
 
edm::ESHandle< TrajectorySmoothersmoother_
 Smoother. More...
 
std::string smootherName_
 
float thr [150]
 vector of thresholds for different bins of eta and pt More...
 
float thrPS [20]
 
reco::TrackBase::TrackQuality trackQuality_
 
std::vector< edm::InputTagtracksContainers_
 
bool usePreshower_
 Use of Preshower clusters. More...
 
bool useQuality_
 TRACK QUALITY. More...
 
bool useTmva_
 USE OF TMVA. More...
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
- 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::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

Definition at line 46 of file GoodSeedProducer.h.

Member Typedef Documentation

Definition at line 47 of file GoodSeedProducer.h.

Constructor & Destructor Documentation

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

Definition at line 38 of file GoodSeedProducer.cc.

References applyIsolation_, clusThreshold_, disablePreId_, EcalStripSumE_deltaEta_, EcalStripSumE_deltaPhiOverQ_maxValue_, EcalStripSumE_deltaPhiOverQ_minValue_, EcalStripSumE_minClusEnergy_, fitterName_, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), HcalIsolWindow_, LogDebug, maxEp_, maxEta_, maxHoverP_, maxPt_, minEoverP_, minEp_, minPt_, nHitsInSeed_, pfCLusTagECLabel_, pfCLusTagHCLabel_, pfCLusTagPSLabel_, preidckf_, preidgsf_, preidname_, produceCkfseed_, producePreId_, edm::ProductRegistryHelper::produces(), PtThresholdSavePredId_, smootherName_, AlCaHLTBitMon_QueryRunRegistry::string, trackQuality_, tracksContainers_, usePreshower_, useQuality_, and useTmva_.

38  :
39  pfTransformer_(nullptr),
40  conf_(iConfig),
41  resMapEtaECAL_(nullptr),
42  resMapPhiECAL_(nullptr),
43  reader(nullptr)
44 {
45  LogInfo("GoodSeedProducer")<<"Electron PreIdentification started ";
46 
47  //now do what ever initialization is needed
48 
50  iConfig.getParameter< vector < InputTag > >("TkColList");
51 
52  minPt_=iConfig.getParameter<double>("MinPt");
53  maxPt_=iConfig.getParameter<double>("MaxPt");
54  maxEta_=iConfig.getParameter<double>("MaxEta");
55 
56 
57  //ISOLATION REQUEST AS DONE IN THE TAU GROUP
58  applyIsolation_ =iConfig.getParameter<bool>("ApplyIsolation");
59  HcalIsolWindow_ =iConfig.getParameter<double>("HcalWindow");
60  EcalStripSumE_minClusEnergy_ = iConfig.getParameter<double>("EcalStripSumE_minClusEnergy");
61  EcalStripSumE_deltaEta_ = iConfig.getParameter<double>("EcalStripSumE_deltaEta");
62  EcalStripSumE_deltaPhiOverQ_minValue_ = iConfig.getParameter<double>("EcalStripSumE_deltaPhiOverQ_minValue");
63  EcalStripSumE_deltaPhiOverQ_maxValue_ = iConfig.getParameter<double>("EcalStripSumE_deltaPhiOverQ_maxValue");
64  minEoverP_= iConfig.getParameter<double>("EOverPLead_minValue");
65  maxHoverP_= iConfig.getParameter<double>("HOverPLead_maxValue");
66 
67  //
69  iConfig.getParameter<InputTag>("PFEcalClusterLabel");
70 
72  iConfig.getParameter<InputTag>("PFHcalClusterLabel");
73 
75  iConfig.getParameter<InputTag>("PFPSClusterLabel");
76 
77  preidgsf_ = iConfig.getParameter<string>("PreGsfLabel");
78  preidckf_ = iConfig.getParameter<string>("PreCkfLabel");
79  preidname_= iConfig.getParameter<string>("PreIdLabel");
80 
81 
82  fitterName_ = iConfig.getParameter<string>("Fitter");
83  smootherName_ = iConfig.getParameter<string>("Smoother");
84 
85 
86  nHitsInSeed_=iConfig.getParameter<int>("NHitsInSeed");
87 
88  clusThreshold_=iConfig.getParameter<double>("ClusterThreshold");
89 
90  minEp_=iConfig.getParameter<double>("MinEOverP");
91  maxEp_=iConfig.getParameter<double>("MaxEOverP");
92 
93  //collection to produce
94  produceCkfseed_ = iConfig.getUntrackedParameter<bool>("ProduceCkfSeed",false);
95 
96  // to disable the electron part (for HI collisions for examples)
97  disablePreId_ = iConfig.getUntrackedParameter<bool>("DisablePreId",false);
98 
99  producePreId_ = iConfig.getUntrackedParameter<bool>("ProducePreId",true);
100  // if no electron, cannot produce the preid
101  if(disablePreId_)
102  producePreId_=false;
103  PtThresholdSavePredId_ = iConfig.getUntrackedParameter<double>("PtThresholdSavePreId",1.);
104 
105  LogDebug("GoodSeedProducer")<<"Seeds for GSF will be produced ";
106 
107  // no disablePreId_ switch here. The collection will be empty if it is true
108  produces<ElectronSeedCollection>(preidgsf_);
109 
110  if(produceCkfseed_){
111  LogDebug("GoodSeedProducer")<<"Seeds for CKF will be produced ";
112  produces<TrajectorySeedCollection>(preidckf_);
113  }
114 
115 
116  if(producePreId_){
117  LogDebug("GoodSeedProducer")<<"PreId debugging information will be produced ";
118 
119  produces<PreIdCollection>(preidname_);
120  if(tracksContainers_.size()==1) // do not make a value map if more than one input track collection
122  }
123 
124  useQuality_ = iConfig.getParameter<bool>("UseQuality");
125  trackQuality_=TrackBase::qualityByName(iConfig.getParameter<std::string>("TrackQuality"));
126 
127  useTmva_= iConfig.getUntrackedParameter<bool>("UseTMVA",false);
128 
129  usePreshower_ = iConfig.getParameter<bool>("UsePreShower");
130 
131 }
#define LogDebug(id)
int nHitsInSeed_
Number of hits in the seed;.
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
std::string preidckf_
Name of the Seed(Ckf) Collection.
edm::InputTag pfCLusTagPSLabel_
PFResolutionMap * resMapEtaECAL_
edm::InputTag pfCLusTagHCLabel_
double EcalStripSumE_minClusEnergy_
bool applyIsolation_
ISOLATION REQUEST AS DONE IN THE TAU GROUP.
edm::ParameterSet conf_
double EcalStripSumE_deltaEta_
double EcalStripSumE_deltaPhiOverQ_minValue_
double EcalStripSumE_deltaPhiOverQ_maxValue_
std::string preidname_
Name of the preid Collection (FB)
TypeLabelItem const & produces()
declare what type of product will make and with which optional label
bool useQuality_
TRACK QUALITY.
double minPt_
Minimum transverse momentum and maximum pseudorapidity.
PFResolutionMap * resMapPhiECAL_
std::string fitterName_
TMVA::Reader * reader
READER FOR TMVA.
bool disablePreId_
switch to disable the pre-id
reco::TrackBase::TrackQuality trackQuality_
double clusThreshold_
Cut on the energy of the clusters.
PFTrackTransformer * pfTransformer_
PFTrackTransformer.
bool produceCkfseed_
Produce the Seed for Ckf tracks?
bool useTmva_
USE OF TMVA.
std::vector< edm::InputTag > tracksContainers_
bool usePreshower_
Use of Preshower clusters.
bool producePreId_
Produce the pre-id debugging collection.
std::string smootherName_
edm::InputTag pfCLusTagECLabel_
std::string preidgsf_
Name of the Seed(Gsf) Collection.
double minEp_
Min and MAx allowed values forEoverP.
double PtThresholdSavePredId_
Threshold to save Pre Idinfo.
GoodSeedProducer::~GoodSeedProducer ( )

Definition at line 134 of file GoodSeedProducer.cc.

References pfTransformer_, reader, resMapEtaECAL_, resMapPhiECAL_, and useTmva_.

135 {
136 
137  // do anything here that needs to be done at desctruction time
138  // (e.g. close files, deallocate resources etc.)
139 
140  delete pfTransformer_;
141  delete resMapEtaECAL_;
142  delete resMapPhiECAL_;
143  if(useTmva_) {
144  delete reader;
145  }
146 }
PFResolutionMap * resMapEtaECAL_
PFResolutionMap * resMapPhiECAL_
TMVA::Reader * reader
READER FOR TMVA.
PFTrackTransformer * pfTransformer_
PFTrackTransformer.
bool useTmva_
USE OF TMVA.

Member Function Documentation

void GoodSeedProducer::beginRun ( const edm::Run run,
const edm::EventSetup es 
)
overrideprivatevirtual

Reimplemented from edm::EDProducer.

Definition at line 502 of file GoodSeedProducer.cc.

References B_, chi, chiRatio, chired, conf_, dpt, eP, eta, edm::FileInPath::fullPath(), edm::EventSetup::get(), edm::ParameterSet::getParameter(), method_, nhit, PFTrackTransformer::OnlyProp(), pfTransformer_, pt, reader, resMapEtaECAL_, resMapPhiECAL_, thr, thrPS, and useTmva_.

504 {
505  //Magnetic Field
506  ESHandle<MagneticField> magneticField;
507  es.get<IdealMagneticFieldRecord>().get(magneticField);
508  B_=magneticField->inTesla(GlobalPoint(0,0,0));
509 
512 
513 
514 
515  //Resolution maps
516  FileInPath ecalEtaMap(conf_.getParameter<string>("EtaMap"));
517  FileInPath ecalPhiMap(conf_.getParameter<string>("PhiMap"));
518  resMapEtaECAL_ = new PFResolutionMap("ECAL_eta",ecalEtaMap.fullPath().c_str());
519  resMapPhiECAL_ = new PFResolutionMap("ECAL_phi",ecalPhiMap.fullPath().c_str());
520 
521  if(useTmva_){
522  reader = new TMVA::Reader("!Color:Silent");
523  method_ = conf_.getParameter<string>("TMVAMethod");
524 
525  reader->AddVariable("eP",&eP);
526  reader->AddVariable("chi",&chi);
527  reader->AddVariable("chired",&chired);
528  reader->AddVariable("chiRatio",&chiRatio);
529  reader->AddVariable("dpt",&dpt);
530  reader->AddVariable("nhit",&nhit);
531  reader->AddVariable("eta",&eta);
532  reader->AddVariable("pt",&pt);
533  FileInPath Weigths(conf_.getParameter<string>("Weights"));
534  reader->BookMVA( method_, Weigths.fullPath().c_str() );
535  }
536 
537 
538  //read threshold
539  FileInPath parFile(conf_.getParameter<string>("ThresholdFile"));
540  ifstream ifs(parFile.fullPath().c_str());
541  for (int iy=0;iy<72;iy++) ifs >> thr[iy];
542 
543  //read PS threshold
544  FileInPath parPSFile(conf_.getParameter<string>("PSThresholdFile"));
545  ifstream ifsPS(parPSFile.fullPath().c_str());
546  for (int iy=0;iy<12;iy++) ifsPS >> thrPS[iy];
547 
548 }
T getParameter(std::string const &) const
float eP
VARIABLES NEEDED FOR TMVA.
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
PFResolutionMap * resMapEtaECAL_
float thr[150]
vector of thresholds for different bins of eta and pt
edm::ParameterSet conf_
std::string method_
TMVA method.
math::XYZVector B_
B field.
PFResolutionMap * resMapPhiECAL_
TMVA::Reader * reader
READER FOR TMVA.
PFTrackTransformer * pfTransformer_
PFTrackTransformer.
bool useTmva_
USE OF TMVA.
const T & get() const
Definition: EventSetup.h:55
Resolution Map (resolution as a function of eta and E)
void GoodSeedProducer::endRun ( const edm::Run run,
const edm::EventSetup  
)
overrideprivatevirtual

Reimplemented from edm::EDProducer.

Definition at line 551 of file GoodSeedProducer.cc.

References pfTransformer_, reader, resMapEtaECAL_, resMapPhiECAL_, and useTmva_.

551  {
552  delete pfTransformer_;
553  pfTransformer_ = nullptr;
554  delete resMapEtaECAL_;
555  resMapEtaECAL_ = nullptr;
556  delete resMapPhiECAL_;
557  resMapPhiECAL_ = nullptr;
558  if(useTmva_) {
559  delete reader;
560  reader = nullptr;
561  }
562 }
PFResolutionMap * resMapEtaECAL_
PFResolutionMap * resMapPhiECAL_
TMVA::Reader * reader
READER FOR TMVA.
PFTrackTransformer * pfTransformer_
PFTrackTransformer.
bool useTmva_
USE OF TMVA.
void GoodSeedProducer::fillPreIdRefValueMap ( edm::Handle< reco::TrackCollection tkhandle,
const edm::OrphanHandle< reco::PreIdCollection > &  preidhandle,
edm::ValueMap< reco::PreIdRef >::Filler &  filler 
)
private

Definition at line 704 of file GoodSeedProducer.cc.

References edm::helper::Filler< Map >::insert(), refMap_, and makeHLTPrescaleTable::values.

Referenced by produce().

707 {
708  std::vector<reco::PreIdRef> values;
709 
710  unsigned ntracks=tracks->size();
711  for(unsigned itrack=0;itrack<ntracks;++itrack)
712  {
713  reco::TrackRef theTrackRef(tracks,itrack);
714  std::map<reco::TrackRef,unsigned>::const_iterator itcheck=refMap_.find(theTrackRef);
715  if(itcheck==refMap_.end())
716  {
717  // the track has been early discarded
718  values.push_back(reco::PreIdRef());
719  }
720  else
721  {
722  edm::Ref<reco::PreIdCollection> preIdRef(preidhandle,itcheck->second);
723  values.push_back(preIdRef);
724  // std::cout << " Checking Refs " << (theTrackRef==preIdRef->trackRef()) << std::endl;
725  }
726  }
727  filler.insert(tracks,values.begin(),values.end());
728 }
void insert(const H &h, I begin, I end)
Definition: ValueMap.h:52
tuple tracks
Definition: testEve_cfg.py:39
std::map< reco::TrackRef, unsigned > refMap_
Map used to create the TrackRef, PreIdRef value map.
int GoodSeedProducer::getBin ( float  eta,
float  pt 
)
private

Find the bin in pt and eta.

Definition at line 575 of file GoodSeedProducer.cc.

References LogDebug.

Referenced by produce().

575  {
576  int ie=0;
577  int ip=0;
578  if (fabs(eta)<1.2) ie=0;
579  else{ if (fabs(eta)<1.68) ie=1;
580  else ie=2;
581  }
582  if (pt<6) ip=0;
583  else { if (pt<12) ip=1;
584  else ip=2;
585  }
586  int iep= ie*3+ip;
587  LogDebug("GoodSeedProducer")<<"Track pt ="<<pt<<" eta="<<eta<<" bin="<<iep;
588  return iep;
589 }
#define LogDebug(id)
int GoodSeedProducer::getBin ( float  pt)
private

Definition at line 565 of file GoodSeedProducer.cc.

565  {
566 int ip=0;
567  if (pt<6) ip=0;
568  else { if (pt<12) ip=1;
569  else ip=2;
570  }
571 return ip;
572 }
bool GoodSeedProducer::IsIsolated ( float  charge,
float  P,
math::XYZPointF  myElecTrkEcalPos,
const reco::PFClusterCollection ecalColl,
const reco::PFClusterCollection hcalColl 
)
private

Definition at line 652 of file GoodSeedProducer.cc.

References funct::abs(), DeDxDiscriminatorTools::charge(), HLTFastRecoForTau_cff::deltaEta, SiPixelRawToDigiRegional_cfi::deltaPhi, deltaR(), EcalStripSumE_deltaPhiOverQ_maxValue_, EcalStripSumE_deltaPhiOverQ_minValue_, EcalStripSumE_minClusEnergy_, AnalysisDataFormats_SUSYBSMObjects::hc, HcalIsolWindow_, maxHoverP_, minEoverP_, and P.

Referenced by produce().

655  {
656 
657 
658  double myHCALenergy3x3=0.;
659  double myStripClusterE=0.;
660 
661 
662  // reco::TrackRef myElecTrk;
663 
664  if (fabs(myElecTrkEcalPos.z())<1. && myElecTrkEcalPos.x()<1. && myElecTrkEcalPos.y()<1. ) return false;
665 
666 
667 
668  PFClusterCollection::const_iterator hc=hcalColl.begin();
669  PFClusterCollection::const_iterator hcend=hcalColl.end();
670  for (;hc!=hcend;++hc){
671  math::XYZPoint clusPos = hc->position();
672  double en = hc->energy();
673  double deltaR = ROOT::Math::VectorUtil::DeltaR(myElecTrkEcalPos,clusPos);
674  if (deltaR<HcalIsolWindow_) {
675  myHCALenergy3x3 += en;
676 
677  }
678  }
679 
680 
681 
682  PFClusterCollection::const_iterator ec=ecalColl.begin();
683  PFClusterCollection::const_iterator ecend=ecalColl.end();
684  for (;ec!=ecend;++ec){
685  math::XYZPoint clusPos = ec->position();
686  double en = ec->energy();
687 
688 
689  double deltaPhi = ROOT::Math::VectorUtil::DeltaPhi(myElecTrkEcalPos,clusPos);
690  double deltaEta = abs(myElecTrkEcalPos.eta()-clusPos.eta());
691  double deltaPhiOverQ = deltaPhi/charge;
692  if (en >= EcalStripSumE_minClusEnergy_ && deltaEta<EcalStripSumE_deltaEta_ && deltaPhiOverQ > EcalStripSumE_deltaPhiOverQ_minValue_ && deltaPhiOverQ < EcalStripSumE_deltaPhiOverQ_maxValue_) {
693  myStripClusterE += en;
694  }
695  }
696 
697  double EoP=myStripClusterE/P;
698  double HoP=myHCALenergy3x3/P;
699 
700 
701  return ((EoP>minEoverP_)&&(EoP<2.5) && (HoP<maxHoverP_))?true:false;
702 }
#define P
double EcalStripSumE_minClusEnergy_
double charge(const std::vector< uint8_t > &Ampls)
double EcalStripSumE_deltaPhiOverQ_minValue_
double EcalStripSumE_deltaPhiOverQ_maxValue_
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
double deltaR(double eta1, double eta2, double phi1, double phi2)
Definition: TreeUtility.cc:17
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
susybsm::HSCParticleCollection hc
Definition: classes.h:25
void GoodSeedProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Implements edm::EDProducer.

Definition at line 155 of file GoodSeedProducer.cc.

References applyIsolation_, B_, DeDxDiscriminatorTools::charge(), chi, chiRatio, chired, clusThreshold_, disablePreId_, dpt, eP, eta, edm::EventID::event(), edm::helper::Filler< Map >::fill(), fillPreIdRefValueMap(), PFResolutionMap::FindBin(), fitter_, fitterName_, edm::EventSetup::get(), getBin(), edm::Event::getByLabel(), BaseParticlePropagator::getSuccess(), i, edm::EventBase::id(), IsIsolated(), LogDebug, maxEp_, maxEta_, maxPt_, method_, minEp_, minPt_, RawParticle::momentum(), nhit, AlCaHLTBitMon_ParallelJobs::p, pfCLusTagECLabel_, pfCLusTagHCLabel_, pfCLusTagPSLabel_, funct::pow(), preidckf_, preidgsf_, preidname_, produceCkfseed_, producePreId_, edm::Handle< T >::product(), edm::ESHandle< class >::product(), BaseParticlePropagator::propagateToEcalEntrance(), ps1chi, ps1Clus, ps1En, ps2chi, ps2Clus, ps2En, PSforTMVA(), reco::PreId::pt(), pt, PtThresholdSavePredId_, edm::Event::put(), reader, refMap_, resMapEtaECAL_, resMapPhiECAL_, edm::EventID::run(), RawParticle::setCharge(), reco::ElectronSeed::setCtfTrack(), reco::PreId::setECALMatching(), reco::PreId::setECALMatchingProperties(), reco::PreId::setESMatching(), reco::PreId::setFinalDecision(), reco::PreId::setMVA(), reco::PreId::setTrack(), reco::PreId::setTrackFiltering(), reco::PreId::setTrackProperties(), smoother_, smootherName_, mathSSE::sqrt(), thr, thrPS, tmp, trackQuality_, tracksContainers_, TwoPi, usePreshower_, useQuality_, useTmva_, RawParticle::vertex(), x, detailsBasic3DVector::y, and detailsBasic3DVector::z.

156 {
157 
158  LogDebug("GoodSeedProducer")<<"START event: "<<iEvent.id().event()
159  <<" in run "<<iEvent.id().run();
160  //Create empty output collections
161  auto_ptr<ElectronSeedCollection> output_preid(new ElectronSeedCollection);
162  auto_ptr<TrajectorySeedCollection> output_nopre(new TrajectorySeedCollection);
163  auto_ptr<PreIdCollection> output_preidinfo(new PreIdCollection);
164  auto_ptr<edm::ValueMap<reco::PreIdRef> > preIdMap_p(new edm::ValueMap<reco::PreIdRef>);
165  edm::ValueMap<reco::PreIdRef>::Filler mapFiller(*preIdMap_p);
166 
167  //Tracking Tools
168  if(!disablePreId_)
169  {
172  }
173 
174  // clear temporary maps
175  refMap_.clear();
176 
177  //Handle input collections
178  //ECAL clusters
179  Handle<PFClusterCollection> theECPfClustCollection;
180  iEvent.getByLabel(pfCLusTagECLabel_,theECPfClustCollection);
181 
182  vector<PFCluster> basClus;
183  vector<PFCluster>::const_iterator iklus;
184  for (iklus=theECPfClustCollection.product()->begin();
185  iklus!=theECPfClustCollection.product()->end();
186  iklus++){
187  if((*iklus).energy()>clusThreshold_) basClus.push_back(*iklus);
188  }
189 
190  //HCAL clusters
191  Handle<PFClusterCollection> theHCPfClustCollection;
192  iEvent.getByLabel(pfCLusTagHCLabel_,theHCPfClustCollection);
193 
194  //PS clusters
195  Handle<PFClusterCollection> thePSPfClustCollection;
196  iEvent.getByLabel(pfCLusTagPSLabel_,thePSPfClustCollection);
197 
198  ps1Clus.clear();
199  ps2Clus.clear();
200 
201  for (iklus=thePSPfClustCollection.product()->begin();
202  iklus!=thePSPfClustCollection.product()->end();
203  iklus++){
204  //layer==-11 first layer of PS
205  //layer==-12 secon layer of PS
206  if ((*iklus).layer()==-11) ps1Clus.push_back(*iklus);
207  if ((*iklus).layer()==-12) ps2Clus.push_back(*iklus);
208  }
209 
210  //Vector of track collections
211  for (unsigned int istr=0; istr<tracksContainers_.size();istr++){
212 
213  //Track collection
214  Handle<TrackCollection> tkRefCollection;
215  iEvent.getByLabel(tracksContainers_[istr], tkRefCollection);
216  const TrackCollection& Tk=*(tkRefCollection.product());
217 
218  //Trajectory collection
219  Handle<vector<Trajectory> > tjCollection;
220  iEvent.getByLabel(tracksContainers_[istr], tjCollection);
221  vector<Trajectory> Tj=*(tjCollection.product());
222 
223 
224  LogDebug("GoodSeedProducer")<<"Number of tracks in collection "
225  <<tracksContainers_[istr] <<" to be analyzed "
226  <<Tj.size();
227 
228 
229  //loop over the track collection
230  for(unsigned int i=0;i<Tk.size();i++){
231  if (useQuality_ &&
232  (!(Tk[i].quality(trackQuality_)))) continue;
233 
234  reco::PreId myPreId;
235  bool GoodPreId=false;
236 
237  TrackRef trackRef(tkRefCollection, i);
238  // TrajectorySeed Seed=Tj[i].seed();
239  TrajectorySeed Seed=(*trackRef->seedRef());
240  if(!disablePreId_)
241  {
242  int ipteta=getBin(Tk[i].eta(),Tk[i].pt());
243  int ibin=ipteta*8;
244 
245  float PTOB=Tj[i].lastMeasurement().updatedState().globalMomentum().mag();
246  float chikfred=Tk[i].normalizedChi2();
247  int nhitpi=Tj[i].foundHits();
248  float EP=0;
249 
250  // set track info
251  myPreId.setTrack(trackRef);
252  //CLUSTERS - TRACK matching
253 
254  float pfmass= 0.0005;
255  float pfoutenergy=sqrt((pfmass*pfmass)+Tk[i].outerMomentum().Mag2());
256  XYZTLorentzVector mom =XYZTLorentzVector(Tk[i].outerMomentum().x(),
257  Tk[i].outerMomentum().y(),
258  Tk[i].outerMomentum().z(),
259  pfoutenergy);
260  XYZTLorentzVector pos = XYZTLorentzVector(Tk[i].outerPosition().x(),
261  Tk[i].outerPosition().y(),
262  Tk[i].outerPosition().z(),
263  0.);
264 
265  BaseParticlePropagator theOutParticle =
267  0,0,B_.z());
268  theOutParticle.setCharge(Tk[i].charge());
269 
270  theOutParticle.propagateToEcalEntrance(false);
271 
272 
273  float toteta=1000;
274  float totphi=1000;
275  float dr=1000;
276  float EE=0;
277  float feta=0;
278  math::XYZPointF ElecTrkEcalPos(0,0,0);
279  PFClusterRef clusterRef;
280  math::XYZPoint meanShowerSaved;
281  if(theOutParticle.getSuccess()!=0){
282  ElecTrkEcalPos=math::XYZPointF(theOutParticle.vertex().x(),
283  theOutParticle.vertex().y(),
284  theOutParticle.vertex().z());
285  bool isBelowPS=(fabs(theOutParticle.vertex().eta())>1.65) ? true :false;
286 
287  unsigned clusCounter=0;
288 
289  for(vector<PFCluster>::const_iterator aClus = basClus.begin();
290  aClus != basClus.end(); aClus++,++clusCounter) {
291 
292  double ecalShowerDepth
293  = PFCluster::getDepthCorrection(aClus->energy(),
294  isBelowPS,
295  false);
296 
297  math::XYZPoint meanShower=math::XYZPoint(theOutParticle.vertex())+
298  math::XYZTLorentzVector(theOutParticle.momentum()).Vect().Unit()*ecalShowerDepth;
299 
300  float etarec=meanShower.eta();
301  float phirec=meanShower.phi();
302  float tmp_ep=aClus->energy()/PTOB;
303  float tmp_phi=fabs(aClus->position().phi()-phirec);
304  if (tmp_phi>TMath::TwoPi()) tmp_phi-= TMath::TwoPi();
305  float tmp_dr=sqrt(pow(tmp_phi,2)+
306  pow((aClus->position().eta()-etarec),2));
307 
308  if ((tmp_dr<dr)&&(tmp_ep>minEp_)&&(tmp_ep<maxEp_)){
309  dr=tmp_dr;
310  toteta=aClus->position().eta()-etarec;
311  totphi=tmp_phi;
312  EP=tmp_ep;
313  EE=aClus->energy();
314  feta= aClus->position().eta();
315  clusterRef = PFClusterRef(theECPfClustCollection,clusCounter);
316  meanShowerSaved = meanShower;
317  }
318  }
319  }
320 
321  //Resolution maps
322  double ecaletares
323  = resMapEtaECAL_->GetBinContent(resMapEtaECAL_->FindBin(feta,EE));
324  double ecalphires
325  = resMapPhiECAL_->GetBinContent(resMapPhiECAL_->FindBin(feta,EE));
326 
327  //geomatrical compatibility
328  float chieta=(toteta!=1000)? toteta/ecaletares : toteta;
329  float chiphi=(totphi!=1000)? totphi/ecalphires : totphi;
330  float chichi= sqrt(chieta*chieta + chiphi*chiphi);
331 
332 
333  //Matching criteria
334  float chi2cut=thr[ibin+0];
335  float ep_cutmin=thr[ibin+1];
336  bool GoodMatching= ((chichi<chi2cut) &&(EP>ep_cutmin) && (nhitpi>10));
337  bool EcalMatching=GoodMatching;
338 
339  if (Tk[i].pt()>maxPt_) GoodMatching=true;
340  if (Tk[i].pt()<minPt_) GoodMatching=false;
341 
342  //ENDCAP
343  //USE OF PRESHOWER
344  bool GoodPSMatching=false;
345  if ((fabs(Tk[i].eta())>1.68)&&(usePreshower_)){
346  int iptbin =4*getBin(Tk[i].pt());
347  ps2En=0;ps1En=0;
348  ps2chi=100.; ps1chi=100.;
349  PSforTMVA(mom,pos);
350  float p1e=thrPS[iptbin];
351  float p2e=thrPS[iptbin+1];
352  float p1c=thrPS[iptbin+2];
353  float p2c=thrPS[iptbin+3];
354  GoodPSMatching=
355  ((ps2En>p2e)
356  &&(ps1En>p1e)
357  &&(ps1chi<p1c)
358  &&(ps2chi<p2c));
359  GoodMatching = (GoodMatching && GoodPSMatching);
360  }
361 
362  math::XYZPoint myPoint(ElecTrkEcalPos.X(),ElecTrkEcalPos.Y(),ElecTrkEcalPos.Z());
363  myPreId.setECALMatchingProperties(clusterRef,myPoint,meanShowerSaved,toteta,totphi,chieta,
364  chiphi,chichi,EP);
365  myPreId.setECALMatching(EcalMatching);
366  myPreId.setESMatching(GoodPSMatching);
367 
368  if(applyIsolation_){
369  if(IsIsolated(float(Tk[i].charge()),Tk[i].p(),
370  ElecTrkEcalPos,*theECPfClustCollection,*theHCPfClustCollection))
371  GoodMatching=true;
372  }
373  bool GoodRange= ((fabs(Tk[i].eta())<maxEta_) &&
374  (Tk[i].pt()>minPt_));
375  //KF FILTERING FOR UNMATCHED EVENTS
376  int hit1max=int(thr[ibin+2]);
377  float chiredmin=thr[ibin+3];
378  bool GoodKFFiltering =
379  ((chikfred>chiredmin) || (nhitpi<hit1max));
380 
381  myPreId.setTrackFiltering(GoodKFFiltering);
382 
383  bool GoodTkId= false;
384 
385  if((!GoodMatching) &&(GoodKFFiltering) &&(GoodRange)){
386  chi=chichi;
387  chired=1000;
388  chiRatio=1000;
389  dpt=0;
390  nhit=nhitpi;
391 
393  Trajectory::ConstRecHitContainer hits=Tj[i].recHits();
394  for (int ih=hits.size()-1; ih>=0; ih--) tmp.push_back(hits[ih]);
395  vector<Trajectory> FitTjs=(fitter_.product())->fit(Seed,tmp,Tj[i].lastMeasurement().updatedState());
396 
397  if(FitTjs.size()>0){
398  if(FitTjs[0].isValid()){
399  vector<Trajectory> SmooTjs=(smoother_.product())->trajectories(FitTjs[0]);
400  if(SmooTjs.size()>0){
401  if(SmooTjs[0].isValid()){
402 
403  //Track refitted with electron hypothesis
404 
405  float pt_out=SmooTjs[0].firstMeasurement().
406  updatedState().globalMomentum().perp();
407  float pt_in=SmooTjs[0].lastMeasurement().
408  updatedState().globalMomentum().perp();
409  dpt=(pt_in>0) ? fabs(pt_out-pt_in)/pt_in : 0.;
410  // the following is simply the number of degrees of freedom
411  chiRatio=SmooTjs[0].chiSquared()/Tj[i].chiSquared();
412  chired=chiRatio*chikfred;
413  }
414  }
415  }
416  }
417 
418  //TMVA Analysis
419  if(useTmva_){
420 
421  eta=Tk[i].eta();
422  pt=Tk[i].pt();
423  eP=EP;
424 
425  float Ytmva=reader->EvaluateMVA( method_ );
426 
427  float BDTcut=thr[ibin+4];
428  if ( Ytmva>BDTcut) GoodTkId=true;
429  myPreId.setMVA(GoodTkId,Ytmva);
431  }else{
432 
433  //
434  float chiratiocut=thr[ibin+5];
435  float gschicut=thr[ibin+6];
436  float gsptmin=thr[ibin+7];
437 
438  GoodTkId=((dpt>gsptmin)&&(chired<gschicut)&&(chiRatio<chiratiocut));
439 
440  }
441  }
442 
443  GoodPreId= (GoodTkId || GoodMatching);
444 
445  myPreId.setFinalDecision(GoodPreId);
446 
447  if(GoodPreId)
448  LogDebug("GoodSeedProducer")<<"Track (pt= "<<Tk[i].pt()<<
449  "GeV/c, eta= "<<Tk[i].eta() <<
450  ") preidentified for agreement between track and ECAL cluster";
451  if(GoodPreId &&(!GoodMatching))
452  LogDebug("GoodSeedProducer")<<"Track (pt= "<<Tk[i].pt()<<
453  "GeV/c, eta= "<<Tk[i].eta() <<
454  ") preidentified only for track properties";
455 
456  } // end of !disablePreId_
457 
458  if (GoodPreId){
459 
460  //NEW SEED with n hits
461  ElectronSeed NewSeed(Seed);
462  NewSeed.setCtfTrack(trackRef);
463  output_preid->push_back(NewSeed);
464  }else{
465  if (produceCkfseed_){
466  output_nopre->push_back(Seed);
467  }
468  }
469  if(producePreId_ && myPreId.pt()>PtThresholdSavePredId_)
470  {
471  // save the index of the PreId object as to be able to create a Ref later
472  refMap_[trackRef] = output_preidinfo->size();
473  output_preidinfo->push_back(myPreId);
474  }
475  } //end loop on track collection
476  } //end loop on the vector of track collections
477 
478  // no disablePreId_ switch, it is simpler to have an empty collection rather than no collection
479  iEvent.put(output_preid,preidgsf_);
480  if (produceCkfseed_)
481  iEvent.put(output_nopre,preidckf_);
482  if(producePreId_)
483  {
484  const edm::OrphanHandle<reco::PreIdCollection> preIdRefProd = iEvent.put(output_preidinfo,preidname_);
485  // now make the Value Map, but only if one input collection
486  if(tracksContainers_.size()==1)
487  {
488  Handle<TrackCollection> tkRefCollection ;
489  iEvent.getByLabel(tracksContainers_[0],tkRefCollection);
490  fillPreIdRefValueMap(tkRefCollection,preIdRefProd,mapFiller);
491  mapFiller.fill();
492  iEvent.put(preIdMap_p,preidname_);
493  }
494  }
495 
496  // clear temporary maps
497  refMap_.clear();
498 
499 }
#define LogDebug(id)
RunNumber_t run() const
Definition: EventID.h:42
const double TwoPi
edm::ESHandle< TrajectoryFitter > fitter_
Fitter.
void setCharge(float q)
set the MEASURED charge
Definition: RawParticle.cc:138
EventNumber_t event() const
Definition: EventID.h:44
int i
Definition: DBlmapReader.cc:9
void setECALMatchingProperties(PFClusterRef clusterRef, const math::XYZPoint &ecalpos, const math::XYZPoint &meanShower, float deta, float dphi, float chieta, float chiphi, float chi2, float eop)
Definition: PreId.h:38
std::vector< reco::PreId > PreIdCollection
Definition: PreIdFwd.h:6
std::string preidckf_
Name of the Seed(Ckf) Collection.
std::vector< reco::PFCluster > ps1Clus
Vector of clusters of the PreShower.
float eP
VARIABLES NEEDED FOR TMVA.
edm::InputTag pfCLusTagPSLabel_
void PSforTMVA(const math::XYZTLorentzVector &mom, const math::XYZTLorentzVector &pos)
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:10
PFResolutionMap * resMapEtaECAL_
int getSuccess() const
Has propagation been performed and was barrel or endcap reached ?
edm::InputTag pfCLusTagHCLabel_
float thr[150]
vector of thresholds for different bins of eta and pt
int FindBin(double eta, double e)
extrapolation requires overloading of this function
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< float > > XYZPointF
point in space with cartesian internal representation
Definition: Point3D.h:10
bool IsIsolated(float charge, float P, math::XYZPointF, const reco::PFClusterCollection &ecalColl, const reco::PFClusterCollection &hcalColl)
bool applyIsolation_
ISOLATION REQUEST AS DONE IN THE TAU GROUP.
double charge(const std::vector< uint8_t > &Ampls)
float float float z
TransientTrackingRecHit::ConstRecHitContainer ConstRecHitContainer
Definition: Trajectory.h:43
void setTrack(reco::TrackRef trackref)
Definition: PreId.h:34
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
int getBin(float, float)
Find the bin in pt and eta.
const XYZTLorentzVector & momentum() const
the momentum fourvector
Definition: RawParticle.h:285
void setMVA(bool accepted, float mva, unsigned n=0)
Definition: PreId.h:72
std::string method_
TMVA method.
std::vector< TrajectorySeed > TrajectorySeedCollection
void setTrackFiltering(bool accepted, unsigned n=0)
Definition: PreId.h:68
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:116
T sqrt(T t)
Definition: SSEVec.h:48
edm::Ref< PFClusterCollection > PFClusterRef
persistent reference to PFCluster objects
Definition: PFClusterFwd.h:15
math::XYZVector B_
B field.
std::string preidname_
Name of the preid Collection (FB)
bool useQuality_
TRACK QUALITY.
void fillPreIdRefValueMap(edm::Handle< reco::TrackCollection > tkhandle, const edm::OrphanHandle< reco::PreIdCollection > &, edm::ValueMap< reco::PreIdRef >::Filler &filler)
double minPt_
Minimum transverse momentum and maximum pseudorapidity.
PFResolutionMap * resMapPhiECAL_
std::string fitterName_
std::vector< ElectronSeed > ElectronSeedCollection
collection of ElectronSeed objects
TMVA::Reader * reader
READER FOR TMVA.
bool disablePreId_
switch to disable the pre-id
reco::TrackBase::TrackQuality trackQuality_
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:390
double clusThreshold_
Cut on the energy of the clusters.
bool propagateToEcalEntrance(bool first=true)
const XYZTLorentzVector & vertex() const
the vertex fourvector
Definition: RawParticle.h:284
bool produceCkfseed_
Produce the Seed for Ckf tracks?
float pt() const
Definition: PreId.h:92
bool useTmva_
USE OF TMVA.
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:62
std::vector< reco::PFCluster > ps2Clus
T const * product() const
Definition: Handle.h:81
std::vector< edm::InputTag > tracksContainers_
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
void setTrackProperties(float newchi2, float chi2ratio, float dpt)
Definition: PreId.h:50
edm::EventID id() const
Definition: EventBase.h:56
bool usePreshower_
Use of Preshower clusters.
void setECALMatching(bool accepted, unsigned n=0)
Definition: PreId.h:60
std::map< reco::TrackRef, unsigned > refMap_
Map used to create the TrackRef, PreIdRef value map.
bool producePreId_
Produce the pre-id debugging collection.
std::string smootherName_
void setESMatching(bool accepted, unsigned n=0)
Definition: PreId.h:64
Definition: DDAxes.h:10
edm::InputTag pfCLusTagECLabel_
std::string preidgsf_
Name of the Seed(Gsf) Collection.
double minEp_
Min and MAx allowed values forEoverP.
edm::ESHandle< TrajectorySmoother > smoother_
Smoother.
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40
double PtThresholdSavePredId_
Threshold to save Pre Idinfo.
void setFinalDecision(bool accepted, unsigned n=0)
Definition: PreId.h:56
math::XYZTLorentzVector XYZTLorentzVector
Definition: RawParticle.h:15
void GoodSeedProducer::PSforTMVA ( const math::XYZTLorentzVector mom,
const math::XYZTLorentzVector pos 
)
private

Definition at line 592 of file GoodSeedProducer.cc.

References create_public_lumi_plots::ax, B_, PFGeometry::innerRadius(), PFGeometry::outerRadius(), BaseParticlePropagator::propagateToPreshowerLayer1(), PFGeometry::PS1, ps1chi, ps1Clus, ps1En, PFGeometry::PS2, ps2chi, ps2Clus, ps2En, and mathSSE::sqrt().

Referenced by produce().

592  {
593 
594  BaseParticlePropagator OutParticle(RawParticle(mom,pos)
595  ,0.,0.,B_.z()) ;
596 
597  OutParticle.propagateToPreshowerLayer1(false);
598  if (OutParticle.getSuccess()!=0){
599  // GlobalPoint v1=ps1TSOS.globalPosition();
600  math::XYZPoint v1=math::XYZPoint(OutParticle.vertex());
601  if ((v1.Rho() >=
603  (v1.Rho() <=
605  float enPScl1=0;
606  float chi1=100;
607  vector<PFCluster>::const_iterator ips;
608  for (ips=ps1Clus.begin(); ips!=ps1Clus.end();ips++){
609  float ax=((*ips).position().x()-v1.x())/0.114;
610  float ay=((*ips).position().y()-v1.y())/2.43;
611  float pschi= sqrt(ax*ax+ay*ay);
612  if (pschi<chi1){
613  chi1=pschi;
614  enPScl1=(*ips).energy();
615  }
616  }
617  ps1En=enPScl1;
618  ps1chi=chi1;
619 
620 
621  OutParticle.propagateToPreshowerLayer2(false);
622  if (OutParticle.getSuccess()!=0){
623  math::XYZPoint v2=math::XYZPoint(OutParticle.vertex());
624  if ((v2.Rho() >=
626  (v2.Rho() <=
628  float enPScl2=0;
629  float chi2=100;
630  for (ips=ps2Clus.begin(); ips!=ps2Clus.end();ips++){
631  float ax=((*ips).position().x()-v2.x())/1.88;
632  float ay=((*ips).position().y()-v2.y())/0.1449;
633  float pschi= sqrt(ax*ax+ay*ay);
634  if (pschi<chi2){
635  chi2=pschi;
636  enPScl2=(*ips).energy();
637  }
638  }
639 
640  ps2En=enPScl2;
641  ps2chi=chi2;
642 
643  }
644  }
645 
646  }
647 
648  }
649 }
bool propagateToPreshowerLayer1(bool first=true)
std::vector< reco::PFCluster > ps1Clus
Vector of clusters of the PreShower.
T sqrt(T t)
Definition: SSEVec.h:48
math::XYZVector B_
B field.
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
static const float outerRadius(PFGeometry::Layers_t layer)
return outer radius of a given layer
Definition: PFGeometry.h:60
static const float innerRadius(PFGeometry::Layers_t layer)
return inner radius of a given layer
Definition: PFGeometry.h:56
std::vector< reco::PFCluster > ps2Clus

Member Data Documentation

bool GoodSeedProducer::applyIsolation_
private

ISOLATION REQUEST AS DONE IN THE TAU GROUP.

Definition at line 103 of file GoodSeedProducer.h.

Referenced by GoodSeedProducer(), and produce().

math::XYZVector GoodSeedProducer::B_
private

B field.

Definition at line 168 of file GoodSeedProducer.h.

Referenced by beginRun(), produce(), and PSforTMVA().

float GoodSeedProducer::chi
private

Definition at line 159 of file GoodSeedProducer.h.

Referenced by beginRun(), and produce().

float GoodSeedProducer::chiRatio
private

Definition at line 159 of file GoodSeedProducer.h.

Referenced by beginRun(), and produce().

float GoodSeedProducer::chired
private

Definition at line 159 of file GoodSeedProducer.h.

Referenced by beginRun(), and produce().

double GoodSeedProducer::clusThreshold_
private

Cut on the energy of the clusters.

Definition at line 114 of file GoodSeedProducer.h.

Referenced by GoodSeedProducer(), and produce().

edm::ParameterSet GoodSeedProducer::conf_
private

Definition at line 137 of file GoodSeedProducer.h.

Referenced by beginRun().

bool GoodSeedProducer::disablePreId_
private

switch to disable the pre-id

Definition at line 124 of file GoodSeedProducer.h.

Referenced by GoodSeedProducer(), and produce().

float GoodSeedProducer::dpt
private

Definition at line 159 of file GoodSeedProducer.h.

Referenced by beginRun(), and produce().

double GoodSeedProducer::EcalStripSumE_deltaEta_
private

Definition at line 106 of file GoodSeedProducer.h.

Referenced by GoodSeedProducer().

double GoodSeedProducer::EcalStripSumE_deltaPhiOverQ_maxValue_
private

Definition at line 108 of file GoodSeedProducer.h.

Referenced by GoodSeedProducer(), and IsIsolated().

double GoodSeedProducer::EcalStripSumE_deltaPhiOverQ_minValue_
private

Definition at line 107 of file GoodSeedProducer.h.

Referenced by GoodSeedProducer(), and IsIsolated().

double GoodSeedProducer::EcalStripSumE_minClusEnergy_
private

Definition at line 105 of file GoodSeedProducer.h.

Referenced by GoodSeedProducer(), and IsIsolated().

float GoodSeedProducer::eP
private

VARIABLES NEEDED FOR TMVA.

Definition at line 159 of file GoodSeedProducer.h.

Referenced by beginRun(), and produce().

float GoodSeedProducer::eta
private

Definition at line 159 of file GoodSeedProducer.h.

Referenced by beginRun(), and produce().

edm::ESHandle<TrajectoryFitter> GoodSeedProducer::fitter_
private

Fitter.

Definition at line 86 of file GoodSeedProducer.h.

Referenced by produce().

std::string GoodSeedProducer::fitterName_
private

Definition at line 144 of file GoodSeedProducer.h.

Referenced by GoodSeedProducer(), and produce().

double GoodSeedProducer::HcalIsolWindow_
private

Definition at line 104 of file GoodSeedProducer.h.

Referenced by GoodSeedProducer(), and IsIsolated().

double GoodSeedProducer::maxEp_
private

Definition at line 118 of file GoodSeedProducer.h.

Referenced by GoodSeedProducer(), and produce().

double GoodSeedProducer::maxEta_
private

Definition at line 100 of file GoodSeedProducer.h.

Referenced by GoodSeedProducer(), and produce().

double GoodSeedProducer::maxHoverP_
private

Definition at line 110 of file GoodSeedProducer.h.

Referenced by GoodSeedProducer(), and IsIsolated().

double GoodSeedProducer::maxPt_
private

Definition at line 99 of file GoodSeedProducer.h.

Referenced by GoodSeedProducer(), and produce().

std::string GoodSeedProducer::method_
private

TMVA method.

Definition at line 165 of file GoodSeedProducer.h.

Referenced by beginRun(), and produce().

double GoodSeedProducer::minEoverP_
private

Definition at line 109 of file GoodSeedProducer.h.

Referenced by GoodSeedProducer(), and IsIsolated().

double GoodSeedProducer::minEp_
private

Min and MAx allowed values forEoverP.

Definition at line 117 of file GoodSeedProducer.h.

Referenced by GoodSeedProducer(), and produce().

double GoodSeedProducer::minPt_
private

Minimum transverse momentum and maximum pseudorapidity.

Definition at line 98 of file GoodSeedProducer.h.

Referenced by GoodSeedProducer(), and produce().

float GoodSeedProducer::nhit
private

Definition at line 159 of file GoodSeedProducer.h.

Referenced by beginRun(), and produce().

int GoodSeedProducer::nHitsInSeed_
private

Number of hits in the seed;.

Definition at line 95 of file GoodSeedProducer.h.

Referenced by GoodSeedProducer().

edm::InputTag GoodSeedProducer::pfCLusTagECLabel_
private

Definition at line 139 of file GoodSeedProducer.h.

Referenced by GoodSeedProducer(), and produce().

edm::InputTag GoodSeedProducer::pfCLusTagHCLabel_
private

Definition at line 140 of file GoodSeedProducer.h.

Referenced by GoodSeedProducer(), and produce().

edm::InputTag GoodSeedProducer::pfCLusTagPSLabel_
private

Definition at line 138 of file GoodSeedProducer.h.

Referenced by GoodSeedProducer(), and produce().

PFTrackTransformer* GoodSeedProducer::pfTransformer_
private

PFTrackTransformer.

Definition at line 92 of file GoodSeedProducer.h.

Referenced by beginRun(), endRun(), and ~GoodSeedProducer().

std::string GoodSeedProducer::preidckf_
private

Name of the Seed(Ckf) Collection.

Definition at line 77 of file GoodSeedProducer.h.

Referenced by GoodSeedProducer(), and produce().

std::string GoodSeedProducer::preidgsf_
private

Name of the Seed(Gsf) Collection.

Definition at line 80 of file GoodSeedProducer.h.

Referenced by GoodSeedProducer(), and produce().

std::string GoodSeedProducer::preidname_
private

Name of the preid Collection (FB)

Definition at line 83 of file GoodSeedProducer.h.

Referenced by GoodSeedProducer(), and produce().

bool GoodSeedProducer::produceCkfseed_
private

Produce the Seed for Ckf tracks?

Definition at line 121 of file GoodSeedProducer.h.

Referenced by GoodSeedProducer(), and produce().

bool GoodSeedProducer::producePreId_
private

Produce the pre-id debugging collection.

Definition at line 127 of file GoodSeedProducer.h.

Referenced by GoodSeedProducer(), and produce().

std::string GoodSeedProducer::propagatorName_
private

Definition at line 146 of file GoodSeedProducer.h.

float GoodSeedProducer::ps1chi
private

Definition at line 160 of file GoodSeedProducer.h.

Referenced by produce(), and PSforTMVA().

std::vector<reco::PFCluster> GoodSeedProducer::ps1Clus
private

Vector of clusters of the PreShower.

Definition at line 73 of file GoodSeedProducer.h.

Referenced by produce(), and PSforTMVA().

float GoodSeedProducer::ps1En
private

Definition at line 160 of file GoodSeedProducer.h.

Referenced by produce(), and PSforTMVA().

float GoodSeedProducer::ps2chi
private

Definition at line 160 of file GoodSeedProducer.h.

Referenced by produce(), and PSforTMVA().

std::vector<reco::PFCluster> GoodSeedProducer::ps2Clus
private

Definition at line 74 of file GoodSeedProducer.h.

Referenced by produce(), and PSforTMVA().

float GoodSeedProducer::ps2En
private

Definition at line 160 of file GoodSeedProducer.h.

Referenced by produce(), and PSforTMVA().

float GoodSeedProducer::pt
private

Definition at line 159 of file GoodSeedProducer.h.

Referenced by beginRun(), and produce().

double GoodSeedProducer::PtThresholdSavePredId_
private

Threshold to save Pre Idinfo.

Definition at line 130 of file GoodSeedProducer.h.

Referenced by GoodSeedProducer(), and produce().

TMVA::Reader* GoodSeedProducer::reader
private

READER FOR TMVA.

Definition at line 156 of file GoodSeedProducer.h.

Referenced by beginRun(), endRun(), produce(), and ~GoodSeedProducer().

std::map<reco::TrackRef,unsigned> GoodSeedProducer::refMap_
private

Map used to create the TrackRef, PreIdRef value map.

Definition at line 174 of file GoodSeedProducer.h.

Referenced by fillPreIdRefValueMap(), and produce().

PFResolutionMap* GoodSeedProducer::resMapEtaECAL_
private

Definition at line 148 of file GoodSeedProducer.h.

Referenced by beginRun(), endRun(), produce(), and ~GoodSeedProducer().

PFResolutionMap* GoodSeedProducer::resMapPhiECAL_
private

Definition at line 149 of file GoodSeedProducer.h.

Referenced by beginRun(), endRun(), produce(), and ~GoodSeedProducer().

edm::ESHandle<TrajectorySmoother> GoodSeedProducer::smoother_
private

Smoother.

Definition at line 89 of file GoodSeedProducer.h.

Referenced by produce().

std::string GoodSeedProducer::smootherName_
private

Definition at line 145 of file GoodSeedProducer.h.

Referenced by GoodSeedProducer(), and produce().

float GoodSeedProducer::thr[150]
private

vector of thresholds for different bins of eta and pt

Definition at line 133 of file GoodSeedProducer.h.

Referenced by beginRun(), and produce().

float GoodSeedProducer::thrPS[20]
private

Definition at line 134 of file GoodSeedProducer.h.

Referenced by beginRun(), and produce().

reco::TrackBase::TrackQuality GoodSeedProducer::trackQuality_
private

Definition at line 153 of file GoodSeedProducer.h.

Referenced by GoodSeedProducer(), and produce().

std::vector<edm::InputTag> GoodSeedProducer::tracksContainers_
private

Definition at line 141 of file GoodSeedProducer.h.

Referenced by GoodSeedProducer(), and produce().

bool GoodSeedProducer::usePreshower_
private

Use of Preshower clusters.

Definition at line 171 of file GoodSeedProducer.h.

Referenced by GoodSeedProducer(), and produce().

bool GoodSeedProducer::useQuality_
private

TRACK QUALITY.

Definition at line 152 of file GoodSeedProducer.h.

Referenced by GoodSeedProducer(), and produce().

bool GoodSeedProducer::useTmva_
private

USE OF TMVA.

Definition at line 162 of file GoodSeedProducer.h.

Referenced by beginRun(), endRun(), GoodSeedProducer(), produce(), and ~GoodSeedProducer().