Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bsunanda:Run2-TB05 Add geometry version of August CERN HGCal TB setup #15475

Merged
merged 1 commit into from Aug 16, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
32 changes: 32 additions & 0 deletions Geometry/HGCalCommonData/data/TB161/1Module/hgcalCons.xml
@@ -0,0 +1,32 @@
<?xml version="1.0"?>
<DDDefinition xmlns="http://www.cern.ch/cms/DDL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.cern.ch/cms/DDL ../../../../DetectorDescription/Schema/DDLSchema.xsd">

<SpecParSection label="hgcalReco.xml" eval="true">
<SpecPar name="HGCalEEWafer">
<PartSelector path="//HGCalEEWafer.*"/>
<Parameter name="Volume" value="HGCalEEWafer" eval="false"/>
<Parameter name="WaferSize" value="[hgcal:WaferW]"/>
</SpecPar>
<SpecPar name="HGCalEECell">
<PartSelector path="//HGCalEECell.*"/>
<Parameter name="Volume" value="HGCalEECell" eval="false"/>
<Parameter name="CellSize" value="[hgcalwafer:CellWF]"/>
<Parameter name="CellSize" value="[hgcalwafer:CellWC]"/>
</SpecPar>
<SpecPar name="HGCalEEReco">
<PartSelector path="//HGCalEESensitive.*"/>
<Parameter name="Volume" value="HGCalEESensitive" eval="false"/>
<Parameter name="Slope" value="0.0"/>
<Parameter name="GroupingZFine" value="1"/>
<Parameter name="GroupingZFine" value="1"/>
<Parameter name="GroupingZFine" value="-1"/>
<Parameter name="GroupingZMid" value="1"/>
<Parameter name="GroupingZMid" value="1"/>
<Parameter name="GroupingZMid" value="-1"/>
<Parameter name="GroupingZOut" value="1"/>
<Parameter name="GroupingZOut" value="1"/>
<Parameter name="GroupingZOut" value="-1"/>
</SpecPar>
</SpecParSection>

</DDDefinition>
63 changes: 63 additions & 0 deletions Geometry/HGCalCommonData/data/TB161/1Module/hgcalEE.xml
@@ -0,0 +1,63 @@
<?xml version="1.0"?>
<DDDefinition xmlns="http://www.cern.ch/cms/DDL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.cern.ch/cms/DDL ../../../../DetectorDescription/Schema/DDLSchema.xsd">

<ConstantsSection label="hgcalEE.xml" eval="true">
<Constant name="rMinFine" value="0.0*fm"/>
<Constant name="rMaxFine" value="0.0*cm"/>
<Constant name="rMaxMiddle" value="120.0*cm"/>
<Constant name="rMaxCoarse" value="2000.0*cm"/>
</ConstantsSection>

<PosPartSection label="hgcalEE.xml">
<Algorithm name="hgcal:DDHGCalModuleAlgo">
<rParent name="hgcal:HGCalEE"/>
<Vector name="WaferName" type="string" nEntries="2">
hgcalwafer:HGCalEEWaferFine, hgcalwafer:HGCalEEWaferCoarse</Vector>
<Vector name="MaterialNames" type="string" nEntries="7">
materials:Lead, materials:Tungsten, hgcal:WCu, materials:Copper,
materials:G10, materials:Silicon, materials:Air</Vector>
<Vector name="VolumeNames" type="string" nEntries="7">
EEAbsorber1, EEAbsorber2, EEAbsorber3, EEHeatShield, EEPCB,
EESensitive, EEAirGap</Vector>
<Vector name="Thickness" type="numeric" nEntries="7">
44.9*mm, 28.0*mm, 2.2*mm, 6.0*mm, 2.0*mm, 0.10*mm, 1.0*mm</Vector>
<Vector name="Layers" type="numeric" nEntries="1">
8</Vector>
<Vector name="LayerThick" type="numeric" nEntries="1">
56.4*mm
</Vector>
<Vector name="LayerType" type="numeric" nEntries="8">
0, 5, 5, 5, 4, 6, 2, 3
</Vector>
<Vector name="LayerSense" type="numeric" nEntries="8">
0, 1, 1, 1, 0, 0, 0, 0
</Vector>
<Numeric name="zMinBlock" value="[hgcal:zminEE]"/>
<Numeric name="rMaxFine" value="[rMaxFine]"/>
<Numeric name="waferW" value="[hgcal:WaferW]"/>
<Numeric name="Sectors" value="12"/>
<Vector name="SlopeBottom" type="numeric" nEntries="2">
0.0, 0.0</Vector>
<Vector name="SlopeTop" type="numeric" nEntries="2">
0, 0</Vector>
<Vector name="ZFront" type="numeric" nEntries="2">
[hgcal:zminEE], [hgcal:zmaxEE]</Vector>
<Vector name="RMaxFront" type="numeric" nEntries="2">
[hgcal:rmaxEE], [hgcal:rmaxEE]</Vector>
<String name="RotNameSpace" value="hgcalmodule"/>
</Algorithm>
</PosPartSection>

