Skip to content
Snippets Groups Projects
Commit 86a32b05 authored by Ruth Pottgen's avatar Ruth Pottgen
Browse files

Merge branch '21.0-salva-S8' into '21.0'

Zmumu new Tree with IDTracks

See merge request !29655
parents 59cb5703 4a322a0e
24 merge requests!46457Draft: Adding the tools to run over data,!46454Draft: Adding the tools to be able to run over data,!45045WIP: Include another condition for hit merging in FCS_StepInfoSD.cxx,!45043Merge branch 'Update-DAOD_IDNCB' into '21.2',!44869Draft: Update to candidate store,!4217921.9-first_steps-InDetTrackingGeometryXML,!42171Add LAr cell DQ plots to UPC stream,!40342WIP: ATR-22546 - add missing trigger to MC16a,!39162Draft: Insert BCM' support,!38765Bis78 cabling,!37483Fix in monitoring of Pixel FE errors,!36893Fix size of RPC active region in BIS78 and strip material,!3645821.9: Improving material map description (ATLITKSW-127),!36293WIP pixel updates,!34993KF-input adding jXERHO to the AOD outputs,!34864LH rings in front ot HR rigs,!34763Fix L1_4jJ15.0ETA25 item definition (ATR-21261),!3473421.0 fix dq servers,!33996WIP: Correct MM zpositions,!3291021.3 salva s0,!31887Merge 21.3.19 into 21.9,!31345Add HEC sampling fractions macros,!31109Merge 21.0.109 into 21.3,!29655Zmumu new Tree with IDTracks
#!/usr/bin/env python
m_year = 2017
m_storingFolder = ""
......@@ -21,6 +20,7 @@ m_userRun = 0
m_dataType = "DESDM_MCP"
m_dataProject = "data17_13TeV"
m_userFiles = 0 # this means all the files
m_userFilesPerJob = 0 #this means let panda distribute the files
m_amitag = "%"
m_physicsType = "physics_Main"
m_mcDataSetName = "mc16_13TeV.361107.PowhegPythia8EvtGen_AZNLOCTEQ6L1_Zmumu.recon.ESD.e3601_s3126_r10201"
......@@ -522,15 +522,17 @@ def getGridSubmissionCommand(runNumber, infoFromAMI):
if ("NONE" in theOutput):
sys.exit(" <acZmumu> ** ERROR ** no output available for the grid submission command. ** STOP execution **")
# warning: if one wants to limit the file per job just add to the options: --nFilesPerJob Nfiles
#theOptions = "--nfiles %d --useShortLivedReplicas --forceStaged --site=ANALY_ECDF_SL7" %(infoFromAMI[runNumber]["nfiles"])
# warning: if one wants to limit the number of files per job just add to the options: --nFilesPerJob Nfiles
theOptions = "NONE"
if (runNumber>0):
theOptions = "--nfiles %d --useShortLivedReplicas --forceStaged" %(infoFromAMI[runNumber]["nfiles"])
theOptions = "--nfiles %d --forceStaged" %(infoFromAMI[runNumber]["nfiles"])
else:
if ("NONE" not in m_userDataSet):
theOptions = "--useShortLivedReplicas --forceStaged"
theOptions = " --forceStaged" # "--useShortLivedReplicas"
if (m_userFilesPerJob > 0 ):
theOptions = "%s --nFilesPerJob %d" % (theOptions, m_userFilesPerJob)
theExtraOptions = ""
if (len(m_workDirPlatform)>0):
......@@ -583,10 +585,13 @@ def welcomeBanner ():
print (" ** max Run: %d" %m_lastRun)
print (" ** physics type: %s" %m_physicsType)
print (" ** data type: %s" %m_dataType)
print (" ** set type: %s" %m_reconmerge)
if (m_userFiles == 0):
print (" ** use all available files ")
if (m_userFiles > 0):
print (" ** user requested files: %d" %m_userFiles)
if (m_userFilesPerJob > 0):
print (" ** user requested files per job: %d" %m_userFilesPerJob)
print (" ** AMI tag: %s" %m_amitag)
print " ** script: %s" %m_scriptName
if ("NONE" not in m_userDataSet):
......@@ -613,9 +618,11 @@ def optParsing():
p_userRun = m_userRun
p_dataType = m_dataType
p_userFiles = m_userFiles
p_userFilesPerJob = m_userFilesPerJob
p_amitag = m_amitag
p_dataProject = m_dataProject
p_physicsType = m_physicsType
p_reconmerge = m_reconmerge
p_scriptName = m_scriptName
p_userDataSet = m_userDataSet
......@@ -629,9 +636,11 @@ def optParsing():
parser.add_option("--lastRun", dest="p_lastRun", help="Last run number (inclusive). Default %s" %(p_lastRun), default = p_lastRun)
parser.add_option("--minEvents", dest="p_minEvents", help="Minimum number of events. Default %s" %(p_minEvents), default = p_minEvents)
parser.add_option("--nFiles", dest="p_userFiles", help="User defined number of files. Default %s = all the available files" %(p_userFiles), default = p_userFiles)
parser.add_option("--run", dest="p_userRun", help="Run number in case of targetting a single run. Default %s" %(p_userRun), default = p_userRun)
parser.add_option("--nFilesPerJob", dest="p_userFilesPerJob", help="User defined number of files per job. Default %s = -> Panda decides" %(p_userFilesPerJob), default = p_userFilesPerJob)
parser.add_option("--run", dest="p_userRun", help="Run number in case of targetting a single run. Default: %s" %(p_userRun), default = p_userRun)
parser.add_option("--physicsType", dest="p_physicsType", help="Physics type to use (physics_Main, Hardprobes...) Default %s" %(p_physicsType), default = p_physicsType)
parser.add_option("--script", dest="p_scriptName", help="Name of the python script to be executed. Default %s" %p_scriptName, default = p_scriptName)
parser.add_option("--script", dest="p_scriptName", help="Name of the python script to be executed. Default: %s" %p_scriptName, default = p_scriptName)
parser.add_option("--setType", dest="p_reconmerge", help="Set type: recon, merge, deriv. Default: %s" %p_reconmerge, default = p_reconmerge)
parser.add_option("--userLabel", dest="p_userLabel", help="User defined label. Default %s" %(p_userLabel), default = p_userLabel)
(config, sys.argv[1:]) = parser.parse_args(sys.argv[1:])
......@@ -684,11 +693,13 @@ if __name__ == '__main__':
m_firstRun = m_userRun
m_lastRun = m_userRun
m_userFiles = int(config.p_userFiles)
m_userFilesPerJob = int(config.p_userFilesPerJob)
m_amitag = config.p_amitag
m_dataProject = config.p_dataProject
m_physicsType = config.p_physicsType
m_scriptName = config.p_scriptName
m_userDataSet = config.p_userDataSet
m_reconmerge = config.p_reconmerge
welcomeBanner ()
preliminaries ()
......
......@@ -61,7 +61,7 @@ print m_TrackSelectorTool_NoCut
m_TrackSelectorTool_TP = InDet__InDetTrackSelectionTool(name = "InDetTrackSelectionToolTightPrimary",
UseTrkTrackTools = True,
CutLevel = "TightPrimary",
minPt = 4000,
minPt = 20000,#4000
minNPixelHitsPhysical = 2,
minNSctHitsPhysical = 2,
TrackSummaryTool = InDetTrackSummaryTool,
......@@ -95,12 +95,11 @@ print " == runzmumu_script == TPSelection "
print TPSelection
allSelection = InDetAlignMon__TrackSelectionTool(name = "InDetAlignMonAlignTrackSelectionTool",
PassAllTracks = True, ## Uncomment this line to bypass track slection
PrimVtxContainerName = InDetKeys.xAODVertexContainer(),
UseIDTrackSelectionTool = True,
IDTrackSelectionTool = m_TrackSelectorTool_NoCut,
#TrackSelectorTool = InDetDetailedTrackSelector_Default
)
PassAllTracks = True, ## Uncomment this line to bypass track slection
PrimVtxContainerName = InDetKeys.xAODVertexContainer(),
UseIDTrackSelectionTool = True,
IDTrackSelectionTool = m_TrackSelectorTool_TP
)
ToolSvc += allSelection
......@@ -110,7 +109,8 @@ from InDetAlignmentMonitoring.InDetAlignmentMonitoringConf import IDAlignMonEffi
for trackCollection in trackCollections:
theTrackSelection = LPSelection
#theTrackSelection = LPSelection
theTrackSelection = TPSelection
if ("CombinedInDetTracks" in trackCollection):
theTrackSelection = TPSelection
print " == runzmumu_script == monitoring for ",trackCollection," --> ",theTrackSelection
......@@ -136,6 +136,7 @@ for trackCollection in trackCollections:
maxTRTResidualWindow = 0.550,
NSplitMap = 4,
RangeOfPullHistos = 5,
PtRange = 50., # GeV
applyHistWeight = useWeightInMonitoring,
hWeightHistName = "h_eventMuVsTrkEta",
hWeightInFileName = "usr/WorkDir/21.0.68/InstallArea/x86_64-slc6-gcc62-opt/src/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/share/hWeight.root"
......
......@@ -62,16 +62,16 @@ FourMuonEvent::~FourMuonEvent()
//==================================================================================
void FourMuonEvent::Init()
{
if(m_doDebug) { std::cout << " * FourMuonEvent::Init * START *" << std::endl; }
if (m_doDebug) { std::cout << " * FourMuonEvent::Init * START *" << std::endl; }
m_xMuonID.Init();
m_xElecID.Init();
if(m_doDebug && m_workAsFourMuons) { std::cout << " * FourMuonEvent::Init * working as 4 muons *" << std::endl; }
if(m_doDebug && m_workAsFourElectrons) { std::cout << " * FourMuonEvent::Init * working as 4 electrons *" << std::endl; }
if(m_doDebug && m_workAsFourLeptons) { std::cout << " * FourMuonEvent::Init * working as 4 leptons *" << std::endl; }
if (m_doDebug && m_workAsFourMuons) { std::cout << " * FourMuonEvent::Init * working as 4 muons *" << std::endl; }
if (m_doDebug && m_workAsFourElectrons) { std::cout << " * FourMuonEvent::Init * working as 4 electrons *" << std::endl; }
if (m_doDebug && m_workAsFourLeptons) { std::cout << " * FourMuonEvent::Init * working as 4 leptons *" << std::endl; }
PARENT::Init();
if(m_doDebug) { std::cout << " * FourMuonEvent::Init * Completed * " << std::endl; }
if (m_doDebug) { std::cout << " * FourMuonEvent::Init * Completed * " << std::endl; }
}
//==================================================================================
......@@ -79,7 +79,7 @@ bool FourMuonEvent::Reco()
{
bool thisdebug = false;
m_eventCount++;
if(m_doDebug || thisdebug) { std::cout << " * FourMuonEvent::Reco * STARTING * event count " << m_eventCount << std::endl; }
if (m_doDebug || thisdebug) { std::cout << " * FourMuonEvent::Reco * STARTING * event count " << m_eventCount << std::endl; }
// Clear out the previous events record.
this->Clear();
......@@ -87,13 +87,13 @@ bool FourMuonEvent::Reco()
// if muons are requested
if (m_workAsFourMuons || m_workAsFourLeptons) {
if(m_doDebug){ std::cout << " * FourMuonEvent::Reco * retrieving xAOD::MuonContainer " << m_container << std::endl; }
if (m_doDebug || thisdebug) {std::cout << " * FourMuonEvent::Reco * retrieving xAOD::MuonContainer " << m_container << std::endl; }
const xAOD::MuonContainer* pxMuonContainer = PerfMonServices::getContainer<xAOD::MuonContainer>( m_container );
// check if muon container does exist
if (pxMuonContainer != nullptr) {
if (m_doDebug) {
if (m_doDebug || thisdebug) {
std::cout << " * FourMuonEvent::Reco * eventCount " << m_eventCount
<< " track list has "<< pxMuonContainer->size()
<< " combined muons in container " << m_container
......@@ -610,10 +610,10 @@ bool FourMuonEvent::EventSelection(ZTYPE eType)
}
default:
if (m_muonpos1 >= 0) leadingMuonPt = m_pxRecMuon[m_muonpos1]->pt();
if (m_muonpos2 >= 0) secondMuonPt = m_pxRecMuon[m_muonpos2]->pt();
if (m_muonneg1 >= 0) thirdMuonPt = m_pxRecMuon[m_muonneg1]->pt();
if (m_muonneg2 >= 0) fourthMuonPt = m_pxRecMuon[m_muonneg2]->pt();
if (m_muonpos1 >= 0) leadingMuonPt = m_pxIDTrack[m_muonpos1]->pt();
if (m_muonpos2 >= 0) secondMuonPt = m_pxIDTrack[m_muonpos2]->pt();
if (m_muonneg1 >= 0) thirdMuonPt = m_pxIDTrack[m_muonneg1]->pt();
if (m_muonneg2 >= 0) fourthMuonPt = m_pxIDTrack[m_muonneg2]->pt();
} // end switch
// up to here the leading and second pt are not really in the right order.
......@@ -912,6 +912,7 @@ void FourMuonEvent::Clear()
//==================================================================================
void FourMuonEvent::RecordMuon( const xAOD::Muon* pxMuon )
{
bool thisdebug = false;
// if(m_doDebug){ std::cout <<" * FourMuonEvent * RecordMuon * started "<< std::endl;}
// This shouldn't really ever happen but just in case.
if ( !pxMuon ) {
......@@ -922,20 +923,29 @@ void FourMuonEvent::RecordMuon( const xAOD::Muon* pxMuon )
if ( m_numberOfFullPassMuons < NUM_MUONS ) {
// The main Muon
m_pxRecMuon[m_numberOfFullPassMuons] = pxMuon;
if (thisdebug) {
std::cout <<" * FourMuonEvent * RecordMuon * m_pxRecMuon for this muon--> pt "<< m_pxRecMuon[m_numberOfFullPassMuons]->pt() << std::endl;
}
const xAOD::TrackParticle* pxMSTrack = pxMuon->trackParticle(xAOD::Muon::MuonSpectrometerTrackParticle);
if (!pxMSTrack) {
if(m_doDebug){ std::cout <<" * FourMuonEvent * RecordMuon * bad pxMSmuon --> EXIT "<< std::endl;}
if (m_doDebug){ std::cout <<" * FourMuonEvent * RecordMuon * bad pxMSmuon --> EXIT "<< std::endl;}
return;
}
m_pxMSTrack[m_numberOfFullPassMuons] = pxMSTrack;
if (thisdebug) {
std::cout <<" * FourMuonEvent * RecordMuon * m_pxMSTrack for this muon--> pt "<< m_pxMSTrack[m_numberOfFullPassMuons]->pt() << std::endl;
}
// ID muon
const xAOD::TrackParticle* pxIDTrack = pxMuon->trackParticle(xAOD::Muon::InnerDetectorTrackParticle);
if (!pxIDTrack) {
if(m_doDebug){ std::cout <<" * FourMuonEvent * RecordMuon * bad pxIDTrack for this muon--> EXIT "<< std::endl;}
if (m_doDebug){ std::cout <<" * FourMuonEvent * RecordMuon * bad pxIDTrack for this muon--> EXIT "<< std::endl;}
return;
}
m_pxIDTrack[m_numberOfFullPassMuons] = pxIDTrack;
if (thisdebug) {
std::cout <<" * FourMuonEvent * RecordMuon * m_pxIDTrack for this muon--> pt "<< m_pxIDTrack[m_numberOfFullPassMuons]->pt() << std::endl;
}
//
++m_numberOfFullPassMuons;
}
......@@ -1340,8 +1350,11 @@ void FourMuonEvent::SetSecondMuonPtCut (double newvalue)
//==================================================================================
void FourMuonEvent::OrderMuonList()
{
if(m_doDebug){ std::cout << " * FourMuonEvent::OrderMuonList * -- start -- " << std::endl
<< " #muons: " << m_numberOfFullPassMuons<< std::endl;}
// Salva: 20/January/2020 RecMuon -> IDTrack
bool thisdebug = false;
if (m_doDebug || thisdebug) {std::cout << " * FourMuonEvent::OrderMuonList * -- start -- " << std::endl
<< " #muons: " << m_numberOfFullPassMuons<< std::endl;}
int muPlus1Id = -9;
int muPlus2Id = -9;
......@@ -1365,36 +1378,36 @@ void FourMuonEvent::OrderMuonList()
<< " and pt= " << m_pxRecMuon[imuon]->pt()
<< std::endl;
}
if (m_pxRecMuon[imuon] != nullptr) {
if (m_pxIDTrack[imuon] != nullptr) {
if (m_pxRecMuon[imuon]->charge()==1) { // positive muon
if (m_pxIDTrack[imuon]->charge()==1) { // positive muon
muposcount++;
if (m_pxRecMuon[imuon]->pt()> muPlus1Pt) {
if (m_pxIDTrack[imuon]->pt()> muPlus1Pt) {
// store 1st in 2nd
muPlus2Pt = muPlus1Pt;
muPlus2Id = muPlus1Id;
// now store the new one in 1st place
muPlus1Pt = m_pxRecMuon[imuon]->pt();
muPlus1Pt = m_pxIDTrack[imuon]->pt();
muPlus1Id = imuon;
}
else if (m_pxRecMuon[imuon]->pt()> muPlus2Pt) {
else if (m_pxIDTrack[imuon]->pt()> muPlus2Pt) {
// store the new one in 2nd place
muPlus2Pt = m_pxRecMuon[imuon]->pt();
muPlus2Pt = m_pxIDTrack[imuon]->pt();
muPlus2Id = imuon;
}
}
// Negative muons
if (m_pxRecMuon[imuon]->charge()==-1) {
if (m_pxIDTrack[imuon]->charge()==-1) {
munegcount++;
if(m_pxRecMuon[imuon]->pt()> muMinus1Pt) {
if(m_pxIDTrack[imuon]->pt()> muMinus1Pt) {
// store 1st in 2nd
muMinus2Pt = muMinus1Pt;
muMinus2Id = muMinus1Id;
muMinus1Pt = m_pxRecMuon[imuon]->pt();
muMinus1Pt = m_pxIDTrack[imuon]->pt();
muMinus1Id = imuon;
}
else if(m_pxRecMuon[imuon]->pt()> muMinus2Pt) {
muMinus2Pt = m_pxRecMuon[imuon]->pt();
muMinus2Pt = m_pxIDTrack[imuon]->pt();
muMinus2Id = imuon;
}
}
......@@ -1424,7 +1437,7 @@ void FourMuonEvent::OrderMuonList()
m_muon1 = m_muonpos1; // to be deleted when no more m_muon is left
m_muon2 = m_muonneg1; // to be deleted when no more m_muon is left
if ((m_doDebug) && m_numberOfFullPassMuons >= 2){
if ((m_doDebug || thisdebug) && m_numberOfFullPassMuons >= 2){
std::cout << " * FourMuonEvent::OrderMuonList * taking " << m_numberOfFullPassMuons << " muons from the input list of " << nMuonsAtEntry << " muons: " << std::endl;
if (muMinus1Id >= 0) std::cout << " leading mu-: " << muMinus1Id << " Pt = " << muMinus1Pt << std::endl;
if (muMinus2Id >= 0) std::cout << " second mu-: " << muMinus2Id << " Pt = " << muMinus2Pt << std::endl;
......@@ -1432,10 +1445,10 @@ void FourMuonEvent::OrderMuonList()
if (muPlus2Id >= 0) std::cout << " second mu+: " << muPlus2Id << " Pt = " << muPlus2Pt << std::endl;
}
else {
if(m_doDebug) std::cout << " * FourMuonEvent::OrderMuonList * This event has less than 2 muons :(" << std::endl;
if (m_doDebug) std::cout << " * FourMuonEvent::OrderMuonList * This event has less than 2 muons :(" << std::endl;
}
if(m_doDebug) std::cout << " * FourMuonEvent::OrderMuonList * completed * m_numberOfFullPassMuons= " << m_numberOfFullPassMuons << std::endl;
if (m_doDebug || thisdebug) std::cout << " * FourMuonEvent::OrderMuonList * completed * m_numberOfFullPassMuons= " << m_numberOfFullPassMuons << std::endl;
return;
}
......
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