CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TCRecoTauProducer.cc
Go to the documentation of this file.
1 /* class CaloRecoTauProducer
2  * EDProducer of the TCTauCollection, starting from the CaloRecoTauCollection,
3  * authors: Sami Lehti (sami.lehti@cern.ch)
4  */
5 
14 
16 
17 using namespace edm;
18 using namespace reco;
19 
21  public:
22  explicit TCRecoTauProducer(const edm::ParameterSet& iConfig);
24 
25  virtual void produce(edm::Event&,const edm::EventSetup&) override;
26 
27  private:
30 };
31 
33  caloRecoTauProducer = iConfig.getParameter<edm::InputTag>("CaloRecoTauProducer");
34  tcTauAlgorithm = new TCTauAlgorithm(iConfig);
35 
36  produces<CaloTauCollection>();
37 }
39  delete tcTauAlgorithm;
40 }
41 
43 
44  std::auto_ptr<CaloTauCollection> tcTauCollection(new CaloTauCollection);
45 
46  edm::Handle<CaloTauCollection> theCaloTauHandle;
47  iEvent.getByLabel(caloRecoTauProducer,theCaloTauHandle);
48 
49  tcTauAlgorithm->eventSetup(iEvent,iSetup);
50 
51  if(theCaloTauHandle.isValid()){
52  const CaloTauCollection & caloTaus = *(theCaloTauHandle.product());
53  CaloTauCollection::const_iterator iTau;
54  for(iTau = caloTaus.begin(); iTau != caloTaus.end(); iTau++){
55  CaloTau theTCTau = *iTau;
56  theTCTau.setP4(tcTauAlgorithm->recalculateEnergy(theTCTau));
57  tcTauCollection->push_back(theTCTau);
58  }
59  }
60 
61  iEvent.put(tcTauCollection);
62 }
63 
T getParameter(std::string const &) const
TCRecoTauProducer(const edm::ParameterSet &iConfig)
DEFINE_FWK_MODULE(HiMixingModule)
std::vector< CaloTau > CaloTauCollection
collection of CaloTau objects
Definition: CaloTauFwd.h:9
int iEvent
Definition: GenABIO.cc:243
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:116
bool isValid() const
Definition: HandleBase.h:76
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:390
virtual void produce(edm::Event &, const edm::EventSetup &) override
T const * product() const
Definition: Handle.h:81
TCTauAlgorithm * tcTauAlgorithm
virtual void setP4(const LorentzVector &p4) GCC11_FINAL
set 4-momentum
edm::InputTag caloRecoTauProducer