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

[WIP] First DECal / SiW ECal commit #294

Open
wants to merge 32 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
8479e80
toprice first commit of DECAL geometry
Nov 17, 2016
2fd40d7
first commit of the DECAL before updating master FCCSW
Nov 25, 2016
ba42ad9
Merge remote branch 'hep-fcc/master'
Nov 25, 2016
ba49172
DECAL Geometry first commit
Apr 5, 2017
e838711
SD classes for DECAL
Apr 5, 2017
acd1cad
Redo Segmentation of DECAL pixel to Pad
Apr 5, 2017
fd3674e
Merge with v0.8 SDWrapper.cpp
Apr 5, 2017
e5210b8
added back in geant_fullsim_ecal_SPG_new.py
Apr 7, 2017
f8feb3e
Merge remote branch 'hep-fcc/master'
Apr 27, 2017
2e12c47
Added basic plotting for the DECAL into Detector/DetectorStudies and …
Apr 28, 2017
77fcad1
Added DEcal analysis to count pixels and analyse variables per layer.…
Sep 11, 2017
ae03431
file to calculate the non linearity factor from total counts in an event
Sep 28, 2017
77a19a6
New xml files to run epitaxial and subtrate (analogue) Silicon ECAL
Nov 21, 2017
cc7e7a2
Analysis code to extract analogue component and analyse
Nov 21, 2017
e627926
code which creates resolution plot from SiWAnalysis
Nov 21, 2017
80030f6
code which creates resoltuion plot from DECalAnalysis
Nov 21, 2017
12bb45c
code to submit analogue analysis to lxbatch
Nov 21, 2017
5b42744
Previous commit did not take into account changes to pre-existing code
Nov 21, 2017
40b9222
Added in flags to DetSegmentation to allow extraction of Digital or n…
Nov 22, 2017
b671bef
Many many changes....
Feb 28, 2018
2f7de76
added many things....
Feb 28, 2018
f408156
Merge remote branch 'hep-fcc/master'
Feb 28, 2018
1361ac2
Modified DECal geometry to match with DD4hep-->dd4hep and removed nam…
Mar 2, 2018
47b2b43
Fixed DD4hep depenacies
Mar 4, 2018
06f4b22
modified DD4hep/LCCD.h for DD4hep/Detector.h and removed all commente…
Mar 6, 2018
d295777
Changing xml child levels
Mar 20, 2018
a3e14ae
Modified XML file to take childs of calorimeter
Mar 20, 2018
8fa4bb7
Removed all old xml files
Mar 20, 2018
b5dfa6a
Fixed xml file
Mar 20, 2018
57c968c
Actually fixed XML file this time
Mar 20, 2018
b047b93
added scripts to submit pile up events
Mar 21, 2018
e6c1161
modified pile-up files and hacked geometry to just draw a single stave
Apr 7, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions Detector/DetCommon/compact/HcalBarrelAir.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?xml version="1.0" encoding="UTF-8"?>
<lccdd xmlns:compact="http://www.lcsim.org/schemas/compact/1.0"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xs:noNamespaceSchemaLocation="http://www.lcsim.org/schemas/compact/1.0/compact.xsd">

<info name="FCC"
title="Air Volume to replace the Hcal"
author="J. Lingemann"
url="no"
status="development"
version="$Id:??$">
<comment>HCal Place-Holder</comment>
</info>
<display>
<vis name="HCalEnvelopeVis" r="0.25" g="0.91" b="0.29" showDaughters="false" visible="true"/>
<vis name="HCalEnvelopeEndcapVis" r="0.49" g="0.91" b="0.51" showDaughters="false" visible="true"/>
<vis name="HCalEnvelopeFwdVis" r="0.65" g="0.87" b="0.67" showDaughters="false" visible="true"/>
</display>
<define>
<constant name="HcalSpacer" value="100*mm" />
</define>
<detectors>
<detector name="HCalEnvelope" type="SimpleCylinder" vis="HCalEnvelopeVis">
<status id="0"/>
<comment>Envelope for HCal barrel</comment>
<dimensions rmin="BarHCal_rmin+HcalSpacer" rmax="BarHCal_rmax" dz="BarHCal_dz" phi0="0" deltaphi="360*deg" z_offset="0*cm" material="Air"/>
</detector>
<!-- End-caps -->
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you need it just for the barrel, remove the commented out code.

<!--detector name="HCalEnvelopeEndcapPos" type="SimpleCylinder" vis="HCalEnvelopeEndcapVis">
<status id="0"/>
<comment>Envelope for HCal positive end-cap</comment>
<dimensions rmin="EndCapHCal_rmin+HcalSpacer" rmax="EndCapHCal_rmax" dz="EndCapHCal_dz-HcalSpacer/2.0" phi0="0" deltaphi="360*deg" z_offset="EndCapHCal_zOffset+HcalSpacer" material="Air"/>
</detector>
<detector name="HCalEnvelopeEndcapNeg" type="SimpleCylinder" vis="HCalEnvelopeEndcapVis">
<status id="0"/>
<comment>Envelope for HCal positive end-cap</comment>
<dimensions rmin="EndCapHCal_rmin+HcalSpacer" rmax="EndCapHCal_rmax" dz="EndCapHCal_dz-HcalSpacer/2.0" phi0="0" deltaphi="360*deg" z_offset="-EndCapHCal_zOffset-HcalSpacer" material="Air"/>
</detector-->
<!-- Forward detectors -->
<!--etector name="HCalEnvelopeFwdPos" type="SimpleCylinder" vis="HCalEnvelopeFwdVis">
<status id="0"/>
<comment>Envelope for forward HCal positive</comment>
<dimensions rmin="FwdHCal_rmin" rmax="FwdHCal_rmax" dz="FwdHCal_dz-HcalSpacer/2.0" phi0="0" deltaphi="360*deg" z_offset="FwdHCal_zOffset+HcalSpacer" material="Air"/>
</detector>
<detector name="HCalEnvelopeFwdNeg" type="SimpleCylinder" vis="HCalEnvelopeFwdVis">
<status id="0"/>
<comment>Envelope for forward HCal positive</comment>
<dimensions rmin="FwdHCal_rmin" rmax="FwdHCal_rmax" dz="FwdHCal_dz-HcalSpacer/2.0" phi0="0" deltaphi="360*deg" z_offset="-FwdHCal_zOffset-HcalSpacer" material="Air"/>
</detector-->
</detectors>
</lccdd>
37 changes: 37 additions & 0 deletions Detector/DetCommon/compact/TrackerBarrelAir.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="UTF-8"?>
<lccdd xmlns:compact="http://www.lcsim.org/schemas/compact/1.0"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xs:noNamespaceSchemaLocation="http://www.lcsim.org/schemas/compact/1.0/compact.xsd">

<info name="FCC"
title="Air Volume to replace the Tracker"
author="J. Lingemann"
url="no"
status="development"
version="$Id:??$">
<comment>Tracker Place-Holder</comment>
</info>
<display>
<vis name="TrackerEnvelopeVis" r="0.87" g="0.27" b="0.15" showDaughters="false" visible="true"/>
<vis name="TrackerEnvelopeFwdVis" r="0.87" g="0.11" b="0.01" showDaughters="false" visible="true"/>
</display>

<detectors>
<detector name="TrackerEnvelopeBarrel" type="SimpleCylinder" vis="TrackerEnvelopeVis">
<status id="0"/>
<comment>Envelope for Tracker</comment>
<dimensions rmin="Tracker_rmin" rmax="Tracker_rmax" dz="Tracker_dz" phi0="0" deltaphi="360*deg" z_offset="0*cm" material="Air"/>
</detector>
<!-- Forward detectors -->
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above, remove the commented out code.

<!--detector name="TrackerEnvelopeFwdPos" type="SimpleCylinder" vis="TrackerEnvelopeFwdVis">
<status id="0"/>
<comment>Envelope for forward Tracker positive</comment>
<dimensions rmin="FwdTracker_rmin" rmax="FwdTracker_rmax" dz="FwdTracker_dz" phi0="0" deltaphi="360*deg" z_offset="FwdTracker_zOffset" material="Air"/>
</detector>
<detector name="TrackerEnvelopeFwdNeg" type="SimpleCylinder" vis="TrackerEnvelopeFwdVis">
<status id="0"/>
<comment>Envelope for forward Tracker positive</comment>
<dimensions rmin="FwdTracker_rmin" rmax="FwdTracker_rmax" dz="FwdTracker_dz" phi0="0" deltaphi="360*deg" z_offset="-FwdTracker_zOffset" material="Air"/>
</detector-->
</detectors>
</lccdd>
10 changes: 9 additions & 1 deletion Detector/DetComponents/src/RedoSegmentation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ DECLARE_ALGORITHM_FACTORY(RedoSegmentation)
RedoSegmentation::RedoSegmentation(const std::string& aName, ISvcLocator* aSvcLoc) : GaudiAlgorithm(aName, aSvcLoc) {
declareProperty("inhits", m_inHits, "Hit collection with old segmentation (input)");
declareProperty("outhits", m_outHits, "Hit collection with modified segmentation (output)");

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you do changes to the file, please run checkformat afterwards.
The recommended way is to commit all your changes and then do checkformat -i <NAME_OF_CHANGED_FILE> and commit again.

}

RedoSegmentation::~RedoSegmentation() {}
Expand Down Expand Up @@ -83,11 +84,17 @@ StatusCode RedoSegmentation::execute() {
// cellID contains the volumeID that needs to be copied to the new id
uint64_t oldid = 0;
uint debugIter = 0;

int nhits = 0;

for (const auto& hit : *inHits) {

fcc::CaloHit newHit = outHits->create();
newHit.energy(hit.energy());
newHit.time(hit.time());
m_oldDecoder->setValue(hit.cellId());

nhits++;

if (debugIter < m_debugPrint) {
debug() << "OLD: " << m_oldDecoder->valueString() << endmsg;
}
Expand All @@ -107,6 +114,7 @@ StatusCode RedoSegmentation::execute() {
debugIter++;
}
}
info() << "nhits = " << nhits << endmsg;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That probably should be in debug() or I'd suggest even verbose() to avoid unnecessary printouts (or maybe even delete this line?)

return StatusCode::SUCCESS;
}

Expand Down
1 change: 1 addition & 0 deletions Detector/DetComponents/src/RedoSegmentation.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,5 +83,6 @@ class RedoSegmentation : public GaudiAlgorithm {
std::vector<std::string> m_detectorIdentifiers;
/// Limit of debug printing
Gaudi::Property<uint> m_debugPrint{this, "debugPrint", 10, "Limit of debug printing"};

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That should disappear if you run checkformat on that file.

};
#endif /* DETCOMPONENTS_REDOSEGMENTATION_H */
61 changes: 61 additions & 0 deletions Detector/DetComponents/tests/options/redoSegmentationXYZ_DEcal.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
from Gaudi.Configuration import *
from Configurables import ApplicationMgr

from Configurables import FCCDataSvc
inputfile = "/afs/cern.ch/user/t/toprice/private/FCC/FCCSW/batch_eos/50Layers_2.1mmW_50umPixels_18umThick_FCCSW0.8/100GeV_BFIELD4T_ETAMIN-0.001_ETAMAX0.001/output_100GeV_BFIELD4T_1.root"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First step would be to put in your public area so that we can copy it to the where we keep our test files.

podiosvc = FCCDataSvc("EventDataSvc", input=inputfile)

from Configurables import PodioInput
podioinput = PodioInput("PodioReader", collections=["positionedCaloHits"], OutputLevel=DEBUG)

from Configurables import GeoSvc
geoservice = GeoSvc("GeoSvc", detectors=[ 'file:/afs/cern.ch/user/t/toprice/private/FCC/FCCSW/Detector/DetFCChhBaseline1/compact/FCChh_DectEmptyMaster.xml',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

path should be relative (remove /afs/cern.ch/user/t/toprice/private/FCC/FCCSW/)

'file:/afs/cern.ch/user/t/toprice/private/FCC/FCCSW/Detector/DetFCChhECalDigital/compact/FCChh_DECalBarrel_50Layers_2.1mmW_50umPixels_18umThick.xml'
],
OutputLevel = DEBUG)

from Configurables import RedoSegmentation
resegment = RedoSegmentation("ReSegmentation",
# old bitfield (readout)
oldReadoutName = "BarDECal_Readout",
# specify which fields are going to be deleted
oldSegmentationIds = ["x","y","z"],
# new bitfield (readout), with new segmentation
newReadoutName="BarDECal_Pads",
OutputLevel = DEBUG)
# clusters are needed, with deposit position and cellID in bits
resegment.inhits.Path = "positionedCaloHits"
resegment.outhits.Path = "newCaloHits"

from Configurables import CreateCaloCells
createcells = CreateCaloCells("CreateCaloCells",
doCellCalibration = False,
addCellNoise = False, filterCellNoise = False,
OutputLevel = DEBUG)
createcells.hits.Path="newCaloHits"
createcells.cells.Path="newCaloCells"

from Configurables import DECalLongitudinalTest
hist = DECalLongitudinalTest("hists",
readoutName = "BarDECal_Readout",
layerFieldName = "layer",
numLayers = 50, # one more because index starts at 1 - layer 0 will be always empty
OutputLevel = DEBUG)
hist.deposits.Path="positionedCaloHits"

THistSvc().Output = ["rec DATAFILE='./hist_test.root' TYP='ROOT' OPT='RECREATE'"]
THistSvc().PrintAll=True
THistSvc().AutoSave=True
THistSvc().AutoFlush=False
THistSvc().OutputLevel=INFO

from Configurables import FCCDataSvc, PodioOutput
#podiosvc = FCCDataSvc("EventDataSvc")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the commented out code

podioout = PodioOutput("out", filename="/afs/cern.ch/user/t/toprice/private/FCC/FCCSW/batch_eos/50Layers_2.1mmW_50umPixels_18umThick_FCCSW0.8/100GeV_BFIELD4T_ETAMIN-0.001_ETAMAX0.001/testResegmentationXYZ_100GeV.root")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here also relative path.

podioout.outputCommands = ["keep *"]

ApplicationMgr(EvtSel='NONE',
EvtMax=5000,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If that is an example, that is far too many events. Also, if that is a test, you could add it to CMakeLists.txt.

TopAlg=[podioinput, resegment, createcells,hist, podioout],
ExtSvc = [podiosvc, geoservice],
OutputLevel=DEBUG)
27 changes: 27 additions & 0 deletions Detector/DetFCChhECalDigital/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
################################################################################
# Package: DetFCChhECalDigital
################################################################################
gaudi_subdir(DetFCChhECalDigital v1r0)

gaudi_depends_on_subdirs(GaudiKernel
Detector/DetExtensions)


find_package(DD4hep)
find_package(Geant4)
include(${Geant4_USE_FILE})

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${DD4hep_ROOT}/cmake )
include( DD4hep )

find_package(ROOT COMPONENTS MathCore GenVector Geom REQUIRED)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add line:
install(DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/compact DESTINATION Detector/DetFCChhECalDigital)
so the detector can be used from the pre-installed FCCSW.

gaudi_add_module(DetFCChhECalDigital
src/*.cpp
INCLUDE_DIRS DD4hep ROOT DetExtensions Geant4
LINK_LIBRARIES GaudiKernel DD4hep ROOT Geant4)

set(LIBRARY_OUTPUT_PATH ${CMAKE_LIBRARY_OUTPUT_DIRECTORY})
message(STATUS "LIBRARY_OUTPUT_PATH -> ${LIBRARY_OUTPUT_PATH}")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is probably not needed anymore.

dd4hep_generate_rootmap(DetFCChhECalDigital)

Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
<?xml version="1.0" encoding="UTF-8"?>
<lccdd xmlns:compact="http://www.lcsim.org/schemas/compact/1.0"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xs:noNamespaceSchemaLocation="http://www.lcsim.org/schemas/compact/1.0/compact.xsd">


<info name="FCChh_DECalBarrel_50Layers_2.1mmW_50umPixels_18umThick"
title="DECal Barrel Calorimeter"
author="T. Price"
url="no"
status="development"
version="$Id:??$">
<comment>DECal very conceptual design</comment>
</info>

<define>
<constant name="BarECalOuterSpacer" value="100*mm"/>
<!-- calorimeter volume -->
<!-- have removed the cryostat as we do not need it! -->
<constant name="EMBarrel_rmin" value="BarECal_rmin+BarECalOuterSpacer"/>
<constant name="EMBarrel_rmax" value="BarECal_rmax-BarECalOuterSpacer"/>
<constant name="EMBarrel_dz" value="BarECal_dz"/>

</define>

<display>
<!--vis name="ecal_envelope" r="0.1" g="0.2" b="0.6" alpha="0.1" showDaughers="false" visible="false" /-->
<vis name="ecal_volume" r="0.6" g="0.2" b="0.1" alpha="0.1" showDaughers="false" visible="false" />
<!--vis name="ecal_active" r=".1" g="0.8" b="0.6" alpha="1.0" showDaughers="true" visible="true" /-->
</display>

<readouts>
<readout name="BarDECal_Readout">
<!-- layer:7 gives 7 bits (max 128 layers) -->
<!-- x, y segmentation -24 to allow 16777216 pixels -->
<segmentation type="CartesianGridXYZ" grid_size_x="0.05*mm" grid_size_y="0.05*mm" grid_size_z="0.05*mm"/>
<!--id>system:3,active:1,EM_barrel:1,layer:6,digital:1,stave:4,module:3,x:-17,y:-17,z:-11</id-->
<id>system:3,active:1,EM_barrel:1,layer:6,digital:1,x:-17,y:-17,z:-18</id>
</readout>

<readout name="BarDECal_Pads">
<!-- layer:7 gives 7 bits (max 128 layers) -->
<!-- x, y segmentation -24 to allow 16777216 pixels -->
<segmentation type="CartesianGridXYZ" grid_size_x="5*mm" grid_size_y="5*mm" grid_size_z="5*mm"/>

<!--id>system:3,active:1,EM_barrel:1,layer:6,digital:1,stave:4,module:3,x:-15,y:-15,z:-15</id-->
<id>system:3,active:1,EM_barrel:1,layer:6,digital:1,x:-15,y:-15,z:-18</id>
<!-- x:-17,y:-17, no stave-->

</readout>

<!--readout name="BarDECal_Readout">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove the obsolete code.

<segmentation type="GridPhiEta" grid_size_eta="0.05*mm" phi_bins="300000"/>
<id>system:3,active:1,EM_barrel:1,layer:7,eta:-18,phi:-19</id>
</readout-->
</readouts>


<detectors>
<detector id="5" name="ECalBarrel" type="EmCaloDigiBarrel" readout="BarDECal_Readout">
<dimensions rmin="EMBarrel_rmin" rmax="EMBarrel_rmax" dz="EMBarrel_dz" vis="ecal_envelope"/>
<calorimeter id="1" name="EM_barrel" >
<dimensions rmin="EMBarrel_rmin" rmax="EMBarrel_rmax" dz="EMBarrel_dz" vis="ecal_volume" numsides="8" nmodules="5"/>

<layers repeat="50"/>
<active thickness="0.018*mm">
<material name="Silicon"/>
</active>
<substrate thickness="0.450*mm">
<material name="Silicon"/>
</substrate>
<passive thickness="2.1*mm">
<material name="Tungsten" />
</passive>
<spacing thickness="0*mm">
<material name="Air" />
</spacing>
<tracker thickness="0.0*cm">
<material name="Silicon"/>
</tracker>
</calorimeter>
</detector>
</detectors>
</lccdd>
Loading