Skip to content
Closed
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: 1 addition & 1 deletion CalPatRec/fcl/prolog.fcl
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ CalPatRec : { @table::CalPatRec
sigmaPhi : 0.1636 # radians
targetconsistent : 0
weightXY : 1.11 #0.4527
weightZPhi : 0.15 #0.29 #0.4423
weightZPhi : 0.75 #0.15 #0.29 #0.4423
weight3D : 0.12 #1
maxXDPhi : 5 #
maxPanelToHelixDPhi : 1.309 # 75 degrees
Expand Down
37 changes: 33 additions & 4 deletions CalPatRec/fcl/prolog_trigger.fcl
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ CprTrigger : {
TTHelixFinderAlg : { @table::CalPatRec.HelixFinderAlg
targetconsistent : 0
# maxZTripletSearch : 0. # mm
maxDfDz : 0.025
}
#------------------------------------------------------------------------------
# SeedFitter(SeedFitHackNew) configuration for the final track fit: NOT USED ANYMORE
Expand Down Expand Up @@ -134,6 +135,28 @@ CprTrigger : { @table::CprTrigger
# HelixFinderAlg configuraton (pattern recognition)
HelixFinderAlg : { @table::CprTrigger.TTHelixFinderAlg }
}

TTCalTimePeakFinderUCC : { @table::CalPatRec.filters.CalTimePeakFinder
useAsFilter : 0
StrawHitCollectionLabel : TTmakePHUCC
StrawHitFlagCollectionLabel : "TTflagBkgHitsUCC:ComboHits"
caloClusterModuleLabel : CaloClusterFast
HitSelectionBits : ["EnergySelection","TimeSelection"]
BackgroundSelectionBits : ["Background"]
minClusterEnergy : 50. # MeV
minClusterSize : 2 # number of crystals
minClusterTime : 500. # ns
}

TTCalHelixFinderUCC : { @table::CalPatRec.filters.CalHelixFinder
useAsFilter : 0
StrawHitCollectionLabel : TTmakePHUCC
StrawHitFlagCollectionLabel : "TTflagBkgHitsUCC:ComboHits"
TimeClusterCollectionLabel : TTCalTimePeakFinderUCC

# HelixFinderAlg configuraton (pattern recognition)
HelixFinderAlg : { @table::CprTrigger.TTHelixFinderAlg }
}
}
}

