Skip to content
Snippets Groups Projects
Commit 253e999e authored by Frank Winklmeier's avatar Frank Winklmeier
Browse files

Merge branch 'eftracking_fixtruth' into 'main'

Fix EFTracking CI test

See merge request !71745
parents ad5de2ef 72ede822
No related branches found
No related tags found
29 merge requests!78241Draft: FPGATrackSim: GenScan code refactor,!78236Draft: Switching Streams https://its.cern.ch/jira/browse/ATR-27417,!78056AFP monitoring: new synchronization and cleaning,!78041AFP monitoring: new synchronization and cleaning,!77990Updating TRT chip masks for L1TRT trigger simulation - ATR-28372,!77733Draft: add new HLT NN JVT, augmented with additional tracking information,!77731Draft: Updates to ZDC reconstruction,!77728Draft: updates to ZDC reconstruction,!77522Draft: sTGC Pad Trigger Emulator,!76725ZdcNtuple: Fix cppcheck warning.,!76611L1CaloFEXByteStream: Fix out-of-bounds array accesses.,!76475Punchthrough AF3 implementation in FastG4,!76474Punchthrough AF3 implementation in FastG4,!76343Draft: MooTrackBuilder: Recalibrate NSW hits in refine method,!75729New implementation of ZDC nonlinear FADC correction.,!75703Draft: Update to HI han config for HLT jets,!75184Draft: Update file heavyions_run.config,!74430Draft: Fixing upper bound for Delayed Jet Triggers,!73963Changing the path of the histograms to "Expert" area,!73875updating ID ART reference plots,!73874AtlasCLHEP_RandomGenerators: Fix cppcheck warnings.,!73449Add muon detectors to DarkJetPEBTLA partial event building,!73343Draft: [TrigEgamma] Add photon ringer chains on bootstrap mechanism,!72336Fixed TRT calibration crash,!72176Draft: Improving L1TopoOnline chain that now gets no-empty plots. Activating it by default,!72012Draft: Separate JiveXMLConfig.py into Config files,!71876Fix MET trigger name in MissingETMonitoring,!71820Draft: Adding new TLA End-Of-Fill (EOF) chains and removing obsolete DIPZ chains,!71745Fix EFTracking CI test
Showing
with 78 additions and 40 deletions
......@@ -5,7 +5,7 @@ set -e
GEO_TAG="ATLAS-P2-RUN4-03-00-00"
export CALIBPATH=/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/PhaseIIUpgrade/EFTracking/${GEO_TAG}/:$CALIBPATH
WRP_EVT=200
WRAPPER="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/PhaseIIUpgrade/EFTracking/${GEO_TAG}/FPGATrackSimWrapper_9L.root"
WRAPPER="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/PhaseIIUpgrade/EFTracking/${GEO_TAG}/FPGATrackSimWrapper.root"
BANKS="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/PhaseIIUpgrade/EFTracking/${GEO_TAG}/banks_9L/"
MAPS="maps_9L/"
......
......@@ -2,7 +2,7 @@
set -e
GEO_TAG="ATLAS-P2-RUN4-03-00-00"
WRAPPER="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/PhaseIIUpgrade/EFTracking/${GEO_TAG}/FPGATrackSimWrapper_9L.root"
WRAPPER="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/PhaseIIUpgrade/EFTracking/${GEO_TAG}/FPGATrackSimWrapper.root"
echo "... Maps Making"
python -m FPGATrackSimConfTools.FPGATrackSimMapMakerConfig \
......
......@@ -59,7 +59,7 @@ StatusCode FPGATrackSimReadRawRandomHitsTool::readData(FPGATrackSimEventInputHea
// Truth Info
FPGATrackSimOptionalEventInfo optional;
int mbc = 0; // to scale up barcodes!
unsigned long int mbc = 0; // to scale up barcodes!
// --- Copy old data
if (doReset)
......@@ -70,7 +70,7 @@ StatusCode FPGATrackSimReadRawRandomHitsTool::readData(FPGATrackSimEventInputHea
{
for (const auto& truthtrack : header->optional().getTruthTracks())
{
if (truthtrack.getBarcode() > mbc) mbc = truthtrack.getBarcode();
if (truthtrack.getBarcode() > mbc) mbc = truthtrack.getBarcode();
optional.addTruthTrack(truthtrack);
}
......@@ -98,15 +98,12 @@ StatusCode FPGATrackSimReadRawRandomHitsTool::readData(FPGATrackSimEventInputHea
// copy Hits
for (auto rawhit : m_eventHeader->hits())
{
if (rawhit.getBarcode() >= 0)
{
FPGATrackSimMultiTruth origtruth = rawhit.getTruth();
FPGATrackSimMultiTruth mt;
FPGATrackSimMultiTruth::Barcode uniquecode(rawhit.getEventIndex(),rawhit.getBarcode()+mbc);
mt.maximize(uniquecode, rawhit.getBarcodePt());
rawhit.setBarcode(rawhit.getBarcode() + mbc);
rawhit.setTruth(mt);
}
FPGATrackSimMultiTruth origtruth = rawhit.getTruth();
FPGATrackSimMultiTruth mt;
FPGATrackSimMultiTruth::Barcode uniquecode(rawhit.getEventIndex(),rawhit.getBarcode()+mbc);
mt.maximize(uniquecode, rawhit.getBarcodePt());
rawhit.setBarcode(rawhit.getBarcode() + mbc);
rawhit.setTruth(mt);
header->addHit(rawhit);
}
......
......@@ -129,12 +129,12 @@ public:
// --- Truth and Other ---
void setToT(unsigned v) { m_ToT = v; }
void setBarcode(long v) { m_barcode = v; }
void setBarcode(unsigned long v) { m_barcode = v; }
void setBarcodePt(float v) { m_barcode_pt = v; }
void setEventIndex(long v) { m_eventindex = v; }
void setParentageMask(unsigned long v) { m_parentage_mask = v; }
void setTruth(const FPGATrackSimMultiTruth& v) { m_truth = v; }
long getBarcode() const { return m_barcode; }
unsigned long getBarcode() const { return m_barcode; }
long getEventIndex() const { return m_eventindex; }
float getBarcodePt() const { return m_barcode_pt; }
unsigned long getParentageMask() const { return m_parentage_mask; }
......@@ -193,7 +193,7 @@ protected:
unsigned m_hw_word = 0; // store Strip and Pixel cluster positions as integers using the same FPGATrackSim_IM HW definition
unsigned m_ToT = 0; // time over Threshold
long m_eventindex = 0; // athena event index assigned to this channel
long m_barcode = 0; // geant particle barcode assigned to this channel
unsigned long m_barcode = 0; // geant particle barcode assigned to this channel
float m_barcode_pt = 0; // maximum 'pt' for any 'good' geant particle contributing to the channel.
// corresponds to the particle with m_barcode
unsigned long m_parentage_mask = 0; // ancestor information of this channel
......
......@@ -12,7 +12,7 @@ public:
FPGATrackSimMatchInfo() : m_barcode(0), m_evtindex(-1) { ; }
FPGATrackSimMatchInfo(int v1, int v2) : m_barcode(v1), m_evtindex(v2) { ; }
int barcode() const { return m_barcode; }
unsigned long barcode() const { return m_barcode; }
int evtindex() const { return m_evtindex; }
bool operator==(const FPGATrackSimMatchInfo& o) const { return (m_barcode == o.m_barcode) && (m_evtindex == o.m_evtindex); }
......@@ -20,7 +20,7 @@ public:
private:
int m_barcode;
unsigned long m_barcode;
int m_evtindex;
......
......@@ -46,7 +46,7 @@
class FPGATrackSimMultiTruth : public TObject {
public:
typedef std::pair<long, long> Barcode; // = (event index, barcode)
typedef std::pair<unsigned long, unsigned long> Barcode; // = (event index, barcode)
typedef float Weight;
typedef std::map<Barcode, Weight> TruthMap;
......@@ -69,7 +69,7 @@ public:
bool isEmpty() const { return m_truth.empty(); }
long best_barcode() const;
unsigned long best_barcode() const;
void add(const FPGATrackSimMultiTruth::Barcode& code, const FPGATrackSimMultiTruth::Weight& weight);
void add(const FPGATrackSimMultiTruth& rval);
......@@ -100,9 +100,10 @@ private:
};
struct TruthMapWeightLt {
unsigned long int bad = -1; /// Use value of -1 here
bool operator()(const TruthMap::value_type& a, const TruthMap::value_type& b) const {
const bool a_info = (a.first.first != -1) && (a.first.second != -1);
const bool b_info = (b.first.first != -1) && (b.first.second != -1);
const bool a_info = (a.first.first != bad) && (a.first.second != bad);
const bool b_info = (b.first.first != bad) && (b.first.second != bad);
return a_info && b_info ? a.second < b.second : b_info;
}
};
......
......@@ -18,7 +18,7 @@ public:
void setPhi(double v) { m_phi = v; }
void setD0(double v) { m_d0 = v; }
void setZ0(double v) { m_z0 = v; }
void setBarcode(long v) { m_barcode = v; }
void setBarcode(unsigned long v) { m_barcode = v; }
void setBarcodeFrac(float v) { m_barcode_frac = v; }
double getPt() const { return m_qoverpt != 0 ? std::abs(sin(2 * std::atan(std::exp(-m_eta))) / m_qoverpt) : 99999999.; }
......@@ -27,7 +27,7 @@ public:
double getD0() const { return m_d0; }
double getZ0() const { return m_z0; }
double getQOverPt() const { return m_qoverpt / sin(2 * std::atan(std::exp(-m_eta))); }
long getBarcode() const { return m_barcode; }
unsigned long getBarcode() const { return m_barcode; }
double getBarcodeFrac() const { return m_barcode_frac; }
// handling hits
......@@ -46,7 +46,7 @@ private:
double m_d0;
double m_z0;
long m_barcode; // matched geant particle barcode
unsigned long m_barcode; // matched geant particle barcode
double m_barcode_frac; // largest "matching fraction" with any "good"
// geant particle, corresponding to the
// particle with m_barcode
......
......@@ -45,8 +45,8 @@ class FPGATrackSimTrack : public TObject {
//write a detmap
int getNCoords() const;
signed long getEventIndex() const { return m_eventindex; }
signed long getBarcode() const { return m_barcode; }
signed long barcode() const { return getBarcode(); }
unsigned long getBarcode() const { return m_barcode; }
unsigned long barcode() const { return getBarcode(); }
float getBarcodeFrac() const { return m_barcode_frac; }
//Should be passed as const ref to avoid excessive copying.
const std::vector <FPGATrackSimHit>& getFPGATrackSimHits() const { return m_hits; }
......@@ -89,7 +89,7 @@ class FPGATrackSimTrack : public TObject {
void setTypeMask(unsigned int v) { m_typemask = v; }
void setHitMap(unsigned int v) { m_hitmap = v; }
void setEventIndex(const signed long& v) { m_eventindex = v; }
void setBarcode(const signed long& v) { m_barcode = v; }
void setBarcode(const unsigned long& v) { m_barcode = v; }
void setBarcodeFrac(const float& v) { m_barcode_frac = v; }
void setValidCand(bool v) { m_isValidCand = v; }
......@@ -145,7 +145,7 @@ class FPGATrackSimTrack : public TObject {
std::vector<FPGATrackSimHit> m_hits; //[m_nlayers] hits associated to the track
signed long m_eventindex = -1; // matched particle event index
signed long m_barcode = -1; // matched geant particle barcode
unsigned long m_barcode = -1; // matched geant particle barcode
float m_barcode_frac = 0.0F; // largest "matching fraction" with any "good"
// geant particle, corresponding to the
// particle with m_barcode
......
......@@ -28,7 +28,7 @@ public:
void setPDGCode(int v) { m_pdgcode = v; }
void setStatus(int v) { m_status = v; }
void setBarcode(int v) { m_barcode = v; }
void setBarcode(unsigned long v) { m_barcode = v; }
void setEventIndex(int v) { m_evtindex = v; }
void setBarcodeFracOffline(double v) { m_barcode_frac_offline = v; }
......@@ -54,8 +54,8 @@ public:
int getPDGCode() const { return m_pdgcode; }
int getStatus() const { return m_status; }
int status() const { return m_status; }
int getBarcode() const { return m_barcode; }
int barcode() const { return m_barcode; }
unsigned long getBarcode() const { return m_barcode; }
unsigned long barcode() const { return m_barcode; }
int getEventIndex() const { return m_evtindex; }
double getBarcodeFracOffline() const { return m_barcode_frac_offline; }
......@@ -88,7 +88,7 @@ private:
int m_pdgcode;
int m_status;
int m_barcode;
unsigned long m_barcode;
int m_evtindex;
double m_barcode_frac_offline; // largest "matching fraction" with any "good"
// xAOD::TruthParticle, corresponding to the
......
......@@ -14,7 +14,7 @@ ClassImp(FPGATrackSimMultiTruth)
// ================================================================
// 20-04-2009 Antonio Boveia (boveia@hep.uchicago.edu)
long FPGATrackSimMultiTruth::best_barcode() const {
unsigned long FPGATrackSimMultiTruth::best_barcode() const {
Barcode code;
Weight weight;
return !best(code, weight) ? -999 : code.second;
......
......@@ -150,6 +150,8 @@ StatusCode FPGATrackSimSGToRawHitsTool::readOfflineTracks(std::vector<FPGATrackS
tmpOfflineTrack.setQOverPt(trackParticle->pt() > 0 ? trackParticle->charge() / trackParticle->pt() : 0);
tmpOfflineTrack.setEta(trackParticle->eta());
tmpOfflineTrack.setPhi(trackParticle->phi());
tmpOfflineTrack.setD0(trackParticle->d0());
tmpOfflineTrack.setZ0(trackParticle->z0());
const Trk::TrackStates* trackStates = trackParticle->track()->trackStateOnSurfaces();
if (trackStates == nullptr) {
......@@ -292,7 +294,16 @@ FPGATrackSimSGToRawHitsTool::readPixelSimulation(HitIndexMap& hitIndexMap, unsig
tmpSGhit.setEventIndex(index);
else
tmpSGhit.setEventIndex(std::numeric_limits<long>::max());
tmpSGhit.setBarcode((long)(bestParent ? bestExtcode.uid() : std::numeric_limits<long>::max())); // FIXME
if (bestParent) {
unsigned int id2, barcode2;
bestExtcode.uniqueID(id2, barcode2);
tmpSGhit.setBarcode(id2);
}
else {
tmpSGhit.setBarcode(std::numeric_limits<unsigned long>::max());
}
tmpSGhit.setBarcodePt(static_cast<unsigned long>(std::ceil(bestParent ? bestParent->momentum().perp() : 0.)));
tmpSGhit.setParentageMask(parentMask.to_ulong());
......@@ -365,8 +376,16 @@ FPGATrackSimSGToRawHitsTool::readStripSimulation(HitIndexMap& hitIndexMap, unsig
tmpSGhit.setEventIndex(index);
else
tmpSGhit.setEventIndex(std::numeric_limits<long>::max());
tmpSGhit.setBarcode((long)(bestParent ? bestExtcode.uid() : std::numeric_limits<long>::max())); // FIXME
if (bestParent) {
unsigned int id2, barcode2;
bestExtcode.uniqueID(id2, barcode2);
tmpSGhit.setBarcode(id2);
}
else {
tmpSGhit.setBarcode(std::numeric_limits<unsigned long>::max());
}
tmpSGhit.setBarcodePt(static_cast<unsigned long>(std::ceil(bestParent ? bestParent->momentum().perp() : 0.)));
tmpSGhit.setParentageMask(parentMask.to_ulong());
tmpSGhit.setX(0.5 * (endsOfStrip.first.x() + endsOfStrip.second.x()));
......@@ -514,7 +533,17 @@ FPGATrackSimSGToRawHitsTool::readOfflineClusters(std::vector <FPGATrackSimCluste
clusterEquiv.setEventIndex(index);
else
clusterEquiv.setEventIndex(std::numeric_limits<long>::max());
clusterEquiv.setBarcode((long)(bestParent ? bestExtcode.uid() : std::numeric_limits<long>::max())); // FIXME
if (bestParent) {
unsigned int id2, barcode2;
bestExtcode.uniqueID(id2, barcode2);
clusterEquiv.setBarcode(id2);
}
else {
clusterEquiv.setBarcode(std::numeric_limits<unsigned long>::max());
}
clusterEquiv.setBarcodePt(static_cast<unsigned long>(std::ceil(bestParent ? bestParent->momentum().perp() : 0.)));
clusterEquiv.setParentageMask(parentMask.to_ulong());
clusterOut.setClusterEquiv(clusterEquiv);
......@@ -583,8 +612,15 @@ FPGATrackSimSGToRawHitsTool::readOfflineClusters(std::vector <FPGATrackSimCluste
else
clusterEquiv.setEventIndex(std::numeric_limits<long>::max());
if (bestParent) {
unsigned int id2, barcode2;
bestExtcode.uniqueID(id2, barcode2);
clusterEquiv.setBarcode(id2);
}
else {
clusterEquiv.setBarcode(std::numeric_limits<unsigned long>::max());
}
clusterEquiv.setBarcode((long)(bestParent ? bestExtcode.uid() : std::numeric_limits<long>::max())); // FIXME
clusterEquiv.setBarcodePt(static_cast<unsigned long>(std::ceil(bestParent ? bestParent->momentum().perp() : 0.)));
clusterEquiv.setParentageMask(parentMask.to_ulong());
clusterOut.setClusterEquiv(clusterEquiv);
......@@ -699,7 +735,11 @@ FPGATrackSimSGToRawHitsTool::readTruthTracks(std::vector <FPGATrackSimTruthTrack
tmpSGTrack.setPZ(track_truth_p * track_truth_costheta);
tmpSGTrack.setPDGCode(pdgcode);
tmpSGTrack.setStatus(particle->status());
tmpSGTrack.setBarcode(extBarcode2.uid()); // FIXME
unsigned int id2, barcode2;
extBarcode2.uniqueID(id2, barcode2);
tmpSGTrack.setBarcode(id2);
index_type index2, position2;
extBarcode2.eventIndex(index2, position2);
tmpSGTrack.setEventIndex(index2);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment