Skip to content

Commit

Permalink
Merge pull request #11711 from bsunanda/Run2-hcx40
Browse files Browse the repository at this point in the history
bsunanda: Run2-hcx40 Update the hit validation package to match Phase2 simulation
  • Loading branch information
cmsbuild committed Oct 16, 2015
2 parents 7dc95bd + 4045e7f commit 6135678
Show file tree
Hide file tree
Showing 6 changed files with 525 additions and 261 deletions.
26 changes: 12 additions & 14 deletions Validation/HcalHits/interface/HcalSimHitsClient.h
Expand Up @@ -25,6 +25,7 @@
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "FWCore/ServiceRegistry/interface/Service.h"
#include "DataFormats/Math/interface/LorentzVector.h"
#include "Geometry/HcalCommonData/interface/HcalDDDRecConstants.h"

#include <iostream>
#include <fstream>
Expand All @@ -34,28 +35,25 @@ class MonitorElement;

class HcalSimHitsClient : public DQMEDHarvester {

private:
std::string outputFile_;

edm::ParameterSet conf_;
private:
int SimHitsEndjob(const std::vector<MonitorElement*> &hcalMEs);
std::vector<std::string> getHistogramTypes();

bool verbose_;
bool debug_;
static const int nType = 25;
static const int nTime = 4;
static const int nType1 = 4;

std::string dirName_;
std::string dirName_;
bool verbose_;
static const int nTime = 4;
static const int nType1 = 4;
const HcalDDDRecConstants *hcons;
int maxDepthHB_, maxDepthHE_, maxDepthHO_, maxDepthHF_;

public:
public:
explicit HcalSimHitsClient(const edm::ParameterSet& );
virtual ~HcalSimHitsClient();

virtual void beginRun(edm::Run const& run, edm::EventSetup const& c);
virtual void runClient_(DQMStore::IBooker &, DQMStore::IGetter &);
virtual void dqmEndJob(DQMStore::IBooker &, DQMStore::IGetter &);

int SimHitsEndjob(const std::vector<MonitorElement*> &hcalMEs);

};

#endif
69 changes: 37 additions & 32 deletions Validation/HcalHits/interface/SimHitsValidationHcal.h
Expand Up @@ -17,6 +17,7 @@

#include "SimDataFormats/CaloHit/interface/PCaloHit.h"
#include "SimDataFormats/CaloHit/interface/PCaloHitContainer.h"
#include "Geometry/HcalCommonData/interface/HcalDDDRecConstants.h"
#include "DataFormats/HcalDetId/interface/HcalDetId.h"

#include <iostream>
Expand All @@ -40,41 +41,45 @@ class SimHitsValidationHcal: public DQMEDAnalyzer {
void analyzeHits (std::vector<PCaloHit> &);

private:

std::string g4Label, hcalHits;
edm::EDGetTokenT<edm::PCaloHitContainer> tok_hits_;
bool verbose_;

struct energysum {
double e25, e50, e100, e250;
energysum() {e25=e50=e100=e250=0.0;}
double e25, e50, e100, e250;
energysum() {e25=e50=e100=e250=0.0;}
};

struct idType {
idType() {subdet=HcalEmpty; z=depth1=depth2=0;}
idType(HcalSubdetector det, int iz, int d1, int d2) {subdet=det; z=iz; depth1=d1; depth2=d2;}
HcalSubdetector subdet;
int z, depth1, depth2;
};

static const int nType = 25;

MonitorElement *meHcalHitEta_[nType];
MonitorElement *meHcalHitTimeEta_[nType];
MonitorElement *meHcalEnergyl25_[nType];
MonitorElement *meHcalEnergyl50_[nType];
MonitorElement *meHcalEnergyl100_[nType];
MonitorElement *meHcalEnergyl250_[nType];

MonitorElement *meEnergy_HB;
MonitorElement *meEnergy_HE;
MonitorElement *meEnergy_HO;
MonitorElement *meEnergy_HF;


MonitorElement *metime_HB;
MonitorElement *metime_HE;
MonitorElement *metime_HO;
MonitorElement *metime_HF;

MonitorElement *metime_enweighted_HB;
MonitorElement *metime_enweighted_HE;
MonitorElement *metime_enweighted_HO;
MonitorElement *metime_enweighted_HF;

struct etaRange {
etaRange() {bins=0; low=high=0;}
etaRange(int bin, double min, double max) {bins=bin; low=min; high=max;}
int bins;
double low, high;
};

std::vector<std::pair<std::string,std::string> > getHistogramTypes();
etaRange getLimits (idType);
std::pair<int,int> histId(int subdet, int eta, int depth, unsigned int dep);

bool initialized;
std::string g4Label_, hcalHits_;
edm::EDGetTokenT<edm::PCaloHitContainer> tok_hits_;
const HcalDDDRecConstants *hcons;
std::vector<idType> types;
bool verbose_, testNumber_;
int maxDepthHB_, maxDepthHE_;
int maxDepthHO_, maxDepthHF_;

std::vector<MonitorElement*> meHcalHitEta_, meHcalHitTimeEta_;
std::vector<MonitorElement*> meHcalEnergyl25_, meHcalEnergyl50_;
std::vector<MonitorElement*> meHcalEnergyl100_, meHcalEnergyl250_;
MonitorElement *meEnergy_HB, *metime_HB, *metime_enweighted_HB;
MonitorElement *meEnergy_HE, *metime_HE, *metime_enweighted_HE;
MonitorElement *meEnergy_HO, *metime_HO, *metime_enweighted_HO;
MonitorElement *meEnergy_HF, *metime_HF, *metime_enweighted_HF;
};

#endif
8 changes: 4 additions & 4 deletions Validation/HcalHits/python/SimHitsValidationHcal_cfi.py
@@ -1,10 +1,10 @@
import FWCore.ParameterSet.Config as cms

simHitsValidationHcal = cms.EDAnalyzer("SimHitsValidationHcal",
ModuleLabel = cms.untracked.string('g4SimHits'),
outputFile = cms.untracked.string(''),
Verbose = cms.untracked.bool(False),
HitCollection = cms.untracked.string('HcalHits')
ModuleLabel = cms.untracked.string('g4SimHits'),
HitCollection = cms.untracked.string('HcalHits'),
Verbose = cms.untracked.bool(False),
TestNumber = cms.untracked.bool(False),
)


Expand Down
4 changes: 2 additions & 2 deletions Validation/HcalHits/python/hcalSimHitsClient_cfi.py
@@ -1,6 +1,6 @@
import FWCore.ParameterSet.Config as cms

hcalsimhitsClient = cms.EDAnalyzer("HcalSimHitsClient",
outputFile = cms.untracked.string(''),
DQMDirName = cms.string("/") # root directory
DQMDirName = cms.string("/"), # root directory
Verbosity = cms.untracked.bool(False),
)

0 comments on commit 6135678

Please sign in to comment.