Expand All @@ -144,18 +167,25 @@ CprTrigger: { @table::CprTrigger
producers : { @table::CprTrigger.producers

TTCalSeedFitDem : { @table::CprTrigger.producers.TTCalSeedFit
# SeedCollection : "TTCalHelixFinderDe:Positive"
SeedCollection : "TTCalHelixMergerDeM"
}
TTCalSeedFitUCCDem : { @table::CprTrigger.producers.TTCalSeedFit
ComboHitCollection : TTmakeSHUCC
SeedCollection : "TTCalHelixUCCMergerDeM"
}
TTCalSeedFitDmm : { @table::CprTrigger.producers.TTCalSeedFit
fitparticle : @local::Particle.muminus
SeedCollection : "TTCalHelixFinderDm:Positive"
}
TTCalSeedFitDep : { @table::CprTrigger.producers.TTCalSeedFit
fitparticle : @local::Particle.eplus
# SeedCollection : "TTCalHelixFinderDe:Negative"
SeedCollection : "TTCalHelixMergerDeP"
}
TTCalSeedFitUCCDep : { @table::CprTrigger.producers.TTCalSeedFit
ComboHitCollection : TTmakeSHUCC
fitparticle : @local::Particle.eplus
SeedCollection : "TTCalHelixUCCMergerDeP"
}
TTCalSeedFitDmp : { @table::CprTrigger.producers.TTCalSeedFit
fitparticle : @local::Particle.muplus
SeedCollection : "TTCalHelixFinderDm:Negative"
Expand All @@ -173,9 +203,8 @@ CprTrigger: { @table::CprTrigger

filters : { @table::CprTrigger.filters
TTCalHelixFinderDe : { @table::CprTrigger.filters.TTCalHelixFinder }
TTCalHelixFinderUCCDe : { @table::CprTrigger.filters.TTCalHelixFinderUCC }
TTCalHelixFinderDm : { @table::CprTrigger.filters.TTCalHelixFinder fitparticle: @local::Particle.muminus }
# TTCalHelixFinderDep : { @table::CprTrigger.filters.TTCalHelixFinder fitparticle: @local::Particle.eplus }
# TTCalHelixFinderDmp : { @table::CprTrigger.filters.TTCalHelixFinder fitparticle: @local::Particle.muplus }
}

sequences : {
Expand Down
4 changes: 3 additions & 1 deletion CalPatRec/inc/CalHelixFinderAlg.hh
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ namespace mu2e {
class CalHelixFinderAlg {
public:
enum { kMaxNHits = 10000 } ;

//-----------------------------------------------------------------------------
// data members
//-----------------------------------------------------------------------------
Expand Down Expand Up @@ -165,7 +166,6 @@ namespace mu2e {
//-----------------------------------------------------------------------------
public:
// parameter set should be passed in on construction

explicit CalHelixFinderAlg(fhicl::ParameterSet const&);
virtual ~CalHelixFinderAlg();
// cached bfield accessor
Expand Down Expand Up @@ -322,6 +322,8 @@ namespace mu2e {
HitInfo_t& Iworst ,
float& HitChi2Worst);



};
}
#endif
2 changes: 2 additions & 0 deletions CalPatRec/inc/CalHelixFinder_module.hh
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,9 @@ namespace mu2e {
// functions
//-----------------------------------------------------------------------------
public:

enum fitType {helixFit=0,seedFit,kalFit};

explicit CalHelixFinder(const fhicl::ParameterSet& PSet);
virtual ~CalHelixFinder();

Expand Down
16 changes: 9 additions & 7 deletions CalPatRec/src/CalHelixFinderAlg.cc
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,6 @@ namespace mu2e {
//mu2e::ComboHit::_useflag = StrawHitFlag(bitnames);
}


//-----------------------------------------------------------------------------
CalHelixFinderAlg::~CalHelixFinderAlg() {
}
Expand Down Expand Up @@ -224,7 +223,8 @@ namespace mu2e {
fCaloTime = cl->time();
fCaloX = tpos.x();
fCaloY = tpos.y();
fCaloZ = tpos.z();
float offset = _calorimeter->caloInfo().getDouble("diskCaseZLength")/2. + (_calorimeter->caloInfo().getDouble("BPPipeZOffset") + _calorimeter->caloInfo().getDouble("BPHoleZLength")+ _calorimeter->caloInfo().getDouble("FEEZLength"))/2. - _calorimeter->caloInfo().getDouble("FPCarbonZLength") - _calorimeter->caloInfo().getDouble("FPFoamZLength");
fCaloZ = tpos.z()-offset;
}


Expand Down Expand Up @@ -725,7 +725,8 @@ namespace mu2e {

float phi, phi_ref(-1e10), z_ref, dphi, dz;

float hist[20], minX(0), maxX(0.01), stepX(0.0005), nbinsX(20); // make it 20 bins
// float hist[20], minX(0), maxX(0.01), stepX(0.0005), nbinsX(20); // make it 20 bins
float hist[50], minX(0), maxX(0.025), stepX(0.0005), nbinsX(50); // make it 20 bins: gianipez test 2019-09-23

XYZVec* center = &Helix._center;
XYZVec pos_ref;
Expand Down Expand Up @@ -756,8 +757,8 @@ namespace mu2e {
//-----------------------------------------------------------------------------
// calorimeter cluster - point number nstations+1
//-----------------------------------------------------------------------------
float zCl = fCaloZ;
float phiCl = polyAtan2(fCaloY-center->y(),fCaloX-center->x());
float zCl = fCaloZ;
float phiCl = polyAtan2(fCaloY-center->y(),fCaloX-center->x());
if (phiCl < 0) phiCl += 2*M_PI;

phiVec[nstations] = phiCl;
Expand Down Expand Up @@ -1584,8 +1585,9 @@ namespace mu2e {
//-----------------------------------------------------------------------------
int good_hit = flag.hasAllProperties(_hsel );
int bkg_hit = flag.hasAnyProperty (_bkgsel);
int used_hit = flag.hasAnyProperty (StrawHitFlag::calosel);
if (good_hit && (! bkg_hit) && (! used_hit)) {
// int used_hit = flag.hasAnyProperty (StrawHitFlag::calosel);
// if (good_hit && (! bkg_hit) && (! used_hit)) {
if (good_hit && (! bkg_hit) ) {
const ComboHit& ch = Helix.chcol()->at(loc);

if (ch.energyDep() > _maxHitEnergy) continue;
Expand Down
4 changes: 1 addition & 3 deletions CalPatRec/src/CalHelixFinderDiag_tool.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ namespace mu2e {
SimParticleTimeOffset* _timeOffsets;

public:

CalHelixFinderDiag(const fhicl::ParameterSet& PSet);
~CalHelixFinderDiag();

Expand All @@ -49,13 +49,11 @@ namespace mu2e {
//
//-----------------------------------------------------------------------------
CalHelixFinderDiag::CalHelixFinderDiag(const fhicl::ParameterSet& PSet) {
printf(" CalHelixFinderDiag::CalHelixFinderDiag : HOORAY! \n");
_first_call = 1;
_event_number = -1;
_timeOffsets = NULL;
}


CalHelixFinderDiag::~CalHelixFinderDiag() {
}

Expand Down
39 changes: 18 additions & 21 deletions CalPatRec/src/CalHelixFinder_module.cc
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ using CLHEP::HepVector;
using CLHEP::Hep3Vector;

namespace mu2e {
//-----------------------------------------------------------------------------
// module constructor, parameter defaults are defiend in CalPatRec/fcl/prolog.fcl
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
// module constructor, parameter defaults are defiend in CalPatRec/fcl/prolog.fcl
//-----------------------------------------------------------------------------
CalHelixFinder::CalHelixFinder(fhicl::ParameterSet const& pset) :
art::EDFilter{pset},
_diagLevel (pset.get<int> ("diagLevel" )),
Expand All @@ -64,34 +64,31 @@ namespace mu2e {
_minNHitsTimeCluster(pset.get<int> ("minNHitsTimeCluster" )),
_tpart ((TrkParticle::type)(pset.get<int>("fitparticle"))),
_fdir ((TrkFitDirection::FitDirection)(pset.get<int>("fitdirection"))),
_hfinder (pset.get<fhicl::ParameterSet>("HelixFinderAlg",fhicl::ParameterSet()))
{
consumes<ComboHitCollection>(_shLabel);
consumes<StrawHitFlagCollection>(_shfLabel);
consumes<TimeClusterCollection>(_timeclLabel);

std::vector<int> helvals = pset.get<std::vector<int> >("Helicities",vector<int>{Helicity::neghel,Helicity::poshel});
for(auto hv : helvals) {
_hfinder (pset.get<fhicl::ParameterSet>("HelixFinderAlg",fhicl::ParameterSet())){
consumes<ComboHitCollection>(_shLabel);
consumes<StrawHitFlagCollection>(_shfLabel);
consumes<TimeClusterCollection>(_timeclLabel);

std::vector<int> helvals = pset.get<std::vector<int> >("Helicities",vector<int>{Helicity::neghel,Helicity::poshel}); //pset.get<std::vector<int> >("Helicities",vector<int>{Helicity::neghel,Helicity::poshel});
for(auto hv : helvals) {
Helicity hel(hv);
_hels.push_back(hel);
produces<HelixSeedCollection>(Helicity::name(hel));
}
// produces<HelixSeedCollection>();
//-----------------------------------------------------------------------------
// provide for interactive disanostics
//-----------------------------------------------------------------------------
_helTraj = 0;
_timeOffsets = new fhicl::ParameterSet(pset.get<fhicl::ParameterSet>("TimeOffsets",fhicl::ParameterSet()));
_helTraj = 0;
_timeOffsets = new fhicl::ParameterSet(pset.get<fhicl::ParameterSet>("TimeOffsets",fhicl::ParameterSet()));

_data.shLabel = _shLabel;
_data.timeOffsets = _timeOffsets;
_data.shLabel = _shLabel;
_data.timeOffsets = _timeOffsets;

if (_debugLevel != 0) _printfreq = 1;
if (_debugLevel != 0) _printfreq = 1;

if (_diagLevel != 0) _hmanager = art::make_tool <ModuleHistToolBase>(pset.get<fhicl::ParameterSet>("diagPlugin"));
else _hmanager = std::make_unique<ModuleHistToolBase>();

}
if (_diagLevel != 0) _hmanager = art::make_tool <ModuleHistToolBase>(pset.get<fhicl::ParameterSet>("diagPlugin"));
else _hmanager = std::make_unique<ModuleHistToolBase>();
}

//-----------------------------------------------------------------------------
// destructor
Expand Down
63 changes: 12 additions & 51 deletions Mu2eUtilities/inc/TriggerResultsNavigator.hh
Original file line number Diff line number Diff line change
Expand Up @@ -23,74 +23,35 @@ namespace mu2e {
class TriggerResultsNavigator{

public:
TriggerResultsNavigator(const art::TriggerResults* trigResults):
_trigResults(trigResults)
{
TriggerResultsNavigator(const art::TriggerResults* trigResults) :
_trigResults(trigResults){
auto const id = trigResults->parameterSetID();
auto const& pset = fhicl::ParameterSetRegistry::get(id);
//set the vector<string> with the names of the tirgger_paths
_trigPathsNames = pset.get<std::vector<std::string>>("trigger_paths");

//loop over trigResults to fill the map <string, unsigned int)
for (unsigned int i=0; i< _trigPathsNames.size(); ++i){
_trigMap.insert(std::pair<std::string, unsigned int>(_trigPathsNames[i], i));
_trigMap.insert(std::pair<std::string, unsigned int>(_trigPathsNames[i], i));
}
}


// Trigger path information for the current process
size_t
size() const
size_t size() const
{
return _trigPathsNames.size();
}
std::vector<std::string> const&
getTrigPaths() const
{
return _trigPathsNames;
}
std::string const&
getTrigPath(unsigned int const i) const
{
return _trigPathsNames.at(i);
}
size_t
findTrigPath(std::string const& name) const
{
return find(_trigMap, name);
}

std::vector<std::string> const& getTrigPaths() const { return _trigPathsNames; }
std::string const& getTrigPath(unsigned int const i) const { return _trigPathsNames.at(i); }

size_t
find(std::map<std::string, unsigned int> const& posmap, std::string const& name) const
{
auto const pos = posmap.find(name);
if (pos == posmap.cend()) {
return posmap.size();
} else {
return pos->second;
}
}
size_t findTrigPath(std::string const& name) const;
size_t find(std::map<std::string, unsigned int> const& posmap, std::string const& name) const;

// Has ith path accepted the event?
bool
accept(std::string const& name) const
{
size_t index = findTrigPath(name);
return _trigResults->accept(index);
}
void print() const {
printf("TriggerResultsNaviogator Map\n");
printf("//------------------------------------------//\n");
printf("// trig_pathName id accepted //\n");
printf("//------------------------------------------//\n");

for (unsigned int i=0; i< _trigPathsNames.size(); ++i){
std::string name = _trigPathsNames[i];
size_t index = findTrigPath(name);
bool accepted = accept(name);
printf("// %24s %2li %i //\n", name.c_str(), index, accepted == true ? 1:0);
}

}
bool accept(std::string const& name) const;
void print() const;

private:
const art::TriggerResults* _trigResults;
Expand Down
Loading