Skip to content

Commit

Permalink
Merge pull request #9173 from abdoulline/HF_ShowerLib_producer_update75X
Browse files Browse the repository at this point in the history
HF ShowerLibrary producer update
  • Loading branch information
cmsbuild committed May 23, 2015
2 parents d0da4a7 + 33c8836 commit fb882b7
Show file tree
Hide file tree
Showing 3 changed files with 184 additions and 205 deletions.
137 changes: 61 additions & 76 deletions SimG4CMS/ShowerLibraryProducer/interface/HcalForwardLibWriter.h
@@ -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

0 comments on commit fb882b7

Please sign in to comment.