Skip to content
Snippets Groups Projects
Commit e808bd32 authored by Savannah Rose Shively's avatar Savannah Rose Shively
Browse files

include extrapolator tool

parent af25b697
No related branches found
No related tags found
No related merge requests found
Pipeline #4095953 passed
......@@ -4,9 +4,11 @@ atlas_add_component(SingleTrackExtrapolation
src/*.cxx
src/*.h
src/components/*.cxx
LINK_LIBRARIES AthenaBaseComps AthViews StoreGateLib
TrkTrack xAODFaserWaveform
LINK_LIBRARIES AthenaBaseComps AthViews StoreGateLib GaudiKernel
xAODFaserWaveform
EventInfo GeneratorObjects TrackerSimData
TrackerPrepRawData TrkTrack TrkRIO_OnTrack TrackerRIO_OnTrack
FaserActsGeometryLib
)
atlas_install_python_modules( python/*.py )
\ No newline at end of file
......@@ -13,15 +13,15 @@ from TrackerPrepRawDataFormation.TrackerPrepRawDataFormationConfig import FaserS
readoutmode='HIT' #or HIT, LEVEL, EDGE
def TrackerEfficiencyExampleCfg(flags, **kwargs):
def SingleTrackExtrapolationCfg(flags, **kwargs):
acc = FaserSCT_GeometryCfg(flags)
kwargs.setdefault("TrackCollection", "SegmentFit")#change to seg
TrackerEfficiencyAlg = CompFactory.TrackerEfficiencyAlg
acc.addEventAlgo(TrackerEfficiencyAlg(**kwargs))
kwargs.setdefault("TrackCollection", "SegmentFit")
SingleTrackExtrapolation = CompFactory.SingleTrackExtrapolation
acc.addEventAlgo(SingleTrackExtrapolation(**kwargs))
thistSvc = CompFactory.THistSvc()
thistSvc.Output = [f"HIST DATAFILE='trackcount{readoutmode}.root' OPT='RECREATE'"]
thistSvc.Output = [f"HIST DATAFILE='SingleTrackTest.root' OPT='RECREATE'"]
acc.addService(thistSvc)
return acc
......@@ -44,13 +44,13 @@ if __name__ == "__main__":
acc.merge(PoolReadCfg(ConfigFlags))
# Inner Detector
acc.merge(TrackerEfficiencyExampleCfg(ConfigFlags))
acc.merge(SingleTrackExtrapolationCfg(ConfigFlags))
replicaSvc = acc.getService("DBReplicaSvc")
replicaSvc.COOLSQLiteVetoPattern = ""
replicaSvc.UseCOOLSQLite = True
replicaSvc.UseCOOLFrontier = False
replicaSvc.UseGeomSQLite = True
# replicaSvc = acc.getService("DBReplicaSvc")
# replicaSvc.COOLSQLiteVetoPattern = ""
# replicaSvc.UseCOOLSQLite = True
# replicaSvc.UseCOOLFrontier = False
# replicaSvc.UseGeomSQLite = True
# Execute and finish
sys.exit(int(acc.run(maxEvents=-1).isFailure()))
......@@ -4,11 +4,36 @@
#include "StoreGate/ReadHandle.h"
#include "StoreGate/StoreGateSvc.h"
#include "TrackerIdentifier/FaserSCT_ID.h"
#include "TrackerPrepRawData/TrackerClusterCollection.h"
#include "TrackerPrepRawData/FaserSCT_Cluster.h"
#include "TrackerPrepRawData/FaserSCT_ClusterCollection.h"
#include "FaserActsGeometry/FaserActsExtrapolationTool.h"
#include <TTree.h>
#include <TBranch.h>
SingleTrackExtrapolation::SingleTrackExtrapolation(const std::string &name, ISvcLocator* pSvcLocator): AthReentrantAlgorithm(name, pSvcLocator), AthHistogramming(name){}
StatusCode SingleTrackExtrapolation::initialize() {
ATH_CHECK( m_trackCollection.initialize() );
ATH_CHECK(detStore()->retrieve(m_idHelper, "FaserSCT_ID"));
m_tree = new TTree("trackCounts", "Track Counts");
m_tree->Branch("x", &m_x, "x/F");
m_tree->Branch("y", &m_y, "y/F");
m_tree->Branch("z", &m_z, "z/F");
m_tree->Branch("px", &m_px, "px/F");
m_tree->Branch("py", &m_py, "py/F");
m_tree->Branch("pz", &m_pz, "pz/F");
m_tree->Branch("eta", &m_eta, "eta/F");
m_tree->Branch("theta", &m_theta, "theta/F");
m_tree->Branch("pt", &m_pt, "pt/F");
return StatusCode::SUCCESS;
}
......@@ -20,9 +45,33 @@ StatusCode SingleTrackExtrapolation::execute(const EventContext& ctx) const {
return StatusCode::FAILURE;
}
int track_count=0;
SG::ReadHandle<TrackCollection> h_TrackCollection {m_trackCollection,ctx};
for (const Trk::Track* track : *h_TrackCollection){}
for (const Trk::Track* track : *h_TrackCollection)
{
track_count+=1;
const Trk::TrackStateOnSurface* trackstate = (*track->trackStateOnSurfaces())[0];
const Trk::TrackParameters* parameters = trackstate->trackParameters();
//auto test = parameters-> #//how do i get charge and stuff
//parameters->
}
/*
1. go through list of tracks
2. save tracks in tree. importantly should include: charge of ptle, ptle ID, x,y,z, extrapolation into magnet
- have to get extrapolation to work (work on including that in this module at least)
3. compare tracks of an event.
- looking for +/- pairs
- compare locations in magnet; start from tracker, work backwards in increments (as dave said)
- momentum should also be symmetric (right?)
- while working back look for points where multiple tracks go into same xy coordinate and check for +/- and momentum
*/
if (track_count==2){ATH_MSG_INFO("We've got just 2!");}
return StatusCode::SUCCESS;
}
......
......@@ -9,6 +9,22 @@
#include "TrackerSimData/TrackerSimDataCollection.h"
#include "TrkTrack/TrackCollection.h"
#include "TrackerPrepRawData/FaserSCT_ClusterContainer.h"
#include "TrackerIdentifier/FaserSCT_ID.h"
#include "GaudiKernel/ServiceHandle.h"
#include "GaudiKernel/ToolHandle.h"
#include "TTree.h"
#include "TFile.h"
#include <TH1.h>
#include <TProfile.h>
class FaserSCT_ID;
class TTree;
class SingleTrackExtrapolation : public AthReentrantAlgorithm, AthHistogramming
{
......@@ -26,8 +42,24 @@ class SingleTrackExtrapolation : public AthReentrantAlgorithm, AthHistogramming
const ServiceHandle<ITHistSvc>& histSvc() const;
private:
const FaserSCT_ID* m_idHelper;
SG::ReadHandleKey<TrackCollection> m_trackCollection {this, "TrackCollection", "CKFTrackCollection", "Input track collection name" };
mutable TTree* m_tree;
mutable float m_x;
mutable float m_y;
mutable float m_z;
mutable float m_px;
mutable float m_py;
mutable float m_pz;
mutable double m_chi2;
mutable float m_eta;
mutable float m_theta;
mutable float m_phi;
mutable float m_pt;
};
#endif // SINGLETRACKEXTRAPOLATION_H
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment