Skip to content
Merged
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
33 changes: 33 additions & 0 deletions CRVFilters/fcl/prolog_trigger.fcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# -*- mode: tcl -*-
#------------------------------------------------------------------------------
#------------------------------------------------------------------------------

BEGIN_PROLOG

CRVFilters : {

#skelethon for a cosmic muon calibration
crvCoincidenceClusterFilter : {
module_type : CrvCoincidenceClusterFilter
CrvCoincidenceClusterFinder : "CrvCoincidenceClusterFinder"
MinNCluster : 1
triggerPath : "CRVCC"
}

CRVFilters : { @table::CRVFilters

filters : {

#select events based on the presence of a cluster of coincidences
crvCoincidenceClusterFilter : { @table::CaloFilters.crvCoincidenceClusterFilter }

}

sequences : {

caloCalibCosmic : [ CrvRecoPulses, CrvCoincidence, CrvCoincidenceClusterFinder, crvCoincidenceClusterFilter]

}
}

END_PROLOG
139 changes: 139 additions & 0 deletions CRVFilters/src/CrvCoincidenceClusterFilter_module.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
//
// A Filter module aimed to select events using a Likelihood defined with calorimeter cluster info
//
// $Id: $
// $Author: $
// $Date: $
//
// Original author G. Pezzullo
//

#include "CLHEP/Units/SystemOfUnits.h"
#include "GlobalConstantsService/inc/GlobalConstantsHandle.hh"

#include "ConfigTools/inc/ConfigFileLookupPolicy.hh"

#include "CalorimeterGeom/inc/Calorimeter.hh"
#include "CalorimeterGeom/inc/DiskCalorimeter.hh"

#include "GeometryService/inc/GeomHandle.hh"
#include "GeometryService/inc/GeometryService.hh"

#include "CaloCluster/inc/ClusterMoments.hh"

#include "RecoDataProducts/inc/CrvCoincidenceClusterCollection.hh"
#include "RecoDataProducts/inc/TrkFitFlag.hh"
#include "RecoDataProducts/inc/TriggerInfo.hh"

// #include "art/Framework/Core/EDAnalyzer.h"
#include "art/Framework/Core/EDFilter.h"
#include "art/Framework/Core/ModuleMacros.h"
#include "art/Framework/Principal/Event.h"
#include "art/Framework/Principal/Run.h"
#include "art/Framework/Principal/Handle.h"
#include "art/Framework/Principal/Selector.h"
#include "art/Framework/Principal/Provenance.h"

#include "cetlib_except/exception.h"
#include "fhiclcpp/ParameterSet.h"
#include "messagefacility/MessageLogger/MessageLogger.h"
#include "canvas/Utilities/InputTag.h"

#include "TDirectory.h"
#include "TH2F.h"
#include "TH1D.h"
#include "TH1F.h"
#include "TFile.h"

#include <cmath>
#include <string>
#include <vector>


using namespace std;

namespace mu2e {


class CrvCoincidenceClusterFilter : public art::EDFilter {

public:

enum {
kN1DVar = 10,
kN2DVar = 10,
kNCorHist = 10
};

virtual ~CrvCoincidenceClusterFilter() { }

virtual void beginJob();
virtual void endJob ();
virtual bool filter (art::Event& event) override;
virtual bool endRun( art::Run& run ) override;

explicit CrvCoincidenceClusterFilter(const fhicl::ParameterSet& PSet);

private:

typedef art::Ptr< CaloCrystalHit> CaloCrystalHitPtr;

int _diagLevel;
int _nProcess;
int _nPass;
art::InputTag _clTag;
int _minNCl;
std::string _trigPath;

};


CrvCoincidenceClusterFilter::CrvCoincidenceClusterFilter(const fhicl::ParameterSet & pset) :
art::EDFilter{pset},
_diagLevel (pset.get<int>("diagLevel",0)),
_nProcess (0),
_nPass (0),
_clTag (pset.get<art::InputTag> ("CrvCoincidenceClusterFinder")),
_minNCl (pset.get<int> ("MinNCluster")), //
_trigPath (pset.get<std::string> ("triggerPath")){

produces<TriggerInfo>();
}

void CrvCoincidenceClusterFilter::beginJob(){ }

void CrvCoincidenceClusterFilter::endJob(){}

bool CrvCoincidenceClusterFilter::endRun( art::Run& run ) {
if(_diagLevel > 0 && _nProcess > 0){
cout << "CrvCoincidenceClusterFilter" << " passed " << _nPass << " events out of " << _nProcess << " for a ratio of " << float(_nPass)/float(_nProcess) << endl;
}
return true;
}

//--------------------------------------------------------------------------------
// Follow the body of the Filter logic
//--------------------------------------------------------------------------------
bool CrvCoincidenceClusterFilter::filter(art::Event& event) {

++_nProcess;
if (_nProcess%10==0 && _diagLevel > 0) std::cout<<"Processing event from CrvCoincidenceClusterFilter = "<<_nProcess <<std::endl;

unique_ptr<TriggerInfo> triginfo(new TriggerInfo);
bool retval(false);

//Get calo cluster collection
auto clH = event.getValidHandle<CrvCoincidenceClusterCollection>(_clTag);
const CrvCoincidenceClusterCollection* crvCoincidenceClusters = clH.product();

if (crvCoincidenceClusters->size() > 0) retval = true;

event.put(std::move(triginfo));
return retval;
}

} // end namespace mu2e

DEFINE_ART_MODULE(mu2e::CrvCoincidenceClusterFilter);


74 changes: 74 additions & 0 deletions CRVFilters/src/SConscript
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
#!/usr/bin/env python
#
# Original author Rob Kutschke.
#

import os, re
Import('env')

Import('mu2e_helper')

helper=mu2e_helper(env)

rootlibs = env['ROOTLIBS']
babarlibs = env['BABARLIBS']

extrarootlibs = [ 'Geom', 'TMVA' , 'Minuit' , 'XMLIO' ]

mainlib = helper.make_mainlib ( [] )

helper.make_plugins( [ mainlib,
'mu2e_TrkExt',
'mu2e_TrkDiag',
'mu2e_BTrkData',
'mu2e_Mu2eBTrk',
'mu2e_Mu2eUtilities',
'mu2e_CaloCluster',
'mu2e_ParticleID',
'mu2e_MCDataProducts',
'mu2e_RecoDataProducts',
'mu2e_ConditionsService',
'mu2e_TrackerConditions',
'mu2e_GeometryService',
'mu2e_CalorimeterGeom',
'mu2e_CosmicRayShieldGeom',
'mu2e_ExtinctionMonitorFNAL_Geometry',
'mu2e_ProtonBeamDumpGeom',
'mu2e_StoppingTargetGeom',
'mu2e_TrackerGeom',
'mu2e_GlobalConstantsService_GlobalConstantsService_service',
'mu2e_GlobalConstantsService',
'mu2e_ConfigTools',
'mu2e_Mu2eInterfaces',
'mu2e_DataProducts',
'mu2e_GeneralUtilities',
'mu2e_CaloMC',
babarlibs,
'art_Framework_Core',
'art_Framework_Principal',
'art_Framework_Services_Registry',
'art_root_io_tfile_support',
'art_root_io_TFileService_service',
'art_Framework_Services_Optional_RandomNumberGenerator_service',
'art_Persistency_Common',
'art_Persistency_Provenance',
'art_Utilities',
'canvas',
'MF_MessageLogger',
'fhiclcpp',
'cetlib',
'cetlib_except',
'CLHEP',
'HepPDT',
'HepPID',
rootlibs,
extrarootlibs,
'xerces-c',
'boost_filesystem',
'boost_system',
] )

# this tells emacs to view this file in python mode.
# Local Variables:
# mode:python
# End:
1 change: 1 addition & 0 deletions CalPatRec/fcl/prolog.fcl
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ CalPatRec : { @table::CalPatRec
filter : true
plotall : false
usetarget : true
maxZTripletSearch : 2000. # mm
nHitsMaxPerPanel : 1
chi2xyMax : 5.0
chi2zphiMax : 5.0
Expand Down
14 changes: 10 additions & 4 deletions CalPatRec/fcl/prolog_trigger.fcl
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ CprTrigger : {
# CalPatRec.HelixFinder and HelixFitHack configuratons (pattern recognition)
#------------------------------------------------------------------------------
TTHelixFinderAlg : { @table::CalPatRec.HelixFinderAlg
targetconsistent : 0
targetconsistent : 0
# maxZTripletSearch : 0. # mm
}
#------------------------------------------------------------------------------
# SeedFitter(SeedFitHackNew) configuration for the final track fit: NOT USED ANYMORE
Expand Down Expand Up @@ -84,7 +85,8 @@ CprTrigger : { @table::CprTrigger
#------------------------------------------------------------------------------
TTCalSeedFit : { @table::CalPatRec.producers.CalSeedFit
ComboHitCollection : TTmakeSH
SeedCollection : "TTCalHelixFinder:Positive"
# SeedCollection : "TTCalHelixFinder:Positive"
SeedCollection : "TTCalHelixMergerDeM"
}

TTCalTrkFit : { @table::CalPatRec.producers.CalTrkFit
Expand Down Expand Up @@ -142,15 +144,17 @@ CprTrigger: { @table::CprTrigger
producers : { @table::CprTrigger.producers

TTCalSeedFitDem : { @table::CprTrigger.producers.TTCalSeedFit
SeedCollection : "TTCalHelixFinderDe:Positive"
# SeedCollection : "TTCalHelixFinderDe:Positive"
SeedCollection : "TTCalHelixMergerDeM"
}
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 : "TTCalHelixFinderDe:Negative"
SeedCollection : "TTCalHelixMergerDeP"
}
TTCalSeedFitDmp : { @table::CprTrigger.producers.TTCalSeedFit
fitparticle : @local::Particle.muplus
Expand All @@ -159,9 +163,11 @@ CprTrigger: { @table::CprTrigger

TTCalTrkFitDem : { @table::CprTrigger.producers.TTCalTrkFit
SeedCollection : TTCalSeedFitDem
CaloClusterCollection : "CaloClusterFast"
}
TTCalTrkFitDep : { @table::CprTrigger.producers.TTCalTrkFit
SeedCollection : TTCalSeedFitDep
CaloClusterCollection : "CaloClusterFast"
}
}

Expand Down
Loading