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