Skip to content
Open
Show file tree
Hide file tree
Changes from 3 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
1 change: 1 addition & 0 deletions DAQ/fcl/prolog.fcl
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ DAQ : {
minEDep : 0.0006 ## in MeV
debugMode : false
debugBits : [ "bit0:0" ]
mnidToSkip : [ ] ## by default all panels are good
fillHistograms : false
}
}
Expand Down
27 changes: 26 additions & 1 deletion DAQ/src/StrawHitFilter_module.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
#include <memory>
#include <map>

#include "Offline/ProditionsService/inc/ProditionsHandle.hh"
#include "Offline/TrackerConditions/inc/TrackerPanelMap.hh"

namespace mu2e {
class StrawHitFilter : public art::EDFilter {
public:
Expand All @@ -40,6 +43,7 @@ namespace mu2e {
fhicl::Atom<float> maxDt {Name("maxDt" ), Comment("max abs(DT)")};
fhicl::Atom<float> minEDep {Name("minEDep" ), Comment("min EDep")};
fhicl::Atom<int> minNGoodHits {Name("minNGoodHits" ), Comment("minNStrawDigis")};
fhicl::Sequence<int> mnidToSkip {Name("mnidToSkip" ), Comment("a list of panels to skip")};
fhicl::Atom<bool> fillHistograms{Name("fillHistograms"), Comment("fill histogrms, default:false")};
};

Expand Down Expand Up @@ -75,14 +79,17 @@ namespace mu2e {
float _maxDt;
float _minEDep;
int _minNGoodHits;
std::vector<int> _mnidToSkip; // panels not to look at when searching for good hits
int _fillHistograms;

int _nevt;
int _nevp;
int _nsht;
int _nshg;

const mu2e::StrawHitCollection* _shc;
const mu2e::StrawHitCollection* _shc;
ProditionsHandle<TrackerPanelMap> _tpm_h;
const TrackerPanelMap* _trkPanelMap;

const art::Event* _event;
int _rn;
Expand All @@ -98,6 +105,7 @@ namespace mu2e {
_maxDt (conf().maxDt ()),
_minEDep (conf().minEDep ()),
_minNGoodHits (conf().minNGoodHits()),
_mnidToSkip (conf().mnidToSkip()),
_fillHistograms (conf().fillHistograms())
{
//-----------------------------------------------------------------------------
Expand Down Expand Up @@ -194,6 +202,8 @@ namespace mu2e {

_event = &ArtEvent; // should always be the first line

_trkPanelMap = &_tpm_h.get(_event->id());

if (_debugMode) print_("-- START");

++_nevt;
Expand All @@ -216,6 +226,21 @@ namespace mu2e {

for (int i = 0; i<_nsht; ++i) {
const mu2e::StrawHit* sh = &_shc->at(i);

int pln = sh->strawId().plane();
int pnl = sh->strawId().panel();
const TrkPanelMap::Row* tpm = _trkPanelMap->panel_map_by_offline_ind(pln,pnl);
int hit_mnid = tpm->mnid();

bool skip = false;
for (auto mnid: _mnidToSkip) {
if (hit_mnid == mnid) {
skip = true;
break;
}
}
if (skip) continue;

if (fabs(sh->dt()) > _maxDt ) continue;
if (sh->energyDep() < _minEDep) continue;
_nshg++;
Expand Down