CMS 3D CMS Logo

offlineValidationTemplates.py
Go to the documentation of this file.
1 ######################################################################
2 ######################################################################
3 offlineTemplate = """
4 process.oneGoodVertexFilter = cms.EDFilter("VertexSelector",
5  src = cms.InputTag("offlinePrimaryVertices"),
6  cut = cms.string("!isFake && ndof > 4 && abs(z) <= 15 && position.Rho <= 2"), # tracksSize() > 3 for the older cut
7  filter = cms.bool(True), # otherwise it won't filter the events, just produce an empty vertex collection.
8  )
9 
10 
11 
12 process.FilterGoodEvents=cms.Sequence(process.oneGoodVertexFilter)
13 
14 
15 process.noScraping= cms.EDFilter("FilterOutScraping",
16  src=cms.InputTag(".oO[TrackCollection]Oo."),
17  applyfilter = cms.untracked.bool(True),
18  debugOn = cms.untracked.bool(False), ## Or 'True' to get some per-event info
19  numtrack = cms.untracked.uint32(10),
20  thresh = cms.untracked.double(0.25)
21  )
22 ####################################
23 
24 
25  ##
26  ## Load and Configure OfflineValidation and Output File
27  ##
28 process.load("Alignment.OfflineValidation.TrackerOfflineValidation_.oO[offlineValidationMode]Oo._cff")
29 process.TrackerOfflineValidation.oO[offlineValidationMode]Oo..Tracks = 'FinalTrackRefitter'
30 process.TrackerOfflineValidation.oO[offlineValidationMode]Oo..trajectoryInput = 'FinalTrackRefitter'
31 process.TrackerOfflineValidation.oO[offlineValidationMode]Oo..moduleLevelHistsTransient = .oO[offlineModuleLevelHistsTransient]Oo.
32 process.TrackerOfflineValidation.oO[offlineValidationMode]Oo..moduleLevelProfiles = .oO[offlineModuleLevelProfiles]Oo.
33 process.TrackerOfflineValidation.oO[offlineValidationMode]Oo..stripYResiduals = .oO[stripYResiduals]Oo.
34 process.TrackerOfflineValidation.oO[offlineValidationMode]Oo..maxTracks = .oO[maxtracks]Oo./ .oO[parallelJobs]Oo.
35 process.TrackerOfflineValidation.oO[offlineValidationMode]Oo..chargeCut = .oO[chargeCut]Oo.
36 """
37 
38 OfflineValidationSequence = "process.seqTrackerOfflineValidation.oO[offlineValidationMode]Oo."
39 
40 
41 ######################################################################
42 ######################################################################
43 mergeOfflineParJobsTemplate="""
44 #include "Alignment/OfflineValidation/scripts/merge_TrackerOfflineValidation.C"
45 
46 int TkAlOfflineJobsMerge(TString pars, TString outFile)
47 {
48 // load framework lite just to find the CMSSW libs...
49 gSystem->Load("libFWCoreFWLite");
50 FWLiteEnabler::enable();
51 
52 return hadd(pars, outFile);
53 }
54 """
55 
56 
57 ######################################################################
58 ######################################################################
59 offlineFileOutputTemplate = """
60 process.TFileService.fileName = '.oO[outputFile]Oo.'
61 """
62 
63 
64 ######################################################################
65 ######################################################################
66 offlineDqmFileOutputTemplate = """
67 process.TrackerOfflineValidationSummary.oO[offlineValidationMode]Oo..removeModuleLevelHists = .oO[offlineModuleLevelHistsTransient]Oo.
68 process.DqmSaverTkAl.workflow = '.oO[workflow]Oo.'
69 process.DqmSaverTkAl.dirName = '.oO[workdir]Oo./.'
70 process.DqmSaverTkAl.forceRunNumber = .oO[firstRunNumber]Oo.
71 """
72 
73 
74 ######################################################################
75 ######################################################################
76 extendedValidationExecution="""
77 #run extended offline validation scripts
78 echo -e "\n\nRunning extended offline validation"
79 
80 cp .oO[extendedValScriptPath]Oo. .
81 root -x -b -q -l TkAlExtendedOfflineValidation.C
82 
83 """
84 
85 
86 ######################################################################
87 ######################################################################
88 extendedValidationTemplate="""
89 #include "Alignment/OfflineValidation/macros/PlotAlignmentValidation.C"
90 #include "FWCore/FWLite/interface/FWLiteEnabler.h"
91 
92 void TkAlExtendedOfflineValidation()
93 {
94  TkAlStyle::legendheader = ".oO[legendheader]Oo.";
95  TkAlStyle::legendoptions = ".oO[legendoptions]Oo.";
96  TkAlStyle::set(.oO[publicationstatus]Oo., .oO[era]Oo., ".oO[customtitle]Oo.", ".oO[customrighttitle]Oo.");
97  bool bigtext = .oO[bigtext]Oo.;
98  gStyle->SetTitleH ( 0.07 );
99  gStyle->SetTitleW ( 1.00 );
100  gStyle->SetTitleFont ( 132 );
101  // load framework lite just to find the CMSSW libs...
102  gSystem->Load("libFWCoreFWLite");
103  FWLiteEnabler::enable();
104 
105  PlotAlignmentValidation p(bigtext);
106 .oO[PlottingInstantiation]Oo.
107  p.setOutputDir(".oO[datadir]Oo./.oO[PlotsDirName]Oo.");
108  p.useFitForDMRplots(.oO[usefit]Oo.);
109  p.setTreeBaseDir(".oO[OfflineTreeBaseDir]Oo.");
110  p.plotDMR(".oO[DMRMethod]Oo.",.oO[DMRMinimum]Oo.,".oO[DMROptions]Oo.");
111  p.plotSurfaceShapes(".oO[SurfaceShapes]Oo.");
112  p.plotChi2("root://eoscms//eos/cms/store/group/alca_trackeralign/AlignmentValidation/.oO[eosdir]Oo./.oO[validationId]Oo._result.root");
113  vector<int> moduleids = {.oO[moduleid]Oo.};
114  for (auto moduleid : moduleids) {
115  p.residual_by_moduleID(moduleid);
116  }
117 }
118 """