Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 2 additions & 0 deletions include/OverlayTiming.h
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,8 @@ namespace overlay {
float _tpcVdrift_mm_ns = 5.0e-2 ;
bool _randomBX = false, _Poisson = false;

bool _checkMCC = true;

typedef std::map<unsigned long long, EVENT::SimCalorimeterHit*> DestMap;
typedef std::map<std::string, DestMap> CollDestMap;
CollDestMap collDestMap{};
Expand Down
24 changes: 18 additions & 6 deletions src/OverlayTiming.cc
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,12 @@ namespace overlay {
m_startWithBackgroundEvent);


// processo MCContribution
registerProcessorParameter("ProcessMCContribution",
"Merging the SimCaloHits check if the MCContributions already exist",
_checkMCC,
bool(true) );

}

//------------------------------------------------------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -551,7 +557,7 @@ namespace overlay {

delete permutation;
++_nEvt;
//we clear the map of calorimeter hits for the next event
// we clear the map of calorimeter hits for the next event
collDestMap.clear();
const std::vector<std::string> *collection_names_in_evt = evt->getCollectionNames();

Expand All @@ -560,9 +566,8 @@ namespace overlay {
streamlog_out(DEBUG) << "Collection " << collection_names_in_evt->at(i) << " has now " << evt->getCollection(collection_names_in_evt->at(i))->getNumberOfElements() << " elements" << std::endl;
}

// reset pointer
// reset pointer at end
overlay_Evt = nullptr;

}

//------------------------------------------------------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -794,7 +799,7 @@ namespace overlay {
{
SimCalorimeterHit *CalorimeterHit = static_cast<SimCalorimeterHit*>(source_collection->getElementAt(k));
const float _time_of_flight = time_of_flight(CalorimeterHit->getPosition()[0], CalorimeterHit->getPosition()[1], CalorimeterHit->getPosition()[2]);

float nullStep[3] = { 0.,0.,0. } ;
//check whether there is already a hit at this position
const unsigned long long lookfor = cellID2long(CalorimeterHit->getCellID0(), CalorimeterHit->getCellID1());
DestMap::const_iterator destMapIt = collDestMap[currentDest].find(lookfor);
Expand All @@ -809,7 +814,10 @@ namespace overlay {
if (((CalorimeterHit->getTimeCont(j) + time_offset) > (this_start + _time_of_flight)) && ((CalorimeterHit->getTimeCont(j) + time_offset) < (this_stop + _time_of_flight)))
{
add_Hit = true;
newCalorimeterHit->addMCParticleContribution(CalorimeterHit->getParticleCont(j), CalorimeterHit->getEnergyCont(j), CalorimeterHit->getTimeCont(j) + time_offset);
if ( _checkMCC )
newCalorimeterHit->addMCParticleContribution(CalorimeterHit->getParticleCont(j), CalorimeterHit->getEnergyCont(j), CalorimeterHit->getTimeCont(j) + time_offset);
else
newCalorimeterHit->addMCParticleContribution(CalorimeterHit->getParticleCont(j), CalorimeterHit->getEnergyCont(j), CalorimeterHit->getTimeCont(j) + time_offset, 0, 0, nullStep);
}
}
if (add_Hit)
Expand Down Expand Up @@ -862,7 +870,11 @@ namespace overlay {
{
if (((CalorimeterHit->getTimeCont(j) + time_offset) > (this_start + _time_of_flight)) && ((CalorimeterHit->getTimeCont(j) + time_offset) < (this_stop + _time_of_flight)))
{
newCalorimeterHit->addMCParticleContribution(CalorimeterHit->getParticleCont(j), CalorimeterHit->getEnergyCont(j), CalorimeterHit->getTimeCont(j) + time_offset);
if ( _checkMCC )
newCalorimeterHit->addMCParticleContribution(CalorimeterHit->getParticleCont(j), CalorimeterHit->getEnergyCont(j), CalorimeterHit->getTimeCont(j) + time_offset);
else
newCalorimeterHit->addMCParticleContribution(CalorimeterHit->getParticleCont(j), CalorimeterHit->getEnergyCont(j), CalorimeterHit->getTimeCont(j) + time_offset, 0, 0, nullStep);

}
}
}
Expand Down
6 changes: 6 additions & 0 deletions src/OverlayTimingGeneric.cc
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,12 @@ OverlayTimingGeneric::OverlayTimingGeneric(): OverlayTiming("OverlayTimingGeneri
"Starting integration time. Should be shortly before the BX, but may need to be shifted earlier if the vertex is smeared in time.",
_DefaultStart_int,
float(-0.25));
// processo MCContribution
registerProcessorParameter("ProcessMCContribution",
"Merging the SimCaloHits check if the MCContributions already exist",
_checkMCC,
bool(true) );

}

void OverlayTimingGeneric::init()
Expand Down
Loading