-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ReducedTrackFinder implemented and running
- Loading branch information
Showing
7 changed files
with
342 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
from LDMX.Framework import ldmxcfg | ||
p = ldmxcfg.Process('reduced_algo_v1_test') | ||
|
||
p.maxTriesPerEvent = 100 | ||
|
||
from LDMX.Biasing import ecal | ||
from LDMX.SimCore import generators as gen | ||
from LDMX.SimCore import simulator as sim | ||
|
||
#myGun = gen.single_4gev_e_upstream_tagger() | ||
myGun = gen.multi( "mgpGen" ) | ||
myGun.vertex = [ 0., 0., -880] # mm | ||
myGun.momentum = [0.,0.,4000.] # MeV | ||
myGun.nParticles = 1 | ||
myGun.pdgID = 11 | ||
myGun.enablePoisson = False #True | ||
|
||
mySim = sim.simulator( "mySim" ) # Build simulator object | ||
det = 'ldmx-reduced-v1' | ||
mySim.setDetector(det, True ) | ||
mySim.beamSpotSmear = [20.,80.,0.] | ||
mySim.description = 'Reduced ECal Electron Gun (reduced) Tracking Algorithm Test' | ||
|
||
mySim.generators = [ myGun ] | ||
p.sequence = [ mySim ] | ||
p.termLogLevel = 0 | ||
|
||
|
||
p.maxEvents = 1 | ||
p.run = 200 | ||
|
||
p.histogramFile = f'hist_reducedAlgoV1Test_seederONLY.root' | ||
p.outputFiles = [f'events_1_reducedAlgoV1Test_seederONLY.root'] | ||
|
||
import LDMX.Ecal.EcalGeometry | ||
import LDMX.Ecal.ecal_hardcoded_conditions | ||
import LDMX.Ecal.digi as ecal_digi | ||
import LDMX.Ecal.vetos as ecal_vetos | ||
|
||
import LDMX.Hcal.HcalGeometry | ||
|
||
ecalVeto = ecal_vetos.EcalVetoProcessor() | ||
ecalVeto.num_ecal_layers = 6 | ||
|
||
p.sequence.extend([ | ||
ecal_digi.EcalDigiProducer(), | ||
ecal_digi.EcalRecProducer(), | ||
ecalVeto]) | ||
|
||
from LDMX.Tracking import tracking | ||
from LDMX.Tracking import geo | ||
|
||
from LDMX.Tracking.geo import TrackersTrackingGeometryProvider as trackgeo | ||
trackgeo.get_instance().setDetector('ldmx-reduced-v1') | ||
|
||
#smearings | ||
uSmearing = 0.006 #mm #could bump up to 10 micron if we want | ||
vSmearing = 0.000001 #mm #~unused | ||
|
||
# Smearing Processor - Recoil | ||
digiRecoil = tracking.DigitizationProcessor("DigitizationProcessorRecoil") | ||
digiRecoil.hit_collection = "RecoilSimHits" | ||
digiRecoil.out_collection = "DigiRecoilSimHits" | ||
digiRecoil.merge_hits = True | ||
digiRecoil.sigma_u = uSmearing | ||
digiRecoil.sigma_v = vSmearing | ||
|
||
reducedSeed = tracking.ReducedSeedFinder("ReducedSeedFinder") | ||
reducedSeed.input_hit_collection = "DigiRecoilSimHits" | ||
reducedSeed.input_recHits_collection = "EcalRecHits" | ||
reducedSeed.out_seed_collection = "ReducedSeedTracks" | ||
|
||
reducedTrack = tracking.ReducedTrackFinder("ReducedTrackFinder") | ||
reducedTrack.seed_coll_name = "ReducedSeedTracks" | ||
reducedTrack.out_trk_collection = "ReducedTrack" | ||
|
||
p.sequence.extend([digiRecoil, reducedSeed, reducedTrack]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
#pragma once | ||
|
||
//--- Framework ---// | ||
#include "Framework/Configure/Parameters.h" | ||
#include "Framework/EventProcessor.h" | ||
#include "Framework/RandomNumberSeedService.h" | ||
|
||
//--- C++ ---// | ||
#include <memory> | ||
#include <random> | ||
|
||
//--- LDMX ---// | ||
#include "Tracking/Reco/TrackingGeometryUser.h" | ||
|
||
//--- Tracking ---// | ||
#include "TFile.h" | ||
#include "TTree.h" | ||
#include "Tracking/Event/Measurement.h" | ||
#include "Tracking/Event/ReducedTrack.h" | ||
|
||
namespace tracking { | ||
namespace reco { | ||
|
||
class ReducedTrackFinder : public TrackingGeometryUser { | ||
public: | ||
/** | ||
* Constructor. | ||
* | ||
* @param name The name of the instance of this object. | ||
* @param process The process running this producer. | ||
*/ | ||
ReducedTrackFinder(const std::string &name, framework::Process &process); | ||
|
||
/// Destructor | ||
~ReducedTrackFinder(); | ||
|
||
/** | ||
* | ||
*/ | ||
void onProcessStart() override; | ||
/** | ||
* | ||
*/ | ||
void onProcessEnd() override; | ||
|
||
/** | ||
* Configure the processor using the given user specified parameters. | ||
* | ||
* @param parameters Set of parameters used to configure this processor. | ||
*/ | ||
void configure(framework::config::Parameters ¶meters) override; | ||
|
||
/** | ||
* Run the processor | ||
* | ||
* @param event The event to process. | ||
*/ | ||
void produce(framework::Event &event) override; | ||
|
||
private: | ||
int nevents_{0}; | ||
double processing_time_{0.}; | ||
|
||
// The output track collection | ||
std::string out_trk_collection_{"ReducedTracks"}; | ||
|
||
// The seed track collection | ||
std::string seed_coll_name_{"ReducedSeedTracks"}; | ||
|
||
int nseeds_{0}; | ||
int ntracks_{0}; | ||
int eventnr_{0}; | ||
|
||
std::vector<ldmx::ReducedTrack> findTracks(const std::vector<ldmx::ReducedTrack>& trackSeeds); | ||
|
||
}; // ReducedTrackFinder | ||
|
||
} // namespace reco | ||
} // namespace tracking |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.