Skip to content
Snippets Groups Projects

fixes needed to run MuonBackground in Boole

Merged Patrizia De Simone requested to merge Muon_debug into master
All threads resolved!
2 files
+ 40
25
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -67,8 +67,7 @@ using Chamber = LHCb::Detector::DeMuonChamber;
// iSta -> station index from 0 to 3,
// iReg -> region index from 0 to 3,
// iCha -> chamber index from 0 to 191 <==> be careful !! don't confuse with the index icha of the vector of chamber
// detector elements,
// given by getChamberVectorIndex
// detector elements, given by getChamberVectorIndex
//
//
DeMuon::DeMuonObject( dd4hep::DetElement const& de, dd4hep::cond::ConditionUpdateContext& ctxt )
@@ -201,7 +200,7 @@ Chamber DeMuon::getChamber( unsigned int ista, unsigned int ireg, unsigned int c
auto it = map.find( chamberNumber );
if ( it == map.end() ) {
dd4hep::printout( dd4hep::DEBUG, "DeMuon",
"GetChamber ERROR: the combination station/region/chamber does not exists" );
"GetChamber DEBUG: the combination station/region/chamber does not exists" );
return nullptr;
}
return &m_stations[ista].m_sides[it->second.side].m_regions[ireg].m_chambers[it->second.index];
@@ -434,7 +433,7 @@ DeMuon::listOfPhysChannels( ROOT::Math::XYZPoint my_entry, ROOT::Math::XYZPoint
}
auto myPair = grid->second.listOfPhysChannels( mod_xen, mod_yen, mod_xex, mod_yex );
//
int gapIndex = pointInGasGap->number;
int gapIndex = ( pointInGasGap->number - 1 );
for ( auto& [myFE, myVec] : myPair ) {
assert( myVec.size() == 4 );
myFE.setLayer( gapIndex / 2 );
@@ -453,6 +452,7 @@ void DeMuon::Hit2ChamberNumber( ROOT::Math::XYZPoint myPoint, int ista, unsigned
//
double x = myPoint.x();
double y = myPoint.y();
double z = myPoint.z();
//
int icha = -1;
int isid = 0;
@@ -480,6 +480,14 @@ void DeMuon::Hit2ChamberNumber( ROOT::Math::XYZPoint myPoint, int ista, unsigned
"Hit2ChamberNumber DEBUG: from det_ch Chamber Number %i, region %i, station %i",
det_ch.m_ChamberNumber, det_ch.m_RegionNumber, det_ch.m_StationNumber );
//
// For calls not providing z hit take the z of the first gas gap layer
if ( !z ) {
const LHCb::Detector::detail::DeMuonGasGapObject& det_gap = det_ch.m_gasGaps[0];
double zGap = det_gap.m_Zgap;
myPoint.SetZ( zGap );
}
//
//
const auto& InGasGap = det_ch.checkPointInGasGap( myPoint );
if ( !InGasGap ) {
@@ -818,7 +826,7 @@ void DeMuon::chamberMostLikely( float x, float y, int ista, int& isid, int& ireg
}
}
if ( newreg == -1 ) {
dd4hep::printout( dd4hep::INFO, "DeMuon", "ChamberMostLikely DEBUG: newreg not found " );
dd4hep::printout( dd4hep::DEBUG, "DeMuon", "ChamberMostLikely DEBUG: newreg not found " );
return;
}
ireg = newreg;
@@ -1385,9 +1393,13 @@ Chamber DeMuon::pos2StChamber( const double x, const double y, unsigned int ista
// Take the chamber Z to update the hit later on.
unsigned int chamberNumber = 0;
int ireg = -1;
unsigned int StationNumber = ista + Muon::firstStation;
//
Hit2ChamberNumber( ROOT::Math::XYZPoint{x, y, 0}, ista, chamberNumber, ireg );
if ( ( ista > 0 and ista < Muon::nStations ) && ( ireg != -1 ) ) {
//
if ( StationNumber > 1 && StationNumber < ( Muon::firstStation + Muon::nStations ) && ( ireg != -1 ) ) {
return getChamber( ista, ireg, chamberNumber );
} else {
return nullptr;
}
@@ -1423,6 +1435,8 @@ TileID DeMuon::Chamber2Tile( unsigned int icha, unsigned int ista, unsigned int
myTile.setX( it->second.nx );
myTile.setY( it->second.ny );
myTile.setStation( ista );
myTile.setRegion( ireg );
myTile.setQuarter( it->second.quarter );
dd4hep::printout( dd4hep::DEBUG, "DeMuon", "Chamber2Tile >> X, Y and Q :: %i %i %i for chamber %i, %i", myTile.nX(),
@@ -1449,7 +1463,7 @@ int DeMuon::sensitiveVolumeID( const ROOT::Math::XYZPoint& myPoint ) const {
return ( quarterNumber << PackMCHit::shiftQuadrantID ) |
( ( stationNumber - Muon::firstStation ) << PackMCHit::shiftStationID ) |
( ( regionNumber - Muon::firstRegion ) << PackMCHit::shiftRegionID ) |
( ( chamberNumber - 1 ) << PackMCHit::shiftChamberID ) | ( ( gapNumber ) << PackMCHit::shiftGapID );
( ( chamberNumber - 1 ) << PackMCHit::shiftChamberID ) | ( ( gapNumber - 1 ) << PackMCHit::shiftGapID );
}
void DeMuon::Pos2ChamberTile( const double x, const double y, const double z, TileID& tile ) const {
Loading