<SpecParSection label="hgcalEE.xml" eval="true">
<SpecPar name="HGCalEE">
<PartSelector path="//HGCalEESensitive.*"/>
<Parameter name="Volume" value="HGCalEESensitive" eval="false"/>
<Parameter name="GeometryMode" value="HGCalGeometryMode::Hexagon" eval="false"/>
<Parameter name="RadiusBound" value="[rMinFine]"/>
<Parameter name="RadiusBound" value="[rMaxFine]"/>
<Parameter name="RadiusBound" value="[rMaxMiddle]"/>
<Parameter name="RadiusBound" value="[rMaxCoarse]"/>
</SpecPar>
</SpecParSection>

</DDDefinition>
35 changes: 35 additions & 0 deletions Geometry/HGCalCommonData/data/TB161/cms.xml
@@ -0,0 +1,35 @@
<?xml version="1.0"?>
<DDDefinition xmlns="http://www.cern.ch/cms/DDL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.cern.ch/cms/DDL ../../../../DetectorDescription/Schema/DDLSchema.xsd">

<SolidSection label="hgcalwafer.xml">
<Tubs name="OCMS" rMin="0.0*fm" rMax="2.0*m" dz="5.0*m" startPhi="0*deg" deltaPhi="360*deg"/>
<Tubs name="CMSE" rMin="0.0*fm" rMax="2.0*m" dz="5.0*m" startPhi="0*deg" deltaPhi="360*deg"/>
</SolidSection>

<LogicalPartSection label="cms.xml">
<LogicalPart name="World" category="unspecified">
<rSolid name="OCMS"/>
<rMaterial name="materials:Air"/>
</LogicalPart>
<LogicalPart name="OCMS" category="unspecified">
<rSolid name="OCMS"/>
<rMaterial name="materials:Air"/>
</LogicalPart>
<LogicalPart name="CMSE" category="unspecified">
<rSolid name="CMSE"/>
<rMaterial name="materials:Air"/>
</LogicalPart>
</LogicalPartSection>

<PosPartSection label="cmsMother.xml">
<PosPart copyNumber="1">
<rParent name="cms:World"/>
<rChild name="cms:OCMS"/>
</PosPart>
<PosPart copyNumber="1">
<rParent name="cms:OCMS"/>
<rChild name="cms:CMSE"/>
</PosPart>
</PosPartSection>

</DDDefinition>
14 changes: 14 additions & 0 deletions Geometry/HGCalCommonData/data/TB161/hgcProdCuts.xml
@@ -0,0 +1,14 @@
<?xml version="1.0"?>
<DDDefinition xmlns="http://www.cern.ch/cms/DDL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.cern.ch/cms/DDL ../../../../DetectorDescription/Schema/DDLSchema.xsd">

<SpecParSection label="hgcProdCuts.xml" eval="true">
<SpecPar name="hgcProdCutsEE">
<PartSelector path="//HGCalEE"/>
<Parameter name="CMSCutsRegion" value="HGCalEERegion" eval="false"/>
<Parameter name="ProdCutsForElectrons" value="0.03*mm"/>
<Parameter name="ProdCutsForPositrons" value="0.03*mm"/>
<Parameter name="ProdCutsForGamma" value="0.03*mm"/>
</SpecPar>
</SpecParSection>

