CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Classes | Public Member Functions | Private Types | Private Attributes
L2TauJetsMerger Class Reference

#include <L2TauJetsMerger.h>

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

Classes

class  SorterByPt
 

Public Member Functions

 L2TauJetsMerger (const edm::ParameterSet &)
 
virtual void produce (edm::Event &, const edm::EventSetup &) override
 
 ~L2TauJetsMerger ()
 
- 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 Types

typedef std::vector
< edm::InputTag
vtag
 
typedef std::vector
< edm::EDGetTokenT
< reco::CaloJetCollection > > 
vtoken_cjets
 

Private Attributes

vtag jetSrc
 
vtoken_cjets jetSrc_token
 
double mEt_Min
 
std::map< int, const
reco::CaloJet
myL2L1JetsMap
 

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 19 of file L2TauJetsMerger.h.

Member Typedef Documentation

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

Definition at line 27 of file L2TauJetsMerger.h.

Definition at line 28 of file L2TauJetsMerger.h.

Constructor & Destructor Documentation

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

Definition at line 12 of file L2TauJetsMerger.cc.

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

13 {
14  jetSrc = iConfig.getParameter<vtag>("JetSrc");
15  for(vtag::const_iterator it = jetSrc.begin(); it != jetSrc.end(); ++it) {
16  edm::EDGetTokenT<CaloJetCollection> aToken = consumes<CaloJetCollection>(*it);
17  jetSrc_token.push_back(aToken);
18  }
19  mEt_Min = iConfig.getParameter<double>("EtMin");
20 
21  produces<CaloJetCollection>();
22 }
T getParameter(std::string const &) const
vtoken_cjets jetSrc_token
std::vector< edm::InputTag > vtag
L2TauJetsMerger::~L2TauJetsMerger ( )

Definition at line 24 of file L2TauJetsMerger.cc.

24 { }

Member Function Documentation

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

Implements edm::EDProducer.

Definition at line 26 of file L2TauJetsMerger.cc.

References edm::Event::getByToken(), i, edm::Event::put(), dt_dqm_sourceclient_common_cff::reco, alignCSCRings::s, reco::LeafCandidate::setPdgId(), python.multivaluedict::sort(), MCScenario_CRAFT1_22X::sorter(), and tmp.

27 {
28 
29  using namespace edm;
30  using namespace std;
31  using namespace reco;
32 
33  //Getting all the L1Seeds
34 
35 
36  //Getting the Collections of L2ReconstructedJets from L1Seeds
37  //and removing the collinear jets
38  myL2L1JetsMap.clear();
39  CaloJetCollection myTmpJets;
40  myTmpJets.clear();
41 
42  int iL1Jet = 0;
43  for( vtoken_cjets::const_iterator s = jetSrc_token.begin(); s != jetSrc_token.end(); ++ s ) {
45  iEvent.getByToken( * s, tauJets );
46  for(CaloJetCollection::const_iterator iTau = tauJets->begin(); iTau !=tauJets->end(); ++iTau)
47  {
48  //Create a Map to associate to every Jet its L1SeedId, i.e. 0,1,2 or 3
49  if(iTau->et() > mEt_Min) {
50 
51  //Add the Pdg Id here
52  CaloJet myJet = *iTau;
53  myJet.setPdgId(15);
54  myTmpJets.push_back(myJet);
55  }
56  }
57  iL1Jet++;
58  }
59 
60  std::auto_ptr<CaloJetCollection> tauL2jets(new CaloJetCollection);
61 
62  //Removing the collinear jets correctly!
63 
64  //First sort the jets you have merged
65  SorterByPt sorter;
66  std::sort(myTmpJets.begin(),myTmpJets.end(),sorter);
67 
68 //Remove Collinear Jets by prefering the highest ones!
69 
70  while(myTmpJets.size()>0) {
71  tauL2jets->push_back(myTmpJets.at(0));
73  for(unsigned int i=1 ;i<myTmpJets.size();++i) {
74  double DR = ROOT::Math::VectorUtil::DeltaR(myTmpJets.at(0).p4(),myTmpJets.at(i).p4());
75  if(DR>0.1)
76  tmp.push_back(myTmpJets.at(i));
77  }
78  myTmpJets.swap(tmp);
79  tmp.clear();
80  }
81 
82 
83  iEvent.put(tauL2jets);
84 
85 }
int i
Definition: DBlmapReader.cc:9
Jets made from CaloTowers.
Definition: CaloJet.h:29
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:434
std::map< int, const reco::CaloJet > myL2L1JetsMap
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:116
vtoken_cjets jetSrc_token
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
virtual void setPdgId(int pdgId) GCC11_FINAL
std::vector< CaloJet > CaloJetCollection
collection of CaloJet objects

Member Data Documentation

vtag L2TauJetsMerger::jetSrc
private

Definition at line 29 of file L2TauJetsMerger.h.

vtoken_cjets L2TauJetsMerger::jetSrc_token
private

Definition at line 30 of file L2TauJetsMerger.h.

double L2TauJetsMerger::mEt_Min
private

Definition at line 31 of file L2TauJetsMerger.h.

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

Definition at line 32 of file L2TauJetsMerger.h.