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 Attributes
L2TauJetsProvider Class Reference

#include <L2TauJetsProvider.h>

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

Public Member Functions

 L2TauJetsProvider (const edm::ParameterSet &)
 
virtual void produce (edm::Event &, const edm::EventSetup &) override
 
 ~L2TauJetsProvider ()
 
- 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 std::vector
< edm::InputTag
vtag
 

Private Attributes

std::vector
< l1extra::L1JetParticleRef
jetCandRefVec
 
vtag jetSrc
 
edm::InputTag l1ParticlesJet
 
edm::InputTag l1ParticlesTau
 
double mEt_Min
 
std::map< int, const
reco::CaloJet
myL2L1JetsMap
 
std::vector
< l1extra::L1JetParticleRef
objL1CandRefVec
 
l1extra::L1JetParticleRef tauCandRef
 
std::vector
< l1extra::L1JetParticleRef
tauCandRefVec
 
edm::InputTag tauTrigger
 

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 23 of file L2TauJetsProvider.h.

Member Typedef Documentation

typedef std::vector<edm::InputTag> L2TauJetsProvider::vtag
private

Definition at line 35 of file L2TauJetsProvider.h.

Constructor & Destructor Documentation

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

Definition at line 15 of file L2TauJetsProvider.cc.

References edm::ParameterSet::getParameter(), and PatBasicFWLiteJetAnalyzer_Selector_cfg::jetSrc.

16 {
17  jetSrc = iConfig.getParameter<vtag>("JetSrc");
18  l1ParticlesTau = iConfig.getParameter<InputTag>("L1ParticlesTau");
19  l1ParticlesJet = iConfig.getParameter<InputTag>("L1ParticlesJet");
20  tauTrigger = iConfig.getParameter<InputTag>("L1TauTrigger");
21  mEt_Min = iConfig.getParameter<double>("EtMin");
22 
23  produces<CaloJetCollection>();
24 }
T getParameter(std::string const &) const
edm::InputTag l1ParticlesJet
edm::InputTag l1ParticlesTau
edm::InputTag tauTrigger
std::vector< edm::InputTag > vtag
L2TauJetsProvider::~L2TauJetsProvider ( )

Definition at line 26 of file L2TauJetsProvider.cc.

26 { }

Member Function Documentation

void L2TauJetsProvider::produce ( edm::Event iEvent,
const edm::EventSetup iES 
)
overridevirtual

Implements edm::EDProducer.

Definition at line 28 of file L2TauJetsProvider.cc.

References edm::HandleBase::clear(), reco::deltaR(), edm::Event::getByLabel(), i, j, PatBasicFWLiteJetAnalyzer_Selector_cfg::jetSrc, p4, reco::LeafCandidate::pt(), edm::Event::put(), dt_dqm_sourceclient_common_cff::reco, alignCSCRings::s, trigger::TriggerL1CenJet, and trigger::TriggerL1TauJet.

29 {
30 
31  using namespace edm;
32  using namespace std;
33  using namespace reco;
34  using namespace trigger;
35  using namespace l1extra;
36 
37 
38  //Getting all the L1Seeds
39 
40 
41  //Getting the Collections of L2ReconstructedJets from L1Seeds
42  //and removing the collinear jets
43  myL2L1JetsMap.clear();
44  int iL1Jet = 0;
45  for( vtag::const_iterator s = jetSrc.begin(); s != jetSrc.end(); ++ s ) {
47  iEvent.getByLabel( * s, tauJets );
48  CaloJetCollection::const_iterator iTau = tauJets->begin();
49  if(iTau != tauJets->end()){
50  //Create a Map to associate to every Jet its L1SeedId, i.e. 0,1,2 or 3
51  myL2L1JetsMap.insert(std::pair<int, const CaloJet>(iL1Jet, *(iTau)));
52  }
53  iL1Jet++;
54  }
55  std::auto_ptr<CaloJetCollection> tauL2jets(new CaloJetCollection);
56 
57  //Loop over the jetSrc to select the proper jets
58 
59  double deltaR = 0.1;
60  double matchingR = 0.01;
61  //Loop over the Map to find which jets has fired the trigger
62  //myL1Tau is the Collection of L1TauCandidates (from 0 to max 4 elements)
63  //get the list of trigger candidates from the HLTL1SeedGT filter
66 
67  iEvent.getByLabel( l1ParticlesTau, tauColl );
68  iEvent.getByLabel(l1ParticlesJet, jetColl);
69 
70  const L1JetParticleCollection myL1Tau = *(tauColl.product());
71 
72  const L1JetParticleCollection myL1Jet = *(jetColl.product());
73 
75  myL1Obj.reserve(8);
76 
77  for(unsigned int i=0;i<myL1Tau.size();i++)
78  {
79  myL1Obj.push_back(myL1Tau[i]);
80  }
81  for(unsigned int j=0;j<myL1Jet.size();j++)
82  {
83  myL1Obj.push_back(myL1Jet[j]);
84  }
85 
86 
88  if(iEvent.getByLabel(tauTrigger,l1TriggeredTaus)){
89 
90 
91  tauCandRefVec.clear();
92  jetCandRefVec.clear();
93 
94  l1TriggeredTaus->getObjects( trigger::TriggerL1TauJet,tauCandRefVec);
95  l1TriggeredTaus->getObjects( trigger::TriggerL1CenJet,jetCandRefVec);
96 
97  for( unsigned int iL1Tau=0; iL1Tau <tauCandRefVec.size();iL1Tau++)
98  {
99  for(unsigned int iJet=0;iJet<myL1Obj.size();iJet++)
100  {
101  //Find the relative L2TauJets, to see if it has been reconstructed
102  std::map<int, const reco::CaloJet>::const_iterator myL2itr = myL2L1JetsMap.find(iJet);
103  if(myL2itr!=myL2L1JetsMap.end()){
104  //Calculate the DeltaR between L1TauCandidate and L1Tau which fired the trigger
105  if(&tauCandRefVec[iL1Tau])
106  deltaR = ROOT::Math::VectorUtil::DeltaR(myL1Obj[iJet].p4().Vect(), (tauCandRefVec[iL1Tau]->p4()).Vect());
107  if(deltaR < matchingR ) {
108  // Getting back from the map the L2TauJet
109  const CaloJet myL2TauJet = myL2itr->second;
110  if(myL2TauJet.pt() > mEt_Min) tauL2jets->push_back(myL2TauJet);
111  myL2L1JetsMap.erase(myL2itr->first);
112  break;
113 
114  }
115  }
116 
117  }
118  }
119 
120  for(unsigned int iL1Tau=0; iL1Tau <jetCandRefVec.size();iL1Tau++)
121  {
122  for(unsigned int iJet=0;iJet<myL1Obj.size();iJet++)
123  {
124  //Find the relative L2TauJets, to see if it has been reconstructed
125  std::map<int, const reco::CaloJet>::const_iterator myL2itr = myL2L1JetsMap.find(iJet);
126  if(myL2itr!=myL2L1JetsMap.end()){
127  //Calculate the DeltaR between L1TauCandidate and L1Tau which fired the trigger
128  if(&jetCandRefVec[iL1Tau])
129  deltaR = ROOT::Math::VectorUtil::DeltaR(myL1Obj[iJet].p4().Vect(), (jetCandRefVec[iL1Tau]->p4()).Vect());
130  if(deltaR < matchingR) {
131  // Getting back from the map the L2TauJet
132  const CaloJet myL2TauJet = myL2itr->second;
133 
134  if(myL2TauJet.pt() > mEt_Min) tauL2jets->push_back(myL2TauJet);
135  myL2L1JetsMap.erase(myL2itr->first);
136  break;
137 
138  }
139  }
140 
141  }
142  }
143 
144  }
145  // std::cout <<"Size of L2 jets "<<tauL2jets->size()<<std::endl;
146 
147  iEvent.put(tauL2jets);
148 
149 }
int i
Definition: DBlmapReader.cc:9
Jets made from CaloTowers.
Definition: CaloJet.h:29
std::map< int, const reco::CaloJet > myL2L1JetsMap
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:116
double p4[4]
Definition: TauolaWrapper.h:92
int j
Definition: DBlmapReader.cc:9
edm::InputTag l1ParticlesJet
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:390
double deltaR(double eta1, double eta2, double phi1, double phi2)
Definition: TreeUtility.cc:17
edm::InputTag l1ParticlesTau
std::vector< l1extra::L1JetParticleRef > tauCandRefVec
std::vector< l1extra::L1JetParticleRef > jetCandRefVec
virtual float pt() const GCC11_FINAL
transverse momentum
edm::InputTag tauTrigger
std::vector< CaloJet > CaloJetCollection
collection of CaloJet objects

Member Data Documentation

std::vector<l1extra::L1JetParticleRef> L2TauJetsProvider::jetCandRefVec
private

Definition at line 31 of file L2TauJetsProvider.h.

vtag L2TauJetsProvider::jetSrc
private

Definition at line 36 of file L2TauJetsProvider.h.

edm::InputTag L2TauJetsProvider::l1ParticlesJet
private

Definition at line 38 of file L2TauJetsProvider.h.

edm::InputTag L2TauJetsProvider::l1ParticlesTau
private

Definition at line 37 of file L2TauJetsProvider.h.

double L2TauJetsProvider::mEt_Min
private

Definition at line 40 of file L2TauJetsProvider.h.

std::map<int, const reco::CaloJet> L2TauJetsProvider::myL2L1JetsMap
private

Definition at line 41 of file L2TauJetsProvider.h.

std::vector<l1extra::L1JetParticleRef> L2TauJetsProvider::objL1CandRefVec
private

Definition at line 32 of file L2TauJetsProvider.h.

l1extra::L1JetParticleRef L2TauJetsProvider::tauCandRef
private

Definition at line 33 of file L2TauJetsProvider.h.

std::vector<l1extra::L1JetParticleRef> L2TauJetsProvider::tauCandRefVec
private

Definition at line 30 of file L2TauJetsProvider.h.

edm::InputTag L2TauJetsProvider::tauTrigger
private

Definition at line 39 of file L2TauJetsProvider.h.