</DDDefinition>
58 changes: 58 additions & 0 deletions Geometry/HGCalCommonData/data/TB161/hgcal.xml
@@ -0,0 +1,58 @@
<?xml version="1.0"?>
<DDDefinition xmlns="http://www.cern.ch/cms/DDL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.cern.ch/cms/DDL ../../../../DetectorDescription/Schema/DDLSchema.xsd">

<ConstantsSection label="hgcal.xml" eval="true">
<Constant name="rmax" value="50.*cm"/>
<Constant name="rmaxEE" value="10.0*cm"/>
<Constant name="zCalor" value="20.0*cm"/>
<Constant name="zminEE" value="0.0*fm"/>
<Constant name="zmaxEE" value="25.896*cm"/>
<Constant name="zposCalo" value="20.0*cm"/>
<Constant name="zposEE" value="-10.0*cm"/>
<Constant name="WaferW" value="123.7*mm"/>
</ConstantsSection>

<MaterialSection label="hgcal.xml">
<CompositeMaterial name="WCu" density="14.979*g/cm3" symbol=" " method="mixture by weight">
<MaterialFraction fraction="0.75">
<rMaterial name="materials:Tungsten"/>
</MaterialFraction>
<MaterialFraction fraction="0.25">
<rMaterial name="materials:Copper"/>
</MaterialFraction>
</CompositeMaterial>
</MaterialSection>

<SolidSection label="hgcal.xml">
<Tubs name="HGCal" rMin="0.0*fm" rMax="[rmax]" dz="[zCalor]" startPhi="0*deg" deltaPhi="360*deg"/>
<Polycone name="HGCalEE" startPhi="0*deg" deltaPhi="360*deg">
<ZSection z="[zminEE]" rMin="0.0*fm" rMax="[rmaxEE]"/>
<ZSection z="[zmaxEE]" rMin="0.0*fm" rMax="[rmaxEE]"/>
</Polycone>
</SolidSection>

<LogicalPartSection label="hgcal.xml">
<LogicalPart name="HGCal" category="unspecified">
<rSolid name="HGCal"/>
<rMaterial name="materials:Air"/>
</LogicalPart>
<LogicalPart name="HGCalEE" category="unspecified">
<rSolid name="HGCalEE"/>
<rMaterial name="materials:Air"/>
</LogicalPart>
</LogicalPartSection>

<PosPartSection label="hgcal.xml">
<PosPart copyNumber="1">
<rParent name="cms:CMSE"/>
<rChild name="hgcal:HGCal"/>
<Translation x="0*fm" y="0*fm" z="[zposCalo]"/>
</PosPart>
<PosPart copyNumber="1">
<rParent name="hgcal:HGCal"/>
<rChild name="hgcal:HGCalEE"/>
<Translation x="0*fm" y="0*fm" z="[zposEE]"/>
<rRotation name="rotations:000D"/>
</PosPart>
</PosPartSection>
</DDDefinition>
11 changes: 11 additions & 0 deletions Geometry/HGCalCommonData/data/TB161/hgcalsense.xml
@@ -0,0 +1,11 @@
<?xml version="1.0"?>
<DDDefinition xmlns="http://www.cern.ch/cms/DDL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.cern.ch/cms/DDL ../../../../DetectorDescription/Schema/DDLSchema.xsd">

