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::ProductRegistryHelper

Classes

class  SorterByPt
 

Public Member Functions

 L2TauJetsMerger (const edm::ParameterSet &)
 
virtual void produce (edm::Event &, const edm::EventSetup &)
 
 ~L2TauJetsMerger ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
boost::function< void(const
BranchDescription &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 

Private Types

typedef std::vector
< edm::InputTag
vtag
 

Private Attributes

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

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
typedef WorkerT< EDProducerWorkerType
 
- 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::EDProducer
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::ProducerBase
template<class TProducer , class TMethod >
void callWhenNewProductsRegistered (TProducer *iProd, TMethod iMethod)
 

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.

Constructor & Destructor Documentation

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

Definition at line 15 of file L2TauJetsMerger.cc.

References edm::ParameterSet::getParameter().

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
std::vector< edm::InputTag > vtag
L2TauJetsMerger::~L2TauJetsMerger ( )

Definition at line 26 of file L2TauJetsMerger.cc.

26 { }

Member Function Documentation

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

Implements edm::EDProducer.

Definition at line 28 of file L2TauJetsMerger.cc.

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

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

Member Data Documentation

vtag L2TauJetsMerger::jetSrc
private

Definition at line 28 of file L2TauJetsMerger.h.

double L2TauJetsMerger::mEt_Min
private

Definition at line 29 of file L2TauJetsMerger.h.

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

Definition at line 30 of file L2TauJetsMerger.h.