Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-08-15 22:40:11

0001 ######################################################################
0002 ######################################################################
0003 offlineTemplate = """
0004 process.oneGoodVertexFilter = cms.EDFilter("VertexSelector",
0005                                            src = cms.InputTag("offlinePrimaryVertices"),
0006                                            cut = cms.string("!isFake && ndof > 4 && abs(z) <= 15 && position.Rho <= 2"), # tracksSize() > 3 for the older cut
0007                                            filter = cms.bool(True),   # otherwise it won't filter the events, just produce an empty vertex collection.
0008                                            )
0009 
0010 
0011 
0012 process.FilterGoodEvents=cms.Sequence(process.oneGoodVertexFilter)
0013 
0014 
0015 process.noScraping= cms.EDFilter("FilterOutScraping",
0016                                  src=cms.InputTag(".oO[TrackCollection]Oo."),
0017                                  applyfilter = cms.untracked.bool(True),
0018                                  debugOn = cms.untracked.bool(False), ## Or 'True' to get some per-event info
0019                                  numtrack = cms.untracked.uint32(10),
0020                                  thresh = cms.untracked.double(0.25)
0021                                  )
0022 ####################################
0023 
0024 # Use compressions settings of TFile
0025 # see https://root.cern.ch/root/html534/TFile.html#TFile:SetCompressionSettings
0026 # settings = 100 * algorithm + level
0027 # level is from 1 (small) to 9 (large compression)
0028 # algo: 1 (ZLIB), 2 (LMZA)
0029 # see more about compression & performance: https://root.cern.ch/root/html534/guides/users-guide/InputOutput.html#compression-and-performance
0030 compressionSettings = 207
0031 
0032  ##
0033  ## Load and Configure OfflineValidation and Output File
0034  ##
0035 process.load("Alignment.OfflineValidation.TrackerOfflineValidation_.oO[offlineValidationMode]Oo._cff")
0036 process.TrackerOfflineValidation.oO[offlineValidationMode]Oo..compressionSettings = compressionSettings
0037 process.TrackerOfflineValidation.oO[offlineValidationMode]Oo..Tracks = 'FinalTrackRefitter'
0038 process.TrackerOfflineValidation.oO[offlineValidationMode]Oo..trajectoryInput = 'FinalTrackRefitter'
0039 process.TrackerOfflineValidation.oO[offlineValidationMode]Oo..moduleLevelHistsTransient = .oO[offlineModuleLevelHistsTransient]Oo.
0040 process.TrackerOfflineValidation.oO[offlineValidationMode]Oo..moduleLevelProfiles = .oO[offlineModuleLevelProfiles]Oo.
0041 process.TrackerOfflineValidation.oO[offlineValidationMode]Oo..stripYResiduals = .oO[stripYResiduals]Oo.
0042 process.TrackerOfflineValidation.oO[offlineValidationMode]Oo..maxTracks = int(.oO[maxtracks]Oo./.oO[parallelJobs]Oo.)
0043 process.TrackerOfflineValidation.oO[offlineValidationMode]Oo..chargeCut = .oO[chargeCut]Oo.
0044 """
0045 
0046 OfflineValidationSequence = "process.seqTrackerOfflineValidation.oO[offlineValidationMode]Oo."
0047 
0048 
0049 ######################################################################
0050 ######################################################################
0051 mergeOfflineParJobsTemplate="""
0052 #include "Alignment/OfflineValidation/scripts/merge_TrackerOfflineValidation.C"
0053 
0054 int TkAlOfflineJobsMerge(TString pars, TString outFile)
0055 {
0056 // load framework lite just to find the CMSSW libs...
0057 gSystem->Load("libFWCoreFWLite");
0058 FWLiteEnabler::enable();
0059 
0060 return hadd(pars, outFile);
0061 }
0062 """
0063 
0064 
0065 ######################################################################
0066 ######################################################################
0067 offlineFileOutputTemplate = """
0068 process.TFileService.fileName = '.oO[outputFile]Oo.'
0069 """
0070 
0071 
0072 ######################################################################
0073 ######################################################################
0074 offlineDqmFileOutputTemplate = """
0075 process.DqmSaverTkAl.workflow = '.oO[workflow]Oo.'
0076 process.DqmSaverTkAl.dirName = '.oO[workdir]Oo./.'
0077 process.DqmSaverTkAl.forceRunNumber = .oO[firstRunNumber]Oo.
0078 """
0079 
0080 
0081 ######################################################################
0082 ######################################################################
0083 extendedValidationExecution="""
0084 #run extended offline validation scripts
0085 echo -e "\n\nRunning extended offline validation"
0086 
0087 cp .oO[extendedValScriptPath]Oo. .
0088 root -x -b -q -l TkAlExtendedOfflineValidation.C
0089 
0090 """
0091 
0092 
0093 ######################################################################
0094 ######################################################################
0095 extendedValidationTemplate="""
0096 #include "Alignment/OfflineValidation/macros/PlotAlignmentValidation.C"
0097 #include "FWCore/FWLite/interface/FWLiteEnabler.h"
0098 
0099 void TkAlExtendedOfflineValidation()
0100 {
0101   TkAlStyle::legendheader = ".oO[legendheader]Oo.";
0102   TkAlStyle::legendoptions = ".oO[legendoptions]Oo.";
0103   TkAlStyle::set(.oO[publicationstatus]Oo., .oO[era]Oo., ".oO[customtitle]Oo.", ".oO[customrighttitle]Oo.");
0104   bool bigtext = .oO[bigtext]Oo.;
0105   gStyle->SetTitleH        ( 0.07 );
0106   gStyle->SetTitleW        ( 1.00 );
0107   gStyle->SetTitleFont     (  132 );
0108   // load framework lite just to find the CMSSW libs...
0109   gSystem->Load("libFWCoreFWLite");
0110   FWLiteEnabler::enable();
0111 
0112   PlotAlignmentValidation p(bigtext);
0113 .oO[PlottingInstantiation]Oo.
0114   p.setOutputDir(".oO[datadir]Oo./.oO[PlotsDirName]Oo.");
0115   p.useFitForDMRplots(.oO[usefit]Oo.);
0116   p.setTreeBaseDir(".oO[OfflineTreeBaseDir]Oo.");
0117   p.plotDMR(".oO[DMRMethod]Oo.",.oO[DMRMinimum]Oo.,".oO[DMROptions]Oo.");
0118   p.plotSurfaceShapes(".oO[SurfaceShapes]Oo.");
0119   p.plotChi2("root://eoscms//eos/cms/store/group/alca_trackeralign/AlignmentValidation/.oO[eosdir]Oo./.oO[validationId]Oo._result.root");
0120   vector<int> moduleids = {.oO[moduleid]Oo.};
0121   for (auto moduleid : moduleids) {
0122     p.residual_by_moduleID(moduleid);
0123   }
0124 }
0125 """