<SpecParSection label="hgcalsense.xml" eval="true">
<SpecPar name="hgcee">
<PartSelector path="//HGCalEECell.*"/>
<Parameter name="SensitiveDetector" value="HGCSensitiveDetector" eval="false"/>
<Parameter name="ReadOutName" value="HGCHitsEE" eval="false"/>
</SpecPar>
</SpecParSection>
</DDDefinition>
56 changes: 45 additions & 11 deletions SimG4CMS/HGCalTestBeam/plugins/HGCalTBAnalyzer.cc
Expand Up @@ -64,15 +64,16 @@ class HGCalTBAnalyzer : public edm::one::EDAnalyzer<edm::one::WatchRuns,edm::one
edm::Service<TFileService> fs_;
const HGCalDDDConstants *hgcons_[2];
const HGCalGeometry *hgeom_[2];
bool ifEE_, ifHE_, makeTree_;
bool ifEE_, ifHE_;
bool doTreeLayer_, doTreeCell_;
bool doSimHits_, doDigis_, doRecHits_;
std::string detectorEE_, detectorHE_;
int sampleIndex_;
edm::EDGetTokenT<edm::PCaloHitContainer> tok_hitsEE_, tok_hitsHE_;
edm::EDGetToken tok_digiEE_, tok_digiHE_;
edm::EDGetToken tok_hitrEE_, tok_hitrHE_;
edm::EDGetTokenT<edm::HepMCProduct> tok_hepMC_;
TTree *tree_;
TTree *tree1_, *tree2_;
TH1D *hSimHitE_[2], *hSimHitT_[2];
TH1D *hDigiADC_[2], *hDigiLng_[2];
TH1D *hRecHitE_[2], *hSimHitEn_[2], *hBeam_;
Expand All @@ -85,6 +86,8 @@ class HGCalTBAnalyzer : public edm::one::EDAnalyzer<edm::one::WatchRuns,edm::one
std::vector<TH1D*> hSimHitLayEn2E_, hSimHitLayEn2H_;
std::vector<float> simHitLayEn1E, simHitLayEn2E;
std::vector<float> simHitLayEn1H, simHitLayEn2H;
std::vector<uint32_t> simHitCellIdE, simHitCellIdH;
std::vector<float> simHitCellEnE, simHitCellEnH;
};

