CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Private Attributes
PFTauTransverseImpactParameters Class Reference
Inheritance diagram for PFTauTransverseImpactParameters:
edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Types

enum  Alg { useInputPV =0, useFont }
 
enum  CMSSWPerigee {
  aCurv =0, aTheta, aPhi, aTip,
  aLip
}
 
- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 

Public Member Functions

 PFTauTransverseImpactParameters (const edm::ParameterSet &iConfig)
 
virtual void produce (edm::Event &, const edm::EventSetup &)
 
 ~PFTauTransverseImpactParameters ()
 
- 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
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Attributes

edm::EDGetTokenT
< edm::AssociationVector
< PFTauRefProd, std::vector
< reco::VertexRef > > > 
PFTauPVAToken_
 
edm::EDGetTokenT
< edm::AssociationVector
< PFTauRefProd, std::vector
< std::vector< reco::VertexRef > > > > 
PFTauSVAToken_
 
edm::EDGetTokenT< std::vector
< reco::PFTau > > 
PFTauToken_
 
bool useFullCalculation_
 

Additional Inherited Members

- 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 53 of file PFTauTransverseImpactParameters.cc.

Member Enumeration Documentation

Constructor & Destructor Documentation

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

Definition at line 67 of file PFTauTransverseImpactParameters.cc.

67  :
68  PFTauToken_(consumes<std::vector<reco::PFTau> >(iConfig.getParameter<edm::InputTag>("PFTauTag"))),
69  PFTauPVAToken_(consumes<edm::AssociationVector<PFTauRefProd, std::vector<reco::VertexRef> > >(iConfig.getParameter<edm::InputTag>("PFTauPVATag"))),
70  PFTauSVAToken_(consumes<edm::AssociationVector<PFTauRefProd,std::vector<std::vector<reco::VertexRef> > > >(iConfig.getParameter<edm::InputTag>("PFTauSVATag"))),
71  useFullCalculation_(iConfig.getParameter<bool>("useFullCalculation"))
72 {
73  produces<edm::AssociationVector<PFTauRefProd, std::vector<reco::PFTauTransverseImpactParameterRef> > >();
74  produces<PFTauTransverseImpactParameterCollection>("PFTauTIP");
75 }
T getParameter(std::string const &) const
edm::EDGetTokenT< std::vector< reco::PFTau > > PFTauToken_
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
edm::EDGetTokenT< edm::AssociationVector< PFTauRefProd, std::vector< std::vector< reco::VertexRef > > > > PFTauSVAToken_
edm::EDGetTokenT< edm::AssociationVector< PFTauRefProd, std::vector< reco::VertexRef > > > PFTauPVAToken_
PFTauTransverseImpactParameters::~PFTauTransverseImpactParameters ( )

Definition at line 77 of file PFTauTransverseImpactParameters.cc.

77  {
78 
79 }

Member Function Documentation

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

Implements edm::EDProducer.

Definition at line 81 of file PFTauTransverseImpactParameters.cc.

