Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9173 from abdoulline/HF_ShowerLib_producer_update75X
HF ShowerLibrary producer update
- Loading branch information
Showing
3 changed files
with
184 additions
and
205 deletions.
There are no files selected for viewing
137 changes: 61 additions & 76 deletions
137
SimG4CMS/ShowerLibraryProducer/interface/HcalForwardLibWriter.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,76 +1,61 @@ | ||
#ifndef SimG4CMS_ShowerLibraryProducer_HcalForwardLibWriter_h | ||
#define SimG4CMS_ShowerLibraryProducer_HcalForwardLibWriter_h | ||
|
||
// -*- C++ -*- | ||
// | ||
// Package: HcalForwardLibWriter | ||
// Class: HcalForwardLibWriter | ||
// | ||
/**\class HcalForwardLibWriter HcalForwardLibWriter.h SimG4CMS/ShowerLibraryProducer/interface/HcalForwardLibWriter.h | ||
Description: [one line class summary] | ||
Implementation: | ||
[Notes on implementation] | ||
*/ | ||
// | ||
// Original Author: Taylan Yetkin,510 1-004,+41227672815, | ||
// Created: Thu Feb 9 13:02:38 CET 2012 | ||
// | ||
// | ||
|
||
|
||
// system include files | ||
#include <memory> | ||
#include <string> | ||
#include <fstream> | ||
#include <utility> | ||
#include <vector> | ||
|
||
|
||
// user include files | ||
#include "FWCore/Framework/interface/Frameworkfwd.h" | ||
#include "FWCore/Framework/interface/EDProducer.h" | ||
|
||
#include "FWCore/Framework/interface/Event.h" | ||
#include "FWCore/Framework/interface/MakerMacros.h" | ||
|
||
#include "FWCore/ParameterSet/interface/ParameterSet.h" | ||
#include "FWCore/Utilities/interface/Exception.h" | ||
|
||
#include "SimDataFormats/CaloHit/interface/HFShowerPhoton.h" | ||
#include "SimDataFormats/CaloHit/interface/HFShowerLibraryEventInfo.h" | ||
|
||
#include "TFile.h" | ||
#include "TTree.h" | ||
|
||
// | ||
// class declaration | ||
// | ||
|
||
class HcalForwardLibWriter : public edm::EDProducer { | ||
public: | ||
|
||
struct FileHandle{ | ||
std::string name; | ||
std::string id; | ||
int momentum; | ||
}; | ||
|
||
explicit HcalForwardLibWriter(const edm::ParameterSet&); | ||
~HcalForwardLibWriter(); | ||
|
||
static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); | ||
|
||
private: | ||
virtual void produce(edm::Event&, const edm::EventSetup&) override; | ||
|
||
void readUserData(); | ||
|
||
// ----------member data --------------------------- | ||
std::string fDataFile; | ||
std::vector<FileHandle> fFileHandle; | ||
TFile* fFile; | ||
TTree* fTree; | ||
}; | ||
#endif | ||
#ifndef SimG4CMS_ShowerLibraryProducer_HcalForwardLibWriter_h | ||
#define SimG4CMS_ShowerLibraryProducer_HcalForwardLibWriter_h | ||
|
||
#include <memory> | ||
#include <string> | ||
#include <fstream> | ||
#include <utility> | ||
#include <vector> | ||
|
||
#include "FWCore/Framework/interface/Frameworkfwd.h" | ||
#include "FWCore/Framework/interface/EDAnalyzer.h" | ||
|
||
#include "FWCore/Framework/interface/Event.h" | ||
#include "FWCore/Framework/interface/MakerMacros.h" | ||
|
||
#include "FWCore/ParameterSet/interface/ParameterSet.h" | ||
#include "FWCore/MessageLogger/interface/MessageLogger.h" | ||
|
||
#include "SimDataFormats/CaloHit/interface/HFShowerPhoton.h" | ||
#include "SimDataFormats/CaloHit/interface/HFShowerLibraryEventInfo.h" | ||
#include "CommonTools/UtilAlgos/interface/TFileService.h" | ||
#include "FWCore/ServiceRegistry/interface/Service.h" | ||
|
||
#include "TFile.h" | ||
#include "TTree.h" | ||
|
||
using namespace edm; | ||
|
||
class HcalForwardLibWriter : public edm::EDAnalyzer { | ||
public: | ||
struct FileHandle{ | ||
std::string name; | ||
std::string id; | ||
int momentum; | ||
}; | ||
explicit HcalForwardLibWriter(const edm::ParameterSet&); | ||
~HcalForwardLibWriter(); | ||
|
||
private: | ||
virtual void beginJob() ; | ||
virtual void analyze(const edm::Event&, const edm::EventSetup&); | ||
virtual void endJob() ; | ||
int readUserData(); | ||
int nbins; | ||
int nshowers; | ||
|
||
TFile* theFile; | ||
TTree* theTree; | ||
TFile* LibFile; | ||
TTree* LibTree; | ||
|
||
edm::Service<TFileService> fs; | ||
std::string theDataFile; | ||
std::vector<FileHandle> theFileHandle; | ||
|
||
HFShowerLibraryEventInfo evtInfo; | ||
HFShowerPhotonCollection emColl; | ||
HFShowerPhotonCollection hadColl; | ||
|
||
}; | ||
#endif |
Oops, something went wrong.