HGCalTBAnalyzer::HGCalTBAnalyzer(const edm::ParameterSet& iConfig) {
Expand All @@ -100,7 +103,8 @@ HGCalTBAnalyzer::HGCalTBAnalyzer(const edm::ParameterSet& iConfig) {
doDigis_ = iConfig.getParameter<bool>("DoDigis");
sampleIndex_ = iConfig.getParameter<int>("SampleIndex");
doRecHits_ = iConfig.getParameter<bool>("DoRecHits");
makeTree_ = iConfig.getUntrackedParameter<bool>("MakeTree",false);
doTreeLayer_ = iConfig.getUntrackedParameter<bool>("DoTreeLayer",false);
doTreeCell_ = iConfig.getUntrackedParameter<bool>("DoTreeCell",false);
#ifdef DebugLog
std::cout << "HGCalTBAnalyzer:: SimHits = " << doSimHits_ << " Digis = "
<< doDigis_ << ":" << sampleIndex_ << " RecHits = " << doRecHits_
Expand Down Expand Up @@ -210,12 +214,19 @@ void HGCalTBAnalyzer::beginJob() {
hRecHitLng1_[i] = fs_->make<TProfile>(name,title,120,0.,60.);
}
}
if (doSimHits_ && makeTree_) {
tree_ = fs_->make<TTree>("HGCTB","SimHitEnergy");
tree_->Branch("simHitLayEn1E", &simHitLayEn1E);
tree_->Branch("simHitLayEn2E", &simHitLayEn2E);
tree_->Branch("simHitLayEn1H", &simHitLayEn1H);
tree_->Branch("simHitLayEn2H", &simHitLayEn2H);
if (doSimHits_ && doTreeLayer_) {
tree1_ = fs_->make<TTree>("HGCTB","SimHitEnergy");
tree1_->Branch("simHitLayEn1E", &simHitLayEn1E);
tree1_->Branch("simHitLayEn2E", &simHitLayEn2E);
tree1_->Branch("simHitLayEn1H", &simHitLayEn1H);
tree1_->Branch("simHitLayEn2H", &simHitLayEn2H);
}
if (doSimHits_ && doTreeCell_) {
tree2_ = fs_->make<TTree>("HGCTBCell","SimHitEnergyCell");
tree2_->Branch("simHitCellIdE", &simHitCellIdE);
tree2_->Branch("simHitCellEnE", &simHitCellEnE);
tree2_->Branch("simHitCellIdH", &simHitCellIdH);
tree2_->Branch("simHitCellEnH", &simHitCellEnH);
}
}

Expand Down Expand Up @@ -313,6 +324,8 @@ void HGCalTBAnalyzer::analyze(const edm::Event& iEvent,
if (doSimHits_) {
simHitLayEn1E.clear(); simHitLayEn2E.clear();
simHitLayEn1H.clear(); simHitLayEn2H.clear();
simHitCellIdE.clear(); simHitCellEnE.clear();
simHitCellIdH.clear(); simHitCellEnH.clear();
edm::Handle<edm::PCaloHitContainer> theCaloHitContainers;
std::vector<PCaloHit> caloHits;
if (ifEE_) {
Expand Down Expand Up @@ -359,7 +372,8 @@ void HGCalTBAnalyzer::analyze(const edm::Event& iEvent,
#endif
}
}
if (makeTree_) tree_->Fill();
if (doTreeLayer_) tree1_->Fill();
if (doTreeCell_) tree2_->Fill();
}

//Now the Digis
Expand Down Expand Up @@ -438,7 +452,7 @@ void HGCalTBAnalyzer::analyze(const edm::Event& iEvent,

void HGCalTBAnalyzer::analyzeSimHits (int type, std::vector<PCaloHit>& hits) {

std::map<uint32_t,double> map_hits;
std::map<uint32_t,double> map_hits, map_hitn;
std::map<int,double> map_hitLayer;
std::map<int,std::pair<uint32_t,double> > map_hitCell;
double entot(0);
Expand Down Expand Up @@ -467,6 +481,15 @@ void HGCalTBAnalyzer::analyzeSimHits (int type, std::vector<PCaloHit>& hits) {
} else {
map_hitCell[cell] = std::pair<uint32_t,double>(id,energy);
}
int layn = (layer-((layer-1)%3))/3 + 1;
uint32_t idn = HGCalTestNumbering::packHexagonIndex(subdet, zside, layn,
sector, subsector,
cell);
if (map_hitn.count(idn) != 0) {
map_hitn[idn] += energy;
} else {
map_hitn[idn] = energy;
}
}
hSimHitT_[type]->Fill(time,energy);
}
Expand Down Expand Up @@ -535,6 +558,17 @@ void HGCalTBAnalyzer::analyzeSimHits (int type, std::vector<PCaloHit>& hits) {
double xx = (zp < 0) ? -xy.first : xy.first;
hSimHitLat_[type]->Fill(xx,xy.second,energy);
}

for (std::map<uint32_t,double>::iterator itr = map_hitn.begin();
itr != map_hitn.end(); ++itr) {
uint32_t id = itr->first;
double energy = itr->second;
if (type == 0) {
simHitCellIdE.push_back(id); simHitCellEnE.push_back(energy);
} else {
simHitCellIdH.push_back(id); simHitCellEnH.push_back(energy);
}
}
}

template<class T1>
Expand Down
16 changes: 16 additions & 0 deletions SimG4CMS/HGCalTestBeam/python/HGCalTB161Module1XML_cfi.py
@@ -0,0 +1,16 @@
import FWCore.ParameterSet.Config as cms

XMLIdealGeometryESSource = cms.ESSource("XMLIdealGeometryESSource",
geomXMLFiles = cms.vstring('Geometry/CMSCommonData/data/materials.xml',
'Geometry/CMSCommonData/data/rotations.xml',
'Geometry/HGCalCommonData/data/TB161/cms.xml',
'Geometry/HGCalCommonData/data/TB161/hgcal.xml',
'Geometry/HGCalCommonData/data/TB161/1Module/hgcalEE.xml',
'Geometry/HGCalCommonData/data/v7/hgcalwafer.xml',
'Geometry/HGCalCommonData/data/TB161/hgcalsense.xml',
'Geometry/HGCalCommonData/data/TB161/hgcProdCuts.xml',
'Geometry/HGCalCommonData/data/TB161/1Module/hgcalCons.xml'),
rootNodeName = cms.string('cms:OCMS')
)


3 changes: 2 additions & 1 deletion SimG4CMS/HGCalTestBeam/python/HGCalTBAnalyzer_cfi.py
Expand Up @@ -16,5 +16,6 @@
DigiSrcHE = cms.InputTag('mix','HGCDigisHEfront'),
RecHitSrcEE = cms.InputTag('HGCalRecHit','HGCEERecHits'),
RecHitSrcHE = cms.InputTag('HGCalRecHit','HGCHEFRecHits'),
MakeTree = cms.untracked.bool(True)
DoTreeLayer = cms.untracked.bool(True),
DoTreeCell = cms.untracked.bool(True),
)