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 """
36 
37 OfflineValidationSequence = "process.seqTrackerOfflineValidation.oO[offlineValidationMode]Oo."
38 
39 
40 ######################################################################
41 ######################################################################
42 mergeOfflineParJobsTemplate="""
43 #include "Alignment/OfflineValidation/scripts/merge_TrackerOfflineValidation.C"
44 
45 int TkAlOfflineJobsMerge(TString pars, TString outFile)
46 {
47 // load framework lite just to find the CMSSW libs...
48 gSystem->Load("libFWCoreFWLite");
49 FWLiteEnabler::enable();
50 
51 return hadd(pars, outFile);
52 }
53 """
54 
55 
56 ######################################################################
57 ######################################################################
58 offlineFileOutputTemplate = """
59 process.TFileService.fileName = '.oO[outputFile]Oo.'
60 """
61 
62 
63 ######################################################################
64 ######################################################################
65 offlineDqmFileOutputTemplate = """
66 process.TrackerOfflineValidationSummary.oO[offlineValidationMode]Oo..removeModuleLevelHists = .oO[offlineModuleLevelHistsTransient]Oo.
67 process.DqmSaverTkAl.workflow = '.oO[workflow]Oo.'
68 process.DqmSaverTkAl.dirName = '.oO[workdir]Oo./.'
69 process.DqmSaverTkAl.forceRunNumber = .oO[firstRunNumber]Oo.
70 """
71 
72 
73 ######################################################################
74 ######################################################################
75 extendedValidationExecution="""
76 #run extended offline validation scripts
77 echo -e "\n\nRunning extended offline validation"
78 
79 rfcp .oO[extendedValScriptPath]Oo. .
80 root -x -b -q -l TkAlExtendedOfflineValidation.C
81 
82 """
83 
84 
85 ######################################################################
86 ######################################################################
87 extendedValidationTemplate="""
88 #include "Alignment/OfflineValidation/macros/PlotAlignmentValidation.C"
89 #include "FWCore/FWLite/interface/FWLiteEnabler.h"
90 
91 void TkAlExtendedOfflineValidation()
92 {
93  TkAlStyle::legendheader = ".oO[legendheader]Oo.";
94  TkAlStyle::legendoptions = ".oO[legendoptions]Oo.";
95  TkAlStyle::set(.oO[publicationstatus]Oo., .oO[era]Oo., ".oO[customtitle]Oo.", ".oO[customrighttitle]Oo.");
96  bool bigtext = .oO[bigtext]Oo.;
97  gStyle->SetTitleH ( 0.07 );
98  gStyle->SetTitleW ( 1.00 );
99  gStyle->SetTitleFont ( 132 );
100  // load framework lite just to find the CMSSW libs...
101  gSystem->Load("libFWCoreFWLite");
102  FWLiteEnabler::enable();
103 
104  PlotAlignmentValidation p(bigtext);
105 .oO[PlottingInstantiation]Oo.
106  p.setOutputDir(".oO[datadir]Oo./.oO[PlotsDirName]Oo.");
107  p.useFitForDMRplots(.oO[usefit]Oo.);
108  p.setTreeBaseDir(".oO[OfflineTreeBaseDir]Oo.");
109  p.plotDMR(".oO[DMRMethod]Oo.",.oO[DMRMinimum]Oo.,".oO[DMROptions]Oo.");
110  p.plotSurfaceShapes(".oO[SurfaceShapes]Oo.");
111  p.plotChi2("root://eoscms//eos/cms/store/group/alca_trackeralign/AlignmentValidation/.oO[eosdir]Oo./.oO[validationId]Oo._result.root");
112  vector<int> moduleids = {.oO[moduleid]Oo.};
113  for (auto moduleid : moduleids) {
114  p.residual_by_moduleID(moduleid);
115  }
116 }
117 """