References aTip, PerigeeTrajectoryError::covarianceMatrix(), reco::Vertex::dimension, edm::EventSetup::get(), edm::Event::getByToken(), edm::Event::getRefBeforePut(), i, edm::Ref< C, T, F >::isNonnull(), edm::HandleBase::isValid(), j, edm::Ref< C, T, F >::key(), TrajectoryStateClosestToPoint::perigeeError(), TrajectoryStateClosestToPoint::perigeeParameters(), PFTauPVAToken_, PFTauSVAToken_, PFTauToken_, TrajectoryStateClosestToPoint::position(), edm::Event::put(), MetAnalyzer::pv(), reco::TransientTrack::trajectoryStateClosestToPoint(), useFullCalculation_, findQualityFiles::v, PerigeeTrajectoryParameters::vector(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

81  {
82  // Obtain Collections
83  edm::ESHandle<TransientTrackBuilder> transTrackBuilder;
84  iSetup.get<TransientTrackRecord>().get("TransientTrackBuilder",transTrackBuilder);
85 
87  iEvent.getByToken(PFTauToken_,Tau);
88 
90  iEvent.getByToken(PFTauPVAToken_,PFTauPVA);
91 
93  iEvent.getByToken(PFTauSVAToken_,PFTauSVA);
94 
95  // Set Association Map
96  auto_ptr<edm::AssociationVector<PFTauRefProd, std::vector<reco::PFTauTransverseImpactParameterRef> > > AVPFTauTIP(new edm::AssociationVector<PFTauRefProd, std::vector<reco::PFTauTransverseImpactParameterRef> >(PFTauRefProd(Tau)));
97  std::auto_ptr<PFTauTransverseImpactParameterCollection> TIPCollection_out= std::auto_ptr<PFTauTransverseImpactParameterCollection>(new PFTauTransverseImpactParameterCollection());
99 
100 
101  // For each Tau Run Algorithim
102  if(Tau.isValid()) {
103  for(reco::PFTauCollection::size_type iPFTau = 0; iPFTau < Tau->size(); iPFTau++) {
104  reco::PFTauRef RefPFTau(Tau, iPFTau);
105  const reco::VertexRef PV=PFTauPVA->value(RefPFTau.key());
106  const std::vector<reco::VertexRef> SV=PFTauSVA->value(RefPFTau.key());
107  double dxy(-999), dxy_err(-999);
108  reco::Vertex::Point poca(0,0,0);
109  if(RefPFTau->leadPFChargedHadrCand().isNonnull()){
110  if(RefPFTau->leadPFChargedHadrCand()->trackRef().isNonnull()){
112  reco::TransientTrack transTrk=transTrackBuilder->build(RefPFTau->leadPFChargedHadrCand()->trackRef());
113  GlobalPoint pv(PV->position().x(),PV->position().y(),PV->position().z());
117  poca=reco::Vertex::Point(pos.x(),pos.y(),pos.z());
118  }
119  else{
120  dxy_err=RefPFTau->leadPFChargedHadrCand()->trackRef()->d0Error();
121  dxy=RefPFTau->leadPFChargedHadrCand()->trackRef()->dxy(PV->position());
122  }
123  }
124  }
125  if(SV.size()>0){
127  reco::Vertex::Point v(SV.at(0)->x()-PV->x(),SV.at(0)->y()-PV->y(),SV.at(0)->z()-PV->z());
128  for(int i=0;i<reco::Vertex::dimension;i++){
129  for(int j=0;j<reco::Vertex::dimension;j++){
130  cov(i,j)=SV.at(0)->covariance(i,j)+PV->covariance(i,j);
131  }
132  }
133  GlobalVector direction(RefPFTau->px(),RefPFTau->py(),RefPFTau->pz());
134  double vSig = SecondaryVertex::computeDist3d(*PV,*SV.at(0),direction,true).significance();
135  reco::PFTauTransverseImpactParameter TIPV(poca,dxy,dxy_err,PV,v,vSig,SV.at(0));
136  reco::PFTauTransverseImpactParameterRef TIPVRef=reco::PFTauTransverseImpactParameterRef(TIPRefProd_out,TIPCollection_out->size());
137  TIPCollection_out->push_back(TIPV);
138  AVPFTauTIP->setValue(iPFTau,TIPVRef);
139  }
140  else{
141  reco::PFTauTransverseImpactParameter TIPV(poca,dxy,dxy_err,PV);
142  reco::PFTauTransverseImpactParameterRef TIPVRef=reco::PFTauTransverseImpactParameterRef(TIPRefProd_out,TIPCollection_out->size());
143  TIPCollection_out->push_back(TIPV);
144  AVPFTauTIP->setValue(iPFTau,TIPVRef);
145  }
146  }
147  }
148  iEvent.put(TIPCollection_out,"PFTauTIP");
149  iEvent.put(AVPFTauTIP);
150 }
const AlgebraicVector5 & vector() const
int i
Definition: DBlmapReader.cc:9
const PerigeeTrajectoryError & perigeeError() const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:446
T y() const
Definition: PV3DBase.h:63
edm::RefProd< PFTauCollection > PFTauRefProd
references to PFTau collection
Definition: PFTauFwd.h:15
uint16_t size_type
math::Error< dimension >::type CovarianceMatrix
covariance error matrix (3x3)
Definition: Vertex.h:45
edm::EDGetTokenT< std::vector< reco::PFTau > > PFTauToken_
edm::EDGetTokenT< edm::AssociationVector< PFTauRefProd, std::vector< std::vector< reco::VertexRef > > > > PFTauSVAToken_
edm::EDGetTokenT< edm::AssociationVector< PFTauRefProd, std::vector< reco::VertexRef > > > PFTauPVAToken_
const PerigeeTrajectoryParameters & perigeeParameters() const
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:113
T z() const
Definition: PV3DBase.h:64
int j
Definition: DBlmapReader.cc:9
math::XYZPoint Point
point in the space
Definition: Vertex.h:39
bool isValid() const
Definition: HandleBase.h:76
RefProd< PROD > getRefBeforePut()
Definition: Event.h:133
const AlgebraicSymMatrix55 & covarianceMatrix() const
TrajectoryStateClosestToPoint trajectoryStateClosestToPoint(const GlobalPoint &point) const
const T & get() const
Definition: EventSetup.h:55
edm::Ref< PFTauTransverseImpactParameterCollection > PFTauTransverseImpactParameterRef
presistent reference to a PFTauTransverseImpactParameter
std::vector< reco::PFTauTransverseImpactParameter > PFTauTransverseImpactParameterCollection
collection of PFTauTransverseImpactParameter objects
T x() const
Definition: PV3DBase.h:62

Member Data Documentation

edm::EDGetTokenT<edm::AssociationVector<PFTauRefProd, std::vector<reco::VertexRef> > > PFTauTransverseImpactParameters::PFTauPVAToken_
private

Definition at line 62 of file PFTauTransverseImpactParameters.cc.

Referenced by produce().

edm::EDGetTokenT<edm::AssociationVector<PFTauRefProd,std::vector<std::vector<reco::VertexRef> > > > PFTauTransverseImpactParameters::PFTauSVAToken_
private

Definition at line 63 of file PFTauTransverseImpactParameters.cc.

Referenced by produce().

edm::EDGetTokenT<std::vector<reco::PFTau> > PFTauTransverseImpactParameters::PFTauToken_
private

Definition at line 61 of file PFTauTransverseImpactParameters.cc.

Referenced by produce().

bool PFTauTransverseImpactParameters::useFullCalculation_
private

Definition at line 64 of file PFTauTransverseImpactParameters.cc.

Referenced by produce().