Skip to content

Commit

Permalink
Merge pull request #2 from skinnari/L1TK_CMSSW_11-1-0-pre4
Browse files Browse the repository at this point in the history
port recent changes from gitlab
  • Loading branch information
skinnari authored Mar 19, 2020
2 parents 8cb8b8a + bb583a7 commit 2eccc68
Show file tree
Hide file tree
Showing 16 changed files with 461 additions and 39 deletions.
1 change: 1 addition & 0 deletions L1Trigger/TrackFindingTMTT/src/L1KalmanComb.cc
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ void L1KalmanComb::printStubLayers( std::ostream &os, std::vector<const Stub *>
void L1KalmanComb::printStubCluster( std::ostream &os, const StubCluster * stubCluster, bool addReturn ) const {
os << "stub: ";
// os << "addr=" << stub << " ";
os << "index=" << stubCluster->stubs()[0]->index() << " ";
os << "layer=" << stubCluster->layerId() << " ";
os << "ring=" << stubCluster->endcapRing() << " ";
os << "r=" << stubCluster->r() << " ";
Expand Down
7 changes: 7 additions & 0 deletions L1Trigger/TrackFindingTMTT/test/MCsamples/1110/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
RelVal/ contains CMSSW 11.1.0.pre2 RelVal samples.

They use the D49 = T15 geometry.

They are made with the stub window sizes that you can find in L1Trigger/TrackTrigger/python/TTStubAlgorithmRegister_cfi.py .

Typical dataset name /RelVal*/CMSSW_11_1_0_pre2*mcRun4_realistic*D49*/GEN-SIM-DIGI-RAW
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_2026D49noPU-v1/20000/E69DE8B3-6117-A94F-A5A9-84A481F15013.root
/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_2026D49noPU-v1/20000/D5E4A5FE-993C-1848-8EC5-B61134EC23D8.root
/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_2026D49noPU-v1/20000/AEF88B74-5FA6-CD4A-AB7F-4017FB7388E7.root
/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_2026D49noPU-v1/20000/98728AF9-B10F-964B-AA44-746FE1B4E9E4.root
/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_2026D49noPU-v1/20000/96AEEF21-E8CC-2341-8AC6-F9816BFA0915.root
/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_2026D49noPU-v1/20000/8AC03800-3995-4943-8DD8-0A2DF92148D7.root
/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_2026D49noPU-v1/20000/7C9D3EE5-1DE8-BE44-A481-C6AA6167F06E.root
/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_2026D49noPU-v1/20000/4FC41F00-C32F-CF4E-B171-B15C72E195B6.root
/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_2026D49noPU-v1/20000/4A5CAF82-FBA2-C545-B253-A7A7CD7846D0.root
/store/relval/CMSSW_11_1_0_pre2/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v2_2026D49noPU-v1/20000/13492D88-2B80-1F44-8F5D-2BFF035C594E.root
100 changes: 100 additions & 0 deletions L1Trigger/TrackFindingTMTT/test/MCsamples/1110/RelVal/TTbar/PU200.txt

Large diffs are not rendered by default.

7 changes: 6 additions & 1 deletion L1Trigger/TrackFindingTMTT/test/tmtt_tf_analysis_cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,14 @@
elif GEOMETRY == "D41":
process.load('Configuration.Geometry.GeometryExtended2023D41Reco_cff')
process.load('Configuration.Geometry.GeometryExtended2023D41_cff')
elif GEOMETRY == "D49":
process.load('Configuration.Geometry.GeometryExtended2023D49Reco_cff')
process.load('Configuration.Geometry.GeometryExtended2023D49_cff')

process.load('Configuration.StandardSequences.MagneticField_cff')
process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
from Configuration.AlCa.GlobalTag import GlobalTag
process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:upgradePLS3', '')
process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase2_realistic', '')

process.load("FWCore.MessageLogger.MessageLogger_cfi")

Expand All @@ -42,6 +45,8 @@ def getTxtFile(txtFileName):
inputMCtxt = getTxtFile('MCsamples/1040/RelVal/TTbar/PU200.txt')
elif GEOMETRY == "D41":
inputMCtxt = getTxtFile('MCsamples/1060/RelVal/TTbar/PU200.txt')
elif GEOMETRY == "D49":
inputMCtxt = getTxtFile('MCsamples/1110/RelVal/TTbar/PU200.txt')

# Fastest to use a local copy ...
#inputMCtxt = getTxtFile('MCsamples/1040/RelVal/TTbar/localRAL/PU200.txt')
Expand Down
33 changes: 15 additions & 18 deletions L1Trigger/TrackFindingTracklet/interface/Constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,8 @@ static const std::string skimfile="";
static const bool dumppars=false;
static const bool dumpproj=false;

static const bool writeVerilog=false; //Write out Verilog mudules for TCs
static const bool writeHLS=false; //Write out HLS mudules for TCs
static const bool writeInvTable=false; //Write out tables of drinv and invt in tracklet calculator for Verilog module
static const bool writeHLSInvTable=false; //Write out tables of drinv and invt in tracklet calculator for HLS module

static const bool writeFitDerTable=false; //Write out track derivative tables

static const bool writeVerilog=false; //Write out auto-generated Verilog mudules used by TCs

//static const bool writeDTCLinks=false;
static const bool writeIL=false;
Expand Down Expand Up @@ -83,13 +78,26 @@ static const bool writeTC=false; //if true write out which memories track projet
static const bool writeNMatches=false;
static const bool writeHitEff=false;

// For HLS LUTs: makes test/*.txt files used to load LUTs in HLS code (for sector 0 only).
static const bool writeVMRTables = false; //write tables used by VMRouter
static const bool writeTETables=false;
static const bool writeVMTables=false;
static const bool writeMETables=false;
static const bool writeMCcuts=false;
static const bool writeHLSInvTable=false; //Write out tables of drinv and invt in tracklet calculator for HLS module
static const bool writeFitDerTable=false; //Write out track derivative tables
static const bool writeTripletTables=false; //Train and write the TED and TRE tables. N.B.: the tables
//cannot be applied while they are being trained, i.e.,
//this flag effectively turns off the cuts in
//TrackletEngineDisplaced and TripletEngine
static const bool writeHLS=false; //Write out auto-generated HLS modules used by TCs

static const bool writeCabling=false;
// For HLS testing: produce data/MemPrints/*/*.dat files of input/output data of processing modules.
static const unsigned int writememsect=3; // Restricts output to a single sector to speed up/reduce output size.
static const bool writememLinks = false; //Write files corresponding to data arriving on dtc links.
static const bool writemem = false; // Write files corresponding to memory modules.

static const bool writeCabling=false;
static const bool writeHitPattern=false;
static const bool writeTrackletParsOverlap=false;
static const bool writeTrackletParsDisk=false;
Expand Down Expand Up @@ -122,17 +130,6 @@ static const int nrinvBitsTable=3; //number of bits for tabulating rinv dependen
static const bool writetrace=false; //Print out details about startup
static const bool debug1=false; //Print detailed debug information about tracking
static const bool writeoutReal = false;
static const bool writememLinks = false; //Write files for dtc links
static const bool writemem = false; //Note that for 'full' detector this will open
//a LOT of files, and the program will run excruciatingly slow
static const unsigned int writememsect=3; //writemem only for this sector

static const bool writeVMRTables = false; //write tables used by VMRouter
static const bool writeTripletTables=false; //Train and write the TED and TRE tables. N.B.: the tables
//cannot be applied while they are being trained, i.e.,
//this flag effectively turns off the cuts in
//TrackletEngineDisplaced and TripletEngine


static const bool warnNoMem=false; //If true will print out warnings about missing projection memories

Expand Down
6 changes: 5 additions & 1 deletion L1Trigger/TrackFindingTracklet/interface/FitTrack.h
Original file line number Diff line number Diff line change
Expand Up @@ -1193,11 +1193,15 @@ class FitTrack:public ProcessBase{
std::vector<std::pair<int,int>> stubidslist;
if ((bestTracklet->getISeed()>=8 && nMatchesUniq>=1)||nMatchesUniq>=2) { //For seeds index >=8 (triplet seeds), there are three stubs associated from start.
countFit++;
#ifdef USEHYBRID
trackFitNew(bestTracklet,trackstublist,stubidslist);
#else
if (fakefit) {
trackFitFake(bestTracklet);
trackFitFake(bestTracklet,trackstublist,stubidslist);
} else {
trackFitNew(bestTracklet,trackstublist,stubidslist);
}
#endif
if(RemovalType=="merge") {
trackfit_->addStubList(trackstublist);
trackfit_->addStubidsList(stubidslist);
Expand Down
14 changes: 12 additions & 2 deletions L1Trigger/TrackFindingTracklet/interface/HybridFit.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@ class HybridFit{
}

void Fit(Tracklet* tracklet, std::vector<std::pair<Stub*,L1TStub*>> &trackstublist){
if (fakefit){
tracklet->setFitPars(tracklet->rinvapprox(),tracklet->phi0approx(),tracklet->d0approx(),tracklet->tapprox(),
tracklet->z0approx(),0.,tracklet->rinv(),tracklet->phi0(),tracklet->d0(),tracklet->t(),tracklet->z0(),0.,
tracklet->fpgarinv().value(),tracklet->fpgaphi0().value(),tracklet->fpgad0().value(),tracklet->fpgat().value(),
tracklet->fpgaz0().value(),0);
return;
}

std::vector<const TMTT::Stub*> TMTTstubs;
std::map<unsigned int, L1TStub*> L1StubIndices;
Expand Down Expand Up @@ -72,9 +79,12 @@ class HybridFit{
}

if (printDebugKF) cout <<kfphi<<" "<<kfr<<" "<<kfz<<" "<<kfbend<<" "<<kflayer<<" "<<isBarrel<<" "<<psmodule<<" "<<endl;
TMTT::Stub* TMTTstubptr = new TMTT::Stub(kfphi, kfr, kfz, kfbend, kflayer, psmodule, isBarrel, iphi, -alpha, &settings, nullptr, L1stubID, kf_phi_sec);
// For debugging, this should ideally be unique index in stub collection for nonant. But can't access that from here, so use this poor version instead.
unsigned int uniqueIndex = 1000*L1stubID + L1stubptr->allStubIndex();
TMTT::Stub* TMTTstubptr = new TMTT::Stub(kfphi, kfr, kfz, kfbend, kflayer, psmodule, isBarrel, iphi, -alpha, &settings, nullptr, uniqueIndex, kf_phi_sec);
TMTTstubs.push_back(TMTTstubptr);
L1StubIndices[L1stubID++] = L1stubptr;
L1StubIndices[uniqueIndex] = L1stubptr;
L1stubID++;
}

if (printDebugKF) cout << "Made TMTTstubs: trackstublist.size() = " << trackstublist.size()<< endl;
Expand Down
11 changes: 9 additions & 2 deletions L1Trigger/TrackFindingTracklet/interface/Sector.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,15 @@ class Sector{
}

~Sector() {
for (unsigned i = 0; i < TRE_.size(); i++)
delete TRE_[i];
// Clean up memory allocations to simplify memory-leak finding
for (const auto& p : Processes_) {
ProcessBase* proc = p.second;
delete proc;
}
for (const auto& m : Memories_) {
MemoryBase* mem = m.second;
delete mem;
}
}

bool addStub(L1TStub stub, string dtc) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,7 @@ class TrackletCalculator:public ProcessBase{
}

void addProjectionDisk(int disk,int iphi,TrackletProjectionsMemory* trackletprojs, Tracklet* tracklet){
if (layer_==2&&abs(disk)==4) return; //L3L4 projections to D3 are not used. Should be in configuration
if (iSeed_==1&&abs(disk)==4) return; //L2L3 projections to D3 are not used. Should be in configuration
if (trackletprojs==0) {
if (layer_==3&&abs(disk)==3) return; //L3L4 projections to D3 are not used.
if (warnNoMem) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ class TrackletEngineDisplaced:public ProcessBase{
readTables();
}

~TrackletEngineDisplaced(){
table_.clear();
}

void addOutput(MemoryBase* memory,string output){
if (writetrace) {
cout << "In "<<name_<<" adding output to "<<memory->getName()
Expand Down
2 changes: 2 additions & 0 deletions L1Trigger/TrackFindingTracklet/plugins/L1FPGATrackProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,8 @@ L1FPGATrackProducer::~L1FPGATrackProducer()
histimp->close();
}

delete[] sectors;

}

//////////
Expand Down
6 changes: 2 additions & 4 deletions L1Trigger/TrackFindingTracklet/test/L1TrackNtupleMaker_cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@
GEOMETRY = "D49"
#GEOMETRY = "D35" # <== to run on old tracker geometry, change flag "geomTkTDR" to *true* in ../interface/Constants.hh

# Specify L1 tracking algo ('HYBRID', 'HYBRID_DISPLACED', 'TMTT','HYBRID_FLOAT', 'TRACKLET_FLOAT'),
# (where HYBRID & HYBRID_DISPLACED both run either Tracklet or Hybrid emulation,
# depending on pragma in Constants.h. ).
# Specify L1 tracking algo ('HYBRID', 'HYBRID_DISPLACED', 'TMTT','HYBRID_FLOAT', 'TRACKLET_FLOAT')
L1TRKALGO = 'HYBRID'

# Write output dataset?
Expand Down Expand Up @@ -54,7 +52,7 @@
process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')

from Configuration.AlCa.GlobalTag import GlobalTag
process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:upgradePLS3', '')
process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase2_realistic', '')


############################################################
Expand Down
Loading

0 comments on commit 2eccc68

Please sign in to comment.