Skip to content

Commit

Permalink
cld tracking detector names in setupGEOM added; otherwise _sectors empty
Browse files Browse the repository at this point in the history
removed printing of subdetector names

around line 949: streamlog of SIT layer check more verbose;
FullLDCTracking_MarlinTrk formatted using .clang-format

vscode setting json files added

introduced vars for subdetector names in setupGeom; less hardcoding

Relaxation of the condition on the vectors V and Z, antiparallel also permitted; experimental modification

tasks.json added

rm vscode specific files
  • Loading branch information
Victor-Schwan authored and tmadlener committed Aug 23, 2024
1 parent 32b5a3e commit a45db09
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 26 deletions.
2 changes: 2 additions & 0 deletions source/Refitting/include/FullLDCTracking_MarlinTrk.h
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,8 @@ class FullLDCTracking_MarlinTrk : public Processor {

std::string _LDCTrackCollection{};

std::string m_vtxDetName{};

TrackExtendedVec _allSiTracks{};
TrackExtendedVec _allTPCTracks{};
TrackExtendedVec _allCombinedTracks{};
Expand Down
46 changes: 29 additions & 17 deletions source/Refitting/src/FullLDCTracking_MarlinTrk.cc
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@ FullLDCTracking_MarlinTrk::FullLDCTracking_MarlinTrk() : Processor("FullLDCTrack
std::string("LDCTracks"));

// steering parameters
registerProcessorParameter("VertexDetectorName", "Name of the vertex (barrel) detector in the geometry", m_vtxDetName,
std::string("VXD"));

registerProcessorParameter("D0CutForMerging", "Cut on D0 difference for merging of Si and TPC segments",
_d0CutForMerging, float(500.0));
Expand Down Expand Up @@ -943,8 +945,9 @@ void FullLDCTracking_MarlinTrk::prepareVectors(LCEvent* event) {
int layer = getLayerID(trkhit);

if (layer < 0 || (unsigned)layer >= _nLayersSIT) {
streamlog_out(ERROR) << "FullLDCTracking_MarlinTrk => fatal error in SIT : layer is outside allowed range : "
<< layer << std::endl;
streamlog_out(ERROR) << "FullLDCTracking_MarlinTrk => fatal error in SIT : hit layer number " << layer
<< " is outside of the total number of layers in the given geometry: " << _nLayersSIT
<< std::endl;
exit(1);
}

Expand Down Expand Up @@ -973,8 +976,8 @@ void FullLDCTracking_MarlinTrk::prepareVectors(LCEvent* event) {

const float eps = 1.0e-07;
// V must be the global z axis
if (fabs(1.0 - V.dot(Z)) > eps) {
streamlog_out(ERROR) << "FullLDCTracking_MarlinTrk: PIXEL SIT Hit measurment vectors V is not equal to the "
if (!(fabs(1.0 - V.dot(Z)) > eps || fabs(-1.0 - V.dot(Z)) > eps)) {
streamlog_out(ERROR) << "FullLDCTracking_MarlinTrk: PIXEL SIT Hit measurement vectors V is not equal to the "
"global Z axis. \n\n exit(1) called from file "
<< __FILE__ << " and line " << __LINE__ << std::endl;
exit(1);
Expand Down Expand Up @@ -4749,51 +4752,60 @@ void FullLDCTracking_MarlinTrk::setupGeom(const dd4hep::Detector& theDetector) {
//-- VXD Parameters--
_nLayersVTX = 0;

// const std::string nameVertexBarrelDetector = "VertexBarrel";

try {
streamlog_out(DEBUG9) << " filling VXD parameters " << std::endl;
streamlog_out(DEBUG9) << " filling " << m_vtxDetName << " parameters " << std::endl;

dd4hep::DetElement vtxDE = theDetector.detector("VXD");
dd4hep::DetElement vtxDE = theDetector.detector(m_vtxDetName);
dd4hep::rec::ZPlanarData* vtx = vtxDE.extension<dd4hep::rec::ZPlanarData>();
_nLayersVTX = vtx->layers.size();

} catch (std::runtime_error& e) {
streamlog_out(DEBUG9) << " ### VXD detector Not Present in Compact File" << std::endl;
streamlog_out(ERROR) << " " << m_vtxDetName << " detector Not Present in Compact File" << std::endl;
}

//-- SIT Parameters--
_nLayersSIT = 0;

const std::string nameInnerTrackerBarrelDetector = "InnerTrackerBarrel";

try {
streamlog_out(DEBUG9) << " filling SIT parameters " << std::endl;
streamlog_out(DEBUG9) << " filling " << nameInnerTrackerBarrelDetector << " parameters " << std::endl;

dd4hep::DetElement sitDE = theDetector.detector("SIT");
dd4hep::DetElement sitDE = theDetector.detector(nameInnerTrackerBarrelDetector);
dd4hep::rec::ZPlanarData* sit = sitDE.extension<dd4hep::rec::ZPlanarData>();
_nLayersSIT = sit->layers.size();
} catch (std::runtime_error& e) {
streamlog_out(DEBUG9) << " ### SIT detector Not Present in Compact File " << std::endl;
streamlog_out(ERROR) << " " << nameInnerTrackerBarrelDetector << " detector Not Present in Compact File "
<< std::endl;
}

//-- SET Parameters--
_nLayersSET = 0;

const std::string nameSiliconExternalTrackDetector = "SET";

try {
streamlog_out(DEBUG9) << " filling SET parameters " << std::endl;
streamlog_out(DEBUG9) << " filling " << nameSiliconExternalTrackDetector << " parameters " << std::endl;

dd4hep::DetElement setDE = theDetector.detector("SET");
dd4hep::DetElement setDE = theDetector.detector(nameSiliconExternalTrackDetector);
dd4hep::rec::ZPlanarData* set = setDE.extension<dd4hep::rec::ZPlanarData>();
_nLayersSET = set->layers.size();
} catch (std::runtime_error& e) {
streamlog_out(DEBUG9) << " ### SET detector Not Present in Compact File " << std::endl;
streamlog_out(WARNING) << " " << nameSiliconExternalTrackDetector << " detector Not Present in Compact File "
<< std::endl;
}

//-- FTD Parameters--
_petalBasedFTDWithOverlaps = false;
_nLayersFTD = 0;

const std::string ftdName = "FTD";

try {
streamlog_out(DEBUG9) << " filling FTD parameters " << std::endl;
streamlog_out(DEBUG9) << " filling " << ftdName << " parameters " << std::endl;

dd4hep::DetElement ftdDE = theDetector.detector("FTD");
dd4hep::DetElement ftdDE = theDetector.detector(ftdName);
dd4hep::rec::ZDiskPetalsData* ftd = ftdDE.extension<dd4hep::rec::ZDiskPetalsData>();

_nLayersFTD = ftd->layers.size();
Expand All @@ -4808,6 +4820,6 @@ void FullLDCTracking_MarlinTrk::setupGeom(const dd4hep::Detector& theDetector) {
_nLayersFTD = _zLayerFTD.size();

} catch (std::runtime_error& e) {
streamlog_out(DEBUG9) << " ### FTD detector Not Present in Compact File" << std::endl;
streamlog_out(WARNING) << " " << ftdName << " detector Not Present in Compact File" << std::endl;
}
}
17 changes: 8 additions & 9 deletions source/Refitting/src/SiliconTracking_MarlinTrk.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3154,31 +3154,30 @@ void SiliconTracking_MarlinTrk::setupGeom(const dd4hep::Detector& theDetector) {
theDetector.field().magneticField({0, 0, 0}, bFieldVec); // get the magnetic field vector from DD4hep
_bField = bFieldVec[2] / dd4hep::tesla; // z component at (0,0,0)

//-- VXD Parameters--
//-- VertexBarrel Parameters--
_nLayersVTX = 0;

try {
streamlog_out(DEBUG9) << " filling VXD parameters " << std::endl;
streamlog_out(DEBUG9) << " filling VertexBarrel parameters " << std::endl;

dd4hep::DetElement vtxDE = theDetector.detector("VXD");
dd4hep::DetElement vtxDE = theDetector.detector("VertexBarrel");
dd4hep::rec::ZPlanarData* vtx = vtxDE.extension<dd4hep::rec::ZPlanarData>();
_nLayersVTX = vtx->layers.size();

} catch (std::runtime_error& e) {
streamlog_out(DEBUG9) << " ### VXD detector Not Present in Compact File" << std::endl;
streamlog_out(DEBUG9) << " ### VertexBarrel detector Not Present in Compact File" << std::endl;
}

//-- SIT Parameters--
//-- InnerTrackerBarrel Parameters--
_nLayersSIT = 0;

try {
streamlog_out(DEBUG9) << " filling SIT parameters " << std::endl;

dd4hep::DetElement sitDE = theDetector.detector("SIT");
streamlog_out(DEBUG9) << " filling InnerTrackerBarrel parameters " << std::endl;
dd4hep::DetElement sitDE = theDetector.detector("InnerTrackerBarrel");
dd4hep::rec::ZPlanarData* sit = sitDE.extension<dd4hep::rec::ZPlanarData>();
_nLayersSIT = sit->layers.size();
} catch (std::runtime_error& e) {
streamlog_out(DEBUG9) << " ### SIT detector Not Present in Compact File " << std::endl;
streamlog_out(DEBUG9) << " ### InnerTrackerBarrel detector Not Present in Compact File " << std::endl;
}

//-- FTD Parameters--
Expand Down

0 comments on commit a45db09

Please sign in to comment.