diff --git a/Alignment/APEEstimation/plugins/ApeEstimatorSummary.cc b/Alignment/APEEstimation/plugins/ApeEstimatorSummary.cc index cca4f5866bea8..c3d04fd7f3788 100644 --- a/Alignment/APEEstimation/plugins/ApeEstimatorSummary.cc +++ b/Alignment/APEEstimation/plugins/ApeEstimatorSummary.cc @@ -1077,9 +1077,6 @@ void ApeEstimatorSummary::analyze(const edm::Event& iEvent, const edm::EventSetu for (auto& i_sector : m_tkSector_) { delete a_sectorName[i_sector.first]; } - delete sectorNameTree; - delete defaultTreeX; - delete defaultTreeY; } firstEvent = false; diff --git a/Alignment/APEEstimation/python/AlignmentTrackSelector_cff.py b/Alignment/APEEstimation/python/AlignmentTrackSelector_cff.py index 32c34dfdc792c..8ad287472030f 100644 --- a/Alignment/APEEstimation/python/AlignmentTrackSelector_cff.py +++ b/Alignment/APEEstimation/python/AlignmentTrackSelector_cff.py @@ -18,6 +18,18 @@ trackQualities = ["highPurity"], ) +## Filter for cosmics tracks +NoPuritySelector = Alignment.CommonAlignmentProducer.AlignmentTrackSelector_cfi.AlignmentTrackSelector.clone( + applyBasicCuts = True, + filter = True, + src = 'ALCARECOTkAlMuonIsolated', + etaMin = -999., + etaMax = 999., +) + +## +## Filters for skims +## genSimSkimSelector = Alignment.CommonAlignmentProducer.AlignmentTrackSelector_cfi.AlignmentTrackSelector.clone( applyBasicCuts = True, filter = True, diff --git a/Alignment/APEEstimation/python/TrackRefitter_38T_cff.py b/Alignment/APEEstimation/python/TrackRefitter_38T_cff.py index cd014aca9226b..d55cbcf5810fd 100644 --- a/Alignment/APEEstimation/python/TrackRefitter_38T_cff.py +++ b/Alignment/APEEstimation/python/TrackRefitter_38T_cff.py @@ -23,7 +23,8 @@ HighPuritySelector = Alignment.APEEstimation.AlignmentTrackSelector_cff.HighPuritySelector HighPuritySelector.src = 'MuSkim' - +NoPuritySelector = Alignment.APEEstimation.AlignmentTrackSelector_cff.NoPuritySelector +NoPuritySelector.src = 'MuSkim' ## SEQUENCE @@ -33,5 +34,11 @@ TrackRefitterForApeEstimator ) +RefitterNoPuritySequence = cms.Sequence( + offlineBeamSpot* + NoPuritySelector* + TrackRefitterForApeEstimator +) + diff --git a/Alignment/APEEstimation/test/autoSubmitter/autoSubmitter.py b/Alignment/APEEstimation/test/autoSubmitter/autoSubmitter.py index eb596a15eacca..27e0b0abe4882 100644 --- a/Alignment/APEEstimation/test/autoSubmitter/autoSubmitter.py +++ b/Alignment/APEEstimation/test/autoSubmitter/autoSubmitter.py @@ -57,6 +57,11 @@ def __init__(self, config, name): self.sampleType = "MC" else: self.sampleType ="data1" + + if "isCosmics" in dsDict: + self.isCosmics = (dsDict["isCosmics"] == "True") + else: + self.isCosmics = False self.conditions, dummy, self.validConditions = loadConditions(dsDict) @@ -205,7 +210,7 @@ def submit_jobs(self): lastIter = (self.curIteration==self.maxIterations) and not self.alignment.isDesign - inputCommands = "sample={sample} fileNumber={fileNo} iterNumber={iterNo} lastIter={lastIter} alignRcd={alignRcd} maxEvents={maxEvents} globalTag={globalTag} measurementName={name} conditions={conditions}".format(sample=self.dataset.sampleType,fileNo="$1",iterNo=self.curIteration,lastIter=lastIter,alignRcd=alignmentNameToUse, maxEvents=self.maxEvents, globalTag=self.alignment.globalTag, name=self.name, conditions=rawFileName) + inputCommands = "sample={sample} fileNumber={fileNo} iterNumber={iterNo} lastIter={lastIter} alignRcd={alignRcd} maxEvents={maxEvents} globalTag={globalTag} measurementName={name} conditions={conditions} cosmics={cosmics}".format(sample=self.dataset.sampleType,fileNo="$1",iterNo=self.curIteration,lastIter=lastIter,alignRcd=alignmentNameToUse, maxEvents=self.maxEvents, globalTag=self.alignment.globalTag, name=self.name, conditions=rawFileName,cosmics=self.dataset.isCosmics) from autoSubmitterTemplates import condorJobTemplate jobFileContent = condorJobTemplate.format(base=base, inputFile="$2", inputCommands=inputCommands) @@ -434,9 +439,10 @@ def run_iteration(self): try: self.submit_jobs() save("measurements", measurements) - except: + except Exception as e: # this is needed in case the scheduler goes down print("Error submitting jobs for APE measurement {}".format(self.name)) + print(e) return if self.status == STATE_BJOBS_WAITING: diff --git a/Alignment/APEEstimation/test/autoSubmitter/config.ini b/Alignment/APEEstimation/test/autoSubmitter/config.ini index b17b831098c9c..576f63881c4ee 100644 --- a/Alignment/APEEstimation/test/autoSubmitter/config.ini +++ b/Alignment/APEEstimation/test/autoSubmitter/config.ini @@ -8,6 +8,8 @@ fileNames=filename.root otherFile_[1-6,8,10]_[1-2].root maxEvents=-1 # optional, set to True for MC samples, False by default isMC=False +# optional, set to True for cosmics samples, False by default +isCosmics=False #define alignments like this [alignment:alignmentObject] diff --git a/Alignment/APEEstimation/test/cfgTemplate/apeEstimator_cfg.py b/Alignment/APEEstimation/test/cfgTemplate/apeEstimator_cfg.py index c181cf3ccb727..9e2c085bc8cb1 100644 --- a/Alignment/APEEstimation/test/cfgTemplate/apeEstimator_cfg.py +++ b/Alignment/APEEstimation/test/cfgTemplate/apeEstimator_cfg.py @@ -20,7 +20,7 @@ options.register('lastIter', False, VarParsing.VarParsing.multiplicity.singleton, VarParsing.VarParsing.varType.bool, "Last iteration") options.register('alignRcd','', VarParsing.VarParsing.multiplicity.singleton, VarParsing.VarParsing.varType.string, "AlignmentRcd") options.register('conditions',"None", VarParsing.VarParsing.multiplicity.singleton, VarParsing.VarParsing.varType.string, "File with conditions") - +options.register('cosmics', False, VarParsing.VarParsing.multiplicity.singleton, VarParsing.VarParsing.varType.bool, "Cosmic data set") # get and parse the command line arguments options.parseArguments() @@ -194,7 +194,6 @@ ) ) process.es_prefer_trackerAlignmentErr = cms.ESPrefer("PoolDBESSource","myTrackerAlignmentErr") - ## @@ -253,11 +252,18 @@ ## ## Path ## -process.p = cms.Path( - #process.TriggerSelectionSequence* # You want to use this if you want to select for triggers - process.RefitterHighPuritySequence* - process.ApeEstimatorSequence -) + +if not options.cosmics: + process.p = cms.Path( + #process.TriggerSelectionSequence* # You want to use this if you want to select for triggers + process.RefitterHighPuritySequence* + process.ApeEstimatorSequence + ) +else: + process.p = cms.Path( + process.RefitterNoPuritySequence* # this sequence doesn't include high purity track criteria + process.ApeEstimatorSequence + ) diff --git a/Alignment/APEEstimation/test/plottingTools/drawResults.py b/Alignment/APEEstimation/test/plottingTools/drawResults.py index c068c95df8fad..f0e21ea07826c 100644 --- a/Alignment/APEEstimation/test/plottingTools/drawResults.py +++ b/Alignment/APEEstimation/test/plottingTools/drawResults.py @@ -13,6 +13,6 @@ plot.setOutputPath(base+"/hists/workingArea/") # label(also used as name when adding systematic errors), inputFile, color (optional, automatic by default), # marker (optional, 20 by default, 0 is line), hitNumbers (optional, file number of hits in each sector, allData.root) -plot.addInputFile("label", "base/hists/workingArea/iter14/allData_iterationApe.root", color = ROOT.kGray+2) +plot.addInputFile("label", base+"/hists/workingArea/iter14/allData_iterationApe.root", color = ROOT.kGray+2) plot.setGranularity(standardGranularity) plot.draw() diff --git a/Alignment/APEEstimation/test/plottingTools/drawValidation.py b/Alignment/APEEstimation/test/plottingTools/drawValidation.py new file mode 100644 index 0000000000000..fe5c65822ed5e --- /dev/null +++ b/Alignment/APEEstimation/test/plottingTools/drawValidation.py @@ -0,0 +1,21 @@ +# Implementation to draw results of an APE measurement +# to check convergence +from validationPlotter import * +from granularity import * +import ROOT +import os +try: + base = os.environ['CMSSW_BASE']+"/src/Alignment/APEEstimation" +except KeyError: + base = "" + +plot = ValidationPlotter() +plot.setOutputPath(base+"/hists/workingArea/validation") +# label(also used as name when adding systematic errors), inputFile, color (optional, automatic by default), +# marker (optional, 20 by default, 0 is line) +# Multiple inputs possible, in which case the plots will be normalized +# Remember that the folder has to be either iter0 or iter15 or baseline +plot.addInputFile("mp3401", "{base}/hists/workingArea/iter15/allData.root".format(base=base),color=ROOT.kBlack) +plot.addInputFile("Design", "{base}/hists/Design/baseline/allData.root".format(base=base),color=ROOT.kRed,marker=0) +plot.setGranularity(standardGranularity) +plot.draw() diff --git a/Alignment/APEEstimation/test/plottingTools/resultPlotter.py b/Alignment/APEEstimation/test/plottingTools/resultPlotter.py index 07ba9385b37f5..b57ba9c8a76e2 100644 --- a/Alignment/APEEstimation/test/plottingTools/resultPlotter.py +++ b/Alignment/APEEstimation/test/plottingTools/resultPlotter.py @@ -90,14 +90,14 @@ def makeHitNumbers(self, label, sectorRange, coordinate): posX = (float(i)+0.5)/numSectors*(1-ROOT.gPad.GetLeftMargin()-ROOT.gPad.GetRightMargin())+ROOT.gPad.GetLeftMargin() posY = (1-ROOT.gPad.GetTopMargin()-size)-1.2*size*self.numHitCounters - label = ROOT.TLatex(posX, posY, "%.2E"%(num)) - label.SetNDC(True) - label.SetTextColor(self.colors[label]) - label.SetTextSize(size) - label.SetTextFont(font) - label.SetTextAngle(45) - label.SetTextAlign(align) - labels.append(label) + labelTex = ROOT.TLatex(posX, posY, "%.2E"%(num)) + labelTex.SetNDC(True) + labelTex.SetTextColor(self.colors[label]) + labelTex.SetTextSize(size) + labelTex.SetTextFont(font) + labelTex.SetTextAngle(45) + labelTex.SetTextAlign(align) + labels.append(labelTex) return labels def makeHist(self, label, sectorRange, coordinate, number): @@ -161,7 +161,7 @@ def draw(self): plotNumber = 0 rangeList = self.granularity.sectors[coordinate] for sectorRange in rangeList: - self.canvas = ROOT.TCanvas("canvas", "canvas", int(ROOT.gStyle.GetCanvasDefW()*len(list(range(sectorRange[0],sectorRange[1]+1)))/10.),ROOT.gStyle.GetCanvasDefH()) + self.canvas = ROOT.TCanvas("canvas", "canvas", max(int(ROOT.gStyle.GetCanvasDefW()*len(list(range(sectorRange[0],sectorRange[1]+1)))/10.), int(ROOT.gStyle.GetCanvasDefW()/2)),ROOT.gStyle.GetCanvasDefH()) ROOT.gPad.SetRightMargin(0.10) legend = ROOT.TLegend(0.2,0.62,0.5,0.82) diff --git a/Alignment/APEEstimation/test/plottingTools/validationPlotter.py b/Alignment/APEEstimation/test/plottingTools/validationPlotter.py new file mode 100644 index 0000000000000..2452086590334 --- /dev/null +++ b/Alignment/APEEstimation/test/plottingTools/validationPlotter.py @@ -0,0 +1,255 @@ +import ROOT +ROOT.gROOT.SetBatch(True) +from setTDRStyle import setTDRStyle + + +from granularity import * + + +class ValidationPlotter: + def __init__(self): + setTDRStyle() + self.inFiles = {} + self.labels = {} + self.colors = {} + self.markers = {} + self.outPath = None + self.granularity = standardGranularity + self.order = [] + + def addInputFile(self, label, inFile, color=None, marker=20): + self.order.append(label) + self.inFiles[label] = inFile + self.labels[label] = label + self.markers[label] = marker + if color != None: + self.colors[label] = color + else: + # choose first not occupied color (other than white) + for autoColor in range(1,100): + if autoColor not in self.colors.values() and not autoColor == 10: + self.colors[label] = autoColor + break + + def setGranularity(self, granularity): + self.granularity = granularity + + def setOutputPath(self, outPath): + self.outPath = outPath + + def convertName(self, name): + out = name.replace("Bpix", "BPIX") + out = out.replace("Fpix", "FPIX") + out = out.replace("Plus", "+") + out = out.replace("Minus", "-") + out = out.replace("Fpix", "FPIX") + out = out.replace("Tib", "TIB") + out = out.replace("Tob", "TOB") + out = out.replace("Tid", "TID") + out = out.replace("Tec", "TEC") + out = out.replace("Layer", " L") + out = out.replace("Ring", " R") + out = out.replace("Stereo", "S") + out = out.replace("Rphi", "R") # different from Ring, this one does not add a space in front + out = out.replace("In", "i") + out = out.replace("Out", "o") + return out + + def plotHist(self, folder, name, title, hists, twoDimensional=False): + self.canvas = ROOT.TCanvas("canvas", "canvas", ROOT.gStyle.GetCanvasDefW(),ROOT.gStyle.GetCanvasDefH()) + ROOT.gPad.SetRightMargin(0.10) + if twoDimensional: + ROOT.gPad.SetRightMargin(0.2) + + + legend = ROOT.TLegend(0.2,0.7,0.9,0.90) + legend.SetFillColor(0) + legend.SetFillStyle(0) + legend.SetTextSize(0.03) + legend.SetMargin(0.15) + legend.SetNColumns(2) + legend.SetBorderSize(0) + + normalize = False + if len (hists) > 1: + normalize = True + + + firstHist = True + scaleHist = None + maximum = 0 + for hist, label in hists: + + n = int(hist.Integral()) + mu = hist.GetMean() + sigma = hist.GetRMS() + + if normalize: + hist.Scale(1./hist.Integral()) + + if hist.GetMaximum() > maximum: + maximum = hist.GetMaximum() + + if firstHist: + scaleHist = hist + addDraw = "" + firstHist = False + else: + addDraw = "same" + + if not twoDimensional: + if self.markers[label] != 0: + drawMode = "P0%s"%(addDraw) + else: + drawMode = "hist%s"%(addDraw) + else: + drawMode = "COLZ" + + scaleHist.SetMaximum(maximum*1.5) + scaleHist.SetMinimum(0) + + hist.Draw(drawMode) + + legText = "#splitline{{{label}}}{{N={n:.2E},#mu={mu:.2f},RMS={sigma:.2f}}}".format(label=label,n=n, mu=mu,sigma=sigma) + + if self.markers[label] != 0: + legend.AddEntry(hist, legText, "p") + else: + legend.AddEntry(hist, legText, "l") + + if not twoDimensional: + legend.Draw() + + cmsText = ROOT.TLatex(0.16,0.96,title) + cmsText.SetTextFont(42) + cmsText.SetNDC() + cmsText.Draw("same") + + import os + if not os.path.isdir(self.outPath): + os.makedirs(self.outPath) + if not os.path.isdir(self.outPath+"/"+folder): + os.makedirs(self.outPath+"/"+folder) + self.canvas.SaveAs("{}/{}/{}.pdf".format(self.outPath, folder, name)) + self.canvas = None + + + + def makeResidualPlot(self, sectorNumber, coordinate): + # residual + hists = [] + for label in self.order: + fi = ROOT.TFile(self.inFiles[label], "READ") + hist = fi.Get("ApeEstimator1/Sector_{sectorNumber}/Results/h_Res{coordinate}".format(sectorNumber=sectorNumber, coordinate=coordinate)) + hist.SetLineColor(self.colors[label]) + hist.SetMarkerColor(self.colors[label]) + hist.SetMarkerStyle(self.markers[label]) + hist.SetDirectory(0) + if self.markers[label] == 0: + hist.SetMarkerSize(0) + hist.SetLineWidth(2) + + hists.append((hist, label)) + nameHist = fi.Get("ApeEstimator1/Sector_{sectorNumber}/z_name".format(sectorNumber=sectorNumber)) + nameHist.SetDirectory(0) + title = self.convertName(nameHist.GetTitle()) + fi.Close() + + name = "Sector_{sectorNumber}_Res{coordinate}".format(sectorNumber=sectorNumber, coordinate=coordinate) + + self.plotHist("residuals", name, title, hists) + + + # normalized residual + hists = [] + for label in self.order: + fi = ROOT.TFile(self.inFiles[label], "READ") + hist = fi.Get("ApeEstimator1/Sector_{sectorNumber}/Results/h_NorRes{coordinate}".format(sectorNumber=sectorNumber, coordinate=coordinate)) + hist.SetLineColor(self.colors[label]) + hist.SetMarkerColor(self.colors[label]) + hist.SetMarkerStyle(self.markers[label]) + hist.SetDirectory(0) + if self.markers[label] == 0: + hist.SetMarkerSize(0) + hist.SetLineWidth(2) + + hists.append((hist, label)) + nameHist = fi.Get("ApeEstimator1/Sector_{sectorNumber}/z_name".format(sectorNumber=sectorNumber)) + nameHist.SetDirectory(0) + title = self.convertName(nameHist.GetTitle()) + fi.Close() + name = "Sector_{sectorNumber}_NorRes{coordinate}".format(sectorNumber=sectorNumber, coordinate=coordinate) + + self.plotHist("residuals", name, title, hists) + + def makeTrackPlot(self,histName, twoDimensional=False): + hists = [] + for label in self.order: + fi = ROOT.TFile(self.inFiles[label], "READ") + hist = fi.Get("ApeEstimator2/TrackVariables/{histName}".format(histName=histName)) + hist.SetLineColor(self.colors[label]) + hist.SetMarkerColor(self.colors[label]) + hist.SetMarkerStyle(self.markers[label]) + hist.SetDirectory(0) + if self.markers[label] == 0: + hist.SetMarkerSize(0) + hist.SetLineWidth(2) + + if twoDimensional: + self.plotHist("tracks", histName+"_"+label, label, [(hist, label),], twoDimensional=True) + else: + hists.append((hist, label)) + if len(hists) > 0: + self.plotHist("tracks", histName, histName, hists, twoDimensional=twoDimensional) + + + + def draw(self): + for coordinate in self.granularity.sectors.keys(): + rangeList = self.granularity.sectors[coordinate] + for first, last in rangeList: + for i in range(first, last+1): + self.makeResidualPlot(i, coordinate) + + self.makeTrackPlot("h_hitsSize") + self.makeTrackPlot("h_hitsValid") + self.makeTrackPlot("h_hitsInvalid") + self.makeTrackPlot("h_hits2D") + self.makeTrackPlot("h_layersMissed") + self.makeTrackPlot("h_hitsPixel") + self.makeTrackPlot("h_hitsStrip") + self.makeTrackPlot("h_charge") + self.makeTrackPlot("h_chi2") + self.makeTrackPlot("h_ndof") + self.makeTrackPlot("h_norChi2") + self.makeTrackPlot("h_prob") + self.makeTrackPlot("h_eta") + self.makeTrackPlot("h_etaErr") + self.makeTrackPlot("h_theta") + self.makeTrackPlot("h_phi") + self.makeTrackPlot("h_phiErr") + self.makeTrackPlot("h_d0Beamspot") + self.makeTrackPlot("h_d0BeamspotErr") + self.makeTrackPlot("h_dz") + self.makeTrackPlot("h_dzErr") + self.makeTrackPlot("h_pt") + self.makeTrackPlot("h_ptErr") + self.makeTrackPlot("h_meanAngle") + self.makeTrackPlot("h_hitsGood") + # these don't have several histograms in one plot + self.makeTrackPlot("h2_meanAngleVsHits", twoDimensional=True) + self.makeTrackPlot("h2_hitsGoodVsHitsValid", twoDimensional=True) + self.makeTrackPlot("h2_hitsPixelVsEta", twoDimensional=True) + self.makeTrackPlot("h2_hitsPixelVsTheta", twoDimensional=True) + self.makeTrackPlot("h2_hitsStripVsEta", twoDimensional=True) + self.makeTrackPlot("h2_hitsStripVsTheta", twoDimensional=True) + self.makeTrackPlot("h2_ptVsTheta", twoDimensional=True) + + + +def main(): + pass + + +if __name__ == "__main__": + main() diff --git a/Alignment/CommonAlignmentProducer/interface/AlignmentTrackSelector.h b/Alignment/CommonAlignmentProducer/interface/AlignmentTrackSelector.h index 1b215eb534cdd..9aa337f5d6f5e 100644 --- a/Alignment/CommonAlignmentProducer/interface/AlignmentTrackSelector.h +++ b/Alignment/CommonAlignmentProducer/interface/AlignmentTrackSelector.h @@ -2,12 +2,14 @@ #define Alignment_CommonAlignmentAlgorithm_AlignmentTrackSelector_h #include "DataFormats/Alignment/interface/AliClusterValueMapFwd.h" +#include "DataFormats/TrackReco/interface/Track.h" +#include "DataFormats/TrackerCommon/interface/TrackerTopology.h" #include "DataFormats/TrackerRecHit2D/interface/SiStripMatchedRecHit2DCollection.h" #include "DataFormats/TrackerRecHit2D/interface/SiStripRecHit2DCollection.h" -#include "DataFormats/TrackReco/interface/Track.h" -#include "FWCore/Utilities/interface/InputTag.h" #include "FWCore/Framework/interface/ConsumesCollector.h" #include "FWCore/Utilities/interface/EDGetToken.h" +#include "FWCore/Utilities/interface/InputTag.h" +#include "Geometry/Records/interface/TrackerTopologyRcd.h" #include namespace edm { @@ -60,6 +62,8 @@ class AlignmentTrackSelector { }; ComparePt ptComparator; + edm::ESGetToken tTopoToken_; + const bool applyBasicCuts_, applyNHighestPt_, applyMultiplicityFilter_; const int seedOnlyFromAbove_; const bool applyIsolation_, chargeCheck_; diff --git a/Alignment/CommonAlignmentProducer/plugins/AlignmentMuonHIPTrajectorySelector.cc b/Alignment/CommonAlignmentProducer/plugins/AlignmentMuonHIPTrajectorySelector.cc index 417ed047241a4..60298e34112bf 100644 --- a/Alignment/CommonAlignmentProducer/plugins/AlignmentMuonHIPTrajectorySelector.cc +++ b/Alignment/CommonAlignmentProducer/plugins/AlignmentMuonHIPTrajectorySelector.cc @@ -24,7 +24,7 @@ // user include files #include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/EDProducer.h" +#include "FWCore/Framework/interface/stream/EDProducer.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/MakerMacros.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" @@ -51,7 +51,7 @@ // class decleration // -class AlignmentMuonHIPTrajectorySelector : public edm::EDProducer { +class AlignmentMuonHIPTrajectorySelector : public edm::stream::EDProducer<> { public: explicit AlignmentMuonHIPTrajectorySelector(const edm::ParameterSet&); ~AlignmentMuonHIPTrajectorySelector() override; diff --git a/Alignment/CommonAlignmentProducer/plugins/AlignmentProducer.cc b/Alignment/CommonAlignmentProducer/plugins/AlignmentProducer.cc index 2cae957af695c..b55f6c0332640 100644 --- a/Alignment/CommonAlignmentProducer/plugins/AlignmentProducer.cc +++ b/Alignment/CommonAlignmentProducer/plugins/AlignmentProducer.cc @@ -15,6 +15,13 @@ AlignmentProducer::AlignmentProducer(const edm::ParameterSet &config) maxLoops_{config.getUntrackedParameter("maxLoops")} { edm::LogInfo("Alignment") << "@SUB=AlignmentProducer::AlignmentProducer"; + // do now all the consumes + trajTrackAssociationCollectionToken_ = consumes(tjTkAssociationMapTag_); + bsToken_ = consumes(beamSpotTag_); + tkFittedLasBeamCollectionToken_ = consumes(tkLasBeamTag_); + tsosVectorCollectionToken_ = consumes(tkLasBeamTag_); + aliClusterValueMapToken_ = consumes(clusterValueMapTag_); + // Tell the framework what data is being produced if (doTracker_) { setWhatProduced(this, &AlignmentProducer::produceTracker); diff --git a/Alignment/CommonAlignmentProducer/plugins/AlignmentProducer.h b/Alignment/CommonAlignmentProducer/plugins/AlignmentProducer.h index aea01e35b1702..dfc086dc415e6 100644 --- a/Alignment/CommonAlignmentProducer/plugins/AlignmentProducer.h +++ b/Alignment/CommonAlignmentProducer/plugins/AlignmentProducer.h @@ -58,33 +58,39 @@ class AlignmentProducer : public edm::ESProducerLooper, public AlignmentProducer bool getAliClusterValueMap(const edm::Event&, edm::Handle&) override; const unsigned int maxLoops_; /// Number of loops to loop + + edm::EDGetTokenT trajTrackAssociationCollectionToken_; + edm::EDGetTokenT bsToken_; + edm::EDGetTokenT tkFittedLasBeamCollectionToken_; + edm::EDGetTokenT tsosVectorCollectionToken_; + edm::EDGetTokenT aliClusterValueMapToken_; }; //------------------------------------------------------------------------------ inline bool AlignmentProducer::getTrajTrackAssociationCollection(const edm::Event& event, edm::Handle& result) { - return event.getByLabel(tjTkAssociationMapTag_, result); + return event.getByToken(trajTrackAssociationCollectionToken_, result); } //------------------------------------------------------------------------------ inline bool AlignmentProducer::getBeamSpot(const edm::Event& event, edm::Handle& result) { - return event.getByLabel(beamSpotTag_, result); + return event.getByToken(bsToken_, result); } //------------------------------------------------------------------------------ inline bool AlignmentProducer::getTkFittedLasBeamCollection(const edm::Run& run, edm::Handle& result) { - return run.getByLabel(tkLasBeamTag_, result); + return run.getByToken(tkFittedLasBeamCollectionToken_, result); } //------------------------------------------------------------------------------ inline bool AlignmentProducer::getTsosVectorCollection(const edm::Run& run, edm::Handle& result) { - return run.getByLabel(tkLasBeamTag_, result); + return run.getByToken(tsosVectorCollectionToken_, result); } //------------------------------------------------------------------------------ inline bool AlignmentProducer::getAliClusterValueMap(const edm::Event& event, edm::Handle& result) { - return event.getByLabel(clusterValueMapTag_, result); + return event.getByToken(aliClusterValueMapToken_, result); } #endif diff --git a/Alignment/CommonAlignmentProducer/plugins/GlobalTrackerMuonAlignment.cc b/Alignment/CommonAlignmentProducer/plugins/GlobalTrackerMuonAlignment.cc index b72d7b31cd1c7..6f566743fbbb8 100644 --- a/Alignment/CommonAlignmentProducer/plugins/GlobalTrackerMuonAlignment.cc +++ b/Alignment/CommonAlignmentProducer/plugins/GlobalTrackerMuonAlignment.cc @@ -31,7 +31,7 @@ // Framework #include "FWCore/MessageLogger/interface/MessageLogger.h" -#include "FWCore/Framework/interface/EDAnalyzer.h" +#include "FWCore/Framework/interface/one/EDAnalyzer.h" #include "FWCore/Framework/interface/ESWatcher.h" #include "FWCore/Framework/interface/Frameworkfwd.h" //#include "FWCore/Framework/interface/EDProducer.h" @@ -106,7 +106,7 @@ using namespace reco; // class declaration // -class GlobalTrackerMuonAlignment : public edm::EDAnalyzer { +class GlobalTrackerMuonAlignment : public edm::one::EDAnalyzer<> { public: explicit GlobalTrackerMuonAlignment(const edm::ParameterSet&); ~GlobalTrackerMuonAlignment() override; @@ -155,6 +155,11 @@ class GlobalTrackerMuonAlignment : public edm::EDAnalyzer { void endJob() override; // ----------member data --------------------------- + edm::ESGetToken m_TkGeometryToken; + edm::ESGetToken m_MagFieldToken; + edm::ESGetToken m_globalPosToken; + edm::ESGetToken m_propToken; + edm::ESGetToken m_ttrhBuilderToken; edm::InputTag trackTags_; // used to select what tracks to read from configuration file edm::InputTag muonTags_; // used to select what standalone muons @@ -270,18 +275,19 @@ class GlobalTrackerMuonAlignment : public edm::EDAnalyzer { // constructors and destructor // GlobalTrackerMuonAlignment::GlobalTrackerMuonAlignment(const edm::ParameterSet& iConfig) - : trackTags_(iConfig.getParameter("tracks")), + : m_TkGeometryToken(esConsumes()), + m_MagFieldToken(esConsumes()), + m_globalPosToken(esConsumes()), + m_propToken(esConsumes(edm::ESInputTag("", iConfig.getParameter("Propagator")))), + m_ttrhBuilderToken(esConsumes(edm::ESInputTag("", "witTrackAngle"))), + trackTags_(iConfig.getParameter("tracks")), muonTags_(iConfig.getParameter("muons")), gmuonTags_(iConfig.getParameter("gmuons")), smuonTags_(iConfig.getParameter("smuons")), - propagator_(iConfig.getParameter("Propagator")), - cosmicMuonMode_(iConfig.getParameter("cosmics")), isolatedMuonMode_(iConfig.getParameter("isolated")), - refitMuon_(iConfig.getParameter("refitmuon")), refitTrack_(iConfig.getParameter("refittrack")), - rootOutFile_(iConfig.getUntrackedParameter("rootOutFile")), txtOutFile_(iConfig.getUntrackedParameter("txtOutFile")), writeDB_(iConfig.getUntrackedParameter("writeDB")), @@ -660,20 +666,17 @@ void GlobalTrackerMuonAlignment::analyzeTrackTrack(const edm::Event& iEvent, con //iSetup.get().get(cscGeometry); if (watchTrackingGeometry_.check(iSetup) || !trackingGeometry_) { - edm::ESHandle trackingGeometry; - iSetup.get().get(trackingGeometry); + edm::ESHandle trackingGeometry = iSetup.getHandle(m_TkGeometryToken); trackingGeometry_ = &*trackingGeometry; } if (watchMagneticFieldRecord_.check(iSetup) || !magneticField_) { - edm::ESHandle magneticField; - iSetup.get().get(magneticField); + edm::ESHandle magneticField = iSetup.getHandle(m_MagFieldToken); magneticField_ = &*magneticField; } if (watchGlobalPositionRcd_.check(iSetup) || !globalPositionRcd_) { - edm::ESHandle globalPositionRcd; - iSetup.get().get(globalPositionRcd); + edm::ESHandle globalPositionRcd = iSetup.getHandle(m_globalPosToken); globalPositionRcd_ = &*globalPositionRcd; for (std::vector::const_iterator i = globalPositionRcd_->m_align.begin(); i != globalPositionRcd_->m_align.end(); @@ -695,8 +698,7 @@ void GlobalTrackerMuonAlignment::analyzeTrackTrack(const edm::Event& iEvent, con } } // end of GlobalPositionRcd - ESHandle propagator; - iSetup.get().get(propagator_, propagator); + edm::ESHandle propagator = iSetup.getHandle(m_propToken); SteppingHelixPropagator alongStHePr = SteppingHelixPropagator(magneticField_, alongMomentum); SteppingHelixPropagator oppositeStHePr = SteppingHelixPropagator(magneticField_, oppositeToMomentum); @@ -1339,21 +1341,18 @@ void GlobalTrackerMuonAlignment::analyzeTrackTrajectory(const edm::Event& iEvent //iSetup.get().get(cscGeometry); if (watchTrackingGeometry_.check(iSetup) || !trackingGeometry_) { - edm::ESHandle trackingGeometry; - iSetup.get().get(trackingGeometry); + edm::ESHandle trackingGeometry = iSetup.getHandle(m_TkGeometryToken); trackingGeometry_ = &*trackingGeometry; theTrackingGeometry = trackingGeometry; } if (watchMagneticFieldRecord_.check(iSetup) || !magneticField_) { - edm::ESHandle magneticField; - iSetup.get().get(magneticField); + edm::ESHandle magneticField = iSetup.getHandle(m_MagFieldToken); magneticField_ = &*magneticField; } if (watchGlobalPositionRcd_.check(iSetup) || !globalPositionRcd_) { - edm::ESHandle globalPositionRcd; - iSetup.get().get(globalPositionRcd); + edm::ESHandle globalPositionRcd = iSetup.getHandle(m_globalPosToken); globalPositionRcd_ = &*globalPositionRcd; for (std::vector::const_iterator i = globalPositionRcd_->m_align.begin(); i != globalPositionRcd_->m_align.end(); @@ -1379,8 +1378,7 @@ void GlobalTrackerMuonAlignment::analyzeTrackTrajectory(const edm::Event& iEvent } } // end of GlobalPositionRcd - ESHandle propagator; - iSetup.get().get(propagator_, propagator); + edm::ESHandle propagator = iSetup.getHandle(m_propToken); SteppingHelixPropagator alongStHePr = SteppingHelixPropagator(magneticField_, alongMomentum); SteppingHelixPropagator oppositeStHePr = SteppingHelixPropagator(magneticField_, oppositeToMomentum); @@ -1407,8 +1405,7 @@ void GlobalTrackerMuonAlignment::analyzeTrackTrajectory(const edm::Event& iEvent theFitterOp = new KFTrajectoryFitter(oppositeSmPr, *theUpdator, *theEstimator); theSmootherOp = new KFTrajectorySmoother(oppositeSmPr, *theUpdator, *theEstimator); - edm::ESHandle builder; - iSetup.get().get("WithTrackAngle", builder); + edm::ESHandle builder = iSetup.getHandle(m_ttrhBuilderToken); this->TTRHBuilder = &(*builder); this->MuRHBuilder = new MuonTransientTrackingRecHitBuilder(theTrackingGeometry); if (debug_) { diff --git a/Alignment/CommonAlignmentProducer/src/AlignmentTrackSelector.cc b/Alignment/CommonAlignmentProducer/src/AlignmentTrackSelector.cc index 59cfb81b812d1..35b1b72f26acc 100644 --- a/Alignment/CommonAlignmentProducer/src/AlignmentTrackSelector.cc +++ b/Alignment/CommonAlignmentProducer/src/AlignmentTrackSelector.cc @@ -16,12 +16,9 @@ #include "DataFormats/SiStripCluster/interface/SiStripCluster.h" #include "DataFormats/Alignment/interface/AlignmentClusterFlag.h" #include "DataFormats/Alignment/interface/AliClusterValueMap.h" - #include "DataFormats/DetId/interface/DetId.h" #include "DataFormats/SiStripDetId/interface/SiStripDetId.h" #include "DataFormats/SiPixelDetId/interface/PixelSubdetector.h" -#include "DataFormats/TrackerCommon/interface/TrackerTopology.h" -#include "Geometry/Records/interface/TrackerTopologyRcd.h" #include @@ -31,7 +28,8 @@ const int kFPIX = PixelSubdetector::PixelEndcap; // constructor ---------------------------------------------------------------- AlignmentTrackSelector::AlignmentTrackSelector(const edm::ParameterSet& cfg, edm::ConsumesCollector& iC) - : applyBasicCuts_(cfg.getParameter("applyBasicCuts")), + : tTopoToken_(iC.esConsumes()), + applyBasicCuts_(cfg.getParameter("applyBasicCuts")), applyNHighestPt_(cfg.getParameter("applyNHighestPt")), applyMultiplicityFilter_(cfg.getParameter("applyMultiplicityFilter")), seedOnlyFromAbove_(cfg.getParameter("seedOnlyFrom")), @@ -222,7 +220,7 @@ AlignmentTrackSelector::AlignmentTrackSelector(const edm::ParameterSet& cfg, edm // destructor ----------------------------------------------------------------- -AlignmentTrackSelector::~AlignmentTrackSelector() {} +AlignmentTrackSelector::~AlignmentTrackSelector() = default; // do selection --------------------------------------------------------------- @@ -321,9 +319,7 @@ bool AlignmentTrackSelector::detailedHitsCheck(const reco::Track* trackp, const edm::Event& evt, const edm::EventSetup& eSetup) const { //Retrieve tracker topology from geometry - edm::ESHandle tTopoHandle; - eSetup.get().get(tTopoHandle); - const TrackerTopology* const tTopo = tTopoHandle.product(); + const TrackerTopology* const tTopo = &eSetup.getData(tTopoToken_); // checking hit requirements beyond simple number of valid hits diff --git a/Alignment/HIPAlignmentAlgorithm/interface/LhcTrackAnalyzer.h b/Alignment/HIPAlignmentAlgorithm/interface/LhcTrackAnalyzer.h deleted file mode 100644 index 61ca07bdaf1f3..0000000000000 --- a/Alignment/HIPAlignmentAlgorithm/interface/LhcTrackAnalyzer.h +++ /dev/null @@ -1,101 +0,0 @@ -#ifndef LhcTrackAnalyzer_h -#define LhcTrackAnalyzer_h - -#include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/one/EDAnalyzer.h" -#include "FWCore/Framework/interface/Event.h" -#include "FWCore/Framework/interface/EventSetup.h" -#include "FWCore/Framework/interface/MakerMacros.h" -#include "FWCore/ParameterSet/interface/ParameterSet.h" - -#include "TFile.h" -#include "TH1D.h" -#include "TH1I.h" -#include "TH2D.h" -#include "TTree.h" - -#include "DataFormats/TrackerRecHit2D/interface/SiStripRecHit2D.h" - -#include "DataFormats/TrackCandidate/interface/TrackCandidate.h" -#include "DataFormats/TrackCandidate/interface/TrackCandidateCollection.h" -#include "DataFormats/TrackReco/interface/Track.h" -#include "DataFormats/TrackReco/interface/TrackFwd.h" -#include "DataFormats/TrackingRecHit/interface/TrackingRecHit.h" -#include "DataFormats/DetId/interface/DetId.h" -#include "DataFormats/SiStripDetId/interface/StripSubdetector.h" -#include "DataFormats/SiPixelDetId/interface/PixelSubdetector.h" - -//FOR CLUSTERINFO -#include "DataFormats/TrackerRecHit2D/interface/SiStripRecHit2D.h" -#include "DataFormats/SiStripDigi/interface/SiStripDigi.h" -#include "DataFormats/SiStripCluster/interface/SiStripCluster.h" -//#include "DataFormats/SiStripCluster/interface/SiStripClusterInfo.h" -#include "DataFormats/Common/interface/DetSetVector.h" - -#include "Geometry/Records/interface/TrackerDigiGeometryRecord.h" -#include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h" -#include "DataFormats/GeometryVector/interface/GlobalPoint.h" -#include "DataFormats/GeometryVector/interface/LocalPoint.h" -#include "Geometry/CommonDetUnit/interface/GeomDet.h" - -// system include files -#include -#include -#include -#include -#include -#include - -// -// class decleration -// - -class LhcTrackAnalyzer : public edm::one::EDAnalyzer<> { -public: - explicit LhcTrackAnalyzer(const edm::ParameterSet&); - ~LhcTrackAnalyzer() override; - -private: - void beginJob() override; - void analyze(const edm::Event&, const edm::EventSetup&) override; - void endJob() override; - - // ----------member data --------------------------- - edm::InputTag TrackCollectionTag_; - edm::InputTag PVtxCollectionTag_; - bool debug_; - - // Output - std::string filename_; - TFile* rootFile_; - TTree* rootTree_; - - // Root-Tuple variables : - //======================= - void SetVarToZero(); - - static const int nMaxtracks_ = 3000; - int nTracks_; - int run_; - int event_; - double pt_[nMaxtracks_]; - double eta_[nMaxtracks_]; - double phi_[nMaxtracks_]; - double chi2_[nMaxtracks_]; - double chi2ndof_[nMaxtracks_]; - int charge_[nMaxtracks_]; - double qoverp_[nMaxtracks_]; - double dz_[nMaxtracks_]; - double dxy_[nMaxtracks_]; - double xPCA_[nMaxtracks_]; - double yPCA_[nMaxtracks_]; - double zPCA_[nMaxtracks_]; - int trkAlgo_[nMaxtracks_]; - int trkQuality_[nMaxtracks_]; - int isHighPurity_[nMaxtracks_]; - int validhits_[nMaxtracks_][7]; - bool goodbx_; - bool goodvtx_; -}; - -#endif diff --git a/Alignment/HIPAlignmentAlgorithm/plugins/LhcTrackAnalyzer.cc b/Alignment/HIPAlignmentAlgorithm/plugins/LhcTrackAnalyzer.cc new file mode 100644 index 0000000000000..9d30308184337 --- /dev/null +++ b/Alignment/HIPAlignmentAlgorithm/plugins/LhcTrackAnalyzer.cc @@ -0,0 +1,342 @@ +// -*- C++ -*- +// +// Package: LhcTrackAnalyzer +// Class: LhcTrackAnalyzer +// +/**\class LhcTrackAnalyzer LhcTrackAnalyzer.cc Alignment/HIPAlignmentAlgorithm/plugins/LhcTrackAnalyzer.cc + + Originally written by M.Musich + Expanded by A. Bonato + + Description: Ntuplizer for collision tracks +*/ +// + +// system include files +#include +#include +#include + +// user include files +#include "DataFormats/SiPixelDetId/interface/PixelSubdetector.h" +#include "DataFormats/SiStripDetId/interface/StripSubdetector.h" +#include "DataFormats/TrackReco/interface/Track.h" +#include "DataFormats/TrackReco/interface/TrackFwd.h" +#include "DataFormats/VertexReco/interface/Vertex.h" +#include "DataFormats/VertexReco/interface/VertexFwd.h" +#include "FWCore/Framework/interface/one/EDAnalyzer.h" +#include "FWCore/Framework/interface/Event.h" +#include "FWCore/Framework/interface/EventSetup.h" +#include "FWCore/Framework/interface/Frameworkfwd.h" +#include "FWCore/Framework/interface/MakerMacros.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/ServiceRegistry/interface/Service.h" + +// ROOT includes +#include "TFile.h" +#include "TTree.h" + +// +// class decleration +// + +class LhcTrackAnalyzer : public edm::one::EDAnalyzer<> { +public: + explicit LhcTrackAnalyzer(const edm::ParameterSet&); + ~LhcTrackAnalyzer() override = default; + static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); + +private: + void beginJob() override; + void analyze(const edm::Event&, const edm::EventSetup&) override; + void endJob() override; + + // ----------member data --------------------------- + edm::InputTag TrackCollectionTag_; + edm::InputTag PVtxCollectionTag_; + bool debug_; + std::vector acceptedBX_; + + edm::EDGetTokenT theTrackCollectionToken; + edm::EDGetTokenT theVertexCollectionToken; + + // Output + std::string filename_; + TFile* rootFile_; + TTree* rootTree_; + + // Root-Tuple variables : + //======================= + void SetVarToZero(); + + static constexpr int nMaxtracks_ = 3000; + int nTracks_; + int run_; + int event_; + double pt_[nMaxtracks_]; + double eta_[nMaxtracks_]; + double phi_[nMaxtracks_]; + double chi2_[nMaxtracks_]; + double chi2ndof_[nMaxtracks_]; + int charge_[nMaxtracks_]; + double qoverp_[nMaxtracks_]; + double dz_[nMaxtracks_]; + double dxy_[nMaxtracks_]; + double xPCA_[nMaxtracks_]; + double yPCA_[nMaxtracks_]; + double zPCA_[nMaxtracks_]; + int trkAlgo_[nMaxtracks_]; + int trkQuality_[nMaxtracks_]; + int isHighPurity_[nMaxtracks_]; + int validhits_[nMaxtracks_][7]; + bool goodbx_; + bool goodvtx_; +}; + +// Constructor + +LhcTrackAnalyzer::LhcTrackAnalyzer(const edm::ParameterSet& iConfig) + : TrackCollectionTag_(iConfig.getParameter("TrackCollectionTag")), + PVtxCollectionTag_(iConfig.getParameter("PVtxCollectionTag")), + debug_(iConfig.getParameter("Debug")), + acceptedBX_(iConfig.getParameter>("acceptedBX")), + filename_(iConfig.getParameter("OutputFileName")) { + //now do what ever initialization is needed + theTrackCollectionToken = consumes(TrackCollectionTag_); + theVertexCollectionToken = consumes(PVtxCollectionTag_); +} + +// +// member functions +// + +/*****************************************************************************/ +void LhcTrackAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) +/*****************************************************************************/ +{ + using namespace edm; + using namespace reco; + using namespace std; + + //======================================================= + // Initialize Root-tuple variables + //======================================================= + + SetVarToZero(); + + //======================================================= + // Retrieve the Track information + //======================================================= + + const auto& vertices = iEvent.get(theVertexCollectionToken); + const auto& vtx = vertices.front(); + if (vtx.isFake()) { + goodvtx_ = false; + } else { + goodvtx_ = true; + } + + int bx = iEvent.bunchCrossing(); + if (acceptedBX_.empty()) { + goodbx_ = true; + } else { + if (std::find(acceptedBX_.begin(), acceptedBX_.end(), bx) != acceptedBX_.end()) { + goodbx_ = true; + } + } + + run_ = iEvent.id().run(); + event_ = iEvent.id().event(); + + const auto& tracks = iEvent.get(theTrackCollectionToken); + if (debug_) { + edm::LogInfo("LhcTrackAnalyzer") << "LhcTrackAnalyzer::analyze() looping over " << tracks.size() << "tracks." + << endl; + } + + for (const auto& track : tracks) { + if (nTracks_ >= nMaxtracks_) { + edm::LogWarning("LhcTrackAnalyzer") + << " LhcTrackAnalyzer::analyze() : Warning - Run " << run_ << " Event " << event_ + << "\tNumber of tracks: " << tracks.size() << " , greater than " << nMaxtracks_ << std::endl; + continue; + } + pt_[nTracks_] = track.pt(); + eta_[nTracks_] = track.eta(); + phi_[nTracks_] = track.phi(); + chi2_[nTracks_] = track.chi2(); + chi2ndof_[nTracks_] = track.normalizedChi2(); + charge_[nTracks_] = track.charge(); + qoverp_[nTracks_] = track.qoverp(); + dz_[nTracks_] = track.dz(); + dxy_[nTracks_] = track.dxy(); + xPCA_[nTracks_] = track.vertex().x(); + yPCA_[nTracks_] = track.vertex().y(); + zPCA_[nTracks_] = track.vertex().z(); + validhits_[nTracks_][0] = track.numberOfValidHits(); + validhits_[nTracks_][1] = track.hitPattern().numberOfValidPixelBarrelHits(); + validhits_[nTracks_][2] = track.hitPattern().numberOfValidPixelEndcapHits(); + validhits_[nTracks_][3] = track.hitPattern().numberOfValidStripTIBHits(); + validhits_[nTracks_][4] = track.hitPattern().numberOfValidStripTIDHits(); + validhits_[nTracks_][5] = track.hitPattern().numberOfValidStripTOBHits(); + validhits_[nTracks_][6] = track.hitPattern().numberOfValidStripTECHits(); + + int myalgo = -88; + if (track.algo() == reco::TrackBase::undefAlgorithm) { + myalgo = 0; + } else if (track.algo() == reco::TrackBase::ctf) { + myalgo = 1; + } else if (track.algo() == reco::TrackBase::duplicateMerge) { + myalgo = 2; + } else if (track.algo() == reco::TrackBase::cosmics) { + myalgo = 3; + } else if (track.algo() == reco::TrackBase::initialStep) { + myalgo = 4; + } else if (track.algo() == reco::TrackBase::lowPtTripletStep) { + myalgo = 5; + } else if (track.algo() == reco::TrackBase::pixelPairStep) { + myalgo = 6; + } else if (track.algo() == reco::TrackBase::detachedTripletStep) { + myalgo = 7; + } else if (track.algo() == reco::TrackBase::mixedTripletStep) { + myalgo = 8; + } else if (track.algo() == reco::TrackBase::pixelLessStep) { + myalgo = 9; + } else if (track.algo() == reco::TrackBase::tobTecStep) { + myalgo = 10; + } else if (track.algo() == reco::TrackBase::jetCoreRegionalStep) { + myalgo = 11; + } else if (track.algo() == reco::TrackBase::muonSeededStepInOut) { + myalgo = 13; + } else if (track.algo() == reco::TrackBase::muonSeededStepOutIn) { + myalgo = 14; + } else if (track.algo() == reco::TrackBase::highPtTripletStep) { + myalgo = 22; + } else if (track.algo() == reco::TrackBase::lowPtQuadStep) { + myalgo = 23; + } else if (track.algo() == reco::TrackBase::detachedQuadStep) { + myalgo = 24; + } else { + myalgo = 25; + edm::LogWarning("LhcTrackAnalyzer") + << "LhcTrackAnalyzer does not support all types of tracks, encountered one from algo " + << reco::TrackBase::algoName(track.algo()); + } + trkAlgo_[nTracks_] = myalgo; + + int myquality = -99; + if (track.quality(reco::TrackBase::undefQuality)) + myquality = -1; + if (track.quality(reco::TrackBase::loose)) + myquality = 0; + if (track.quality(reco::TrackBase::tight)) + myquality = 1; + if (track.quality(reco::TrackBase::highPurity)) + myquality = 2; + trkQuality_[nTracks_] = myquality; + + if (track.quality(reco::TrackBase::highPurity)) + isHighPurity_[nTracks_] = 1; + else + isHighPurity_[nTracks_] = 0; + nTracks_++; + + } //end loop on tracks + + for (int d = 0; d < nTracks_; ++d) { + if (abs(trkQuality_[d]) > 5) + edm::LogInfo("LhcTrackAnalyzer") << "MYQUALITY!!! " << trkQuality_[d] << " at track # " << d << "/" << nTracks_ + << endl; + } + + rootTree_->Fill(); +} + +/*****************************************************************************/ +void LhcTrackAnalyzer::beginJob() +/*****************************************************************************/ +{ + edm::LogInfo("beginJob") << "Begin Job" << std::endl; + // Define TTree for output + rootFile_ = new TFile(filename_.c_str(), "recreate"); + rootTree_ = new TTree("tree", "Lhc Track tree"); + + // Track Paramters + rootTree_->Branch("run", &run_, "run/I"); + rootTree_->Branch("event", &event_, "event/I"); + rootTree_->Branch("goodbx", &goodbx_, "goodbx/O"); + rootTree_->Branch("goodvtx", &goodvtx_, "goodvtx/O"); + rootTree_->Branch("nTracks", &nTracks_, "nTracks/I"); + rootTree_->Branch("pt", &pt_, "pt[nTracks]/D"); + rootTree_->Branch("eta", &eta_, "eta[nTracks]/D"); + rootTree_->Branch("phi", &phi_, "phi[nTracks]/D"); + rootTree_->Branch("chi2", &chi2_, "chi2[nTracks]/D"); + rootTree_->Branch("chi2ndof", &chi2ndof_, "chi2ndof[nTracks]/D"); + rootTree_->Branch("charge", &charge_, "charge[nTracks]/I"); + rootTree_->Branch("qoverp", &qoverp_, "qoverp[nTracks]/D"); + rootTree_->Branch("dz", &dz_, "dz[nTracks]/D"); + rootTree_->Branch("dxy", &dxy_, "dxy[nTracks]/D"); + rootTree_->Branch("xPCA", &xPCA_, "xPCA[nTracks]/D"); + rootTree_->Branch("yPCA", &yPCA_, "yPCA[nTracks]/D"); + rootTree_->Branch("zPCA", &zPCA_, "zPCA[nTracks]/D"); + rootTree_->Branch("isHighPurity", &isHighPurity_, "isHighPurity[nTracks]/I"); + rootTree_->Branch("trkQuality", &trkQuality_, "trkQuality[nTracks]/I"); + rootTree_->Branch("trkAlgo", &trkAlgo_, "trkAlgo[nTracks]/I"); + rootTree_->Branch("nValidHits", &validhits_, "nValidHits[nTracks][7]/I"); +} + +/*****************************************************************************/ +void LhcTrackAnalyzer::endJob() +/*****************************************************************************/ +{ + if (rootFile_) { + rootFile_->Write(); + rootFile_->Close(); + } +} + +/*****************************************************************************/ +void LhcTrackAnalyzer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) +/*****************************************************************************/ +{ + edm::ParameterSetDescription desc; + desc.setComment("Ntuplizer for LHC tracks"); + desc.add("TrackCollectionTag", edm::InputTag("ALCARECOTkAlMinBias")); + desc.add("PVtxCollectionTag", edm::InputTag("offlinePrimaryVertices")); + desc.add("Debug", false); + desc.add>("acceptedBX", {}); + desc.add("OutputFileName", "LhcTrackAnalyzer_Output_default.root"); + descriptions.addWithDefaultLabel(desc); +} + +/*****************************************************************************/ +void LhcTrackAnalyzer::SetVarToZero() +/*****************************************************************************/ +{ + run_ = -1; + event_ = -99; + nTracks_ = 0; + for (int i = 0; i < nMaxtracks_; ++i) { + pt_[i] = 0; + eta_[i] = 0; + phi_[i] = 0; + chi2_[i] = 0; + chi2ndof_[i] = 0; + charge_[i] = 0; + qoverp_[i] = 0; + dz_[i] = 0; + dxy_[i] = 0; + xPCA_[i] = 0; + yPCA_[i] = 0; + zPCA_[i] = 0; + trkQuality_[i] = 0; + trkAlgo_[i] = -1; + isHighPurity_[i] = -3; + for (int j = 0; j < 7; j++) { + validhits_[nTracks_][j] = -1 * j; + } + } +} + +//define this as a plug-in +DEFINE_FWK_MODULE(LhcTrackAnalyzer); diff --git a/Alignment/HIPAlignmentAlgorithm/src/HIPAlignmentAlgorithm.cc b/Alignment/HIPAlignmentAlgorithm/src/HIPAlignmentAlgorithm.cc index 1f0cb0c349b86..39c6612187990 100644 --- a/Alignment/HIPAlignmentAlgorithm/src/HIPAlignmentAlgorithm.cc +++ b/Alignment/HIPAlignmentAlgorithm/src/HIPAlignmentAlgorithm.cc @@ -12,28 +12,28 @@ #include "FWCore/MessageLogger/interface/MessageLogger.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "FWCore/Framework/interface/Run.h" +#include "FWCore/Framework/interface/ESTransientHandle.h" +#include "FWCore/Framework/interface/EventSetup.h" +#include "FWCore/Framework/interface/ValidityInterval.h" #include "TrackingTools/PatternTools/interface/Trajectory.h" #include "TrackingTools/TrackFitters/interface/TrajectoryStateCombiner.h" #include "Alignment/CommonAlignment/interface/Alignable.h" #include "Alignment/CommonAlignment/interface/AlignableDetUnit.h" +#include "Alignment/CommonAlignment/interface/AlignableExtras.h" #include "Alignment/CommonAlignment/interface/AlignmentParameters.h" #include "Alignment/CommonAlignment/interface/SurveyResidual.h" -#include "Alignment/CommonAlignmentAlgorithm/interface/AlignmentParameterStore.h" #include "Alignment/CommonAlignmentAlgorithm/interface/AlignmentParameterSelector.h" +#include "Alignment/CommonAlignmentAlgorithm/interface/AlignmentParameterStore.h" #include "Alignment/HIPAlignmentAlgorithm/interface/HIPUserVariables.h" #include "Alignment/HIPAlignmentAlgorithm/interface/HIPUserVariablesIORoot.h" #include "Alignment/MuonAlignment/interface/AlignableMuon.h" -#include #include "Alignment/TrackerAlignment/interface/AlignableTracker.h" -#include "Alignment/CommonAlignment/interface/AlignableExtras.h" -#include "DataFormats/TrackReco/interface/Track.h" #include "CondFormats/AlignmentRecord/interface/GlobalPositionRcd.h" #include "CondFormats/AlignmentRecord/interface/TrackerAlignmentRcd.h" -#include "FWCore/Framework/interface/ValidityInterval.h" -#include "FWCore/Framework/interface/ESTransientHandle.h" -#include "FWCore/Framework/interface/EventSetup.h" +#include "DataFormats/GeometrySurface/interface/LocalError.h" +#include "DataFormats/TrackReco/interface/Track.h" #include "Alignment/HIPAlignmentAlgorithm/interface/HIPAlignmentAlgorithm.h" @@ -83,7 +83,6 @@ HIPAlignmentAlgorithm::HIPAlignmentAlgorithm(const edm::ParameterSet& cfg, edm:: theIOVrangeSet = cfg.getParameter>("IOVrange"); defaultAlignableSpecs.minNHits = cfg.getParameter("minimumNumberOfHits"); - ; defaultAlignableSpecs.minRelParError = cfg.getParameter("minRelParameterError"); defaultAlignableSpecs.maxRelParError = cfg.getParameter("maxRelParameterError"); defaultAlignableSpecs.maxHitPull = cfg.getParameter("maxAllowedHitPull"); diff --git a/Alignment/HIPAlignmentAlgorithm/src/LhcTrackAnalyzer.cc b/Alignment/HIPAlignmentAlgorithm/src/LhcTrackAnalyzer.cc deleted file mode 100644 index 37c427c70b022..0000000000000 --- a/Alignment/HIPAlignmentAlgorithm/src/LhcTrackAnalyzer.cc +++ /dev/null @@ -1,277 +0,0 @@ -// -*- C++ -*- -// -// Package: LhcTrackAnalyzer -// Class: LhcTrackAnalyzer -// -/**\class LhcTrackAnalyzer LhcTrackAnalyzer.cc MySub/LhcTrackAnalyzer/src/LhcTrackAnalyzer.cc - -Originally written by M.Musich -Expanded by A. Bonato - - Description: - - Implementation: - -*/ -// - -// updated to 25/2/2009 5.30 pm - -// -// - -// system include files -#include - -// user include files -#include "Alignment/HIPAlignmentAlgorithm/interface/LhcTrackAnalyzer.h" -#include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/EDAnalyzer.h" - -#include "SimDataFormats/EncodedEventId/interface/EncodedEventId.h" -#include "FWCore/Framework/interface/Event.h" -#include -#include "FWCore/Framework/interface/MakerMacros.h" - -#include "FWCore/ParameterSet/interface/ParameterSet.h" - -#include "TH1F.h" -#include "TH2F.h" -#include "TFile.h" -#include "TROOT.h" -#include "TChain.h" -#include "TNtuple.h" -#include "FWCore/ServiceRegistry/interface/Service.h" -#include "CommonTools/UtilAlgos/interface/TFileService.h" -#include "Geometry/Records/interface/TrackerDigiGeometryRecord.h" -#include -#include -#include -#include -#include "MagneticField/Engine/interface/MagneticField.h" -#include "MagneticField/Records/interface/IdealMagneticFieldRecord.h" - -#include "DataFormats/TrackReco/interface/Track.h" -#include "DataFormats/TrackReco/interface/TrackFwd.h" -#include "DataFormats/VertexReco/interface/Vertex.h" -#include "DataFormats/VertexReco/interface/VertexFwd.h" - -// Constructor - -LhcTrackAnalyzer::LhcTrackAnalyzer(const edm::ParameterSet& iConfig) - -{ - //now do what ever initialization is needed - debug_ = iConfig.getParameter("Debug"); - TrackCollectionTag_ = iConfig.getParameter("TrackCollectionTag"); - PVtxCollectionTag_ = iConfig.getParameter("PVtxCollectionTag"); - filename_ = iConfig.getParameter("OutputFileName"); -} - -// Destructor -LhcTrackAnalyzer::~LhcTrackAnalyzer() { - // do anything here that needs to be done at desctruction time - // (e.g. close files, deallocate resources etc.) -} - -// -// member functions -// - -// ------------ method called to for each event ------------ -void LhcTrackAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) { - using namespace edm; - using namespace reco; - using namespace std; - - //======================================================= - // Initialize Root-tuple variables - //======================================================= - - SetVarToZero(); - - //======================================================= - // Retrieve the Track information - //======================================================= - - Handle trackCollectionHandle; - iEvent.getByLabel(TrackCollectionTag_, trackCollectionHandle); - Handle vertexCollectionHandle; - iEvent.getByLabel(PVtxCollectionTag_, vertexCollectionHandle); - for (VertexCollection::const_iterator vtx = vertexCollectionHandle->begin(); vtx != vertexCollectionHandle->end(); - ++vtx) { - if (vtx == vertexCollectionHandle->begin()) { - if (vtx->isFake()) - goodvtx_ = false; - else - goodvtx_ = true; - } else - break; - } - - goodbx_ = true; - // int bx = iEvent.bunchCrossing(); - //if (bx==51 || bx==2724) goodbx_=true; - - run_ = iEvent.id().run(); - event_ = iEvent.id().event(); - - if (debug_) - cout << "LhcTrackAnalyzer::analyze() looping over " << trackCollectionHandle->size() << "tracks." << endl; - - // unsigned int i = 0; - for (TrackCollection::const_iterator track = trackCollectionHandle->begin(); track != trackCollectionHandle->end(); - ++track) { - if (nTracks_ >= nMaxtracks_) { - std::cout << " LhcTrackAnalyzer::analyze() : Warning - Run " << run_ << " Event " << event_ - << "\tNumber of tracks: " << trackCollectionHandle->size() << " , greater than " << nMaxtracks_ - << std::endl; - continue; - } - pt_[nTracks_] = track->pt(); - eta_[nTracks_] = track->eta(); - phi_[nTracks_] = track->phi(); - chi2_[nTracks_] = track->chi2(); - chi2ndof_[nTracks_] = track->normalizedChi2(); - charge_[nTracks_] = track->charge(); - qoverp_[nTracks_] = track->qoverp(); - dz_[nTracks_] = track->dz(); - dxy_[nTracks_] = track->dxy(); - xPCA_[nTracks_] = track->vertex().x(); - yPCA_[nTracks_] = track->vertex().y(); - zPCA_[nTracks_] = track->vertex().z(); - validhits_[nTracks_][0] = track->numberOfValidHits(); - validhits_[nTracks_][1] = track->hitPattern().numberOfValidPixelBarrelHits(); - validhits_[nTracks_][2] = track->hitPattern().numberOfValidPixelEndcapHits(); - validhits_[nTracks_][3] = track->hitPattern().numberOfValidStripTIBHits(); - validhits_[nTracks_][4] = track->hitPattern().numberOfValidStripTIDHits(); - validhits_[nTracks_][5] = track->hitPattern().numberOfValidStripTOBHits(); - validhits_[nTracks_][6] = track->hitPattern().numberOfValidStripTECHits(); - - int myalgo = -88; - if (track->algo() == reco::TrackBase::undefAlgorithm) - myalgo = 0; - if (track->algo() == reco::TrackBase::ctf) - myalgo = 1; - if (track->algo() == reco::TrackBase::initialStep) - myalgo = 4; - if (track->algo() == reco::TrackBase::lowPtTripletStep) - myalgo = 5; - if (track->algo() == reco::TrackBase::pixelPairStep) - myalgo = 6; - if (track->algo() == reco::TrackBase::detachedTripletStep) - myalgo = 7; - if (track->algo() == reco::TrackBase::mixedTripletStep) - myalgo = 8; - if (track->algo() == reco::TrackBase::pixelLessStep) - myalgo = 9; - if (track->algo() == reco::TrackBase::tobTecStep) - myalgo = 10; - if (track->algo() == reco::TrackBase::jetCoreRegionalStep) - myalgo = 11; - // This class is pending the migration to Phase1 tracks - if (track->algo() == reco::TrackBase::highPtTripletStep || track->algo() == reco::TrackBase::lowPtQuadStep || - track->algo() == reco::TrackBase::detachedQuadStep) { - throw cms::Exception("Not implemented") - << "LhcTrackAnalyzer does not yet support phase1 tracks, encountered one from algo " - << reco::TrackBase::algoName(track->algo()); - } - trkAlgo_[nTracks_] = myalgo; - - int myquality = -99; - if (track->quality(reco::TrackBase::undefQuality)) - myquality = -1; - if (track->quality(reco::TrackBase::loose)) - myquality = 0; - if (track->quality(reco::TrackBase::tight)) - myquality = 1; - if (track->quality(reco::TrackBase::highPurity)) - myquality = 2; - //if(track->quality(reco::TrackBase::confirmed))myquality=3; - // if(track->quality(reco::TrackBase::goodIterative))myquality=4; - // if(track->quality(reco::TrackBase::qualitySize))myquality=5; - trkQuality_[nTracks_] = myquality; - - if (track->quality(reco::TrackBase::highPurity)) - isHighPurity_[nTracks_] = 1; - else - isHighPurity_[nTracks_] = 0; - nTracks_++; - - } //end loop on tracks - - for (int d = 0; d < nTracks_; ++d) { - if (abs(trkQuality_[d]) > 5) - cout << "MYQUALITY!!! " << trkQuality_[d] << " at track # " << d << "/" << nTracks_ << endl; - } - - rootTree_->Fill(); -} - -// ------------ method called once each job before begining the event loop ------------ -void LhcTrackAnalyzer::beginJob() { - edm::LogInfo("beginJob") << "Begin Job" << std::endl; - // Define TTree for output - rootFile_ = new TFile(filename_.c_str(), "recreate"); - rootTree_ = new TTree("tree", "Lhc Track tree"); - - // Track Paramters - rootTree_->Branch("run", &run_, "run/I"); - rootTree_->Branch("event", &event_, "event/I"); - rootTree_->Branch("goodbx", &goodbx_, "goodbx/O"); - rootTree_->Branch("goodvtx", &goodvtx_, "goodvtx/O"); - rootTree_->Branch("nTracks", &nTracks_, "nTracks/I"); - rootTree_->Branch("pt", &pt_, "pt[nTracks]/D"); - rootTree_->Branch("eta", &eta_, "eta[nTracks]/D"); - rootTree_->Branch("phi", &phi_, "phi[nTracks]/D"); - rootTree_->Branch("chi2", &chi2_, "chi2[nTracks]/D"); - rootTree_->Branch("chi2ndof", &chi2ndof_, "chi2ndof[nTracks]/D"); - rootTree_->Branch("charge", &charge_, "charge[nTracks]/I"); - rootTree_->Branch("qoverp", &qoverp_, "qoverp[nTracks]/D"); - rootTree_->Branch("dz", &dz_, "dz[nTracks]/D"); - rootTree_->Branch("dxy", &dxy_, "dxy[nTracks]/D"); - rootTree_->Branch("xPCA", &xPCA_, "xPCA[nTracks]/D"); - rootTree_->Branch("yPCA", &yPCA_, "yPCA[nTracks]/D"); - rootTree_->Branch("zPCA", &zPCA_, "zPCA[nTracks]/D"); - rootTree_->Branch("isHighPurity", &isHighPurity_, "isHighPurity[nTracks]/I"); - rootTree_->Branch("trkQuality", &trkQuality_, "trkQuality[nTracks]/I"); - rootTree_->Branch("trkAlgo", &trkAlgo_, "trkAlgo[nTracks]/I"); - rootTree_->Branch("nValidHits", &validhits_, "nValidHits[nTracks][7]/I"); -} - -// ------------ method called once each job just after ending the event loop ------------ -void LhcTrackAnalyzer::endJob() { - if (rootFile_) { - rootFile_->Write(); - rootFile_->Close(); - } -} - -void LhcTrackAnalyzer::SetVarToZero() { - run_ = -1; - event_ = -99; - nTracks_ = 0; - for (int i = 0; i < nMaxtracks_; ++i) { - pt_[i] = 0; - eta_[i] = 0; - phi_[i] = 0; - chi2_[i] = 0; - chi2ndof_[i] = 0; - charge_[i] = 0; - qoverp_[i] = 0; - dz_[i] = 0; - dxy_[i] = 0; - xPCA_[i] = 0; - yPCA_[i] = 0; - zPCA_[i] = 0; - trkQuality_[i] = 0; - trkAlgo_[i] = -1; - isHighPurity_[i] = -3; - for (int j = 0; j < 7; j++) { - validhits_[nTracks_][j] = -1 * j; - } - } -} - -//define this as a plug-in -DEFINE_FWK_MODULE(LhcTrackAnalyzer); diff --git a/Alignment/HIPAlignmentAlgorithm/test/LHCAnalyzer_cfg.py b/Alignment/HIPAlignmentAlgorithm/test/LHCAnalyzer_cfg.py index 9fe0ef598f395..a1b5b13ed6657 100644 --- a/Alignment/HIPAlignmentAlgorithm/test/LHCAnalyzer_cfg.py +++ b/Alignment/HIPAlignmentAlgorithm/test/LHCAnalyzer_cfg.py @@ -1,39 +1,44 @@ import FWCore.ParameterSet.Config as cms +from PhysicsTools.PatAlgos.patInputFiles_cff import filesRelValTTbarPileUpGENSIMRECO process = cms.Process("Demo") -##process.load("AuxCode.CheckTkCollection.Run123151_RECO_cff") +################################################################### +# Messages +################################################################### process.load("FWCore.MessageService.MessageLogger_cfi") MessageLogger = cms.Service("MessageLogger", cout = cms.untracked.PSet( - threshold = cms.untracked.string('WARNING') - ), + threshold = cms.untracked.string('WARNING') + ), destinations = cms.untracked.vstring('cout') ) process.MessageLogger.cerr.FwkReport.reportEvery = 1000 +################################################################### +# Conditions +################################################################### process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff") -process.GlobalTag.globaltag = 'GR09_R_34X_V2::All' -process.source = cms.Source("PoolSource", - fileNames = cms.untracked.vstring('rfio:///?svcClass=cmscafuser&path=/castor/cern.ch/cms/store/user/emiglior/ALCARECO/08Jan10/TkAlMinBias_123615.root','rfio:///?svcClass=cmscafuser&path=/castor/cern.ch/cms/store/user/emiglior/ALCARECO/08Jan10/TkAlMinBias_124009.root','rfio:///?svcClass=cmscafuser&path=/castor/cern.ch/cms/store/user/emiglior/ALCARECO/08Jan10/TkAlMinBias_124020.root','rfio:///?svcClass=cmscafuser&path=/castor/cern.ch/cms/store/user/emiglior/ALCARECO/08Jan10/TkAlMinBias_124022.root') - - -# - -#'rfio:///?svcClass=cmscafuser&path=/castor/cern.ch/cms/store/user/emiglior/ALCARECO/08Jan10/TkAlMinBias_124024.root','rfio:///?svcClass=cmscafuser&path=/castor/cern.ch/cms/store/user/emiglior/ALCARECO/08Jan10/TkAlMinBias_124030.root','rfio:///?svcClass=cmscafuser&path=/castor/cern.ch/cms/store/user/emiglior/ALCARECO/08Jan10/TkAlMinBias_124230.root' +from Configuration.AlCa.GlobalTag import GlobalTag +process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase1_2017_realistic', '') - -#,'rfio:///?svcClass=cmscafuser&path=/castor/cern.ch/cms/store/user/emiglior/ALCARECO/08Jan10/TkAlMinBias_124120.root' #2.36TeV run - -) +################################################################### +# Event source +################################################################### +process.source = cms.Source("PoolSource", + fileNames = filesRelValTTbarPileUpGENSIMRECO) process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(-1) ) +################################################################### +# Analyzer +################################################################### process.LhcTrackAnalyzer = cms.EDAnalyzer("LhcTrackAnalyzer", -# TrackCollectionTag = cms.InputTag("generalTracks"), - TrackCollectionTag = cms.InputTag("ALCARECOTkAlMinBias"), + TrackCollectionTag = cms.InputTag("generalTracks"), + #TrackCollectionTag = cms.InputTag("ALCARECOTkAlMinBias"), PVtxCollectionTag = cms.InputTag("offlinePrimaryVertices"), - OutputFileName = cms.string("AnalyzerOutput_1.root"), + acceptedBX = cms.vuint32(), # (51,2724) + OutputFileName = cms.string("AnalyzerOutput_1.root"), Debug = cms.bool(False) ) diff --git a/Alignment/LaserAlignment/BuildFile.xml b/Alignment/LaserAlignment/BuildFile.xml index fedafb9bdac8f..9b1e6ad9c934c 100644 --- a/Alignment/LaserAlignment/BuildFile.xml +++ b/Alignment/LaserAlignment/BuildFile.xml @@ -3,7 +3,6 @@ - diff --git a/Alignment/LaserAlignmentSimulation/test/LaserSimulation_cfg.py b/Alignment/LaserAlignmentSimulation/test/LaserSimulation_cfg.py index a16db8aba4d6a..fd55fb96fea33 100644 --- a/Alignment/LaserAlignmentSimulation/test/LaserSimulation_cfg.py +++ b/Alignment/LaserAlignmentSimulation/test/LaserSimulation_cfg.py @@ -9,7 +9,7 @@ # include default services, like RandomNumberGenerator process.load("Configuration.StandardSequences.Services_cff") -process.load("Configuration.StandardSequences.Geometry_cff") +process.load("Configuration.StandardSequences.GeometryDB_cff") process.load("Configuration.StandardSequences.MagneticField_cff") diff --git a/Alignment/MuonAlignment/test/make_SVGtemplates_cfg.py b/Alignment/MuonAlignment/test/make_SVGtemplates_cfg.py index 1648c91913181..330fcf7c86b98 100644 --- a/Alignment/MuonAlignment/test/make_SVGtemplates_cfg.py +++ b/Alignment/MuonAlignment/test/make_SVGtemplates_cfg.py @@ -4,7 +4,7 @@ process.source = cms.Source("EmptySource") process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(1)) -process.load("Configuration.StandardSequences.Geometry_cff") +process.load("Configuration.StandardSequences.GeometryDB_cff") process.MuonGeometrySVGTemplate = cms.EDAnalyzer("MuonGeometrySVGTemplate", wheelTemplateName = cms.string("wheel_template.svg")) diff --git a/Alignment/MuonAlignment/test/test_sanityCheck_cfg.py b/Alignment/MuonAlignment/test/test_sanityCheck_cfg.py index 5ca932fe0cb7d..8556076b92212 100644 --- a/Alignment/MuonAlignment/test/test_sanityCheck_cfg.py +++ b/Alignment/MuonAlignment/test/test_sanityCheck_cfg.py @@ -6,7 +6,7 @@ process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff") process.GlobalTag.globaltag = "MC_36Y_V10::All" -process.load("Configuration.StandardSequences.Geometry_cff") +process.load("Configuration.StandardSequences.GeometryDB_cff") from Alignment.MuonAlignment.MuonGeometrySanityCheck_cfi import * process.MuonGeometrySanityCheck = MuonGeometrySanityCheck.clone() diff --git a/Alignment/OfflineValidation/macros/PlotAlignmentValidation.C b/Alignment/OfflineValidation/macros/PlotAlignmentValidation.C index ac26ba7ea0a88..db8e05dae9419 100644 --- a/Alignment/OfflineValidation/macros/PlotAlignmentValidation.C +++ b/Alignment/OfflineValidation/macros/PlotAlignmentValidation.C @@ -42,26 +42,23 @@ #include #include - /*! \class PlotAlignmentValidation * \brief Class PlotAlignmentValidation * Class used as the last step for Offline Track Validation tool. * The main goal of this class is creating the plots regarding DMRs and Surface Deformations for modules and substructures. */ - //------------------------------------------------------------------------------ /*! \fn PlotAlignmentValidation * \brief Constructor for the class */ -PlotAlignmentValidation::PlotAlignmentValidation(bool bigtext) : bigtext_(bigtext) -{ +PlotAlignmentValidation::PlotAlignmentValidation(bool bigtext) : bigtext_(bigtext) { setOutputDir("."); setTreeBaseDir(); sourcelist = NULL; - - moreThanOneSource=false; + + moreThanOneSource = false; useFit_ = false; // Force ROOT to use scientific notation even with smaller datasets @@ -81,8 +78,9 @@ PlotAlignmentValidation::PlotAlignmentValidation(bool bigtext) : bigtext_(bigtex /*! \fn PlotAlignmentValidation * \brief Constructor for the class. This function also retrieves the list of root files used to produce DMRs and Surface Deformations */ -PlotAlignmentValidation::PlotAlignmentValidation(const char *inputFile,std::string legendName, int lineColor, int lineStyle, bool bigtext) : PlotAlignmentValidation(bigtext) -{ +PlotAlignmentValidation::PlotAlignmentValidation( + const char* inputFile, std::string legendName, int lineColor, int lineStyle, bool bigtext) + : PlotAlignmentValidation(bigtext) { loadFileList(inputFile, legendName, lineColor, lineStyle); } @@ -90,16 +88,12 @@ PlotAlignmentValidation::PlotAlignmentValidation(const char *inputFile,std::stri /*! \fn ~PlotAlignmentValidation * \brief Default destructor */ -PlotAlignmentValidation::~PlotAlignmentValidation() -{ - - for(std::vector::iterator it = sourceList.begin(); - it != sourceList.end(); ++it){ +PlotAlignmentValidation::~PlotAlignmentValidation() { + for (std::vector::iterator it = sourceList.begin(); it != sourceList.end(); ++it) { delete (*it); } delete sourcelist; - } //------------------------------------------------------------------------------ @@ -108,23 +102,21 @@ PlotAlignmentValidation::~PlotAlignmentValidation() * \brief Create/open the root and txt summary files, where the DMR histograms and the associtated mean/sigma are stored respectively */ - -void PlotAlignmentValidation::openSummaryFile() -{ +void PlotAlignmentValidation::openSummaryFile() { if (!openedsummaryfile) { openedsummaryfile = true; - summaryfile.open(outputDir+"/"+summaryfilename+".txt"); + summaryfile.open(TString(outputDir + "/") + summaryfilename + ".txt"); //Rootfile introduced to store the DMR histograms - rootsummaryfile= new TFile(outputDir+"/"+summaryfilename+".root","RECREATE"); + rootsummaryfile = new TFile(TString(outputDir + "/") + summaryfilename + ".root", "RECREATE"); for (auto vars : sourceList) { summaryfile << "\t" << vars->getName(); } summaryfile << "\tformat={}\n"; - }else{ + } else { //Check for the rootfile to be open, and open it in case it is not already. - if (!rootsummaryfile->IsOpen()) rootsummaryfile->Open(outputDir+"/"+summaryfilename+".root","UPDATE"); - + if (!rootsummaryfile->IsOpen()) + rootsummaryfile->Open(TString(outputDir + "/") + summaryfilename + ".root", "UPDATE"); } } @@ -132,27 +124,19 @@ void PlotAlignmentValidation::openSummaryFile() /*! \fn loadFileList * \brief Add to the list of sources the rootfile associated to a particular geometry */ -void PlotAlignmentValidation::loadFileList(const char *inputFile, std::string legendName, int lineColor, int lineStyle) -{ - +void PlotAlignmentValidation::loadFileList(const char* inputFile, std::string legendName, int lineColor, int lineStyle) { if (openedsummaryfile) { std::cout << "Can't load a root file after opening the summary file!" << std::endl; assert(0); } - sourceList.push_back( new TkOfflineVariables( inputFile, treeBaseDir, legendName, lineColor, lineStyle ) ); - + sourceList.push_back(new TkOfflineVariables(inputFile, treeBaseDir, legendName, lineColor, lineStyle)); } //------------------------------------------------------------------------------ /*! \fn useFitForDMRplots * \brief Store the selected boolean in one of the private members of the class */ -void PlotAlignmentValidation::useFitForDMRplots(bool usefit) -{ - - useFit_ = usefit; - -} +void PlotAlignmentValidation::useFitForDMRplots(bool usefit) { useFit_ = usefit; } //------------------------------------------------------------------------------ /*! \fn numberOfLayers @@ -161,27 +145,42 @@ void PlotAlignmentValidation::useFitForDMRplots(bool usefit) //TODO Possible improvement: reduce the number of switches in the code by implementing a map int PlotAlignmentValidation::numberOfLayers(int phase, int subdetector) { switch (phase) { - case 0: - switch (subdetector) { - case 1: return 3; - case 2: return 2; - case 3: return 4; - case 4: return 3; - case 5: return 6; - case 6: return 9; - default: assert(false); - } - case 1: - switch (subdetector) { - case 1: return 4; - case 2: return 3; - case 3: return 4; - case 4: return 3; - case 5: return 6; - case 6: return 9; - default: assert(false); - } - default: assert(false); + case 0: + switch (subdetector) { + case 1: + return 3; + case 2: + return 2; + case 3: + return 4; + case 4: + return 3; + case 5: + return 6; + case 6: + return 9; + default: + assert(false); + } + case 1: + switch (subdetector) { + case 1: + return 4; + case 2: + return 3; + case 3: + return 4; + case 4: + return 3; + case 5: + return 6; + case 6: + return 9; + default: + assert(false); + } + default: + assert(false); } return 0; } @@ -202,16 +201,14 @@ int PlotAlignmentValidation::maxNumberOfLayers(int subdetector) { /*! \fn legendOptions * \brief Assign legend options to members of the class */ -void PlotAlignmentValidation::legendOptions(TString options) -{ - +void PlotAlignmentValidation::legendOptions(TString options) { showMean_ = false; showRMS_ = false; showMeanError_ = false; showRMSError_ = false; showModules_ = false; showUnderOverFlow_ = false; - options.ReplaceAll(" ","").ToLower(); + options.ReplaceAll(" ", "").ToLower(); if (options.Contains("mean") || options.Contains("all")) showMean_ = true; if (options.Contains("meanerror") || options.Contains("all")) @@ -232,8 +229,7 @@ void PlotAlignmentValidation::legendOptions(TString options) /*! \fn setOutputDir * \brief Set the output direcotry */ -void PlotAlignmentValidation::setOutputDir( std::string dir ) -{ +void PlotAlignmentValidation::setOutputDir(std::string dir) { if (openedsummaryfile) { std::cout << "Can't set the output dir after opening the summary file!" << std::endl; assert(0); @@ -246,64 +242,81 @@ void PlotAlignmentValidation::setOutputDir( std::string dir ) /*! \fn plotSubDetResiduals * \brief Function used to plot residuals for a subdetector */ -void PlotAlignmentValidation::plotSubDetResiduals(bool plotNormHisto,unsigned int subDetId) -{ +void PlotAlignmentValidation::plotSubDetResiduals(bool plotNormHisto, unsigned int subDetId) { gStyle->SetOptStat(11111); gStyle->SetOptFit(0000); - TCanvas *c = new TCanvas("c", "c"); + TCanvas* c = new TCanvas("c", "c"); c->SetTopMargin(0.15); - TString histoName= ""; - if (plotNormHisto) {histoName= "h_NormXprime";} - else histoName= "h_Xprime_"; - switch (subDetId){ - case 1 : histoName+="TPBBarrel_0";break; - case 2 : histoName+="TPEendcap_1";break; - case 3 : histoName+="TPEendcap_2";break; - case 4 : histoName+="TIBBarrel_0";break; - case 5 : histoName+="TIDEndcap_1";break; - case 6 : histoName+="TIDEndcap_2";break; - case 7 : histoName+="TOBBarrel_3";break; - case 8 : histoName+="TECEndcap_4";break; - case 9 : histoName+="TECEndcap_5";break; + TString histoName = ""; + if (plotNormHisto) { + histoName = "h_NormXprime"; + } else + histoName = "h_Xprime_"; + switch (subDetId) { + case 1: + histoName += "TPBBarrel_0"; + break; + case 2: + histoName += "TPEendcap_1"; + break; + case 3: + histoName += "TPEendcap_2"; + break; + case 4: + histoName += "TIBBarrel_0"; + break; + case 5: + histoName += "TIDEndcap_1"; + break; + case 6: + histoName += "TIDEndcap_2"; + break; + case 7: + histoName += "TOBBarrel_3"; + break; + case 8: + histoName += "TECEndcap_4"; + break; + case 9: + histoName += "TECEndcap_5"; + break; } int tmpcounter = 0; - TH1 *sumHisto = 0; - for(std::vector::iterator it = sourceList.begin(); - it != sourceList.end(); ++it) { - if (tmpcounter == 0 ) { - TFile *f= (*it)->getFile(); - sumHisto =(TH1*) f->FindKeyAny(histoName)->ReadObj();//FindObjectAny(histoName.Data()); - sumHisto->SetLineColor(tmpcounter+1); - sumHisto->SetLineStyle(tmpcounter+1); + TH1* sumHisto = 0; + for (std::vector::iterator it = sourceList.begin(); it != sourceList.end(); ++it) { + if (tmpcounter == 0) { + TFile* f = (*it)->getFile(); + sumHisto = (TH1*)f->FindKeyAny(histoName)->ReadObj(); //FindObjectAny(histoName.Data()); + sumHisto->SetLineColor(tmpcounter + 1); + sumHisto->SetLineStyle(tmpcounter + 1); sumHisto->GetFunction("tmp")->SetBit(TF1::kNotDraw); sumHisto->Draw(); - + //get statistic box coordinate to plot all boxes one below the other //gStyle->SetStatY(0.91); //gStyle->SetStatW(0.15); //gStyle->SetStatBorderSize(1); //gStyle->SetStatH(0.10); - - + tmpcounter++; } else { - sumHisto = (TH1*) (*it)->getFile()->FindObjectAny(histoName); - sumHisto->SetLineColor(tmpcounter+1); - sumHisto->SetLineStyle(tmpcounter+1); + sumHisto = (TH1*)(*it)->getFile()->FindObjectAny(histoName); + sumHisto->SetLineColor(tmpcounter + 1); + sumHisto->SetLineStyle(tmpcounter + 1); sumHisto->GetFunction("tmp")->SetBit(TF1::kNotDraw); //hstack->Add(sumHisto); - + c->Update(); - tmpcounter++; + tmpcounter++; } - TObject *statObj = sumHisto->GetListOfFunctions()->FindObject("stats"); + TObject* statObj = sumHisto->GetListOfFunctions()->FindObject("stats"); if (statObj && statObj->InheritsFrom(TPaveStats::Class())) { - TPaveStats *stats = static_cast(statObj); - stats->SetLineColor(tmpcounter+1); - stats->SetTextColor(tmpcounter+1); + TPaveStats* stats = static_cast(statObj); + stats->SetLineColor(tmpcounter + 1); + stats->SetTextColor(tmpcounter + 1); stats->SetFillColor(10); - stats->SetX1NDC(0.91-tmpcounter*0.1); + stats->SetX1NDC(0.91 - tmpcounter * 0.1); stats->SetX2NDC(0.15); stats->SetY1NDC(1); stats->SetY2NDC(0.10); @@ -312,200 +325,191 @@ void PlotAlignmentValidation::plotSubDetResiduals(bool plotNormHisto,unsigned in } //hstack->Draw("nostack"); char PlotName[1000]; - sprintf( PlotName, "%s/%s.png", outputDir.c_str(), histoName.Data() ); + sprintf(PlotName, "%s/%s.png", outputDir.c_str(), histoName.Data()); c->Print(PlotName); - sprintf( PlotName, "%s/%s.eps", outputDir.c_str(), histoName.Data() ); + sprintf(PlotName, "%s/%s.eps", outputDir.c_str(), histoName.Data()); c->Print(PlotName); - sprintf( PlotName, "%s/%s.pdf", outputDir.c_str(), histoName.Data() ); + sprintf(PlotName, "%s/%s.pdf", outputDir.c_str(), histoName.Data()); c->Print(PlotName); - sprintf( PlotName, "%s/%s.root", outputDir.c_str(), histoName.Data() ); + sprintf(PlotName, "%s/%s.root", outputDir.c_str(), histoName.Data()); c->Print(PlotName); //delete c; //c=0; - } //------------------------------------------------------------------------------ -void PlotAlignmentValidation::plotHitMaps() -{ - +void PlotAlignmentValidation::plotHitMaps() { //gStyle->SetOptStat(0); - - TCanvas *c = new TCanvas("c", "c", 1200,400); - c->Divide(3,1); + + TCanvas* c = new TCanvas("c", "c", 1200, 400); + c->Divide(3, 1); //ps->NewPage(); //------------------------------------------------- //plot Hit map //------------------------------------------------- - std::string histName_="Entriesprofile"; + std::string histName_ = "Entriesprofile"; c->cd(1); - TTree *tree= (*sourceList.begin())->getTree(); - tree->Draw("entries:posR:posZ","","COLZ2Prof"); + TTree* tree = (*sourceList.begin())->getTree(); + tree->Draw("entries:posR:posZ", "", "COLZ2Prof"); c->cd(2); - tree->Draw("entries:posY:posX","","COLZ2Prof"); + tree->Draw("entries:posY:posX", "", "COLZ2Prof"); c->cd(3); - tree->Draw("entries:posR:posPhi","","COLZ2Prof"); - + tree->Draw("entries:posR:posPhi", "", "COLZ2Prof"); + char PlotName[1000]; - sprintf( PlotName, "%s/%s.png", outputDir.c_str(), histName_.c_str() ); + sprintf(PlotName, "%s/%s.png", outputDir.c_str(), histName_.c_str()); c->Print(PlotName); - sprintf( PlotName, "%s/%s.eps", outputDir.c_str(), histName_.c_str() ); + sprintf(PlotName, "%s/%s.eps", outputDir.c_str(), histName_.c_str()); c->Print(PlotName); - sprintf( PlotName, "%s/%s.pdf", outputDir.c_str(), histName_.c_str() ); + sprintf(PlotName, "%s/%s.pdf", outputDir.c_str(), histName_.c_str()); c->Print(PlotName); - sprintf( PlotName, "%s/%s.root", outputDir.c_str(), histName_.c_str() ); + sprintf(PlotName, "%s/%s.root", outputDir.c_str(), histName_.c_str()); c->Print(PlotName); // //c->Update(); - c->Close(); + c->Close(); //---------------------------------------------------- - } //------------------------------------------------------------------------------ -void PlotAlignmentValidation::plotOutlierModules(const char *outputFileName, std::string plotVariable, - float plotVariable_cut ,int unsigned minHits) -{ - - Int_t counter=0; - +void PlotAlignmentValidation::plotOutlierModules(const char* outputFileName, + std::string plotVariable, + float plotVariable_cut, + int unsigned minHits) { + Int_t counter = 0; + gStyle->SetOptStat(111111); gStyle->SetStatY(0.9); //TList* treelist=getTreeList(); - - TCanvas *c1 = new TCanvas("canv", "canv", 800, 500); - outputFile = outputDir +'/'+ outputFileName; - c1->Print( (outputFile+'[').Data() ); - - - c1->Divide(2,1); - - TTree *tree= (*sourceList.begin())->getTree(); - TkOffTreeVariables *treeMem = 0; // ROOT will initilise + + TCanvas* c1 = new TCanvas("canv", "canv", 800, 500); + outputFile = outputDir + '/' + outputFileName; + c1->Print((outputFile + '[').Data()); + + c1->Divide(2, 1); + + TTree* tree = (*sourceList.begin())->getTree(); + TkOffTreeVariables* treeMem = 0; // ROOT will initilise tree->SetBranchAddress("TkOffTreeVariables", &treeMem); - - - Long64_t nentries = tree->GetEntriesFast(); - - for (Long64_t i = 0; i < nentries; i++){ - + + Long64_t nentries = tree->GetEntriesFast(); + + for (Long64_t i = 0; i < nentries; i++) { tree->GetEntry(i); float var = 0; - if (plotVariable == "chi2PerDofX") var =treeMem->chi2PerDofX; - else if(plotVariable == "chi2PerDofY") var =treeMem->chi2PerDofY; - else if(plotVariable == "fitMeanX") var =treeMem->fitMeanX; - else if(plotVariable == "fitMeanY") var =treeMem->fitMeanY; - else if(plotVariable == "fitSigmaX") var =treeMem->fitSigmaX; - else if(plotVariable == "fitSigmaY") var =treeMem->fitSigmaY; + if (plotVariable == "chi2PerDofX") + var = treeMem->chi2PerDofX; + else if (plotVariable == "chi2PerDofY") + var = treeMem->chi2PerDofY; + else if (plotVariable == "fitMeanX") + var = treeMem->fitMeanX; + else if (plotVariable == "fitMeanY") + var = treeMem->fitMeanY; + else if (plotVariable == "fitSigmaX") + var = treeMem->fitSigmaX; + else if (plotVariable == "fitSigmaY") + var = treeMem->fitSigmaY; else { - cout<<"There is no variable "<entries "<entries< plotVariable_cut && treeMem->entries > minHits) - { - - TFile *f=(*sourceList.begin())->getFile();//(TFile*)sourcelist->First(); - - if(f->FindKeyAny(treeMem->histNameX.c_str())!=0){ - TH1 *h = (TH1*) f->FindKeyAny(treeMem->histNameX.c_str())->ReadObj();//f->FindObjectAny(treeMem->histNameX.c_str()); - gStyle->SetOptFit(0111); - cout<<"hist name "<GetName()<GetPath(), "TrackerOfflineValidation" ); - //cout<<"hist path "<GetEntries()<cd(0); - TPaveText * text=new TPaveText(0,0.95,0.99,0.99); - text->AddText(path); - text->SetFillColor(0); - text->SetShadowColor(0); - text->SetBorderSize( 0 ); - text->Draw(); - - //residual histogram - c1->cd(1); - TPad *subpad = (TPad*)c1->GetPad(1); - subpad->SetPad(0,0,0.5,0.94); - h->Draw(); - - //norm. residual histogram - h = (TH1*) f->FindObjectAny(treeMem->histNameNormX.c_str()); - if(h) cout<GetEntries()<cd(2); - TPad *subpad2 = (TPad*)c1->GetPad(2); - subpad2->SetPad(0.5,0,0.99,0.94); - h->Draw(); - - c1->Print(outputFile); - counter++; - } - else{ - cout<<"There are no residual histograms on module level stored!"<entries "<entries< plotVariable_cut && treeMem->entries > minHits) { + TFile* f = (*sourceList.begin())->getFile(); //(TFile*)sourcelist->First(); + + if (f->FindKeyAny(treeMem->histNameX.c_str()) != 0) { + TH1* h = + (TH1*)f->FindKeyAny(treeMem->histNameX.c_str())->ReadObj(); //f->FindObjectAny(treeMem->histNameX.c_str()); + gStyle->SetOptFit(0111); + cout << "hist name " << h->GetName() << endl; + + TString path = (char*)strstr(gDirectory->GetPath(), "TrackerOfflineValidation"); + //cout<<"hist path "<GetEntries() << endl; + + //modules' location as title + c1->cd(0); + TPaveText* text = new TPaveText(0, 0.95, 0.99, 0.99); + text->AddText(path); + text->SetFillColor(0); + text->SetShadowColor(0); + text->SetBorderSize(0); + text->Draw(); + + //residual histogram + c1->cd(1); + TPad* subpad = (TPad*)c1->GetPad(1); + subpad->SetPad(0, 0, 0.5, 0.94); + h->Draw(); + + //norm. residual histogram + h = (TH1*)f->FindObjectAny(treeMem->histNameNormX.c_str()); + if (h) + cout << h->GetEntries() << endl; + c1->cd(2); + TPad* subpad2 = (TPad*)c1->GetPad(2); + subpad2->SetPad(0.5, 0, 0.99, 0.94); + h->Draw(); + + c1->Print(outputFile); + counter++; + } else { + cout << "There are no residual histograms on module level stored!" << endl; + cout << "Please make sure that moduleLevelHistsTransient = cms.bool(False) in the validation job!" << endl; + break; } - + } } - c1->Print( (outputFile+"]").Data() ); - if (counter == 0) cout<<"no bad modules found"<Print((outputFile + "]").Data()); + if (counter == 0) + cout << "no bad modules found" << endl; + //read the number of entries in the t3 //TTree* tree=0; //tree=(TTree*)treeList->At(0); - - + //c1->Close(); - } //------------------------------------------------------------------------------ /*! \fn getTreeList * \brief Extract from the rootfiles stored in the sourcelist the corresponding trees. */ -TList* PlotAlignmentValidation::getTreeList() -{ - TList *treeList = new TList(); - TFile *first_source = (TFile*)sourcelist->First(); - std::cout<GetName()<Get( treeBaseDir.c_str() ); - treeList->Add( (TTree*)(*d).Get("TkOffVal") ); - - if( moreThanOneSource ==true ){ - TFile *nextsource = (TFile*)sourcelist->After( first_source ); - while ( nextsource ) { - std::cout<GetName()<Get("TrackerOfflineValidation"); - +TList* PlotAlignmentValidation::getTreeList() { + TList* treeList = new TList(); + TFile* first_source = (TFile*)sourcelist->First(); + std::cout << first_source->GetName() << std::endl; + TDirectoryFile* d = (TDirectoryFile*)first_source->Get(treeBaseDir.c_str()); + treeList->Add((TTree*)(*d).Get("TkOffVal")); + + if (moreThanOneSource == true) { + TFile* nextsource = (TFile*)sourcelist->After(first_source); + while (nextsource) { + std::cout << nextsource->GetName() << std::endl; + d = (TDirectoryFile*)nextsource->Get("TrackerOfflineValidation"); + treeList->Add((TTree*)(*d).Get("TkOffVal")); - - nextsource = (TFile*)sourcelist->After( nextsource ); + + nextsource = (TFile*)sourcelist->After(nextsource); } } return treeList; } //------------------------------------------------------------------------------ -void PlotAlignmentValidation::setTreeBaseDir( std::string dir ) -{ - treeBaseDir = dir; -} +void PlotAlignmentValidation::setTreeBaseDir(std::string dir) { treeBaseDir = dir; } //------------------------------------------------------------------------------ -void PlotAlignmentValidation::plotSurfaceShapes( const std::string& options, const std::string& residType ) -{ +void PlotAlignmentValidation::plotSurfaceShapes(const std::string& options, const std::string& residType) { cout << "-------- plotSurfaceShapes called with " << options << endl; if (options == "none") return; - else if (options == "coarse"){ + else if (options == "coarse") { plotSS("subdet=1"); plotSS("subdet=2"); plotSS("subdet=3"); @@ -514,23 +518,22 @@ void PlotAlignmentValidation::plotSurfaceShapes( const std::string& options, con plotSS("subdet=6"); } // else if (options == "fine") ... - else - plotSS( options, residType ); + else + plotSS(options, residType); return; } //------------------------------------------------------------------------------ -void PlotAlignmentValidation::plotSS( const std::string& options, const std::string& residType ) -{ +void PlotAlignmentValidation::plotSS(const std::string& options, const std::string& residType) { if (residType == "") { - plotSS( options, "ResXvsXProfile"); - plotSS( options, "ResXvsYProfile"); + plotSS(options, "ResXvsXProfile"); + plotSS(options, "ResXvsYProfile"); return; } int bkperrorx = gStyle->GetErrorX(); - gStyle->SetErrorX(1); //regardless of style settings, we want x error bars here + gStyle->SetErrorX(1); //regardless of style settings, we want x error bars here int plotLayerN = 0; // int plotRingN = 0; @@ -538,41 +541,44 @@ void PlotAlignmentValidation::plotSS( const std::string& options, const std::str bool plotLayers = false; // overrides plotLayerN // bool plotRings = false; // Todo: implement this? bool plotSplits = false; - int plotSubDetN = 0; // if zero, plot all + int plotSubDetN = 0; // if zero, plot all TRegexp layer_re("layer=[0-9]+"); Ssiz_t index, len; - if (options.find("split") != std::string::npos) { plotSplits = true; } - if (options.find("layers") != std::string::npos) { plotLayers = true; } + if (options.find("split") != std::string::npos) { + plotSplits = true; + } + if (options.find("layers") != std::string::npos) { + plotLayers = true; + } if ((index = layer_re.Index(options, &len)) != -1) { if (plotLayers) { std::cerr << "Warning: option 'layers' overrides 'layer=N'" << std::endl; } else { - std::string substr = options.substr(index+6, len-6); + std::string substr = options.substr(index + 6, len - 6); plotLayerN = atoi(substr.c_str()); } } TRegexp subdet_re("subdet=[1-6]+"); if ((index = subdet_re.Index(options, &len)) != -1) { - std::string substr = options.substr(index+7, len-7); + std::string substr = options.substr(index + 7, len - 7); plotSubDetN = atoi(substr.c_str()); } gStyle->SetOptStat(0); - + TCanvas c("canv", "canv"); // todo: title, min/max, nbins? // Loop over detectors - for (int iSubDet=1; iSubDet<=6; ++iSubDet) { - + for (int iSubDet = 1; iSubDet <= 6; ++iSubDet) { // TEC requires special care since rings 1-4 and 5-7 are plotted separately - bool isTEC = (iSubDet==6); + bool isTEC = (iSubDet == 6); // if subdet is specified, skip other subdets - if (plotSubDetN!=0 && iSubDet!=plotSubDetN) + if (plotSubDetN != 0 && iSubDet != plotSubDetN) continue; // Skips plotting too high layers @@ -586,120 +592,131 @@ void PlotAlignmentValidation::plotSS( const std::string& options, const std::str int maxlayer = plotLayers ? maxNumberOfLayers(iSubDet) : plotLayerN; // see later where this is used int maxlayerphase0 = plotLayers ? numberOfLayers(0, iSubDet) : plotLayerN; - + for (int layer = minlayer; layer <= maxlayer; layer++) { + // two plots for TEC, skip first + for (int iTEC = 0; iTEC < 2; iTEC++) { + if (!isTEC && iTEC == 0) + continue; + + char selection[1000]; + if (!isTEC) { + if (layer == 0) + sprintf(selection, "subDetId==%d", iSubDet); + else + sprintf(selection, "subDetId==%d && layer == %d", iSubDet, layer); + } else { // TEC + if (iTEC == 0) // rings + sprintf(selection, "subDetId==%d && ring <= 4", iSubDet); + else + sprintf(selection, "subDetId==%d && ring > 4", iSubDet); + } - // two plots for TEC, skip first - for (int iTEC = 0; iTEC<2; iTEC++) { - if (!isTEC && iTEC==0) continue; - - char selection[1000]; - if (!isTEC){ - if (layer==0) - sprintf(selection,"subDetId==%d",iSubDet); - else - sprintf(selection,"subDetId==%d && layer == %d",iSubDet,layer); - } - else{ // TEC - if (iTEC==0) // rings - sprintf(selection,"subDetId==%d && ring <= 4",iSubDet); - else - sprintf(selection,"subDetId==%d && ring > 4",iSubDet); - } - - - // Title for plot and name for the file - - TString subDetName; - switch (iSubDet) { - case 1: subDetName = "BPIX"; break; - case 2: subDetName = "FPIX"; break; - case 3: subDetName = "TIB"; break; - case 4: subDetName = "TID"; break; - case 5: subDetName = "TOB"; break; - case 6: subDetName = "TEC"; break; - } + // Title for plot and name for the file + + TString subDetName; + switch (iSubDet) { + case 1: + subDetName = "BPIX"; + break; + case 2: + subDetName = "FPIX"; + break; + case 3: + subDetName = "TIB"; + break; + case 4: + subDetName = "TID"; + break; + case 5: + subDetName = "TOB"; + break; + case 6: + subDetName = "TEC"; + break; + } TString secondline = ""; - if (layer!=0) { - // TEC and TID have discs, the rest have layers - if (iSubDet==4 || iSubDet==6) - secondline = "disc "; - else { - secondline = "layer "; - } - secondline += Form("%d",layer); - secondline += " "; - } - if (isTEC && iTEC==0) - secondline += TString("R1-4"); - if (isTEC && iTEC>0) - secondline += TString("R5-7"); - - // Generate histograms with selection - TLegend* legend = 0; + if (layer != 0) { + // TEC and TID have discs, the rest have layers + if (iSubDet == 4 || iSubDet == 6) + secondline = "disc "; + else { + secondline = "layer "; + } + secondline += Form("%d", layer); + secondline += " "; + } + if (isTEC && iTEC == 0) + secondline += TString("R1-4"); + if (isTEC && iTEC > 0) + secondline += TString("R5-7"); + + // Generate histograms with selection + TLegend* legend = 0; // Any file from phase 0 will be skipped if the last argument is false - THStack *hs = addHists(selection, residType, &legend, false, /*validforphase0 = */layer <= maxlayerphase0); - if (!hs || hs->GetHists()==0 || hs->GetHists()->GetSize()==0) { - std::cout << "No histogram for " << subDetName << - ", perhaps not enough data? Creating default histogram." << std::endl; - if(hs == 0) - hs = new THStack("hstack", ""); - - TProfile* defhist = new TProfile("defhist", "Empty default histogram", 100, -1, 1, -1, 1); - hs->Add(defhist); - hs->Draw(); - } - else { - hs->Draw("nostack PE"); - modifySSHistAndLegend(hs, legend); - legend->Draw(); - setTitleStyle(*hs, "", "", iSubDet, true, secondline); - - // Adjust Labels - TH1* firstHisto = (TH1*) hs->GetHists()->First(); - TString xName = firstHisto->GetXaxis()->GetTitle(); - TString yName = firstHisto->GetYaxis()->GetTitle(); - hs->GetHistogram()->GetXaxis()->SetTitleColor( kBlack ); - hs->GetHistogram()->GetXaxis()->SetTitle( xName ); - hs->GetHistogram()->GetYaxis()->SetTitleColor( kBlack ); - // micrometers: - yName.ReplaceAll("cm", "#mum"); - hs->GetHistogram()->GetYaxis()->SetTitle( yName ); - } - - // Save plot to file - std::ostringstream plotName; - plotName << outputDir << "/SurfaceShape_" << subDetName << "_"; - plotName << residType; - if (layer!=0) { - plotName << "_"; - // TEC and TID have discs, the rest have layers - if (iSubDet==4 || iSubDet==6) - plotName << "disc"; - else { - plotName << "layer"; - } - plotName << layer; - } - if (isTEC && iTEC==0) - plotName << "_" << "R1-4"; - if (isTEC && iTEC>0) - plotName << "_" << "R5-7"; - - // PNG,EPS,PDF files - c.Update(); - c.Print((plotName.str() + ".png").c_str()); - c.Print((plotName.str() + ".eps").c_str()); - c.Print((plotName.str() + ".pdf").c_str()); - - // ROOT file - TFile f((plotName.str() + ".root").c_str(), "recreate"); - c.Write(); - f.Close(); - - delete legend; - delete hs; + THStack* hs = addHists(selection, residType, &legend, false, /*validforphase0 = */ layer <= maxlayerphase0); + if (!hs || hs->GetHists() == 0 || hs->GetHists()->GetSize() == 0) { + std::cout << "No histogram for " << subDetName << ", perhaps not enough data? Creating default histogram." + << std::endl; + if (hs == 0) + hs = new THStack("hstack", ""); + + TProfile* defhist = new TProfile("defhist", "Empty default histogram", 100, -1, 1, -1, 1); + hs->Add(defhist); + hs->Draw(); + } else { + hs->Draw("nostack PE"); + modifySSHistAndLegend(hs, legend); + legend->Draw(); + setTitleStyle(*hs, "", "", iSubDet, true, secondline); + + // Adjust Labels + TH1* firstHisto = (TH1*)hs->GetHists()->First(); + TString xName = firstHisto->GetXaxis()->GetTitle(); + TString yName = firstHisto->GetYaxis()->GetTitle(); + hs->GetHistogram()->GetXaxis()->SetTitleColor(kBlack); + hs->GetHistogram()->GetXaxis()->SetTitle(xName); + hs->GetHistogram()->GetYaxis()->SetTitleColor(kBlack); + // micrometers: + yName.ReplaceAll("cm", "#mum"); + hs->GetHistogram()->GetYaxis()->SetTitle(yName); + } + + // Save plot to file + std::ostringstream plotName; + plotName << outputDir << "/SurfaceShape_" << subDetName << "_"; + plotName << residType; + if (layer != 0) { + plotName << "_"; + // TEC and TID have discs, the rest have layers + if (iSubDet == 4 || iSubDet == 6) + plotName << "disc"; + else { + plotName << "layer"; + } + plotName << layer; + } + if (isTEC && iTEC == 0) + plotName << "_" + << "R1-4"; + if (isTEC && iTEC > 0) + plotName << "_" + << "R5-7"; + + // PNG,EPS,PDF files + c.Update(); + c.Print((plotName.str() + ".png").c_str()); + c.Print((plotName.str() + ".eps").c_str()); + c.Print((plotName.str() + ".pdf").c_str()); + + // ROOT file + TFile f((plotName.str() + ".root").c_str(), "recreate"); + c.Write(); + f.Close(); + + delete legend; + delete hs; } } } @@ -708,36 +725,34 @@ void PlotAlignmentValidation::plotSS( const std::string& options, const std::str return; } - //------------------------------------------------------------------------------ /*! \fn plotDMR * \brief Main function used to plot DMRs for a single IOV printing the canvases in the output directory and saving histograms and fit funtions in a root file. */ -void PlotAlignmentValidation::plotDMR(const std::string& variable, Int_t minHits, const std::string& options) -{ +void PlotAlignmentValidation::plotDMR(const std::string& variable, Int_t minHits, const std::string& options) { // If several, comma-separated values are given in 'variable', // call plotDMR with each value separately. // If a comma is found, the string is divided to two. // (no space allowed) std::size_t findres = variable.find(","); - if ( findres != std::string::npos) { - std::string substring1 = variable.substr(0, findres); - std::string substring2 = variable.substr(findres+1, std::string::npos); + if (findres != std::string::npos) { + std::string substring1 = variable.substr(0, findres); + std::string substring2 = variable.substr(findres + 1, std::string::npos); plotDMR(substring1, minHits, options); plotDMR(substring2, minHits, options); return; - } + } // Variable name should end with X or Y. If it doesn't, recursively calls plotDMR twice with // X and Y added, respectively - if (variable == "mean" || variable == "median" || variable == "meanNorm" || - variable == "rms" || variable == "rmsNorm") { - plotDMR(variable+"X", minHits, options); - plotDMR(variable+"Y", minHits, options); + if (variable == "mean" || variable == "median" || variable == "meanNorm" || variable == "rms" || + variable == "rmsNorm") { + plotDMR(variable + "X", minHits, options); + plotDMR(variable + "Y", minHits, options); return; } - // options: + // options: // -plain (default, the whole distribution) // -split (distribution splitted to two) // -layers (plain db for each layer/disc superimposed in one plot) @@ -749,30 +764,38 @@ void PlotAlignmentValidation::plotDMR(const std::string& variable, Int_t minHits bool plotPlain = false, plotSplits = false, plotLayers = false; int plotLayerN = 0; Ssiz_t index, len; - if (options.find("plain") != std::string::npos) { plotPlain = true; } - if (options.find("split") != std::string::npos) { plotSplits = true; } - if (options.find("layers") != std::string::npos) { plotLayers = true; } + if (options.find("plain") != std::string::npos) { + plotPlain = true; + } + if (options.find("split") != std::string::npos) { + plotSplits = true; + } + if (options.find("layers") != std::string::npos) { + plotLayers = true; + } if ((index = layer_re.Index(options, &len)) != -1) { if (plotLayers) { std::cerr << "Warning: option 'layers' overrides 'layer=N'" << std::endl; } else { - std::string substr = options.substr(index+6, len-6); + std::string substr = options.substr(index + 6, len - 6); plotLayerN = atoi(substr.c_str()); } } // Defaults to plotting only plain plot if empty (or invalid) // option string is given - if (!plotPlain && !plotSplits) { plotPlain = true; } + if (!plotPlain && !plotSplits) { + plotPlain = true; + } // This boolean array tells for which detector modules to plot split DMR plots // They are plotted for BPIX, FPIX, TIB and TOB - static bool plotSplitsFor[6] = { true, true, true, false, true, false }; + static bool plotSplitsFor[6] = {true, true, true, false, true, false}; DMRPlotInfo plotinfo; gStyle->SetOptStat(0); - + TCanvas c("canv", "canv"); plotinfo.variable = variable; @@ -783,38 +806,77 @@ void PlotAlignmentValidation::plotDMR(const std::string& variable, Int_t minHits // width in cm // for DMRS, use 100 bins in range +-10 um, bin width 0.2um // if modified, check also TrackerOfflineValidationSummary_cfi.py and TrackerOfflineValidation_Standalone_cff.py - if (variable == "meanX") { plotinfo.nbins = 50; plotinfo.min = -0.001; plotinfo.max = 0.001; } - else if (variable == "meanY") { plotinfo.nbins = 50; plotinfo.min = -0.005; plotinfo.max = 0.005; } - else if (variable == "medianX") - if (plotSplits) { plotinfo.nbins = 50; plotinfo.min = -0.0005; plotinfo.max = 0.0005;} - else { plotinfo.nbins = 100; plotinfo.min = -0.001; plotinfo.max = 0.001; } + if (variable == "meanX") { + plotinfo.nbins = 50; + plotinfo.min = -0.001; + plotinfo.max = 0.001; + } else if (variable == "meanY") { + plotinfo.nbins = 50; + plotinfo.min = -0.005; + plotinfo.max = 0.005; + } else if (variable == "medianX") + if (plotSplits) { + plotinfo.nbins = 50; + plotinfo.min = -0.0005; + plotinfo.max = 0.0005; + } else { + plotinfo.nbins = 100; + plotinfo.min = -0.001; + plotinfo.max = 0.001; + } else if (variable == "medianY") - if (plotSplits) { plotinfo.nbins = 50; plotinfo.min = -0.0005; plotinfo.max = 0.0005;} - else { plotinfo.nbins = 100; plotinfo.min = -0.001; plotinfo.max = 0.001; } - else if (variable == "meanNormX") { plotinfo.nbins = 100; plotinfo.min = -2.0; plotinfo.max = 2.0; } - else if (variable == "meanNormY") { plotinfo.nbins = 100; plotinfo.min = -2.0; plotinfo.max = 2.0; } - else if (variable == "rmsX") { plotinfo.nbins = 100; plotinfo.min = 0.0; plotinfo.max = 0.1; } - else if (variable == "rmsY") { plotinfo.nbins = 100; plotinfo.min = 0.0; plotinfo.max = 0.1; } - else if (variable == "rmsNormX") { plotinfo.nbins = 100; plotinfo.min = 0.3; plotinfo.max = 1.8; } - else if (variable == "rmsNormY") { plotinfo.nbins = 100; plotinfo.min = 0.3; plotinfo.max = 1.8; } - else { + if (plotSplits) { + plotinfo.nbins = 50; + plotinfo.min = -0.0005; + plotinfo.max = 0.0005; + } else { + plotinfo.nbins = 100; + plotinfo.min = -0.001; + plotinfo.max = 0.001; + } + else if (variable == "meanNormX") { + plotinfo.nbins = 100; + plotinfo.min = -2.0; + plotinfo.max = 2.0; + } else if (variable == "meanNormY") { + plotinfo.nbins = 100; + plotinfo.min = -2.0; + plotinfo.max = 2.0; + } else if (variable == "rmsX") { + plotinfo.nbins = 100; + plotinfo.min = 0.0; + plotinfo.max = 0.1; + } else if (variable == "rmsY") { + plotinfo.nbins = 100; + plotinfo.min = 0.0; + plotinfo.max = 0.1; + } else if (variable == "rmsNormX") { + plotinfo.nbins = 100; + plotinfo.min = 0.3; + plotinfo.max = 1.8; + } else if (variable == "rmsNormY") { + plotinfo.nbins = 100; + plotinfo.min = 0.3; + plotinfo.max = 1.8; + } else { std::cerr << "Unknown variable " << variable << std::endl; - plotinfo.nbins = 100; plotinfo.min = -0.1; plotinfo.max = 0.1; + plotinfo.nbins = 100; + plotinfo.min = -0.1; + plotinfo.max = 0.1; } //Begin loop on structures - for (int i=1; i<=6; ++i) { - + for (int i = 1; i <= 6; ++i) { // Skip strip detectors if plotting any "Y" variable - if (i != 1 && i != 2 && variable.length() > 0 && variable[variable.length()-1] == 'Y') { + if (i != 1 && i != 2 && variable.length() > 0 && variable[variable.length() - 1] == 'Y') { continue; } - + // Skips plotting too high layers if (plotLayerN > maxNumberOfLayers(i)) { continue; } - plotinfo.plotSplits = plotSplits && plotSplitsFor[i-1]; + plotinfo.plotSplits = plotSplits && plotSplitsFor[i - 1]; if (!plotinfo.plotPlain && !plotinfo.plotSplits) { continue; } @@ -824,17 +886,27 @@ void PlotAlignmentValidation::plotDMR(const std::string& variable, Int_t minHits bool hasheader = (TkAlStyle::legendheader != ""); int nPlots = 1; - if (plotinfo.plotSplits) { nPlots = 3; } + if (plotinfo.plotSplits) { + nPlots = 3; + } // This will make the legend a bit bigger than necessary if there is a mixture of phase 0 and phase 1. // Not worth it to implement more complicated logic. - if (plotinfo.plotLayers) { nPlots *= maxNumberOfLayers(i); } + if (plotinfo.plotLayers) { + nPlots *= maxNumberOfLayers(i); + } nPlots *= sourceList.size(); - if (twolines_) { nPlots *= 2; } + if (twolines_) { + nPlots *= 2; + } nPlots += hasheader; double legendY = 0.80; - if (nPlots > 3) { legendY -= 0.01 * (nPlots - 3); } - if (bigtext_) { legendY -= 0.05; } + if (nPlots > 3) { + legendY -= 0.01 * (nPlots - 3); + } + if (bigtext_) { + legendY -= 0.05; + } if (legendY < 0.6) { std::cerr << "Warning: Huge legend!" << std::endl; legendY = 0.6; @@ -845,53 +917,72 @@ void PlotAlignmentValidation::plotDMR(const std::string& variable, Int_t minHits plotinfo.subDetId = i; plotinfo.legend = new TLegend(0.17, legendY, 0.85, 0.88); plotinfo.legend->SetNColumns(2); - if (hasheader) plotinfo.legend->SetHeader(TkAlStyle::legendheader); - if (bigtext_) plotinfo.legend->SetTextSize(TkAlStyle::textSize); + if (hasheader) + plotinfo.legend->SetHeader(TkAlStyle::legendheader); + if (bigtext_) + plotinfo.legend->SetTextSize(TkAlStyle::textSize); plotinfo.legend->SetFillStyle(0); plotinfo.hstack = &hstack; plotinfo.h = plotinfo.h1 = plotinfo.h2 = 0; plotinfo.firsthisto = true; openSummaryFile(); - vmean.clear(); vrms.clear(); vdeltamean.clear(); vmeanerror.clear(); vPValueEqualSplitMeans.clear(), vAlignmentUncertainty.clear(); vPValueMeanEqualIdeal.clear(); vPValueRMSEqualIdeal.clear(); + vmean.clear(); + vrms.clear(); + vdeltamean.clear(); + vmeanerror.clear(); + vPValueEqualSplitMeans.clear(), vAlignmentUncertainty.clear(); + vPValueMeanEqualIdeal.clear(); + vPValueRMSEqualIdeal.clear(); std::string stringsubdet; switch (i) { - case 1: stringsubdet = "BPIX"; break; - case 2: stringsubdet = "FPIX"; break; - case 3: stringsubdet = "TIB"; break; - case 4: stringsubdet = "TID"; break; - case 5: stringsubdet = "TOB"; break; - case 6: stringsubdet = "TEC"; break; + case 1: + stringsubdet = "BPIX"; + break; + case 2: + stringsubdet = "FPIX"; + break; + case 3: + stringsubdet = "TIB"; + break; + case 4: + stringsubdet = "TID"; + break; + case 5: + stringsubdet = "TOB"; + break; + case 6: + stringsubdet = "TEC"; + break; } - for(std::vector::iterator it = sourceList.begin(); - it != sourceList.end(); ++it) { - + for (std::vector::iterator it = sourceList.begin(); it != sourceList.end(); ++it) { plotinfo.vars = *it; plotinfo.h1 = plotinfo.h2 = plotinfo.h = 0; int minlayer = plotLayers ? 1 : plotLayerN; //Layer 0 is associated to the entire structure, this check ensures that even when both the plotLayers and the plotPlain options are active, also the histogram for the entire structure is made. - if(plotinfo.plotPlain) minlayer=0; + if (plotinfo.plotPlain) + minlayer = 0; int maxlayer = plotLayers ? numberOfLayers(plotinfo.vars->getPhase(), plotinfo.subDetId) : plotLayerN; for (int layer = minlayer; layer <= maxlayer; layer++) { + if (plotinfo.plotPlain) { + plotDMRHistogram(plotinfo, 0, layer, stringsubdet); + } - if (plotinfo.plotPlain) { - plotDMRHistogram(plotinfo, 0, layer, stringsubdet); - } - - if (plotinfo.plotSplits) { - plotDMRHistogram(plotinfo, -1, layer, stringsubdet); - plotDMRHistogram(plotinfo, 1, layer, stringsubdet); - } + if (plotinfo.plotSplits) { + plotDMRHistogram(plotinfo, -1, layer, stringsubdet); + plotDMRHistogram(plotinfo, 1, layer, stringsubdet); + } - if (plotinfo.plotPlain) { - if (plotinfo.h) { + if (plotinfo.plotPlain) { + if (plotinfo.h) { setDMRHistStyleAndLegend(plotinfo.h, plotinfo, 0, layer); } else { - if ((plotinfo.variable == "medianX" || plotinfo.variable == "medianY") && /*!plotinfo.plotLayers && */layer==0) { + if ((plotinfo.variable == "medianX" || plotinfo.variable == "medianY") && + /*!plotinfo.plotLayers && */ layer == 0) { vmean.push_back(nan("")); vrms.push_back(nan("")); vmeanerror.push_back(nan("")); @@ -904,57 +995,58 @@ void PlotAlignmentValidation::plotDMR(const std::string& variable, Int_t minHits } } } - } - - if (plotinfo.plotSplits) { - // Add delta mu to the histogram - if (plotinfo.h1 != 0 && plotinfo.h2 != 0 && !plotinfo.plotPlain) { - std::ostringstream legend; - std::string unit = " #mum"; - legend.precision(3); - legend << fixed; // to always show 3 decimals - float factor = 10000.0f; - if (plotinfo.variable == "meanNormX" || plotinfo.variable == "meanNormY" || - plotinfo.variable == "rmsNormX" || plotinfo.variable == "rmsNormY") { - factor = 1.0f; - unit = ""; - } - float deltamu = factor*(plotinfo.h2->GetMean(1) - plotinfo.h1->GetMean(1)); - legend << plotinfo.vars->getName(); - if (layer > 0) { - // TEC and TID have discs, the rest have layers - if (i==4 || i==6) - legend << ", disc "; - else - legend << ", layer "; - legend << layer; - } - plotinfo.legend->AddEntry(static_cast(0), legend.str().c_str(), ""); - legend.str(""); - legend << "#Delta#mu = " << deltamu << unit; - plotinfo.legend->AddEntry(static_cast(0), legend.str().c_str(), ""); - - if ((plotinfo.variable == "medianX" || plotinfo.variable == "medianY") && !plotLayers && layer==0) { - vdeltamean.push_back(deltamu); + } + + if (plotinfo.plotSplits) { + // Add delta mu to the histogram + if (plotinfo.h1 != 0 && plotinfo.h2 != 0 && !plotinfo.plotPlain) { + std::ostringstream legend; + std::string unit = " #mum"; + legend.precision(3); + legend << fixed; // to always show 3 decimals + float factor = 10000.0f; + if (plotinfo.variable == "meanNormX" || plotinfo.variable == "meanNormY" || + plotinfo.variable == "rmsNormX" || plotinfo.variable == "rmsNormY") { + factor = 1.0f; + unit = ""; + } + float deltamu = factor * (plotinfo.h2->GetMean(1) - plotinfo.h1->GetMean(1)); + legend << plotinfo.vars->getName(); + if (layer > 0) { + // TEC and TID have discs, the rest have layers + if (i == 4 || i == 6) + legend << ", disc "; + else + legend << ", layer "; + legend << layer; } - } - if (plotinfo.h1) { setDMRHistStyleAndLegend(plotinfo.h1, plotinfo, -1, layer); } - if (plotinfo.h2) { setDMRHistStyleAndLegend(plotinfo.h2, plotinfo, 1, layer); } - } + plotinfo.legend->AddEntry(static_cast(0), legend.str().c_str(), ""); + legend.str(""); + legend << "#Delta#mu = " << deltamu << unit; + plotinfo.legend->AddEntry(static_cast(0), legend.str().c_str(), ""); + if ((plotinfo.variable == "medianX" || plotinfo.variable == "medianY") && !plotLayers && layer == 0) { + vdeltamean.push_back(deltamu); + } + } + if (plotinfo.h1) { + setDMRHistStyleAndLegend(plotinfo.h1, plotinfo, -1, layer); + } + if (plotinfo.h2) { + setDMRHistStyleAndLegend(plotinfo.h2, plotinfo, 1, layer); + } + } } - } - if (hstack.GetHists()!=0 && hstack.GetHists()->GetSize()!=0) { + if (hstack.GetHists() != 0 && hstack.GetHists()->GetSize() != 0) { hstack.Draw("nostack"); - hstack.SetMaximum(plotinfo.maxY*1.3); + hstack.SetMaximum(plotinfo.maxY * 1.3); setTitleStyle(hstack, variable.c_str(), "#modules", plotinfo.subDetId); setHistStyle(*hstack.GetHistogram(), variable.c_str(), "#modules", 1); - plotinfo.legend->Draw(); - } - else { + plotinfo.legend->Draw(); + } else { // Draw an empty default histogram plotinfo.h = new TH1F("defhist", "Empty default histogram", plotinfo.nbins, plotinfo.min, plotinfo.max); plotinfo.h->SetMaximum(10); @@ -968,42 +1060,66 @@ void PlotAlignmentValidation::plotDMR(const std::string& variable, Int_t minHits std::ostringstream plotName; plotName << outputDir << "/D"; - if (variable=="medianX") plotName << "medianR_"; - else if (variable=="medianY") plotName << "medianYR_"; - else if (variable=="meanX") plotName << "meanR_"; - else if (variable=="meanY") plotName << "meanYR_"; - else if (variable=="meanNormX") plotName << "meanNR_"; - else if (variable=="meanNormY") plotName << "meanNYR_"; - else if (variable=="rmsX") plotName << "rmsR_"; - else if (variable=="rmsY") plotName << "rmsYR_"; - else if (variable=="rmsNormX") plotName << "rmsNR_"; - else if (variable=="rmsNormY") plotName << "rmsNYR_"; - + if (variable == "medianX") + plotName << "medianR_"; + else if (variable == "medianY") + plotName << "medianYR_"; + else if (variable == "meanX") + plotName << "meanR_"; + else if (variable == "meanY") + plotName << "meanYR_"; + else if (variable == "meanNormX") + plotName << "meanNR_"; + else if (variable == "meanNormY") + plotName << "meanNYR_"; + else if (variable == "rmsX") + plotName << "rmsR_"; + else if (variable == "rmsY") + plotName << "rmsYR_"; + else if (variable == "rmsNormX") + plotName << "rmsNR_"; + else if (variable == "rmsNormY") + plotName << "rmsNYR_"; TString subdet; switch (i) { - case 1: subdet = "BPIX"; break; - case 2: subdet = "FPIX"; break; - case 3: subdet = "TIB"; break; - case 4: subdet = "TID"; break; - case 5: subdet = "TOB"; break; - case 6: subdet = "TEC"; break; + case 1: + subdet = "BPIX"; + break; + case 2: + subdet = "FPIX"; + break; + case 3: + subdet = "TIB"; + break; + case 4: + subdet = "TID"; + break; + case 5: + subdet = "TOB"; + break; + case 6: + subdet = "TEC"; + break; } plotName << subdet; - if (plotPlain && !plotSplits) { plotName << "_plain"; } - else if (!plotPlain && plotSplits) { plotName << "_split"; } + if (plotPlain && !plotSplits) { + plotName << "_plain"; + } else if (!plotPlain && plotSplits) { + plotName << "_split"; + } if (plotLayers) { // TEC and TID have discs, the rest have layers - if (i==4 || i==6) + if (i == 4 || i == 6) plotName << "_discs"; else plotName << "_layers"; } if (plotLayerN > 0) { // TEC and TID have discs, the rest have layers - if (i==4 || i==6) + if (i == 4 || i == 6) plotName << "_disc"; else plotName << "_layer"; @@ -1011,7 +1127,7 @@ void PlotAlignmentValidation::plotDMR(const std::string& variable, Int_t minHits } // PNG,EPS,PDF files - c.Update(); + c.Update(); c.Print((plotName.str() + ".png").c_str()); c.Print((plotName.str() + ".eps").c_str()); c.Print((plotName.str() + ".pdf").c_str()); @@ -1020,7 +1136,7 @@ void PlotAlignmentValidation::plotDMR(const std::string& variable, Int_t minHits TFile f((plotName.str() + ".root").c_str(), "recreate"); c.Write(); f.Close(); - + // Free allocated memory. delete plotinfo.h; delete plotinfo.h1; @@ -1028,120 +1144,143 @@ void PlotAlignmentValidation::plotDMR(const std::string& variable, Int_t minHits if (vmean.size()) { summaryfile << " mu_" << subdet; - if (plotinfo.variable == "medianY") summaryfile << "_y"; + if (plotinfo.variable == "medianY") + summaryfile << "_y"; summaryfile << " (um)\t" << "latexname=$\\mu_\\text{" << subdet << "}"; - if (plotinfo.variable == "medianY") summaryfile << "^{y}"; + if (plotinfo.variable == "medianY") + summaryfile << "^{y}"; summaryfile << "$ ($\\mu$m)\t" << "format={:.3g}\t" << "latexformat=${:.3g}$"; - for (auto mu : vmean) summaryfile << "\t" << mu; + for (auto mu : vmean) + summaryfile << "\t" << mu; summaryfile << "\n"; } if (vrms.size()) { summaryfile << "sigma_" << subdet; - if (plotinfo.variable == "medianY") summaryfile << "_y"; + if (plotinfo.variable == "medianY") + summaryfile << "_y"; summaryfile << " (um)\t" << "latexname=$\\sigma_\\text{" << subdet << "}"; - if (plotinfo.variable == "medianY") summaryfile << "^{y}"; + if (plotinfo.variable == "medianY") + summaryfile << "^{y}"; summaryfile << "$ ($\\mu$m)\t" << "format={:.3g}\t" << "latexformat=${:.3g}$"; - for (auto sigma : vrms) summaryfile << "\t" << sigma; + for (auto sigma : vrms) + summaryfile << "\t" << sigma; summaryfile << "\n"; } if (vdeltamean.size()) { - summaryfile << " dmu_" << subdet ; - if (plotinfo.variable == "medianY") summaryfile << "_y"; + summaryfile << " dmu_" << subdet; + if (plotinfo.variable == "medianY") + summaryfile << "_y"; summaryfile << " (um)\t" << "latexname=$\\Delta\\mu_\\text{" << subdet << "}"; - if (plotinfo.variable == "medianY") summaryfile << "^{y}"; + if (plotinfo.variable == "medianY") + summaryfile << "^{y}"; summaryfile << "$ ($\\mu$m)\t" << "format={:.3g}\t" << "latexformat=${:.3g}$"; - for (auto dmu : vdeltamean) summaryfile << "\t" << dmu; + for (auto dmu : vdeltamean) + summaryfile << "\t" << dmu; summaryfile << "\n"; } if (vmeanerror.size()) { - summaryfile << " sigma_mu_" << subdet ; - if (plotinfo.variable == "medianY") summaryfile << "_y"; + summaryfile << " sigma_mu_" << subdet; + if (plotinfo.variable == "medianY") + summaryfile << "_y"; summaryfile << " (um)\t" << "latexname=$\\sigma\\mu_\\text{" << subdet << "}"; - if (plotinfo.variable == "medianY") summaryfile << "^{y}"; + if (plotinfo.variable == "medianY") + summaryfile << "^{y}"; summaryfile << "$ ($\\mu$m)\t" << "format={:.3g}\t" << "latexformat=${:.3g}$"; - for (auto dmu : vmeanerror) summaryfile << "\t" << dmu; + for (auto dmu : vmeanerror) + summaryfile << "\t" << dmu; summaryfile << "\n"; } if (vPValueEqualSplitMeans.size()) { - summaryfile << " p_delta_mu_equal_zero_" << subdet ; - if (plotinfo.variable == "medianY") summaryfile << "_y"; + summaryfile << " p_delta_mu_equal_zero_" << subdet; + if (plotinfo.variable == "medianY") + summaryfile << "_y"; summaryfile << "\t" << "latexname=$P(\\delta\\mu_\\text{" << subdet << "}=0)"; - if (plotinfo.variable == "medianY") summaryfile << "^{y}"; + if (plotinfo.variable == "medianY") + summaryfile << "^{y}"; summaryfile << "$\t" << "format={:.3g}\t" << "latexformat=${:.3g}$"; - for (auto dmu : vPValueEqualSplitMeans) summaryfile << "\t" << dmu; + for (auto dmu : vPValueEqualSplitMeans) + summaryfile << "\t" << dmu; summaryfile << "\n"; } if (vAlignmentUncertainty.size()) { - summaryfile << " alignment_uncertainty_" << subdet ; - if (plotinfo.variable == "medianY") summaryfile << "_y"; + summaryfile << " alignment_uncertainty_" << subdet; + if (plotinfo.variable == "medianY") + summaryfile << "_y"; summaryfile << " (um)\t" << "latexname=$\\sigma_\\text{align}_\\text{" << subdet << "}"; - if (plotinfo.variable == "medianY") summaryfile << "^{y}"; + if (plotinfo.variable == "medianY") + summaryfile << "^{y}"; summaryfile << "$ ($\\mu$m)\t" << "format={:.3g}\t" << "latexformat=${:.3g}$"; - for (auto dmu : vAlignmentUncertainty) summaryfile << "\t" << dmu; + for (auto dmu : vAlignmentUncertainty) + summaryfile << "\t" << dmu; summaryfile << "\n"; } if (vPValueMeanEqualIdeal.size()) { - summaryfile << " p_mean_equals_ideal_" << subdet ; - if (plotinfo.variable == "medianY") summaryfile << "_y"; + summaryfile << " p_mean_equals_ideal_" << subdet; + if (plotinfo.variable == "medianY") + summaryfile << "_y"; summaryfile << "\t" << "latexname=$P(\\mu_\\text{" << subdet << "}=\\mu_\\text{ideal})"; - if (plotinfo.variable == "medianY") summaryfile << "^{y}"; + if (plotinfo.variable == "medianY") + summaryfile << "^{y}"; summaryfile << "$\t" << "format={:.3g}\t" << "latexformat=${:.3g}$"; - for (auto dmu : vPValueMeanEqualIdeal) summaryfile << "\t" << dmu; + for (auto dmu : vPValueMeanEqualIdeal) + summaryfile << "\t" << dmu; summaryfile << "\n"; } if (vPValueRMSEqualIdeal.size()) { - summaryfile << " p_RMS_equals_ideal_" << subdet ; - if (plotinfo.variable == "medianY") summaryfile << "_y"; + summaryfile << " p_RMS_equals_ideal_" << subdet; + if (plotinfo.variable == "medianY") + summaryfile << "_y"; summaryfile << "\t" << "latexname=$P(\\sigma_\\text{" << subdet << "}=\\sigma_\\text{ideal})"; - if (plotinfo.variable == "medianY") summaryfile << "^{y}"; + if (plotinfo.variable == "medianY") + summaryfile << "^{y}"; summaryfile << "$\t" << "format={:.3g}\t" << "latexformat=${:.3g}$"; - for (auto dmu : vPValueRMSEqualIdeal) summaryfile << "\t" << dmu; + for (auto dmu : vPValueRMSEqualIdeal) + summaryfile << "\t" << dmu; summaryfile << "\n"; } } } //------------------------------------------------------------------------------ -void PlotAlignmentValidation::plotChi2(const char *inputFile) -{ +void PlotAlignmentValidation::plotChi2(const char* inputFile) { // Opens the file (it should be OfflineValidation(Parallel)_result.root) // and reads and plots the norm_chi^2 and h_chi2Prob -distributions. Bool_t errorflag = kTRUE; - TFile* fi1 = TFile::Open(inputFile,"read"); + TFile* fi1 = TFile::Open(inputFile, "read"); TDirectoryFile* mta1 = NULL; TDirectoryFile* mtb1 = NULL; TCanvas* normchi = NULL; TCanvas* chiprob = NULL; if (fi1 != NULL) { - mta1 = (TDirectoryFile*) fi1->Get("TrackerOfflineValidationStandalone"); - if(mta1 != NULL) { - mtb1 = (TDirectoryFile*) mta1->Get("GlobalTrackVariables"); - if(mtb1 != NULL) { + mta1 = (TDirectoryFile*)fi1->Get("TrackerOfflineValidationStandalone"); + if (mta1 != NULL) { + mtb1 = (TDirectoryFile*)mta1->Get("GlobalTrackVariables"); + if (mtb1 != NULL) { normchi = dynamic_cast(mtb1->Get("h_normchi2")); chiprob = dynamic_cast(mtb1->Get("h_chi2Prob")); if (normchi != NULL && chiprob != NULL) { @@ -1150,17 +1289,17 @@ void PlotAlignmentValidation::plotChi2(const char *inputFile) } } } - if(errorflag) - { + if (errorflag) { std::cout << "PlotAlignmentValidation::plotChi2: Can't find data from given file," << " no chi^2-plots produced" << std::endl; return; } - TLegend *legend = 0; + TLegend* legend = 0; for (auto primitive : *normchi->GetListOfPrimitives()) { legend = dynamic_cast(primitive); - if (legend) break; + if (legend) + break; } if (legend) { openSummaryFile(); @@ -1172,10 +1311,11 @@ void PlotAlignmentValidation::plotChi2(const char *inputFile) int style = alignment->getLineStyle(); bool foundit = false; for (auto entry : *legend->GetListOfPrimitives()) { - TLegendEntry *legendentry = dynamic_cast(entry); + TLegendEntry* legendentry = dynamic_cast(entry); assert(legendentry); - TH1 *h = dynamic_cast(legendentry->GetObject()); - if (!h) continue; + TH1* h = dynamic_cast(legendentry->GetObject()); + if (!h) + continue; if (legendentry->GetLabel() == title && h->GetLineColor() == color && h->GetLineStyle() == style) { foundit = true; summaryfile << h->GetEntries(); @@ -1210,56 +1350,72 @@ void PlotAlignmentValidation::plotChi2(const char *inputFile) fi3.Close(); delete fi1; - } //------------------------------------------------------------------------------ -THStack* PlotAlignmentValidation::addHists(const TString& selection, const TString &residType, - TLegend **myLegend, bool printModuleIds, bool validforphase0) -{ +THStack* PlotAlignmentValidation::addHists( + const TString& selection, const TString& residType, TLegend** myLegend, bool printModuleIds, bool validforphase0) { enum ResidType { - xPrimeRes, yPrimeRes, xPrimeNormRes, yPrimeNormRes, xRes, yRes, xNormRes, /*yResNorm*/ - ResXvsXProfile, ResXvsYProfile, ResYvsXProfile, ResYvsYProfile + xPrimeRes, + yPrimeRes, + xPrimeNormRes, + yPrimeNormRes, + xRes, + yRes, + xNormRes, /*yResNorm*/ + ResXvsXProfile, + ResXvsYProfile, + ResYvsXProfile, + ResYvsYProfile }; ResidType rType = xPrimeRes; - if (residType == "xPrime") rType = xPrimeRes; - else if (residType == "yPrime") rType = yPrimeRes; - else if (residType == "xPrimeNorm") rType = xPrimeNormRes; - else if (residType == "yPrimeNorm") rType = yPrimeNormRes; - else if (residType == "x") rType = xRes; - else if (residType == "y") rType = yRes; - else if (residType == "xNorm") rType = xNormRes; + if (residType == "xPrime") + rType = xPrimeRes; + else if (residType == "yPrime") + rType = yPrimeRes; + else if (residType == "xPrimeNorm") + rType = xPrimeNormRes; + else if (residType == "yPrimeNorm") + rType = yPrimeNormRes; + else if (residType == "x") + rType = xRes; + else if (residType == "y") + rType = yRes; + else if (residType == "xNorm") + rType = xNormRes; // else if (residType == "yNorm") rType = yResNorm; - else if (residType == "ResXvsXProfile") rType = ResXvsXProfile; - else if (residType == "ResYvsXProfile") rType = ResYvsXProfile; - else if (residType == "ResXvsYProfile") rType = ResXvsYProfile; - else if (residType == "ResYvsYProfile") rType = ResYvsYProfile; + else if (residType == "ResXvsXProfile") + rType = ResXvsXProfile; + else if (residType == "ResYvsXProfile") + rType = ResYvsXProfile; + else if (residType == "ResXvsYProfile") + rType = ResXvsYProfile; + else if (residType == "ResYvsYProfile") + rType = ResYvsYProfile; else { - std::cout << "PlotAlignmentValidation::addHists: Unknown residual type " - << residType << std::endl; + std::cout << "PlotAlignmentValidation::addHists: Unknown residual type " << residType << std::endl; return 0; } cout << "PlotAlignmentValidation::addHists: using selection " << selection << endl; - THStack * retHistoStack = new THStack("hstack", ""); + THStack* retHistoStack = new THStack("hstack", ""); if (myLegend != 0) if (*myLegend == 0) { *myLegend = new TLegend(0.17, 0.80, 0.85, 0.88); } - for(std::vector::iterator itSourceFile = sourceList.begin(); - itSourceFile != sourceList.end(); ++itSourceFile) { - + for (std::vector::iterator itSourceFile = sourceList.begin(); itSourceFile != sourceList.end(); + ++itSourceFile) { std::vector histnames; - TFile *f = (*itSourceFile)->getFile(); - TTree *tree= (*itSourceFile)->getTree(); + TFile* f = (*itSourceFile)->getFile(); + TTree* tree = (*itSourceFile)->getTree(); int myLineColor = (*itSourceFile)->getLineColor(); int myLineStyle = (*itSourceFile)->getLineStyle(); TString myLegendName = (*itSourceFile)->getName(); - TH1 *h = 0; // becomes result - UInt_t nEmpty = 0;// selected, but empty hists - Long64_t nentries = tree->GetEntriesFast(); + TH1* h = 0; // becomes result + UInt_t nEmpty = 0; // selected, but empty hists + Long64_t nentries = tree->GetEntriesFast(); if (!f || !tree) { std::cout << "PlotAlignmentValidation::addHists: no tree or no file" << std::endl; return 0; @@ -1267,19 +1423,19 @@ THStack* PlotAlignmentValidation::addHists(const TString& selection, const TStri bool histnamesfilled = false; int phase = (bool)(f->Get("TrackerOfflineValidationStandalone/Pixel/P1PXBBarrel_1")); - if (residType.Contains("Res") && residType.Contains("Profile")) - { - TString basename = TString(residType).ReplaceAll("Res","p_res") - .ReplaceAll("vs","") - .ReplaceAll("Profile","_"); //gives e.g.: p_resXX_ + if (residType.Contains("Res") && residType.Contains("Profile")) { + TString basename = TString(residType) + .ReplaceAll("Res", "p_res") + .ReplaceAll("vs", "") + .ReplaceAll("Profile", "_"); //gives e.g.: p_resXX_ if (selection == "subDetId==1") { - if (phase==1) + if (phase == 1) histnames.push_back(TString(basename) += "P1PXBBarrel_1"); else histnames.push_back(TString(basename) += "TPBBarrel_1"); histnamesfilled = true; } else if (selection == "subDetId==2") { - if (phase==1) { + if (phase == 1) { histnames.push_back(TString(basename) += "P1PXECEndcap_2"); histnames.push_back(TString(basename) += "P1PXECEndcap_3"); } else { @@ -1297,7 +1453,7 @@ THStack* PlotAlignmentValidation::addHists(const TString& selection, const TStri } else if (selection == "subDetId==5") { histnames.push_back(TString(basename) += "TOBBarrel_4"); histnamesfilled = true; - } else if (selection == "subDetId==6") { //whole TEC - doesn't happen by default but easy enough to account for + } else if (selection == "subDetId==6") { //whole TEC - doesn't happen by default but easy enough to account for histnames.push_back(TString(basename) += "TECEndcap_5"); histnames.push_back(TString(basename) += "TECEndcap_6"); histnamesfilled = true; @@ -1307,16 +1463,13 @@ THStack* PlotAlignmentValidation::addHists(const TString& selection, const TStri for (int iDisk = 1; iDisk <= 9; iDisk++) for (int iSide = 1; iSide <= 2; iSide++) for (int iPetal = 1; iPetal <= 8; iPetal++) - for (int iRing = 1; iRing <= 4 - (iDisk>=4) - (iDisk>=7) - (iDisk>=9); iRing++) + for (int iRing = 1; iRing <= 4 - (iDisk >= 4) - (iDisk >= 7) - (iDisk >= 9); iRing++) //in the higher disks, the inner rings go away. But the numbering in the file structure removes the higher numbers // so the numbers there do not correspond to the actual ring numbers { stringstream s; - s << "TrackerOfflineValidationStandalone/Strip/TECEndcap_" << iEndcap - << "/TECDisk_" << iDisk - << "/TECSide_" << iSide - << "/TECPetal_" << iPetal - << "/" << basename << "TECRing_" << iRing; + s << "TrackerOfflineValidationStandalone/Strip/TECEndcap_" << iEndcap << "/TECDisk_" << iDisk + << "/TECSide_" << iSide << "/TECPetal_" << iPetal << "/" << basename << "TECRing_" << iRing; histnames.push_back(TString(s.str())); } histnamesfilled = true; @@ -1326,23 +1479,21 @@ THStack* PlotAlignmentValidation::addHists(const TString& selection, const TStri for (int iDisk = 1; iDisk <= 9; iDisk++) for (int iSide = 1; iSide <= 2; iSide++) for (int iPetal = 1; iPetal <= 8; iPetal++) - for (int iRing = 5 - (iDisk>=4) - (iDisk>=7) - (iDisk>=9); iRing <= 7 - (iDisk>=4) - (iDisk>=7) - (iDisk>=9); iRing++) + for (int iRing = 5 - (iDisk >= 4) - (iDisk >= 7) - (iDisk >= 9); + iRing <= 7 - (iDisk >= 4) - (iDisk >= 7) - (iDisk >= 9); + iRing++) //in the higher disks, the inner rings go away. But the numbering in the file structure removes the higher numbers // so the numbers there do not correspond to the actual ring numbers { stringstream s; - s << "TrackerOfflineValidationStandalone/Strip/TECEndcap_" << iEndcap - << "/TECDisk_" << iDisk - << "/TECSide_" << iSide - << "/TECPetal_" << iPetal - << "/" << basename << "TECRing_" << iRing; + s << "TrackerOfflineValidationStandalone/Strip/TECEndcap_" << iEndcap << "/TECDisk_" << iDisk + << "/TECSide_" << iSide << "/TECPetal_" << iPetal << "/" << basename << "TECRing_" << iRing; histnames.push_back(TString(s.str())); } histnamesfilled = true; } } - Long64_t nSel = 0; if (histnamesfilled && histnames.size() > 0) { nSel = (Long64_t)histnames.size(); @@ -1351,7 +1502,8 @@ THStack* PlotAlignmentValidation::addHists(const TString& selection, const TStri // first loop on tree to find out which entries (i.e. modules) fulfill the selection // 'Entry$' gives the entry number in the tree nSel = tree->Draw("Entry$", selection, "goff"); - if (nSel == -1) return 0; // error in selection + if (nSel == -1) + return 0; // error in selection if (nSel == 0) { std::cout << "PlotAlignmentValidation::addHists: no selected module." << std::endl; return 0; @@ -1363,56 +1515,79 @@ THStack* PlotAlignmentValidation::addHists(const TString& selection, const TStri // second loop on tree: // for each selected entry get the hist from the file and merge - TkOffTreeVariables *treeMem = 0; // ROOT will initialise + TkOffTreeVariables* treeMem = 0; // ROOT will initialise tree->SetBranchAddress("TkOffTreeVariables", &treeMem); - for (Long64_t i = 0; i < nentries; i++){ - if (i < *iterEnt - 0.1 // smaller index (with tolerance): skip - || iterEnt == selected.end()) { // at the end: skip - continue; + for (Long64_t i = 0; i < nentries; i++) { + if (i < *iterEnt - 0.1 // smaller index (with tolerance): skip + || iterEnt == selected.end()) { // at the end: skip + continue; } else if (TMath::Abs(i - *iterEnt) < 0.11) { - ++iterEnt; // take this entry! - } else std::cout << "Must not happen: " << i << " " << *iterEnt << std::endl; + ++iterEnt; // take this entry! + } else + std::cout << "Must not happen: " << i << " " << *iterEnt << std::endl; tree->GetEntry(i); if (printModuleIds) { - std::cout << treeMem->moduleId << ": " << treeMem->entries << " entries" << std::endl; + std::cout << treeMem->moduleId << ": " << treeMem->entries << " entries" << std::endl; } if (treeMem->entries <= 0) { // little speed up: skip empty hists - ++nEmpty; - continue; + ++nEmpty; + continue; } TString hName; - switch(rType) { - case xPrimeRes: hName = treeMem->histNameX.c_str(); break; - case yPrimeRes: hName = treeMem->histNameY.c_str(); break; - case xPrimeNormRes: hName = treeMem->histNameNormX.c_str(); break; - case yPrimeNormRes: hName = treeMem->histNameNormY.c_str(); break; - case xRes: hName = treeMem->histNameLocalX.c_str(); break; - case yRes: hName = treeMem->histNameLocalY.c_str(); break; - case xNormRes: hName = treeMem->histNameNormLocalX.c_str(); break; - /*case yResNorm: hName = treeMem->histNameNormLocalY.c_str(); break;*/ - case ResXvsXProfile: hName = treeMem->profileNameResXvsX.c_str(); break; - case ResXvsYProfile: hName = treeMem->profileNameResXvsY.c_str(); break; - case ResYvsXProfile: hName = treeMem->profileNameResYvsX.c_str(); break; - case ResYvsYProfile: hName = treeMem->profileNameResYvsY.c_str(); break; + switch (rType) { + case xPrimeRes: + hName = treeMem->histNameX.c_str(); + break; + case yPrimeRes: + hName = treeMem->histNameY.c_str(); + break; + case xPrimeNormRes: + hName = treeMem->histNameNormX.c_str(); + break; + case yPrimeNormRes: + hName = treeMem->histNameNormY.c_str(); + break; + case xRes: + hName = treeMem->histNameLocalX.c_str(); + break; + case yRes: + hName = treeMem->histNameLocalY.c_str(); + break; + case xNormRes: + hName = treeMem->histNameNormLocalX.c_str(); + break; + /*case yResNorm: hName = treeMem->histNameNormLocalY.c_str(); break;*/ + case ResXvsXProfile: + hName = treeMem->profileNameResXvsX.c_str(); + break; + case ResXvsYProfile: + hName = treeMem->profileNameResXvsY.c_str(); + break; + case ResYvsXProfile: + hName = treeMem->profileNameResYvsX.c_str(); + break; + case ResYvsYProfile: + hName = treeMem->profileNameResYvsY.c_str(); + break; } histnames.push_back(hName); } } - for (std::vector::iterator ithistname = histnames.begin(); - ithistname != histnames.end(); ++ithistname) { - if (phase == 0 && !validforphase0) break; - TH1 *newHist; + for (std::vector::iterator ithistname = histnames.begin(); ithistname != histnames.end(); ++ithistname) { + if (phase == 0 && !validforphase0) + break; + TH1* newHist; if (ithistname->Contains("/")) { newHist = (TH1*)f->Get(*ithistname); } else { - TKey *histKey = f->FindKeyAny(*ithistname); + TKey* histKey = f->FindKeyAny(*ithistname); newHist = (histKey ? static_cast(histKey->ReadObj()) : 0); } if (!newHist) { - std::cout << "Hist " << *ithistname << " not found in file, break loop." << std::endl; - break; + std::cout << "Hist " << *ithistname << " not found in file, break loop." << std::endl; + break; } if (newHist->GetEntries() == 0) { nEmpty++; @@ -1420,24 +1595,26 @@ THStack* PlotAlignmentValidation::addHists(const TString& selection, const TStri } newHist->SetLineColor(myLineColor); newHist->SetLineStyle(myLineStyle); - if (!h) { // first hist: clone, but rename keeping only first part of name - TString name(newHist->GetName()); - Ssiz_t pos_ = 0; - for (UInt_t i2 = 0; i2 < 3; ++i2) pos_ = name.Index("_", pos_+1); - name = name(0, pos_); // only up to three '_' - h = static_cast(newHist->Clone("summed_"+name)); - // TString myTitle = Form("%s: %lld modules", selection, nSel); - // h->SetTitle( myTitle ); - } else { // otherwise just add - h->Add(newHist); + if (!h) { // first hist: clone, but rename keeping only first part of name + TString name(newHist->GetName()); + Ssiz_t pos_ = 0; + for (UInt_t i2 = 0; i2 < 3; ++i2) + pos_ = name.Index("_", pos_ + 1); + name = name(0, pos_); // only up to three '_' + h = static_cast(newHist->Clone("summed_" + name)); + // TString myTitle = Form("%s: %lld modules", selection, nSel); + // h->SetTitle( myTitle ); + } else { // otherwise just add + h->Add(newHist); } delete newHist; } - std::cout << "PlotAlignmentValidation::addHists" << "Result is merged from " << nSel-nEmpty - << " hists, " << nEmpty << " hists were empty." << std::endl; + std::cout << "PlotAlignmentValidation::addHists" + << "Result is merged from " << nSel - nEmpty << " hists, " << nEmpty << " hists were empty." << std::endl; - if (nSel-nEmpty == 0) continue; + if (nSel - nEmpty == 0) + continue; if (myLegend != 0) (*myLegend)->AddEntry(h, myLegendName, "L"); @@ -1452,56 +1629,52 @@ THStack* PlotAlignmentValidation::addHists(const TString& selection, const TStri /*! \fn fitGauss * \brief Operate a Gaussian fit to the given histogram */ -TF1 * -PlotAlignmentValidation::fitGauss(TH1 *hist,int color) -{ +TF1* PlotAlignmentValidation::fitGauss(TH1* hist, int color) { //1. fits a Gauss function to the inner range of abs(2 rms) //2. repeates the Gauss fit in a 2 sigma range around mean of first fit //returns mean and sigma from fit in micron - if (!hist || hist->GetEntries() < 20) return 0; + if (!hist || hist->GetEntries() < 20) + return 0; - float mean = hist->GetMean(); + float mean = hist->GetMean(); float sigma = hist->GetRMS(); - string functionname="gaussian_"; - functionname+=hist->GetName(); - TF1 *func = new TF1(functionname.c_str(), "gaus", mean - 2.*sigma, mean + 2.*sigma); - + string functionname = "gaussian_"; + functionname += hist->GetName(); + TF1* func = new TF1(functionname.c_str(), "gaus", mean - 2. * sigma, mean + 2. * sigma); + func->SetLineColor(color); func->SetLineStyle(2); - if (0 == hist->Fit(func,"QNR")) { // N: do not blow up file by storing fit! - mean = func->GetParameter(1); + if (0 == hist->Fit(func, "QNR")) { // N: do not blow up file by storing fit! + mean = func->GetParameter(1); sigma = func->GetParameter(2); // second fit: three sigma of first fit around mean of first fit - func->SetRange(mean - 3.*sigma, mean + 3.*sigma); + func->SetRange(mean - 3. * sigma, mean + 3. * sigma); // I: integral gives more correct results if binning is too wide // L: Likelihood can treat empty bins correctly (if hist not weighted...) if (0 == hist->Fit(func, "Q0ILR")) { - if (hist->GetFunction(func->GetName())) { // Take care that it is later on drawn: - //hist->GetFunction(func->GetName())->ResetBit(TF1::kNotDraw); + if (hist->GetFunction(func->GetName())) { // Take care that it is later on drawn: + //hist->GetFunction(func->GetName())->ResetBit(TF1::kNotDraw); } } } return func; } - //------------------------------------------------------------------------------ /*! \fn storeHistogramInRootfile * \brief Store the histogram and the gaussian function resulting from the fitGauss function into a root file */ -void PlotAlignmentValidation::storeHistogramInRootfile(TH1* hist) -{ +void PlotAlignmentValidation::storeHistogramInRootfile(TH1* hist) { //Store histogram and fit function in the root summary file rootsummaryfile->cd(); hist->Write(); } //------------------------------------------------------------------------------ -void PlotAlignmentValidation::scaleXaxis(TH1* hist, Int_t scale) -{ +void PlotAlignmentValidation::scaleXaxis(TH1* hist, Int_t scale) { Double_t xmin = hist->GetXaxis()->GetXmin(); Double_t xmax = hist->GetXaxis()->GetXmax(); - hist->GetXaxis()->SetLimits(xmin*scale, xmax*scale); + hist->GetXaxis()->SetLimits(xmin * scale, xmax * scale); } //------------------------------------------------------------------------------ @@ -1511,7 +1684,7 @@ TObject* PlotAlignmentValidation::findObjectFromCanvas(TCanvas* canv, const char TObject* obj = 0; Int_t found = 0; while ((obj = next())) { - if(strncmp(obj->ClassName(), className, 10) == 0) { + if (strncmp(obj->ClassName(), className, 10) == 0) { if (++found == n) return obj; } @@ -1521,30 +1694,42 @@ TObject* PlotAlignmentValidation::findObjectFromCanvas(TCanvas* canv, const char } //------------------------------------------------------------------------------ -void PlotAlignmentValidation::setTitleStyle( TNamed &hist,const char* titleX, const char* titleY,int subDetId, bool isSurfaceDeformation, TString secondline) -{ +void PlotAlignmentValidation::setTitleStyle( + TNamed& hist, const char* titleX, const char* titleY, int subDetId, bool isSurfaceDeformation, TString secondline) { std::stringstream title_Xaxis; std::stringstream title_Yaxis; - TString titleXAxis=titleX; - TString titleYAxis=titleY; + TString titleXAxis = titleX; + TString titleYAxis = titleY; if (titleXAxis != "" && titleYAxis != "") - cout<<"plot "<SetFillStyle(0); text2->SetBorderSize(0); text2->SetMargin(0.01); - text2->SetTextAlign(12); // align left - text2->AddText(0.01,0.75,subD); + text2->SetTextAlign(12); // align left + text2->AddText(0.01, 0.75, subD); if (secondline != "") { text2->AddText(0.01, 0.25, secondline); } text2->Draw(); } - //------------------------------------------------------------------------------ /*! \fn * \brief */ -void PlotAlignmentValidation::setHistStyle( TH1& hist,const char* titleX, const char* titleY, int color) -{ +void PlotAlignmentValidation::setHistStyle(TH1& hist, const char* titleX, const char* titleY, int color) { std::stringstream title_Xaxis; std::stringstream title_Yaxis; - TString titleXAxis=titleX; - TString titleYAxis=titleY; - - if ( titleXAxis.Contains("Phi") )title_Xaxis<InheritsFrom( TH1F::Class() ) )hist.SetLineColor(color); - if (hist.IsA()->InheritsFrom( TProfile::Class() ) ) { + TString titleXAxis = titleX; + TString titleYAxis = titleY; + + if (titleXAxis.Contains("Phi")) + title_Xaxis << titleX << "[rad]"; + else if (titleXAxis.Contains("meanX")) + title_Xaxis << "#LTx'_{pred}-x'_{hit}#GT[#mum]"; + else if (titleXAxis.Contains("meanY")) + title_Xaxis << "#LTy'_{pred}-y'_{hit}#GT[#mum]"; + else if (titleXAxis.Contains("rmsX")) + title_Xaxis << "RMS(x'_{pred}-x'_{hit})[#mum]"; + else if (titleXAxis.Contains("rmsY")) + title_Xaxis << "RMS(y'_{pred}-y'_{hit})[#mum]"; + else if (titleXAxis.Contains("meanNormX")) + title_Xaxis << "#LTx'_{pred}-x'_{hit}/#sigma#GT"; + else if (titleXAxis.Contains("meanNormY")) + title_Xaxis << "#LTy'_{pred}-y'_{hit}/#sigma#GT"; + else if (titleXAxis.Contains("rmsNormX")) + title_Xaxis << "RMS(x'_{pred}-x'_{hit}/#sigma)"; + else if (titleXAxis.Contains("rmsNormY")) + title_Xaxis << "RMS(y'_{pred}-y'_{hit}/#sigma)"; + else if (titleXAxis.Contains("meanLocalX")) + title_Xaxis << "#LTx_{pred}-x_{hit}#GT[#mum]"; + else if (titleXAxis.Contains("rmsLocalX")) + title_Xaxis << "RMS(x_{pred}-x_{hit})[#mum]"; + else if (titleXAxis.Contains("meanNormLocalX")) + title_Xaxis << "#LTx_{pred}-x_{hit}/#sigma#GT[#mum]"; + else if (titleXAxis.Contains("rmsNormLocalX")) + title_Xaxis << "RMS(x_{pred}-x_{hit}/#sigma)[#mum]"; + else if (titleXAxis.Contains("medianX")) + title_Xaxis << "median(x'_{pred}-x'_{hit})[#mum]"; + else if (titleXAxis.Contains("medianY")) + title_Xaxis << "median(y'_{pred}-y'_{hit})[#mum]"; + else + title_Xaxis << titleX << "[cm]"; + + if (hist.IsA()->InheritsFrom(TH1F::Class())) + hist.SetLineColor(color); + if (hist.IsA()->InheritsFrom(TProfile::Class())) { hist.SetMarkerStyle(20); hist.SetMarkerSize(0.8); hist.SetMarkerColor(color); } - - hist.GetXaxis()->SetTitle( (title_Xaxis.str()).c_str() ); + + hist.GetXaxis()->SetTitle((title_Xaxis.str()).c_str()); double binning = (hist.GetXaxis()->GetXmax() - hist.GetXaxis()->GetXmin()) / hist.GetNbinsX(); title_Yaxis.precision(2); - if ( ((titleYAxis.Contains("layer") || titleYAxis.Contains("ring")) - && titleYAxis.Contains("subDetId")) - || titleYAxis.Contains("#modules")) { - title_Yaxis<<"number of modules"; + if (((titleYAxis.Contains("layer") || titleYAxis.Contains("ring")) && titleYAxis.Contains("subDetId")) || + titleYAxis.Contains("#modules")) { + title_Yaxis << "number of modules"; if (TString(title_Xaxis.str()).Contains("[#mum]")) title_Yaxis << " / " << binning << " #mum"; else if (TString(title_Xaxis.str()).Contains("[cm]")) title_Yaxis << " / " << binning << " cm"; else title_Yaxis << " / " << binning; - } - else title_Yaxis<SetTitle( (title_Yaxis.str()).c_str() ); + hist.GetYaxis()->SetTitle((title_Yaxis.str()).c_str()); hist.GetXaxis()->SetTitleFont(42); hist.GetYaxis()->SetTitleFont(42); } //------------------------------------------------------------------------------ -std::string PlotAlignmentValidation:: -getSelectionForDMRPlot(int minHits, int subDetId, int direction, int layer) -{ +std::string PlotAlignmentValidation::getSelectionForDMRPlot(int minHits, int subDetId, int direction, int layer) { std::ostringstream builder; builder << "entries >= " << minHits; builder << " && subDetId == " << subDetId; if (direction != 0) { - if (subDetId == 2) { // FPIX is split by zDirection + if (subDetId == 2) { // FPIX is split by zDirection builder << " && zDirection == " << direction; } else { builder << " && rDirection == " << direction; @@ -1644,21 +1841,19 @@ getSelectionForDMRPlot(int minHits, int subDetId, int direction, int layer) return builder.str(); } -std::string PlotAlignmentValidation:: -getVariableForDMRPlot(const std::string& histoname, const std::string& variable, int nbins, double min, - double max) -{ +std::string PlotAlignmentValidation::getVariableForDMRPlot( + const std::string& histoname, const std::string& variable, int nbins, double min, double max) { std::ostringstream builder; - builder << variable << ">>" << histoname << "(" << nbins << "," << min << - "," << max << ")"; + builder << variable << ">>" << histoname << "(" << nbins << "," << min << "," << max << ")"; return builder.str(); } //------------------------------------------------------------------------------ -void PlotAlignmentValidation:: -setDMRHistStyleAndLegend(TH1F* h, PlotAlignmentValidation::DMRPlotInfo& plotinfo, int direction, int layer) -{ - TF1 *fitResults = 0; +void PlotAlignmentValidation::setDMRHistStyleAndLegend(TH1F* h, + PlotAlignmentValidation::DMRPlotInfo& plotinfo, + int direction, + int layer) { + TF1* fitResults = 0; h->SetDirectory(0); @@ -1671,47 +1866,60 @@ setDMRHistStyleAndLegend(TH1F* h, PlotAlignmentValidation::DMRPlotInfo& plotinfo // -However if only direction split plots are to be plotted, the additions should be 0 and +1 respectively // -Modulo 4 arithmetic, because the styles run from 1..4 int linestyle = plotinfo.vars->getLineStyle() - 1, linestyleplus = 0; - if (direction == 1) { linestyleplus = 1; } - if (direction == -1) { linestyleplus = 2; } - if (direction != 0 && plotinfo.plotSplits && !plotinfo.plotPlain) { linestyleplus--; } + if (direction == 1) { + linestyleplus = 1; + } + if (direction == -1) { + linestyleplus = 2; + } + if (direction != 0 && plotinfo.plotSplits && !plotinfo.plotPlain) { + linestyleplus--; + } linestyle = (linestyle + linestyleplus) % 4 + 1; int linecolor = plotinfo.vars->getLineColor(); - if (plotinfo.plotLayers && layer > 0) { linecolor += layer - 1; } + if (plotinfo.plotLayers && layer > 0) { + linecolor += layer - 1; + } if (plotinfo.firsthisto) { - setHistStyle(*h, plotinfo.variable.c_str(), "#modules", 1); //set color later + setHistStyle(*h, plotinfo.variable.c_str(), "#modules", 1); //set color later plotinfo.firsthisto = false; } - h->SetLineColor( linecolor ); - h->SetLineStyle( linestyle ); - - if (plotinfo.maxYGetMaximum()){ - plotinfo.maxY=h->GetMaximum(); + h->SetLineColor(linecolor); + h->SetLineStyle(linestyle); + + if (plotinfo.maxY < h->GetMaximum()) { + plotinfo.maxY = h->GetMaximum(); } - + //fit histogram for median and mean - if (plotinfo.variable == "medianX" || plotinfo.variable == "meanX" || plotinfo.variable == "medianY" || plotinfo.variable == "meanY") { - fitResults = fitGauss(h, linecolor ); + if (plotinfo.variable == "medianX" || plotinfo.variable == "meanX" || plotinfo.variable == "medianY" || + plotinfo.variable == "meanY") { + fitResults = fitGauss(h, linecolor); } - + plotinfo.hstack->Add(h); std::ostringstream legend; legend.precision(3); - legend << fixed; // to always show 3 decimals + legend << fixed; // to always show 3 decimals // Legend: header part - if (direction == -1 && plotinfo.subDetId != 2) { legend << "rDirection < 0"; } - else if (direction == 1 && plotinfo.subDetId != 2) { legend << "rDirection > 0"; } - else if (direction == -1 && plotinfo.subDetId == 2) { legend << "zDirection < 0"; } - else if (direction == 1 && plotinfo.subDetId == 2) { legend << "zDirection > 0"; } - else { - legend << plotinfo.vars->getName(); + if (direction == -1 && plotinfo.subDetId != 2) { + legend << "rDirection < 0"; + } else if (direction == 1 && plotinfo.subDetId != 2) { + legend << "rDirection > 0"; + } else if (direction == -1 && plotinfo.subDetId == 2) { + legend << "zDirection < 0"; + } else if (direction == 1 && plotinfo.subDetId == 2) { + legend << "zDirection > 0"; + } else { + legend << plotinfo.vars->getName(); if (layer > 0) { // TEC and TID have discs, the rest have layers - if (plotinfo.subDetId==4 || plotinfo.subDetId==6) + if (plotinfo.subDetId == 4 || plotinfo.subDetId == 6) legend << ", disc "; else legend << ", layer "; @@ -1725,27 +1933,27 @@ setDMRHistStyleAndLegend(TH1F* h, PlotAlignmentValidation::DMRPlotInfo& plotinfo // Legend: Statistics double mean, meanerror, rms, rmserror; TString rmsname, units; - bool showdeltamu = (plotinfo.h1 != 0 && plotinfo.h2 != 0 && plotinfo.plotSplits && plotinfo.plotPlain && direction == 0); - if (plotinfo.variable == "medianX" || plotinfo.variable == "meanX" || - plotinfo.variable == "medianY" || plotinfo.variable == "meanY" || - plotinfo.variable == "rmsX" || plotinfo.variable == "rmsY") { + bool showdeltamu = + (plotinfo.h1 != 0 && plotinfo.h2 != 0 && plotinfo.plotSplits && plotinfo.plotPlain && direction == 0); + if (plotinfo.variable == "medianX" || plotinfo.variable == "meanX" || plotinfo.variable == "medianY" || + plotinfo.variable == "meanY" || plotinfo.variable == "rmsX" || plotinfo.variable == "rmsY") { if (useFit_ && fitResults) { - mean = fitResults->GetParameter(1)*10000; - meanerror = fitResults->GetParError(1)*10000; - rms = fitResults->GetParameter(2)*10000; - rmserror = fitResults->GetParError(2)*10000; + mean = fitResults->GetParameter(1) * 10000; + meanerror = fitResults->GetParError(1) * 10000; + rms = fitResults->GetParameter(2) * 10000; + rmserror = fitResults->GetParError(2) * 10000; rmsname = "#sigma"; delete fitResults; } else { - mean = h->GetMean(1)*10000; - meanerror = h->GetMeanError(1)*10000; - rms = h->GetRMS(1)*10000; - rmserror = h->GetRMSError(1)*10000; + mean = h->GetMean(1) * 10000; + meanerror = h->GetMeanError(1) * 10000; + rms = h->GetRMS(1) * 10000; + rmserror = h->GetRMSError(1) * 10000; rmsname = "rms"; } units = " #mum"; - } else if (plotinfo.variable == "meanNormX" || plotinfo.variable == "meanNormY" || - plotinfo.variable == "rmsNormX" || plotinfo.variable == "rmsNormY") { + } else if (plotinfo.variable == "meanNormX" || plotinfo.variable == "meanNormY" || plotinfo.variable == "rmsNormX" || + plotinfo.variable == "rmsNormY") { mean = h->GetMean(1); meanerror = h->GetMeanError(1); rms = h->GetRMS(1); @@ -1753,8 +1961,7 @@ setDMRHistStyleAndLegend(TH1F* h, PlotAlignmentValidation::DMRPlotInfo& plotinfo rmsname = "rms"; units = ""; } - if (showMean_) - { + if (showMean_) { legend << " #mu = " << mean; if (showMeanError_) legend << " #pm " << meanerror; @@ -1762,8 +1969,7 @@ setDMRHistStyleAndLegend(TH1F* h, PlotAlignmentValidation::DMRPlotInfo& plotinfo if (showRMS_ || showdeltamu || ((showModules_ || showUnderOverFlow_) && !twolines_)) legend << ", "; } - if (showRMS_) - { + if (showRMS_) { legend << " " << rmsname << " = " << rms; if (showRMSError_) legend << " #pm " << rmserror; @@ -1772,44 +1978,42 @@ setDMRHistStyleAndLegend(TH1F* h, PlotAlignmentValidation::DMRPlotInfo& plotinfo legend << ", "; } - if ((plotinfo.variable == "medianX" || plotinfo.variable == "medianY") && /*!plotinfo.plotLayers && */layer==0 && direction==0) { + if ((plotinfo.variable == "medianX" || plotinfo.variable == "medianY") && /*!plotinfo.plotLayers && */ layer == 0 && + direction == 0) { vmean.push_back(mean); vrms.push_back(rms); vmeanerror.push_back(meanerror); - TH1F* ideal = (TH1F*)plotinfo.hstack->GetHists()->At(0); - TH1F* h = plotinfo.h; - if(h->GetRMS() >= ideal->GetRMS()) - { - vAlignmentUncertainty.push_back(sqrt(pow(h->GetRMS(),2)-pow(ideal->GetRMS(),2))); - } - else{ - vAlignmentUncertainty.push_back(nan("")); - } - float p = (float)resampleTestOfEqualMeans(ideal, h, 10000); - vPValueMeanEqualIdeal.push_back(p); - p=resampleTestOfEqualRMS(ideal, h, 10000); - vPValueRMSEqualIdeal.push_back(p); - + TH1F* ideal = (TH1F*)plotinfo.hstack->GetHists()->At(0); + TH1F* h = plotinfo.h; + if (h->GetRMS() >= ideal->GetRMS()) { + vAlignmentUncertainty.push_back(sqrt(pow(h->GetRMS(), 2) - pow(ideal->GetRMS(), 2))); + } else { + vAlignmentUncertainty.push_back(nan("")); + } + float p = (float)resampleTestOfEqualMeans(ideal, h, 10000); + vPValueMeanEqualIdeal.push_back(p); + p = resampleTestOfEqualRMS(ideal, h, 10000); + vPValueRMSEqualIdeal.push_back(p); } // Legend: Delta mu for split plots if (showdeltamu) { float factor = 10000.0f; - if (plotinfo.variable == "meanNormX" || plotinfo.variable == "meanNormY" || - plotinfo.variable == "rmsNormX" || plotinfo.variable == "rmsNormY") { + if (plotinfo.variable == "meanNormX" || plotinfo.variable == "meanNormY" || plotinfo.variable == "rmsNormX" || + plotinfo.variable == "rmsNormY") { factor = 1.0f; } - float deltamu = factor*(plotinfo.h2->GetMean(1) - plotinfo.h1->GetMean(1)); + float deltamu = factor * (plotinfo.h2->GetMean(1) - plotinfo.h1->GetMean(1)); legend << "#Delta#mu = " << deltamu << units; if ((showModules_ || showUnderOverFlow_) && !twolines_) legend << ", "; - if ((plotinfo.variable == "medianX" || plotinfo.variable == "medianY") && /*!plotinfo.plotLayers && */layer==0 && direction==0) { + if ((plotinfo.variable == "medianX" || plotinfo.variable == "medianY") && /*!plotinfo.plotLayers && */ layer == 0 && + direction == 0) { vdeltamean.push_back(deltamu); - if(plotinfo.h1->GetEntries()&&plotinfo.h2->GetEntries()){ - float p = (float)resampleTestOfEqualMeans(plotinfo.h1,plotinfo.h2, 10000); - vPValueEqualSplitMeans.push_back(p); - + if (plotinfo.h1->GetEntries() && plotinfo.h2->GetEntries()) { + float p = (float)resampleTestOfEqualMeans(plotinfo.h1, plotinfo.h2, 10000); + vPValueEqualSplitMeans.push_back(p); } } } @@ -1821,13 +2025,14 @@ setDMRHistStyleAndLegend(TH1F* h, PlotAlignmentValidation::DMRPlotInfo& plotinfo } if (!showUnderOverFlow_ && showModules_) { - legend << (int) h->GetEntries() << " modules"; + legend << (int)h->GetEntries() << " modules"; } if (showUnderOverFlow_) { if (showModules_) { - legend << (int) h->GetEntries() << " modules (" << (int) h->GetBinContent(0) + (int)h->GetBinContent(h->GetNbinsX()+1) << " outside range)"; + legend << (int)h->GetEntries() << " modules (" + << (int)h->GetBinContent(0) + (int)h->GetBinContent(h->GetNbinsX() + 1) << " outside range)"; } else { - legend << (int) h->GetBinContent(0) + (int)h->GetBinContent(h->GetNbinsX()+1) << " modules outside range"; + legend << (int)h->GetBinContent(0) + (int)h->GetBinContent(h->GetNbinsX() + 1) << " modules outside range"; } } plotinfo.legend->AddEntry((TObject*)0, legend.str().c_str(), ""); @@ -1835,7 +2040,6 @@ setDMRHistStyleAndLegend(TH1F* h, PlotAlignmentValidation::DMRPlotInfo& plotinfo // Scale the x-axis (cm to um), if needed if (plotinfo.variable.find("Norm") == std::string::npos) scaleXaxis(h, 10000); - } /*! @@ -1843,60 +2047,81 @@ setDMRHistStyleAndLegend(TH1F* h, PlotAlignmentValidation::DMRPlotInfo& plotinfo * \brief Create the DMR histrogram using data stored in trees and store them in the plotinfo structure. */ -void PlotAlignmentValidation:: -plotDMRHistogram(PlotAlignmentValidation::DMRPlotInfo& plotinfo, int direction, int layer, std::string subdet) -{ +void PlotAlignmentValidation::plotDMRHistogram(PlotAlignmentValidation::DMRPlotInfo& plotinfo, + int direction, + int layer, + std::string subdet) { TH1F* h = 0; //Create a name for the histogram that summarize all relevant information: name of the geometry, variable plotted, structure, layer, and whether the modules considered point inward or outward. - TString histoname=""; - if(plotinfo.variable == "medianX" || plotinfo.variable == "medianY" )histoname="median"; - else if(plotinfo.variable == "rmsNormX" || plotinfo.variable == "rmsNormY")histoname="DrmsNR"; - histoname+="_"; histoname+=plotinfo.vars->getName(); - histoname.ReplaceAll(" ","_"); - histoname+="_"; histoname+=subdet.c_str(); - if (plotinfo.variable == "medianY" || plotinfo.variable == "rmsNormY")histoname+="_y"; - if(layer!=0){ - if(subdet=="TID"||subdet=="TEC")histoname+="_disc"; - else histoname+="_layer"; - histoname+=to_string(layer); - } - if (direction == -1) { histoname += "_minus"; } - else if (direction == 1) { histoname += "_plus"; } - else { histoname += ""; } - std::string plotVariable = getVariableForDMRPlot(histoname.Data(), plotinfo.variable, plotinfo.nbins, plotinfo.min, plotinfo.max); + TString histoname = ""; + if (plotinfo.variable == "medianX" || plotinfo.variable == "medianY") + histoname = "median"; + else if (plotinfo.variable == "rmsNormX" || plotinfo.variable == "rmsNormY") + histoname = "DrmsNR"; + histoname += "_"; + histoname += plotinfo.vars->getName(); + histoname.ReplaceAll(" ", "_"); + histoname += "_"; + histoname += subdet.c_str(); + if (plotinfo.variable == "medianY" || plotinfo.variable == "rmsNormY") + histoname += "_y"; + if (layer != 0) { + if (subdet == "TID" || subdet == "TEC") + histoname += "_disc"; + else + histoname += "_layer"; + histoname += to_string(layer); + } + if (direction == -1) { + histoname += "_minus"; + } else if (direction == 1) { + histoname += "_plus"; + } else { + histoname += ""; + } + std::string plotVariable = + getVariableForDMRPlot(histoname.Data(), plotinfo.variable, plotinfo.nbins, plotinfo.min, plotinfo.max); std::string selection = getSelectionForDMRPlot(plotinfo.minHits, plotinfo.subDetId, direction, layer); plotinfo.vars->getTree()->Draw(plotVariable.c_str(), selection.c_str(), "goff"); - if (gDirectory) gDirectory->GetObject(histoname.Data(), h); + if (gDirectory) + gDirectory->GetObject(histoname.Data(), h); if (h && h->GetEntries() > 0) { - if (direction == -1) { plotinfo.h1 = h; } - else if (direction == 1) { plotinfo.h2 = h; } - else { plotinfo.h = h; } + if (direction == -1) { + plotinfo.h1 = h; + } else if (direction == 1) { + plotinfo.h2 = h; + } else { + plotinfo.h = h; + } } - if(plotinfo.variable == "medianX" || plotinfo.variable == "medianY" || plotinfo.variable == "rmsNormX" || plotinfo.variable == "rmsNormY") + if (plotinfo.variable == "medianX" || plotinfo.variable == "medianY" || plotinfo.variable == "rmsNormX" || + plotinfo.variable == "rmsNormY") storeHistogramInRootfile(h); - } -void PlotAlignmentValidation::modifySSHistAndLegend(THStack* hs, TLegend* legend) -{ +void PlotAlignmentValidation::modifySSHistAndLegend(THStack* hs, TLegend* legend) { // Add mean-y-values to the legend and scale the histograms. Double_t legendY = 0.80; bool hasheader = (TkAlStyle::legendheader != ""); - if (hasheader) legend->SetHeader(TkAlStyle::legendheader); + if (hasheader) + legend->SetHeader(TkAlStyle::legendheader); legend->SetFillStyle(0); int legendsize = hs->GetHists()->GetSize() + hasheader; if (legendsize > 3) legendY -= 0.01 * (legendsize - 3); - if (bigtext_) { legendY -= 0.05; } + if (bigtext_) { + legendY -= 0.05; + } if (legendY < 0.6) { std::cerr << "Warning: Huge legend!" << std::endl; legendY = 0.6; } legend->SetY1(legendY); - if (bigtext_) legend->SetTextSize(TkAlStyle::textSize); + if (bigtext_) + legend->SetTextSize(TkAlStyle::textSize); // Loop over all profiles TProfile* prof = 0; @@ -1912,8 +2137,8 @@ void PlotAlignmentValidation::modifySSHistAndLegend(THStack* hs, TLegend* legend std::ostringstream legendtext; legendtext.precision(3); - legendtext << fixed; // to always show 3 decimals - legendtext << ": y mean = " << stats[4]/stats[0]*scale << " #mum"; + legendtext << fixed; // to always show 3 decimals + legendtext << ": y mean = " << stats[4] / stats[0] * scale << " #mum"; TLegendEntry* entry = (TLegendEntry*)legend->GetListOfPrimitives()->At(index); if (entry == 0) @@ -1924,58 +2149,55 @@ void PlotAlignmentValidation::modifySSHistAndLegend(THStack* hs, TLegend* legend } // Make some room for the legend - hs->SetMaximum(hs->GetMaximum("nostack PE")*1.3); + hs->SetMaximum(hs->GetMaximum("nostack PE") * 1.3); } - //random variable: \sigma_{X_1}-\sigma_{X_2}-\delta_{RMS} //is centered approx around 0 //null hypothesis: \delta_{RMS}=0 //so \delta_\sigma is a realization of this random variable //how probable is it to get our value of \delta_\sigma? //->p-value -double PlotAlignmentValidation::resampleTestOfEqualRMS(TH1F* h1, TH1F* h2, int numSamples){ -//vector to store realizations of random variable - vector diff; - diff.clear(); -//"true" (in bootstrap terms) difference of the samples' RMS - double rmsdiff = abs(h1->GetRMS()-h2->GetRMS()); -//means of the samples to calculate RMS - double m1 = h1->GetMean(); - double m2 = h2->GetMean(); -//realization of random variable - double d1 = 0; - double d2 = 0; -//mean of random variable - double test_mean=0; - for(int i=0;iGetEntries();i++){ - d1+=h1->GetRandom()-m1; - } - for(int i=0;iGetEntries();i++){ - d2+=h2->GetRandom()+m2; - } - d1/=h1->GetEntries(); - d2/=h2->GetEntries(); - diff.push_back(abs(d1-d2-rmsdiff)); - test_mean+=abs(d1-d2-rmsdiff); +double PlotAlignmentValidation::resampleTestOfEqualRMS(TH1F* h1, TH1F* h2, int numSamples) { + //vector to store realizations of random variable + vector diff; + diff.clear(); + //"true" (in bootstrap terms) difference of the samples' RMS + double rmsdiff = abs(h1->GetRMS() - h2->GetRMS()); + //means of the samples to calculate RMS + double m1 = h1->GetMean(); + double m2 = h2->GetMean(); + //realization of random variable + double d1 = 0; + double d2 = 0; + //mean of random variable + double test_mean = 0; + for (int i = 0; i < numSamples; i++) { + d1 = 0; + d2 = 0; + for (int i = 0; i < h1->GetEntries(); i++) { + d1 += h1->GetRandom() - m1; } - test_mean/=numSamples; -//p value - double p=0; - for(double d:diff){ - if(d>rmsdiff){ - p+=1; - } + for (int i = 0; i < h2->GetEntries(); i++) { + d2 += h2->GetRandom() + m2; } - - p/=numSamples; - return p; -} - + d1 /= h1->GetEntries(); + d2 /= h2->GetEntries(); + diff.push_back(abs(d1 - d2 - rmsdiff)); + test_mean += abs(d1 - d2 - rmsdiff); + } + test_mean /= numSamples; + //p value + double p = 0; + for (double d : diff) { + if (d > rmsdiff) { + p += 1; + } + } + p /= numSamples; + return p; +} //random variable: (\overline{X_1}-\mu_1)-(\overline{X_2}-\mu_2) //is centered approx around 0 @@ -1983,150 +2205,137 @@ double PlotAlignmentValidation::resampleTestOfEqualRMS(TH1F* h1, TH1F* h2, int n //so \delta_\mu is a realization of this random variable //how probable is it to get our value of \delta_\mu? //->p-value -double PlotAlignmentValidation::resampleTestOfEqualMeans(TH1F* h1, TH1F* h2, int numSamples){ -//vector to store realization of random variable - vector diff; - diff.clear(); -//"true" (in bootstrap terms) difference of the samples' means - double meandiff = abs(h1->GetMean()-h2->GetMean()); -//realization of random variable - double d1 = 0; - double d2=0; -//mean of random variable - double test_mean=0; - for(int i=0;iGetEntries();i++){ - d1+=h1->GetRandom(); - } - for(int i=0;iGetEntries();i++){ - d2+=h2->GetRandom(); - } - d1/=h1->GetEntries(); - d2/=h2->GetEntries(); - diff.push_back(abs(d1-d2-meandiff)); - test_mean+=abs(d1-d2-meandiff); +double PlotAlignmentValidation::resampleTestOfEqualMeans(TH1F* h1, TH1F* h2, int numSamples) { + //vector to store realization of random variable + vector diff; + diff.clear(); + //"true" (in bootstrap terms) difference of the samples' means + double meandiff = abs(h1->GetMean() - h2->GetMean()); + //realization of random variable + double d1 = 0; + double d2 = 0; + //mean of random variable + double test_mean = 0; + for (int i = 0; i < numSamples; i++) { + d1 = 0; + d2 = 0; + for (int i = 0; i < h1->GetEntries(); i++) { + d1 += h1->GetRandom(); } - test_mean/=numSamples; -//p-value - double p=0; - for(double d:diff){ - if(d>meandiff){ - p+=1; - } + for (int i = 0; i < h2->GetEntries(); i++) { + d2 += h2->GetRandom(); } - - p/=numSamples; - return p; -} - + d1 /= h1->GetEntries(); + d2 /= h2->GetEntries(); + diff.push_back(abs(d1 - d2 - meandiff)); + test_mean += abs(d1 - d2 - meandiff); + } + test_mean /= numSamples; + //p-value + double p = 0; + for (double d : diff) { + if (d > meandiff) { + p += 1; + } + } + p /= numSamples; + return p; +} -float PlotAlignmentValidation::twotailedStudentTTestEqualMean(float t, float v){ -return 2*(1-ROOT::Math::tdistribution_cdf(abs(t),v)); +float PlotAlignmentValidation::twotailedStudentTTestEqualMean(float t, float v) { + return 2 * (1 - ROOT::Math::tdistribution_cdf(abs(t), v)); } const TString PlotAlignmentValidation::summaryfilename = "OfflineValidationSummary"; +vector PlotAlignmentValidation::findmodule(TFile* f, unsigned int moduleid) { + //TFile *f = TFile::Open(filename, "READ"); + TString histnamex; + TString histnamey; + //read necessary branch/folder + auto t = (TTree*)f->Get("TrackerOfflineValidationStandalone/TkOffVal"); + + TkOffTreeVariables* variables = 0; + t->SetBranchAddress("TkOffTreeVariables", &variables); + unsigned int number_of_entries = t->GetEntries(); + for (unsigned int i = 0; i < number_of_entries; i++) { + t->GetEntry(i); + if (variables->moduleId == moduleid) { + histnamex = variables->histNameX; + histnamey = variables->histNameY; + break; + } + } + vector h; -vector PlotAlignmentValidation::findmodule (TFile* f, unsigned int moduleid){ - - - //TFile *f = TFile::Open(filename, "READ"); - TString histnamex; - TString histnamey; - //read necessary branch/folder - auto t = (TTree*)f->Get("TrackerOfflineValidationStandalone/TkOffVal"); - - TkOffTreeVariables *variables=0; - t->SetBranchAddress("TkOffTreeVariables", &variables); - unsigned int number_of_entries=t->GetEntries(); - for (unsigned int i=0;iGetEntry(i); - if (variables->moduleId==moduleid){ - histnamex=variables->histNameX; - histnamey=variables->histNameY; - break; - } - } - - vector h; - - auto h1 = (TH1*)f->FindObjectAny(histnamex); - auto h2 = (TH1*)f->FindObjectAny(histnamey); - - h1->SetDirectory(0); - h2->SetDirectory(0); - - h.push_back(h1); - h.push_back(h2); - - return h; - } - -void PlotAlignmentValidation::residual_by_moduleID( unsigned int moduleid){ - TCanvas *cx = new TCanvas("x_residual"); - TCanvas *cy = new TCanvas("y_residual"); - TLegend *legendx =new TLegend(0.55, 0.7, 1, 0.9); - TLegend *legendy =new TLegend(0.55, 0.7, 1, 0.9); - - legendx->SetTextSize(0.016); - legendx->SetTextAlign(12); - legendy->SetTextSize(0.016); - legendy->SetTextAlign(12); - - - - - for (auto it : sourceList) { - TFile* file = it->getFile(); - int color = it->getLineColor(); - int linestyle = it->getLineStyle(); //this you set by doing h->SetLineStyle(linestyle) - TString legendname = it->getName(); //this goes in the legend - vector hist = findmodule(file, moduleid); - - TString histnamex = legendname+" NEntries: "+to_string(int(hist[0]->GetEntries())); - hist[0]->SetTitle(histnamex); - hist[0]->SetStats(0); - hist[0]->Rebin(50); - hist[0]->SetBit(TH1::kNoTitle); - hist[0]->SetLineColor(color); - hist[0]->SetLineStyle(linestyle); - cx->cd(); - hist[0]->Draw("Same"); - legendx->AddEntry(hist[0], histnamex, "l"); - - - TString histnamey = legendname+" NEntries: "+to_string(int(hist[1]->GetEntries())); - hist[1]->SetTitle(histnamey); - hist[1]->SetStats(0); - hist[1]->Rebin(50); - hist[1]->SetBit(TH1::kNoTitle); - hist[1]->SetLineColor(color); - hist[1]->SetLineStyle(linestyle); - cy->cd(); - hist[1]->Draw("Same"); - legendy->AddEntry(hist[1], histnamey, "l"); - - } - - TString filenamex = "x_residual_"+to_string(moduleid); - TString filenamey = "y_residual_"+to_string(moduleid); - cx->cd(); - legendx->Draw(); - cx->SaveAs(outputDir + "/" +filenamex+".root"); - cx->SaveAs(outputDir + "/" +filenamex+".pdf"); - cx->SaveAs(outputDir + "/" +filenamex+".png"); - cx->SaveAs(outputDir + "/" +filenamex+".eps"); - - cy->cd(); - legendy->Draw(); - cy->SaveAs(outputDir + "/" +filenamey+".root"); - cy->SaveAs(outputDir + "/" +filenamey+".pdf"); - cy->SaveAs(outputDir + "/" +filenamey+".png"); - cy->SaveAs(outputDir + "/" +filenamey+".eps"); - + auto h1 = (TH1*)f->FindObjectAny(histnamex); + auto h2 = (TH1*)f->FindObjectAny(histnamey); + + h1->SetDirectory(0); + h2->SetDirectory(0); + + h.push_back(h1); + h.push_back(h2); + + return h; +} + +void PlotAlignmentValidation::residual_by_moduleID(unsigned int moduleid) { + TCanvas* cx = new TCanvas("x_residual"); + TCanvas* cy = new TCanvas("y_residual"); + TLegend* legendx = new TLegend(0.55, 0.7, 1, 0.9); + TLegend* legendy = new TLegend(0.55, 0.7, 1, 0.9); + + legendx->SetTextSize(0.016); + legendx->SetTextAlign(12); + legendy->SetTextSize(0.016); + legendy->SetTextAlign(12); + + for (auto it : sourceList) { + TFile* file = it->getFile(); + int color = it->getLineColor(); + int linestyle = it->getLineStyle(); //this you set by doing h->SetLineStyle(linestyle) + TString legendname = it->getName(); //this goes in the legend + vector hist = findmodule(file, moduleid); + + TString histnamex = legendname + " NEntries: " + TString(to_string(int(hist[0]->GetEntries()))); + hist[0]->SetTitle(histnamex); + hist[0]->SetStats(0); + hist[0]->Rebin(50); + hist[0]->SetBit(TH1::kNoTitle); + hist[0]->SetLineColor(color); + hist[0]->SetLineStyle(linestyle); + cx->cd(); + hist[0]->Draw("Same"); + legendx->AddEntry(hist[0], histnamex, "l"); + + TString histnamey = legendname + " NEntries: " + TString(to_string(int(hist[1]->GetEntries()))); + hist[1]->SetTitle(histnamey); + hist[1]->SetStats(0); + hist[1]->Rebin(50); + hist[1]->SetBit(TH1::kNoTitle); + hist[1]->SetLineColor(color); + hist[1]->SetLineStyle(linestyle); + cy->cd(); + hist[1]->Draw("Same"); + legendy->AddEntry(hist[1], histnamey, "l"); + } + TString filenamex = "x_residual_" + to_string(moduleid); + TString filenamey = "y_residual_" + to_string(moduleid); + cx->cd(); + legendx->Draw(); + cx->SaveAs(TString(outputDir + "/") + filenamex + ".root"); + cx->SaveAs(TString(outputDir + "/") + filenamex + ".pdf"); + cx->SaveAs(TString(outputDir + "/") + filenamex + ".png"); + cx->SaveAs(TString(outputDir + "/") + filenamex + ".eps"); + + cy->cd(); + legendy->Draw(); + cy->SaveAs(TString(outputDir + "/") + filenamey + ".root"); + cy->SaveAs(TString(outputDir + "/") + filenamey + ".pdf"); + cy->SaveAs(TString(outputDir + "/") + filenamey + ".png"); + cy->SaveAs(TString(outputDir + "/") + filenamey + ".eps"); } diff --git a/Alignment/OfflineValidation/macros/trackSplitPlot.h b/Alignment/OfflineValidation/macros/trackSplitPlot.h index 123208cc73b90..a75958e2f6592 100644 --- a/Alignment/OfflineValidation/macros/trackSplitPlot.h +++ b/Alignment/OfflineValidation/macros/trackSplitPlot.h @@ -9,6 +9,7 @@ #include "TClass.h" #include "TColor.h" #include "TFile.h" +#include "TF1.h" #include "TGaxis.h" #include "TGraph2DErrors.h" #include "TGraphErrors.h" @@ -29,9 +30,8 @@ #include "TText.h" #include "TTree.h" - -enum PlotType {ScatterPlot,Profile,Histogram,OrgHistogram,Resolution}; -enum Statistic {Minimum, Maximum, Average, RMS}; +enum PlotType { ScatterPlot, Profile, Histogram, OrgHistogram, Resolution }; +enum Statistic { Minimum, Maximum, Average, RMS }; const Double_t pi = TMath::Pi(); vector colors; @@ -45,15 +45,15 @@ Int_t legendGrid = 100; Double_t margin = .1; Double_t increaseby = .1; -TString xvariables[xsize] = {"", "pt", "eta", "phi", "dz", "dxy", "theta", "qoverpt"}; -TString yvariables[ysize] = {"pt", "pt", "eta", "phi", "dz", "dxy", "theta", "qoverpt", ""}; -Bool_t relativearray[ysize] = {true, false, false, false, false, false, false, false, false}; +TString xvariables[xsize] = {"", "pt", "eta", "phi", "dz", "dxy", "theta", "qoverpt"}; +TString yvariables[ysize] = {"pt", "pt", "eta", "phi", "dz", "dxy", "theta", "qoverpt", ""}; +Bool_t relativearray[ysize] = {true, false, false, false, false, false, false, false, false}; TList *stufftodelete = new TList(); TString subdetector = "PIXEL"; -double outliercut = 0.99; //use the middle 99% of tracks to find the mean and RMS - //(a few tracks are fit badly and skew them otherwise) +double outliercut = 0.99; //use the middle 99% of tracks to find the mean and RMS + //(a few tracks are fit badly and skew them otherwise) /*********************************** Table Of Contents @@ -68,136 +68,335 @@ Table Of Contents #include "trackSplitPlot.h" ofstream devnull("/dev/null"); -template T identity(T t) {return t;} +template +T identity(T t) { + return t; +} //=================== //0. Track Split Plot //=================== -TCanvas *trackSplitPlot(Int_t nFiles,TString *files,TString *names,TString xvar,TString yvar, - Bool_t relative = false,Bool_t resolution = false,Bool_t pull = false, - TString saveas = "", ostream& summaryfile=devnull); -TCanvas *trackSplitPlot(Int_t nFiles,TString *files,TString *names,TString var, - Bool_t relative = false,Bool_t pull = false,TString saveas = "", ostream& summaryfile=devnull); -TCanvas *trackSplitPlot(TString file,TString xvar,TString yvar,Bool_t profile = false, - Bool_t relative = false,Bool_t resolution = false,Bool_t pull = false, - TString saveas = "", ostream& summaryfile=devnull); -TCanvas *trackSplitPlot(TString file,TString var, - Bool_t relative = false,Bool_t pull = false, - TString saveas = "", ostream& summaryfile=devnull); -void placeholder(TString saveas = "",Bool_t wide = false); -void saveplot(TCanvas *c1,TString saveas); +TCanvas *trackSplitPlot(Int_t nFiles, + TString *files, + TString *names, + TString xvar, + TString yvar, + Bool_t relative = false, + Bool_t resolution = false, + Bool_t pull = false, + TString saveas = "", + ostream &summaryfile = devnull); +TCanvas *trackSplitPlot(Int_t nFiles, + TString *files, + TString *names, + TString var, + Bool_t relative = false, + Bool_t pull = false, + TString saveas = "", + ostream &summaryfile = devnull); +TCanvas *trackSplitPlot(TString file, + TString xvar, + TString yvar, + Bool_t profile = false, + Bool_t relative = false, + Bool_t resolution = false, + Bool_t pull = false, + TString saveas = "", + ostream &summaryfile = devnull); +TCanvas *trackSplitPlot(TString file, + TString var, + Bool_t relative = false, + Bool_t pull = false, + TString saveas = "", + ostream &summaryfile = devnull); +void placeholder(TString saveas = "", Bool_t wide = false); +void saveplot(TCanvas *c1, TString saveas); void deleteCanvas(TObject *canvas); void setupcolors(); -void runNumberZoomed(Int_t nFiles,TString *files,TString *names,TString yvar, - Bool_t relative = false,Bool_t resolution = false,Bool_t pull = false, - Int_t firstRun = -1,Int_t lastRun = -1,TString saveas = ""); +void runNumberZoomed(Int_t nFiles, + TString *files, + TString *names, + TString yvar, + Bool_t relative = false, + Bool_t resolution = false, + Bool_t pull = false, + Int_t firstRun = -1, + Int_t lastRun = -1, + TString saveas = ""); //========================== //1. Misalignment Dependence //========================== void misalignmentDependence(TCanvas *c1old, - Int_t nFiles,TString *names,TString misalignment,Double_t *values,Double_t *phases,TString xvar,TString yvar, - TF1 *function,Int_t parameter,TString parametername = "",TString functionname = "", - Bool_t relative = false,Bool_t resolution = false,Bool_t pull = false, + Int_t nFiles, + TString *names, + TString misalignment, + Double_t *values, + Double_t *phases, + TString xvar, + TString yvar, + TF1 *function, + Int_t parameter, + TString parametername = "", + TString functionname = "", + Bool_t relative = false, + Bool_t resolution = false, + Bool_t pull = false, TString saveas = ""); void misalignmentDependence(TCanvas *c1old, - Int_t nFiles,TString *names,TString misalignment,Double_t *values,Double_t *phases,TString xvar,TString yvar, - TF1 *function,Int_t nParameters,Int_t *parameters,TString *parameternames,TString functionname = "", - Bool_t relative = false,Bool_t resolution = false,Bool_t pull = false, + Int_t nFiles, + TString *names, + TString misalignment, + Double_t *values, + Double_t *phases, + TString xvar, + TString yvar, + TF1 *function, + Int_t nParameters, + Int_t *parameters, + TString *parameternames, + TString functionname = "", + Bool_t relative = false, + Bool_t resolution = false, + Bool_t pull = false, TString saveas = ""); -void misalignmentDependence(Int_t nFiles,TString *files,TString *names,TString misalignment,Double_t *values,Double_t *phases,TString xvar,TString yvar, - TF1 *function,Int_t parameter,TString parametername = "",TString functionname = "", - Bool_t relative = false,Bool_t resolution = false,Bool_t pull = false, +void misalignmentDependence(Int_t nFiles, + TString *files, + TString *names, + TString misalignment, + Double_t *values, + Double_t *phases, + TString xvar, + TString yvar, + TF1 *function, + Int_t parameter, + TString parametername = "", + TString functionname = "", + Bool_t relative = false, + Bool_t resolution = false, + Bool_t pull = false, TString saveas = ""); -void misalignmentDependence(Int_t nFiles,TString *files,TString *names,TString misalignment,Double_t *values,Double_t *phases,TString xvar,TString yvar, - TF1 *function,Int_t nParameters,Int_t *parameters,TString *parameternames,TString functionname = "", - Bool_t relative = false,Bool_t resolution = false,Bool_t pull = false, +void misalignmentDependence(Int_t nFiles, + TString *files, + TString *names, + TString misalignment, + Double_t *values, + Double_t *phases, + TString xvar, + TString yvar, + TF1 *function, + Int_t nParameters, + Int_t *parameters, + TString *parameternames, + TString functionname = "", + Bool_t relative = false, + Bool_t resolution = false, + Bool_t pull = false, TString saveas = ""); void misalignmentDependence(TCanvas *c1old, - Int_t nFiles,TString *names,TString misalignment,Double_t *values,Double_t *phases,TString xvar,TString yvar, - TString function,Int_t parameter,TString parametername = "",TString functionname = "", - Bool_t relative = false,Bool_t resolution = false,Bool_t pull = false, + Int_t nFiles, + TString *names, + TString misalignment, + Double_t *values, + Double_t *phases, + TString xvar, + TString yvar, + TString function, + Int_t parameter, + TString parametername = "", + TString functionname = "", + Bool_t relative = false, + Bool_t resolution = false, + Bool_t pull = false, TString saveas = ""); void misalignmentDependence(TCanvas *c1old, - Int_t nFiles,TString *names,TString misalignment,Double_t *values,Double_t *phases,TString xvar,TString yvar, - TString function,Int_t nParameters,Int_t *parameters,TString *parameternames,TString functionname = "", - Bool_t relative = false,Bool_t resolution = false,Bool_t pull = false, + Int_t nFiles, + TString *names, + TString misalignment, + Double_t *values, + Double_t *phases, + TString xvar, + TString yvar, + TString function, + Int_t nParameters, + Int_t *parameters, + TString *parameternames, + TString functionname = "", + Bool_t relative = false, + Bool_t resolution = false, + Bool_t pull = false, TString saveas = ""); -void misalignmentDependence(Int_t nFiles,TString *files,TString *names,TString misalignment,Double_t *values,Double_t *phases,TString xvar,TString yvar, - TString function,Int_t parameter,TString parametername = "",TString functionname = "", - Bool_t relative = false,Bool_t resolution = false,Bool_t pull = false, +void misalignmentDependence(Int_t nFiles, + TString *files, + TString *names, + TString misalignment, + Double_t *values, + Double_t *phases, + TString xvar, + TString yvar, + TString function, + Int_t parameter, + TString parametername = "", + TString functionname = "", + Bool_t relative = false, + Bool_t resolution = false, + Bool_t pull = false, TString saveas = ""); -void misalignmentDependence(Int_t nFiles,TString *files,TString *names,TString misalignment,Double_t *values,Double_t *phases,TString xvar,TString yvar, - TString function,Int_t nParameters,Int_t *parameters,TString *parameternames,TString functionname = "", - Bool_t relative = false,Bool_t resolution = false,Bool_t pull = false, +void misalignmentDependence(Int_t nFiles, + TString *files, + TString *names, + TString misalignment, + Double_t *values, + Double_t *phases, + TString xvar, + TString yvar, + TString function, + Int_t nParameters, + Int_t *parameters, + TString *parameternames, + TString functionname = "", + Bool_t relative = false, + Bool_t resolution = false, + Bool_t pull = false, TString saveas = ""); Bool_t misalignmentDependence(TCanvas *c1old, - Int_t nFiles,TString *names,TString misalignment,Double_t *values,Double_t *phases,TString xvar,TString yvar, + Int_t nFiles, + TString *names, + TString misalignment, + Double_t *values, + Double_t *phases, + TString xvar, + TString yvar, Bool_t drawfits = true, - Bool_t relative = false,Bool_t resolution = false,Bool_t pull = false, + Bool_t relative = false, + Bool_t resolution = false, + Bool_t pull = false, TString saveas = ""); -Bool_t misalignmentDependence(Int_t nFiles,TString *files,TString *names,TString misalignment,Double_t *values,Double_t *phases,TString xvar,TString yvar, +Bool_t misalignmentDependence(Int_t nFiles, + TString *files, + TString *names, + TString misalignment, + Double_t *values, + Double_t *phases, + TString xvar, + TString yvar, Bool_t drawfits = true, - Bool_t relative = false,Bool_t resolution = false,Bool_t pull = false, + Bool_t relative = false, + Bool_t resolution = false, + Bool_t pull = false, TString saveas = ""); -Bool_t hasFit(TString misalignment,TString xvar,TString yvar,Bool_t relative = false,Bool_t resolution = false,Bool_t pull = false); - +Bool_t hasFit(TString misalignment, + TString xvar, + TString yvar, + Bool_t relative = false, + Bool_t resolution = false, + Bool_t pull = false); //============= //2. Make Plots //============= -void makePlots(Int_t nFiles,TString *files,TString *names,TString misalignment,Double_t *values,Double_t *phases,TString directory,Bool_t matrix[xsize][ysize]); -void makePlots(Int_t nFiles,TString *files,TString *names,TString directory, Bool_t matrix[xsize][ysize]); -void makePlots(TString file,TString misalignment,Double_t *values,Double_t *phases,TString directory,Bool_t matrix[xsize][ysize]); -void makePlots(TString file,TString directory,Bool_t matrix[xsize][ysize]); -void makePlots(Int_t nFiles,TString *files,TString *names,TString misalignment,Double_t *values,Double_t *phases,TString directory,TString xvar,TString yvar); -void makePlots(Int_t nFiles,TString *files,TString *names,TString directory,TString xvar,TString yvar); -void makePlots(TString file,TString misalignment,Double_t *values,Double_t *phases,TString directory, - TString xvar,TString yvar); -void makePlots(TString file,TString directory,TString xvar,TString yvar); -void makePlots(Int_t nFiles,TString *files,TString *names,TString misalignment,Double_t *values,Double_t *phases,TString directory); -void makePlots(Int_t nFiles,TString *files,TString *names,TString directory); -void makePlots(TString file,TString misalignment,Double_t *values,Double_t *phases,TString directory); -void makePlots(TString file,TString directory); +void makePlots(Int_t nFiles, + TString *files, + TString *names, + TString misalignment, + Double_t *values, + Double_t *phases, + TString directory, + Bool_t matrix[xsize][ysize]); +void makePlots(Int_t nFiles, TString *files, TString *names, TString directory, Bool_t matrix[xsize][ysize]); +void makePlots(TString file, + TString misalignment, + Double_t *values, + Double_t *phases, + TString directory, + Bool_t matrix[xsize][ysize]); +void makePlots(TString file, TString directory, Bool_t matrix[xsize][ysize]); +void makePlots(Int_t nFiles, + TString *files, + TString *names, + TString misalignment, + Double_t *values, + Double_t *phases, + TString directory, + TString xvar, + TString yvar); +void makePlots(Int_t nFiles, TString *files, TString *names, TString directory, TString xvar, TString yvar); +void makePlots(TString file, + TString misalignment, + Double_t *values, + Double_t *phases, + TString directory, + TString xvar, + TString yvar); +void makePlots(TString file, TString directory, TString xvar, TString yvar); +void makePlots(Int_t nFiles, + TString *files, + TString *names, + TString misalignment, + Double_t *values, + Double_t *phases, + TString directory); +void makePlots(Int_t nFiles, TString *files, TString *names, TString directory); +void makePlots(TString file, TString misalignment, Double_t *values, Double_t *phases, TString directory); +void makePlots(TString file, TString directory); //============= //3. Axis Label //============= TString fancyname(TString variable); -TString units(TString variable,Char_t axis); -TString plainunits(TString variable,Char_t axis); -TString latexunits(TString variable,Char_t axis); -TString axislabel(TString variable, Char_t axis, Bool_t relative = false, Bool_t resolution = false, Bool_t pull = false); -TString latexlabel(TString variable, Char_t axis, Bool_t relative = false, Bool_t resolution = false, Bool_t pull = false); -void setAxisLabels(TH1 *p, PlotType type,TString xvar,TString yvar,Bool_t relative,Bool_t pull); -void setAxisLabels(TMultiGraph *p, PlotType type,TString xvar,TString yvar,Bool_t relative,Bool_t pull); -TString nPart(Int_t part,TString string,TString delimit = ";",Bool_t removerest = true); +TString units(TString variable, Char_t axis); +TString plainunits(TString variable, Char_t axis); +TString latexunits(TString variable, Char_t axis); +TString axislabel( + TString variable, Char_t axis, Bool_t relative = false, Bool_t resolution = false, Bool_t pull = false); +TString latexlabel( + TString variable, Char_t axis, Bool_t relative = false, Bool_t resolution = false, Bool_t pull = false); +void setAxisLabels(TH1 *p, PlotType type, TString xvar, TString yvar, Bool_t relative, Bool_t pull); +void setAxisLabels(TMultiGraph *p, PlotType type, TString xvar, TString yvar, Bool_t relative, Bool_t pull); +TString nPart(Int_t part, TString string, TString delimit = ";", Bool_t removerest = true); //============== //4. Axis Limits //============== -Double_t findStatistic(Statistic what,Int_t nFiles,TString *files,TString var,Char_t axis,Bool_t relative = false,Bool_t pull = false); -Double_t findAverage(Int_t nFiles,TString *files,TString var,Char_t axis,Bool_t relative = false,Bool_t pull = false); -Double_t findMin(Int_t nFiles,TString *files,TString var,Char_t axis,Bool_t relative = false,Bool_t pull = false); -Double_t findMax(Int_t nFiles,TString *files,TString var,Char_t axis,Bool_t relative = false,Bool_t pull = false); -Double_t findRMS(Int_t nFiles,TString *files,TString var,Char_t axis,Bool_t relative = false,Bool_t pull = false); -Double_t findStatistic(Statistic what,TString file,TString var,Char_t axis,Bool_t relative = false,Bool_t pull = false); -Double_t findAverage(TString file,TString var,Char_t axis,Bool_t relative = false,Bool_t pull = false); -Double_t findMin(TString file,TString var,Char_t axis,Bool_t relative = false,Bool_t pull = false); -Double_t findMax(TString file,TString var,Char_t axis,Bool_t relative = false,Bool_t pull = false); -Double_t findRMS(TString file,TString var,Char_t axis,Bool_t relative = false,Bool_t pull = false); -void axislimits(Int_t nFiles,TString *files,TString var,Char_t axis,Bool_t relative,Bool_t pull,Double_t &min,Double_t &max,Double_t &bins); +Double_t findStatistic(Statistic what, + Int_t nFiles, + TString *files, + TString var, + Char_t axis, + Bool_t relative = false, + Bool_t pull = false); +Double_t findAverage( + Int_t nFiles, TString *files, TString var, Char_t axis, Bool_t relative = false, Bool_t pull = false); +Double_t findMin(Int_t nFiles, TString *files, TString var, Char_t axis, Bool_t relative = false, Bool_t pull = false); +Double_t findMax(Int_t nFiles, TString *files, TString var, Char_t axis, Bool_t relative = false, Bool_t pull = false); +Double_t findRMS(Int_t nFiles, TString *files, TString var, Char_t axis, Bool_t relative = false, Bool_t pull = false); +Double_t findStatistic( + Statistic what, TString file, TString var, Char_t axis, Bool_t relative = false, Bool_t pull = false); +Double_t findAverage(TString file, TString var, Char_t axis, Bool_t relative = false, Bool_t pull = false); +Double_t findMin(TString file, TString var, Char_t axis, Bool_t relative = false, Bool_t pull = false); +Double_t findMax(TString file, TString var, Char_t axis, Bool_t relative = false, Bool_t pull = false); +Double_t findRMS(TString file, TString var, Char_t axis, Bool_t relative = false, Bool_t pull = false); +void axislimits(Int_t nFiles, + TString *files, + TString var, + Char_t axis, + Bool_t relative, + Bool_t pull, + Double_t &min, + Double_t &max, + Double_t &bins); //=============== //5. Place Legend //=============== -Double_t placeLegend(TLegend *l, Double_t width, Double_t height, Double_t x1min, Double_t y1min, Double_t x2max, Double_t y2max); -Bool_t fitsHere(TLegend *l,Double_t x1, Double_t y1, Double_t x2, Double_t y2); +Double_t placeLegend( + TLegend *l, Double_t width, Double_t height, Double_t x1min, Double_t y1min, Double_t x2max, Double_t y2max); +Bool_t fitsHere(TLegend *l, Double_t x1, Double_t y1, Double_t x2, Double_t y2); #endif diff --git a/Alignment/OfflineValidation/plugins/BuildFile.xml b/Alignment/OfflineValidation/plugins/BuildFile.xml index 9a516c4315241..5f837ecee49c1 100644 --- a/Alignment/OfflineValidation/plugins/BuildFile.xml +++ b/Alignment/OfflineValidation/plugins/BuildFile.xml @@ -12,6 +12,7 @@ + diff --git a/Alignment/OfflineValidation/plugins/DMRChecker.cc b/Alignment/OfflineValidation/plugins/DMRChecker.cc index cd68af995f2e3..2d4bc4b3fe7d2 100644 --- a/Alignment/OfflineValidation/plugins/DMRChecker.cc +++ b/Alignment/OfflineValidation/plugins/DMRChecker.cc @@ -149,11 +149,11 @@ namespace running { class DMRChecker : public edm::one::EDAnalyzer { public: DMRChecker(const edm::ParameterSet &pset) - : geomToken_(esConsumes()), - runInfoToken_(esConsumes()), - magFieldToken_(esConsumes()), - topoToken_(esConsumes()), - latencyToken_(esConsumes()), + : geomToken_(esConsumes()), + runInfoToken_(esConsumes()), + magFieldToken_(esConsumes()), + topoToken_(esConsumes()), + latencyToken_(esConsumes()), isCosmics_(pset.getParameter("isCosmics")) { usesResource(TFileService::kSharedResource); @@ -195,7 +195,7 @@ class DMRChecker : public edm::one::EDAnalyzer { static void fillDescriptions(edm::ConfigurationDescriptions &); - ~DMRChecker() override {} + ~DMRChecker() override = default; /*_______________________________________________________ // @@ -620,7 +620,7 @@ class DMRChecker : public edm::one::EDAnalyzer { resDetailsTIB_[detid_db].rOrZDirection = resDetailsTIB_[detid_db].rDirection; // barrel (split in r) } - hTIBResXPrime->Fill(uOrientation * resX * 10000); + hTIBResXPrime->Fill(uOrientation * resX * cmToUm); hTIBResXPull->Fill(pullX); // update residuals @@ -630,7 +630,7 @@ class DMRChecker : public edm::one::EDAnalyzer { uOrientation = deltaPhi(gUDirection.barePhi(), gPModule.barePhi()) >= 0. ? +1.F : -1.F; //vOrientation = gVDirection.z() - gPModule.z() >= 0 ? +1.F : -1.F; // not used for Strips - hTOBResXPrime->Fill(uOrientation * resX * 10000); + hTOBResXPrime->Fill(uOrientation * resX * cmToUm); hTOBResXPull->Fill(pullX); // if the detid has never occcurred yet, set the local orientations @@ -647,7 +647,7 @@ class DMRChecker : public edm::one::EDAnalyzer { uOrientation = deltaPhi(gUDirection.barePhi(), gPModule.barePhi()) >= 0. ? +1.F : -1.F; //vOrientation = gVDirection.perp() - gPModule.perp() >= 0. ? +1.F : -1.F; // not used for Strips - hTIDResXPrime->Fill(uOrientation * resX * 10000); + hTIDResXPrime->Fill(uOrientation * resX * cmToUm); hTIDResXPull->Fill(pullX); // update residuals @@ -657,7 +657,7 @@ class DMRChecker : public edm::one::EDAnalyzer { uOrientation = deltaPhi(gUDirection.barePhi(), gPModule.barePhi()) >= 0. ? +1.F : -1.F; //vOrientation = gVDirection.perp() - gPModule.perp() >= 0. ? +1.F : -1.F; // not used for Strips - hTECResXPrime->Fill(uOrientation * resX * 10000); + hTECResXPrime->Fill(uOrientation * resX * cmToUm); hTECResXPull->Fill(pullX); // update residuals diff --git a/Alignment/OfflineValidation/plugins/GeneralPurposeTrackAnalyzer.cc b/Alignment/OfflineValidation/plugins/GeneralPurposeTrackAnalyzer.cc index 1574d3f914846..eb080b217c6fa 100644 --- a/Alignment/OfflineValidation/plugins/GeneralPurposeTrackAnalyzer.cc +++ b/Alignment/OfflineValidation/plugins/GeneralPurposeTrackAnalyzer.cc @@ -32,13 +32,16 @@ #include // user include files - #include "CommonTools/TrackerMap/interface/TrackerMap.h" #include "CommonTools/UtilAlgos/interface/TFileService.h" #include "CondFormats/AlignmentRecord/interface/GlobalPositionRcd.h" +#include "CondFormats/DataRecord/interface/SiPixelFedCablingMapRcd.h" #include "CondFormats/DataRecord/interface/SiStripCondDataRecords.h" +#include "CondFormats/SiPixelObjects/interface/SiPixelFedCablingMap.h" #include "CondFormats/SiStripObjects/interface/SiStripLatency.h" +#include "DQM/SiPixelPhase1Common/interface/SiPixelCoordinates.h" #include "DQM/TrackerRemapper/interface/Phase1PixelMaps.h" +#include "DQM/TrackerRemapper/interface/Phase1PixelROCMaps.h" #include "DataFormats/BeamSpot/interface/BeamSpot.h" #include "DataFormats/Common/interface/TriggerResults.h" #include "DataFormats/DetId/interface/DetId.h" @@ -60,11 +63,11 @@ #include "DataFormats/VertexReco/interface/Vertex.h" #include "DataFormats/VertexReco/interface/VertexFwd.h" #include "FWCore/Common/interface/TriggerNames.h" -#include "FWCore/Framework/interface/one/EDAnalyzer.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/EventSetup.h" #include "FWCore/Framework/interface/Frameworkfwd.h" #include "FWCore/Framework/interface/MakerMacros.h" +#include "FWCore/Framework/interface/one/EDAnalyzer.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "FWCore/ServiceRegistry/interface/Service.h" @@ -85,9 +88,12 @@ const int kFPIX = PixelSubdetector::PixelEndcap; class GeneralPurposeTrackAnalyzer : public edm::one::EDAnalyzer { public: GeneralPurposeTrackAnalyzer(const edm::ParameterSet &pset) - : geomToken_(esConsumes()), - magFieldToken_(esConsumes()), - latencyToken_(esConsumes()) { + : geomToken_(esConsumes()), + magFieldToken_(esConsumes()), + latencyToken_(esConsumes()), + geomTokenBR_(esConsumes()), + trackerTopologyTokenBR_(esConsumes()), + siPixelFedCablingMapTokenBR_(esConsumes()) { usesResource(TFileService::kSharedResource); TkTag_ = pset.getParameter("TkTag"); @@ -116,9 +122,11 @@ class GeneralPurposeTrackAnalyzer : public edm::one::EDAnalyzer("COLZ0 L"); pixelmap->bookBarrelHistograms("entriesBarrel", "# hits", "# pixel hits"); pixelmap->bookForwardHistograms("entriesForward", "# hits", "# pixel hits"); + + pixelrocsmap_ = std::make_unique(""); } - ~GeneralPurposeTrackAnalyzer() override {} + ~GeneralPurposeTrackAnalyzer() override = default; static void fillDescriptions(edm::ConfigurationDescriptions &); @@ -140,14 +148,21 @@ class GeneralPurposeTrackAnalyzer : public edm::one::EDAnalyzer magFieldToken_; const edm::ESGetToken latencyToken_; + const edm::ESGetToken geomTokenBR_; + const edm::ESGetToken trackerTopologyTokenBR_; + const edm::ESGetToken siPixelFedCablingMapTokenBR_; + edm::ESHandle magneticField_; + SiPixelCoordinates coord_; + edm::Service fs; std::unique_ptr tmap; std::unique_ptr pmap; std::unique_ptr pixelmap; + std::unique_ptr pixelrocsmap_; TH1D *hchi2ndof; TH1D *hNtrk; @@ -343,11 +358,13 @@ class GeneralPurposeTrackAnalyzer : public edm::one::EDAnalyzer rocsToMask; for (auto iHit = track->recHitsBegin(); iHit != track->recHitsEnd(); ++iHit) { if (this->isHit2D(**iHit)) { ++nHit2D; } - + // rest the ROCs for the map + rocsToMask.reset(); const DetId &detId = (*iHit)->geographicalId(); const GeomDet *geomDet(theGeometry->idToDet(detId)); @@ -358,6 +375,18 @@ class GeneralPurposeTrackAnalyzer : public edm::one::EDAnalyzercluster(); + + if (clustp.isNull()) + continue; + auto const &cluster = *clustp; + int row = cluster.x() - 0.5, col = cluster.y() - 0.5; + int rocId = coord_.roc(detId, std::make_pair(row, col)); + + rocsToMask.set(rocId); + pixelrocsmap_->fillSelectedRocs(detid_db, rocsToMask, 1); + if (!isPhase1_) { pmap->fill(detid_db, 1); } else { @@ -695,6 +724,14 @@ class GeneralPurposeTrackAnalyzer : public edm::one::EDAnalyzerGetXaxis()->SetBinLabel((the_r - theRuns_.front()) + 1, std::to_string(the_r).c_str()); } - pmap->save(true, 0, 0, "PixelHitMap.pdf", 600, 800); - pmap->save(true, 0, 0, "PixelHitMap.png", 500, 750); + if (!isPhase1_) { + pmap->save(true, 0, 0, "PixelHitMap.pdf", 600, 800); + pmap->save(true, 0, 0, "PixelHitMap.png", 500, 750); + } tmap->save(true, 0, 0, "StripHitMap.pdf"); tmap->save(true, 0, 0, "StripHitMap.png"); @@ -1139,6 +1178,10 @@ class GeneralPurposeTrackAnalyzer : public edm::one::EDAnalyzerdrawForwardMaps("entriesForward", cF); cF.SaveAs("pixelForwardEntries.png"); + + TCanvas cRocs = TCanvas("cRocs", "cRocs", 1200, 1600); + pixelrocsmap_->drawMaps(cRocs, "Pixel on-track clusters occupancy"); + cRocs.SaveAs("Phase1PixelROCMaps_fullROCs.png"); } //************************************************************* diff --git a/Alignment/OfflineValidation/plugins/TrackerOfflineValidationSummary.cc b/Alignment/OfflineValidation/plugins/TrackerOfflineValidationSummary.cc index 72182c759dbf6..51f7e40025717 100644 --- a/Alignment/OfflineValidation/plugins/TrackerOfflineValidationSummary.cc +++ b/Alignment/OfflineValidation/plugins/TrackerOfflineValidationSummary.cc @@ -55,7 +55,7 @@ // class decleration // -class TrackerOfflineValidationSummary : public edm::one::EDAnalyzer<> { +class TrackerOfflineValidationSummary : public edm::one::EDAnalyzer { public: typedef dqm::legacy::DQMStore DQMStore; explicit TrackerOfflineValidationSummary(const edm::ParameterSet&); @@ -63,7 +63,7 @@ class TrackerOfflineValidationSummary : public edm::one::EDAnalyzer<> { private: const edm::ESGetToken geomToken_; - const edm::ESGetToken topoToken_; + const edm::ESGetToken tTopoToken_; struct ModuleHistos { ModuleHistos() @@ -96,7 +96,9 @@ class TrackerOfflineValidationSummary : public edm::one::EDAnalyzer<> { HarvestingHistos harvestingHistos; }; + void beginRun(const edm::Run&, const edm::EventSetup& iSetup) override{}; void analyze(const edm::Event& evt, const edm::EventSetup&) override; + void endRun(const edm::Run&, const edm::EventSetup& iSetup) override; void endJob() override; void fillTree(TTree& tree, @@ -123,6 +125,7 @@ class TrackerOfflineValidationSummary : public edm::one::EDAnalyzer<> { const edm::ParameterSet parSet_; edm::ESHandle tkGeom_; + std::unique_ptr tTopo_; // parameters from cfg to steer const std::string moduleDirectory_; @@ -140,47 +143,31 @@ class TrackerOfflineValidationSummary : public edm::one::EDAnalyzer<> { std::map mTecResiduals_; std::vector vHarvestingHierarchy_; - - const edm::EventSetup* lastSetup_; }; -// -// constants, enums and typedefs -// - -// -// static data member definitions -// - // // constructors and destructor // TrackerOfflineValidationSummary::TrackerOfflineValidationSummary(const edm::ParameterSet& iConfig) - : //geomToken_(esConsumes()), # this does not work - topoToken_(esConsumes()), + : geomToken_(esConsumes()), + tTopoToken_(esConsumes()), parSet_(iConfig), + tTopo_(nullptr), moduleDirectory_(parSet_.getParameter("moduleDirectoryInOutput")), useFit_(parSet_.getParameter("useFit")), dbe_(nullptr), - moduleMapsInitialized(false), - lastSetup_(nullptr) { + moduleMapsInitialized(false) { //now do what ever initialization is needed dbe_ = edm::Service().operator->(); } -TrackerOfflineValidationSummary::~TrackerOfflineValidationSummary() { - // do anything here that needs to be done at desctruction time - // (e.g. close files, deallocate resources etc.) -} - +TrackerOfflineValidationSummary::~TrackerOfflineValidationSummary() = default; // // member functions // // ------------ method called to for each event ------------ void TrackerOfflineValidationSummary::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) { - lastSetup_ = &iSetup; - // Access of EventSetup is needed to get the list of silicon-modules and their IDs // Since they do not change, it is accessed only once if (moduleMapsInitialized) @@ -215,18 +202,16 @@ void TrackerOfflineValidationSummary::analyze(const edm::Event& iEvent, const ed moduleMapsInitialized = true; } +// ------------ method called at each end of Run ------------ +void TrackerOfflineValidationSummary::endRun(const edm::Run&, const edm::EventSetup& iSetup) { + if (!tTopo_) { + tTopo_ = std::make_unique(iSetup.getData(tTopoToken_)); + } +} + // ------------ method called once each job just after ending the event loop ------------ void TrackerOfflineValidationSummary::endJob() { - //Retrieve tracker topology from geometry - edm::ESHandle tTopoHandle; - lastSetup_->get().get(tTopoHandle); - const TrackerTopology* const tTopo = tTopoHandle.product(); - - // do not know how to set the transition - //edm::ESHandle tTopoHandle = lastSetup_->getHandle(topoToken_); - //const TrackerTopology *const tTopo = tTopoHandle.product(); - - AlignableTracker aliTracker(&(*tkGeom_), tTopo); + AlignableTracker aliTracker(&(*tkGeom_), tTopo_.get()); TTree* tree = new TTree("TkOffVal", "TkOffVal"); @@ -239,12 +224,12 @@ void TrackerOfflineValidationSummary::endJob() { std::map* substructureName = new std::map; tree->Branch("SubstructureName", &substructureName, 32000, 00); // SplitLevel must be set to zero - this->fillTree(*tree, mPxbResiduals_, *treeMemPtr, *tkGeom_, *substructureName, tTopo); - this->fillTree(*tree, mPxeResiduals_, *treeMemPtr, *tkGeom_, *substructureName, tTopo); - this->fillTree(*tree, mTibResiduals_, *treeMemPtr, *tkGeom_, *substructureName, tTopo); - this->fillTree(*tree, mTidResiduals_, *treeMemPtr, *tkGeom_, *substructureName, tTopo); - this->fillTree(*tree, mTobResiduals_, *treeMemPtr, *tkGeom_, *substructureName, tTopo); - this->fillTree(*tree, mTecResiduals_, *treeMemPtr, *tkGeom_, *substructureName, tTopo); + this->fillTree(*tree, mPxbResiduals_, *treeMemPtr, *tkGeom_, *substructureName, tTopo_.get()); + this->fillTree(*tree, mPxeResiduals_, *treeMemPtr, *tkGeom_, *substructureName, tTopo_.get()); + this->fillTree(*tree, mTibResiduals_, *treeMemPtr, *tkGeom_, *substructureName, tTopo_.get()); + this->fillTree(*tree, mTidResiduals_, *treeMemPtr, *tkGeom_, *substructureName, tTopo_.get()); + this->fillTree(*tree, mTobResiduals_, *treeMemPtr, *tkGeom_, *substructureName, tTopo_.get()); + this->fillTree(*tree, mTecResiduals_, *treeMemPtr, *tkGeom_, *substructureName, tTopo_.get()); //dbe_->save("dqmOut.root"); diff --git a/Alignment/OfflineValidation/python/TkAlAllInOneTool/offlineValidationTemplates.py b/Alignment/OfflineValidation/python/TkAlAllInOneTool/offlineValidationTemplates.py index 2dbfeadbef788..3dd9a759a571a 100644 --- a/Alignment/OfflineValidation/python/TkAlAllInOneTool/offlineValidationTemplates.py +++ b/Alignment/OfflineValidation/python/TkAlAllInOneTool/offlineValidationTemplates.py @@ -33,13 +33,13 @@ ## Load and Configure OfflineValidation and Output File ## process.load("Alignment.OfflineValidation.TrackerOfflineValidation_.oO[offlineValidationMode]Oo._cff") -process.TrackerOfflineValidation.oO[offlineValidationMode]Oo..compressionSettings = compressionSettings, +process.TrackerOfflineValidation.oO[offlineValidationMode]Oo..compressionSettings = compressionSettings process.TrackerOfflineValidation.oO[offlineValidationMode]Oo..Tracks = 'FinalTrackRefitter' process.TrackerOfflineValidation.oO[offlineValidationMode]Oo..trajectoryInput = 'FinalTrackRefitter' process.TrackerOfflineValidation.oO[offlineValidationMode]Oo..moduleLevelHistsTransient = .oO[offlineModuleLevelHistsTransient]Oo. process.TrackerOfflineValidation.oO[offlineValidationMode]Oo..moduleLevelProfiles = .oO[offlineModuleLevelProfiles]Oo. process.TrackerOfflineValidation.oO[offlineValidationMode]Oo..stripYResiduals = .oO[stripYResiduals]Oo. -process.TrackerOfflineValidation.oO[offlineValidationMode]Oo..maxTracks = .oO[maxtracks]Oo./ .oO[parallelJobs]Oo. +process.TrackerOfflineValidation.oO[offlineValidationMode]Oo..maxTracks = int(.oO[maxtracks]Oo./.oO[parallelJobs]Oo.) process.TrackerOfflineValidation.oO[offlineValidationMode]Oo..chargeCut = .oO[chargeCut]Oo. """ diff --git a/Alignment/OfflineValidation/python/TkAlAllInOneTool/primaryVertexResolutionTemplates.py b/Alignment/OfflineValidation/python/TkAlAllInOneTool/primaryVertexResolutionTemplates.py index e2a0942f3299c..7b35628c5d95e 100644 --- a/Alignment/OfflineValidation/python/TkAlAllInOneTool/primaryVertexResolutionTemplates.py +++ b/Alignment/OfflineValidation/python/TkAlAllInOneTool/primaryVertexResolutionTemplates.py @@ -9,7 +9,7 @@ isMultipleRuns=False if(isinstance(runboundary, (list, tuple))): isMultipleRuns=True - print "Multiple Runs are selected" + print("Multiple Runs are selected") if(isMultipleRuns): process.source.firstRun = cms.untracked.uint32(int(runboundary[0])) diff --git a/Alignment/OfflineValidation/python/TkAlAllInOneTool/zMuMuValidationTemplates.py b/Alignment/OfflineValidation/python/TkAlAllInOneTool/zMuMuValidationTemplates.py index 97284eba43282..e1ea2121c27e4 100644 --- a/Alignment/OfflineValidation/python/TkAlAllInOneTool/zMuMuValidationTemplates.py +++ b/Alignment/OfflineValidation/python/TkAlAllInOneTool/zMuMuValidationTemplates.py @@ -1,8 +1,7 @@ ZMuMuValidationTemplate=""" - +compressionSettings = 207 ###### MuSclFit SETTINGS ############################################## - ### MuScleFit specific configuration process.looper = cms.Looper( diff --git a/Alignment/OfflineValidation/scripts/GeometryComparisonPlotter.cc b/Alignment/OfflineValidation/scripts/GeometryComparisonPlotter.cc index 9a2c86493da08..4110c34dfafaa 100644 --- a/Alignment/OfflineValidation/scripts/GeometryComparisonPlotter.cc +++ b/Alignment/OfflineValidation/scripts/GeometryComparisonPlotter.cc @@ -8,1543 +8,1649 @@ /* Thanks a million <3 */ /***********************************************************************************/ -// NOTE: look for "TO DO" as a keyword to now what should be upgraded in later versions.... - +// NOTE: look for "TO DO" as a keyword to now what should be upgraded in later versions.... // modes -#define TALKATIVE // get some comments while processing +#define TALKATIVE // get some comments while processing //#define DEBUG // get a lot of comments while processing + canvases -> resource-consuming! // MACROS -#define INSIDE_VECTOR(vector) \ - cout << #vector << "={"; for (unsigned int i = 0 ; i < vector.size()-1 ; i++) cout << vector[i] << ","; cout << vector.back() << "}"; -#define CHECK_MAP_CONTENT(m,type) \ - for (map::iterator it = m.begin() ; it != m.end() ; it++) \ - cout << __FILE__ << ":" << __LINE__ << ":Info: " << #m << "[" << it->first << "]=" << it->second << endl; +#define INSIDE_VECTOR(vector) \ + cout << #vector << "={"; \ + for (unsigned int i = 0; i < vector.size() - 1; i++) \ + cout << vector[i] << ","; \ + cout << vector.back() << "}"; +#define CHECK_MAP_CONTENT(m, type) \ + for (map::iterator it = m.begin(); it != m.end(); it++) \ + cout << __FILE__ << ":" << __LINE__ << ":Info: " << #m << "[" << it->first << "]=" << it->second << endl; // CONSTRUCTOR AND DESTRUCTOR -GeometryComparisonPlotter::GeometryComparisonPlotter (TString tree_file_name, - TString output_directory, - TString modulesToPlot, - TString alignmentName, - TString referenceName, - bool printOnlyGlobal, - bool makeProfilePlots - ) : - _output_directory(output_directory + TString(output_directory.EndsWith("/") ? "" : "/")), - _output_filename("comparison.root"), - _print_option("pdf"), - _module_plot_option(modulesToPlot), - _alignment_name(alignmentName), - _reference_name(referenceName), - _print_only_global(printOnlyGlobal), - _make_profile_plots(makeProfilePlots), - _print(true), // print the graphs in a file (e.g. pdf) - _legend(true), // print the graphs in a file (e.g. pdf) - _write(true), // write the graphs in a root file - _batchMode( +GeometryComparisonPlotter::GeometryComparisonPlotter(TString tree_file_name, + TString output_directory, + TString modulesToPlot, + TString alignmentName, + TString referenceName, + bool printOnlyGlobal, + bool makeProfilePlots) + : _output_directory(output_directory + TString(output_directory.EndsWith("/") ? "" : "/")), + _output_filename("comparison.root"), + _print_option("pdf"), + _module_plot_option(modulesToPlot), + _alignment_name(alignmentName), + _reference_name(referenceName), + _print_only_global(printOnlyGlobal), + _make_profile_plots(makeProfilePlots), + _print(true), // print the graphs in a file (e.g. pdf) + _legend(true), // print the graphs in a file (e.g. pdf) + _write(true), // write the graphs in a root file + _batchMode( #ifdef DEBUG - false // false = display canvases (very time- and resource-consuming) + false // false = display canvases (very time- and resource-consuming) #else - true // true = no canvases + true // true = no canvases #endif - ), - _1dModule(true), // cut on 1d modules - _2dModule(true), // cut on 2d modules - _levelCut (DEFAULT_LEVEL), // module level (see branch of same name) - _grid_x(0), // by default no display the grid in the canvases - _grid_y(0), // by default no display the grid in the canvases - _window_width(DEFAULT_WINDOW_WIDTH), - _window_height(DEFAULT_WINDOW_HEIGHT) -{ + ), + _1dModule(true), // cut on 1d modules + _2dModule(true), // cut on 2d modules + _levelCut(DEFAULT_LEVEL), // module level (see branch of same name) + _grid_x(0), // by default no display the grid in the canvases + _grid_y(0), // by default no display the grid in the canvases + _window_width(DEFAULT_WINDOW_WIDTH), + _window_height(DEFAULT_WINDOW_HEIGHT) { #ifdef TALKATIVE - cout << ">>> TALKATIVE MODE ACTIVATED <<<" << endl; + cout << ">>> TALKATIVE MODE ACTIVATED <<<" << endl; #endif #ifdef DEBUG - cout << ">>> DEBUG MODE ACTIVATED <<<" << endl; - cout << __FILE__ << ":"<< __LINE__ << ":Info: inside constructor of GeometryComparisonPlotter utility"<< endl; + cout << ">>> DEBUG MODE ACTIVATED <<<" << endl; + cout << __FILE__ << ":" << __LINE__ << ":Info: inside constructor of GeometryComparisonPlotter utility" << endl; #endif - //_sublevel_names = {"PXB", "PXF", "TIB", "TID", "TOB", "TEC"}; // C++11 - _sublevel_names[0] = TString("PXB"); - _sublevel_names[1] = TString("PXF"); - _sublevel_names[2] = TString("TIB"); - _sublevel_names[3] = TString("TID"); - _sublevel_names[4] = TString("TOB"); - _sublevel_names[5] = TString("TEC"); - // TO DO: handle other structures - - // read tree - tree_file = new TFile(tree_file_name, "UPDATE"); - data = (TTree*) tree_file->Get("alignTree"); - // int branches - data->SetBranchAddress("id" ,&branch_i["id"]); - data->SetBranchAddress("inModuleList" ,&branch_i["inModuleList"]); - data->SetBranchAddress("badModuleQuality" ,&branch_i["badModuleQuality"]); - data->SetBranchAddress("mid" ,&branch_i["mid"]); - data->SetBranchAddress("level" ,&branch_i["level"]); - data->SetBranchAddress("mlevel" ,&branch_i["mlevel"]); - data->SetBranchAddress("sublevel" ,&branch_i["sublevel"]); - data->SetBranchAddress("useDetId" ,&branch_i["useDetId"]); - data->SetBranchAddress("detDim" ,&branch_i["detDim"]); - // float branches - data->SetBranchAddress("x" ,&branch_f["x"]); - data->SetBranchAddress("y" ,&branch_f["y"]); - data->SetBranchAddress("z" ,&branch_f["z"]); - data->SetBranchAddress("alpha" ,&branch_f["alpha"]); - data->SetBranchAddress("beta" ,&branch_f["beta"]); - data->SetBranchAddress("gamma" ,&branch_f["gamma"]); - data->SetBranchAddress("phi" ,&branch_f["phi"]); - data->SetBranchAddress("eta" ,&branch_f["eta"]); - data->SetBranchAddress("r" ,&branch_f["r"]); - data->SetBranchAddress("dx" ,&branch_f["dx"]); - data->SetBranchAddress("dy" ,&branch_f["dy"]); - data->SetBranchAddress("dz" ,&branch_f["dz"]); - data->SetBranchAddress("dphi" ,&branch_f["dphi"]); - data->SetBranchAddress("dr" ,&branch_f["dr"]); - data->SetBranchAddress("dalpha" ,&branch_f["dalpha"]); - data->SetBranchAddress("dbeta" ,&branch_f["dbeta"]); - data->SetBranchAddress("dgamma" ,&branch_f["dgamma"]); - if (data->GetBranch("rdphi") == 0x0) // in the case of rdphi branch not existing, it is created from r and dphi branches - { + //_sublevel_names = {"PXB", "PXF", "TIB", "TID", "TOB", "TEC"}; // C++11 + _sublevel_names[0] = TString("PXB"); + _sublevel_names[1] = TString("PXF"); + _sublevel_names[2] = TString("TIB"); + _sublevel_names[3] = TString("TID"); + _sublevel_names[4] = TString("TOB"); + _sublevel_names[5] = TString("TEC"); + // TO DO: handle other structures + + // read tree + tree_file = new TFile(tree_file_name, "UPDATE"); + data = (TTree *)tree_file->Get("alignTree"); + // int branches + data->SetBranchAddress("id", &branch_i["id"]); + data->SetBranchAddress("inModuleList", &branch_i["inModuleList"]); + data->SetBranchAddress("badModuleQuality", &branch_i["badModuleQuality"]); + data->SetBranchAddress("mid", &branch_i["mid"]); + data->SetBranchAddress("level", &branch_i["level"]); + data->SetBranchAddress("mlevel", &branch_i["mlevel"]); + data->SetBranchAddress("sublevel", &branch_i["sublevel"]); + data->SetBranchAddress("useDetId", &branch_i["useDetId"]); + data->SetBranchAddress("detDim", &branch_i["detDim"]); + // float branches + data->SetBranchAddress("x", &branch_f["x"]); + data->SetBranchAddress("y", &branch_f["y"]); + data->SetBranchAddress("z", &branch_f["z"]); + data->SetBranchAddress("alpha", &branch_f["alpha"]); + data->SetBranchAddress("beta", &branch_f["beta"]); + data->SetBranchAddress("gamma", &branch_f["gamma"]); + data->SetBranchAddress("phi", &branch_f["phi"]); + data->SetBranchAddress("eta", &branch_f["eta"]); + data->SetBranchAddress("r", &branch_f["r"]); + data->SetBranchAddress("dx", &branch_f["dx"]); + data->SetBranchAddress("dy", &branch_f["dy"]); + data->SetBranchAddress("dz", &branch_f["dz"]); + data->SetBranchAddress("dphi", &branch_f["dphi"]); + data->SetBranchAddress("dr", &branch_f["dr"]); + data->SetBranchAddress("dalpha", &branch_f["dalpha"]); + data->SetBranchAddress("dbeta", &branch_f["dbeta"]); + data->SetBranchAddress("dgamma", &branch_f["dgamma"]); + if (data->GetBranch("rdphi") == + 0x0) // in the case of rdphi branch not existing, it is created from r and dphi branches + { #ifdef TALKATIVE - cout << __FILE__ << ":" << __LINE__ << ":Info: computing the rdphi branch from r and dphi branches (assuming they exist...)" << endl; + cout << __FILE__ << ":" << __LINE__ + << ":Info: computing the rdphi branch from r and dphi branches (assuming they exist...)" << endl; #endif - TBranch * br_rdphi = data->Branch("rdphi", &branch_f["rdphi"], "rdphi/F"); - for (unsigned int ientry = 0 ; ientry < data->GetEntries() ; ientry++) - { - data->GetEntry(ientry); - branch_f["rdphi"] = branch_f["r"]*branch_f["dphi"]; - br_rdphi->Fill(); - } + TBranch *br_rdphi = data->Branch("rdphi", &branch_f["rdphi"], "rdphi/F"); + for (unsigned int ientry = 0; ientry < data->GetEntries(); ientry++) { + data->GetEntry(ientry); + branch_f["rdphi"] = branch_f["r"] * branch_f["dphi"]; + br_rdphi->Fill(); } - else - data->SetBranchAddress("rdphi",&branch_f["rdphi"]); + } else + data->SetBranchAddress("rdphi", &branch_f["rdphi"]); #ifdef DEBUG - cout << __FILE__ << ":" << __LINE__ << ":Info: branch addresses set" << endl; + cout << __FILE__ << ":" << __LINE__ << ":Info: branch addresses set" << endl; #endif - // style - gROOT->Reset(); - - data->SetMarkerSize(0.5); - data->SetMarkerStyle(6); - - gStyle->SetOptStat("emr"); - gStyle->SetTitleAlign(22); - gStyle->SetTitleX(0.5); - gStyle->SetTitleY(0.97); - gStyle->SetTitleFont(62); - //gStyle->SetOptTitle(0); - - gStyle->SetTextFont(132); - gStyle->SetTextSize(0.08); - gStyle->SetLabelFont(132,"x"); - gStyle->SetLabelFont(132,"y"); - gStyle->SetLabelFont(132,"z"); - gStyle->SetTitleSize(0.08,"x"); - gStyle->SetTitleSize(0.08,"y"); - gStyle->SetTitleSize(0.08,"z"); - gStyle->SetLabelSize(0.08,"x"); - gStyle->SetLabelSize(0.08,"y"); - gStyle->SetLabelSize(0.08,"z"); - - gStyle->SetMarkerStyle(8); - gStyle->SetHistLineWidth(2); - gStyle->SetLineStyleString(2,"[12 12]"); // postscript dashes - - gStyle->SetFrameBorderMode(0); - gStyle->SetCanvasBorderMode(0); - gStyle->SetPadBorderMode(0); - gStyle->SetPadColor(0); - gStyle->SetCanvasColor(0); - gStyle->SetTitleColor(1); - gStyle->SetStatColor(0); - gStyle->SetStatBorderSize(1); - gStyle->SetFrameFillColor(0); - - gStyle->SetPadTickX(1); - gStyle->SetPadTickY(1); - - gStyle->SetPadTopMargin(0.1); - gStyle->SetPadRightMargin(0.05); - gStyle->SetPadBottomMargin(0.16); - gStyle->SetPadLeftMargin(0.18); + // style + gROOT->Reset(); + + data->SetMarkerSize(0.5); + data->SetMarkerStyle(6); + + gStyle->SetOptStat("emr"); + gStyle->SetTitleAlign(22); + gStyle->SetTitleX(0.5); + gStyle->SetTitleY(0.97); + gStyle->SetTitleFont(62); + //gStyle->SetOptTitle(0); + + gStyle->SetTextFont(132); + gStyle->SetTextSize(0.08); + gStyle->SetLabelFont(132, "x"); + gStyle->SetLabelFont(132, "y"); + gStyle->SetLabelFont(132, "z"); + gStyle->SetTitleSize(0.08, "x"); + gStyle->SetTitleSize(0.08, "y"); + gStyle->SetTitleSize(0.08, "z"); + gStyle->SetLabelSize(0.08, "x"); + gStyle->SetLabelSize(0.08, "y"); + gStyle->SetLabelSize(0.08, "z"); + + gStyle->SetMarkerStyle(8); + gStyle->SetHistLineWidth(2); + gStyle->SetLineStyleString(2, "[12 12]"); // postscript dashes + + gStyle->SetFrameBorderMode(0); + gStyle->SetCanvasBorderMode(0); + gStyle->SetPadBorderMode(0); + gStyle->SetPadColor(0); + gStyle->SetCanvasColor(0); + gStyle->SetTitleColor(1); + gStyle->SetStatColor(0); + gStyle->SetStatBorderSize(1); + gStyle->SetFrameFillColor(0); + + gStyle->SetPadTickX(1); + gStyle->SetPadTickY(1); + + gStyle->SetPadTopMargin(0.1); + gStyle->SetPadRightMargin(0.05); + gStyle->SetPadBottomMargin(0.16); + gStyle->SetPadLeftMargin(0.18); #ifdef DEBUG - cout << __FILE__ << ":" << __LINE__ << ":Info: end of constructor" << endl; + cout << __FILE__ << ":" << __LINE__ << ":Info: end of constructor" << endl; #endif } -GeometryComparisonPlotter::~GeometryComparisonPlotter () -{ +GeometryComparisonPlotter::~GeometryComparisonPlotter() { #ifdef DEBUG - cout << __FILE__ << ":" << __LINE__ << ":Info: in destructor of the GeometryComparisonPlotter utility" << endl; + cout << __FILE__ << ":" << __LINE__ << ":Info: in destructor of the GeometryComparisonPlotter utility" << endl; #endif - tree_file->Close(); + tree_file->Close(); #ifdef DEBUG - cout << __FILE__ << ":" << __LINE__ << ":Info: ending." << endl; + cout << __FILE__ << ":" << __LINE__ << ":Info: ending." << endl; #endif } // MAIN METHOD -void GeometryComparisonPlotter::MakePlots (vector x, // axes to combine to plot - vector y, // every combination (except the ones such that x=y) will be perfomed - vector dyMin, // Minimum of y-variable to enable fixed ranges of the histogram - vector dyMax) // Minimum of y-variable +void GeometryComparisonPlotter::MakePlots( + vector x, // axes to combine to plot + vector y, // every combination (except the ones such that x=y) will be perfomed + vector dyMin, // Minimum of y-variable to enable fixed ranges of the histogram + vector dyMax) // Minimum of y-variable { - /// -1) check that only existing branches are called - // (we use a macro to avoid copy/paste) -#define CHECK_BRANCHES(branchname_vector) \ - for (unsigned int i = 0 ; i < branchname_vector.size() ; i++) \ - { \ - if (branch_f.find(branchname_vector[i]) == branch_f.end()) \ - { \ - cout << __FILE__ << ":" << __LINE__ << ":Error: The branch " << branchname_vector[i] << " is not recognised." << endl; \ - return; \ - } \ - } - CHECK_BRANCHES(x); - CHECK_BRANCHES(y); - - const unsigned int nentries = data->GetEntries(); + /// -1) check that only existing branches are called + // (we use a macro to avoid copy/paste) +#define CHECK_BRANCHES(branchname_vector) \ + for (unsigned int i = 0; i < branchname_vector.size(); i++) { \ + if (branch_f.find(branchname_vector[i]) == branch_f.end()) { \ + cout << __FILE__ << ":" << __LINE__ << ":Error: The branch " << branchname_vector[i] << " is not recognised." \ + << endl; \ + return; \ + } \ + } + CHECK_BRANCHES(x); + CHECK_BRANCHES(y); + + const unsigned int nentries = data->GetEntries(); #ifdef TALKATIVE - cout << __FILE__ << ":" << __LINE__ << ":Info: "; INSIDE_VECTOR(x); cout << endl - << __FILE__ << ":" << __LINE__ << ":Info: "; INSIDE_VECTOR(y); cout << endl; + cout << __FILE__ << ":" << __LINE__ << ":Info: "; + INSIDE_VECTOR(x); + cout << endl << __FILE__ << ":" << __LINE__ << ":Info: "; + INSIDE_VECTOR(y); + cout << endl; #endif - /// 0) min and max values - // the max and min of the graphs are computed from the tree if they have not been manually input yet - // (we use a macro to avoid copy/paste) -#define LIMITS(axes_vector) \ - for (unsigned int i = 0 ; i < axes_vector.size() ; i++) \ - { \ - if ( _SF.find(axes_vector[i]) == _SF.end()) _SF[axes_vector[i]] = 1.; \ - if (_min.find(axes_vector[i]) == _min.end()) _min[axes_vector[i]] = _SF[axes_vector[i]]*data->GetMinimum(axes_vector[i]); \ - if (_max.find(axes_vector[i]) == _max.end()) _max[axes_vector[i]] = _SF[axes_vector[i]]*data->GetMaximum(axes_vector[i]); \ - } - LIMITS(x); - LIMITS(y); + /// 0) min and max values + // the max and min of the graphs are computed from the tree if they have not been manually input yet + // (we use a macro to avoid copy/paste) +#define LIMITS(axes_vector) \ + for (unsigned int i = 0; i < axes_vector.size(); i++) { \ + if (_SF.find(axes_vector[i]) == _SF.end()) \ + _SF[axes_vector[i]] = 1.; \ + if (_min.find(axes_vector[i]) == _min.end()) \ + _min[axes_vector[i]] = _SF[axes_vector[i]] * data->GetMinimum(axes_vector[i]); \ + if (_max.find(axes_vector[i]) == _max.end()) \ + _max[axes_vector[i]] = _SF[axes_vector[i]] * data->GetMaximum(axes_vector[i]); \ + } + LIMITS(x); + LIMITS(y); -#ifdef TALKATIVE - CHECK_MAP_CONTENT(_min,float); - CHECK_MAP_CONTENT(_max,float); - CHECK_MAP_CONTENT(_SF ,float); +#ifdef TALKATIVE + CHECK_MAP_CONTENT(_min, float); + CHECK_MAP_CONTENT(_max, float); + CHECK_MAP_CONTENT(_SF, float); #endif - /// 1) declare TGraphs and Histograms for profile plots if these are to be plotted - // the idea is to produce at the end a table of 8 TMultiGraphs and histograms: - // - 0=Tracker, with color code for the different sublevels - // - 1..6=different sublevels, with color code for z < or > 0 - // - 7=only pixel with color code for BPIX and FPIX - - // (convention: the six first (resp. last) correspond to z>0 (resp. z<0)) - // Modules with bad quality and in a list of modules that is given - // by the user (e.g. list of bad/untouched modules, default: empty list) - // are stored in seperate graphs and might be plotted (depends on the module - // plot option, default: all modules plotted) - // This means that 3*2*6 TGraphs will be filled during the loop on the TTree, - // and will be arranged differently with different color codes in the TMultiGraphs - - // For the profile plots - // Either all modules, only good modules or good modules + those in a given list will be plotted - // This means that 2*6 TH2F will be filled during the loop on the TTree, - // and will be arranged differently with different color codes in the Histograms + /// 1) declare TGraphs and Histograms for profile plots if these are to be plotted + // the idea is to produce at the end a table of 8 TMultiGraphs and histograms: + // - 0=Tracker, with color code for the different sublevels + // - 1..6=different sublevels, with color code for z < or > 0 + // - 7=only pixel with color code for BPIX and FPIX + + // (convention: the six first (resp. last) correspond to z>0 (resp. z<0)) + // Modules with bad quality and in a list of modules that is given + // by the user (e.g. list of bad/untouched modules, default: empty list) + // are stored in seperate graphs and might be plotted (depends on the module + // plot option, default: all modules plotted) + // This means that 3*2*6 TGraphs will be filled during the loop on the TTree, + // and will be arranged differently with different color codes in the TMultiGraphs + + // For the profile plots + // Either all modules, only good modules or good modules + those in a given list will be plotted + // This means that 2*6 TH2F will be filled during the loop on the TTree, + // and will be arranged differently with different color codes in the Histograms #ifndef NB_SUBLEVELS #define NB_SUBLEVELS 6 #endif #define NB_Z_SLICES 2 #define NB_MODULE_QUALITY 3 -#define COLOR_CODE(icolor) int(icolor/4)+icolor+1 - - TGraph * graphs[x.size()][y.size()][NB_SUBLEVELS*NB_Z_SLICES*NB_MODULE_QUALITY]; - long int ipoint[x.size()][y.size()][NB_SUBLEVELS*NB_Z_SLICES*NB_MODULE_QUALITY]; - - TMultiGraph * mgraphs[x.size()][y.size()][2+NB_SUBLEVELS]; // the 0th is for global plots, the 1..6th for sublevel plots, 7th for pixel only - TCanvas * c[x.size()][y.size()][2+NB_SUBLEVELS], - * c_global[2+NB_SUBLEVELS]; - canvas_index++; // this static index is a safety used in case the MakePlots method is used several times to avoid overloading - - // histograms for profile plots, - // 2D-hists to store the data - // 1D-hists to calculate mean and sigma of y-values for each x-bin of the 2D-hists and for the final profile hist - TH2F * histos2D[x.size()][y.size()][NB_SUBLEVELS*NB_Z_SLICES]; - TH1F * histos[x.size()][y.size()][NB_SUBLEVELS*NB_Z_SLICES]; - TH1F * histosYValues[x.size()][y.size()][NB_SUBLEVELS*NB_Z_SLICES]; // Used to calculate the mean and RMS for each x-bin of the 2D-hist - TH1F * histosTracker[x.size()][y.size()][NB_SUBLEVELS*NB_Z_SLICES]; // for the tracker plots all histos are copied to avoid using the same hists in different canvas - - TCanvas * c_hist[x.size()][y.size()][2+NB_SUBLEVELS], * c_global_hist[2+NB_SUBLEVELS]; - - unsigned int nXBins; // Sensible number of x-bins differs depending on the variable - - - - - for (unsigned int ic = 0 ; ic <= NB_SUBLEVELS+1 ; ic++) - { - c_global[ic] = new TCanvas (TString::Format("global_%s_%d", ic==0 ? "tracker" : ( ic==7 ? "pixel" : _sublevel_names[ic-1].Data() ), - canvas_index), - TString::Format("Global overview of the %s variables", ic==0 ? "tracker" : ( ic==7 ? "pixel" : _sublevel_names[ic-1].Data() ) ), - _window_width, - _window_height); - c_global[ic]->Divide(x.size(),y.size()); - - if (_make_profile_plots) { - c_global_hist[ic] = new TCanvas (TString::Format("global_profile_plots_%s_%d", ic==0 ? "tracker" : ( ic==7 ? "pixel" : _sublevel_names[ic-1].Data() ), - canvas_index), - TString::Format("Global overview profile plots of the %s variables", ic==0 ? "tracker" : ( ic==7 ? "pixel" : _sublevel_names[ic-1].Data() ) ), - _window_width, - _window_height); - c_global_hist[ic]->Divide(x.size(),y.size()); - } - - } +#define COLOR_CODE(icolor) int(icolor / 4) + icolor + 1 + + TGraph *graphs[x.size()][y.size()][NB_SUBLEVELS * NB_Z_SLICES * NB_MODULE_QUALITY]; + long int ipoint[x.size()][y.size()][NB_SUBLEVELS * NB_Z_SLICES * NB_MODULE_QUALITY]; + + TMultiGraph + *mgraphs[x.size()][y.size()] + [2 + NB_SUBLEVELS]; // the 0th is for global plots, the 1..6th for sublevel plots, 7th for pixel only + TCanvas *c[x.size()][y.size()][2 + NB_SUBLEVELS], *c_global[2 + NB_SUBLEVELS]; + canvas_index++; // this static index is a safety used in case the MakePlots method is used several times to avoid overloading + + // histograms for profile plots, + // 2D-hists to store the data + // 1D-hists to calculate mean and sigma of y-values for each x-bin of the 2D-hists and for the final profile hist + TH2F *histos2D[x.size()][y.size()][NB_SUBLEVELS * NB_Z_SLICES]; + TH1F *histos[x.size()][y.size()][NB_SUBLEVELS * NB_Z_SLICES]; + TH1F *histosYValues[x.size()][y.size()] + [NB_SUBLEVELS * NB_Z_SLICES]; // Used to calculate the mean and RMS for each x-bin of the 2D-hist + TH1F *histosTracker + [x.size()][y.size()] + [NB_SUBLEVELS * + NB_Z_SLICES]; // for the tracker plots all histos are copied to avoid using the same hists in different canvas + + TCanvas *c_hist[x.size()][y.size()][2 + NB_SUBLEVELS], *c_global_hist[2 + NB_SUBLEVELS]; + + unsigned int nXBins; // Sensible number of x-bins differs depending on the variable + + for (unsigned int ic = 0; ic <= NB_SUBLEVELS + 1; ic++) { + c_global[ic] = new TCanvas( + TString::Format( + "global_%s_%d", ic == 0 ? "tracker" : (ic == 7 ? "pixel" : _sublevel_names[ic - 1].Data()), canvas_index), + TString::Format("Global overview of the %s variables", + ic == 0 ? "tracker" : (ic == 7 ? "pixel" : _sublevel_names[ic - 1].Data())), + _window_width, + _window_height); + c_global[ic]->Divide(x.size(), y.size()); - - for (unsigned int ix = 0 ; ix < x.size() ; ix++) - { - for (unsigned int iy = 0 ; iy < y.size() ; iy++) - { - //if (x[ix] == y[iy]) continue; // do not plot graphs like (r,r) or (phi,phi) - for (unsigned int igraph = 0 ; igraph < NB_SUBLEVELS*NB_Z_SLICES*NB_MODULE_QUALITY ; igraph++) - { - // declaring - ipoint[ix][iy][igraph] = 0; // the purpose of an index for every graph is to avoid thousands of points at the origin of each - graphs[ix][iy][igraph] = new TGraph (); - - graphs[ix][iy][igraph]->SetMarkerColor(COLOR_CODE(igraph)); - graphs[ix][iy][igraph]->SetMarkerStyle(6); - // pimping - graphs[ix][iy][igraph]->SetName (x[ix]+y[iy]+_sublevel_names[igraph%NB_SUBLEVELS] - +TString(igraph%(NB_SUBLEVELS*NB_Z_SLICES)>=NB_SUBLEVELS ? "n" : "p" ) // graphs for negative/positive z - +TString(igraph >= NB_SUBLEVELS*NB_Z_SLICES ? - ( igraph >= 2*NB_SUBLEVELS*NB_Z_SLICES ? "bad" : "list") : "good" ));// graphs for good, bad modules and from a list - graphs[ix][iy][igraph]->SetTitle( _sublevel_names[igraph%NB_SUBLEVELS] - +TString(igraph%(NB_SUBLEVELS*NB_Z_SLICES)>=NB_SUBLEVELS ? " at z<0": " at z>=0") - +TString(igraph >= NB_SUBLEVELS*NB_Z_SLICES ? - ( igraph >= 2*NB_SUBLEVELS*NB_Z_SLICES ? " bad modules" : " in list") : " good modules" ) - + TString (";") + LateXstyle(x[ix]) + " /" + _units[x[ix]] - + TString (";") + LateXstyle(y[iy]) + " /" + _units[y[iy]]); - graphs[ix][iy][igraph]->SetMarkerStyle(igraph >= NB_SUBLEVELS*NB_Z_SLICES ? - ( igraph >= 2*NB_SUBLEVELS*NB_Z_SLICES ? 4 : 5) : 6); // empty circle for bad modules, X for those in list, dot for good ones - } + if (_make_profile_plots) { + c_global_hist[ic] = + new TCanvas(TString::Format("global_profile_plots_%s_%d", + ic == 0 ? "tracker" : (ic == 7 ? "pixel" : _sublevel_names[ic - 1].Data()), + canvas_index), + TString::Format("Global overview profile plots of the %s variables", + ic == 0 ? "tracker" : (ic == 7 ? "pixel" : _sublevel_names[ic - 1].Data())), + _window_width, + _window_height); + c_global_hist[ic]->Divide(x.size(), y.size()); + } + } + + for (unsigned int ix = 0; ix < x.size(); ix++) { + for (unsigned int iy = 0; iy < y.size(); iy++) { + //if (x[ix] == y[iy]) continue; // do not plot graphs like (r,r) or (phi,phi) + for (unsigned int igraph = 0; igraph < NB_SUBLEVELS * NB_Z_SLICES * NB_MODULE_QUALITY; igraph++) { + // declaring + ipoint[ix][iy][igraph] = + 0; // the purpose of an index for every graph is to avoid thousands of points at the origin of each + graphs[ix][iy][igraph] = new TGraph(); + + graphs[ix][iy][igraph]->SetMarkerColor(COLOR_CODE(igraph)); + graphs[ix][iy][igraph]->SetMarkerStyle(6); + // pimping + graphs[ix][iy][igraph]->SetName( + x[ix] + y[iy] + _sublevel_names[igraph % NB_SUBLEVELS] + + TString(igraph % (NB_SUBLEVELS * NB_Z_SLICES) >= NB_SUBLEVELS ? "n" + : "p") // graphs for negative/positive z + + TString(igraph >= NB_SUBLEVELS * NB_Z_SLICES ? (igraph >= 2 * NB_SUBLEVELS * NB_Z_SLICES ? "bad" : "list") + : "good")); // graphs for good, bad modules and from a list + graphs[ix][iy][igraph]->SetTitle( + _sublevel_names[igraph % NB_SUBLEVELS] + + TString(igraph % (NB_SUBLEVELS * NB_Z_SLICES) >= NB_SUBLEVELS ? " at z<0" : " at z>=0") + + TString(igraph >= NB_SUBLEVELS * NB_Z_SLICES + ? (igraph >= 2 * NB_SUBLEVELS * NB_Z_SLICES ? " bad modules" : " in list") + : " good modules") + + TString(";") + LateXstyle(x[ix]) + " /" + _units[x[ix]] + TString(";") + LateXstyle(y[iy]) + " /" + + _units[y[iy]]); + graphs[ix][iy][igraph]->SetMarkerStyle( + igraph >= NB_SUBLEVELS * NB_Z_SLICES + ? (igraph >= 2 * NB_SUBLEVELS * NB_Z_SLICES ? 4 : 5) + : 6); // empty circle for bad modules, X for those in list, dot for good ones + } + } + } + + // Use seperate loop for the profile histograms since we do not produce histograms for the different module qualities + if (_make_profile_plots) { + for (unsigned int ix = 0; ix < x.size(); ix++) { + if (x[ix] == "phi") + nXBins = 10; + else + nXBins = 40; + + for (unsigned int iy = 0; iy < y.size(); iy++) { + for (unsigned int igraph = 0; igraph < NB_SUBLEVELS * NB_Z_SLICES; igraph++) { + // declaring + histos2D[ix][iy][igraph] = + new TH2F("2Dhist" + x[ix] + y[iy] + _sublevel_names[igraph % NB_SUBLEVELS] + + TString(igraph % (NB_SUBLEVELS * NB_Z_SLICES) >= NB_SUBLEVELS ? "n" : "p") + + TString(std::to_string(canvas_index)), + "", + nXBins, + _min[x[ix]], + _max[x[ix]], + 1000, + _min[y[iy]], + _max[y[iy]] + 1.); } + } } - - // Use seperate loop for the profile histograms since we do not produce histograms for the different module qualities - if (_make_profile_plots) { - for (unsigned int ix = 0 ; ix < x.size() ; ix++) - { - if ( x[ix] == "phi") nXBins = 10; - else nXBins = 40; - - for (unsigned int iy = 0 ; iy < y.size() ; iy++) - { - for (unsigned int igraph = 0 ; igraph < NB_SUBLEVELS*NB_Z_SLICES ; igraph++) - { - // declaring - histos2D[ix][iy][igraph] = new TH2F ("2Dhist"+x[ix]+y[iy]+_sublevel_names[igraph%NB_SUBLEVELS] - +TString(igraph%(NB_SUBLEVELS*NB_Z_SLICES)>=NB_SUBLEVELS ? "n" : "p" ) - +std::to_string(canvas_index), - "",nXBins,_min[x[ix]],_max[x[ix]], - 1000,_min[y[iy]],_max[y[iy]]+1.); - } - } - } - } - + } + #ifdef DEBUG - cout << __FILE__ << ":" << __LINE__ << ":Info: Creation of the TGraph[" << x.size() << "][" << y.size() << "][" << NB_SUBLEVELS*NB_Z_SLICES*NB_MODULE_QUALITY << "] ended." << endl; + cout << __FILE__ << ":" << __LINE__ << ":Info: Creation of the TGraph[" << x.size() << "][" << y.size() << "][" + << NB_SUBLEVELS * NB_Z_SLICES * NB_MODULE_QUALITY << "] ended." << endl; #endif - /// 2) loop on the TTree data + /// 2) loop on the TTree data #ifdef DEBUG - cout << __FILE__ << ":" << __LINE__ << ":Info: Looping on the TTree" << endl; + cout << __FILE__ << ":" << __LINE__ << ":Info: Looping on the TTree" << endl; #endif #ifdef TALKATIVE - unsigned int progress = 0; - cout << __FILE__ << ":" << __LINE__ << ":Info: 0%" << endl; + unsigned int progress = 0; + cout << __FILE__ << ":" << __LINE__ << ":Info: 0%" << endl; #endif - for (unsigned int ientry = 0 ; ientry < nentries ; ientry++) - { -#ifdef TALKATIVE - if (10*ientry/nentries != progress) - { - progress = 10*ientry/nentries; - cout << __FILE__ << ":" << __LINE__ << ":Info: " << 10*progress << "%" << endl; - } + for (unsigned int ientry = 0; ientry < nentries; ientry++) { +#ifdef TALKATIVE + if (10 * ientry / nentries != progress) { + progress = 10 * ientry / nentries; + cout << __FILE__ << ":" << __LINE__ << ":Info: " << 10 * progress << "%" << endl; + } #endif - // load current tree entry - data->GetEntry(ientry); - - // CUTS on entry - if (branch_i["level"] != _levelCut) continue; - if (!_1dModule && branch_i["detDim"] == 1) continue; - if (!_2dModule && branch_i["detDim"] == 2) continue; - - // loop on the different couples of variables to plot in a graph - for (unsigned int ix = 0 ; ix < x.size() ; ix++) - { - // CUTS on x[ix] - if (_SF[x[ix]]*branch_f[x[ix]] > _max[x[ix]] || _SF[x[ix]]*branch_f[x[ix]] < _min[x[ix]]) - { -//#ifdef DEBUG -// cout << "branch_f[x[ix]]=" << branch_f[x[ix]] << endl; -//#endif - continue; - } + // load current tree entry + data->GetEntry(ientry); + + // CUTS on entry + if (branch_i["level"] != _levelCut) + continue; + if (!_1dModule && branch_i["detDim"] == 1) + continue; + if (!_2dModule && branch_i["detDim"] == 2) + continue; + + // loop on the different couples of variables to plot in a graph + for (unsigned int ix = 0; ix < x.size(); ix++) { + // CUTS on x[ix] + if (_SF[x[ix]] * branch_f[x[ix]] > _max[x[ix]] || _SF[x[ix]] * branch_f[x[ix]] < _min[x[ix]]) { + //#ifdef DEBUG + // cout << "branch_f[x[ix]]=" << branch_f[x[ix]] << endl; + //#endif + continue; + } + + for (unsigned int iy = 0; iy < y.size(); iy++) { + // CUTS on y[iy] + //if (x[ix] == y[iy]) continue; // TO DO: handle display when such a case occurs + if (branch_i["sublevel"] < 1 || branch_i["sublevel"] > NB_SUBLEVELS) + continue; + + // FILLING histograms take even those outside the plotted range into account + if (_make_profile_plots) { + if (_module_plot_option == "all") { + const short int igraph = (branch_i["sublevel"] - 1) + (branch_f["z"] >= 0 ? 0 : NB_SUBLEVELS); + histos2D[ix][iy][igraph]->Fill(_SF[x[ix]] * branch_f[x[ix]], _SF[y[iy]] * branch_f[y[iy]]); + } else if (_module_plot_option == "good" && branch_i["badModuleQuality"] == 0) { + const short int igraph = (branch_i["sublevel"] - 1) + (branch_f["z"] >= 0 ? 0 : NB_SUBLEVELS); + histos2D[ix][iy][igraph]->Fill(_SF[x[ix]] * branch_f[x[ix]], _SF[y[iy]] * branch_f[y[iy]]); + } else if (_module_plot_option == "list" && + (branch_i["inModuleList"] == 1 || branch_i["badModuleQuality"] == 0)) { + const short int igraph = (branch_i["sublevel"] - 1) + (branch_f["z"] >= 0 ? 0 : NB_SUBLEVELS); + histos2D[ix][iy][igraph]->Fill(_SF[x[ix]] * branch_f[x[ix]], _SF[y[iy]] * branch_f[y[iy]]); + } + } - for (unsigned int iy = 0 ; iy < y.size() ; iy++) - { - // CUTS on y[iy] - //if (x[ix] == y[iy]) continue; // TO DO: handle display when such a case occurs - if (branch_i["sublevel"] < 1 || branch_i["sublevel"] > NB_SUBLEVELS) continue; - - // FILLING histograms take even those outside the plotted range into account - if (_make_profile_plots) { - if (_module_plot_option == "all"){ - const short int igraph = (branch_i["sublevel"]-1) - + (branch_f["z"]>=0?0:NB_SUBLEVELS); - histos2D[ix][iy][igraph]->Fill(_SF[x[ix]]*branch_f[x[ix]], - _SF[y[iy]]*branch_f[y[iy]]); - } - else if (_module_plot_option == "good" && branch_i["badModuleQuality"]==0 ){ - const short int igraph = (branch_i["sublevel"]-1) - + (branch_f["z"]>=0?0:NB_SUBLEVELS); - histos2D[ix][iy][igraph]->Fill(_SF[x[ix]]*branch_f[x[ix]], - _SF[y[iy]]*branch_f[y[iy]]); - } - else if (_module_plot_option == "list" && (branch_i["inModuleList"]==1 || branch_i["badModuleQuality"]==0) ){ - const short int igraph = (branch_i["sublevel"]-1) - + (branch_f["z"]>=0?0:NB_SUBLEVELS); - histos2D[ix][iy][igraph]->Fill(_SF[x[ix]]*branch_f[x[ix]], - _SF[y[iy]]*branch_f[y[iy]]); - } - } - - // restrict scatter plots to chosen range - if (_SF[y[iy]]*branch_f[y[iy]] > _max[y[iy]] || _SF[y[iy]]*branch_f[y[iy]] < _min[y[iy]]) - { -//#ifdef DEBUG -// cout << "branch_f[y[iy]]=" << branch_f[y[iy]] << endl; -//#endif - continue; - } - - // FILLING GRAPH - if (y.size() >= x.size()){ - if (branch_i["inModuleList"]==0 && branch_i["badModuleQuality"]==0 ){ - const short int igraph = (branch_i["sublevel"]-1) - + (branch_f["z"]>=0?0:NB_SUBLEVELS); - graphs[ix][iy][igraph]->SetPoint(ipoint[ix][iy][igraph], - _SF[x[ix]]*branch_f[x[ix]], - _SF[y[iy]]*branch_f[y[iy]]); - ipoint[ix][iy][igraph]++; - } - if (branch_i["inModuleList"]>0){ - const short int igraph = (branch_i["sublevel"]-1) - + (branch_f["z"]>=0?0:NB_SUBLEVELS) - + NB_SUBLEVELS*NB_Z_SLICES; - graphs[ix][iy][igraph]->SetPoint(ipoint[ix][iy][igraph], - _SF[x[ix]]*branch_f[x[ix]], - _SF[y[iy]]*branch_f[y[iy]]); - ipoint[ix][iy][igraph]++; - } - if (branch_i["badModuleQuality"]>0){ - const short int igraph = (branch_i["sublevel"]-1) - + (branch_f["z"]>=0?0:NB_SUBLEVELS) - + 2*NB_SUBLEVELS*NB_Z_SLICES; - graphs[ix][iy][igraph]->SetPoint(ipoint[ix][iy][igraph], - _SF[x[ix]]*branch_f[x[ix]], - _SF[y[iy]]*branch_f[y[iy]]); - ipoint[ix][iy][igraph]++; - } - } - else{ - if (branch_i["inModuleList"]==0 && branch_i["badModuleQuality"]==0 ){ - const short int igraph = (branch_i["sublevel"]-1) - + (branch_f["z"]>=0?0:NB_SUBLEVELS); - graphs[iy][ix][igraph]->SetPoint(ipoint[iy][ix][igraph], - _SF[x[ix]]*branch_f[x[ix]], - _SF[y[iy]]*branch_f[y[iy]]); - ipoint[iy][ix][igraph]++; - } - if (branch_i["inModuleList"]>0){ - const short int igraph = (branch_i["sublevel"]-1) - + (branch_f["z"]>=0?0:NB_SUBLEVELS) - + NB_SUBLEVELS*NB_Z_SLICES; - graphs[iy][ix][igraph]->SetPoint(ipoint[iy][ix][igraph], - _SF[x[ix]]*branch_f[x[ix]], - _SF[y[iy]]*branch_f[y[iy]]); - ipoint[iy][ix][igraph]++; - } - if (branch_i["badModuleQuality"]>0){ - const short int igraph = (branch_i["sublevel"]-1) - + (branch_f["z"]>=0?0:NB_SUBLEVELS) - + 2*NB_SUBLEVELS*NB_Z_SLICES; - graphs[iy][ix][igraph]->SetPoint(ipoint[ix][iy][igraph], - _SF[x[ix]]*branch_f[x[ix]], - _SF[y[iy]]*branch_f[y[iy]]); - ipoint[iy][ix][igraph]++; - } - } - } + // restrict scatter plots to chosen range + if (_SF[y[iy]] * branch_f[y[iy]] > _max[y[iy]] || _SF[y[iy]] * branch_f[y[iy]] < _min[y[iy]]) { + //#ifdef DEBUG + // cout << "branch_f[y[iy]]=" << branch_f[y[iy]] << endl; + //#endif + continue; } + + // FILLING GRAPH + if (y.size() >= x.size()) { + if (branch_i["inModuleList"] == 0 && branch_i["badModuleQuality"] == 0) { + const short int igraph = (branch_i["sublevel"] - 1) + (branch_f["z"] >= 0 ? 0 : NB_SUBLEVELS); + graphs[ix][iy][igraph]->SetPoint( + ipoint[ix][iy][igraph], _SF[x[ix]] * branch_f[x[ix]], _SF[y[iy]] * branch_f[y[iy]]); + ipoint[ix][iy][igraph]++; + } + if (branch_i["inModuleList"] > 0) { + const short int igraph = + (branch_i["sublevel"] - 1) + (branch_f["z"] >= 0 ? 0 : NB_SUBLEVELS) + NB_SUBLEVELS * NB_Z_SLICES; + graphs[ix][iy][igraph]->SetPoint( + ipoint[ix][iy][igraph], _SF[x[ix]] * branch_f[x[ix]], _SF[y[iy]] * branch_f[y[iy]]); + ipoint[ix][iy][igraph]++; + } + if (branch_i["badModuleQuality"] > 0) { + const short int igraph = + (branch_i["sublevel"] - 1) + (branch_f["z"] >= 0 ? 0 : NB_SUBLEVELS) + 2 * NB_SUBLEVELS * NB_Z_SLICES; + graphs[ix][iy][igraph]->SetPoint( + ipoint[ix][iy][igraph], _SF[x[ix]] * branch_f[x[ix]], _SF[y[iy]] * branch_f[y[iy]]); + ipoint[ix][iy][igraph]++; + } + } else { + if (branch_i["inModuleList"] == 0 && branch_i["badModuleQuality"] == 0) { + const short int igraph = (branch_i["sublevel"] - 1) + (branch_f["z"] >= 0 ? 0 : NB_SUBLEVELS); + graphs[iy][ix][igraph]->SetPoint( + ipoint[iy][ix][igraph], _SF[x[ix]] * branch_f[x[ix]], _SF[y[iy]] * branch_f[y[iy]]); + ipoint[iy][ix][igraph]++; + } + if (branch_i["inModuleList"] > 0) { + const short int igraph = + (branch_i["sublevel"] - 1) + (branch_f["z"] >= 0 ? 0 : NB_SUBLEVELS) + NB_SUBLEVELS * NB_Z_SLICES; + graphs[iy][ix][igraph]->SetPoint( + ipoint[iy][ix][igraph], _SF[x[ix]] * branch_f[x[ix]], _SF[y[iy]] * branch_f[y[iy]]); + ipoint[iy][ix][igraph]++; + } + if (branch_i["badModuleQuality"] > 0) { + const short int igraph = + (branch_i["sublevel"] - 1) + (branch_f["z"] >= 0 ? 0 : NB_SUBLEVELS) + 2 * NB_SUBLEVELS * NB_Z_SLICES; + graphs[iy][ix][igraph]->SetPoint( + ipoint[ix][iy][igraph], _SF[x[ix]] * branch_f[x[ix]], _SF[y[iy]] * branch_f[y[iy]]); + ipoint[iy][ix][igraph]++; + } + } + } } + } #ifdef TALKATIVE - cout << __FILE__ << ":" << __LINE__ << ":Info: 100%\tLoop ended" << endl; + cout << __FILE__ << ":" << __LINE__ << ":Info: 100%\tLoop ended" << endl; #endif - /// 3) merge TGraph objects into TMultiGraph objects, then draw, print and write (according to the options _batchMode, _print and _write respectively) - gROOT->SetBatch(_batchMode); // if true, then equivalent to "root -b", i.e. no canvas - if (_write) - { // opening the file to write the graphs - output = new TFile(_output_directory+TString(_output_filename), "UPDATE"); // possibly existing file will be updated, otherwise created - if (output->IsZombie()) - { - cout << __FILE__ << ":" << __LINE__ << ":Error: Opening of " << _output_directory+TString(_output_filename) << " failed" << endl; - exit(-1); - } + /// 3) merge TGraph objects into TMultiGraph objects, then draw, print and write (according to the options _batchMode, _print and _write respectively) + gROOT->SetBatch(_batchMode); // if true, then equivalent to "root -b", i.e. no canvas + if (_write) { // opening the file to write the graphs + output = new TFile(_output_directory + TString(_output_filename), + "UPDATE"); // possibly existing file will be updated, otherwise created + if (output->IsZombie()) { + cout << __FILE__ << ":" << __LINE__ << ":Error: Opening of " << _output_directory + TString(_output_filename) + << " failed" << endl; + exit(-1); + } #ifdef TALKATIVE - cout << __FILE__ << ":"<< __LINE__ << ":Info: output file is " << _output_directory+TString(_output_filename) << endl; + cout << __FILE__ << ":" << __LINE__ << ":Info: output file is " << _output_directory + TString(_output_filename) + << endl; #endif - } - // declaring TMultiGraphs and TCanvas - // Usually more y variables than x variables - // creating TLegend - TLegend * legend = MakeLegend(.1,.92,.9,1.,NB_SUBLEVELS); - if (_write) legend->Write(); - - // check which modules are supposed to be plotted - unsigned int n_module_types = 1; - if (_module_plot_option == "all"){ - n_module_types = 3; //plot all modules (good, list and bad ) - } - else if (_module_plot_option == "list"){ - n_module_types = 2; // plot good modules and those in the list - } - else if (_module_plot_option == "good"){ - n_module_types = 1; // only plot the modules that are neither bad or in the list - } - - -#define INDEX_IN_GLOBAL_CANVAS(i1,i2) 1 + i1 + i2*x.size() - // running on the TGraphs to produce the TMultiGraph and draw/print them - for (unsigned int ix = 0 ; ix < x.size() ; ix++) - { + } + // declaring TMultiGraphs and TCanvas + // Usually more y variables than x variables + // creating TLegend + TLegend *legend = MakeLegend(.1, .92, .9, 1., NB_SUBLEVELS); + if (_write) + legend->Write(); + + // check which modules are supposed to be plotted + unsigned int n_module_types = 1; + if (_module_plot_option == "all") { + n_module_types = 3; //plot all modules (good, list and bad ) + } else if (_module_plot_option == "list") { + n_module_types = 2; // plot good modules and those in the list + } else if (_module_plot_option == "good") { + n_module_types = 1; // only plot the modules that are neither bad or in the list + } + +#define INDEX_IN_GLOBAL_CANVAS(i1, i2) 1 + i1 + i2 *x.size() + // running on the TGraphs to produce the TMultiGraph and draw/print them + for (unsigned int ix = 0; ix < x.size(); ix++) { #ifdef DEBUG - cout << __FILE__ << ":" << __LINE__ << ":Info: x[" << ix << "]="<< x[ix] << endl; + cout << __FILE__ << ":" << __LINE__ << ":Info: x[" << ix << "]=" << x[ix] << endl; #endif - // looping on Y axes - for (unsigned int iy = 0 ; iy < y.size() ; iy++) - { - - + // looping on Y axes + for (unsigned int iy = 0; iy < y.size(); iy++) { #ifdef DEBUG - cout << __FILE__ << ":" << __LINE__ << ":Info: x[" << ix << "]=" << x[ix] - << " and y[" << iy << "]=" << y[iy] - << "\t-> creating TMultiGraph" << endl; + cout << __FILE__ << ":" << __LINE__ << ":Info: x[" << ix << "]=" << x[ix] << " and y[" << iy << "]=" << y[iy] + << "\t-> creating TMultiGraph" << endl; #endif - mgraphs[ix][iy][0] = new TMultiGraph (TString::Format("mgr_%s_vs_%s_tracker_%d", x[ix].Data(), - y[iy].Data(), - canvas_index), // name - //LateXstyle(x[ix]) + TString(" vs. ") + LateXstyle(y[iy]) + TString(" for Tracker") // graph title - TString (";") + LateXstyle(x[ix]) + " /" + _units[x[ix]] // x axis title - + TString (";") + LateXstyle(y[iy]) + " /" + _units[y[iy]]); // y axis title - - mgraphs[ix][iy][7] = new TMultiGraph (TString::Format("mgr_%s_vs_%s_pixel_%d", x[ix].Data(), - y[iy].Data(), - canvas_index), // name - //LateXstyle(x[ix]) + TString(" vs. ") + LateXstyle(y[iy]) + TString(" for Tracker") // graph title - TString (";") + LateXstyle(x[ix]) + " /" + _units[x[ix]] // x axis title - + TString (";") + LateXstyle(y[iy]) + " /" + _units[y[iy]]); // y axis title - - /// TRACKER and PIXEL - // fixing ranges and filling TMultiGraph - // for (unsigned short int jgraph = NB_SUBLEVELS*NB_Z_SLICES-1 ; jgraph >= 0 ; --jgraph) - for (unsigned short int jgraph = 0 ; jgraph < NB_SUBLEVELS*NB_Z_SLICES*n_module_types ; jgraph++) - { - unsigned short int igraph = NB_SUBLEVELS*NB_Z_SLICES*n_module_types - jgraph - 1; // reverse counting for humane readability (one of the sublevel takes much more place than the others) + mgraphs[ix][iy][0] = new TMultiGraph( + TString::Format("mgr_%s_vs_%s_tracker_%d", + x[ix].Data(), + y[iy].Data(), + canvas_index), // name + //LateXstyle(x[ix]) + TString(" vs. ") + LateXstyle(y[iy]) + TString(" for Tracker") // graph title + TString(";") + LateXstyle(x[ix]) + " /" + _units[x[ix]] // x axis title + + TString(";") + LateXstyle(y[iy]) + " /" + _units[y[iy]]); // y axis title + + mgraphs[ix][iy][7] = new TMultiGraph( + TString::Format("mgr_%s_vs_%s_pixel_%d", + x[ix].Data(), + y[iy].Data(), + canvas_index), // name + //LateXstyle(x[ix]) + TString(" vs. ") + LateXstyle(y[iy]) + TString(" for Tracker") // graph title + TString(";") + LateXstyle(x[ix]) + " /" + _units[x[ix]] // x axis title + + TString(";") + LateXstyle(y[iy]) + " /" + _units[y[iy]]); // y axis title + + /// TRACKER and PIXEL + // fixing ranges and filling TMultiGraph + // for (unsigned short int jgraph = NB_SUBLEVELS*NB_Z_SLICES-1 ; jgraph >= 0 ; --jgraph) + for (unsigned short int jgraph = 0; jgraph < NB_SUBLEVELS * NB_Z_SLICES * n_module_types; jgraph++) { + unsigned short int igraph = + NB_SUBLEVELS * NB_Z_SLICES * n_module_types - jgraph - + 1; // reverse counting for humane readability (one of the sublevel takes much more place than the others) #ifdef DEBUG - cout << __FILE__ << ":" << __LINE__ << ":Info: writing TGraph to file" << endl; + cout << __FILE__ << ":" << __LINE__ << ":Info: writing TGraph to file" << endl; #endif - // write into root file - if (_write) graphs[ix][iy][igraph]->Write(); - if (graphs[ix][iy][igraph]->GetN() == 0) - { + // write into root file + if (_write) + graphs[ix][iy][igraph]->Write(); + if (graphs[ix][iy][igraph]->GetN() == 0) { #ifdef TALKATIVE - cout << __FILE__ << ":" << __LINE__ << ":Info: " << graphs[ix][iy][igraph]->GetName() << " is empty." << endl; + cout << __FILE__ << ":" << __LINE__ << ":Info: " << graphs[ix][iy][igraph]->GetName() << " is empty." << endl; #endif - continue; - } + continue; + } #ifdef DEBUG - cout << __FILE__ << ":" << __LINE__ << ":Info: cloning, coloring and adding TGraph " - << _sublevel_names[igraph%NB_SUBLEVELS] - << (igraph >= NB_SUBLEVELS ? "(z<0)" : "(z>0)") - << " to global TMultiGraph" << endl; + cout << __FILE__ << ":" << __LINE__ << ":Info: cloning, coloring and adding TGraph " + << _sublevel_names[igraph % NB_SUBLEVELS] << (igraph >= NB_SUBLEVELS ? "(z<0)" : "(z>0)") + << " to global TMultiGraph" << endl; #endif - // clone to prevent any injure on the graph - TGraph * gr = (TGraph *) graphs[ix][iy][igraph]->Clone(); - // color - gr->SetMarkerColor(COLOR_CODE(igraph%NB_SUBLEVELS)); - mgraphs[ix][iy][0]->Add(gr, "P");//, (mgraphs[ix][iy][0]->GetListOfGraphs()==0?"AP":"P")); - - if (igraph%NB_SUBLEVELS == 0 || igraph%NB_SUBLEVELS == 1) mgraphs[ix][iy][7]->Add(gr, "P"); // Add BPIX (0) and FPIX (1) to pixel plot - - } - - /// SUBLEVELS (1..6) - for (unsigned int isublevel = 1 ; isublevel <= NB_SUBLEVELS ; isublevel++) - { + // clone to prevent any injure on the graph + TGraph *gr = (TGraph *)graphs[ix][iy][igraph]->Clone(); + // color + gr->SetMarkerColor(COLOR_CODE(igraph % NB_SUBLEVELS)); + mgraphs[ix][iy][0]->Add(gr, "P"); //, (mgraphs[ix][iy][0]->GetListOfGraphs()==0?"AP":"P")); + + if (igraph % NB_SUBLEVELS == 0 || igraph % NB_SUBLEVELS == 1) + mgraphs[ix][iy][7]->Add(gr, "P"); // Add BPIX (0) and FPIX (1) to pixel plot + } + + /// SUBLEVELS (1..6) + for (unsigned int isublevel = 1; isublevel <= NB_SUBLEVELS; isublevel++) { #ifdef DEBUG - cout << __FILE__ << ":" << __LINE__ << ":Info: cloning, coloring and adding TGraph " - << _sublevel_names[isublevel-1] << " to sublevel TMultiGraph" << endl; + cout << __FILE__ << ":" << __LINE__ << ":Info: cloning, coloring and adding TGraph " + << _sublevel_names[isublevel - 1] << " to sublevel TMultiGraph" << endl; #endif - mgraphs[ix][iy][isublevel] = new TMultiGraph (TString::Format("%s_vs_%s_%s_%d", x[ix].Data(), - y[iy].Data(), - _sublevel_names[isublevel-1].Data(), - canvas_index), // name - //LateXstyle(x[ix]) + TString(" vs. ") + LateXstyle(y[iy]) + TString(" for ") + - _sublevel_names[isublevel-1] // graph title - + TString (";") + LateXstyle(x[ix]) + " /" + _units[x[ix]] // x axis title - + TString (";") + LateXstyle(y[iy]) + " /" + _units[y[iy]]); // y axis title - - graphs[ix][iy][ isublevel-1]->SetMarkerColor(kBlack); - graphs[ix][iy][NB_SUBLEVELS+isublevel-1]->SetMarkerColor(kRed); - graphs[ix][iy][2*NB_SUBLEVELS+isublevel-1]->SetMarkerColor(kGray+1); - graphs[ix][iy][3*NB_SUBLEVELS+isublevel-1]->SetMarkerColor(kRed-7); - graphs[ix][iy][4*NB_SUBLEVELS+isublevel-1]->SetMarkerColor(kGray+1); - graphs[ix][iy][5*NB_SUBLEVELS+isublevel-1]->SetMarkerColor(kRed-7); - if (graphs[ix][iy][ isublevel-1]->GetN() > 0) mgraphs[ix][iy][isublevel]->Add(graphs[ix][iy][ isublevel-1], "P"); //(mgraphs[ix][iy][isublevel-1]->GetListOfGraphs()==0?"AP":"P")); // z>0 + mgraphs[ix][iy][isublevel] = + new TMultiGraph(TString::Format("%s_vs_%s_%s_%d", + x[ix].Data(), + y[iy].Data(), + _sublevel_names[isublevel - 1].Data(), + canvas_index), // name + //LateXstyle(x[ix]) + TString(" vs. ") + LateXstyle(y[iy]) + TString(" for ") + + _sublevel_names[isublevel - 1] // graph title + + TString(";") + LateXstyle(x[ix]) + " /" + _units[x[ix]] // x axis title + + TString(";") + LateXstyle(y[iy]) + " /" + _units[y[iy]]); // y axis title + + graphs[ix][iy][isublevel - 1]->SetMarkerColor(kBlack); + graphs[ix][iy][NB_SUBLEVELS + isublevel - 1]->SetMarkerColor(kRed); + graphs[ix][iy][2 * NB_SUBLEVELS + isublevel - 1]->SetMarkerColor(kGray + 1); + graphs[ix][iy][3 * NB_SUBLEVELS + isublevel - 1]->SetMarkerColor(kRed - 7); + graphs[ix][iy][4 * NB_SUBLEVELS + isublevel - 1]->SetMarkerColor(kGray + 1); + graphs[ix][iy][5 * NB_SUBLEVELS + isublevel - 1]->SetMarkerColor(kRed - 7); + if (graphs[ix][iy][isublevel - 1]->GetN() > 0) + mgraphs[ix][iy][isublevel]->Add( + graphs[ix][iy][isublevel - 1], + "P"); //(mgraphs[ix][iy][isublevel-1]->GetListOfGraphs()==0?"AP":"P")); // z>0 #ifdef TALKATIVE - else cout << __FILE__ << ":" << __LINE__ << ":Info: graphs[ix][iy][isublevel-1]=" << graphs[ix][iy][isublevel-1]->GetName() << " is empty -> not added into " << mgraphs[ix][iy][isublevel]->GetName() << endl; + else + cout << __FILE__ << ":" << __LINE__ + << ":Info: graphs[ix][iy][isublevel-1]=" << graphs[ix][iy][isublevel - 1]->GetName() + << " is empty -> not added into " << mgraphs[ix][iy][isublevel]->GetName() << endl; #endif - if (graphs[ix][iy][NB_SUBLEVELS+isublevel-1]->GetN() > 0) mgraphs[ix][iy][isublevel]->Add(graphs[ix][iy][NB_SUBLEVELS+isublevel-1], "P"); //(mgraphs[ix][iy][isublevel-1]->GetListOfGraphs()==0?"AP":"P")); // z<0 + if (graphs[ix][iy][NB_SUBLEVELS + isublevel - 1]->GetN() > 0) + mgraphs[ix][iy][isublevel]->Add( + graphs[ix][iy][NB_SUBLEVELS + isublevel - 1], + "P"); //(mgraphs[ix][iy][isublevel-1]->GetListOfGraphs()==0?"AP":"P")); // z<0 #ifdef TALKATIVE - else cout << __FILE__ << ":" << __LINE__ << ":Info: graphs[ix][iy][NB_SUBLEVEL+isublevel-1]=" << graphs[ix][iy][NB_Z_SLICES+isublevel-1]->GetName() << " is empty -> not added into " << mgraphs[ix][iy][isublevel]->GetName() << endl; + else + cout << __FILE__ << ":" << __LINE__ << ":Info: graphs[ix][iy][NB_SUBLEVEL+isublevel-1]=" + << graphs[ix][iy][NB_Z_SLICES + isublevel - 1]->GetName() << " is empty -> not added into " + << mgraphs[ix][iy][isublevel]->GetName() << endl; #endif -#if NB_Z_SLICES!=2 - cout << __FILE__ << ":" << __LINE__ << ":Error: color code incomplete for Z slices..." << endl; +#if NB_Z_SLICES != 2 + cout << __FILE__ << ":" << __LINE__ << ":Error: color code incomplete for Z slices..." << endl; #endif - if (_module_plot_option == "all"){ - if (graphs[ix][iy][2*NB_SUBLEVELS+isublevel-1]->GetN() > 0) mgraphs[ix][iy][isublevel]->Add(graphs[ix][iy][2*NB_SUBLEVELS+isublevel-1], "P"); - if (graphs[ix][iy][3*NB_SUBLEVELS+isublevel-1]->GetN() > 0) mgraphs[ix][iy][isublevel]->Add(graphs[ix][iy][3*NB_SUBLEVELS+isublevel-1], "P"); - if (graphs[ix][iy][4*NB_SUBLEVELS+isublevel-1]->GetN() > 0) mgraphs[ix][iy][isublevel]->Add(graphs[ix][iy][4*NB_SUBLEVELS+isublevel-1], "P"); - if (graphs[ix][iy][5*NB_SUBLEVELS+isublevel-1]->GetN() > 0) mgraphs[ix][iy][isublevel]->Add(graphs[ix][iy][5*NB_SUBLEVELS+isublevel-1], "P"); - } - if (_module_plot_option == "list"){ - if (graphs[ix][iy][2*NB_SUBLEVELS+isublevel-1]->GetN() > 0) mgraphs[ix][iy][isublevel]->Add(graphs[ix][iy][2*NB_SUBLEVELS+isublevel-1], "P"); - if (graphs[ix][iy][3*NB_SUBLEVELS+isublevel-1]->GetN() > 0) mgraphs[ix][iy][isublevel]->Add(graphs[ix][iy][3*NB_SUBLEVELS+isublevel-1], "P"); - } - } - + if (_module_plot_option == "all") { + if (graphs[ix][iy][2 * NB_SUBLEVELS + isublevel - 1]->GetN() > 0) + mgraphs[ix][iy][isublevel]->Add(graphs[ix][iy][2 * NB_SUBLEVELS + isublevel - 1], "P"); + if (graphs[ix][iy][3 * NB_SUBLEVELS + isublevel - 1]->GetN() > 0) + mgraphs[ix][iy][isublevel]->Add(graphs[ix][iy][3 * NB_SUBLEVELS + isublevel - 1], "P"); + if (graphs[ix][iy][4 * NB_SUBLEVELS + isublevel - 1]->GetN() > 0) + mgraphs[ix][iy][isublevel]->Add(graphs[ix][iy][4 * NB_SUBLEVELS + isublevel - 1], "P"); + if (graphs[ix][iy][5 * NB_SUBLEVELS + isublevel - 1]->GetN() > 0) + mgraphs[ix][iy][isublevel]->Add(graphs[ix][iy][5 * NB_SUBLEVELS + isublevel - 1], "P"); + } + if (_module_plot_option == "list") { + if (graphs[ix][iy][2 * NB_SUBLEVELS + isublevel - 1]->GetN() > 0) + mgraphs[ix][iy][isublevel]->Add(graphs[ix][iy][2 * NB_SUBLEVELS + isublevel - 1], "P"); + if (graphs[ix][iy][3 * NB_SUBLEVELS + isublevel - 1]->GetN() > 0) + mgraphs[ix][iy][isublevel]->Add(graphs[ix][iy][3 * NB_SUBLEVELS + isublevel - 1], "P"); + } + } - // fixing ranges, saving, and drawing of TMultiGraph (tracker AND sublevels AND pixel, i.e. 2+NB_SUBLEVELS objects) - // the individual canvases are saved, but the global are just drawn and will be saved later - for (unsigned short int imgr = 0 ; imgr <= NB_SUBLEVELS+1 ; imgr++) - { + // fixing ranges, saving, and drawing of TMultiGraph (tracker AND sublevels AND pixel, i.e. 2+NB_SUBLEVELS objects) + // the individual canvases are saved, but the global are just drawn and will be saved later + for (unsigned short int imgr = 0; imgr <= NB_SUBLEVELS + 1; imgr++) { #ifdef DEBUG - cout << __FILE__ << ":" << __LINE__ << ":Info: treating individual canvases." << endl; + cout << __FILE__ << ":" << __LINE__ << ":Info: treating individual canvases." << endl; #endif - // drawing into individual canvas and printing it (including a legend for the tracker canvas) - c[ix][iy][imgr] = new TCanvas (TString::Format("c_%s_vs_%s_%s_%d", x[ix].Data(), - y[iy].Data(), - imgr==0 ? "tracker" : ( imgr==7 ? "pixel" : _sublevel_names[imgr-1].Data() ), - canvas_index), - TString::Format("%s vs. %s at %s level", x[ix].Data(), - y[iy].Data(), - imgr==0 ? "tracker" : ( imgr==7 ? "pixel" : _sublevel_names[imgr-1].Data() ) ), - _window_width, - _window_height); - c[ix][iy][imgr]->SetGrid(_grid_x,_grid_y); // grid - - if (mgraphs[ix][iy][imgr]->GetListOfGraphs() != 0) { - if (dyMin[iy] != -99999) { - mgraphs[ix][iy][imgr]->SetMinimum(dyMin[iy]); - } - if (dyMax[iy] != -99999) { - mgraphs[ix][iy][imgr]->SetMaximum(dyMax[iy]); - } - mgraphs[ix][iy][imgr]->Draw("A"); - } - if (imgr == 0 && _legend) legend->Draw(); // only for the tracker - if (_print && !_print_only_global) c[ix][iy][imgr]->Print(_output_directory + mgraphs[ix][iy][imgr]->GetName() + ExtensionFromPrintOption(_print_option), _print_option); - - // writing into root file - if (_write) mgraphs[ix][iy][imgr]->Write(); - - // drawing into global canvas - c_global[imgr]->cd(INDEX_IN_GLOBAL_CANVAS(ix,iy)); - c_global[imgr]->GetPad(INDEX_IN_GLOBAL_CANVAS(ix,iy))->SetFillStyle(4000); // make the pad transparent - c_global[imgr]->GetPad(INDEX_IN_GLOBAL_CANVAS(ix,iy))->SetGrid(_grid_x,_grid_y); // grid - if (mgraphs[ix][iy][imgr]->GetListOfGraphs() != 0) { - if (dyMin[iy] != -99999) { - mgraphs[ix][iy][imgr]->SetMinimum(dyMin[iy]); - } - if (dyMax[iy] != -99999) { - mgraphs[ix][iy][imgr]->SetMaximum(dyMax[iy]); - } - mgraphs[ix][iy][imgr]->Draw("A"); - } - // printing will be performed after customisation (e.g. legend or title) just after the loops on ix and iy + // drawing into individual canvas and printing it (including a legend for the tracker canvas) + c[ix][iy][imgr] = new TCanvas( + TString::Format("c_%s_vs_%s_%s_%d", + x[ix].Data(), + y[iy].Data(), + imgr == 0 ? "tracker" : (imgr == 7 ? "pixel" : _sublevel_names[imgr - 1].Data()), + canvas_index), + TString::Format("%s vs. %s at %s level", + x[ix].Data(), + y[iy].Data(), + imgr == 0 ? "tracker" : (imgr == 7 ? "pixel" : _sublevel_names[imgr - 1].Data())), + _window_width, + _window_height); + c[ix][iy][imgr]->SetGrid(_grid_x, _grid_y); // grid + + if (mgraphs[ix][iy][imgr]->GetListOfGraphs() != 0) { + if (dyMin[iy] != -99999) { + mgraphs[ix][iy][imgr]->SetMinimum(dyMin[iy]); + } + if (dyMax[iy] != -99999) { + mgraphs[ix][iy][imgr]->SetMaximum(dyMax[iy]); + } + mgraphs[ix][iy][imgr]->Draw("A"); + } + if (imgr == 0 && _legend) + legend->Draw(); // only for the tracker + if (_print && !_print_only_global) + c[ix][iy][imgr]->Print( + _output_directory + mgraphs[ix][iy][imgr]->GetName() + ExtensionFromPrintOption(_print_option), + _print_option); + + // writing into root file + if (_write) + mgraphs[ix][iy][imgr]->Write(); + + // drawing into global canvas + c_global[imgr]->cd(INDEX_IN_GLOBAL_CANVAS(ix, iy)); + c_global[imgr]->GetPad(INDEX_IN_GLOBAL_CANVAS(ix, iy))->SetFillStyle(4000); // make the pad transparent + c_global[imgr]->GetPad(INDEX_IN_GLOBAL_CANVAS(ix, iy))->SetGrid(_grid_x, _grid_y); // grid + if (mgraphs[ix][iy][imgr]->GetListOfGraphs() != 0) { + if (dyMin[iy] != -99999) { + mgraphs[ix][iy][imgr]->SetMinimum(dyMin[iy]); + } + if (dyMax[iy] != -99999) { + mgraphs[ix][iy][imgr]->SetMaximum(dyMax[iy]); + } + mgraphs[ix][iy][imgr]->Draw("A"); + } + // printing will be performed after customisation (e.g. legend or title) just after the loops on ix and iy + } + } // end of loop on y + } // end of loop on x + + // CUSTOMISATION + gStyle->SetOptTitle(0); // otherwise, the title is repeated in every pad of the global canvases + // -> instead, we will write it in the upper part in a TPaveText or in a TLegend + for (unsigned int ic = 0; ic <= NB_SUBLEVELS + 1; ic++) { + c_global[ic]->Draw(); + + // setting legend to tracker canvases + if (!_legend) + break; + TCanvas *c_temp = (TCanvas *)c_global[ic]->Clone(c_global[ic]->GetTitle() + TString("_sub")); + c_temp->Draw(); + c_global[ic] = new TCanvas( + c_temp->GetName() + TString("_final"), c_temp->GetTitle(), c_temp->GetWindowWidth(), c_temp->GetWindowHeight()); + c_global[ic]->Draw(); + TPad *p_up = new TPad(TString("legend_") + c_temp->GetName(), + "", + 0., + 0.9, + 1., + 1., // relative position + -1, + 0, + 0), // display options + *p_down = new TPad(TString("main_") + c_temp->GetName(), "", 0., 0., 1., 0.9, -1, 0, 0); + // in the lower part, draw the plots + p_down->Draw(); + p_down->cd(); + c_temp->DrawClonePad(); + c_global[ic]->cd(); + // in the upper part, pimp the canvas :p + p_up->Draw(); + p_up->cd(); + if (ic == 0) // tracker + { + TLegend *global_legend = MakeLegend(.05, .1, .7, .8, NB_SUBLEVELS); //, "brNDC"); + global_legend->Draw(); + TPaveText *pt_geom = new TPaveText(.75, .1, .95, .8, "NB"); + pt_geom->SetFillColor(0); + pt_geom->SetTextSize(0.25); + pt_geom->AddText(TString("x: ") + _reference_name); + pt_geom->AddText(TString("y: ") + _alignment_name + TString(" - ") + _reference_name); + pt_geom->Draw(); + } else if (ic == 7) // pixel + { + TLegend *global_legend = MakeLegend(.05, .1, .7, .8, 2); //, "brNDC"); + global_legend->Draw(); + TPaveText *pt_geom = new TPaveText(.75, .1, .95, .8, "NB"); + pt_geom->SetFillColor(0); + pt_geom->SetTextSize(0.25); + pt_geom->AddText(TString("x: ") + _reference_name); + pt_geom->AddText(TString("y: ") + _alignment_name + TString(" - ") + _reference_name); + pt_geom->Draw(); + } else // sublevels + { + TPaveText *pt = new TPaveText(.05, .1, .7, .8, "NB"); + pt->SetFillColor(0); + pt->AddText(_sublevel_names[ic - 1]); + pt->Draw(); + TPaveText *pt_geom = new TPaveText(.6, .1, .95, .8, "NB"); + pt_geom->SetFillColor(0); + pt_geom->SetTextSize(0.3); + pt_geom->AddText(TString("x: ") + _reference_name); + pt_geom->AddText(TString("y: ") + _alignment_name + TString(" - ") + _reference_name); + pt_geom->Draw(); + } + // printing + if (_print) + c_global[ic]->Print(_output_directory + c_global[ic]->GetName() + ExtensionFromPrintOption(_print_option), + _print_option); + if (_write) + c_global[ic]->Write(); + } + + // printing global canvases + if (_write) + output->Close(); + + // Now produce the profile plots if the option is chosen + // Use seperate loops since no seperate plots are produced for different module qualities + if (_make_profile_plots) { + // Fill Content of 2D-hists into 1D-hists for the profile plots + // Loop over all y-bins for a certain x-bin, calculate mean and RMS as entries of the 1D-hists + bool entries = false; + for (unsigned int ix = 0; ix < x.size(); ix++) { + for (unsigned int iy = 0; iy < y.size(); iy++) { + for (unsigned int igraph = 0; igraph < NB_SUBLEVELS * NB_Z_SLICES; igraph++) { + // Declare hists which will be plotted for the profile plots + histos[ix][iy][igraph] = + new TH1F("1Dhist" + x[ix] + y[iy] + _sublevel_names[igraph % NB_SUBLEVELS] + + TString(igraph % (NB_SUBLEVELS * NB_Z_SLICES) >= NB_SUBLEVELS ? "n" : "p") + + TString(std::to_string(canvas_index)), + "", + histos2D[ix][iy][igraph]->GetXaxis()->GetNbins(), + _min[x[ix]], + _max[x[ix]]); + histos[ix][iy][igraph]->SetMarkerColor(COLOR_CODE(igraph)); + histos[ix][iy][igraph]->SetLineColor(COLOR_CODE(igraph)); + histos[ix][iy][igraph]->StatOverflows(kTRUE); + + // Loop over x bins + for (int binx = 0; binx <= histos2D[ix][iy][igraph]->GetXaxis()->GetNbins(); binx++) { + entries = false; + // Declare y-histogram for each x bin + histosYValues[ix][iy][igraph] = + new TH1F("1Dhist_Y-Values" + x[ix] + y[iy] + _sublevel_names[igraph % NB_SUBLEVELS] + + TString(igraph % (NB_SUBLEVELS * NB_Z_SLICES) >= NB_SUBLEVELS ? "n" : "p") + + TString(std::to_string(canvas_index)) + TString(std::to_string(binx)), + "", + histos2D[ix][iy][igraph]->GetYaxis()->GetNbins(), + _min[y[iy]], + _max[y[iy]] + 1.); + histosYValues[ix][iy][igraph]->StatOverflows(kTRUE); + // Loop over y-bins for each x-bin of the 2D histogram and put it into the 1-d y histograms + // Take overflow bin into account + for (int biny = 0; biny <= histos2D[ix][iy][igraph]->GetYaxis()->GetNbins() + 1; biny++) { + if (histos2D[ix][iy][igraph]->GetBinContent(binx, biny) > 1.) { + histosYValues[ix][iy][igraph]->SetBinContent(biny, histos2D[ix][iy][igraph]->GetBinContent(binx, biny)); + entries = true; + } } - } // end of loop on y - } // end of loop on x - - + if (entries) { + histos[ix][iy][igraph]->SetBinContent(binx, histosYValues[ix][iy][igraph]->GetMean()); + histos[ix][iy][igraph]->SetBinError(binx, histosYValues[ix][iy][igraph]->GetRMS()); + } else + histos[ix][iy][igraph]->SetBinContent(binx, -999999.); + } + } - // CUSTOMISATION - gStyle->SetOptTitle(0); // otherwise, the title is repeated in every pad of the global canvases - // -> instead, we will write it in the upper part in a TPaveText or in a TLegend - for (unsigned int ic = 0 ; ic <= NB_SUBLEVELS+1 ; ic++) - { - c_global[ic]->Draw(); - - // setting legend to tracker canvases - if (!_legend) break; - TCanvas * c_temp = (TCanvas *) c_global[ic]->Clone(c_global[ic]->GetTitle() + TString("_sub")); - c_temp->Draw(); - c_global[ic] = new TCanvas (c_temp->GetName() + TString("_final"), c_temp->GetTitle(), c_temp->GetWindowWidth(), c_temp->GetWindowHeight()); - c_global[ic]->Draw(); - TPad * p_up = new TPad (TString("legend_") + c_temp->GetName(), "", - 0., 0.9, 1., 1., // relative position - -1, 0, 0), // display options - * p_down = new TPad (TString("main_") + c_temp->GetName(), "", - 0., 0., 1., 0.9, - -1, 0, 0); - // in the lower part, draw the plots - p_down->Draw(); - p_down->cd(); - c_temp->DrawClonePad(); - c_global[ic]->cd(); - // in the upper part, pimp the canvas :p - p_up->Draw(); - p_up->cd(); - if (ic == 0) // tracker - { - TLegend * global_legend = MakeLegend(.05,.1,.7,.8,NB_SUBLEVELS);//, "brNDC"); - global_legend->Draw(); - TPaveText * pt_geom = new TPaveText(.75,.1,.95,.8, "NB"); - pt_geom->SetFillColor(0); - pt_geom->SetTextSize(0.25); - pt_geom->AddText(TString("x: ")+_reference_name); - pt_geom->AddText(TString("y: ")+_alignment_name+TString(" - ")+_reference_name); - pt_geom->Draw(); + // Customize and print the histograms + + /// TRACKER + // fixing ranges and draw profile plot histos + + c_hist[ix][iy][0] = + new TCanvas(TString::Format("c_hist_%s_vs_%s_tracker_%d", x[ix].Data(), y[iy].Data(), canvas_index), + TString::Format("Profile plot %s vs. %s at tracker level", x[ix].Data(), y[iy].Data()), + _window_width, + _window_height); + c_hist[ix][iy][0]->SetGrid(_grid_x, _grid_y); // grid + // Draw the frame that will contain the histograms + // One needs to specify the binning and title + c_hist[ix][iy][0]->GetPad(0)->DrawFrame(_min[x[ix]], + dyMin[iy] != -99999 ? dyMin[iy] : _min[y[iy]], + _max[x[ix]], + dyMax[iy] != -99999 ? dyMax[iy] : _max[y[iy]], + TString(";") + LateXstyle(x[ix]) + " /" + _units[x[ix]] + TString(";") + + LateXstyle(y[iy]) + " /" + _units[y[iy]]); + if (_legend) + legend->Draw("same"); + + for (unsigned short int jgraph = 0; jgraph < NB_SUBLEVELS * NB_Z_SLICES; jgraph++) { + unsigned short int igraph = + NB_SUBLEVELS * NB_Z_SLICES - jgraph - + 1; // reverse counting for humane readability (one of the sublevel takes much more place than the others) + + // clone to prevent any injure on the graph + histosTracker[ix][iy][igraph] = (TH1F *)histos[ix][iy][igraph]->Clone(); + // color + histosTracker[ix][iy][igraph]->SetMarkerColor(COLOR_CODE(igraph % NB_SUBLEVELS)); + histosTracker[ix][iy][igraph]->SetLineColor(COLOR_CODE(igraph % NB_SUBLEVELS)); + histosTracker[ix][iy][igraph]->SetMarkerStyle(6); + histosTracker[ix][iy][igraph]->Draw("same pe0"); + } + + if (_print && !_print_only_global) + c_hist[ix][iy][0]->Print( + _output_directory + + TString::Format("Profile_plot_%s_vs_%s_tracker_%d", x[ix].Data(), y[iy].Data(), canvas_index) + + ExtensionFromPrintOption(_print_option), + _print_option); + + //Draw into profile hists global tracker canvas + c_global_hist[0]->cd(INDEX_IN_GLOBAL_CANVAS(ix, iy)); + c_global_hist[0]->GetPad(INDEX_IN_GLOBAL_CANVAS(ix, iy))->SetFillStyle(4000); // make the pad transparent + c_global_hist[0]->GetPad(INDEX_IN_GLOBAL_CANVAS(ix, iy))->SetGrid(_grid_x, _grid_y); // grid + c_global_hist[0] + ->GetPad(INDEX_IN_GLOBAL_CANVAS(ix, iy)) + ->DrawFrame(_min[x[ix]], + dyMin[iy] != -99999 ? dyMin[iy] : _min[y[iy]], + _max[x[ix]], + dyMax[iy] != -99999 ? dyMax[iy] : _max[y[iy]], + TString(";") + LateXstyle(x[ix]) + " /" + _units[x[ix]] + TString(";") + LateXstyle(y[iy]) + + " /" + _units[y[iy]]); + + for (unsigned short int jgraph = 0; jgraph < NB_SUBLEVELS * NB_Z_SLICES; jgraph++) { + unsigned short int igraph = + NB_SUBLEVELS * NB_Z_SLICES - jgraph - + 1; // reverse counting for humane readability (one of the sublevel takes much more place than the others) + histosTracker[ix][iy][igraph]->Draw("same pe0"); + } + + /// PIXEL + // fixing ranges and draw profile plot histos + + c_hist[ix][iy][7] = + new TCanvas(TString::Format("c_hist_%s_vs_%s_pixel_%d", x[ix].Data(), y[iy].Data(), canvas_index), + TString::Format("Profile plot %s vs. %s at pixel level", x[ix].Data(), y[iy].Data()), + _window_width, + _window_height); + c_hist[ix][iy][7]->SetGrid(_grid_x, _grid_y); // grid + // Draw the frame that will contain the histograms + // One needs to specify the binning and title + c_hist[ix][iy][7]->GetPad(0)->DrawFrame(_min[x[ix]], + dyMin[iy] != -99999 ? dyMin[iy] : _min[y[iy]], + _max[x[ix]], + dyMax[iy] != -99999 ? dyMax[iy] : _max[y[iy]], + TString(";") + LateXstyle(x[ix]) + " /" + _units[x[ix]] + TString(";") + + LateXstyle(y[iy]) + " /" + _units[y[iy]]); + if (_legend) + legend->Draw("same"); + + for (unsigned short int jgraph = 0; jgraph < NB_SUBLEVELS * NB_Z_SLICES; jgraph++) { + unsigned short int igraph = + NB_SUBLEVELS * NB_Z_SLICES - jgraph - + 1; // reverse counting for humane readability (one of the sublevel takes much more place than the others) + + if (igraph % NB_SUBLEVELS == 0 || igraph % NB_SUBLEVELS == 1) //Only BPIX and FPIX + { + // clone to prevent any injure on the graph + histosTracker[ix][iy][igraph] = (TH1F *)histos[ix][iy][igraph]->Clone(); + // color + histosTracker[ix][iy][igraph]->SetMarkerColor(COLOR_CODE(igraph % NB_SUBLEVELS)); + histosTracker[ix][iy][igraph]->SetLineColor(COLOR_CODE(igraph % NB_SUBLEVELS)); + histosTracker[ix][iy][igraph]->SetMarkerStyle(6); + histosTracker[ix][iy][igraph]->Draw("same pe0"); + } } - else if (ic == 7) // pixel - { - TLegend * global_legend = MakeLegend(.05,.1,.7,.8,2);//, "brNDC"); - global_legend->Draw(); - TPaveText * pt_geom = new TPaveText(.75,.1,.95,.8, "NB"); - pt_geom->SetFillColor(0); - pt_geom->SetTextSize(0.25); - pt_geom->AddText(TString("x: ")+_reference_name); - pt_geom->AddText(TString("y: ")+_alignment_name+TString(" - ")+_reference_name); - pt_geom->Draw(); + + if (_print && !_print_only_global) + c_hist[ix][iy][7]->Print( + _output_directory + + TString::Format("Profile_plot_%s_vs_%s_pixel_%d", x[ix].Data(), y[iy].Data(), canvas_index) + + ExtensionFromPrintOption(_print_option), + _print_option); + + //Draw into profile hists global tracker canvas + c_global_hist[7]->cd(INDEX_IN_GLOBAL_CANVAS(ix, iy)); + c_global_hist[7]->GetPad(INDEX_IN_GLOBAL_CANVAS(ix, iy))->SetFillStyle(4000); // make the pad transparent + c_global_hist[7]->GetPad(INDEX_IN_GLOBAL_CANVAS(ix, iy))->SetGrid(_grid_x, _grid_y); // grid + c_global_hist[7] + ->GetPad(INDEX_IN_GLOBAL_CANVAS(ix, iy)) + ->DrawFrame(_min[x[ix]], + dyMin[iy] != -99999 ? dyMin[iy] : _min[y[iy]], + _max[x[ix]], + dyMax[iy] != -99999 ? dyMax[iy] : _max[y[iy]], + TString(";") + LateXstyle(x[ix]) + " /" + _units[x[ix]] + TString(";") + LateXstyle(y[iy]) + + " /" + _units[y[iy]]); + + for (unsigned short int jgraph = 0; jgraph < NB_SUBLEVELS * NB_Z_SLICES; jgraph++) { + unsigned short int igraph = + NB_SUBLEVELS * NB_Z_SLICES - jgraph - + 1; // reverse counting for humane readability (one of the sublevel takes much more place than the others) + histosTracker[ix][iy][igraph]->Draw("same pe0"); } - else // sublevels - { - TPaveText * pt = new TPaveText(.05,.1,.7,.8, "NB"); - pt->SetFillColor(0); - pt->AddText(_sublevel_names[ic-1]); - pt->Draw(); - TPaveText * pt_geom = new TPaveText(.6,.1,.95,.8, "NB"); - pt_geom->SetFillColor(0); - pt_geom->SetTextSize(0.3); - pt_geom->AddText(TString("x: ")+_reference_name); - pt_geom->AddText(TString("y: ")+_alignment_name+TString(" - ")+_reference_name); - pt_geom->Draw(); + // printing will be performed after customisation (e.g. legend or title) just after the loops on ix and iy + /// SUBLEVELS (1..6) + for (unsigned int isublevel = 1; isublevel <= NB_SUBLEVELS; isublevel++) { + // Draw and print profile histograms + c_hist[ix][iy][isublevel] = + new TCanvas(TString::Format("c_hist_%s_vs_%s_%s_%d", + x[ix].Data(), + y[iy].Data(), + isublevel == 0 ? "tracker" : _sublevel_names[isublevel - 1].Data(), + canvas_index), + TString::Format("Profile plot %s vs. %s at %s level", + x[ix].Data(), + y[iy].Data(), + isublevel == 0 ? "tracker" : _sublevel_names[isublevel - 1].Data()), + _window_width, + _window_height); + c_hist[ix][iy][isublevel]->SetGrid(_grid_x, _grid_y); // grid + c_hist[ix][iy][isublevel]->GetPad(0)->DrawFrame(_min[x[ix]], + dyMin[iy] != -99999 ? dyMin[iy] : _min[y[iy]], + _max[x[ix]], + dyMax[iy] != -99999 ? dyMax[iy] : _max[y[iy]], + TString(";") + LateXstyle(x[ix]) + " /" + _units[x[ix]] + + TString(";") + LateXstyle(y[iy]) + " /" + _units[y[iy]]); + + histos[ix][iy][isublevel - 1]->SetMarkerColor(kBlack); + histos[ix][iy][isublevel - 1]->SetLineColor(kBlack); + histos[ix][iy][NB_SUBLEVELS + isublevel - 1]->SetMarkerColor(kRed); + histos[ix][iy][NB_SUBLEVELS + isublevel - 1]->SetLineColor(kRed); + + histos[ix][iy][isublevel - 1]->Draw("same pe0"); + histos[ix][iy][NB_SUBLEVELS + isublevel - 1]->Draw("same pe0"); + + if (_print && !_print_only_global) + c_hist[ix][iy][isublevel]->Print(_output_directory + + TString::Format("Profile_plot_%s_vs_%s_%s_%d", + x[ix].Data(), + y[iy].Data(), + _sublevel_names[isublevel - 1].Data(), + canvas_index) + + ExtensionFromPrintOption(_print_option), + _print_option); + + // draw into global canvas + // printing will be performed after customisation (e.g. legend or title) just after the loops on ix and iy + c_global_hist[isublevel]->cd(INDEX_IN_GLOBAL_CANVAS(ix, iy)); + c_global_hist[isublevel] + ->GetPad(INDEX_IN_GLOBAL_CANVAS(ix, iy)) + ->SetFillStyle(4000); // make the pad transparent + c_global_hist[isublevel]->GetPad(INDEX_IN_GLOBAL_CANVAS(ix, iy))->SetGrid(_grid_x, _grid_y); // grid + c_global_hist[isublevel] + ->GetPad(INDEX_IN_GLOBAL_CANVAS(ix, iy)) + ->DrawFrame(_min[x[ix]], + dyMin[iy] != -99999 ? dyMin[iy] : _min[y[iy]], + _max[x[ix]], + dyMax[iy] != -99999 ? dyMax[iy] : _max[y[iy]], + TString(";") + LateXstyle(x[ix]) + " /" + _units[x[ix]] + TString(";") + LateXstyle(y[iy]) + + " /" + _units[y[iy]]); + + histos[ix][iy][isublevel - 1]->Draw("same pe0"); + histos[ix][iy][NB_SUBLEVELS + isublevel - 1]->Draw("same pe0"); } - // printing - if (_print) c_global[ic]->Print(_output_directory + c_global[ic]->GetName() + ExtensionFromPrintOption(_print_option), _print_option); - if (_write) c_global[ic]->Write(); + + } // end of loop on y + } // end of loop on x + + // CUSTOMISATION + gStyle->SetOptTitle(0); // otherwise, the title is repeated in every pad of the global canvases + // -> instead, we will write it in the upper part in a TPaveText or in a TLegend + for (unsigned int ic = 0; ic <= NB_SUBLEVELS; ic++) { + // setting legend to tracker canvases + if (!_legend) + break; + + // setting legend to tracker canvases + if (!_legend) + break; + TCanvas *c_temp_hist = (TCanvas *)c_global_hist[ic]->Clone(c_global_hist[ic]->GetTitle() + TString("_sub")); + c_temp_hist->Draw(); + c_global_hist[ic] = new TCanvas(c_temp_hist->GetName() + TString("_final"), + c_temp_hist->GetTitle(), + c_temp_hist->GetWindowWidth(), + c_temp_hist->GetWindowHeight()); + c_global_hist[ic]->Draw(); + TPad *p_up = new TPad(TString("legend_") + c_temp_hist->GetName(), + "", + 0., + 0.9, + 1., + 1., // relative position + -1, + 0, + 0), // display options + *p_down = new TPad(TString("main_") + c_temp_hist->GetName(), "", 0., 0., 1., 0.9, -1, 0, 0); + // in the lower part, draw the plots + p_down->Draw(); + p_down->cd(); + c_temp_hist->DrawClonePad(); + c_global_hist[ic]->cd(); + // in the upper part, pimp the canvas :p + p_up->Draw(); + p_up->cd(); + if (ic == 0) // tracker + { + TLegend *global_legend = MakeLegend(.05, .1, .7, .8, NB_SUBLEVELS); //, "brNDC"); + global_legend->Draw(); + TPaveText *pt_geom = new TPaveText(.75, .1, .95, .8, "NB"); + pt_geom->SetFillColor(0); + pt_geom->SetTextSize(0.25); + pt_geom->AddText(TString("x: ") + _reference_name); + pt_geom->AddText(TString("y: ") + _alignment_name + TString(" - ") + _reference_name); + pt_geom->Draw(); + } else if (ic == 7) // pixel + { + TLegend *global_legend = MakeLegend(.05, .1, .7, .8, 2); //, "brNDC"); + global_legend->Draw(); + TPaveText *pt_geom = new TPaveText(.75, .1, .95, .8, "NB"); + pt_geom->SetFillColor(0); + pt_geom->SetTextSize(0.25); + pt_geom->AddText(TString("x: ") + _reference_name); + pt_geom->AddText(TString("y: ") + _alignment_name + TString(" - ") + _reference_name); + pt_geom->Draw(); + } else // sublevels + { + TPaveText *pt = new TPaveText(.05, .1, .7, .8, "NB"); + pt->SetFillColor(0); + pt->AddText(_sublevel_names[ic - 1]); + pt->Draw(); + TPaveText *pt_geom = new TPaveText(.6, .1, .95, .8, "NB"); + pt_geom->SetFillColor(0); + pt_geom->SetTextSize(0.3); + pt_geom->AddText(TString("x: ") + _reference_name); + pt_geom->AddText(TString("y: ") + _alignment_name + TString(" - ") + _reference_name); + pt_geom->Draw(); + } + // printing + if (_print) + c_global_hist[ic]->Print( + _output_directory + c_global_hist[ic]->GetName() + ExtensionFromPrintOption(_print_option), _print_option); } - - // printing global canvases - if (_write) output->Close(); - - - // Now produce the profile plots if the option is chosen - // Use seperate loops since no seperate plots are produced for different module qualities - if (_make_profile_plots) { - - // Fill Content of 2D-hists into 1D-hists for the profile plots - // Loop over all y-bins for a certain x-bin, calculate mean and RMS as entries of the 1D-hists - bool entries = false; - for (unsigned int ix = 0 ; ix < x.size() ; ix++) - { - for (unsigned int iy = 0 ; iy < y.size() ; iy++) - { - for (unsigned int igraph = 0 ; igraph < NB_SUBLEVELS*NB_Z_SLICES ; igraph++) - { - - // Declare hists which will be plotted for the profile plots - histos[ix][iy][igraph] = new TH1F ("1Dhist"+x[ix]+y[iy]+_sublevel_names[igraph%NB_SUBLEVELS] - +TString(igraph%(NB_SUBLEVELS*NB_Z_SLICES)>=NB_SUBLEVELS ? "n" : "p" ) - +std::to_string(canvas_index), - "",histos2D[ix][iy][igraph]->GetXaxis()->GetNbins(),_min[x[ix]],_max[x[ix]]); - histos[ix][iy][igraph]->SetMarkerColor(COLOR_CODE(igraph)); - histos[ix][iy][igraph]->SetLineColor(COLOR_CODE(igraph)); - histos[ix][iy][igraph]->StatOverflows(kTRUE); - - - // Loop over x bins - for (int binx = 0 ; binx <= histos2D[ix][iy][igraph]->GetXaxis()->GetNbins() ; binx++) - { - entries = false; - // Declare y-histogram for each x bin - histosYValues[ix][iy][igraph] = new TH1F ("1Dhist_Y-Values"+x[ix]+y[iy]+_sublevel_names[igraph%NB_SUBLEVELS] - +TString(igraph%(NB_SUBLEVELS*NB_Z_SLICES)>=NB_SUBLEVELS ? "n" : "p" ) - +std::to_string(canvas_index) - +std::to_string(binx), - "",histos2D[ix][iy][igraph]->GetYaxis()->GetNbins(), - _min[y[iy]], - _max[y[iy]]+1.); - histosYValues[ix][iy][igraph]->StatOverflows(kTRUE); - // Loop over y-bins for each x-bin of the 2D histogram and put it into the 1-d y histograms - // Take overflow bin into account - for (int biny = 0 ; biny <= histos2D[ix][iy][igraph]->GetYaxis()->GetNbins()+1 ; biny++) - { - if (histos2D[ix][iy][igraph]->GetBinContent(binx,biny) > 1.) - { - histosYValues[ix][iy][igraph]->SetBinContent(biny,histos2D[ix][iy][igraph]->GetBinContent(binx,biny)); - entries = true; - } - } - if (entries) - { - histos[ix][iy][igraph]->SetBinContent(binx,histosYValues[ix][iy][igraph]->GetMean()); - histos[ix][iy][igraph]->SetBinError(binx,histosYValues[ix][iy][igraph]->GetRMS()); - } - else histos[ix][iy][igraph]->SetBinContent(binx,-999999.); - - } - - } - - // Customize and print the histograms - - /// TRACKER - // fixing ranges and draw profile plot histos - - c_hist[ix][iy][0] = new TCanvas (TString::Format("c_hist_%s_vs_%s_tracker_%d", x[ix].Data(), - y[iy].Data(), - canvas_index), - TString::Format("Profile plot %s vs. %s at tracker level", x[ix].Data(), - y[iy].Data()), - _window_width, - _window_height); - c_hist[ix][iy][0]->SetGrid(_grid_x,_grid_y); // grid - // Draw the frame that will contain the histograms - // One needs to specify the binning and title - c_hist[ix][iy][0]->GetPad(0)->DrawFrame(_min[x[ix]], - dyMin[iy] != -99999 ? dyMin[iy] : _min[y[iy]], - _max[x[ix]], - dyMax[iy] != -99999 ? dyMax[iy] : _max[y[iy]], - TString (";") + LateXstyle(x[ix]) + " /" + _units[x[ix]] - + TString (";") + LateXstyle(y[iy]) + " /" + _units[y[iy]]); - if (_legend) legend->Draw("same"); - - for (unsigned short int jgraph = 0 ; jgraph < NB_SUBLEVELS*NB_Z_SLICES ; jgraph++) - { - unsigned short int igraph = NB_SUBLEVELS*NB_Z_SLICES - jgraph - 1; // reverse counting for humane readability (one of the sublevel takes much more place than the others) - - // clone to prevent any injure on the graph - histosTracker[ix][iy][igraph] = (TH1F *) histos[ix][iy][igraph]->Clone(); - // color - histosTracker[ix][iy][igraph]->SetMarkerColor(COLOR_CODE(igraph%NB_SUBLEVELS)); - histosTracker[ix][iy][igraph]->SetLineColor(COLOR_CODE(igraph%NB_SUBLEVELS)); - histosTracker[ix][iy][igraph]->SetMarkerStyle(6); - histosTracker[ix][iy][igraph]->Draw("same pe0"); - - } - - if (_print && !_print_only_global) c_hist[ix][iy][0]->Print(_output_directory - + TString::Format("Profile_plot_%s_vs_%s_tracker_%d", x[ix].Data(), y[iy].Data(), canvas_index) - + ExtensionFromPrintOption(_print_option), - _print_option); - - //Draw into profile hists global tracker canvas - c_global_hist[0]->cd(INDEX_IN_GLOBAL_CANVAS(ix,iy)); - c_global_hist[0]->GetPad(INDEX_IN_GLOBAL_CANVAS(ix,iy))->SetFillStyle(4000); // make the pad transparent - c_global_hist[0]->GetPad(INDEX_IN_GLOBAL_CANVAS(ix,iy))->SetGrid(_grid_x,_grid_y); // grid - c_global_hist[0]->GetPad(INDEX_IN_GLOBAL_CANVAS(ix,iy))->DrawFrame(_min[x[ix]], - dyMin[iy] != -99999 ? dyMin[iy] : _min[y[iy]], - _max[x[ix]], - dyMax[iy] != -99999 ? dyMax[iy] : _max[y[iy]], - TString (";") + LateXstyle(x[ix]) + " /" + _units[x[ix]] - + TString (";") + LateXstyle(y[iy]) + " /" + _units[y[iy]]); - - for (unsigned short int jgraph = 0 ; jgraph < NB_SUBLEVELS*NB_Z_SLICES ; jgraph++) - { - unsigned short int igraph = NB_SUBLEVELS*NB_Z_SLICES - jgraph - 1; // reverse counting for humane readability (one of the sublevel takes much more place than the others) - histosTracker[ix][iy][igraph]->Draw("same pe0"); - } - - /// PIXEL - // fixing ranges and draw profile plot histos - - c_hist[ix][iy][7] = new TCanvas (TString::Format("c_hist_%s_vs_%s_pixel_%d", x[ix].Data(), - y[iy].Data(), - canvas_index), - TString::Format("Profile plot %s vs. %s at pixel level", x[ix].Data(), - y[iy].Data()), - _window_width, - _window_height); - c_hist[ix][iy][7]->SetGrid(_grid_x,_grid_y); // grid - // Draw the frame that will contain the histograms - // One needs to specify the binning and title - c_hist[ix][iy][7]->GetPad(0)->DrawFrame(_min[x[ix]], - dyMin[iy] != -99999 ? dyMin[iy] : _min[y[iy]], - _max[x[ix]], - dyMax[iy] != -99999 ? dyMax[iy] : _max[y[iy]], - TString (";") + LateXstyle(x[ix]) + " /" + _units[x[ix]] - + TString (";") + LateXstyle(y[iy]) + " /" + _units[y[iy]]); - if (_legend) legend->Draw("same"); - - for (unsigned short int jgraph = 0 ; jgraph < NB_SUBLEVELS*NB_Z_SLICES ; jgraph++) - { - unsigned short int igraph = NB_SUBLEVELS*NB_Z_SLICES - jgraph - 1; // reverse counting for humane readability (one of the sublevel takes much more place than the others) - - if (igraph%NB_SUBLEVELS == 0 || igraph%NB_SUBLEVELS == 1) //Only BPIX and FPIX - { - // clone to prevent any injure on the graph - histosTracker[ix][iy][igraph] = (TH1F *) histos[ix][iy][igraph]->Clone(); - // color - histosTracker[ix][iy][igraph]->SetMarkerColor(COLOR_CODE(igraph%NB_SUBLEVELS)); - histosTracker[ix][iy][igraph]->SetLineColor(COLOR_CODE(igraph%NB_SUBLEVELS)); - histosTracker[ix][iy][igraph]->SetMarkerStyle(6); - histosTracker[ix][iy][igraph]->Draw("same pe0"); - } - - } - - if (_print && !_print_only_global) c_hist[ix][iy][7]->Print(_output_directory - + TString::Format("Profile_plot_%s_vs_%s_pixel_%d", x[ix].Data(), y[iy].Data(), canvas_index) - + ExtensionFromPrintOption(_print_option), - _print_option); - - //Draw into profile hists global tracker canvas - c_global_hist[7]->cd(INDEX_IN_GLOBAL_CANVAS(ix,iy)); - c_global_hist[7]->GetPad(INDEX_IN_GLOBAL_CANVAS(ix,iy))->SetFillStyle(4000); // make the pad transparent - c_global_hist[7]->GetPad(INDEX_IN_GLOBAL_CANVAS(ix,iy))->SetGrid(_grid_x,_grid_y); // grid - c_global_hist[7]->GetPad(INDEX_IN_GLOBAL_CANVAS(ix,iy))->DrawFrame(_min[x[ix]], - dyMin[iy] != -99999 ? dyMin[iy] : _min[y[iy]], - _max[x[ix]], - dyMax[iy] != -99999 ? dyMax[iy] : _max[y[iy]], - TString (";") + LateXstyle(x[ix]) + " /" + _units[x[ix]] - + TString (";") + LateXstyle(y[iy]) + " /" + _units[y[iy]]); - - for (unsigned short int jgraph = 0 ; jgraph < NB_SUBLEVELS*NB_Z_SLICES ; jgraph++) - { - unsigned short int igraph = NB_SUBLEVELS*NB_Z_SLICES - jgraph - 1; // reverse counting for humane readability (one of the sublevel takes much more place than the others) - histosTracker[ix][iy][igraph]->Draw("same pe0"); - } - // printing will be performed after customisation (e.g. legend or title) just after the loops on ix and iy - /// SUBLEVELS (1..6) - for (unsigned int isublevel = 1 ; isublevel <= NB_SUBLEVELS ; isublevel++) - { - - // Draw and print profile histograms - c_hist[ix][iy][isublevel] = new TCanvas (TString::Format("c_hist_%s_vs_%s_%s_%d", x[ix].Data(), - y[iy].Data(), - isublevel==0?"tracker":_sublevel_names[isublevel-1].Data(), - canvas_index), - TString::Format("Profile plot %s vs. %s at %s level", x[ix].Data(), - y[iy].Data(), - isublevel==0?"tracker":_sublevel_names[isublevel-1].Data()), - _window_width, - _window_height); - c_hist[ix][iy][isublevel]->SetGrid(_grid_x,_grid_y); // grid - c_hist[ix][iy][isublevel]->GetPad(0)->DrawFrame(_min[x[ix]], - dyMin[iy] != -99999 ? dyMin[iy] : _min[y[iy]], - _max[x[ix]], - dyMax[iy] != -99999 ? dyMax[iy] : _max[y[iy]], - TString (";") + LateXstyle(x[ix]) + " /" + _units[x[ix]] - + TString (";") + LateXstyle(y[iy]) + " /" + _units[y[iy]]); - - histos[ix][iy][ isublevel-1]->SetMarkerColor(kBlack); - histos[ix][iy][ isublevel-1]->SetLineColor(kBlack); - histos[ix][iy][NB_SUBLEVELS+isublevel-1]->SetMarkerColor(kRed); - histos[ix][iy][NB_SUBLEVELS+isublevel-1]->SetLineColor(kRed); - - - histos[ix][iy][ isublevel-1]->Draw("same pe0"); - histos[ix][iy][NB_SUBLEVELS+isublevel-1]->Draw("same pe0"); - - if (_print && !_print_only_global) c_hist[ix][iy][isublevel]->Print(_output_directory - + TString::Format("Profile_plot_%s_vs_%s_%s_%d", x[ix].Data(), y[iy].Data(),_sublevel_names[isublevel-1].Data(), canvas_index) - + ExtensionFromPrintOption(_print_option), - _print_option); - - // draw into global canvas - // printing will be performed after customisation (e.g. legend or title) just after the loops on ix and iy - c_global_hist[isublevel]->cd(INDEX_IN_GLOBAL_CANVAS(ix,iy)); - c_global_hist[isublevel]->GetPad(INDEX_IN_GLOBAL_CANVAS(ix,iy))->SetFillStyle(4000); // make the pad transparent - c_global_hist[isublevel]->GetPad(INDEX_IN_GLOBAL_CANVAS(ix,iy))->SetGrid(_grid_x,_grid_y); // grid - c_global_hist[isublevel]->GetPad(INDEX_IN_GLOBAL_CANVAS(ix,iy))->DrawFrame(_min[x[ix]], - dyMin[iy] != -99999 ? dyMin[iy] : _min[y[iy]], - _max[x[ix]], - dyMax[iy] != -99999 ? dyMax[iy] : _max[y[iy]], - TString (";") + LateXstyle(x[ix]) + " /" + _units[x[ix]] - + TString (";") + LateXstyle(y[iy]) + " /" + _units[y[iy]]); - - - histos[ix][iy][ isublevel-1]->Draw("same pe0"); - histos[ix][iy][NB_SUBLEVELS+isublevel-1]->Draw("same pe0"); - } - - } // end of loop on y - } // end of loop on x - - - - // CUSTOMISATION - gStyle->SetOptTitle(0); // otherwise, the title is repeated in every pad of the global canvases - // -> instead, we will write it in the upper part in a TPaveText or in a TLegend - for (unsigned int ic = 0 ; ic <= NB_SUBLEVELS ; ic++) - { - // setting legend to tracker canvases - if (!_legend) break; - - // setting legend to tracker canvases - if (!_legend) break; - TCanvas * c_temp_hist = (TCanvas *) c_global_hist[ic]->Clone(c_global_hist[ic]->GetTitle() + TString("_sub")); - c_temp_hist->Draw(); - c_global_hist[ic] = new TCanvas (c_temp_hist->GetName() + TString("_final"), c_temp_hist->GetTitle(), c_temp_hist->GetWindowWidth(), c_temp_hist->GetWindowHeight()); - c_global_hist[ic]->Draw(); - TPad * p_up = new TPad (TString("legend_") + c_temp_hist->GetName(), "", - 0., 0.9, 1., 1., // relative position - -1, 0, 0), // display options - * p_down = new TPad (TString("main_") + c_temp_hist->GetName(), "", - 0., 0., 1., 0.9, - -1, 0, 0); - // in the lower part, draw the plots - p_down->Draw(); - p_down->cd(); - c_temp_hist->DrawClonePad(); - c_global_hist[ic]->cd(); - // in the upper part, pimp the canvas :p - p_up->Draw(); - p_up->cd(); - if (ic == 0) // tracker - { - TLegend * global_legend = MakeLegend(.05,.1,.7,.8,NB_SUBLEVELS);//, "brNDC"); - global_legend->Draw(); - TPaveText * pt_geom = new TPaveText(.75,.1,.95,.8, "NB"); - pt_geom->SetFillColor(0); - pt_geom->SetTextSize(0.25); - pt_geom->AddText(TString("x: ")+_reference_name); - pt_geom->AddText(TString("y: ")+_alignment_name+TString(" - ")+_reference_name); - pt_geom->Draw(); - } - else if (ic == 7) // pixel - { - TLegend * global_legend = MakeLegend(.05,.1,.7,.8,2);//, "brNDC"); - global_legend->Draw(); - TPaveText * pt_geom = new TPaveText(.75,.1,.95,.8, "NB"); - pt_geom->SetFillColor(0); - pt_geom->SetTextSize(0.25); - pt_geom->AddText(TString("x: ")+_reference_name); - pt_geom->AddText(TString("y: ")+_alignment_name+TString(" - ")+_reference_name); - pt_geom->Draw(); - } - else // sublevels - { - TPaveText * pt = new TPaveText(.05,.1,.7,.8, "NB"); - pt->SetFillColor(0); - pt->AddText(_sublevel_names[ic-1]); - pt->Draw(); - TPaveText * pt_geom = new TPaveText(.6,.1,.95,.8, "NB"); - pt_geom->SetFillColor(0); - pt_geom->SetTextSize(0.3); - pt_geom->AddText(TString("x: ")+_reference_name); - pt_geom->AddText(TString("y: ")+_alignment_name+TString(" - ")+_reference_name); - pt_geom->Draw(); - } - // printing - if (_print) c_global_hist[ic]->Print(_output_directory + c_global_hist[ic]->GetName() + ExtensionFromPrintOption(_print_option), _print_option); - } - - } - + } + #ifdef TALKATIVE - cout << __FILE__ << ":" << __LINE__ << ":Info: End of MakePlots method" << endl; + cout << __FILE__ << ":" << __LINE__ << ":Info: End of MakePlots method" << endl; #endif - } - // Make additional table for the mean/RMS values of differences -void GeometryComparisonPlotter::MakeTables (vector x, // axes to combine to plot - vector y, // only requires the differences (y values in the plots) and ranges - vector dyMin, // Minimum of y-variable to enable fixed ranges of the histogram - vector dyMax) // Maximum of y-variable to enable fixed ranges of the histogram +void GeometryComparisonPlotter::MakeTables( + vector x, // axes to combine to plot + vector y, // only requires the differences (y values in the plots) and ranges + vector dyMin, // Minimum of y-variable to enable fixed ranges of the histogram + vector dyMax) // Maximum of y-variable to enable fixed ranges of the histogram { - - /// -1) check that only existing branches are called - // (we use a macro to avoid copy/paste) -#define CHECK_BRANCHES(branchname_vector) \ - for (unsigned int i = 0 ; i < branchname_vector.size() ; i++) \ - { \ - if (branch_f.find(branchname_vector[i]) == branch_f.end()) \ - { \ - cout << __FILE__ << ":" << __LINE__ << ":Error: The branch " << branchname_vector[i] << " is not recognised." << endl; \ - return; \ - } \ - } - CHECK_BRANCHES(x); - CHECK_BRANCHES(y); - - const unsigned int nentries = data->GetEntries(); + /// -1) check that only existing branches are called + // (we use a macro to avoid copy/paste) +#define CHECK_BRANCHES(branchname_vector) \ + for (unsigned int i = 0; i < branchname_vector.size(); i++) { \ + if (branch_f.find(branchname_vector[i]) == branch_f.end()) { \ + cout << __FILE__ << ":" << __LINE__ << ":Error: The branch " << branchname_vector[i] << " is not recognised." \ + << endl; \ + return; \ + } \ + } + CHECK_BRANCHES(x); + CHECK_BRANCHES(y); + + const unsigned int nentries = data->GetEntries(); #ifdef TALKATIVE - cout << __FILE__ << ":" << __LINE__ << ":Info: "; INSIDE_VECTOR(x); cout << endl; - cout << __FILE__ << ":" << __LINE__ << ":Info: "; INSIDE_VECTOR(y); cout << endl; + cout << __FILE__ << ":" << __LINE__ << ":Info: "; + INSIDE_VECTOR(x); + cout << endl; + cout << __FILE__ << ":" << __LINE__ << ":Info: "; + INSIDE_VECTOR(y); + cout << endl; #endif + /// 0) min and max values + // the max and min of the graphs are computed from the tree if they have not been manually input yet + // (we use a macro to avoid copy/paste) +#define LIMITS(axes_vector) \ + for (unsigned int i = 0; i < axes_vector.size(); i++) { \ + if (_SF.find(axes_vector[i]) == _SF.end()) \ + _SF[axes_vector[i]] = 1.; \ + if (_min.find(axes_vector[i]) == _min.end()) \ + _min[axes_vector[i]] = _SF[axes_vector[i]] * data->GetMinimum(axes_vector[i]); \ + if (_max.find(axes_vector[i]) == _max.end()) \ + _max[axes_vector[i]] = _SF[axes_vector[i]] * data->GetMaximum(axes_vector[i]); \ + } + LIMITS(x); + LIMITS(y); - /// 0) min and max values - // the max and min of the graphs are computed from the tree if they have not been manually input yet - // (we use a macro to avoid copy/paste) -#define LIMITS(axes_vector) \ - for (unsigned int i = 0 ; i < axes_vector.size() ; i++) \ - { \ - if ( _SF.find(axes_vector[i]) == _SF.end()) _SF[axes_vector[i]] = 1.; \ - if (_min.find(axes_vector[i]) == _min.end()) _min[axes_vector[i]] = _SF[axes_vector[i]]*data->GetMinimum(axes_vector[i]); \ - if (_max.find(axes_vector[i]) == _max.end()) _max[axes_vector[i]] = _SF[axes_vector[i]]*data->GetMaximum(axes_vector[i]); \ - } - LIMITS(x); - LIMITS(y); - -#ifdef TALKATIVE - CHECK_MAP_CONTENT(_min,float); - CHECK_MAP_CONTENT(_max,float); - CHECK_MAP_CONTENT(_SF ,float); +#ifdef TALKATIVE + CHECK_MAP_CONTENT(_min, float); + CHECK_MAP_CONTENT(_max, float); + CHECK_MAP_CONTENT(_SF, float); #endif - /// 1) declare histograms - // the idea is to produce tables of the differences and the absolute positions containing mean and RMS values - // for the different subdetectors - 0..5=different sublevels. - // Values for each endcap detector are to be split in +/-z, for the barrel detectors in +/- x (half barrels) - // Since it is easier to handle in the loops, all subdetectors will be split in - // 4 parts at first: (+/-x)X(+/-z) - // This means that 2*2*6 histograms will be filled during the loop on the TTree - // Pairs of histograms need to be combined afterwards again - // Histograms 0-5 are at +x and +z, 6-11 at +x and -z, 12-17 at -x and +z, and 18-23 at -x and -z - // - // Two version of the table containing the differences are produced. Once using Gaussian fits (more stable - // vs single outliers but perform poorly if the distributions are non-Gaussian) and once using - // the mean and RMS of the histograms (more stable but outliers have a strong impact on the RMS). - // For the absolute positions, only mean+RMS are used since the detector layout is not Gaussian - // (structures due to layers/rings etc) + /// 1) declare histograms + // the idea is to produce tables of the differences and the absolute positions containing mean and RMS values + // for the different subdetectors - 0..5=different sublevels. + // Values for each endcap detector are to be split in +/-z, for the barrel detectors in +/- x (half barrels) + // Since it is easier to handle in the loops, all subdetectors will be split in + // 4 parts at first: (+/-x)X(+/-z) + // This means that 2*2*6 histograms will be filled during the loop on the TTree + // Pairs of histograms need to be combined afterwards again + // Histograms 0-5 are at +x and +z, 6-11 at +x and -z, 12-17 at -x and +z, and 18-23 at -x and -z + // + // Two version of the table containing the differences are produced. Once using Gaussian fits (more stable + // vs single outliers but perform poorly if the distributions are non-Gaussian) and once using + // the mean and RMS of the histograms (more stable but outliers have a strong impact on the RMS). + // For the absolute positions, only mean+RMS are used since the detector layout is not Gaussian + // (structures due to layers/rings etc) #ifndef NB_SUBLEVELS #define NB_SUBLEVELS 6 #endif #define NB_Z_SLICES 2 #define NB_X_SLICES 2 - - TH1F * histosx[x.size()][NB_SUBLEVELS*NB_Z_SLICES*NB_X_SLICES]; - float meanValuex[x.size()][NB_SUBLEVELS*NB_Z_SLICES*NB_X_SLICES]; - float RMSx[x.size()][NB_SUBLEVELS*NB_Z_SLICES*NB_X_SLICES]; - - TH1F * histos[y.size()][NB_SUBLEVELS*NB_Z_SLICES*NB_X_SLICES]; - TF1 * gausFit[y.size()][NB_SUBLEVELS*NB_Z_SLICES*NB_X_SLICES]; - float meanValue[y.size()][NB_SUBLEVELS*NB_Z_SLICES*NB_X_SLICES]; - float meanValueGaussian[y.size()][NB_SUBLEVELS*NB_Z_SLICES*NB_X_SLICES]; - float RMS[y.size()][NB_SUBLEVELS*NB_Z_SLICES*NB_X_SLICES]; - float RMSGaussian[y.size()][NB_SUBLEVELS*NB_Z_SLICES*NB_X_SLICES]; - - for (unsigned int iy = 0 ; iy < y.size() ; iy++) - { - for (unsigned int ihist = 0 ; ihist < NB_SUBLEVELS*NB_Z_SLICES*NB_X_SLICES ; ihist++) - { - - // Create and correctly name a histogram for each subdetector*Z_Slice*X_Slice - histos[iy][ihist] = new TH1F ("hist"+y[iy]+_sublevel_names[ihist%NB_SUBLEVELS] - +TString(ihist%(NB_SUBLEVELS*NB_Z_SLICES)>=NB_SUBLEVELS ? "zn" : "zp" ) - +TString(ihist>=NB_SUBLEVELS*NB_Z_SLICES ? "xn" : "xp" ), - "",1000, - _min[y[iy]], - _max[y[iy]]+1.); - histos[iy][ihist]->StatOverflows(kTRUE); - - } - } - - for (unsigned int ix = 0 ; ix < x.size() ; ix++) - { - for (unsigned int ihist = 0 ; ihist < NB_SUBLEVELS*NB_Z_SLICES*NB_X_SLICES ; ihist++) - { - - // Create and correctly name a histogram for each subdetector*Z_Slice*ModuleType - histosx[ix][ihist] = new TH1F ("histx"+x[ix]+_sublevel_names[ihist%NB_SUBLEVELS] - +TString(ihist%(NB_SUBLEVELS*NB_Z_SLICES)>=NB_SUBLEVELS ? "zn" : "zp" ) - +TString(ihist>=NB_SUBLEVELS*NB_Z_SLICES ? "xn" : "xp" ), - "",1000, - _min[x[ix]], - _max[x[ix]]+1.); - histosx[ix][ihist]->StatOverflows(kTRUE); - - } - } + + TH1F *histosx[x.size()][NB_SUBLEVELS * NB_Z_SLICES * NB_X_SLICES]; + float meanValuex[x.size()][NB_SUBLEVELS * NB_Z_SLICES * NB_X_SLICES]; + float RMSx[x.size()][NB_SUBLEVELS * NB_Z_SLICES * NB_X_SLICES]; + + TH1F *histos[y.size()][NB_SUBLEVELS * NB_Z_SLICES * NB_X_SLICES]; + TF1 *gausFit[y.size()][NB_SUBLEVELS * NB_Z_SLICES * NB_X_SLICES]; + float meanValue[y.size()][NB_SUBLEVELS * NB_Z_SLICES * NB_X_SLICES]; + float meanValueGaussian[y.size()][NB_SUBLEVELS * NB_Z_SLICES * NB_X_SLICES]; + float RMS[y.size()][NB_SUBLEVELS * NB_Z_SLICES * NB_X_SLICES]; + float RMSGaussian[y.size()][NB_SUBLEVELS * NB_Z_SLICES * NB_X_SLICES]; + + for (unsigned int iy = 0; iy < y.size(); iy++) { + for (unsigned int ihist = 0; ihist < NB_SUBLEVELS * NB_Z_SLICES * NB_X_SLICES; ihist++) { + // Create and correctly name a histogram for each subdetector*Z_Slice*X_Slice + histos[iy][ihist] = new TH1F("hist" + y[iy] + _sublevel_names[ihist % NB_SUBLEVELS] + + TString(ihist % (NB_SUBLEVELS * NB_Z_SLICES) >= NB_SUBLEVELS ? "zn" : "zp") + + TString(ihist >= NB_SUBLEVELS * NB_Z_SLICES ? "xn" : "xp"), + "", + 1000, + _min[y[iy]], + _max[y[iy]] + 1.); + histos[iy][ihist]->StatOverflows(kTRUE); + } + } + + for (unsigned int ix = 0; ix < x.size(); ix++) { + for (unsigned int ihist = 0; ihist < NB_SUBLEVELS * NB_Z_SLICES * NB_X_SLICES; ihist++) { + // Create and correctly name a histogram for each subdetector*Z_Slice*ModuleType + histosx[ix][ihist] = new TH1F("histx" + x[ix] + _sublevel_names[ihist % NB_SUBLEVELS] + + TString(ihist % (NB_SUBLEVELS * NB_Z_SLICES) >= NB_SUBLEVELS ? "zn" : "zp") + + TString(ihist >= NB_SUBLEVELS * NB_Z_SLICES ? "xn" : "xp"), + "", + 1000, + _min[x[ix]], + _max[x[ix]] + 1.); + histosx[ix][ihist]->StatOverflows(kTRUE); + } + } #ifdef DEBUG - cout << __FILE__ << ":" << __LINE__ << ":Info: Creation of the TH1F[" << y.size() << "][" << NB_SUBLEVELS*NB_Z_SLICES*NB_X_SLICES << "] ended." << endl; + cout << __FILE__ << ":" << __LINE__ << ":Info: Creation of the TH1F[" << y.size() << "][" + << NB_SUBLEVELS * NB_Z_SLICES * NB_X_SLICES << "] ended." << endl; #endif - /// 2) loop on the TTree data + /// 2) loop on the TTree data #ifdef DEBUG - cout << __FILE__ << ":" << __LINE__ << ":Info: Looping on the TTree" << endl; + cout << __FILE__ << ":" << __LINE__ << ":Info: Looping on the TTree" << endl; #endif #ifdef TALKATIVE - unsigned int progress = 0; - cout << __FILE__ << ":" << __LINE__ << ":Info: 0%" << endl; + unsigned int progress = 0; + cout << __FILE__ << ":" << __LINE__ << ":Info: 0%" << endl; #endif - for (unsigned int ientry = 0 ; ientry < nentries ; ientry++) - { -#ifdef TALKATIVE - if (10*ientry/nentries != progress) - { - progress = 10*ientry/nentries; - cout << __FILE__ << ":" << __LINE__ << ":Info: " << 10*progress << "%" << endl; - } + for (unsigned int ientry = 0; ientry < nentries; ientry++) { +#ifdef TALKATIVE + if (10 * ientry / nentries != progress) { + progress = 10 * ientry / nentries; + cout << __FILE__ << ":" << __LINE__ << ":Info: " << 10 * progress << "%" << endl; + } #endif - // load current tree entry - data->GetEntry(ientry); - - // CUTS on entry - if (branch_i["level"] != _levelCut) continue; - if (!_1dModule && branch_i["detDim"] == 1) continue; - if (!_2dModule && branch_i["detDim"] == 2) continue; - - - for (unsigned int iy = 0 ; iy < y.size() ; iy++) - { - if (branch_i["sublevel"] < 1 || branch_i["sublevel"] > NB_SUBLEVELS) continue; - if (_SF[y[iy]]*branch_f[y[iy]] > _max[y[iy]] || _SF[y[iy]]*branch_f[y[iy]] < _min[y[iy]]) - { -//#ifdef DEBUG -// cout << "branch_f[y[iy]]=" << branch_f[y[iy]] << endl; -//#endif - continue; - } - - // FILLING HISTOGRAMS - - // histogram for all modules - const short int ihisto = (branch_i["sublevel"]-1) + (branch_f["z"]>=0?0:NB_SUBLEVELS) + (branch_f["x"]>=0?0:NB_SUBLEVELS*NB_Z_SLICES); - - if (_module_plot_option == "all") histos[iy][ihisto]->Fill( _SF[y[iy]]*branch_f[y[iy]]); - - // Only good modules - else if (_module_plot_option == "good" && branch_i["badModuleQuality"]==0) histos[iy][ihisto]->Fill( _SF[y[iy]]*branch_f[y[iy]]); - - // Only good modules and those in the list - else if (_module_plot_option == "list" && (branch_i["inModuleList"]==1 || branch_i["badModuleQuality"]==0)) histos[iy][ihisto]->Fill( _SF[y[iy]]*branch_f[y[iy]]); - - } - - for (unsigned int ix = 0 ; ix < x.size() ; ix++) - { - if (branch_i["sublevel"] < 1 || branch_i["sublevel"] > NB_SUBLEVELS) continue; - if (_SF[x[ix]]*branch_f[x[ix]] > _max[x[ix]] || _SF[x[ix]]*branch_f[x[ix]] < _min[x[ix]]) - { -//#ifdef DEBUG -// cout << "branch_f[y[iy]]=" << branch_f[y[iy]] << endl; -//#endif - continue; - } - - // FILLING HISTOGRAMS - - // histogram for all modules - const short int ihistosx = (branch_i["sublevel"]-1) + (branch_f["z"]>=0?0:NB_SUBLEVELS) + (branch_f["x"]>=0?0:NB_SUBLEVELS*NB_Z_SLICES); - - if (_module_plot_option == "all") histosx[ix][ihistosx]->Fill( _SF[x[ix]]*branch_f[x[ix]]); - - // Only good modules - else if (_module_plot_option == "good" && branch_i["badModuleQuality"]==0) histosx[ix][ihistosx]->Fill( _SF[x[ix]]*branch_f[x[ix]]); - - // Only good modules and those in the list - else if (_module_plot_option == "list" && (branch_i["inModuleList"]==1 || branch_i["badModuleQuality"]==0)) histosx[ix][ihistosx]->Fill( _SF[x[ix]]*branch_f[x[ix]]); - - } + // load current tree entry + data->GetEntry(ientry); + + // CUTS on entry + if (branch_i["level"] != _levelCut) + continue; + if (!_1dModule && branch_i["detDim"] == 1) + continue; + if (!_2dModule && branch_i["detDim"] == 2) + continue; + + for (unsigned int iy = 0; iy < y.size(); iy++) { + if (branch_i["sublevel"] < 1 || branch_i["sublevel"] > NB_SUBLEVELS) + continue; + if (_SF[y[iy]] * branch_f[y[iy]] > _max[y[iy]] || _SF[y[iy]] * branch_f[y[iy]] < _min[y[iy]]) { + //#ifdef DEBUG + // cout << "branch_f[y[iy]]=" << branch_f[y[iy]] << endl; + //#endif + continue; + } + + // FILLING HISTOGRAMS + + // histogram for all modules + const short int ihisto = (branch_i["sublevel"] - 1) + (branch_f["z"] >= 0 ? 0 : NB_SUBLEVELS) + + (branch_f["x"] >= 0 ? 0 : NB_SUBLEVELS * NB_Z_SLICES); + + if (_module_plot_option == "all") + histos[iy][ihisto]->Fill(_SF[y[iy]] * branch_f[y[iy]]); + + // Only good modules + else if (_module_plot_option == "good" && branch_i["badModuleQuality"] == 0) + histos[iy][ihisto]->Fill(_SF[y[iy]] * branch_f[y[iy]]); + + // Only good modules and those in the list + else if (_module_plot_option == "list" && (branch_i["inModuleList"] == 1 || branch_i["badModuleQuality"] == 0)) + histos[iy][ihisto]->Fill(_SF[y[iy]] * branch_f[y[iy]]); + } + + for (unsigned int ix = 0; ix < x.size(); ix++) { + if (branch_i["sublevel"] < 1 || branch_i["sublevel"] > NB_SUBLEVELS) + continue; + if (_SF[x[ix]] * branch_f[x[ix]] > _max[x[ix]] || _SF[x[ix]] * branch_f[x[ix]] < _min[x[ix]]) { + //#ifdef DEBUG + // cout << "branch_f[y[iy]]=" << branch_f[y[iy]] << endl; + //#endif + continue; + } + + // FILLING HISTOGRAMS + + // histogram for all modules + const short int ihistosx = (branch_i["sublevel"] - 1) + (branch_f["z"] >= 0 ? 0 : NB_SUBLEVELS) + + (branch_f["x"] >= 0 ? 0 : NB_SUBLEVELS * NB_Z_SLICES); + + if (_module_plot_option == "all") + histosx[ix][ihistosx]->Fill(_SF[x[ix]] * branch_f[x[ix]]); + + // Only good modules + else if (_module_plot_option == "good" && branch_i["badModuleQuality"] == 0) + histosx[ix][ihistosx]->Fill(_SF[x[ix]] * branch_f[x[ix]]); + + // Only good modules and those in the list + else if (_module_plot_option == "list" && (branch_i["inModuleList"] == 1 || branch_i["badModuleQuality"] == 0)) + histosx[ix][ihistosx]->Fill(_SF[x[ix]] * branch_f[x[ix]]); } + } #ifdef TALKATIVE - cout << __FILE__ << ":" << __LINE__ << ":Info: 100%\tLoop ended" << endl; + cout << __FILE__ << ":" << __LINE__ << ":Info: 100%\tLoop ended" << endl; #endif - //~ TString rangeLabel = ""; - // Calculate mean and standard deviation for each histogram - for (unsigned int iy = 0 ; iy < y.size() ; iy++) - { - - for (unsigned int ihist = 0 ; ihist < NB_SUBLEVELS*NB_Z_SLICES*NB_X_SLICES ; ihist++) - { - // combine +/-z histograms for barrel detectors - if (ihist%(NB_SUBLEVELS*NB_Z_SLICES) == 0 || ihist%(NB_SUBLEVELS*NB_Z_SLICES) == 2 || ihist%(NB_SUBLEVELS*NB_Z_SLICES) == 4) { - histos[iy][ihist]->Add(histos[iy][ihist+NB_SUBLEVELS]); - } - // combine +/-x histograms for endcap detectors (only used for half shells in barrel) - if (ihist < NB_SUBLEVELS*NB_Z_SLICES && ( ihist%NB_SUBLEVELS == 1 || ihist%NB_SUBLEVELS == 3 || ihist%NB_SUBLEVELS == 5)) { - histos[iy][ihist]->Add(histos[iy][ihist+NB_SUBLEVELS*NB_Z_SLICES]); - } - meanValue[iy][ihist] = histos[iy][ihist]->GetMean(); - RMS[iy][ihist] = histos[iy][ihist]->GetRMS(); - - histos[iy][ihist]->Fit("gaus"); - gausFit[iy][ihist] = histos[iy][ihist]->GetFunction("gaus"); - meanValueGaussian[iy][ihist] = gausFit[iy][ihist]->GetParameter(1); - RMSGaussian[iy][ihist] = gausFit[iy][ihist]->GetParameter(2); - - - - } - } - - for (unsigned int ix = 0 ; ix < x.size() ; ix++) - { - - for (unsigned int ihist = 0 ; ihist < NB_SUBLEVELS*NB_Z_SLICES*NB_X_SLICES ; ihist++) - { - // combine +/-z histograms for barrel detectors - if (ihist%(NB_SUBLEVELS*NB_Z_SLICES) == 0 || ihist%(NB_SUBLEVELS*NB_Z_SLICES) == 2 || ihist%(NB_SUBLEVELS*NB_Z_SLICES) == 4) { - histosx[ix][ihist]->Add(histosx[ix][ihist+NB_SUBLEVELS]); - } - // combine +/-x histograms for endcap detectors (only used for half shells in barrel) - if (ihist < NB_SUBLEVELS*NB_Z_SLICES && ( ihist%NB_SUBLEVELS == 1 || ihist%NB_SUBLEVELS == 3 || ihist%NB_SUBLEVELS == 5) ) { - histosx[ix][ihist]->Add(histosx[ix][ihist+NB_SUBLEVELS*NB_Z_SLICES]); - } - meanValuex[ix][ihist] = histosx[ix][ihist]->GetMean(); - RMSx[ix][ihist] = histosx[ix][ihist]->GetRMS(); - - } - } - - TString tableFileName,tableCaption,tableAlign,tableHeadline; - TString PXBpLine,PXBmLine,PXFpLine,PXFmLine,TIBpLine,TIBmLine,TOBpLine,TOBmLine,TIDpLine,TIDmLine,TECpLine,TECmLine; - - - // table using mean and RMS, round to integers in µm etc. - tableFileName = "table_differences.tex"; - if (_module_plot_option == "all") tableCaption = "Means and standard deviations of "+_alignment_name+" - "+_reference_name+" for each subdetector, all modules used."; - else if (_module_plot_option == "good") tableCaption = "Means and standard deviations of "+_alignment_name+" - "+_reference_name+" for each subdetector, only good modules used."; - else if (_module_plot_option == "list") tableCaption = "Means and standard deviations of "+_alignment_name+" - "+_reference_name+" for each subdetector, good modules and those in given list used."; - - WriteTable(y,NB_SUBLEVELS*NB_Z_SLICES*NB_X_SLICES,meanValue,RMS,"0",tableCaption,tableFileName); - - - //~ // table using Gaussian fit, round to integers in µm etc. - tableFileName = "table_differences_Gaussian.tex"; - if (_module_plot_option == "all") tableCaption = "Means and standard deviations for Gaussian fit of "+_alignment_name+" - "+_reference_name+" for each subdetector, all modules used."; - else if (_module_plot_option == "good") tableCaption = "Means and standard deviations for Gaussian fit of "+_alignment_name+" - "+_reference_name+" for each subdetector, only good modules used."; - else if (_module_plot_option == "list") tableCaption = "Means and standard deviations for Gaussian fit of "+_alignment_name+" - "+_reference_name+" for each subdetector, good modules and those in given list used."; - - - WriteTable(y,NB_SUBLEVELS*NB_Z_SLICES*NB_X_SLICES,meanValueGaussian,RMSGaussian,"0",tableCaption,tableFileName); - - - - // Table for the mean positions on the x-axis, round to 3 digits in cm etc. - tableFileName = "table_meanPos.tex"; - - if (_module_plot_option == "all") tableCaption = "Mean positions and standard deviations in "+_reference_name+" geometry for each subdetector, all modules used."; - else if (_module_plot_option == "good") tableCaption = "Mean positions and standard deviations in "+_reference_name+" geometry for each subdetector, only good modules used."; - else if (_module_plot_option == "list") tableCaption = "Mean positions and standard deviations in "+_reference_name+" geometry for each subdetector, good modules and those in given list used."; - - WriteTable(x,NB_SUBLEVELS*NB_Z_SLICES*NB_X_SLICES,meanValuex,RMSx,"3",tableCaption,tableFileName); - - + //~ TString rangeLabel = ""; + // Calculate mean and standard deviation for each histogram + for (unsigned int iy = 0; iy < y.size(); iy++) { + for (unsigned int ihist = 0; ihist < NB_SUBLEVELS * NB_Z_SLICES * NB_X_SLICES; ihist++) { + // combine +/-z histograms for barrel detectors + if (ihist % (NB_SUBLEVELS * NB_Z_SLICES) == 0 || ihist % (NB_SUBLEVELS * NB_Z_SLICES) == 2 || + ihist % (NB_SUBLEVELS * NB_Z_SLICES) == 4) { + histos[iy][ihist]->Add(histos[iy][ihist + NB_SUBLEVELS]); + } + // combine +/-x histograms for endcap detectors (only used for half shells in barrel) + if (ihist < NB_SUBLEVELS * NB_Z_SLICES && + (ihist % NB_SUBLEVELS == 1 || ihist % NB_SUBLEVELS == 3 || ihist % NB_SUBLEVELS == 5)) { + histos[iy][ihist]->Add(histos[iy][ihist + NB_SUBLEVELS * NB_Z_SLICES]); + } + meanValue[iy][ihist] = histos[iy][ihist]->GetMean(); + RMS[iy][ihist] = histos[iy][ihist]->GetRMS(); + + histos[iy][ihist]->Fit("gaus"); + gausFit[iy][ihist] = histos[iy][ihist]->GetFunction("gaus"); + meanValueGaussian[iy][ihist] = gausFit[iy][ihist]->GetParameter(1); + RMSGaussian[iy][ihist] = gausFit[iy][ihist]->GetParameter(2); + } + } + + for (unsigned int ix = 0; ix < x.size(); ix++) { + for (unsigned int ihist = 0; ihist < NB_SUBLEVELS * NB_Z_SLICES * NB_X_SLICES; ihist++) { + // combine +/-z histograms for barrel detectors + if (ihist % (NB_SUBLEVELS * NB_Z_SLICES) == 0 || ihist % (NB_SUBLEVELS * NB_Z_SLICES) == 2 || + ihist % (NB_SUBLEVELS * NB_Z_SLICES) == 4) { + histosx[ix][ihist]->Add(histosx[ix][ihist + NB_SUBLEVELS]); + } + // combine +/-x histograms for endcap detectors (only used for half shells in barrel) + if (ihist < NB_SUBLEVELS * NB_Z_SLICES && + (ihist % NB_SUBLEVELS == 1 || ihist % NB_SUBLEVELS == 3 || ihist % NB_SUBLEVELS == 5)) { + histosx[ix][ihist]->Add(histosx[ix][ihist + NB_SUBLEVELS * NB_Z_SLICES]); + } + meanValuex[ix][ihist] = histosx[ix][ihist]->GetMean(); + RMSx[ix][ihist] = histosx[ix][ihist]->GetRMS(); + } + } + + TString tableFileName, tableCaption, tableAlign, tableHeadline; + TString PXBpLine, PXBmLine, PXFpLine, PXFmLine, TIBpLine, TIBmLine, TOBpLine, TOBmLine, TIDpLine, TIDmLine, TECpLine, + TECmLine; + + // table using mean and RMS, round to integers in µm etc. + tableFileName = "table_differences.tex"; + if (_module_plot_option == "all") + tableCaption = "Means and standard deviations of " + _alignment_name + " - " + _reference_name + + " for each subdetector, all modules used."; + else if (_module_plot_option == "good") + tableCaption = "Means and standard deviations of " + _alignment_name + " - " + _reference_name + + " for each subdetector, only good modules used."; + else if (_module_plot_option == "list") + tableCaption = "Means and standard deviations of " + _alignment_name + " - " + _reference_name + + " for each subdetector, good modules and those in given list used."; + + WriteTable(y, NB_SUBLEVELS * NB_Z_SLICES * NB_X_SLICES, meanValue, RMS, "0", tableCaption, tableFileName); + + //~ // table using Gaussian fit, round to integers in µm etc. + tableFileName = "table_differences_Gaussian.tex"; + if (_module_plot_option == "all") + tableCaption = "Means and standard deviations for Gaussian fit of " + _alignment_name + " - " + _reference_name + + " for each subdetector, all modules used."; + else if (_module_plot_option == "good") + tableCaption = "Means and standard deviations for Gaussian fit of " + _alignment_name + " - " + _reference_name + + " for each subdetector, only good modules used."; + else if (_module_plot_option == "list") + tableCaption = "Means and standard deviations for Gaussian fit of " + _alignment_name + " - " + _reference_name + + " for each subdetector, good modules and those in given list used."; + + WriteTable( + y, NB_SUBLEVELS * NB_Z_SLICES * NB_X_SLICES, meanValueGaussian, RMSGaussian, "0", tableCaption, tableFileName); + + // Table for the mean positions on the x-axis, round to 3 digits in cm etc. + tableFileName = "table_meanPos.tex"; + + if (_module_plot_option == "all") + tableCaption = "Mean positions and standard deviations in " + _reference_name + + " geometry for each subdetector, all modules used."; + else if (_module_plot_option == "good") + tableCaption = "Mean positions and standard deviations in " + _reference_name + + " geometry for each subdetector, only good modules used."; + else if (_module_plot_option == "list") + tableCaption = "Mean positions and standard deviations in " + _reference_name + + " geometry for each subdetector, good modules and those in given list used."; + + WriteTable(x, NB_SUBLEVELS * NB_Z_SLICES * NB_X_SLICES, meanValuex, RMSx, "3", tableCaption, tableFileName); + #ifdef TALKATIVE - cout << __FILE__ << ":" << __LINE__ << ":Info: End of MakeLegends method" << endl; + cout << __FILE__ << ":" << __LINE__ << ":Info: End of MakeLegends method" << endl; #endif - } // OPTION METHODS -void GeometryComparisonPlotter::SetPrint (const bool kPrint) { _print = kPrint ; } -void GeometryComparisonPlotter::SetLegend (const bool kLegend) { _legend = kLegend ; } -void GeometryComparisonPlotter::SetWrite (const bool kWrite) { _write = kWrite ; } -void GeometryComparisonPlotter::Set1dModule (const bool k1dModule) { _1dModule = k1dModule ; } -void GeometryComparisonPlotter::Set2dModule (const bool k2dModule) { _2dModule = k2dModule ; } -void GeometryComparisonPlotter::SetLevelCut (const int kLevelCut) { _levelCut = kLevelCut ; } -void GeometryComparisonPlotter::SetBatchMode (const bool kBatchMode) { _batchMode = kBatchMode ; } -void GeometryComparisonPlotter::SetGrid (const int kGridX, - const int kGridY) { _grid_x = kGridX ; - _grid_y = kGridY ; } -void GeometryComparisonPlotter::SetBranchMax (const TString branchname, - const float max) { _max[branchname] = max ; } -void GeometryComparisonPlotter::SetBranchMin (const TString branchname, - const float min) { _min[branchname] = min ; } -void GeometryComparisonPlotter::SetBranchSF (const TString branchname, - const float SF) { _SF[branchname] = SF ; } -void GeometryComparisonPlotter::SetBranchUnits (const TString branchname, - const TString units) { _units[branchname] = units ; } -void GeometryComparisonPlotter::SetPrintOption (const Option_t * print_option) { _print_option = print_option ; } -void GeometryComparisonPlotter::SetCanvasSize (const int window_width, - const int window_height) { _window_width = window_width ; - _window_height = window_height ; } -void GeometryComparisonPlotter::SetOutputFileName (const TString name) { _output_filename = name ; } -void GeometryComparisonPlotter::SetOutputDirectoryName (const TString name) { _output_directory = name - + TString(name.EndsWith("/") ? "" : "/") ; } +void GeometryComparisonPlotter::SetPrint(const bool kPrint) { _print = kPrint; } +void GeometryComparisonPlotter::SetLegend(const bool kLegend) { _legend = kLegend; } +void GeometryComparisonPlotter::SetWrite(const bool kWrite) { _write = kWrite; } +void GeometryComparisonPlotter::Set1dModule(const bool k1dModule) { _1dModule = k1dModule; } +void GeometryComparisonPlotter::Set2dModule(const bool k2dModule) { _2dModule = k2dModule; } +void GeometryComparisonPlotter::SetLevelCut(const int kLevelCut) { _levelCut = kLevelCut; } +void GeometryComparisonPlotter::SetBatchMode(const bool kBatchMode) { _batchMode = kBatchMode; } +void GeometryComparisonPlotter::SetGrid(const int kGridX, const int kGridY) { + _grid_x = kGridX; + _grid_y = kGridY; +} +void GeometryComparisonPlotter::SetBranchMax(const TString branchname, const float max) { _max[branchname] = max; } +void GeometryComparisonPlotter::SetBranchMin(const TString branchname, const float min) { _min[branchname] = min; } +void GeometryComparisonPlotter::SetBranchSF(const TString branchname, const float SF) { _SF[branchname] = SF; } +void GeometryComparisonPlotter::SetBranchUnits(const TString branchname, const TString units) { + _units[branchname] = units; +} +void GeometryComparisonPlotter::SetPrintOption(const Option_t *print_option) { _print_option = print_option; } +void GeometryComparisonPlotter::SetCanvasSize(const int window_width, const int window_height) { + _window_width = window_width; + _window_height = window_height; +} +void GeometryComparisonPlotter::SetOutputFileName(const TString name) { _output_filename = name; } +void GeometryComparisonPlotter::SetOutputDirectoryName(const TString name) { + _output_directory = name + TString(name.EndsWith("/") ? "" : "/"); +} // PRIVATE METHODS -TString GeometryComparisonPlotter::LateXstyle (TString word) -{ - word.ToLower(); - if (word.BeginsWith("d")) word.ReplaceAll("d", "#Delta"); - if (word == TString("rdphi")) word = "r#Delta#phi"; // TO DO: find something less ad hoc... - else if (word.EndsWith("phi")) word.ReplaceAll("phi", "#phi"); - else if (word.EndsWith("alpha")) word.ReplaceAll("alpha", "#alpha"); - else if (word.EndsWith("beta")) word.ReplaceAll("beta" , "#beta"); - else if (word.EndsWith("gamma")) word.ReplaceAll("gamma", "#gamma"); - else if (word.EndsWith("eta")) word.ReplaceAll("eta", "#eta"); - return word; +TString GeometryComparisonPlotter::LateXstyle(TString word) { + word.ToLower(); + if (word.BeginsWith("d")) + word.ReplaceAll("d", "#Delta"); + if (word == TString("rdphi")) + word = "r#Delta#phi"; // TO DO: find something less ad hoc... + else if (word.EndsWith("phi")) + word.ReplaceAll("phi", "#phi"); + else if (word.EndsWith("alpha")) + word.ReplaceAll("alpha", "#alpha"); + else if (word.EndsWith("beta")) + word.ReplaceAll("beta", "#beta"); + else if (word.EndsWith("gamma")) + word.ReplaceAll("gamma", "#gamma"); + else if (word.EndsWith("eta")) + word.ReplaceAll("eta", "#eta"); + return word; } -TString GeometryComparisonPlotter::LateXstyleTable (TString word) -{ - word.ToLower(); - if (word.BeginsWith("d")) word.ReplaceAll("d", "$\\Delta$"); - if (word == TString("rdphi")) word = "r$\\Delta\\phi$"; // TO DO: find something less ad hoc... - else if (word.EndsWith("phi")) word.ReplaceAll("phi", "$\\phi$"); - else if (word.EndsWith("alpha")) word.ReplaceAll("alpha", "$\\alpha$"); - else if (word.EndsWith("beta")) word.ReplaceAll("beta" , "$\\beta$"); - else if (word.EndsWith("gamma")) word.ReplaceAll("gamma", "#$\\gamma$"); - else if (word.EndsWith("eta")) word.ReplaceAll("eta", "$\\eta$"); - return word; +TString GeometryComparisonPlotter::LateXstyleTable(TString word) { + word.ToLower(); + if (word.BeginsWith("d")) + word.ReplaceAll("d", "$\\Delta$"); + if (word == TString("rdphi")) + word = "r$\\Delta\\phi$"; // TO DO: find something less ad hoc... + else if (word.EndsWith("phi")) + word.ReplaceAll("phi", "$\\phi$"); + else if (word.EndsWith("alpha")) + word.ReplaceAll("alpha", "$\\alpha$"); + else if (word.EndsWith("beta")) + word.ReplaceAll("beta", "$\\beta$"); + else if (word.EndsWith("gamma")) + word.ReplaceAll("gamma", "#$\\gamma$"); + else if (word.EndsWith("eta")) + word.ReplaceAll("eta", "$\\eta$"); + return word; } -TString GeometryComparisonPlotter::ExtensionFromPrintOption (TString print_option) -{ - if (print_option.Contains("pdf" )) return TString(".pdf" ); - else if (print_option.Contains("eps" )) return TString(".eps" ); - else if (print_option.Contains("ps" )) return TString(".ps" ); - else if (print_option.Contains("svg" )) return TString(".svg" ); - else if (print_option.Contains("tex" )) return TString(".tex" ); - else if (print_option.Contains("gif" )) return TString(".gif" ); - else if (print_option.Contains("xpm" )) return TString(".xpm" ); - else if (print_option.Contains("png" )) return TString(".png" ); - else if (print_option.Contains("jpg" )) return TString(".jpg" ); - else if (print_option.Contains("tiff")) return TString(".tiff"); - else if (print_option.Contains("cxx" )) return TString(".cxx" ); - else if (print_option.Contains("xml" )) return TString(".xml" ); - else if (print_option.Contains("root")) return TString(".root"); - else - { - cout << __FILE__ << ":" << __LINE__ << ":Warning: unknown format. Returning .pdf, but possibly wrong..." << endl; - return TString(".pdf"); - } +TString GeometryComparisonPlotter::ExtensionFromPrintOption(TString print_option) { + if (print_option.Contains("pdf")) + return TString(".pdf"); + else if (print_option.Contains("eps")) + return TString(".eps"); + else if (print_option.Contains("ps")) + return TString(".ps"); + else if (print_option.Contains("svg")) + return TString(".svg"); + else if (print_option.Contains("tex")) + return TString(".tex"); + else if (print_option.Contains("gif")) + return TString(".gif"); + else if (print_option.Contains("xpm")) + return TString(".xpm"); + else if (print_option.Contains("png")) + return TString(".png"); + else if (print_option.Contains("jpg")) + return TString(".jpg"); + else if (print_option.Contains("tiff")) + return TString(".tiff"); + else if (print_option.Contains("cxx")) + return TString(".cxx"); + else if (print_option.Contains("xml")) + return TString(".xml"); + else if (print_option.Contains("root")) + return TString(".root"); + else { + cout << __FILE__ << ":" << __LINE__ << ":Warning: unknown format. Returning .pdf, but possibly wrong..." << endl; + return TString(".pdf"); + } } -TLegend * GeometryComparisonPlotter::MakeLegend (double x1, - double y1, - double x2, - double y2, - int nPlottedSublevels, - const TString title) -{ - TLegend * legend = new TLegend (x1, y1, x2, y2, title.Data(), "NBNDC"); - legend->SetNColumns(nPlottedSublevels); - legend->SetFillColor(0); - legend->SetLineColor(0); // redundant with option - legend->SetLineWidth(0); // redundant with option - for (int isublevel = 0 ; isublevel < nPlottedSublevels ; isublevel++) // nPlottedSublevels is either NB_SUBLEVELS for the tracker or 2 for the pixel - { - TGraph * g = new TGraph (0); - g->SetMarkerColor(COLOR_CODE(isublevel)); - g->SetFillColor(COLOR_CODE(isublevel)); - g->SetMarkerStyle(kFullSquare); - g->SetMarkerSize(10); - legend->AddEntry(g,_sublevel_names[isublevel], "p"); - } - return legend; +TLegend *GeometryComparisonPlotter::MakeLegend( + double x1, double y1, double x2, double y2, int nPlottedSublevels, const TString title) { + TLegend *legend = new TLegend(x1, y1, x2, y2, title.Data(), "NBNDC"); + legend->SetNColumns(nPlottedSublevels); + legend->SetFillColor(0); + legend->SetLineColor(0); // redundant with option + legend->SetLineWidth(0); // redundant with option + for (int isublevel = 0; isublevel < nPlottedSublevels; + isublevel++) // nPlottedSublevels is either NB_SUBLEVELS for the tracker or 2 for the pixel + { + TGraph *g = new TGraph(0); + g->SetMarkerColor(COLOR_CODE(isublevel)); + g->SetFillColor(COLOR_CODE(isublevel)); + g->SetMarkerStyle(kFullSquare); + g->SetMarkerSize(10); + legend->AddEntry(g, _sublevel_names[isublevel], "p"); + } + return legend; } - - -void GeometryComparisonPlotter::WriteTable (vector x, - unsigned int nLevelsTimesSlices, - float meanValue[10][24], - float RMS[10][24], - const TString nDigits, - const TString tableCaption, - const TString tableFileName) -{ - std::ofstream output(_output_directory+tableFileName); - - TString tableAlign,tableHeadline; - TString PXBpLine,PXBmLine,PXFpLine,PXFmLine,TIBpLine,TIBmLine,TOBpLine,TOBmLine,TIDpLine,TIDmLine,TECpLine,TECmLine; - char meanChar[x.size()][nLevelsTimesSlices][10]; - char RMSChar[x.size()][nLevelsTimesSlices][10]; - - tableAlign = "l"; - tableHeadline = ""; - PXBpLine = "PXB x$+$"; - PXBmLine = "PXB x$-$"; - PXFpLine = "PXF z$+$"; - PXFmLine = "PXF z$-$"; - TIBpLine = "TIB x$+$"; - TIBmLine = "TIB x$-$"; - TIDpLine = "TID z$+$"; - TIDmLine = "TID z$-$"; - TOBpLine = "TOB x$+$"; - TOBmLine = "TOB x$-$"; - TECpLine = "TEC z$+$"; - TECmLine = "TEC z$-$"; - - - - for (unsigned int ix = 0 ; ix < x.size() ; ix++) - { - for (unsigned int isubDet = 0 ; isubDet < nLevelsTimesSlices; isubDet++) - { - - sprintf(meanChar[ix][isubDet],"%."+nDigits+"f",meanValue[ix][isubDet]); - sprintf(RMSChar[ix][isubDet],"%."+nDigits+"f",RMS[ix][isubDet]); - } - tableAlign += "|c"; - tableHeadline += " & " + LateXstyleTable(x[ix]) + " / " + _units[x[ix]].ReplaceAll("#mum", "$\\mu$m"); - - PXBpLine += " & $"; PXBpLine += meanChar[ix][0]; PXBpLine += "\\pm"; PXBpLine += RMSChar[ix][0]; PXBpLine += " $"; - PXBmLine += " & $"; PXBmLine += meanChar[ix][12]; PXBmLine += "\\pm"; PXBmLine += RMSChar[ix][12]; PXBmLine += " $"; - PXFpLine += " & $"; PXFpLine += meanChar[ix][1]; PXFpLine += "\\pm"; PXFpLine += RMSChar[ix][1]; PXFpLine += " $"; - PXFmLine += " & $"; PXFmLine += meanChar[ix][7]; PXFmLine += "\\pm"; PXFmLine += RMSChar[ix][7]; PXFmLine += " $"; - TIBpLine += " & $"; TIBpLine += meanChar[ix][2]; TIBpLine += "\\pm"; TIBpLine += RMSChar[ix][2]; TIBpLine += " $"; - TIBmLine += " & $"; TIBmLine += meanChar[ix][14]; TIBmLine += "\\pm"; TIBmLine += RMSChar[ix][14]; TIBmLine += " $"; - TIDpLine += " & $"; TIDpLine += meanChar[ix][3]; TIDpLine += "\\pm"; TIDpLine += RMSChar[ix][3]; TIDpLine += " $"; - TIDmLine += " & $"; TIDmLine += meanChar[ix][9]; TIDmLine += "\\pm"; TIDmLine += RMSChar[ix][9]; TIDmLine += " $"; - TOBpLine += " & $"; TOBpLine += meanChar[ix][4]; TOBpLine += "\\pm"; TOBpLine += RMSChar[ix][4]; TOBpLine += " $"; - TOBmLine += " & $"; TOBmLine += meanChar[ix][16]; TOBmLine += "\\pm"; TOBmLine += RMSChar[ix][16]; TOBmLine += " $"; - TECpLine += " & $"; TECpLine += meanChar[ix][5]; TECpLine += "\\pm"; TECpLine += RMSChar[ix][5]; TECpLine += " $"; - TECmLine += " & $"; TECmLine += meanChar[ix][11]; TECmLine += "\\pm"; TECmLine += RMSChar[ix][11]; TECmLine += " $"; - } - - // Write the table to the tex file - output << "\\begin{table}" << std::endl; - output << "\\caption{" << tableCaption << "}" << std::endl; - output << "\\begin{tabular}{"<< tableAlign <<"}" << std::endl; - output << "\\hline" << std::endl; - output << tableHeadline << " \\\\" << std::endl; - output << "\\hline" << std::endl; - output << PXBpLine << " \\\\"<< std::endl; - output << PXBmLine << " \\\\"<< std::endl; - output << PXFpLine << " \\\\"<< std::endl; - output << PXFmLine << " \\\\"<< std::endl; - output << TIBpLine << " \\\\"<< std::endl; - output << TIBmLine << " \\\\"<< std::endl; - output << TIDpLine << " \\\\"<< std::endl; - output << TIDmLine << " \\\\"<< std::endl; - output << TOBpLine << " \\\\"<< std::endl; - output << TOBmLine << " \\\\"<< std::endl; - output << TECpLine << " \\\\"<< std::endl; - output << TECmLine << " \\\\"<< std::endl; - output << "\\hline" << std::endl; - output << "\\end{tabular}" << std::endl; - output << "\\end{table}" << std::endl; - + +void GeometryComparisonPlotter::WriteTable(vector x, + unsigned int nLevelsTimesSlices, + float meanValue[10][24], + float RMS[10][24], + const TString nDigits, + const TString tableCaption, + const TString tableFileName) { + std::ofstream output(_output_directory + tableFileName); + + TString tableAlign, tableHeadline; + TString PXBpLine, PXBmLine, PXFpLine, PXFmLine, TIBpLine, TIBmLine, TOBpLine, TOBmLine, TIDpLine, TIDmLine, TECpLine, + TECmLine; + char meanChar[x.size()][nLevelsTimesSlices][10]; + char RMSChar[x.size()][nLevelsTimesSlices][10]; + + tableAlign = "l"; + tableHeadline = ""; + PXBpLine = "PXB x$+$"; + PXBmLine = "PXB x$-$"; + PXFpLine = "PXF z$+$"; + PXFmLine = "PXF z$-$"; + TIBpLine = "TIB x$+$"; + TIBmLine = "TIB x$-$"; + TIDpLine = "TID z$+$"; + TIDmLine = "TID z$-$"; + TOBpLine = "TOB x$+$"; + TOBmLine = "TOB x$-$"; + TECpLine = "TEC z$+$"; + TECmLine = "TEC z$-$"; + + for (unsigned int ix = 0; ix < x.size(); ix++) { + for (unsigned int isubDet = 0; isubDet < nLevelsTimesSlices; isubDet++) { + sprintf(meanChar[ix][isubDet], "%." + nDigits + "f", meanValue[ix][isubDet]); + sprintf(RMSChar[ix][isubDet], "%." + nDigits + "f", RMS[ix][isubDet]); + } + tableAlign += "|c"; + tableHeadline += " & " + LateXstyleTable(x[ix]) + " / " + _units[x[ix]].ReplaceAll("#mum", "$\\mu$m"); + + PXBpLine += " & $"; + PXBpLine += meanChar[ix][0]; + PXBpLine += "\\pm"; + PXBpLine += RMSChar[ix][0]; + PXBpLine += " $"; + PXBmLine += " & $"; + PXBmLine += meanChar[ix][12]; + PXBmLine += "\\pm"; + PXBmLine += RMSChar[ix][12]; + PXBmLine += " $"; + PXFpLine += " & $"; + PXFpLine += meanChar[ix][1]; + PXFpLine += "\\pm"; + PXFpLine += RMSChar[ix][1]; + PXFpLine += " $"; + PXFmLine += " & $"; + PXFmLine += meanChar[ix][7]; + PXFmLine += "\\pm"; + PXFmLine += RMSChar[ix][7]; + PXFmLine += " $"; + TIBpLine += " & $"; + TIBpLine += meanChar[ix][2]; + TIBpLine += "\\pm"; + TIBpLine += RMSChar[ix][2]; + TIBpLine += " $"; + TIBmLine += " & $"; + TIBmLine += meanChar[ix][14]; + TIBmLine += "\\pm"; + TIBmLine += RMSChar[ix][14]; + TIBmLine += " $"; + TIDpLine += " & $"; + TIDpLine += meanChar[ix][3]; + TIDpLine += "\\pm"; + TIDpLine += RMSChar[ix][3]; + TIDpLine += " $"; + TIDmLine += " & $"; + TIDmLine += meanChar[ix][9]; + TIDmLine += "\\pm"; + TIDmLine += RMSChar[ix][9]; + TIDmLine += " $"; + TOBpLine += " & $"; + TOBpLine += meanChar[ix][4]; + TOBpLine += "\\pm"; + TOBpLine += RMSChar[ix][4]; + TOBpLine += " $"; + TOBmLine += " & $"; + TOBmLine += meanChar[ix][16]; + TOBmLine += "\\pm"; + TOBmLine += RMSChar[ix][16]; + TOBmLine += " $"; + TECpLine += " & $"; + TECpLine += meanChar[ix][5]; + TECpLine += "\\pm"; + TECpLine += RMSChar[ix][5]; + TECpLine += " $"; + TECmLine += " & $"; + TECmLine += meanChar[ix][11]; + TECmLine += "\\pm"; + TECmLine += RMSChar[ix][11]; + TECmLine += " $"; + } + + // Write the table to the tex file + output << "\\begin{table}" << std::endl; + output << "\\caption{" << tableCaption << "}" << std::endl; + output << "\\begin{tabular}{" << tableAlign << "}" << std::endl; + output << "\\hline" << std::endl; + output << tableHeadline << " \\\\" << std::endl; + output << "\\hline" << std::endl; + output << PXBpLine << " \\\\" << std::endl; + output << PXBmLine << " \\\\" << std::endl; + output << PXFpLine << " \\\\" << std::endl; + output << PXFmLine << " \\\\" << std::endl; + output << TIBpLine << " \\\\" << std::endl; + output << TIBmLine << " \\\\" << std::endl; + output << TIDpLine << " \\\\" << std::endl; + output << TIDmLine << " \\\\" << std::endl; + output << TOBpLine << " \\\\" << std::endl; + output << TOBmLine << " \\\\" << std::endl; + output << TECpLine << " \\\\" << std::endl; + output << TECmLine << " \\\\" << std::endl; + output << "\\hline" << std::endl; + output << "\\end{tabular}" << std::endl; + output << "\\end{table}" << std::endl; } diff --git a/Alignment/OfflineValidation/test/test_all.sh b/Alignment/OfflineValidation/test/test_all.sh index 0501533bbb3c9..afd15e3b9e83f 100755 --- a/Alignment/OfflineValidation/test/test_all.sh +++ b/Alignment/OfflineValidation/test/test_all.sh @@ -158,6 +158,16 @@ validateAlignments.py -c validation_config.ini -N testingAllInOneTool --dryRun | printf "\n\n" +echo " TESTING all-in-one tool configuration ..." +FILES="$PWD/testingAllInOneTool/*_cfg.py" +for f in $FILES +do + echo "Processing $f file..." + python3 $FILE/$f || die "Failure compiling test configuration" $? +done + +printf "\n\n" + echo " TESTING Primary Vertex Validation run-by-run submission ..." submitPVValidationJobs.py -j UNIT_TEST -D /HLTPhysics/Run2016C-TkAlMinBias-07Dec2018-v1/ALCARECO -i ${LOCAL_TEST_DIR}/testPVValidation_Relvals_DATA.ini -r --unitTest || die "Failure running PV Validation run-by-run submission" $? diff --git a/Alignment/TrackerAlignment/plugins/AlignmentPrescaler.cc b/Alignment/TrackerAlignment/plugins/AlignmentPrescaler.cc index a62eec5546a0e..029a0b5146727 100644 --- a/Alignment/TrackerAlignment/plugins/AlignmentPrescaler.cc +++ b/Alignment/TrackerAlignment/plugins/AlignmentPrescaler.cc @@ -1,33 +1,73 @@ -#include "Alignment/TrackerAlignment/plugins/AlignmentPrescaler.h" - -#include "FWCore/MessageLogger/interface/MessageLogger.h" +#include "Alignment/CommonAlignment/interface/Alignable.h" +#include "Alignment/CommonAlignment/interface/Utilities.h" +#include "Alignment/TrackerAlignment/interface/AlignableTracker.h" +#include "AnalysisDataFormats/TrackInfo/interface/TrackInfo.h" +#include "DataFormats/Alignment/interface/AliClusterValueMap.h" +#include "DataFormats/Alignment/interface/AlignmentClusterFlag.h" #include "DataFormats/Common/interface/View.h" +#include "DataFormats/DetId/interface/DetId.h" +#include "DataFormats/TrackReco/interface/Track.h" #include "DataFormats/TrackerCommon/interface/TrackerTopology.h" +#include "DataFormats/TrackerRecHit2D/interface/SiPixelRecHit.h" +#include "DataFormats/TrackerRecHit2D/interface/SiStripRecHit1D.h" +#include "DataFormats/TrackerRecHit2D/interface/SiStripRecHit2D.h" +#include "FWCore/Framework/interface/ESHandle.h" +#include "FWCore/Framework/interface/Event.h" +#include "FWCore/Framework/interface/EventPrincipal.h" +#include "FWCore/Framework/interface/EventSetup.h" +#include "FWCore/Framework/interface/one/EDProducer.h" +#include "FWCore/MessageLogger/interface/MessageLogger.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/ParameterSet/interface/ParameterSetDescription.h" +#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" +#include "FWCore/Utilities/interface/InputTag.h" #include "Geometry/Records/interface/IdealGeometryRecord.h" #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h" -#include "Alignment/TrackerAlignment/interface/AlignableTracker.h" -#include "Alignment/CommonAlignment/interface/Alignable.h" -#include "Alignment/CommonAlignment/interface/Utilities.h" +#include "RecoTracker/TransientTrackingRecHit/interface/TSiPixelRecHit.h" +#include "RecoTracker/TransientTrackingRecHit/interface/TSiStripRecHit2DLocalPos.h" #include "Utilities/General/interface/ClassName.h" -#include "DataFormats/TrackReco/interface/Track.h" -#include "AnalysisDataFormats/TrackInfo/interface/TrackInfo.h" +#include "TFile.h" +#include "TTree.h" +#include "TRandom3.h" +#include "TH1F.h" +#include -#include "DataFormats/TrackerRecHit2D/interface/SiStripRecHit1D.h" -#include "DataFormats/TrackerRecHit2D/interface/SiStripRecHit2D.h" -#include "DataFormats/TrackerRecHit2D/interface/SiPixelRecHit.h" -#include "RecoTracker/TransientTrackingRecHit/interface/TSiStripRecHit2DLocalPos.h" -#include "RecoTracker/TransientTrackingRecHit/interface/TSiPixelRecHit.h" -#include "DataFormats/Alignment/interface/AlignmentClusterFlag.h" -#include "DataFormats/Alignment/interface/AliClusterValueMap.h" +class TrackerTopology; + +class AlignmentPrescaler : public edm::one::EDProducer<> { +public: + AlignmentPrescaler(const edm::ParameterSet& iConfig); + ~AlignmentPrescaler() override; + void beginJob() override; + void endJob() override; + void produce(edm::Event& iEvent, const edm::EventSetup& iSetup) override; + static void fillDescriptions(edm::ConfigurationDescriptions&); + +private: + // tokens + edm::EDGetTokenT tracksToken_; //tracks in input + edm::EDGetTokenT aliClusterToken_; //Hit-quality association map -// #include "Riostream.h" + std::string prescfilename_; //name of the file containing the TTree with the prescaling factors + std::string presctreename_; //name of the TTree with the prescaling factors + + TFile* fpresc_; + TTree* tpresc_; + TRandom3* myrand_; + + int layerFromId(const DetId& id, const TrackerTopology* tTopo) const; + + unsigned int detid_; + float hitPrescFactor_, overlapPrescFactor_; + int totnhitspxl_; +}; using namespace std; AlignmentPrescaler::AlignmentPrescaler(const edm::ParameterSet& iConfig) - : src_(iConfig.getParameter("src")), - srcQualityMap_(iConfig.getParameter("assomap")), + : tracksToken_(consumes(iConfig.getParameter("src"))), + aliClusterToken_(consumes(iConfig.getParameter("assomap"))), prescfilename_(iConfig.getParameter("PrescFileName")), presctreename_(iConfig.getParameter("PrescTreeName")) { // issue the produce<> @@ -35,13 +75,11 @@ AlignmentPrescaler::AlignmentPrescaler(const edm::ParameterSet& iConfig) produces(); } -AlignmentPrescaler::~AlignmentPrescaler() { - // -} +AlignmentPrescaler::~AlignmentPrescaler() = default; void AlignmentPrescaler::beginJob() { // - std::cout << "in AlignmentPrescaler::beginJob" << std::flush; + edm::LogPrint("AlignmentPrescaler") << "in AlignmentPrescaler::beginJob" << std::flush; fpresc_ = new TFile(prescfilename_.c_str(), "READ"); tpresc_ = (TTree*)fpresc_->Get(presctreename_.c_str()); tpresc_->BuildIndex("DetId"); @@ -49,7 +87,7 @@ void AlignmentPrescaler::beginJob() { tpresc_->SetBranchStatus("DetId", true); tpresc_->SetBranchStatus("PrescaleFactor", true); tpresc_->SetBranchStatus("PrescaleFactorOverlap", true); - cout << " Branches activated " << std::flush; + edm::LogPrint("AlignmentPrescaler") << " Branches activated " << std::flush; detid_ = 0; hitPrescFactor_ = 99.0; overlapPrescFactor_ = 88.0; @@ -57,10 +95,10 @@ void AlignmentPrescaler::beginJob() { tpresc_->SetBranchAddress("DetId", &detid_); tpresc_->SetBranchAddress("PrescaleFactor", &hitPrescFactor_); tpresc_->SetBranchAddress("PrescaleFactorOverlap", &overlapPrescFactor_); - cout << " addressed " << std::flush; + edm::LogPrint("AlignmentPrescaler") << " addressed " << std::flush; myrand_ = new TRandom3(); // myrand_->SetSeed(); - cout << " ok " << std::endl; + edm::LogPrint("AlignmentPrescaler") << " ok "; } void AlignmentPrescaler::endJob() { @@ -71,25 +109,25 @@ void AlignmentPrescaler::endJob() { } void AlignmentPrescaler::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) { - // std::cout<<"\n\n#################\n### Starting the AlignmentPrescaler::produce ; Event: "< Tracks; - iEvent.getByLabel(src_, Tracks); + iEvent.getByToken(tracksToken_, Tracks); //take HitAssomap - edm::Handle hMap; - iEvent.getByLabel(srcQualityMap_, hMap); - AliClusterValueMap InValMap = *hMap; + AliClusterValueMap InValMap = iEvent.get(aliClusterToken_); //prepare the output of the ValueMap flagging tracks std::vector trackflags(Tracks->size(), 0); - //int npxlhits=0; + int npxlhits = 0; //loop on tracks for (std::vector::const_iterator ittrk = Tracks->begin(), edtrk = Tracks->end(); ittrk != edtrk; ++ittrk) { //loop on tracking rechits - // std::cout << "Loop on hits of track #" << (ittrk - Tracks->begin()) << std::endl; + LogDebug("AlignmentPrescaler") << "Loop on hits of track #" << (ittrk - Tracks->begin()) << std::endl; int nhit = 0; int ntakenhits = 0; bool firstTakenHit = false; @@ -135,10 +173,11 @@ void AlignmentPrescaler::produce(edm::Event& iEvent, const edm::EventSetup& iSet tmpflag.SetDetId(hit->geographicalId()); if (tmpflag.isOverlap()) isOverlapHit = true; - // std::cout<<"~*~*~* Prescale (1D) for module "<(hit); @@ -148,17 +187,18 @@ void AlignmentPrescaler::produce(edm::Event& iEvent, const edm::EventSetup& iSet tmpflag.SetDetId(hit->geographicalId()); if (tmpflag.isOverlap()) isOverlapHit = true; - // std::cout<<"~*~*~* Prescale (2D) for module "<(hit); if (pixelhit != nullptr) { - //npxlhits++; + npxlhits++; SiPixelClusterRefNew pixclust(pixelhit->cluster()); tmpflag = InValMap[pixclust]; tmpflag.SetDetId(hit->geographicalId()); @@ -169,7 +209,7 @@ void AlignmentPrescaler::produce(edm::Event& iEvent, const edm::EventSetup& iSet // tmpflag.SetDetId(hit->geographicalId()); if (isOverlapHit) { - //cout<<" DetId="<Rndm()) <= overlapPrescFactor_); } if (!takeit) { @@ -177,7 +217,7 @@ void AlignmentPrescaler::produce(edm::Event& iEvent, const edm::EventSetup& iSet takeit = (rr <= hitPrescFactor_); } if (takeit) { //HIT TAKEN ! - //cout<<" DetId="< 2) { @@ -196,22 +236,15 @@ void AlignmentPrescaler::produce(edm::Event& iEvent, const edm::EventSetup& iSet if (!firstTakenHit) { firstTakenHit = true; - //std::cout<<"Index of the track iterator is "<< ittrk-Tracks->begin() <begin(); } ntakenhits++; } //end if take this hit - //cout<begin()] = ntakenhits; - } //end loop on tracks - // totnhitspxl_+=ntakenhits; - //cout<<"AlignmentPrescaler::produce says that in this event "<(); @@ -242,9 +275,18 @@ int AlignmentPrescaler::layerFromId(const DetId& id, const TrackerTopology* tTop return tTopo->tidWheel(id) + (3 * (tTopo->tidSide(id) - 1)); } return -1; - } //end layerfromId +void AlignmentPrescaler::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { + edm::ParameterSetDescription desc; + desc.setComment("Prescale Tracker Alignment hits for alignment procedures"); + desc.add("src", edm::InputTag("generalTracks")); + desc.add("assomap", edm::InputTag("OverlapAssoMap")); + desc.add("PrescFileName", "PrescaleFactors.root"); + desc.add("PrescTreeName", "AlignmentHitMap"); + descriptions.addWithDefaultLabel(desc); +} + // ========= MODULE DEF ============== #include "FWCore/PluginManager/interface/ModuleDef.h" #include "FWCore/Framework/interface/MakerMacros.h" diff --git a/Alignment/TrackerAlignment/plugins/AlignmentPrescaler.h b/Alignment/TrackerAlignment/plugins/AlignmentPrescaler.h deleted file mode 100644 index dc143c2220dab..0000000000000 --- a/Alignment/TrackerAlignment/plugins/AlignmentPrescaler.h +++ /dev/null @@ -1,48 +0,0 @@ -#ifndef TrackerAlignment_AlignmentPrescaler_H -#define TrackerAlignment_AlignmentPrescaler_H - -#include "FWCore/Framework/interface/EDProducer.h" -#include "FWCore/Framework/interface/EventPrincipal.h" -#include "FWCore/Framework/interface/Event.h" -#include "FWCore/Framework/interface/EventSetup.h" -#include "FWCore/Framework/interface/ESHandle.h" - -#include "FWCore/ParameterSet/interface/ParameterSet.h" -#include "FWCore/Utilities/interface/InputTag.h" - -#include "DataFormats/DetId/interface/DetId.h" - -#include -#include "TFile.h" -#include "TTree.h" -#include "TRandom3.h" -#include "TH1F.h" - -class TrackerTopology; - -class AlignmentPrescaler : public edm::EDProducer { -public: - AlignmentPrescaler(const edm::ParameterSet &iConfig); - ~AlignmentPrescaler() override; - void beginJob() override; - void endJob() override; - void produce(edm::Event &iEvent, const edm::EventSetup &iSetup) override; - -private: - edm::InputTag src_; //tracks in input - edm::InputTag srcQualityMap_; //Hit-quality association map - - std::string prescfilename_; //name of the file containing the TTree with the prescaling factors - std::string presctreename_; //name of the TTree with the prescaling factors - - TFile *fpresc_; - TTree *tpresc_; - TRandom3 *myrand_; - - int layerFromId(const DetId &id, const TrackerTopology *tTopo) const; - - unsigned int detid_; - float hitPrescFactor_, overlapPrescFactor_; - int totnhitspxl_; -}; -#endif diff --git a/Alignment/TrackerAlignment/plugins/BuildFile.xml b/Alignment/TrackerAlignment/plugins/BuildFile.xml index 1ba9005254f6d..80f283bd6dd47 100644 --- a/Alignment/TrackerAlignment/plugins/BuildFile.xml +++ b/Alignment/TrackerAlignment/plugins/BuildFile.xml @@ -18,6 +18,7 @@ + diff --git a/Alignment/TrackerAlignment/plugins/TkAlCaOverlapTagger.cc b/Alignment/TrackerAlignment/plugins/TkAlCaOverlapTagger.cc index 28cd34eebd324..1aa11fff757fd 100644 --- a/Alignment/TrackerAlignment/plugins/TkAlCaOverlapTagger.cc +++ b/Alignment/TrackerAlignment/plugins/TkAlCaOverlapTagger.cc @@ -1,10 +1,12 @@ -#include "FWCore/Framework/interface/EDProducer.h" +#include "FWCore/Framework/interface/stream/EDProducer.h" #include "FWCore/Framework/interface/EventPrincipal.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/EventSetup.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/ParameterSet/interface/ParameterSetDescription.h" +#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" #include "FWCore/Utilities/interface/InputTag.h" #include "DataFormats/Common/interface/View.h" @@ -25,16 +27,19 @@ #include "DataFormats/Alignment/interface/AlignmentClusterFlag.h" #include "DataFormats/Alignment/interface/AliClusterValueMap.h" -//#include -class TkAlCaOverlapTagger : public edm::EDProducer { +class TkAlCaOverlapTagger : public edm::stream::EDProducer<> { public: TkAlCaOverlapTagger(const edm::ParameterSet& iConfig); ~TkAlCaOverlapTagger() override; void produce(edm::Event& iEvent, const edm::EventSetup& iSetup) override; + static void fillDescriptions(edm::ConfigurationDescriptions&); private: const edm::ESGetToken topoToken_; + edm::EDGetTokenT trajTrackToken_; + edm::EDGetTokenT siPixelClustersToken_; + edm::EDGetTokenT siStripClustersToken_; edm::InputTag src_; edm::InputTag srcClust_; bool rejectBadMods_; @@ -45,31 +50,33 @@ class TkAlCaOverlapTagger : public edm::EDProducer { TkAlCaOverlapTagger::TkAlCaOverlapTagger(const edm::ParameterSet& iConfig) : topoToken_(esConsumes()), - src_(iConfig.getParameter("src")), - srcClust_(iConfig.getParameter("Clustersrc")), + trajTrackToken_(consumes((iConfig.getParameter("src")))), + siPixelClustersToken_(consumes((iConfig.getParameter("Clustersrc")))), + siStripClustersToken_(consumes((iConfig.getParameter("Clustersrc")))), rejectBadMods_(iConfig.getParameter("rejectBadMods")), - BadModsList_(iConfig.getParameter >("BadMods")) { + BadModsList_(iConfig.getParameter>("BadMods")) { produces(); //produces the ValueMap (VM) to be stored in the Event at the end } -TkAlCaOverlapTagger::~TkAlCaOverlapTagger() {} +TkAlCaOverlapTagger::~TkAlCaOverlapTagger() = default; void TkAlCaOverlapTagger::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) { //Retrieve tracker topology from geometry const TrackerTopology* tTopo = &iSetup.getData(topoToken_); edm::Handle assoMap; - iEvent.getByLabel(src_, assoMap); - // cout<<"\n\n############################\n### Starting a new TkAlCaOverlapTagger - Ev "< > pixelclusters; - iEvent.getByLabel(srcClust_, pixelclusters); //same label as tracks + edm::Handle> pixelclusters; + iEvent.getByToken(siPixelClustersToken_, pixelclusters); //same label as tracks std::vector pixelvalues(pixelclusters->dataSize(), iniflag); //vector where to store value to be fileld in the VM - edm::Handle > stripclusters; - iEvent.getByLabel(srcClust_, stripclusters); //same label as tracks + edm::Handle> stripclusters; + iEvent.getByToken(siStripClustersToken_, stripclusters); //same label as tracks std::vector stripvalues(stripclusters->dataSize(), iniflag); //vector where to store value to be fileld in the VM @@ -78,7 +85,7 @@ void TkAlCaOverlapTagger::produce(edm::Event& iEvent, const edm::EventSetup& iSe //loop over trajectories for (TrajTrackAssociationCollection::const_iterator itass = assoMap->begin(); itass != assoMap->end(); ++itass) { int nOverlaps = 0; - const edm::Ref > traj = itass->key; //trajectory in the collection + const edm::Ref> traj = itass->key; //trajectory in the collection const Trajectory* myTrajectory = &(*traj); std::vector tmColl = myTrajectory->measurements(); @@ -95,14 +102,17 @@ void TkAlCaOverlapTagger::produce(edm::Event& iEvent, const edm::EventSetup& iSe hitcnt++; if (previousTM != nullptr) { - // std::cout<<"Checking TrajMeas ("<recHit()->isValid()) { - //std::cout<<"Previous RecHit invalid !"<recHit()->geographicalId().rawId() + << "\t Local x of hit: " << previousTM->recHit()->localPosition().x(); } - //else std::cout<<"\nDetId: "<recHit()->geographicalId().rawId()<<"\t Local x of hit: "<recHit()->localPosition().x()<recHit(); @@ -110,7 +120,6 @@ void TkAlCaOverlapTagger::produce(edm::Event& iEvent, const edm::EventSetup& iSe if (!hit->isValid()) continue; - //std::cout << " hit number " << (ith - itt->recHits().begin()) << std::endl; DetId detid = hit->geographicalId(); int layer(layerFromId(detid, tTopo)); //layer 1-4=TIB, layer 5-10=TOB int subDet = detid.subdetId(); @@ -133,12 +142,12 @@ void TkAlCaOverlapTagger::produce(edm::Event& iEvent, const edm::EventSetup& iSe // AlignmentClusterFlag hitflag(hit->geographicalId()); hitflag.SetOverlapFlag(); - // cout<<"Overlap found in SubDet "<(hit); const SiStripRecHit1D* transstriphit1D = dynamic_cast(hit); @@ -177,14 +186,17 @@ void TkAlCaOverlapTagger::produce(edm::Event& iEvent, const edm::EventSetup& iSe .id()) { //ensure that the stripclust is really present in the original cluster collection!!! stripvalues[stripclust.key()] = hitflag; - //cout<<">>> Storing in the ValueMap a StripClusterRef with Cluster.Key: "<cluster().key() <<"), Cluster.Id: "<geographicalId().rawId()<<")"<>> Storing in the ValueMap a StripClusterRef with Cluster.Key: " << stripclust.key() + << " (" << striphit->cluster().key() << "), Cluster.Id: " << stripclust.id() << " (DetId is " + << hit->geographicalId().rawId() << ")"; } else { edm::LogError("TkAlCaOverlapTagger") << "ERROR in : ProdId of Strip clusters mismatched: " << stripclust.id() << " vs " << stripclusters.id(); } - // cout<<"Cluster baricentre: "<barycenter()<barycenter(); } else { edm::LogError("TkAlCaOverlapTagger") << "ERROR in : Dynamic cast of " "Strip RecHit failed! TypeId of the RecHit: " @@ -206,7 +218,9 @@ void TkAlCaOverlapTagger::produce(edm::Event& iEvent, const edm::EventSetup& iSe if (pixclust.id() == pixelclusters.id()) { pixelvalues[pixclust.key()] = hitflag; - //cout<<">>> Storing in the ValueMap a PixelClusterRef with ProdID: "<geographicalId().rawId()<<")" <>> Storing in the ValueMap a PixelClusterRef with ProdID: " << pixclust.id() + << " (DetId is " << hit->geographicalId().rawId() << ")"; //" and a Val with ID: "<: ProdId of Pixel clusters mismatched: " @@ -228,18 +242,17 @@ void TkAlCaOverlapTagger::produce(edm::Event& iEvent, const edm::EventSetup& iSe previousTM = &(*itTrajMeas); previousId = detid; } //end loop over traj meas - //std::cout<<"Found "<(); AliClusterValueMap::Filler mapfiller(*hitvalmap); - edm::TestHandle > fakePixelHandle(&pixelvalues, pixelclusters.id()); + edm::TestHandle> fakePixelHandle(&pixelvalues, pixelclusters.id()); mapfiller.insert(fakePixelHandle, pixelvalues.begin(), pixelvalues.end()); - edm::TestHandle > fakeStripHandle(&stripvalues, stripclusters.id()); + edm::TestHandle> fakeStripHandle(&stripvalues, stripclusters.id()); mapfiller.insert(fakeStripHandle, stripvalues.begin(), stripvalues.end()); mapfiller.fill(); @@ -264,6 +277,16 @@ int TkAlCaOverlapTagger::layerFromId(const DetId& id, const TrackerTopology* tTo } //end layerfromId +void TkAlCaOverlapTagger::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { + edm::ParameterSetDescription desc; + desc.setComment("Tagger of overlaps for tracker alignment"); + desc.add("src", edm::InputTag("generalTracks")); + desc.add("Clustersrc", edm::InputTag("ALCARECOTkAlCosmicsCTF0T")); + desc.add("rejectBadMods", false); + desc.add>("BadMods", {}); + descriptions.addWithDefaultLabel(desc); +} + // ========= MODULE DEF ============== #include "FWCore/PluginManager/interface/ModuleDef.h" #include "FWCore/Framework/interface/MakerMacros.h" diff --git a/Alignment/TrackerAlignment/plugins/TkAlCaSkimTreeMerger.cc b/Alignment/TrackerAlignment/plugins/TkAlCaSkimTreeMerger.cc index 458babf469b2f..4c11866e91217 100644 --- a/Alignment/TrackerAlignment/plugins/TkAlCaSkimTreeMerger.cc +++ b/Alignment/TrackerAlignment/plugins/TkAlCaSkimTreeMerger.cc @@ -1,19 +1,17 @@ - -#ifndef TrackerAlignment_TkAlCaSkimTreeMerger_H -#define TrackerAlignment_TkAlCaSkimTreeMerger_H - -#include #include #include #include +#include -#include "FWCore/Framework/interface/EDAnalyzer.h" +#include "FWCore/Framework/interface/one/EDAnalyzer.h" #include "FWCore/Framework/interface/EventPrincipal.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/EventSetup.h" #include "FWCore/Framework/interface/ESHandle.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/ParameterSet/interface/ParameterSetDescription.h" +#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" #include "FWCore/Utilities/interface/InputTag.h" #include "TFile.h" @@ -21,13 +19,14 @@ #include "TChain.h" #include "TStopwatch.h" -class TkAlCaSkimTreeMerger : public edm::EDAnalyzer { +class TkAlCaSkimTreeMerger : public edm::one::EDAnalyzer<> { public: TkAlCaSkimTreeMerger(const edm::ParameterSet &iConfig); ~TkAlCaSkimTreeMerger() override; void beginJob() override; void endJob() override; void analyze(const edm::Event &, const edm::EventSetup &) override; + static void fillDescriptions(edm::ConfigurationDescriptions &); private: TTree *out_; //TTree containing the merged result @@ -49,13 +48,10 @@ class TkAlCaSkimTreeMerger : public edm::EDAnalyzer { TStopwatch myclock; }; -#endif - TkAlCaSkimTreeMerger::TkAlCaSkimTreeMerger(const edm::ParameterSet &iConfig) : filelist_(iConfig.getParameter("FileList")), treename_(iConfig.getParameter("TreeName")), outfilename_(iConfig.getParameter("OutputFile")), - // maxhits_(iConfig.getParameter("NhitsMaxLimit")) maxhits_(iConfig.getParameter("NhitsMaxLimit")), maxhitsSet_(iConfig.getParameter("NhitsMaxSet")) { maxPXBhits_ = maxhitsSet_.getParameter("PXBmaxhits"); @@ -65,19 +61,15 @@ TkAlCaSkimTreeMerger::TkAlCaSkimTreeMerger(const edm::ParameterSet &iConfig) maxTOBhits_ = maxhitsSet_.getParameter("TOBmaxhits"); maxTEChits_ = maxhitsSet_.getParameter("TECmaxhits"); //anything you want to do for initializing - std::cout << "\n\n*** MAX N HITS = " << maxhits_ << std::endl << std::endl; + LogDebug("TkAlCaSkimTreeMerger") << "\n\n*** MAX N HITS = " << maxhits_ << std::endl << std::endl; out_ = nullptr; firsttree_ = nullptr; ch_ = nullptr; } TkAlCaSkimTreeMerger::~TkAlCaSkimTreeMerger() { - //default destructor - // delete out_; - // delete firsttree_; - delete ch_; - std::cout << "finished." << std::endl; + LogDebug("TkAlCaSkimTreeMerger") << "finished." << std::endl; } // ------------ method called before analyzing the first event ------------ @@ -86,7 +78,7 @@ void TkAlCaSkimTreeMerger::beginJob() { //prepare the chain ch_ = new TChain(treename_.c_str()); - std::cout << "The chain contains " << ch_->GetNtrees() << " trees" << std::endl; + LogDebug("TkAlCaSkimTreeMerger") << "The chain contains " << ch_->GetNtrees() << " trees" << std::endl; //load the trees into the chain std::ifstream flist(filelist_.c_str(), std::ios::in); @@ -98,15 +90,15 @@ void TkAlCaSkimTreeMerger::beginJob() { flist >> filename; if (filename.empty()) continue; - //std::cout<<"Adding "<Add(filename.c_str()); if (first) { firstfilename_ = filename; first = false; } } - std::cout << "Now the chain contains " << ch_->GetNtrees() << " trees (" << ch_->GetEntries() << " entries)" - << std::endl; + LogDebug("TkAlCaSkimTreeMerger") << "Now the chain contains " << ch_->GetNtrees() << " trees (" << ch_->GetEntries() + << " entries)" << std::endl; unsigned int id_ch = 0; uint32_t nhits_ch = 0, noverlaps_ch = 0; @@ -153,18 +145,18 @@ void TkAlCaSkimTreeMerger::beginJob() { } //end loop on ent - entries in the chain - std::cout << "Nhits in the chain: " << totnhits << std::endl; - std::cout << "NOverlaps in the chain: " << totnoverlaps << std::endl; + LogDebug("TkAlCaSkimTreeMerger") << "Nhits in the chain: " << totnhits << std::endl; + LogDebug("TkAlCaSkimTreeMerger") << "NOverlaps in the chain: " << totnoverlaps << std::endl; myclock.Stop(); - std::cout << "Finished beginJob after " << myclock.RealTime() << " s (real time) / " << myclock.CpuTime() - << " s (cpu time)" << std::endl; + LogDebug("TkAlCaSkimTreeMerger") << "Finished beginJob after " << myclock.RealTime() << " s (real time) / " + << myclock.CpuTime() << " s (cpu time)" << std::endl; myclock.Continue(); } //end beginJob // ------------ method called to for each event ------------ void TkAlCaSkimTreeMerger::analyze(const edm::Event &, const edm::EventSetup &) { - // std::cout<GetEntries()<GetEntries() << std::endl; } //end analyze // ------------ method called after having analyzed all the events ------------ @@ -172,7 +164,7 @@ void TkAlCaSkimTreeMerger::endJob() { //address variables in the first tree and in the chain TFile *firstfile = new TFile(firstfilename_.c_str(), "READ"); firsttree_ = (TTree *)firstfile->Get(treename_.c_str()); - std::cout << "the first tree has " << firsttree_->GetEntries() << " entries" << std::endl; + LogDebug("TkAlCaSkimTreeMerger") << "the first tree has " << firsttree_->GetEntries() << " entries" << std::endl; unsigned int id = 0; uint32_t nhits = 0, noverlaps = 0; float posX(-99999.0), posY(-77777.0), posZ(-88888.0); @@ -235,7 +227,7 @@ void TkAlCaSkimTreeMerger::endJob() { firsttree_->GetEntry(mod); nhits_out = hitmap_[id]; noverlaps_out = overlapmap_[id]; - // if(mod<25)std::cout<<"Nhits 1st tree: "<Write(); - std::cout << "Deleting..." << std::flush; + LogDebug("TkAlCaSkimTreeMerger") << "Deleting..." << std::flush; delete firstfile; delete outfile; - } //end endJob +void TkAlCaSkimTreeMerger::fillDescriptions(edm::ConfigurationDescriptions &descriptions) { + edm::ParameterSetDescription desc; + desc.setComment("Merger of TkAlCaSkim Trees"); + desc.add("FileList", "DQMHitMapsList.txt"); + desc.add("TreeName", "AlignmentHitMaps"); + desc.add("OutputFile", "AlignmentHitMapsMerged.root"); + desc.add("NhitsMaxLimit", 0); + + edm::ParameterSetDescription tkAlCaSkimTreeParamsDesc; + std::vector tkAlCaSkimDefaults(1); + tkAlCaSkimDefaults[0].addParameter("PXBmaxhits", -1); + tkAlCaSkimDefaults[0].addParameter("PXFmaxhits", -1); + tkAlCaSkimDefaults[0].addParameter("TIBmaxhits", -1); + tkAlCaSkimDefaults[0].addParameter("TIDmaxhits", -1); + tkAlCaSkimDefaults[0].addParameter("TOBmaxhits", -1); + tkAlCaSkimDefaults[0].addParameter("TECmaxhits", -1); + desc.addVPSet("NhitsMaxSet", tkAlCaSkimTreeParamsDesc, tkAlCaSkimDefaults); + descriptions.addWithDefaultLabel(desc); +} + // ========= MODULE DEF ============== #include "FWCore/PluginManager/interface/ModuleDef.h" #include "FWCore/Framework/interface/MakerMacros.h" diff --git a/Alignment/TrackerAlignment/scripts/TkAlCaRecoPrescaling.ALCARECOTkAlCosmics0T.tpl b/Alignment/TrackerAlignment/scripts/TkAlCaRecoPrescaling.ALCARECOTkAlCosmics0T.tpl index e3e8616fadd48..6f1443cbe25cd 100644 --- a/Alignment/TrackerAlignment/scripts/TkAlCaRecoPrescaling.ALCARECOTkAlCosmics0T.tpl +++ b/Alignment/TrackerAlignment/scripts/TkAlCaRecoPrescaling.ALCARECOTkAlCosmics0T.tpl @@ -34,7 +34,7 @@ process.source = cms.Source("PoolSource", from CondCore.DBCommon.CondDBSetup_cfi import * process.load('Configuration.EventContent.EventContent_cff') -process.load("Configuration.StandardSequences.Geometry_cff") +process.load("Configuration.StandardSequences.GeometryDB_cff") process.load("Geometry.CMSCommonData.cmsIdealGeometryXML_cfi") process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff") diff --git a/Alignment/TrackerAlignment/scripts/TkAlCaRecoPrescaling.ALCARECOTkAlMinBias.tpl b/Alignment/TrackerAlignment/scripts/TkAlCaRecoPrescaling.ALCARECOTkAlMinBias.tpl index 2f1765fc34c7c..8b5562aeefa9b 100644 --- a/Alignment/TrackerAlignment/scripts/TkAlCaRecoPrescaling.ALCARECOTkAlMinBias.tpl +++ b/Alignment/TrackerAlignment/scripts/TkAlCaRecoPrescaling.ALCARECOTkAlMinBias.tpl @@ -33,7 +33,7 @@ process.source = cms.Source("PoolSource", from CondCore.DBCommon.CondDBSetup_cfi import * process.load('Configuration.EventContent.EventContent_cff') -process.load("Configuration.StandardSequences.Geometry_cff") +process.load("Configuration.StandardSequences.GeometryDB_cff") process.load("Geometry.CMSCommonData.cmsIdealGeometryXML_cfi") process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff") diff --git a/Alignment/TrackerAlignment/scripts/TkAlCaRecoSkimming.ALCARECOTkAlCosmics0T.tpl b/Alignment/TrackerAlignment/scripts/TkAlCaRecoSkimming.ALCARECOTkAlCosmics0T.tpl index 9376ae38c35ef..ed1cc857e7676 100644 --- a/Alignment/TrackerAlignment/scripts/TkAlCaRecoSkimming.ALCARECOTkAlCosmics0T.tpl +++ b/Alignment/TrackerAlignment/scripts/TkAlCaRecoSkimming.ALCARECOTkAlCosmics0T.tpl @@ -35,7 +35,7 @@ process.source = cms.Source("PoolSource", from CondCore.DBCommon.CondDBSetup_cfi import * process.load('Configuration.EventContent.EventContent_cff') -process.load("Configuration.StandardSequences.Geometry_cff") +process.load("Configuration.StandardSequences.GeometryDB_cff") process.load("Geometry.CMSCommonData.cmsIdealGeometryXML_cfi") process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff") diff --git a/Alignment/TrackerAlignment/scripts/TkAlCaRecoSkimming.ALCARECOTkAlMinBias.tpl b/Alignment/TrackerAlignment/scripts/TkAlCaRecoSkimming.ALCARECOTkAlMinBias.tpl index e157808836d61..eef73c524aa22 100644 --- a/Alignment/TrackerAlignment/scripts/TkAlCaRecoSkimming.ALCARECOTkAlMinBias.tpl +++ b/Alignment/TrackerAlignment/scripts/TkAlCaRecoSkimming.ALCARECOTkAlMinBias.tpl @@ -34,7 +34,7 @@ process.source = cms.Source("PoolSource", from CondCore.DBCommon.CondDBSetup_cfi import * process.load('Configuration.EventContent.EventContent_cff') -process.load("Configuration.StandardSequences.Geometry_cff") +process.load("Configuration.StandardSequences.GeometryDB_cff") process.load("Geometry.CMSCommonData.cmsIdealGeometryXML_cfi") process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff") diff --git a/AnalysisAlgos/TrackInfoProducer/interface/TrackInfoProducer.h b/AnalysisAlgos/TrackInfoProducer/interface/TrackInfoProducer.h deleted file mode 100644 index 428c7e380976e..0000000000000 --- a/AnalysisAlgos/TrackInfoProducer/interface/TrackInfoProducer.h +++ /dev/null @@ -1,41 +0,0 @@ -#ifndef TrackInfoProducer_h -#define TrackInfoProducer_h - -// -// Package: RecoTracker/TrackInfoProducer -// Class: TrackInfoProducer -// -// -// Description: Produce TrackInfo from Trajectory -// -// -// Original Author: Chiara Genta -// Created: -// - -#include "AnalysisAlgos/TrackInfoProducer/interface/TrackInfoProducerAlgorithm.h" -#include "FWCore/Framework/interface/EDProducer.h" -#include "FWCore/Framework/interface/Event.h" -#include "FWCore/Framework/interface/EventSetup.h" -#include "FWCore/ParameterSet/interface/ParameterSet.h" -#include "DataFormats/TrackReco/interface/TrackFwd.h" -#include "TrackingTools/PatternTools/interface/Trajectory.h" -#include "TrackingTools/PatternTools/interface/TrajTrackAssociation.h" - -class TrackInfoProducer : public edm::EDProducer { -public: - // TrackInfoProducer(){} - explicit TrackInfoProducer(const edm::ParameterSet& iConfig); - - ~TrackInfoProducer() override{}; - - void produce(edm::Event&, const edm::EventSetup&) override; - -private: - TrackInfoProducerAlgorithm theAlgo_; - edm::EDGetTokenT > TrajectoryToken_; - edm::EDGetTokenT trackCollectionToken_; - edm::EDGetTokenT assoMapToken_; - std::string forwardPredictedStateTag_, backwardPredictedStateTag_, updatedStateTag_, combinedStateTag_; -}; -#endif diff --git a/AnalysisAlgos/TrackInfoProducer/src/SealModules.cc b/AnalysisAlgos/TrackInfoProducer/src/SealModules.cc deleted file mode 100644 index a1b7ae25133a4..0000000000000 --- a/AnalysisAlgos/TrackInfoProducer/src/SealModules.cc +++ /dev/null @@ -1,5 +0,0 @@ -#include "FWCore/Framework/interface/MakerMacros.h" - -#include "AnalysisAlgos/TrackInfoProducer/interface/TrackInfoProducer.h" - -DEFINE_FWK_MODULE(TrackInfoProducer); diff --git a/AnalysisAlgos/TrackInfoProducer/src/TrackInfoProducer.cc b/AnalysisAlgos/TrackInfoProducer/src/TrackInfoProducer.cc index 8f6830c779f8a..fe9a1917484f1 100644 --- a/AnalysisAlgos/TrackInfoProducer/src/TrackInfoProducer.cc +++ b/AnalysisAlgos/TrackInfoProducer/src/TrackInfoProducer.cc @@ -1,15 +1,54 @@ -#include "AnalysisAlgos/TrackInfoProducer/interface/TrackInfoProducer.h" +// +// Package: RecoTracker/TrackInfoProducer +// Class: TrackInfoProducer +// +// +// Description: Produce TrackInfo from Trajectory +// +// +// Original Author: Chiara Genta +// Created: +// + // system include files #include + // user include files -#include "DataFormats/Common/interface/Handle.h" -#include "FWCore/Framework/interface/ESHandle.h" -#include "FWCore/MessageLogger/interface/MessageLogger.h" +#include "AnalysisAlgos/TrackInfoProducer/interface/TrackInfoProducerAlgorithm.h" #include "AnalysisDataFormats/TrackInfo/interface/TrackInfo.h" #include "AnalysisDataFormats/TrackInfo/interface/TrackInfoTrackAssociation.h" +#include "DataFormats/Common/interface/Handle.h" +#include "DataFormats/TrackReco/interface/TrackFwd.h" +#include "FWCore/Framework/interface/MakerMacros.h" +#include "FWCore/Framework/interface/Event.h" +#include "FWCore/Framework/interface/EventSetup.h" +#include "FWCore/Framework/interface/stream/EDProducer.h" +#include "FWCore/MessageLogger/interface/MessageLogger.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" #include "Geometry/Records/interface/TrackerDigiGeometryRecord.h" +#include "TrackingTools/PatternTools/interface/TrajTrackAssociation.h" +#include "TrackingTools/PatternTools/interface/Trajectory.h" + +class TrackInfoProducer : public edm::stream::EDProducer<> { +public: + explicit TrackInfoProducer(const edm::ParameterSet& iConfig); + + ~TrackInfoProducer() override{}; + + void produce(edm::Event&, const edm::EventSetup&) override; + +private: + edm::ESGetToken tkGeomToken_; + TrackInfoProducerAlgorithm theAlgo_; + edm::EDGetTokenT > TrajectoryToken_; + edm::EDGetTokenT trackCollectionToken_; + edm::EDGetTokenT assoMapToken_; + std::string forwardPredictedStateTag_, backwardPredictedStateTag_, updatedStateTag_, combinedStateTag_; +}; + TrackInfoProducer::TrackInfoProducer(const edm::ParameterSet& iConfig) - : theAlgo_(iConfig), + : tkGeomToken_(esConsumes()), + theAlgo_(iConfig), TrajectoryToken_(consumes >(iConfig.getParameter("cosmicTracks"))), trackCollectionToken_(consumes(iConfig.getParameter("cosmicTracks"))), assoMapToken_(consumes(iConfig.getParameter("cosmicTracks"))) { @@ -21,17 +60,14 @@ void TrackInfoProducer::produce(edm::Event& theEvent, const edm::EventSetup& set // // create empty output collections // - std::unique_ptr outputColl(new reco::TrackInfoCollection); + const TrackerGeometry* tracker = &setup.getData(tkGeomToken_); + edm::Handle > TrajectoryCollection; edm::Handle trackCollection; edm::Handle assoMap; - edm::ESHandle tkgeom; - setup.get().get(tkgeom); - const TrackerGeometry* tracker = &(*tkgeom); - theEvent.getByToken(TrajectoryToken_, TrajectoryCollection); theEvent.getByToken(trackCollectionToken_, trackCollection); theEvent.getByToken(assoMapToken_, assoMap); @@ -72,3 +108,5 @@ void TrackInfoProducer::produce(edm::Event& theEvent, const edm::EventSetup& set theEvent.put(std::move(TIassociationColl)); } + +DEFINE_FWK_MODULE(TrackInfoProducer); diff --git a/CUDADataFormats/SiPixelCluster/interface/gpuClusteringConstants.h b/CUDADataFormats/SiPixelCluster/interface/gpuClusteringConstants.h index 77cf567dca681..c0df6cad9bf39 100644 --- a/CUDADataFormats/SiPixelCluster/interface/gpuClusteringConstants.h +++ b/CUDADataFormats/SiPixelCluster/interface/gpuClusteringConstants.h @@ -18,6 +18,7 @@ namespace gpuClustering { constexpr uint16_t maxNumModules = 2000; constexpr int32_t maxNumClustersPerModules = maxHitsInModule(); constexpr uint16_t invalidModuleId = std::numeric_limits::max() - 1; + constexpr int invalidClusterId = -9999; static_assert(invalidModuleId > maxNumModules); // invalidModuleId must be > maxNumModules } // namespace gpuClustering diff --git a/CalibCalorimetry/CaloMiscalibTools/interface/CaloMiscalibMapEcal.h b/CalibCalorimetry/CaloMiscalibTools/interface/CaloMiscalibMapEcal.h index 9ddfdc473c6cf..0ffd75d042e99 100644 --- a/CalibCalorimetry/CaloMiscalibTools/interface/CaloMiscalibMapEcal.h +++ b/CalibCalorimetry/CaloMiscalibTools/interface/CaloMiscalibMapEcal.h @@ -5,7 +5,6 @@ #include "Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h" #include "Geometry/Records/interface/IdealGeometryRecord.h" #include "Geometry/CaloGeometry/interface/CaloGeometry.h" -#include "FWCore/Framework/interface/EDProducer.h" #include "DataFormats/EcalDetId/interface/EBDetId.h" #include "DataFormats/EcalDetId/interface/EEDetId.h" #include diff --git a/CalibCalorimetry/CaloMiscalibTools/interface/CaloMiscalibMapHcal.h b/CalibCalorimetry/CaloMiscalibTools/interface/CaloMiscalibMapHcal.h index e70c7038d491f..4e549db20337b 100644 --- a/CalibCalorimetry/CaloMiscalibTools/interface/CaloMiscalibMapHcal.h +++ b/CalibCalorimetry/CaloMiscalibTools/interface/CaloMiscalibMapHcal.h @@ -4,7 +4,6 @@ #include "Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h" #include "Geometry/Records/interface/IdealGeometryRecord.h" #include "Geometry/CaloGeometry/interface/CaloGeometry.h" -#include "FWCore/Framework/interface/EDProducer.h" #include "DataFormats/HcalDetId/interface/HcalDetId.h" #include "DataFormats/HcalDetId/interface/HcalSubdetector.h" #include "Geometry/CaloTopology/interface/HcalTopology.h" diff --git a/CalibCalorimetry/CaloMiscalibTools/interface/CaloMiscalibTools.h b/CalibCalorimetry/CaloMiscalibTools/interface/CaloMiscalibTools.h index 05b35da8b158b..6f4c36f36074e 100644 --- a/CalibCalorimetry/CaloMiscalibTools/interface/CaloMiscalibTools.h +++ b/CalibCalorimetry/CaloMiscalibTools/interface/CaloMiscalibTools.h @@ -36,7 +36,6 @@ #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "FWCore/Framework/interface/EventSetupRecordIntervalFinder.h" -#include "FWCore/Framework/interface/ESHandle.h" #include "FWCore/Framework/interface/EventSetup.h" #include "CondFormats/EcalObjects/interface/EcalIntercalibConstants.h" #include "CondFormats/DataRecord/interface/EcalIntercalibConstantsRcd.h" diff --git a/CalibCalorimetry/CaloMiscalibTools/interface/CaloMiscalibToolsMC.h b/CalibCalorimetry/CaloMiscalibTools/interface/CaloMiscalibToolsMC.h index da451d3c98cd6..d68efe81f4b57 100644 --- a/CalibCalorimetry/CaloMiscalibTools/interface/CaloMiscalibToolsMC.h +++ b/CalibCalorimetry/CaloMiscalibTools/interface/CaloMiscalibToolsMC.h @@ -36,7 +36,6 @@ #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "FWCore/Framework/interface/EventSetupRecordIntervalFinder.h" -#include "FWCore/Framework/interface/ESHandle.h" #include "FWCore/Framework/interface/EventSetup.h" #include "CondFormats/EcalObjects/interface/EcalIntercalibConstantsMC.h" #include "CondFormats/DataRecord/interface/EcalIntercalibConstantsMCRcd.h" diff --git a/CalibCalorimetry/CaloMiscalibTools/interface/EcalRecHitRecalib.h b/CalibCalorimetry/CaloMiscalibTools/interface/EcalRecHitRecalib.h index b2cc951b731d7..7ea8d207decaa 100644 --- a/CalibCalorimetry/CaloMiscalibTools/interface/EcalRecHitRecalib.h +++ b/CalibCalorimetry/CaloMiscalibTools/interface/EcalRecHitRecalib.h @@ -23,18 +23,21 @@ // user include files #include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/EDProducer.h" +#include "FWCore/Framework/interface/stream/EDProducer.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/MakerMacros.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h" +#include "CondFormats/EcalObjects/interface/EcalIntercalibConstants.h" +#include "CondFormats/DataRecord/interface/EcalIntercalibConstantsRcd.h" // // class decleration // -class EcalRecHitRecalib : public edm::EDProducer { +class EcalRecHitRecalib : public edm::stream::EDProducer<> { public: explicit EcalRecHitRecalib(const edm::ParameterSet &); ~EcalRecHitRecalib() override; @@ -44,13 +47,19 @@ class EcalRecHitRecalib : public edm::EDProducer { private: // ----------member data --------------------------- - std::string ecalHitsProducer_; - std::string barrelHits_; - std::string endcapHits_; - std::string RecalibBarrelHits_; - std::string RecalibEndcapHits_; - double refactor_; - double refactor_mean_; + const std::string ecalHitsProducer_; + const std::string barrelHits_; + const std::string endcapHits_; + const std::string recalibBarrelHits_; + const std::string recalibEndcapHits_; + const double refactor_; + const double refactor_mean_; + + const edm::EDGetTokenT ebRecHitToken_; + const edm::EDGetTokenT eeRecHitToken_; + const edm::ESGetToken intercalibConstsToken_; + const edm::EDPutTokenT barrelHitsToken_; + const edm::EDPutTokenT endcapHitsToken_; }; #endif diff --git a/CalibCalorimetry/CaloMiscalibTools/interface/HcalRecHitRecalib.h b/CalibCalorimetry/CaloMiscalibTools/interface/HcalRecHitRecalib.h index 57874afc9f098..963b370327575 100644 --- a/CalibCalorimetry/CaloMiscalibTools/interface/HcalRecHitRecalib.h +++ b/CalibCalorimetry/CaloMiscalibTools/interface/HcalRecHitRecalib.h @@ -23,7 +23,7 @@ // user include files #include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/EDProducer.h" +#include "FWCore/Framework/interface/stream/EDProducer.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/EventSetup.h" @@ -32,8 +32,9 @@ #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "CalibCalorimetry/CaloMiscalibTools/interface/CaloMiscalibMapHcal.h" #include "DataFormats/HcalRecHit/interface/HcalRecHitCollections.h" +#include "Geometry/Records/interface/HcalRecNumberingRecord.h" -class HcalRecHitRecalib : public edm::EDProducer { +class HcalRecHitRecalib : public edm::stream::EDProducer<> { public: explicit HcalRecHitRecalib(const edm::ParameterSet &); ~HcalRecHitRecalib() override; @@ -42,18 +43,19 @@ class HcalRecHitRecalib : public edm::EDProducer { void produce(edm::Event &, const edm::EventSetup &) override; private: - edm::EDGetTokenT tok_hbhe_; - edm::EDGetTokenT tok_ho_; - edm::EDGetTokenT tok_hf_; - std::string RecalibHBHEHits_; - std::string RecalibHFHits_; - std::string RecalibHOHits_; + const edm::EDGetTokenT tok_hbhe_; + const edm::EDGetTokenT tok_ho_; + const edm::EDGetTokenT tok_hf_; + const edm::ESGetToken topologyToken_; + const std::string recalibHBHEHits_; + const std::string recalibHFHits_; + const std::string recalibHOHits_; std::string hcalfile_; - std::string hcalfileinpath_; + const std::string hcalfileinpath_; CaloMiscalibMapHcal mapHcal_; - double refactor_; - double refactor_mean_; + const double refactor_; + const double refactor_mean_; }; #endif diff --git a/CalibCalorimetry/CaloMiscalibTools/interface/WriteEcalMiscalibConstants.h b/CalibCalorimetry/CaloMiscalibTools/interface/WriteEcalMiscalibConstants.h index a275dcce6c143..1bc733a246728 100644 --- a/CalibCalorimetry/CaloMiscalibTools/interface/WriteEcalMiscalibConstants.h +++ b/CalibCalorimetry/CaloMiscalibTools/interface/WriteEcalMiscalibConstants.h @@ -11,17 +11,20 @@ // user include files #include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/EDAnalyzer.h" +#include "FWCore/Framework/interface/one/EDAnalyzer.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/MakerMacros.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" + +#include "CondFormats/EcalObjects/interface/EcalIntercalibConstants.h" +#include "CondFormats/DataRecord/interface/EcalIntercalibConstantsRcd.h" // // class decleration // -class WriteEcalMiscalibConstants : public edm::EDAnalyzer { +class WriteEcalMiscalibConstants : public edm::one::EDAnalyzer<> { public: explicit WriteEcalMiscalibConstants(const edm::ParameterSet&); ~WriteEcalMiscalibConstants() override; @@ -33,4 +36,6 @@ class WriteEcalMiscalibConstants : public edm::EDAnalyzer { // ----------member data --------------------------- std::string newTagRequest_; + + const edm::ESGetToken intercalibConstsToken_; }; diff --git a/CalibCalorimetry/CaloMiscalibTools/interface/WriteEcalMiscalibConstantsMC.h b/CalibCalorimetry/CaloMiscalibTools/interface/WriteEcalMiscalibConstantsMC.h index 9b4577cdd1053..64eeafacc6011 100644 --- a/CalibCalorimetry/CaloMiscalibTools/interface/WriteEcalMiscalibConstantsMC.h +++ b/CalibCalorimetry/CaloMiscalibTools/interface/WriteEcalMiscalibConstantsMC.h @@ -11,17 +11,20 @@ // user include files #include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/EDAnalyzer.h" +#include "FWCore/Framework/interface/one/EDAnalyzer.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/MakerMacros.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" + +#include "CondFormats/EcalObjects/interface/EcalIntercalibConstantsMC.h" +#include "CondFormats/DataRecord/interface/EcalIntercalibConstantsMCRcd.h" // // class decleration // -class WriteEcalMiscalibConstantsMC : public edm::EDAnalyzer { +class WriteEcalMiscalibConstantsMC : public edm::one::EDAnalyzer<> { public: explicit WriteEcalMiscalibConstantsMC(const edm::ParameterSet&); ~WriteEcalMiscalibConstantsMC() override; @@ -33,4 +36,6 @@ class WriteEcalMiscalibConstantsMC : public edm::EDAnalyzer { // ----------member data --------------------------- std::string newTagRequest_; + + const edm::ESGetToken intercalibConstsToken_; }; diff --git a/CalibCalorimetry/CaloMiscalibTools/plugins/CaloMiscalibTools.cc b/CalibCalorimetry/CaloMiscalibTools/plugins/CaloMiscalibTools.cc index 77c34d8532ee3..0ba0639b1e844 100644 --- a/CalibCalorimetry/CaloMiscalibTools/plugins/CaloMiscalibTools.cc +++ b/CalibCalorimetry/CaloMiscalibTools/plugins/CaloMiscalibTools.cc @@ -25,6 +25,7 @@ // user include files #include "CalibCalorimetry/CaloMiscalibTools/interface/CaloMiscalibTools.h" #include "FWCore/ParameterSet/interface/FileInPath.h" +#include "FWCore/MessageLogger/interface/MessageLogger.h" #include "CalibCalorimetry/CaloMiscalibTools/interface/MiscalibReaderFromXMLEcalBarrel.h" #include "CalibCalorimetry/CaloMiscalibTools/interface/MiscalibReaderFromXMLEcalEndcap.h" @@ -45,8 +46,8 @@ CaloMiscalibTools::CaloMiscalibTools(const edm::ParameterSet& iConfig) { barrelfile_ = barrelfiletmp.fullPath(); endcapfile_ = endcapfiletmp.fullPath(); - std::cout << "Barrel file is:" << barrelfile_ << std::endl; - std::cout << "endcap file is:" << endcapfile_ << std::endl; + edm::LogVerbatim("CaloMiscalibTools") << "Barrel file is:" << barrelfile_; + edm::LogVerbatim("CaloMiscalibTools") << "endcap file is:" << endcapfile_; // added by Zhen (changed since 1_2_0) setWhatProduced(this, &CaloMiscalibTools::produce); @@ -75,9 +76,7 @@ CaloMiscalibTools::ReturnType CaloMiscalibTools::produce(const EcalIntercalibCon endcapreader_.parseXMLMiscalibFile(endcapfile_); map.print(); // Added by Zhen, need a new object so to not be deleted at exit - // std::cout<<"about to copy"<(map.get()); - // std::cout<<"mydata "<(map.get()); - // std::cout<<"mydata "<("ecalRecHitsProducer"); - barrelHits_ = iConfig.getParameter("barrelHitCollection"); - endcapHits_ = iConfig.getParameter("endcapHitCollection"); - RecalibBarrelHits_ = iConfig.getParameter("RecalibBarrelHitCollection"); - RecalibEndcapHits_ = iConfig.getParameter("RecalibEndcapHitCollection"); - refactor_ = iConfig.getUntrackedParameter("Refactor", (double)1); - refactor_mean_ = iConfig.getUntrackedParameter("Refactor_mean", (double)1); - - //register your products - produces(RecalibBarrelHits_); - produces(RecalibEndcapHits_); -} +EcalRecHitRecalib::EcalRecHitRecalib(const edm::ParameterSet& iConfig) + : ecalHitsProducer_(iConfig.getParameter("ecalRecHitsProducer")), + barrelHits_(iConfig.getParameter("barrelHitCollection")), + endcapHits_(iConfig.getParameter("endcapHitCollection")), + recalibBarrelHits_(iConfig.getParameter("RecalibBarrelHitCollection")), + recalibEndcapHits_(iConfig.getParameter("RecalibEndcapHitCollection")), + refactor_(iConfig.getUntrackedParameter("Refactor", (double)1)), + refactor_mean_(iConfig.getUntrackedParameter("Refactor_mean", (double)1)), + ebRecHitToken_(consumes(edm::InputTag(ecalHitsProducer_, barrelHits_))), + eeRecHitToken_(consumes(edm::InputTag(ecalHitsProducer_, endcapHits_))), + intercalibConstsToken_(esConsumes()), + barrelHitsToken_(produces(recalibBarrelHits_)), + endcapHitsToken_(produces(recalibEndcapHits_)) {} EcalRecHitRecalib::~EcalRecHitRecalib() {} @@ -39,14 +33,14 @@ void EcalRecHitRecalib::produce(edm::Event& iEvent, const edm::EventSetup& iSetu const EBRecHitCollection* EBRecHits = nullptr; const EERecHitCollection* EERecHits = nullptr; - iEvent.getByLabel(ecalHitsProducer_, barrelHits_, barrelRecHitsHandle); + iEvent.getByToken(ebRecHitToken_, barrelRecHitsHandle); if (!barrelRecHitsHandle.isValid()) { LogDebug("") << "EcalREcHitMiscalib: Error! can't get product!" << std::endl; } else { EBRecHits = barrelRecHitsHandle.product(); // get a ptr to the product } - iEvent.getByLabel(ecalHitsProducer_, endcapHits_, endcapRecHitsHandle); + iEvent.getByToken(eeRecHitToken_, endcapRecHitsHandle); if (!endcapRecHitsHandle.isValid()) { LogDebug("") << "EcalREcHitMiscalib: Error! can't get product!" << std::endl; } else { @@ -58,21 +52,18 @@ void EcalRecHitRecalib::produce(edm::Event& iEvent, const edm::EventSetup& iSetu auto RecalibEERecHitCollection = std::make_unique(); // Intercalib constants - edm::ESHandle pIcal; - iSetup.get().get(pIcal); - const EcalIntercalibConstants* ical = pIcal.product(); + const EcalIntercalibConstants& ical = iSetup.getData(intercalibConstsToken_); if (EBRecHits) { //loop on all EcalRecHits (barrel) EBRecHitCollection::const_iterator itb; for (itb = EBRecHits->begin(); itb != EBRecHits->end(); ++itb) { // find intercalib constant for this xtal - EcalIntercalibConstantMap::const_iterator icalit = ical->getMap().find(itb->id().rawId()); + EcalIntercalibConstantMap::const_iterator icalit = ical.getMap().find(itb->id().rawId()); EcalIntercalibConstant icalconst = -1; - if (icalit != ical->getMap().end()) { + if (icalit != ical.getMap().end()) { icalconst = (*icalit); - // edm::LogDebug("EcalRecHitRecalib") << "Found intercalib for xtal " << EBDetId(itb->id()) << " " << icalconst ; } else { edm::LogError("EcalRecHitRecalib") << "No intercalib const found for xtal " << EBDetId(itb->id()) @@ -93,12 +84,11 @@ void EcalRecHitRecalib::produce(edm::Event& iEvent, const edm::EventSetup& iSetu EERecHitCollection::const_iterator ite; for (ite = EERecHits->begin(); ite != EERecHits->end(); ++ite) { // find intercalib constant for this xtal - EcalIntercalibConstantMap::const_iterator icalit = ical->getMap().find(ite->id().rawId()); + EcalIntercalibConstantMap::const_iterator icalit = ical.getMap().find(ite->id().rawId()); EcalIntercalibConstant icalconst = -1; - if (icalit != ical->getMap().end()) { + if (icalit != ical.getMap().end()) { icalconst = (*icalit); - // edm:: LogDebug("EcalRecHitRecalib") << "Found intercalib for xtal " << EEDetId(ite->id()) << " " << icalconst ; } else { edm::LogError("EcalRecHitRecalib") << "No intercalib const found for xtal " << EEDetId(ite->id()) << "! something wrong with EcalIntercalibConstants in your DB? "; @@ -115,6 +105,6 @@ void EcalRecHitRecalib::produce(edm::Event& iEvent, const edm::EventSetup& iSetu } //Put Recalibrated rechit in the event - iEvent.put(std::move(RecalibEBRecHitCollection), RecalibBarrelHits_); - iEvent.put(std::move(RecalibEERecHitCollection), RecalibEndcapHits_); + iEvent.put(barrelHitsToken_, std::move(RecalibEBRecHitCollection)); + iEvent.put(endcapHitsToken_, std::move(RecalibEERecHitCollection)); } diff --git a/CalibCalorimetry/CaloMiscalibTools/plugins/HcalRecHitRecalib.cc b/CalibCalorimetry/CaloMiscalibTools/plugins/HcalRecHitRecalib.cc index 9c1dd235f249a..3db40e4805270 100644 --- a/CalibCalorimetry/CaloMiscalibTools/plugins/HcalRecHitRecalib.cc +++ b/CalibCalorimetry/CaloMiscalibTools/plugins/HcalRecHitRecalib.cc @@ -2,52 +2,38 @@ #include "DataFormats/Common/interface/Handle.h" #include "DataFormats/HcalDetId/interface/HcalDetId.h" -#include "Geometry/Records/interface/HcalRecNumberingRecord.h" #include "FWCore/ParameterSet/interface/FileInPath.h" -#include "FWCore/Framework/interface/ESHandle.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" #include "CalibCalorimetry/CaloMiscalibTools/interface/MiscalibReaderFromXMLHcal.h" -HcalRecHitRecalib::HcalRecHitRecalib(const edm::ParameterSet& iConfig) { - tok_hbhe_ = consumes(iConfig.getParameter("hbheInput")); - tok_ho_ = consumes(iConfig.getParameter("hoInput")); - tok_hf_ = consumes(iConfig.getParameter("hfInput")); - - // HBHEHitsProducer_ = iConfig.getParameter< std::string > ("HBHERecHitsProducer"); - // HOHitsProducer_ = iConfig.getParameter< std::string > ("HERecHitsProducer"); - // HFHitsProducer_ = iConfig.getParameter< std::string > ("HERecHitsProducer"); - // HBHEHits_ = iConfig.getParameter< std::string > ("HBHEHitCollection"); - // HFHits_ = iConfig.getParameter< std::string > ("HFHitCollection"); - // HOHits_ = iConfig.getParameter< std::string > ("HOHitCollection"); - - RecalibHBHEHits_ = iConfig.getParameter("RecalibHBHEHitCollection"); - RecalibHFHits_ = iConfig.getParameter("RecalibHFHitCollection"); - RecalibHOHits_ = iConfig.getParameter("RecalibHOHitCollection"); - - refactor_ = iConfig.getUntrackedParameter("Refactor", (double)1); - refactor_mean_ = iConfig.getUntrackedParameter("Refactor_mean", (double)1); - +HcalRecHitRecalib::HcalRecHitRecalib(const edm::ParameterSet& iConfig) + : tok_hbhe_(consumes(iConfig.getParameter("hbheInput"))), + tok_ho_(consumes(iConfig.getParameter("hoInput"))), + tok_hf_(consumes(iConfig.getParameter("hfInput"))), + topologyToken_(esConsumes()), + recalibHBHEHits_(iConfig.getParameter("RecalibHBHEHitCollection")), + recalibHFHits_(iConfig.getParameter("RecalibHFHitCollection")), + recalibHOHits_(iConfig.getParameter("RecalibHOHitCollection")), + hcalfileinpath_(iConfig.getUntrackedParameter("fileNameHcal", "")), + refactor_(iConfig.getUntrackedParameter("Refactor", (double)1)), + refactor_mean_(iConfig.getUntrackedParameter("Refactor_mean", (double)1)) { //register your products - produces(RecalibHBHEHits_); - produces(RecalibHFHits_); - produces(RecalibHOHits_); + produces(recalibHBHEHits_); + produces(recalibHFHits_); + produces(recalibHOHits_); // here read them from xml (particular to HCAL) - - hcalfileinpath_ = iConfig.getUntrackedParameter("fileNameHcal", ""); edm::FileInPath hcalfiletmp("CalibCalorimetry/CaloMiscalibTools/data/" + hcalfileinpath_); - hcalfile_ = hcalfiletmp.fullPath(); } HcalRecHitRecalib::~HcalRecHitRecalib() {} void HcalRecHitRecalib::beginRun(const edm::Run&, const edm::EventSetup& iSetup) { - edm::ESHandle topology; - iSetup.get().get(topology); + const HcalTopology& topology = iSetup.getData(topologyToken_); - mapHcal_.prefillMap(*topology); + mapHcal_.prefillMap(topology); MiscalibReaderFromXMLHcal hcalreader_(mapHcal_); if (!hcalfile_.empty()) @@ -89,46 +75,16 @@ void HcalRecHitRecalib::produce(edm::Event& iEvent, const edm::EventSetup& iSetu HFRecHits = HFRecHitsHandle.product(); // get a ptr to the product } - // iEvent.getByLabel(HBHEHitsProducer_,HBHEHits_,HBHERecHitsHandle); - // HBHERecHits = HBHERecHitsHandle.product(); // get a ptr to the product - - // iEvent.getByLabel(HFHitsProducer_,HFHits_,HFRecHitsHandle); - // HFRecHits = HFRecHitsHandle.product(); // get a ptr to the product - - // iEvent.getByLabel(HOHitsProducer_,HOHits_,HORecHitsHandle); - // HORecHits = HORecHitsHandle.product(); // get a ptr to the product - //Create empty output collections auto RecalibHBHERecHitCollection = std::make_unique(); auto RecalibHFRecHitCollection = std::make_unique(); auto RecalibHORecHitCollection = std::make_unique(); - // Intercalib constants - // edm::ESHandle pIcal; - // iSetup.get().get(pIcal); - // const EcalIntercalibConstants* ical = pIcal.product(); - if (HBHERecHits) { - //loop on all EcalRecHits (barrel) HBHERecHitCollection::const_iterator itHBHE; for (itHBHE = HBHERecHits->begin(); itHBHE != HBHERecHits->end(); ++itHBHE) { - // find intercalib constant for this cell - - // EcalIntercalibConstants::EcalIntercalibConstantMap::const_iterator icalit=ical->getMap().find(itb->id().rawId()); - // EcalIntercalibConstants::EcalIntercalibConstant icalconst; - - // if( icalit!=ical->getMap().end() ){ - // icalconst = icalit->second; - // edm::LogDebug("EcalRecHitMiscalib") << "Found intercalib for xtal " << EBDetId(itb->id()) << " " << icalconst ; - - // } else { - // edm::LogError("EcalRecHitMiscalib") << "No intercalib const found for xtal " << EBDetId(itb->id()) << "! something wrong with EcalIntercalibConstants in your DB? " - // ; - // } - - float icalconst = (mapHcal_.get().find(itHBHE->id().rawId()))->second; // make the rechit with rescaled energy and put in the output collection - + float icalconst = (mapHcal_.get().find(itHBHE->id().rawId()))->second; icalconst = refactor_mean_ + (icalconst - refactor_mean_) * refactor_; //apply additional scaling factor (works if gaussian) HBHERecHit aHit(itHBHE->id(), itHBHE->energy() * icalconst, itHBHE->time()); @@ -138,25 +94,9 @@ void HcalRecHitRecalib::produce(edm::Event& iEvent, const edm::EventSetup& iSetu } if (HFRecHits) { - //loop on all EcalRecHits (barrel) HFRecHitCollection::const_iterator itHF; for (itHF = HFRecHits->begin(); itHF != HFRecHits->end(); ++itHF) { - // find intercalib constant for this cell - - // EcalIntercalibConstants::EcalIntercalibConstantMap::const_iterator icalit=ical->getMap().find(itb->id().rawId()); - // EcalIntercalibConstants::EcalIntercalibConstant icalconst; - - // if( icalit!=ical->getMap().end() ){ - // icalconst = icalit->second; - // edm::LogDebug("EcalRecHitMiscalib") << "Found intercalib for xtal " << EBDetId(itb->id()) << " " << icalconst ; - - // } else { - // edm::LogError("EcalRecHitMiscalib") << "No intercalib const found for xtal " << EBDetId(itb->id()) << "! something wrong with EcalIntercalibConstants in your DB? " - // ; - // } - // make the rechit with rescaled energy and put in the output collection - float icalconst = (mapHcal_.get().find(itHF->id().rawId()))->second; icalconst = refactor_mean_ + (icalconst - refactor_mean_) * refactor_; //apply additional scaling factor (works if gaussian) @@ -167,25 +107,9 @@ void HcalRecHitRecalib::produce(edm::Event& iEvent, const edm::EventSetup& iSetu } if (HORecHits) { - //loop on all EcalRecHits (barrel) HORecHitCollection::const_iterator itHO; for (itHO = HORecHits->begin(); itHO != HORecHits->end(); ++itHO) { - // find intercalib constant for this cell - - // EcalIntercalibConstants::EcalIntercalibConstantMap::const_iterator icalit=ical->getMap().find(itb->id().rawId()); - // EcalIntercalibConstants::EcalIntercalibConstant icalconst; - - // if( icalit!=ical->getMap().end() ){ - // icalconst = icalit->second; - // edm::LogDebug("EcalRecHitMiscalib") << "Found intercalib for xtal " << EBDetId(itb->id()) << " " << icalconst ; - - // } else { - // edm::LogError("EcalRecHitMiscalib") << "No intercalib const found for xtal " << EBDetId(itb->id()) << "! something wrong with EcalIntercalibConstants in your DB? " - // ; - // } - // make the rechit with rescaled energy and put in the output collection - float icalconst = (mapHcal_.get().find(itHO->id().rawId()))->second; icalconst = refactor_mean_ + (icalconst - refactor_mean_) * refactor_; //apply additional scaling factor (works if gaussian) @@ -196,7 +120,7 @@ void HcalRecHitRecalib::produce(edm::Event& iEvent, const edm::EventSetup& iSetu } //Put Recalibrated rechit in the event - iEvent.put(std::move(RecalibHBHERecHitCollection), RecalibHBHEHits_); - iEvent.put(std::move(RecalibHFRecHitCollection), RecalibHFHits_); - iEvent.put(std::move(RecalibHORecHitCollection), RecalibHOHits_); + iEvent.put(std::move(RecalibHBHERecHitCollection), recalibHBHEHits_); + iEvent.put(std::move(RecalibHFRecHitCollection), recalibHFHits_); + iEvent.put(std::move(RecalibHORecHitCollection), recalibHOHits_); } diff --git a/CalibCalorimetry/CaloMiscalibTools/plugins/WriteEcalMiscalibConstants.cc b/CalibCalorimetry/CaloMiscalibTools/plugins/WriteEcalMiscalibConstants.cc index 0847724a04d78..20dfb9bcaf1e9 100644 --- a/CalibCalorimetry/CaloMiscalibTools/plugins/WriteEcalMiscalibConstants.cc +++ b/CalibCalorimetry/CaloMiscalibTools/plugins/WriteEcalMiscalibConstants.cc @@ -16,23 +16,15 @@ // // -// system include files -#include - // user include files - -#include "FWCore/Framework/interface/ESHandle.h" #include "FWCore/Framework/interface/EventSetup.h" +#include "FWCore/MessageLogger/interface/MessageLogger.h" // DB includes #include "FWCore/ServiceRegistry/interface/Service.h" #include "CondCore/DBOutputService/interface/PoolDBOutputService.h" // user include files -#include "CondFormats/EcalObjects/interface/EcalIntercalibConstants.h" -#include "CondFormats/DataRecord/interface/EcalIntercalibConstantsRcd.h" -//For Checks - //this one #include "CalibCalorimetry/CaloMiscalibTools/interface/WriteEcalMiscalibConstants.h" @@ -43,15 +35,10 @@ // // constructors and destructor // -WriteEcalMiscalibConstants::WriteEcalMiscalibConstants(const edm::ParameterSet& iConfig) { - //now do what ever initialization is needed - newTagRequest_ = iConfig.getParameter("NewTagRequest"); -} +WriteEcalMiscalibConstants::WriteEcalMiscalibConstants(const edm::ParameterSet& iConfig) + : newTagRequest_(iConfig.getParameter("NewTagRequest")), intercalibConstsToken_(esConsumes()) {} -WriteEcalMiscalibConstants::~WriteEcalMiscalibConstants() { - // do anything here that needs to be done at desctruction time - // (e.g. close files, deallocate resources etc.) -} +WriteEcalMiscalibConstants::~WriteEcalMiscalibConstants() {} // // member functions @@ -61,20 +48,18 @@ WriteEcalMiscalibConstants::~WriteEcalMiscalibConstants() { void WriteEcalMiscalibConstants::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) { using namespace edm; // Intercalib constants - edm::ESHandle pIcal; - iSetup.get().get(pIcal); - const EcalIntercalibConstants* Mcal = pIcal.product(); + const EcalIntercalibConstants* Mcal = &iSetup.getData(intercalibConstsToken_); edm::Service poolDbService; if (poolDbService.isAvailable()) { if (poolDbService->isNewTagRequest(newTagRequest_)) { - std::cout << " Creating a new one " << std::endl; - poolDbService->createNewIOV( - Mcal, poolDbService->beginOfTime(), poolDbService->endOfTime(), newTagRequest_); - std::cout << "Done" << std::endl; + edm::LogVerbatim("WriteEcalMiscalibConstants") << "Creating a new IOV"; + poolDbService->createNewIOV(*Mcal, poolDbService->beginOfTime(), newTagRequest_); + edm::LogVerbatim("WriteEcalMiscalibConstants") << "Done"; } else { - std::cout << "Old One " << std::endl; - poolDbService->appendSinceTime(Mcal, poolDbService->currentTime(), newTagRequest_); + edm::LogVerbatim("WriteEcalMiscalibConstants") << "Old IOV"; + poolDbService->appendSinceTime( + *Mcal, poolDbService->currentTime(), newTagRequest_); } } } @@ -83,8 +68,4 @@ void WriteEcalMiscalibConstants::analyze(const edm::Event& iEvent, const edm::Ev void WriteEcalMiscalibConstants::beginJob() {} // ------------ method called once each job just after ending the event loop ------------ -void - -WriteEcalMiscalibConstants::endJob() { - std::cout << "Here is the end" << std::endl; -} +void WriteEcalMiscalibConstants::endJob() { edm::LogVerbatim("WriteEcalMiscalibConstants") << "Here is the end"; } diff --git a/CalibCalorimetry/CaloMiscalibTools/plugins/WriteEcalMiscalibConstantsMC.cc b/CalibCalorimetry/CaloMiscalibTools/plugins/WriteEcalMiscalibConstantsMC.cc index f43abd36c1b1c..74896397ca2b7 100644 --- a/CalibCalorimetry/CaloMiscalibTools/plugins/WriteEcalMiscalibConstantsMC.cc +++ b/CalibCalorimetry/CaloMiscalibTools/plugins/WriteEcalMiscalibConstantsMC.cc @@ -16,23 +16,15 @@ // // -// system include files -#include - // user include files - -#include "FWCore/Framework/interface/ESHandle.h" #include "FWCore/Framework/interface/EventSetup.h" +#include "FWCore/MessageLogger/interface/MessageLogger.h" // DB includes #include "FWCore/ServiceRegistry/interface/Service.h" #include "CondCore/DBOutputService/interface/PoolDBOutputService.h" // user include files -#include "CondFormats/EcalObjects/interface/EcalIntercalibConstantsMC.h" -#include "CondFormats/DataRecord/interface/EcalIntercalibConstantsMCRcd.h" -//For Checks - //this one #include "CalibCalorimetry/CaloMiscalibTools/interface/WriteEcalMiscalibConstantsMC.h" @@ -43,15 +35,10 @@ // // constructors and destructor // -WriteEcalMiscalibConstantsMC::WriteEcalMiscalibConstantsMC(const edm::ParameterSet& iConfig) { - //now do what ever initialization is needed - newTagRequest_ = iConfig.getParameter("NewTagRequest"); -} +WriteEcalMiscalibConstantsMC::WriteEcalMiscalibConstantsMC(const edm::ParameterSet& iConfig) + : newTagRequest_(iConfig.getParameter("NewTagRequest")), intercalibConstsToken_(esConsumes()) {} -WriteEcalMiscalibConstantsMC::~WriteEcalMiscalibConstantsMC() { - // do anything here that needs to be done at desctruction time - // (e.g. close files, deallocate resources etc.) -} +WriteEcalMiscalibConstantsMC::~WriteEcalMiscalibConstantsMC() {} // // member functions @@ -61,21 +48,18 @@ WriteEcalMiscalibConstantsMC::~WriteEcalMiscalibConstantsMC() { void WriteEcalMiscalibConstantsMC::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) { using namespace edm; // Intercalib constants - edm::ESHandle pIcal; - iSetup.get().get(pIcal); - const EcalIntercalibConstantsMC* Mcal = pIcal.product(); + const EcalIntercalibConstantsMC* Mcal = &iSetup.getData(intercalibConstsToken_); edm::Service poolDbService; if (poolDbService.isAvailable()) { if (poolDbService->isNewTagRequest(newTagRequest_)) { - std::cout << " Creating a new one " << std::endl; - poolDbService->createNewIOV( - Mcal, poolDbService->beginOfTime(), poolDbService->endOfTime(), newTagRequest_); - std::cout << "Done" << std::endl; + edm::LogVerbatim("WriteEcalMiscalibConstantsMC") << "Creating a new IOV"; + poolDbService->createNewIOV(*Mcal, poolDbService->beginOfTime(), newTagRequest_); + edm::LogVerbatim("WriteEcalMiscalibConstantsMC") << "Done"; } else { - std::cout << "Old One " << std::endl; + edm::LogVerbatim("WriteEcalMiscalibConstantsMC") << "Old IOV"; poolDbService->appendSinceTime( - Mcal, poolDbService->currentTime(), newTagRequest_); + *Mcal, poolDbService->currentTime(), newTagRequest_); } } } @@ -84,8 +68,4 @@ void WriteEcalMiscalibConstantsMC::analyze(const edm::Event& iEvent, const edm:: void WriteEcalMiscalibConstantsMC::beginJob() {} // ------------ method called once each job just after ending the event loop ------------ -void - -WriteEcalMiscalibConstantsMC::endJob() { - std::cout << "Here is the end" << std::endl; -} +void WriteEcalMiscalibConstantsMC::endJob() { edm::LogVerbatim("WriteEcalMiscalibConstantsMC") << "Here is the end"; } diff --git a/CalibCalorimetry/CaloMiscalibTools/test/writeXMLinSqlite.py b/CalibCalorimetry/CaloMiscalibTools/test/writeXMLinSqlite.py index 0c8590990e645..7e670304126ce 100644 --- a/CalibCalorimetry/CaloMiscalibTools/test/writeXMLinSqlite.py +++ b/CalibCalorimetry/CaloMiscalibTools/test/writeXMLinSqlite.py @@ -36,7 +36,7 @@ ) process.prefer("CaloMiscalibTools") -process.WriteInDB = cms.EDFilter("WriteEcalMiscalibConstants", +process.WriteInDB = cms.EDAnalyzer("WriteEcalMiscalibConstants", NewTagRequest = cms.string('EcalIntercalibConstantsRcd') ) diff --git a/CalibCalorimetry/CaloMiscalibTools/test/writeXMLinSqliteMC.py b/CalibCalorimetry/CaloMiscalibTools/test/writeXMLinSqliteMC.py index 7b15c2c40562f..ec3b9b78cbd6d 100644 --- a/CalibCalorimetry/CaloMiscalibTools/test/writeXMLinSqliteMC.py +++ b/CalibCalorimetry/CaloMiscalibTools/test/writeXMLinSqliteMC.py @@ -31,12 +31,12 @@ ) process.CaloMiscalibToolsMC = cms.ESSource("CaloMiscalibToolsMC", - fileNameBarrel = cms.untracked.string('inv_EcalIntercalibConstants_EB_startup.xml'), - fileNameEndcap = cms.untracked.string('inv_EcalIntercalibConstants_EE_startup.xml') + fileNameBarrel = cms.untracked.string('EcalIntercalibConstants_EB_startup.xml'), + fileNameEndcap = cms.untracked.string('EcalIntercalibConstants_EE_startup.xml') ) process.prefer("CaloMiscalibToolsMC") -process.WriteInDB = cms.EDFilter("WriteEcalMiscalibConstantsMC", +process.WriteInDB = cms.EDAnalyzer("WriteEcalMiscalibConstantsMC", NewTagRequest = cms.string('EcalIntercalibConstantsMCRcd') ) diff --git a/CalibCalorimetry/CaloTPG/src/CaloTPGTranscoderULUT.h b/CalibCalorimetry/CaloTPG/interface/CaloTPGTranscoderULUT.h similarity index 100% rename from CalibCalorimetry/CaloTPG/src/CaloTPGTranscoderULUT.h rename to CalibCalorimetry/CaloTPG/interface/CaloTPGTranscoderULUT.h diff --git a/CalibCalorimetry/CaloTPG/plugins/CaloTPGTranscoderULUTs.cc b/CalibCalorimetry/CaloTPG/plugins/CaloTPGTranscoderULUTs.cc index 7547c349fa6b4..99473986f4d62 100644 --- a/CalibCalorimetry/CaloTPG/plugins/CaloTPGTranscoderULUTs.cc +++ b/CalibCalorimetry/CaloTPG/plugins/CaloTPGTranscoderULUTs.cc @@ -25,7 +25,7 @@ #include "FWCore/Framework/interface/ESProducer.h" #include "FWCore/Framework/interface/EventSetupRecordIntervalFinder.h" -#include "CalibCalorimetry/CaloTPG/src/CaloTPGTranscoderULUT.h" +#include "CalibCalorimetry/CaloTPG/interface/CaloTPGTranscoderULUT.h" #include "CalibFormats/CaloTPG/interface/CaloTPGRecord.h" #include "FWCore/Framework/interface/ValidityInterval.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" diff --git a/CalibCalorimetry/CaloTPG/src/CaloTPGTranscoderULUT.cc b/CalibCalorimetry/CaloTPG/src/CaloTPGTranscoderULUT.cc index 48595c5ae9cec..ba934267acdc9 100644 --- a/CalibCalorimetry/CaloTPG/src/CaloTPGTranscoderULUT.cc +++ b/CalibCalorimetry/CaloTPG/src/CaloTPGTranscoderULUT.cc @@ -1,4 +1,4 @@ -#include "CalibCalorimetry/CaloTPG/src/CaloTPGTranscoderULUT.h" +#include "CalibCalorimetry/CaloTPG/interface/CaloTPGTranscoderULUT.h" #include "DataFormats/HcalDetId/interface/HcalGenericDetId.h" #include "FWCore/Utilities/interface/Exception.h" #include "FWCore/Framework/interface/ESTransientHandle.h" diff --git a/CalibCalorimetry/CastorCalib/interface/CastorLedAnalysis.h b/CalibCalorimetry/CastorCalib/interface/CastorLedAnalysis.h index 8171f971a3809..1c679a2b37890 100644 --- a/CalibCalorimetry/CastorCalib/interface/CastorLedAnalysis.h +++ b/CalibCalorimetry/CastorCalib/interface/CastorLedAnalysis.h @@ -2,7 +2,6 @@ #define CastorLedAnalysis_H #include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/EDAnalyzer.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/MakerMacros.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" diff --git a/CalibCalorimetry/CastorCalib/interface/CastorPedestalAnalysis.h b/CalibCalorimetry/CastorCalib/interface/CastorPedestalAnalysis.h index 23e7d055ef289..b26a660041eba 100644 --- a/CalibCalorimetry/CastorCalib/interface/CastorPedestalAnalysis.h +++ b/CalibCalorimetry/CastorCalib/interface/CastorPedestalAnalysis.h @@ -2,7 +2,6 @@ #define CastorPedestalAnalysis_H #include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/EDAnalyzer.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/MakerMacros.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" diff --git a/CalibCalorimetry/CastorCalib/interface/CastorPedestalsAnalysis.h b/CalibCalorimetry/CastorCalib/interface/CastorPedestalsAnalysis.h deleted file mode 100644 index c2273879efb80..0000000000000 --- a/CalibCalorimetry/CastorCalib/interface/CastorPedestalsAnalysis.h +++ /dev/null @@ -1,113 +0,0 @@ -#ifndef CastorPedestalsAnalysis_H -#define CastorPedestalsAnalysis_H - -#include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/EDAnalyzer.h" -#include "FWCore/Framework/interface/Event.h" -#include "FWCore/Framework/interface/MakerMacros.h" -#include "FWCore/Framework/interface/EventSetup.h" -#include "FWCore/ParameterSet/interface/ParameterSet.h" -#include "FWCore/ServiceRegistry/interface/Service.h" -#include "FWCore/Utilities/interface/InputTag.h" - -#include "DataFormats/Common/interface/Handle.h" -#include "DataFormats/HcalDetId/interface/HcalGenericDetId.h" -#include "DataFormats/HcalDetId/interface/HcalElectronicsId.h" -#include "DataFormats/HcalDetId/interface/HcalDetId.h" -#include "DataFormats/HcalDigi/interface/HcalDigiCollections.h" -#include "DataFormats/DetId/interface/DetId.h" -#include "CondFormats/CastorObjects/interface/CastorPedestals.h" -#include "CondFormats/CastorObjects/interface/CastorPedestalWidths.h" -#include "CondFormats/CastorObjects/interface/CastorQIECoder.h" -#include "CondFormats/CastorObjects/interface/CastorQIEData.h" -#include "CondFormats/CastorObjects/interface/CastorQIEShape.h" -#include "CondFormats/CastorObjects/interface/CastorElectronicsMap.h" -#include "CondFormats/CastorObjects/interface/AllObjects.h" - -#include "CalibFormats/CastorObjects/interface/CastorDbRecord.h" -#include "CalibFormats/CastorObjects/interface/CastorDbService.h" -#include "CalibFormats/CastorObjects/interface/CastorCalibrations.h" -#include "CalibFormats/CastorObjects/interface/CastorCalibrationWidths.h" - -// #include "CondTools/Hcal/interface/HcalDbOnline.h" - -#include "CalibCalorimetry/CastorCalib/interface/CastorDbASCIIIO.h" -// #include "CalibCalorimetry/CastorCalib/interface/CastorCondXML.h" -#include "TBDataFormats/HcalTBObjects/interface/HcalTBTriggerData.h" - -#include "TFile.h" -#include "TProfile.h" -#include "TH1.h" -#include "TH2.h" -#include "TCanvas.h" -#include "TStyle.h" - -#include -#include -#include -#include -#include -#include -#include - -namespace edm { - class ParameterSet; - class Event; - class EventSetup; -} // namespace edm - -struct NewPedBunch { - HcalCastorDetId detid; - bool usedflag; - float cap[4]; - float capfc[4]; - float sig[4][4]; - float sigfc[4][4]; - float prod[4][4]; - float prodfc[4][4]; - int num[4][4]; -}; - -class CastorPedestalsAnalysis : public edm::EDAnalyzer { -public: - //Constructor - CastorPedestalsAnalysis(const edm::ParameterSet &ps); - //Destructor - ~CastorPedestalsAnalysis() override; - //Analysis - void analyze(const edm::Event &event, const edm::EventSetup &eventSetup) override; - -private: - //Container for data, 1 per channel - std::vector Bunches; - //Flag for saving histos - bool hiSaveFlag; - bool dumpXML; - bool verboseflag; - int runnum; - int firstTS; - int lastTS; - std::string ROOTfilename; - std::string pedsADCfilename; - std::string pedsfCfilename; - std::string widthsADCfilename; - std::string widthsfCfilename; - std::string XMLfilename; - std::string XMLtag; - std::string ZSfilename; - - edm::ESGetToken tok_cond_; - edm::ESGetToken tok_map_; - - TH1F *CASTORMeans; - TH1F *CASTORWidths; - - // TH2F *dephist[4]; - TH2F *dephist; - - TFile *theFile; - bool firsttime; - - edm::InputTag castorDigiCollectionTag; -}; -#endif diff --git a/CalibCalorimetry/CastorCalib/plugins/BuildFile.xml b/CalibCalorimetry/CastorCalib/plugins/BuildFile.xml index ecd05778404ef..b7f3976ba0c8f 100644 --- a/CalibCalorimetry/CastorCalib/plugins/BuildFile.xml +++ b/CalibCalorimetry/CastorCalib/plugins/BuildFile.xml @@ -1,5 +1,6 @@ + diff --git a/CalibCalorimetry/CastorCalib/plugins/CastorHardcodeCalibrations.cc b/CalibCalorimetry/CastorCalib/plugins/CastorHardcodeCalibrations.cc index ef7426c62de47..0f97bb2751411 100644 --- a/CalibCalorimetry/CastorCalib/plugins/CastorHardcodeCalibrations.cc +++ b/CalibCalorimetry/CastorCalib/plugins/CastorHardcodeCalibrations.cc @@ -1,10 +1,14 @@ // -*- C++ -*- +// ESSource to generate default HCAL/CASTOR calibration objects +// // Original Author: Fedor Ratnikov // Adapted for CASTOR by L. Mundim // -#include #include +#include +#include +#include #include "FWCore/Framework/interface/ValidityInterval.h" #include "DataFormats/HcalDetId/interface/HcalCastorDetId.h" @@ -26,7 +30,35 @@ #include "Geometry/CaloTopology/interface/HcalTopology.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" -#include "CastorHardcodeCalibrations.h" +#include "FWCore/Framework/interface/ESProducer.h" +#include "FWCore/Framework/interface/EventSetupRecordIntervalFinder.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" + +#include "CondFormats/CastorObjects/interface/AllObjects.h" + +class CastorHardcodeCalibrations : public edm::ESProducer, public edm::EventSetupRecordIntervalFinder { +public: + CastorHardcodeCalibrations(const edm::ParameterSet&); + ~CastorHardcodeCalibrations() override; + + void produce(){}; + +protected: + void setIntervalFor(const edm::eventsetup::EventSetupRecordKey&, + const edm::IOVSyncValue&, + edm::ValidityInterval&) override; + + std::unique_ptr producePedestals(const CastorPedestalsRcd& rcd); + std::unique_ptr producePedestalWidths(const CastorPedestalWidthsRcd& rcd); + std::unique_ptr produceGains(const CastorGainsRcd& rcd); + std::unique_ptr produceGainWidths(const CastorGainWidthsRcd& rcd); + std::unique_ptr produceQIEData(const CastorQIEDataRcd& rcd); + std::unique_ptr produceChannelQuality(const CastorChannelQualityRcd& rcd); + std::unique_ptr produceElectronicsMap(const CastorElectronicsMapRcd& rcd); + std::unique_ptr produceRecoParams(const CastorRecoParamsRcd& rcd); + std::unique_ptr produceSaturationCorrs(const CastorSaturationCorrsRcd& rcd); + bool h2mode_; +}; // class declaration // @@ -229,3 +261,8 @@ std::unique_ptr CastorHardcodeCalibrations::produceSatura } return result; } + +#include "FWCore/PluginManager/interface/ModuleDef.h" +#include "FWCore/Framework/interface/SourceFactory.h" + +DEFINE_FWK_EVENTSETUP_SOURCE(CastorHardcodeCalibrations); diff --git a/CalibCalorimetry/CastorCalib/plugins/CastorHardcodeCalibrations.h b/CalibCalorimetry/CastorCalib/plugins/CastorHardcodeCalibrations.h deleted file mode 100644 index c7f2e9aff2779..0000000000000 --- a/CalibCalorimetry/CastorCalib/plugins/CastorHardcodeCalibrations.h +++ /dev/null @@ -1,45 +0,0 @@ -// ESSource to generate default HCAL/CASTOR calibration objects -// -#include -#include - -#include "FWCore/Framework/interface/ESProducer.h" -#include "FWCore/Framework/interface/EventSetupRecordIntervalFinder.h" -#include "FWCore/ParameterSet/interface/ParameterSet.h" - -#include "CondFormats/CastorObjects/interface/AllObjects.h" -class ParameterSet; - -class CastorPedestalsRcd; -class CastorPedestalWidthsRcd; -class CastorGainsRcd; -class CastorGainWidthsRcd; -class CastorQIEDataRcd; -class CastorChannelQualityRcd; -class CastorElectronicsMapRcd; -class CastorRecoParamsRcd; -class CastorSaturationCorrsRcd; - -class CastorHardcodeCalibrations : public edm::ESProducer, public edm::EventSetupRecordIntervalFinder { -public: - CastorHardcodeCalibrations(const edm::ParameterSet&); - ~CastorHardcodeCalibrations() override; - - void produce(){}; - -protected: - void setIntervalFor(const edm::eventsetup::EventSetupRecordKey&, - const edm::IOVSyncValue&, - edm::ValidityInterval&) override; - - std::unique_ptr producePedestals(const CastorPedestalsRcd& rcd); - std::unique_ptr producePedestalWidths(const CastorPedestalWidthsRcd& rcd); - std::unique_ptr produceGains(const CastorGainsRcd& rcd); - std::unique_ptr produceGainWidths(const CastorGainWidthsRcd& rcd); - std::unique_ptr produceQIEData(const CastorQIEDataRcd& rcd); - std::unique_ptr produceChannelQuality(const CastorChannelQualityRcd& rcd); - std::unique_ptr produceElectronicsMap(const CastorElectronicsMapRcd& rcd); - std::unique_ptr produceRecoParams(const CastorRecoParamsRcd& rcd); - std::unique_ptr produceSaturationCorrs(const CastorSaturationCorrsRcd& rcd); - bool h2mode_; -}; diff --git a/CalibCalorimetry/CastorCalib/plugins/CastorPedestalsAnalysis.cc b/CalibCalorimetry/CastorCalib/plugins/CastorPedestalsAnalysis.cc index 05d5fdf0c9b04..9494e7af17f4e 100644 --- a/CalibCalorimetry/CastorCalib/plugins/CastorPedestalsAnalysis.cc +++ b/CalibCalorimetry/CastorCalib/plugins/CastorPedestalsAnalysis.cc @@ -5,11 +5,118 @@ // This code runs 1000x faster and produces all outputs from a single run // (ADC, fC in .txt plus an .xml file) // + +#include "FWCore/Framework/interface/Frameworkfwd.h" +#include "FWCore/Framework/interface/one/EDAnalyzer.h" +#include "FWCore/Framework/interface/Event.h" +#include "FWCore/Framework/interface/MakerMacros.h" +#include "FWCore/Framework/interface/EventSetup.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/ServiceRegistry/interface/Service.h" +#include "FWCore/Utilities/interface/InputTag.h" + +#include "CommonTools/UtilAlgos/interface/TFileService.h" +#include "DataFormats/Common/interface/Handle.h" +#include "DataFormats/HcalDetId/interface/HcalGenericDetId.h" +#include "DataFormats/HcalDetId/interface/HcalElectronicsId.h" +#include "DataFormats/HcalDetId/interface/HcalDetId.h" +#include "DataFormats/HcalDigi/interface/HcalDigiCollections.h" +#include "DataFormats/DetId/interface/DetId.h" +#include "CondFormats/CastorObjects/interface/CastorPedestals.h" +#include "CondFormats/CastorObjects/interface/CastorPedestalWidths.h" +#include "CondFormats/CastorObjects/interface/CastorQIECoder.h" +#include "CondFormats/CastorObjects/interface/CastorQIEData.h" +#include "CondFormats/CastorObjects/interface/CastorQIEShape.h" +#include "CondFormats/CastorObjects/interface/CastorElectronicsMap.h" +#include "CondFormats/CastorObjects/interface/AllObjects.h" + +#include "CalibFormats/CastorObjects/interface/CastorDbRecord.h" +#include "CalibFormats/CastorObjects/interface/CastorDbService.h" +#include "CalibFormats/CastorObjects/interface/CastorCalibrations.h" +#include "CalibFormats/CastorObjects/interface/CastorCalibrationWidths.h" + +#include "CalibCalorimetry/CastorCalib/interface/CastorDbASCIIIO.h" +#include "TBDataFormats/HcalTBObjects/interface/HcalTBTriggerData.h" + +#include "TProfile.h" +#include "TH1.h" +#include "TH2.h" +#include "TCanvas.h" +#include "TStyle.h" + +#include +#include +#include #include -#include "CalibCalorimetry/CastorCalib/interface/CastorPedestalsAnalysis.h" +#include +#include +#include +#include + +namespace edm { + class ParameterSet; + class Event; + class EventSetup; +} // namespace edm + +struct NewPedBunch { + HcalCastorDetId detid; + bool usedflag; + float cap[4]; + float capfc[4]; + float sig[4][4]; + float sigfc[4][4]; + float prod[4][4]; + float prodfc[4][4]; + int num[4][4]; +}; + +class CastorPedestalsAnalysis : public edm::one::EDAnalyzer { +public: + //Constructor + CastorPedestalsAnalysis(const edm::ParameterSet& ps); + //Destructor + ~CastorPedestalsAnalysis() override; + //Analysis + void analyze(const edm::Event& event, const edm::EventSetup& eventSetup) override; + +private: + //Container for data, 1 per channel + std::vector Bunches; + //Flag for saving histos + bool hiSaveFlag; + bool dumpXML; + bool verboseflag; + int runnum; + int firstTS; + int lastTS; + std::string ROOTfilename; + std::string pedsADCfilename; + std::string pedsfCfilename; + std::string widthsADCfilename; + std::string widthsfCfilename; + std::string XMLfilename; + std::string XMLtag; + std::string ZSfilename; + + edm::ESGetToken tok_cond_; + edm::ESGetToken tok_map_; + + TH1F* CASTORMeans; + TH1F* CASTORWidths; + + // TH2F *dephist[4]; + TH2F* dephist; + + bool firsttime; + + edm::InputTag castorDigiCollectionTag; +}; CastorPedestalsAnalysis::CastorPedestalsAnalysis(const edm::ParameterSet& ps) : castorDigiCollectionTag(ps.getParameter("castorDigiCollectionTag")) { + usesResource(TFileService::kSharedResource); + hiSaveFlag = ps.getUntrackedParameter("hiSaveFlag", false); dumpXML = ps.getUntrackedParameter("dumpXML", false); verboseflag = ps.getUntrackedParameter("verbose", false); @@ -187,6 +294,7 @@ CastorPedestalsAnalysis::~CastorPedestalsAnalysis() { // CastorCondXML::dumpObject (outStream5, runnum, runnum, runnum, XMLtag, 1, (*rawPedsItem), (*rawWidthsItem)); } + /* if (hiSaveFlag) { theFile->Write(); } else { @@ -197,6 +305,7 @@ CastorPedestalsAnalysis::~CastorPedestalsAnalysis() { } theFile->cd(); dephist->Write(); + */ dephist->SetDrawOption("colz"); dephist->GetXaxis()->SetTitle("module"); dephist->GetYaxis()->SetTitle("sector"); @@ -246,9 +355,11 @@ CastorPedestalsAnalysis::~CastorPedestalsAnalysis() { //dephist[3]->SetDrawOption("colz"); c2->SaveAs(name2.c_str()); */ + /* std::cout << "Writing ROOT file... "; theFile->Close(); std::cout << "ROOT file closed.\n"; + */ } // ------------ method called to for each event ------------ @@ -273,20 +384,23 @@ void CastorPedestalsAnalysis::analyze(const edm::Event& e, const edm::EventSetup XMLfilename = runnum_string + "-peds_ADC_complete.xml"; XMLtag = "Castor_pedestals_" + runnum_string; + edm::Service fs; + fs->mkdir("CASTOR"); + /* theFile = new TFile(ROOTfilename.c_str(), "RECREATE"); theFile->cd(); // Create sub-directories theFile->mkdir("CASTOR"); theFile->cd(); - - CASTORMeans = new TH1F("All Ped Means CASTOR", "All Ped Means CASTOR", 100, 0, 9); - CASTORWidths = new TH1F("All Ped Widths CASTOR", "All Ped Widths CASTOR", 100, 0, 3); - - dephist = new TH2F("Pedestals (ADC)", "All Castor", 14, 0., 14.5, 16, .5, 16.5); - // dephist[0] = new TH2F("Pedestals (ADC)","Depth 1",89, -44, 44, 72, .5, 72.5); - // dephist[1] = new TH2F("Pedestals (ADC)","Depth 2",89, -44, 44, 72, .5, 72.5); - // dephist[2] = new TH2F("Pedestals (ADC)","Depth 3",89, -44, 44, 72, .5, 72.5); - // dephist[3] = new TH2F("Pedestals (ADC)","Depth 4",89, -44, 44, 72, .5, 72.5); + */ + CASTORMeans = fs->make("All Ped Means CASTOR", "All Ped Means CASTOR", 100, 0, 9); + CASTORWidths = fs->make("All Ped Widths CASTOR", "All Ped Widths CASTOR", 100, 0, 3); + + dephist = fs->make("Pedestals (ADC)", "All Castor", 14, 0., 14.5, 16, .5, 16.5); + // dephist[0] = fs->make("Pedestals (ADC)","Depth 1",89, -44, 44, 72, .5, 72.5); + // dephist[1] = fs->make("Pedestals (ADC)","Depth 2",89, -44, 44, 72, .5, 72.5); + // dephist[2] = fs->make("Pedestals (ADC)","Depth 3",89, -44, 44, 72, .5, 72.5); + // dephist[3] = fs->make("Pedestals (ADC)","Depth 4",89, -44, 44, 72, .5, 72.5); const CastorElectronicsMap* myRefEMap = &iSetup.getData(tok_map_); std::vector listEMap = myRefEMap->allPrecisionId(); diff --git a/CalibCalorimetry/CastorCalib/plugins/CastorTextCalibrations.cc b/CalibCalorimetry/CastorCalib/plugins/CastorTextCalibrations.cc index e6dcdab50acbb..cf6b8e1651a8b 100644 --- a/CalibCalorimetry/CastorCalib/plugins/CastorTextCalibrations.cc +++ b/CalibCalorimetry/CastorCalib/plugins/CastorTextCalibrations.cc @@ -1,9 +1,14 @@ +#include #include #include #include +#include #include "FWCore/Utilities/interface/Exception.h" +#include "FWCore/Framework/interface/ESProducer.h" +#include "FWCore/Framework/interface/EventSetupRecordIntervalFinder.h" #include "FWCore/ParameterSet/interface/FileInPath.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" #include "FWCore/Framework/interface/ValidityInterval.h" @@ -27,7 +32,31 @@ #include "CondFormats/DataRecord/interface/CastorRecoParamsRcd.h" #include "CondFormats/DataRecord/interface/CastorSaturationCorrsRcd.h" -#include "CastorTextCalibrations.h" +class CastorTextCalibrations : public edm::ESProducer, public edm::EventSetupRecordIntervalFinder { +public: + CastorTextCalibrations(const edm::ParameterSet&); + ~CastorTextCalibrations() override; + + void produce(){}; + +protected: + void setIntervalFor(const edm::eventsetup::EventSetupRecordKey&, + const edm::IOVSyncValue&, + edm::ValidityInterval&) override; + + std::unique_ptr producePedestals(const CastorPedestalsRcd& rcd); + std::unique_ptr producePedestalWidths(const CastorPedestalWidthsRcd& rcd); + std::unique_ptr produceGains(const CastorGainsRcd& rcd); + std::unique_ptr produceGainWidths(const CastorGainWidthsRcd& rcd); + std::unique_ptr produceQIEData(const CastorQIEDataRcd& rcd); + std::unique_ptr produceChannelQuality(const CastorChannelQualityRcd& rcd); + std::unique_ptr produceElectronicsMap(const CastorElectronicsMapRcd& rcd); + std::unique_ptr produceRecoParams(const CastorRecoParamsRcd& rcd); + std::unique_ptr produceSaturationCorrs(const CastorSaturationCorrsRcd& rcd); + +private: + std::map mInputs; +}; // // class decleration // @@ -144,3 +173,8 @@ std::unique_ptr CastorTextCalibrations::produceSaturation const CastorSaturationCorrsRcd& rcd) { return produce_impl(mInputs["SaturationCorrs"]); } + +#include "FWCore/PluginManager/interface/ModuleDef.h" +#include "FWCore/Framework/interface/SourceFactory.h" + +DEFINE_FWK_EVENTSETUP_SOURCE(CastorTextCalibrations); diff --git a/CalibCalorimetry/CastorCalib/plugins/CastorTextCalibrations.h b/CalibCalorimetry/CastorCalib/plugins/CastorTextCalibrations.h deleted file mode 100644 index a8206fcb7cefb..0000000000000 --- a/CalibCalorimetry/CastorCalib/plugins/CastorTextCalibrations.h +++ /dev/null @@ -1,57 +0,0 @@ -#include -#include - -#include "FWCore/Framework/interface/ESProducer.h" -#include "FWCore/Framework/interface/EventSetupRecordIntervalFinder.h" -#include "FWCore/ParameterSet/interface/ParameterSet.h" - -class ParameterSet; - -class CastorPedestals; -class CastorPedestalWidths; -//class CastorGains; -//class CastorGainWidths; -class CastorQIEData; -//class CastorChannelQuality; -class CastorElectronicsMap; - -class CastorPedestalsRcd; -class CastorPedestalWidthsRcd; -class CastorGainsRcd; -class CastorGainWidthsRcd; -class CastorQIEDataRcd; -class CastorChannelQualityRcd; -class CastorElectronicsMapRcd; -class CastorRecoParamsRcd; -class CastorSaturationCorrsRcd; -class CastorGains; -class CastorGainWidths; -class CastorChannelQuality; -class CastorRecoParams; -class CastorSaturationCorrs; - -class CastorTextCalibrations : public edm::ESProducer, public edm::EventSetupRecordIntervalFinder { -public: - CastorTextCalibrations(const edm::ParameterSet&); - ~CastorTextCalibrations() override; - - void produce(){}; - -protected: - void setIntervalFor(const edm::eventsetup::EventSetupRecordKey&, - const edm::IOVSyncValue&, - edm::ValidityInterval&) override; - - std::unique_ptr producePedestals(const CastorPedestalsRcd& rcd); - std::unique_ptr producePedestalWidths(const CastorPedestalWidthsRcd& rcd); - std::unique_ptr produceGains(const CastorGainsRcd& rcd); - std::unique_ptr produceGainWidths(const CastorGainWidthsRcd& rcd); - std::unique_ptr produceQIEData(const CastorQIEDataRcd& rcd); - std::unique_ptr produceChannelQuality(const CastorChannelQualityRcd& rcd); - std::unique_ptr produceElectronicsMap(const CastorElectronicsMapRcd& rcd); - std::unique_ptr produceRecoParams(const CastorRecoParamsRcd& rcd); - std::unique_ptr produceSaturationCorrs(const CastorSaturationCorrsRcd& rcd); - -private: - std::map mInputs; -}; diff --git a/CalibCalorimetry/CastorCalib/plugins/SealModule.cc b/CalibCalorimetry/CastorCalib/plugins/SealModule.cc deleted file mode 100644 index db06b3a5e80a6..0000000000000 --- a/CalibCalorimetry/CastorCalib/plugins/SealModule.cc +++ /dev/null @@ -1,8 +0,0 @@ -#include "FWCore/PluginManager/interface/ModuleDef.h" -#include "FWCore/Framework/interface/SourceFactory.h" - -#include "CastorHardcodeCalibrations.h" -#include "CastorTextCalibrations.h" - -DEFINE_FWK_EVENTSETUP_SOURCE(CastorHardcodeCalibrations); -DEFINE_FWK_EVENTSETUP_SOURCE(CastorTextCalibrations); diff --git a/CalibCalorimetry/CastorCalib/test/castor_localrun_pedestals_cfg.py b/CalibCalorimetry/CastorCalib/test/castor_localrun_pedestals_cfg.py index bf1ad1c0716f3..05d64a21c50b9 100644 --- a/CalibCalorimetry/CastorCalib/test/castor_localrun_pedestals_cfg.py +++ b/CalibCalorimetry/CastorCalib/test/castor_localrun_pedestals_cfg.py @@ -115,6 +115,9 @@ castorDigiCollectionTag = cms.InputTag('castorDigis') ) +process.TFileService = cms.Service("TFileService", + fileName = cms.string('castorDigis.root') +) process.load("FWCore.MessageService.MessageLogger_cfi") process.MessageLogger.cerr.enable = False diff --git a/CalibCalorimetry/EcalLaserAnalyzer/plugins/EcalABAnalyzer.cc b/CalibCalorimetry/EcalLaserAnalyzer/plugins/EcalABAnalyzer.cc index f376d10524991..dca17f7b11474 100644 --- a/CalibCalorimetry/EcalLaserAnalyzer/plugins/EcalABAnalyzer.cc +++ b/CalibCalorimetry/EcalLaserAnalyzer/plugins/EcalABAnalyzer.cc @@ -16,27 +16,16 @@ #include "CalibCalorimetry/EcalLaserAnalyzer/plugins/EcalABAnalyzer.h" #include -#include #include #include -#include #include -#include - -#include #include - -#include -#include - #include #include #include -#include #include #include -#include #include #include @@ -52,7 +41,12 @@ using namespace std; EcalABAnalyzer::EcalABAnalyzer(const edm::ParameterSet& iConfig) //======================================================================== : iEvent(0), - + eventHeaderCollection_(iConfig.getParameter("eventHeaderCollection")), + eventHeaderProducer_(iConfig.getParameter("eventHeaderProducer")), + digiCollection_(iConfig.getParameter("digiCollection")), + digiProducer_(iConfig.getParameter("digiProducer")), + rawDataToken_(consumes(edm::InputTag(eventHeaderProducer_, eventHeaderCollection_))), + mappingToken_(esConsumes()), // framework parameters with default values _nsamples(iConfig.getUntrackedParameter("nSamples", 10)), _presample(iConfig.getUntrackedParameter("nPresamples", 2)), @@ -73,8 +67,10 @@ EcalABAnalyzer::EcalABAnalyzer(const edm::ParameterSet& iConfig) _noise(iConfig.getUntrackedParameter("noise", 2.0)), _chi2cut(iConfig.getUntrackedParameter("chi2cut", 100.0)), _ecalPart(iConfig.getUntrackedParameter("ecalPart", "EB")), + _fedid(iConfig.getUntrackedParameter("fedId", -999)), _qualpercent(iConfig.getUntrackedParameter("qualPercent", 0.2)), _debug(iConfig.getUntrackedParameter("debug", 0)), + resdir_(iConfig.getUntrackedParameter("resDir")), nCrys(NCRYSEB), runType(-1), runNum(0), @@ -92,15 +88,11 @@ EcalABAnalyzer::EcalABAnalyzer(const edm::ParameterSet& iConfig) //======================================================================== { - // Initialization from cfg file - - resdir_ = iConfig.getUntrackedParameter("resDir"); - - digiCollection_ = iConfig.getParameter("digiCollection"); - digiProducer_ = iConfig.getParameter("digiProducer"); - - eventHeaderCollection_ = iConfig.getParameter("eventHeaderCollection"); - eventHeaderProducer_ = iConfig.getParameter("eventHeaderProducer"); + if (_ecalPart == "EB") { + ebDigiToken_ = consumes(edm::InputTag(digiProducer_, digiCollection_)); + } else if (_ecalPart == "EE") { + eeDigiToken_ = consumes(edm::InputTag(digiProducer_, digiCollection_)); + } // Geometrical constants initialization @@ -236,12 +228,12 @@ void EcalABAnalyzer::analyze(const edm::Event& e, const edm::EventSetup& c) { // retrieving DCC header edm::Handle pDCCHeader; const EcalRawDataCollection* DCCHeader = nullptr; - try { - e.getByLabel(eventHeaderProducer_, eventHeaderCollection_, pDCCHeader); + e.getByToken(rawDataToken_, pDCCHeader); + if (!pDCCHeader.isValid()) { + edm::LogError("nodata") << "Error! can't get the product retrieving DCC header" << eventHeaderCollection_.c_str() + << " " << eventHeaderProducer_.c_str(); + } else { DCCHeader = pDCCHeader.product(); - } catch (std::exception& ex) { - std::cerr << "Error! can't get the product retrieving DCC header" << eventHeaderCollection_.c_str() << " " - << eventHeaderProducer_.c_str() << std::endl; } //retrieving crystal data from Event @@ -250,33 +242,26 @@ void EcalABAnalyzer::analyze(const edm::Event& e, const edm::EventSetup& c) { edm::Handle pEEDigi; const EEDigiCollection* EEDigi = nullptr; if (_ecalPart == "EB") { - try { - e.getByLabel(digiProducer_, digiCollection_, pEBDigi); + e.getByToken(ebDigiToken_, pEBDigi); + if (!pEBDigi.isValid()) { + edm::LogError("nodata") << "Error! can't get the product retrieving EB crystal data " << digiCollection_.c_str(); + } else { EBDigi = pEBDigi.product(); - } catch (std::exception& ex) { - std::cerr << "Error! can't get the product retrieving EB crystal data " << digiCollection_.c_str() << std::endl; } } else if (_ecalPart == "EE") { - try { - e.getByLabel(digiProducer_, digiCollection_, pEEDigi); + e.getByToken(eeDigiToken_, pEEDigi); + if (!pEEDigi.isValid()) { + edm::LogError("nodata") << "Error! can't get the product retrieving EE crystal data " << digiCollection_.c_str(); + } else { EEDigi = pEEDigi.product(); - } catch (std::exception& ex) { - std::cerr << "Error! can't get the product retrieving EE crystal data " << digiCollection_.c_str() << std::endl; } } else { - std::cout << " Wrong ecalPart in cfg file " << std::endl; + edm::LogError("cfg_error") << " Wrong ecalPart in cfg file"; return; } // retrieving electronics mapping - edm::ESHandle ecalmapping; - const EcalElectronicsMapping* TheMapping = nullptr; - try { - c.get().get(ecalmapping); - TheMapping = ecalmapping.product(); - } catch (std::exception& ex) { - std::cerr << "Error! can't get the product EcalMappingRcd" << std::endl; - } + const auto& TheMapping = c.getData(mappingToken_); // ============================= // Decode DCCHeader Information @@ -363,7 +348,7 @@ void EcalABAnalyzer::analyze(const edm::Event& e, const edm::EventSetup& c) { // Recover the TT id and the electronic crystal numbering from EcalElectronicsMapping - EcalElectronicsId elecid_crystal = TheMapping->getElectronicsId(id_crystal); + EcalElectronicsId elecid_crystal = TheMapping.getElectronicsId(id_crystal); int towerID = elecid_crystal.towerId(); int strip = elecid_crystal.stripId(); @@ -445,7 +430,7 @@ void EcalABAnalyzer::analyze(const edm::Event& e, const edm::EventSetup& c) { int iY = (eta - 1) / 5 + 1; side = MEEEGeom::side(iX, iY, iZ); - EcalElectronicsId elecid_crystal = TheMapping->getElectronicsId(id_crystal); + EcalElectronicsId elecid_crystal = TheMapping.getElectronicsId(id_crystal); int towerID = elecid_crystal.towerId(); int channelID = elecid_crystal.channelId() - 1; @@ -472,7 +457,7 @@ void EcalABAnalyzer::analyze(const edm::Event& e, const edm::EventSetup& c) { //=========== if ((*digiItr).size() > 10) - std::cout << "SAMPLES SIZE > 10!" << (*digiItr).size() << std::endl; + edm::LogVerbatim("EcalABAnalyzer") << "SAMPLES SIZE > 10!" << (*digiItr).size(); // Loop on adc samples @@ -522,8 +507,8 @@ void EcalABAnalyzer::analyze(const edm::Event& e, const edm::EventSetup& c) { void EcalABAnalyzer::endJob() { //======================================================================== - std::cout << "\n\t+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+" << std::endl; - std::cout << "\t+=+ Analyzing data: getting (alpha, beta) +=+" << std::endl; + edm::LogVerbatim("EcalABAnalyzer") << "\n\t+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+"; + edm::LogVerbatim("EcalABAnalyzer") << "\t+=+ Analyzing data: getting (alpha, beta) +=+"; // Adjust channel numbers for EE //=============================== @@ -551,8 +536,8 @@ void EcalABAnalyzer::endJob() { //====================== if (_fitab) { - std::cout << "\n\t+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+" << std::endl; - std::cout << "\t+=+ Analyzing data: getting (alpha, beta) +=+" << std::endl; + edm::LogVerbatim("EcalABAnalyzer") << "\n\t+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+"; + edm::LogVerbatim("EcalABAnalyzer") << "\t+=+ Analyzing data: getting (alpha, beta) +=+"; TFile* fAB = nullptr; TTree* ABInit = nullptr; if (doesABTreeExist) { @@ -595,12 +580,12 @@ void EcalABAnalyzer::endJob() { isTimingOK = false; if (!isGainOK) - std::cout << "\t+=+ ............................ WARNING! APD GAIN WAS NOT 1 +=+" << std::endl; + edm::LogVerbatim("EcalABAnalyzer") << "\t+=+ ............................ WARNING! APD GAIN WAS NOT 1 +=+"; if (!isTimingOK) - std::cout << "\t+=+ ............................ WARNING! TIMING WAS BAD +=+" << std::endl; + edm::LogVerbatim("EcalABAnalyzer") << "\t+=+ ............................ WARNING! TIMING WAS BAD +=+"; - std::cout << "\t+=+ .................................... done +=+" << std::endl; - std::cout << "\t+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+" << std::endl; + edm::LogVerbatim("EcalABAnalyzer") << "\t+=+ .................................... done +=+"; + edm::LogVerbatim("EcalABAnalyzer") << "\t+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+"; } } diff --git a/CalibCalorimetry/EcalLaserAnalyzer/plugins/EcalABAnalyzer.h b/CalibCalorimetry/EcalLaserAnalyzer/plugins/EcalABAnalyzer.h index 219082aa12653..8cc3b857fe180 100644 --- a/CalibCalorimetry/EcalLaserAnalyzer/plugins/EcalABAnalyzer.h +++ b/CalibCalorimetry/EcalLaserAnalyzer/plugins/EcalABAnalyzer.h @@ -1,5 +1,5 @@ -#ifndef EcalABAnalyzer_h_ -#define EcalABAnalyzer_h_ +#ifndef CalibCalorimetry_EcalLaserAnalyzer_EcalABAnalyzer_h +#define CalibCalorimetry_EcalLaserAnalyzer_EcalABAnalyzer_h // $Id: EcalABAnalyzer.h @@ -7,7 +7,12 @@ #include #include -#include +#include + +#include +#include +#include +#include class TShapeAnalysis; class TAPDPulse; @@ -32,7 +37,7 @@ class TMom; // "EE" geometry #define NCRYSEE 830 // Number of crystals per EE supermodule -class EcalABAnalyzer : public edm::EDAnalyzer { +class EcalABAnalyzer : public edm::one::EDAnalyzer<> { public: explicit EcalABAnalyzer(const edm::ParameterSet &iConfig); ~EcalABAnalyzer() override; @@ -46,40 +51,46 @@ class EcalABAnalyzer : public edm::EDAnalyzer { private: int iEvent; + const std::string eventHeaderCollection_; + const std::string eventHeaderProducer_; + const std::string digiCollection_; + const std::string digiProducer_; + + const edm::EDGetTokenT rawDataToken_; + edm::EDGetTokenT ebDigiToken_; + edm::EDGetTokenT eeDigiToken_; + const edm::ESGetToken mappingToken_; + // Framework parameters - unsigned int _nsamples; + const unsigned int _nsamples; unsigned int _presample; - unsigned int _firstsample; - unsigned int _lastsample; - unsigned int _timingcutlow; - unsigned int _timingcuthigh; - unsigned int _timingquallow; - unsigned int _timingqualhigh; - double _ratiomincutlow; - double _ratiomincuthigh; - double _ratiomaxcutlow; - double _presamplecut; - unsigned int _niter; - double _alpha; - double _beta; - unsigned int _nevtmax; - double _noise; - double _chi2cut; - std::string _ecalPart; - int _fedid; - double _qualpercent; - int _debug; + const unsigned int _firstsample; + const unsigned int _lastsample; + const unsigned int _timingcutlow; + const unsigned int _timingcuthigh; + const unsigned int _timingquallow; + const unsigned int _timingqualhigh; + const double _ratiomincutlow; + const double _ratiomincuthigh; + const double _ratiomaxcutlow; + const double _presamplecut; + const unsigned int _niter; + const double _alpha; + const double _beta; + const unsigned int _nevtmax; + const double _noise; + const double _chi2cut; + const std::string _ecalPart; + const int _fedid; + const double _qualpercent; + const int _debug; TAPDPulse *APDPulse; TMom *Delta01; TMom *Delta12; - std::string resdir_; - std::string digiCollection_; - std::string digiProducer_; - std::string eventHeaderCollection_; - std::string eventHeaderProducer_; + const std::string resdir_; // Output file names diff --git a/CalibCalorimetry/EcalLaserAnalyzer/plugins/EcalLaserAnalyzer.cc b/CalibCalorimetry/EcalLaserAnalyzer/plugins/EcalLaserAnalyzer.cc index 12042a2be2c0f..78f9ea713a32d 100644 --- a/CalibCalorimetry/EcalLaserAnalyzer/plugins/EcalLaserAnalyzer.cc +++ b/CalibCalorimetry/EcalLaserAnalyzer/plugins/EcalLaserAnalyzer.cc @@ -16,28 +16,18 @@ #include "CalibCalorimetry/EcalLaserAnalyzer/plugins/EcalLaserAnalyzer.h" #include -#include #include #include #include -#include -#include #include -#include -#include - #include #include #include -#include #include #include -#include - -#include #include #include @@ -56,9 +46,15 @@ EcalLaserAnalyzer::EcalLaserAnalyzer(const edm::ParameterSet& iConfig) //======================================================================== : iEvent(0), - + eventHeaderCollection_(iConfig.getParameter("eventHeaderCollection")), + eventHeaderProducer_(iConfig.getParameter("eventHeaderProducer")), + digiCollection_(iConfig.getParameter("digiCollection")), + digiProducer_(iConfig.getParameter("digiProducer")), + digiPNCollection_(iConfig.getParameter("digiPNCollection")), + rawDataToken_(consumes(edm::InputTag(eventHeaderProducer_, eventHeaderCollection_))), + pnDiodeDigiToken_(consumes(edm::InputTag(digiProducer_))), + mappingToken_(esConsumes()), // Framework parameters with default values - _nsamples(iConfig.getUntrackedParameter("nSamples", 10)), _presample(iConfig.getUntrackedParameter("nPresamples", 2)), _firstsample(iConfig.getUntrackedParameter("firstSample", 1)), @@ -88,6 +84,8 @@ EcalLaserAnalyzer::EcalLaserAnalyzer(const edm::ParameterSet& iConfig) _saveallevents(iConfig.getUntrackedParameter("saveAllEvents", false)), _qualpercent(iConfig.getUntrackedParameter("qualPercent", 0.2)), _debug(iConfig.getUntrackedParameter("debug", 0)), + resdir_(iConfig.getUntrackedParameter("resDir")), + pncorfile_(iConfig.getUntrackedParameter("pnCorFile")), nCrys(NCRYSEB), nPNPerMod(NPNPERMOD), nMod(NMODEE), @@ -117,17 +115,11 @@ EcalLaserAnalyzer::EcalLaserAnalyzer(const edm::ParameterSet& iConfig) //======================================================================== { - // Initialization from cfg file - - resdir_ = iConfig.getUntrackedParameter("resDir"); - pncorfile_ = iConfig.getUntrackedParameter("pnCorFile"); - - digiCollection_ = iConfig.getParameter("digiCollection"); - digiPNCollection_ = iConfig.getParameter("digiPNCollection"); - digiProducer_ = iConfig.getParameter("digiProducer"); - - eventHeaderCollection_ = iConfig.getParameter("eventHeaderCollection"); - eventHeaderProducer_ = iConfig.getParameter("eventHeaderProducer"); + if (_ecalPart == "EB") { + ebDigiToken_ = consumes(edm::InputTag(digiProducer_, digiCollection_)); + } else if (_ecalPart == "EE") { + eeDigiToken_ = consumes(edm::InputTag(digiProducer_, digiCollection_)); + } // Geometrical constants initialization @@ -318,64 +310,52 @@ void EcalLaserAnalyzer::analyze(const edm::Event& e, const edm::EventSetup& c) { ++iEvent; // retrieving DCC header - edm::Handle pDCCHeader; const EcalRawDataCollection* DCCHeader = nullptr; - try { - e.getByLabel(eventHeaderProducer_, eventHeaderCollection_, pDCCHeader); + e.getByToken(rawDataToken_, pDCCHeader); + if (!pDCCHeader.isValid()) { + edm::LogError("nodata") << "Error! can't get the product retrieving DCC header" << eventHeaderCollection_.c_str() + << " " << eventHeaderProducer_.c_str(); + } else { DCCHeader = pDCCHeader.product(); - } catch (std::exception& ex) { - std::cerr << "Error! can't get the product retrieving DCC header" << eventHeaderCollection_.c_str() << " " - << eventHeaderProducer_.c_str() << std::endl; } //retrieving crystal data from Event - edm::Handle pEBDigi; const EBDigiCollection* EBDigi = nullptr; edm::Handle pEEDigi; const EEDigiCollection* EEDigi = nullptr; - if (_ecalPart == "EB") { - try { - e.getByLabel(digiProducer_, digiCollection_, pEBDigi); + e.getByToken(ebDigiToken_, pEBDigi); + if (!pEBDigi.isValid()) { + edm::LogError("nodata") << "Error! can't get the product retrieving EB crystal data " << digiCollection_.c_str(); + } else { EBDigi = pEBDigi.product(); - } catch (std::exception& ex) { - std::cerr << "Error! can't get the product retrieving EB crystal data " << digiCollection_.c_str() << std::endl; } } else if (_ecalPart == "EE") { - try { - e.getByLabel(digiProducer_, digiCollection_, pEEDigi); + e.getByToken(eeDigiToken_, pEEDigi); + if (!pEEDigi.isValid()) { + edm::LogError("nodata") << "Error! can't get the product retrieving EE crystal data " << digiCollection_.c_str(); + } else { EEDigi = pEEDigi.product(); - } catch (std::exception& ex) { - std::cerr << "Error! can't get the product retrieving EE crystal data " << digiCollection_.c_str() << std::endl; } } else { - std::cout << " Wrong ecalPart in cfg file " << std::endl; + edm::LogError("cfg_error") << " Wrong ecalPart in cfg file "; return; } // retrieving crystal PN diodes from Event - edm::Handle pPNDigi; const EcalPnDiodeDigiCollection* PNDigi = nullptr; - try { - e.getByLabel(digiProducer_, pPNDigi); + e.getByToken(pnDiodeDigiToken_, pPNDigi); + if (!pPNDigi.isValid()) { + edm::LogError("nodata") << "Error! can't get the product " << digiPNCollection_.c_str(); + } else { PNDigi = pPNDigi.product(); - } catch (std::exception& ex) { - std::cerr << "Error! can't get the product " << digiPNCollection_.c_str() << std::endl; } // retrieving electronics mapping - - edm::ESHandle ecalmapping; - const EcalElectronicsMapping* TheMapping = nullptr; - try { - c.get().get(ecalmapping); - TheMapping = ecalmapping.product(); - } catch (std::exception& ex) { - std::cerr << "Error! can't get the product EcalMappingRcd" << std::endl; - } + const auto& TheMapping = c.getData(mappingToken_); // ============================ // Decode DCCHeader Information @@ -418,7 +398,7 @@ void EcalLaserAnalyzer::analyze(const edm::Event& e, const edm::EventSetup& c) { std::vector::iterator iter = find(colors.begin(), colors.end(), color); if (iter == colors.end()) { colors.push_back(color); - std::cout << " new color found " << color << " " << colors.size() << std::endl; + edm::LogVerbatim("EcalLaserAnalyzer") << " new color found " << color << " " << colors.size(); } } @@ -451,8 +431,8 @@ void EcalLaserAnalyzer::analyze(const edm::Event& e, const edm::EventSetup& c) { EcalPnDiodeDetId pnDetId = EcalPnDiodeDetId((*pnItr).id()); if (_debug == 1) - std::cout << "-- debug -- Inside PNDigi - pnID=" << pnDetId.iPnId() << ", dccID=" << pnDetId.iDCCId() - << std::endl; + edm::LogVerbatim("EcalLaserAnalyzer") + << "-- debug -- Inside PNDigi - pnID=" << pnDetId.iPnId() << ", dccID=" << pnDetId.iDCCId(); // Skip MEM DCC without relevant data @@ -472,7 +452,7 @@ void EcalLaserAnalyzer::analyze(const edm::Event& e, const edm::EventSetup& c) { } if (pnGain != 1) - std::cout << "PN gain different from 1" << std::endl; + edm::LogVerbatim("EcalLaserAnalyzer") << "PN gain different from 1"; // Calculate amplitude from pulse @@ -497,7 +477,7 @@ void EcalLaserAnalyzer::analyze(const edm::Event& e, const edm::EventSetup& c) { allPNAmpl[pnDetId.iDCCId()].push_back(pnAmpl); if (_debug == 1) - std::cout << "-- debug -- Inside PNDigi - PNampl=" << pnAmpl << ", PNgain=" << pnGain << std::endl; + edm::LogVerbatim("EcalLaserAnalyzer") << "-- debug -- Inside PNDigi - PNampl=" << pnAmpl << ", PNgain=" << pnGain; } // =========================== @@ -516,7 +496,7 @@ void EcalLaserAnalyzer::analyze(const edm::Event& e, const edm::EventSetup& c) { EBDetId id_crystal(digiItr->id()); EBDataFrame df(*digiItr); - EcalElectronicsId elecid_crystal = TheMapping->getElectronicsId(id_crystal); + EcalElectronicsId elecid_crystal = TheMapping.getElectronicsId(id_crystal); int etaG = id_crystal.ieta(); // global int phiG = id_crystal.iphi(); // global @@ -545,8 +525,9 @@ void EcalLaserAnalyzer::analyze(const edm::Event& e, const edm::EventSetup& c) { setGeomEB(etaG, phiG, module, tower, strip, xtal, apdRefTT, channel, lmr); if (_debug == 1) - std::cout << "-- debug -- Inside EBDigi - towerID:" << towerID << " channelID:" << channelID - << " module:" << module << " modules:" << modules.size() << std::endl; + edm::LogVerbatim("EcalLaserAnalyzer") + << "-- debug -- Inside EBDigi - towerID:" << towerID << " channelID:" << channelID << " module:" << module + << " modules:" << modules.size(); // APD Pulse //=========== @@ -619,7 +600,7 @@ void EcalLaserAnalyzer::analyze(const edm::Event& e, const edm::EventSetup& c) { EEDetId id_crystal(digiItr->id()); EEDataFrame df(*digiItr); - EcalElectronicsId elecid_crystal = TheMapping->getElectronicsId(id_crystal); + EcalElectronicsId elecid_crystal = TheMapping.getElectronicsId(id_crystal); int etaG = id_crystal.iy(); int phiG = id_crystal.ix(); @@ -652,14 +633,15 @@ void EcalLaserAnalyzer::analyze(const edm::Event& e, const edm::EventSetup& c) { setGeomEE(etaG, phiG, iX, iY, iZ, module, tower, ch, apdRefTT, channel, lmr); if (_debug == 1) - std::cout << "-- debug -- Inside EEDigi - towerID:" << towerID << " channelID:" << channelID - << " module:" << module << " modules:" << modules.size() << std::endl; + edm::LogVerbatim("EcalLaserAnalyzer") + << "-- debug -- Inside EEDigi - towerID:" << towerID << " channelID:" << channelID << " module:" << module + << " modules:" << modules.size(); // APD Pulse //=========== if ((*digiItr).size() > 10) - std::cout << "SAMPLES SIZE > 10!" << (*digiItr).size() << std::endl; + edm::LogVerbatim("EcalLaserAnalyzer") << "SAMPLES SIZE > 10!" << (*digiItr).size(); // Loop on adc samples @@ -753,8 +735,8 @@ void EcalLaserAnalyzer::endJob() { //====================== if (_fitab) { - std::cout << "\n\t+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+" << std::endl; - std::cout << "\t+=+ Analyzing data: getting (alpha, beta) +=+" << std::endl; + edm::LogVerbatim("EcalLaserAnalyzer") << "\n\t+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+"; + edm::LogVerbatim("EcalLaserAnalyzer") << "\t+=+ Analyzing data: getting (alpha, beta) +=+"; TFile* fAB = nullptr; TTree* ABInit = nullptr; if (doesABTreeExist) { @@ -764,8 +746,8 @@ void EcalLaserAnalyzer::endJob() { ABInit = (TTree*)fAB->Get("ABCol0"); } shapana->computeShape(alphafile, ABInit); - std::cout << "\t+=+ .................................... done +=+" << std::endl; - std::cout << "\t+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+" << std::endl; + edm::LogVerbatim("EcalLaserAnalyzer") << "\t+=+ .................................... done +=+"; + edm::LogVerbatim("EcalLaserAnalyzer") << "\t+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+"; } // Don't do anything if there is no events @@ -776,7 +758,7 @@ void EcalLaserAnalyzer::endJob() { std::stringstream del; del << "rm " << ADCfile; system(del.str().c_str()); - std::cout << " No Laser Events " << std::endl; + edm::LogVerbatim("EcalLaserAnalyzer") << " No Laser Events "; return; } @@ -815,13 +797,13 @@ void EcalLaserAnalyzer::endJob() { // Analyze adc samples to get amplitudes //======================================= - std::cout << "\n\t+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+" << std::endl; - std::cout << "\t+=+ Analyzing laser data: getting APD, PN, APD/PN, PN/PN +=+" << std::endl; + edm::LogVerbatim("EcalLaserAnalyzer") << "\n\t+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+"; + edm::LogVerbatim("EcalLaserAnalyzer") << "\t+=+ Analyzing laser data: getting APD, PN, APD/PN, PN/PN +=+"; if (!isGainOK) - std::cout << "\t+=+ ............................ WARNING! APD GAIN WAS NOT 1 +=+" << std::endl; + edm::LogVerbatim("EcalLaserAnalyzer") << "\t+=+ ............................ WARNING! APD GAIN WAS NOT 1 +=+"; if (!isTimingOK) - std::cout << "\t+=+ ............................ WARNING! TIMING WAS BAD +=+" << std::endl; + edm::LogVerbatim("EcalLaserAnalyzer") << "\t+=+ ............................ WARNING! TIMING WAS BAD +=+"; APDFile = new TFile(APDfile.c_str(), "RECREATE"); @@ -993,7 +975,7 @@ void EcalLaserAnalyzer::endJob() { } if (_debug == 1) - std::cout << "-- debug test -- apdAmpl=" << apdAmpl << ", apdTime=" << apdTime << std::endl; + edm::LogVerbatim("EcalLaserAnalyzer") << "-- debug test -- apdAmpl=" << apdAmpl << ", apdTime=" << apdTime; double pnmean; if (pn0 < 10 && pn1 > 10) { pnmean = pn1; @@ -1003,7 +985,7 @@ void EcalLaserAnalyzer::endJob() { pnmean = 0.5 * (pn0 + pn1); if (_debug == 1) - std::cout << "-- debug test -- pn0=" << pn0 << ", pn1=" << pn1 << std::endl; + edm::LogVerbatim("EcalLaserAnalyzer") << "-- debug test -- pn0=" << pn0 << ", pn1=" << pn1; // Fill PN stuff //=============== @@ -1224,7 +1206,7 @@ void EcalLaserAnalyzer::endJob() { //=================== if (_debug == 1) - std::cout << "-- debug test -- Last Loop event:" << event << " apdAmpl:" << apdAmpl << std::endl; + edm::LogVerbatim("EcalLaserAnalyzer") << "-- debug test -- Last Loop event:" << event << " apdAmpl:" << apdAmpl; apdAmplA = 0.0; apdAmplB = 0.0; @@ -1233,8 +1215,9 @@ void EcalLaserAnalyzer::endJob() { } if (_debug == 1) - std::cout << "-- debug test -- Last Loop apdAmplA:" << apdAmplA << " apdAmplB:" << apdAmplB - << ", event:" << event << ", eventref:" << eventref << std::endl; + edm::LogVerbatim("EcalLaserAnalyzer") + << "-- debug test -- Last Loop apdAmplA:" << apdAmplA << " apdAmplB:" << apdAmplB << ", event:" << event + << ", eventref:" << eventref; // Fill APD stuff //=============== @@ -1350,8 +1333,8 @@ void EcalLaserAnalyzer::endJob() { resFile->Close(); - std::cout << "\t+=+ .................................................. done +=+" << std::endl; - std::cout << "\t+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+" << std::endl; + edm::LogVerbatim("EcalLaserAnalyzer") << "\t+=+ .................................................. done +=+"; + edm::LogVerbatim("EcalLaserAnalyzer") << "\t+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+"; } void EcalLaserAnalyzer::setGeomEB( diff --git a/CalibCalorimetry/EcalLaserAnalyzer/plugins/EcalLaserAnalyzer.h b/CalibCalorimetry/EcalLaserAnalyzer/plugins/EcalLaserAnalyzer.h index 259897fd07bb1..5f17cbca450bd 100644 --- a/CalibCalorimetry/EcalLaserAnalyzer/plugins/EcalLaserAnalyzer.h +++ b/CalibCalorimetry/EcalLaserAnalyzer/plugins/EcalLaserAnalyzer.h @@ -1,3 +1,5 @@ +#ifndef CalibCalorimetry_EcalLaserAnalyzer_EcalLaserAnalyzer_h +#define CalibCalorimetry_EcalLaserAnalyzer_EcalLaserAnalyzer_h // $Id: EcalLaserAnalyzer.h #include @@ -5,7 +7,12 @@ #include #include -#include +#include + +#include +#include +#include +#include class TFile; class TTree; @@ -44,7 +51,7 @@ class TMem; #define NSIDES 2 // Number of sides #define NREFCHAN 2 // Ref number for APDB -class EcalLaserAnalyzer : public edm::EDAnalyzer { +class EcalLaserAnalyzer : public edm::one::EDAnalyzer<> { public: explicit EcalLaserAnalyzer(const edm::ParameterSet &iConfig); ~EcalLaserAnalyzer() override; @@ -62,37 +69,49 @@ class EcalLaserAnalyzer : public edm::EDAnalyzer { private: int iEvent; + const std::string eventHeaderCollection_; + const std::string eventHeaderProducer_; + const std::string digiCollection_; + const std::string digiProducer_; + const std::string digiPNCollection_; + + const edm::EDGetTokenT rawDataToken_; + edm::EDGetTokenT ebDigiToken_; + edm::EDGetTokenT eeDigiToken_; + const edm::EDGetTokenT pnDiodeDigiToken_; + const edm::ESGetToken mappingToken_; + // Framework parameters - unsigned int _nsamples; + const unsigned int _nsamples; unsigned int _presample; - unsigned int _firstsample; - unsigned int _lastsample; - unsigned int _nsamplesPN; - unsigned int _presamplePN; - unsigned int _firstsamplePN; - unsigned int _lastsamplePN; - unsigned int _timingcutlow; - unsigned int _timingcuthigh; - unsigned int _timingquallow; - unsigned int _timingqualhigh; - double _ratiomincutlow; - double _ratiomincuthigh; - double _ratiomaxcutlow; - double _presamplecut; - unsigned int _niter; + const unsigned int _firstsample; + const unsigned int _lastsample; + const unsigned int _nsamplesPN; + const unsigned int _presamplePN; + const unsigned int _firstsamplePN; + const unsigned int _lastsamplePN; + const unsigned int _timingcutlow; + const unsigned int _timingcuthigh; + const unsigned int _timingquallow; + const unsigned int _timingqualhigh; + const double _ratiomincutlow; + const double _ratiomincuthigh; + const double _ratiomaxcutlow; + const double _presamplecut; + const unsigned int _niter; bool _fitab; - double _alpha; - double _beta; - unsigned int _nevtmax; - double _noise; - double _chi2cut; - std::string _ecalPart; - bool _docorpn; - int _fedid; - bool _saveallevents; - double _qualpercent; - int _debug; + const double _alpha; + const double _beta; + const unsigned int _nevtmax; + const double _noise; + const double _chi2cut; + const std::string _ecalPart; + const bool _docorpn; + const int _fedid; + const bool _saveallevents; + const double _qualpercent; + const int _debug; TAPDPulse *APDPulse; TPNPulse *PNPulse; @@ -102,13 +121,8 @@ class EcalLaserAnalyzer : public edm::EDAnalyzer { bool doesABTreeExist; - std::string resdir_; - std::string pncorfile_; - std::string digiCollection_; - std::string digiPNCollection_; - std::string digiProducer_; - std::string eventHeaderCollection_; - std::string eventHeaderProducer_; + const std::string resdir_; + const std::string pncorfile_; // Output file names @@ -232,3 +246,4 @@ class EcalLaserAnalyzer : public edm::EDAnalyzer { bool isGainOK; bool isTimingOK; }; +#endif diff --git a/CalibCalorimetry/EcalLaserAnalyzer/plugins/EcalLaserAnalyzer2.cc b/CalibCalorimetry/EcalLaserAnalyzer/plugins/EcalLaserAnalyzer2.cc index cd5a6ce560a3e..b3f78c55771c0 100644 --- a/CalibCalorimetry/EcalLaserAnalyzer/plugins/EcalLaserAnalyzer2.cc +++ b/CalibCalorimetry/EcalLaserAnalyzer/plugins/EcalLaserAnalyzer2.cc @@ -1,5 +1,6 @@ /* * \class EcalLaserAnalyzer2 + * * primary author: Julie Malcles - CEA/Saclay * author: Gautier Hamel De Monchenault - CEA/Saclay */ @@ -15,28 +16,18 @@ #include "CalibCalorimetry/EcalLaserAnalyzer/plugins/EcalLaserAnalyzer2.h" #include -#include -#include #include +#include #include -#include -#include #include -#include -#include - #include #include #include -#include #include #include -#include - -#include #include #include @@ -56,8 +47,15 @@ using namespace std; EcalLaserAnalyzer2::EcalLaserAnalyzer2(const edm::ParameterSet& iConfig) //======================================================================== : iEvent(0), - - // framework parameters with default values + eventHeaderCollection_(iConfig.getParameter("eventHeaderCollection")), + eventHeaderProducer_(iConfig.getParameter("eventHeaderProducer")), + digiCollection_(iConfig.getParameter("digiCollection")), + digiProducer_(iConfig.getParameter("digiProducer")), + digiPNCollection_(iConfig.getParameter("digiPNCollection")), + rawDataToken_(consumes(edm::InputTag(eventHeaderProducer_, eventHeaderCollection_))), + pnDiodeDigiToken_(consumes(edm::InputTag(digiProducer_, digiPNCollection_))), + mappingToken_(esConsumes()), + // Framework parameters with default values _nsamples(iConfig.getUntrackedParameter("nSamples", 10)), _presample(iConfig.getUntrackedParameter("nPresamples", 2)), _firstsample(iConfig.getUntrackedParameter("firstSample", 1)), @@ -83,6 +81,9 @@ EcalLaserAnalyzer2::EcalLaserAnalyzer2(const edm::ParameterSet& iConfig) _saveallevents(iConfig.getUntrackedParameter("saveAllEvents", false)), _qualpercent(iConfig.getUntrackedParameter("qualPercent", 0.2)), _debug(iConfig.getUntrackedParameter("debug", 0)), + resdir_(iConfig.getUntrackedParameter("resDir")), + elecfile_(iConfig.getUntrackedParameter("elecFile")), + pncorfile_(iConfig.getUntrackedParameter("pnCorFile")), nCrys(NCRYSEB), nPNPerMod(NPNPERMOD), nMod(NMODEB), @@ -116,18 +117,11 @@ EcalLaserAnalyzer2::EcalLaserAnalyzer2(const edm::ParameterSet& iConfig) //======================================================================== { - // Initialization from cfg file - - resdir_ = iConfig.getUntrackedParameter("resDir"); - elecfile_ = iConfig.getUntrackedParameter("elecFile"); - pncorfile_ = iConfig.getUntrackedParameter("pnCorFile"); - - digiCollection_ = iConfig.getParameter("digiCollection"); - digiPNCollection_ = iConfig.getParameter("digiPNCollection"); - digiProducer_ = iConfig.getParameter("digiProducer"); - - eventHeaderCollection_ = iConfig.getParameter("eventHeaderCollection"); - eventHeaderProducer_ = iConfig.getParameter("eventHeaderProducer"); + if (_ecalPart == "EB") { + ebDigiToken_ = consumes(edm::InputTag(digiProducer_, digiCollection_)); + } else if (_ecalPart == "EE") { + eeDigiToken_ = consumes(edm::InputTag(digiProducer_, digiCollection_)); + } // Geometrical constants initialization if (_ecalPart == "EB") { @@ -198,7 +192,7 @@ EcalLaserAnalyzer2::EcalLaserAnalyzer2(const edm::ParameterSet& iConfig) EcalLaserAnalyzer2::~EcalLaserAnalyzer2() { //======================================================================== - // do anything here that needs to be done at desctruction time + // do anything here that needs to be done at destruction time // (e.g. close files, deallocate resources etc.) } @@ -267,7 +261,7 @@ void EcalLaserAnalyzer2::beginJob() { IsMatacqOK = getShapes(); if (!IsMatacqOK) { - cout << " ERROR! No matacq shape available: analysis aborted !" << endl; + edm::LogError("noshape") << " ERROR! No matacq shape available: analysis aborted !"; return; } @@ -285,11 +279,11 @@ void EcalLaserAnalyzer2::analyze(const edm::Event& e, const edm::EventSetup& c) // retrieving DCC header edm::Handle pDCCHeader; const EcalRawDataCollection* DCCHeader = nullptr; - try { - e.getByLabel(eventHeaderProducer_, eventHeaderCollection_, pDCCHeader); + e.getByToken(rawDataToken_, pDCCHeader); + if (!pDCCHeader.isValid()) { + edm::LogError("nodata") << "Error! can't get the product retrieving DCC header" << eventHeaderCollection_.c_str(); + } else { DCCHeader = pDCCHeader.product(); - } catch (std::exception& ex) { - std::cerr << "Error! can't get the product retrieving DCC header" << eventHeaderCollection_.c_str() << std::endl; } //retrieving crystal data from Event @@ -297,46 +291,37 @@ void EcalLaserAnalyzer2::analyze(const edm::Event& e, const edm::EventSetup& c) const EBDigiCollection* EBDigi = nullptr; edm::Handle pEEDigi; const EEDigiCollection* EEDigi = nullptr; - if (_ecalPart == "EB") { - try { - e.getByLabel(digiProducer_, digiCollection_, pEBDigi); + e.getByToken(ebDigiToken_, pEBDigi); + if (!pEBDigi.isValid()) { + edm::LogError("nodata") << "Error! can't get the product retrieving EB crystal data " << digiCollection_.c_str(); + } else { EBDigi = pEBDigi.product(); - } catch (std::exception& ex) { - std::cerr << "Error! can't get the product retrieving EB crystal data " << digiCollection_.c_str() << std::endl; } } else if (_ecalPart == "EE") { - try { - e.getByLabel(digiProducer_, digiCollection_, pEEDigi); + e.getByToken(eeDigiToken_, pEEDigi); + if (!pEEDigi.isValid()) { + edm::LogError("nodata") << "Error! can't get the product retrieving EE crystal data " << digiCollection_.c_str(); + } else { EEDigi = pEEDigi.product(); - } catch (std::exception& ex) { - std::cerr << "Error! can't get the product retrieving EE crystal data " << digiCollection_.c_str() << std::endl; } } else { - cout << " Wrong ecalPart in cfg file " << endl; + edm::LogError("cfg_error") << " Wrong ecalPart in cfg file "; return; } // retrieving crystal PN diodes from Event - edm::Handle pPNDigi; const EcalPnDiodeDigiCollection* PNDigi = nullptr; - try { - e.getByLabel(digiProducer_, digiPNCollection_, pPNDigi); + e.getByToken(pnDiodeDigiToken_, pPNDigi); + if (!pPNDigi.isValid()) { + edm::LogError("nodata") << "Error! can't get the product " << digiPNCollection_.c_str(); + } else { PNDigi = pPNDigi.product(); - } catch (std::exception& ex) { - std::cerr << "Error! can't get the product " << digiPNCollection_.c_str() << std::endl; } // retrieving electronics mapping - edm::ESHandle ecalmapping; - const EcalElectronicsMapping* TheMapping = nullptr; - try { - c.get().get(ecalmapping); - TheMapping = ecalmapping.product(); - } catch (std::exception& ex) { - std::cerr << "Error! can't get the product EcalMappingRcd" << std::endl; - } + const auto& TheMapping = c.getData(mappingToken_); // ==================================== // Decode Basic DCCHeader Information @@ -379,7 +364,7 @@ void EcalLaserAnalyzer2::analyze(const edm::Event& e, const edm::EventSetup& c) vector::iterator iter = find(colors.begin(), colors.end(), color); if (iter == colors.end()) { colors.push_back(color); - cout << " new color found " << color << " " << colors.size() << endl; + edm::LogVerbatim("EcalLaserAnalyzer2") << " new color found " << color << " " << colors.size(); } } @@ -417,7 +402,8 @@ void EcalLaserAnalyzer2::analyze(const edm::Event& e, const edm::EventSetup& c) EcalPnDiodeDetId pnDetId = EcalPnDiodeDetId((*pnItr).id()); if (_debug == 1) - cout << "-- debug test -- Inside PNDigi - pnID=" << pnDetId.iPnId() << ", dccID=" << pnDetId.iDCCId() << endl; + edm::LogVerbatim("EcalLaserAnalyzer2") + << "-- debug test -- Inside PNDigi - pnID=" << pnDetId.iPnId() << ", dccID=" << pnDetId.iDCCId(); // Skip MEM DCC without relevant data @@ -437,7 +423,7 @@ void EcalLaserAnalyzer2::analyze(const edm::Event& e, const edm::EventSetup& c) } if (pnGain != 1) - cout << "PN gain different from 1" << endl; + edm::LogVerbatim("EcalLaserAnalyzer2") << "PN gain different from 1"; // Calculate amplitude from pulse @@ -462,7 +448,8 @@ void EcalLaserAnalyzer2::analyze(const edm::Event& e, const edm::EventSetup& c) allPNAmpl[pnDetId.iDCCId()].push_back(pnAmpl); if (_debug == 1) - cout << "-- debug -- Inside PNDigi - PNampl=" << pnAmpl << ", PNgain=" << pnGain << endl; + edm::LogVerbatim("EcalLaserAnalyzer2") + << "-- debug -- Inside PNDigi - PNampl=" << pnAmpl << ", PNgain=" << pnGain; } // =========================== @@ -483,7 +470,7 @@ void EcalLaserAnalyzer2::analyze(const edm::Event& e, const edm::EventSetup& c) EBDetId id_crystal(digiItr->id()); EBDataFrame df(*digiItr); - EcalElectronicsId elecid_crystal = TheMapping->getElectronicsId(id_crystal); + EcalElectronicsId elecid_crystal = TheMapping.getElectronicsId(id_crystal); int etaG = id_crystal.ieta(); // global int phiG = id_crystal.iphi(); // global @@ -512,8 +499,9 @@ void EcalLaserAnalyzer2::analyze(const edm::Event& e, const edm::EventSetup& c) setGeomEB(etaG, phiG, module, tower, strip, xtal, apdRefTT, channel, lmr); if (_debug == 1) - cout << "-- debug -- Inside EBDigi - towerID:" << towerID << " channelID:" << channelID << " module:" << module - << " modules:" << modules.size() << endl; + edm::LogVerbatim("EcalLaserAnalyzer2") + << "-- debug -- Inside EBDigi - towerID:" << towerID << " channelID:" << channelID << " module:" << module + << " modules:" << modules.size(); // APD Pulse //=========== @@ -567,6 +555,7 @@ void EcalLaserAnalyzer2::analyze(const edm::Event& e, const edm::EventSetup& c) Delta12->addEntry(APDPulse->getDelta(1, 2)); } } + } else if (EEDigi) { // Loop on crystals //=================== @@ -577,7 +566,7 @@ void EcalLaserAnalyzer2::analyze(const edm::Event& e, const edm::EventSetup& c) EEDetId id_crystal(digiItr->id()); EEDataFrame df(*digiItr); - EcalElectronicsId elecid_crystal = TheMapping->getElectronicsId(id_crystal); + EcalElectronicsId elecid_crystal = TheMapping.getElectronicsId(id_crystal); int etaG = id_crystal.iy(); int phiG = id_crystal.ix(); @@ -610,14 +599,15 @@ void EcalLaserAnalyzer2::analyze(const edm::Event& e, const edm::EventSetup& c) setGeomEE(etaG, phiG, iX, iY, iZ, module, tower, ch, apdRefTT, channel, lmr); if (_debug == 1) - cout << "-- debug -- Inside EEDigi - towerID:" << towerID << " channelID:" << channelID << " module:" << module - << " modules:" << modules.size() << endl; + edm::LogVerbatim("EcalLaserAnalyzer2") + << "-- debug -- Inside EEDigi - towerID:" << towerID << " channelID:" << channelID << " module:" << module + << " modules:" << modules.size(); // APD Pulse //=========== if ((*digiItr).size() > 10) - cout << "SAMPLES SIZE > 10!" << (*digiItr).size() << endl; + edm::LogVerbatim("EcalLaserAnalyzer2") << "SAMPLES SIZE > 10!" << (*digiItr).size(); // Loop on adc samples @@ -678,9 +668,9 @@ void EcalLaserAnalyzer2::endJob() { //======================================================================== if (!IsMatacqOK) { - cout << "\n\t+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+" << endl; - cout << "\t+=+ WARNING! NO MATACQ +=+" << endl; - cout << "\t+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+" << endl; + edm::LogVerbatim("EcalLaserAnalyzer2") << "\n\t+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+"; + edm::LogVerbatim("EcalLaserAnalyzer2") << "\t+=+ WARNING! NO MATACQ +=+"; + edm::LogVerbatim("EcalLaserAnalyzer2") << "\t+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+"; return; } @@ -712,7 +702,7 @@ void EcalLaserAnalyzer2::endJob() { stringstream del; del << "rm " << ADCfile; system(del.str().c_str()); - cout << " No Laser Events " << endl; + edm::LogVerbatim("EcalLaserAnalyzer2") << " No Laser Events "; return; } @@ -751,13 +741,13 @@ void EcalLaserAnalyzer2::endJob() { // Analyze adc samples to get amplitudes //======================================= - cout << "\n\t+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+" << endl; - cout << "\t+=+ Analyzing laser data: getting APD, PN, APD/PN, PN/PN +=+" << endl; + edm::LogVerbatim("EcalLaserAnalyzer2") << "\n\t+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+"; + edm::LogVerbatim("EcalLaserAnalyzer2") << "\t+=+ Analyzing laser data: getting APD, PN, APD/PN, PN/PN +=+"; if (!isGainOK) - cout << "\t+=+ ............................ WARNING! APD GAIN WAS NOT 1 +=+" << endl; + edm::LogVerbatim("EcalLaserAnalyzer2") << "\t+=+ ............................ WARNING! APD GAIN WAS NOT 1 +=+"; if (!isTimingOK) - cout << "\t+=+ ............................ WARNING! TIMING WAS BAD +=+" << endl; + edm::LogVerbatim("EcalLaserAnalyzer2") << "\t+=+ ............................ WARNING! TIMING WAS BAD +=+"; APDFile = new TFile(APDfile.c_str(), "RECREATE"); @@ -838,6 +828,7 @@ void EcalLaserAnalyzer2::endJob() { for (unsigned int iM = 0; iM < nMod; iM++) { unsigned int iMod = modules[iM] - 1; + for (unsigned int ich = 0; ich < nPNPerMod; ich++) { for (unsigned int icol = 0; icol < nCol; icol++) { PNFirstAnal[iMod][ich][icol] = new TPN(ich); @@ -911,8 +902,8 @@ void EcalLaserAnalyzer2::endJob() { } if (_debug >= 1) - cout << "-- debug test -- endJob -- apdAmpl:" << apdAmpl << " apdTime:" << apdTime << endl; - + edm::LogVerbatim("EcalLaserAnalyzer2") + << "-- debug test -- endJob -- apdAmpl:" << apdAmpl << " apdTime:" << apdTime; double pnmean; if (pn0 < 10 && pn1 > 10) { pnmean = pn1; @@ -922,7 +913,7 @@ void EcalLaserAnalyzer2::endJob() { pnmean = 0.5 * (pn0 + pn1); if (_debug >= 1) - cout << "-- debug test -- endJob -- pnMean:" << pnmean << endl; + edm::LogVerbatim("EcalLaserAnalyzer2") << "-- debug test -- endJob -- pnMean:" << pnmean; // Fill PN stuff //=============== @@ -939,7 +930,7 @@ void EcalLaserAnalyzer2::endJob() { if (apdAmpl != 0.0) APDFirstAnal[iCry][iCol]->addEntry(apdAmpl, pnmean, pn0, pn1, apdTime); if (_debug >= 1) - cout << "-- debug test -- endJob -- filling APDTree" << endl; + edm::LogVerbatim("EcalLaserAnalyzer2") << "-- debug test -- endJob -- filling APDTree"; APDtrees[iCry]->Fill(); @@ -954,28 +945,28 @@ void EcalLaserAnalyzer2::endJob() { for (unsigned int ir = 0; ir < nRefChan; ir++) { if (_debug >= 1) - cout << "-- debug test -- ir:" << ir << " tt:" << towerID << " refmap:" << apdRefMap[ir][iMod + 1] - << " iCry:" << iCry << endl; + edm::LogVerbatim("EcalLaserAnalyzer2") << "-- debug test -- ir:" << ir << " tt:" << towerID + << " refmap:" << apdRefMap[ir][iMod + 1] << " iCry:" << iCry; if (apdRefMap[ir][iMod + 1] == iCry) { if (_debug >= 1) - cout << "-- debug test -- cut passed " << endl; + edm::LogVerbatim("EcalLaserAnalyzer2") << "-- debug test -- cut passed "; if (ir == 0) apdAmplA = apdAmpl; else if (ir == 1) apdAmplB = apdAmpl; if (_debug >= 1) - cout << "-- debug test -- apdAmplA=" << apdAmplA << endl; + edm::LogVerbatim("EcalLaserAnalyzer2") << "-- debug test -- apdAmplA=" << apdAmplA; if (_debug >= 1) - cout << "-- debug test -- apdAmplB=" << apdAmplB << endl; + edm::LogVerbatim("EcalLaserAnalyzer2") << "-- debug test -- apdAmplB=" << apdAmplB; if (_debug >= 1) - cout << "-- debug test -- color=" << color << ", event:" << event << ", ir:" << ir - << " tt-1:" << towerID - 1 << endl; + edm::LogVerbatim("EcalLaserAnalyzer2") << "-- debug test -- color=" << color << ", event:" << event + << ", ir:" << ir << " tt-1:" << towerID - 1; RefAPDtrees[ir][iMod + 1]->Fill(); if (_debug >= 1) - cout << "-- debug test -- tree filled" << event << endl; + edm::LogVerbatim("EcalLaserAnalyzer2") << "-- debug test -- tree filled" << event; } } } @@ -987,11 +978,10 @@ void EcalLaserAnalyzer2::endJob() { ADCFile->Close(); if (_debug == 1) - cout << "-- debug test -- endJob -- after apdAmpl Loop" << endl; + edm::LogVerbatim("EcalLaserAnalyzer2") << "-- debug test -- endJob -- after apdAmpl Loop"; // Remove temporary file //======================= - stringstream del; del << "rm " << ADCfile; system(del.str().c_str()); @@ -1074,7 +1064,6 @@ void EcalLaserAnalyzer2::endJob() { // Build ref trees indexes //======================== - for (unsigned int imod = 0; imod < nMod; imod++) { int jmod = modules[imod]; if (RefAPDtrees[0][jmod]->GetEntries() != 0 && RefAPDtrees[1][jmod]->GetEntries() != 0) { @@ -1122,7 +1111,6 @@ void EcalLaserAnalyzer2::endJob() { APDFirstAnal[iCry][iCol]->getAPDoPN1().at(1)); APDAnal[iCry][iCol]->setTimeCut(APDFirstAnal[iCry][iCol]->getTime().at(0), APDFirstAnal[iCry][iCol]->getTime().at(1)); - APDAnal[iCry][iCol]->set2DAPDoAPD0Cut(lowcut, highcut); APDAnal[iCry][iCol]->set2DAPDoAPD1Cut(lowcut, highcut); } @@ -1144,7 +1132,7 @@ void EcalLaserAnalyzer2::endJob() { pnmean = 0.5 * (pn0 + pn1); // Get back color - //=============== + //================ unsigned int iCol = 0; for (unsigned int i = 0; i < nCol; i++) { @@ -1167,7 +1155,7 @@ void EcalLaserAnalyzer2::endJob() { //=================== if (_debug >= 1) - cout << "-- debug test -- LastLoop event:" << event << " apdAmpl:" << apdAmpl << endl; + edm::LogVerbatim("EcalLaserAnalyzer2") << "-- debug test -- LastLoop event:" << event << " apdAmpl:" << apdAmpl; apdAmplA = 0.0; apdAmplB = 0.0; @@ -1176,8 +1164,9 @@ void EcalLaserAnalyzer2::endJob() { } if (_debug == 1) - cout << "-- debug test -- LastLoop apdAmplA:" << apdAmplA << " apdAmplB:" << apdAmplB << ", event:" << event - << ", eventref:" << eventref << endl; + edm::LogVerbatim("EcalLaserAnalyzer2") + << "-- debug test -- LastLoop apdAmplA:" << apdAmplA << " apdAmplB:" << apdAmplB << ", event:" << event + << ", eventref:" << eventref; // Fill APD stuff //=============== @@ -1229,8 +1218,8 @@ void EcalLaserAnalyzer2::endJob() { flag = 0; if (_debug >= 1) - cout << "-- debug test -- endJob -- APD[0]" << APD[0] << " APDoPN[0] " << APDoPN[0] << " APDoAPDA[0] " - << APDoAPDA[0] << " flag " << flag << endl; + edm::LogVerbatim("EcalLaserAnalyzer2") << "-- debug test -- endJob -- APD[0]" << APD[0] << " APDoPN[0] " + << APDoPN[0] << " APDoAPDA[0] " << APDoAPDA[0] << " flag " << flag; restrees[iColor]->Fill(); } } @@ -1264,8 +1253,9 @@ void EcalLaserAnalyzer2::endJob() { } if (_debug >= 1) - cout << "-- debug test -- endJob -- filling pn results'tree: PN[0]:" << PN[0] << " iModule:" << iMod - << " iColor:" << iColor << " ch:" << ch << endl; + edm::LogVerbatim("EcalLaserAnalyzer2") + << "-- debug test -- endJob -- filling pn results'tree: PN[0]:" << PN[0] << " iModule:" << iMod + << " iColor:" << iColor << " ch:" << ch; // Fill PN results trees //======================== @@ -1277,7 +1267,6 @@ void EcalLaserAnalyzer2::endJob() { // Remove temporary files //======================== - if (!_saveallevents) { APDFile->Close(); stringstream del2; @@ -1287,6 +1276,7 @@ void EcalLaserAnalyzer2::endJob() { } else { APDFile->cd(); APDtrees[0]->Write(); + APDFile->Close(); resFile->cd(); } @@ -1301,8 +1291,8 @@ void EcalLaserAnalyzer2::endJob() { resFile->Close(); - cout << "\t+=+ .................................................. done +=+" << endl; - cout << "\t+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+" << endl; + edm::LogVerbatim("EcalLaserAnalyzer2") << "\t+=+ .................................................. done +=+"; + edm::LogVerbatim("EcalLaserAnalyzer2") << "\t+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+"; } //======================================================================== @@ -1333,7 +1323,7 @@ bool EcalLaserAnalyzer2::getShapes() { laserShape->Scale(1.0 / y); } } else { - cout << " ERROR! Matacq shape file not found !" << endl; + edm::LogError("file_not_found") << " ERROR! Matacq shape file not found !"; } if (doesMatShapeExist) IsMatacqOK = true; @@ -1365,7 +1355,7 @@ bool EcalLaserAnalyzer2::getShapes() { } } else { - cout << " ERROR! Elec shape file not found !" << endl; + edm::LogError("file_not_found") << " ERROR! Elec shape file not found !"; } if (IsMatacqOK) { @@ -1380,7 +1370,8 @@ bool EcalLaserAnalyzer2::getShapes() { unsigned int nBins2 = int(elecShape->GetNbinsX()); if (nBins2 < nBins) { - cout << "EcalLaserAnalyzer2::getShapes: wrong configuration of the shapes' number of bins" << std::endl; + edm::LogError("cfg_error") + << "EcalLaserAnalyzer2::getShapes: wrong configuration of the shapes' number of bins"; isSPRFine = false; } assert(nSamplesShapes == nBins2); @@ -1498,4 +1489,5 @@ void EcalLaserAnalyzer2::setGeomEE( idccID[channel] = dccID; iside[channel] = side; } + DEFINE_FWK_MODULE(EcalLaserAnalyzer2); diff --git a/CalibCalorimetry/EcalLaserAnalyzer/plugins/EcalLaserAnalyzer2.h b/CalibCalorimetry/EcalLaserAnalyzer/plugins/EcalLaserAnalyzer2.h index 55cdaa7d81ec1..23b2320ed6d31 100644 --- a/CalibCalorimetry/EcalLaserAnalyzer/plugins/EcalLaserAnalyzer2.h +++ b/CalibCalorimetry/EcalLaserAnalyzer/plugins/EcalLaserAnalyzer2.h @@ -1,7 +1,18 @@ +#ifndef CalibCalorimetry_EcalLaserAnalyzer_EcalLaserAnalyzer2_h +#define CalibCalorimetry_EcalLaserAnalyzer_EcalLaserAnalyzer2_h // $Id: EcalLaserAnalyzer2.h #include -#include + +#include +#include + +#include + +#include +#include +#include +#include class TFile; class TTree; @@ -40,7 +51,7 @@ class TMem; #define NREFCHAN 2 // Ref number for APDB #define NSAMPSHAPES 250 -class EcalLaserAnalyzer2 : public edm::EDAnalyzer { +class EcalLaserAnalyzer2 : public edm::one::EDAnalyzer<> { public: explicit EcalLaserAnalyzer2(const edm::ParameterSet &iConfig); ~EcalLaserAnalyzer2() override; @@ -58,35 +69,45 @@ class EcalLaserAnalyzer2 : public edm::EDAnalyzer { private: int iEvent; + const std::string eventHeaderCollection_; + const std::string eventHeaderProducer_; + const std::string digiCollection_; + const std::string digiProducer_; + const std::string digiPNCollection_; + + const edm::EDGetTokenT rawDataToken_; + edm::EDGetTokenT ebDigiToken_; + edm::EDGetTokenT eeDigiToken_; + const edm::EDGetTokenT pnDiodeDigiToken_; + const edm::ESGetToken mappingToken_; + // Framework parameters - unsigned int _nsamples; + const unsigned int _nsamples; unsigned int _presample; - unsigned int _firstsample; - unsigned int _lastsample; - unsigned int _samplemin; - unsigned int _samplemax; - unsigned int _nsamplesPN; - unsigned int _presamplePN; - unsigned int _firstsamplePN; - unsigned int _lastsamplePN; - unsigned int _timingcutlow; - unsigned int _timingcuthigh; - unsigned int _timingquallow; - unsigned int _timingqualhigh; - double _ratiomincutlow; - double _ratiomincuthigh; - double _ratiomaxcutlow; - double _presamplecut; - unsigned int _niter; - double _noise; - std::string _ecalPart; - bool _saveshapes; - bool _docorpn; - int _fedid; - bool _saveallevents; - double _qualpercent; - int _debug; + const unsigned int _firstsample; + const unsigned int _lastsample; + const unsigned int _nsamplesPN; + const unsigned int _presamplePN; + const unsigned int _firstsamplePN; + const unsigned int _lastsamplePN; + const unsigned int _timingcutlow; + const unsigned int _timingcuthigh; + const unsigned int _timingquallow; + const unsigned int _timingqualhigh; + const double _ratiomincutlow; + const double _ratiomincuthigh; + const double _ratiomaxcutlow; + const double _presamplecut; + const unsigned int _niter; + const double _noise; + const std::string _ecalPart; + const bool _saveshapes; + const bool _docorpn; + const int _fedid; + const bool _saveallevents; + const double _qualpercent; + const int _debug; TAPDPulse *APDPulse; TPNPulse *PNPulse; @@ -94,14 +115,9 @@ class EcalLaserAnalyzer2 : public edm::EDAnalyzer { TMom *Delta01; TMom *Delta12; - std::string resdir_; - std::string digiCollection_; - std::string elecfile_; - std::string pncorfile_; - std::string digiPNCollection_; - std::string digiProducer_; - std::string eventHeaderCollection_; - std::string eventHeaderProducer_; + const std::string resdir_; + const std::string elecfile_; + const std::string pncorfile_; // Output file names @@ -243,3 +259,4 @@ class EcalLaserAnalyzer2 : public edm::EDAnalyzer { bool isGainOK; bool isTimingOK; }; +#endif diff --git a/CalibCalorimetry/EcalLaserAnalyzer/plugins/EcalPerEvtLaserAnalyzer.cc b/CalibCalorimetry/EcalLaserAnalyzer/plugins/EcalPerEvtLaserAnalyzer.cc index 7feaa380bc004..53654b6ad07f5 100644 --- a/CalibCalorimetry/EcalLaserAnalyzer/plugins/EcalPerEvtLaserAnalyzer.cc +++ b/CalibCalorimetry/EcalLaserAnalyzer/plugins/EcalPerEvtLaserAnalyzer.cc @@ -11,12 +11,10 @@ #include "EcalPerEvtLaserAnalyzer.h" #include -#include #include #include #include -#include #include #include @@ -25,17 +23,9 @@ #include #include #include -#include -#include -#include - -#include #include #include -#include - -#include #include #include @@ -46,14 +36,19 @@ using namespace std; EcalPerEvtLaserAnalyzer::EcalPerEvtLaserAnalyzer(const edm::ParameterSet& iConfig) //======================================================================== : iEvent(0), - + eventHeaderCollection_(iConfig.getParameter("eventHeaderCollection")), + eventHeaderProducer_(iConfig.getParameter("eventHeaderProducer")), + digiCollection_(iConfig.getParameter("digiCollection")), + digiProducer_(iConfig.getParameter("digiProducer")), + digiPNCollection_(iConfig.getParameter("digiPNCollection")), + rawDataToken_(consumes(edm::InputTag(eventHeaderProducer_, eventHeaderCollection_))), + pnDiodeDigiToken_(consumes(edm::InputTag(digiProducer_, digiPNCollection_))), + mappingToken_(esConsumes()), // framework parameters with default values _nsamples(iConfig.getUntrackedParameter("nSamples", 10)), _presample(iConfig.getUntrackedParameter("nPresamples", 3)), _firstsample(iConfig.getUntrackedParameter("firstSample", 1)), _lastsample(iConfig.getUntrackedParameter("lastSample", 2)), - _samplemin(iConfig.getUntrackedParameter("sampleMin", 3)), - _samplemax(iConfig.getUntrackedParameter("sampleMax", 9)), _nsamplesPN(iConfig.getUntrackedParameter("nSamplesPN", 50)), _presamplePN(iConfig.getUntrackedParameter("nPresamplesPN", 6)), _firstsamplePN(iConfig.getUntrackedParameter("firstSamplePN", 7)), @@ -65,11 +60,10 @@ EcalPerEvtLaserAnalyzer::EcalPerEvtLaserAnalyzer(const edm::ParameterSet& iConfi _tower(iConfig.getUntrackedParameter("tower", 1)), _channel(iConfig.getUntrackedParameter("channel", 1)), _ecalPart(iConfig.getUntrackedParameter("ecalPart", "EB")), + resdir_(iConfig.getUntrackedParameter("resDir")), + refalphabeta_(iConfig.getUntrackedParameter("refAlphaBeta")), nCrys(NCRYSEB), - nTT(NTTEB), - nSides(NSIDES), IsFileCreated(0), - nCh(0), runType(-1), runNum(0), dccID(-1), @@ -83,26 +77,18 @@ EcalPerEvtLaserAnalyzer::EcalPerEvtLaserAnalyzer(const edm::ParameterSet& iConfi //======================================================================== { - //now do what ever initialization is needed - - resdir_ = iConfig.getUntrackedParameter("resDir"); - refalphabeta_ = iConfig.getUntrackedParameter("refAlphaBeta"); - - digiCollection_ = iConfig.getParameter("digiCollection"); - digiPNCollection_ = iConfig.getParameter("digiPNCollection"); - digiProducer_ = iConfig.getParameter("digiProducer"); - - eventHeaderCollection_ = iConfig.getParameter("eventHeaderCollection"); - eventHeaderProducer_ = iConfig.getParameter("eventHeaderProducer"); + if (_ecalPart == "EB") { + ebDigiToken_ = consumes(edm::InputTag(digiProducer_, digiCollection_)); + } else if (_ecalPart == "EE") { + eeDigiToken_ = consumes(edm::InputTag(digiProducer_, digiCollection_)); + } // Define geometrical constants - + // if (_ecalPart == "EB") { nCrys = NCRYSEB; - nTT = NTTEB; } else { nCrys = NCRYSEE; - nTT = NTTEE; } } @@ -157,7 +143,6 @@ void EcalPerEvtLaserAnalyzer::beginJob() { ADCtrees->SetBranchAddress("pn1", &pn1); IsFileCreated = 0; - nCh = nCrys; } //======================================================================== @@ -169,11 +154,11 @@ void EcalPerEvtLaserAnalyzer::analyze(const edm::Event& e, const edm::EventSetup // retrieving DCC header edm::Handle pDCCHeader; const EcalRawDataCollection* DCCHeader = nullptr; - try { - e.getByLabel(eventHeaderProducer_, eventHeaderCollection_, pDCCHeader); + e.getByToken(rawDataToken_, pDCCHeader); + if (!pDCCHeader.isValid()) { + edm::LogError("nodata") << "Error! can't get the product retrieving DCC header" << eventHeaderCollection_.c_str(); + } else { DCCHeader = pDCCHeader.product(); - } catch (std::exception& ex) { - std::cerr << "Error! can't get the product retrieving DCC header" << eventHeaderCollection_.c_str() << std::endl; } // retrieving crystal data from Event @@ -181,42 +166,34 @@ void EcalPerEvtLaserAnalyzer::analyze(const edm::Event& e, const edm::EventSetup const EBDigiCollection* EBDigi = nullptr; edm::Handle pEEDigi; const EEDigiCollection* EEDigi = nullptr; - if (_ecalPart == "EB") { - try { - e.getByLabel(digiProducer_, digiCollection_, pEBDigi); + e.getByToken(ebDigiToken_, pEBDigi); + if (!pEBDigi.isValid()) { + edm::LogError("nodata") << "Error! can't get the product retrieving EB crystal data " << digiCollection_.c_str(); + } else { EBDigi = pEBDigi.product(); - } catch (std::exception& ex) { - std::cerr << "Error! can't get the product retrieving EB crystal data " << digiCollection_.c_str() << std::endl; } } else { - try { - e.getByLabel(digiProducer_, digiCollection_, pEEDigi); + e.getByToken(eeDigiToken_, pEEDigi); + if (!pEEDigi.isValid()) { + edm::LogError("nodata") << "Error! can't get the product retrieving EE crystal data " << digiCollection_.c_str(); + } else { EEDigi = pEEDigi.product(); - } catch (std::exception& ex) { - std::cerr << "Error! can't get the product retrieving EE crystal data " << digiCollection_.c_str() << std::endl; } } // retrieving crystal PN diodes from Event edm::Handle pPNDigi; const EcalPnDiodeDigiCollection* PNDigi = nullptr; - try { - e.getByLabel(digiProducer_, digiPNCollection_, pPNDigi); + e.getByToken(pnDiodeDigiToken_, pPNDigi); + if (!pPNDigi.isValid()) { + edm::LogError("nodata") << "Error! can't get the product " << digiPNCollection_.c_str(); + } else { PNDigi = pPNDigi.product(); - } catch (std::exception& ex) { - std::cerr << "Error! can't get the product " << digiPNCollection_.c_str() << std::endl; } // retrieving electronics mapping - edm::ESHandle ecalmapping; - const EcalElectronicsMapping* TheMapping = nullptr; - try { - c.get().get(ecalmapping); - TheMapping = ecalmapping.product(); - } catch (std::exception& ex) { - std::cerr << "Error! can't get the product EcalMappingRcd" << std::endl; - } + const auto& TheMapping = c.getData(mappingToken_); // ==================================== // Decode Basic DCCHeader Information @@ -285,7 +262,7 @@ void EcalPerEvtLaserAnalyzer::analyze(const edm::Event& e, const edm::EventSetup vector::iterator iter = find(colors.begin(), colors.end(), color); if (iter == colors.end()) { colors.push_back(color); - cout << " new color found " << color << " " << colors.size() << endl; + edm::LogVerbatim("EcalPerEvtLaserAnalyzer") << " new color found " << color << " " << colors.size(); } } @@ -391,7 +368,7 @@ void EcalPerEvtLaserAnalyzer::analyze(const edm::Event& e, const edm::EventSetup side = MEEBGeom::side(etaG, phiG); - EcalElectronicsId elecid_crystal = TheMapping->getElectronicsId(id_crystal); + EcalElectronicsId elecid_crystal = TheMapping.getElectronicsId(id_crystal); int towerID = elecid_crystal.towerId(); // int channelID=elecid_crystal.channelId()-1; // FIXME so far for endcap only @@ -479,7 +456,7 @@ void EcalPerEvtLaserAnalyzer::analyze(const edm::Event& e, const edm::EventSetup // Recover the TT id and the electronic crystal numbering from EcalElectronicsMapping - EcalElectronicsId elecid_crystal = TheMapping->getElectronicsId(id_crystal); + EcalElectronicsId elecid_crystal = TheMapping.getElectronicsId(id_crystal); int towerID = elecid_crystal.towerId(); int channelID = elecid_crystal.channelId() - 1; @@ -563,10 +540,14 @@ void EcalPerEvtLaserAnalyzer::endJob() { ADCtrees->Write(); - cout << "\n\t+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+" << endl; - cout << "\t+=+ Analyzing laser data: getting per event +=+" << endl; - cout << "\t+=+ APD Amplitudes and ADC samples +=+" << endl; - cout << "\t+=+ for fed:" << _fedid << ", tower:" << _tower << ", and channel:" << _channel << endl; + edm::LogVerbatim("EcalPerEvtLaserAnalyzer") + << "\n\t+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+"; + edm::LogVerbatim("EcalPerEvtLaserAnalyzer") + << "\t+=+ Analyzing laser data: getting per event +=+"; + edm::LogVerbatim("EcalPerEvtLaserAnalyzer") + << "\t+=+ APD Amplitudes and ADC samples +=+"; + edm::LogVerbatim("EcalPerEvtLaserAnalyzer") + << "\t+=+ for fed:" << _fedid << ", tower:" << _tower << ", and channel:" << _channel; // Define temporary tree to save APD amplitudes @@ -739,8 +720,10 @@ void EcalPerEvtLaserAnalyzer::endJob() { del << "rm " << ADCfile; system(del.str().c_str()); - cout << "\t+=+ .................................................. done +=+" << endl; - cout << "\t+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+" << endl; + edm::LogVerbatim("EcalPerEvtLaserAnalyzer") + << "\t+=+ .................................................. done +=+"; + edm::LogVerbatim("EcalPerEvtLaserAnalyzer") + << "\t+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+"; } DEFINE_FWK_MODULE(EcalPerEvtLaserAnalyzer); diff --git a/CalibCalorimetry/EcalLaserAnalyzer/plugins/EcalPerEvtLaserAnalyzer.h b/CalibCalorimetry/EcalLaserAnalyzer/plugins/EcalPerEvtLaserAnalyzer.h index 8828ad23a67ea..511edb95df466 100644 --- a/CalibCalorimetry/EcalLaserAnalyzer/plugins/EcalPerEvtLaserAnalyzer.h +++ b/CalibCalorimetry/EcalLaserAnalyzer/plugins/EcalPerEvtLaserAnalyzer.h @@ -1,10 +1,20 @@ +#ifndef CalibCalorimetry_EcalLaserAnalyzer_EcalPerEvtLaserAnalyzer_h +#define CalibCalorimetry_EcalLaserAnalyzer_EcalPerEvtLaserAnalyzer_h // $Id: EcalPerEvtLaserAnalyzer.h #include -#include -class TTree; +#include + +#include + +#include +#include +#include +#include + class TFile; +class TTree; // Define geometrical constants // NOT the same for "EB" and "EE" @@ -30,7 +40,7 @@ class TFile; #define NTTEE 33 // Number of EE Trigger Towers #define NPNEE 4 // Number of PN per EE supermodule -class EcalPerEvtLaserAnalyzer : public edm::EDAnalyzer { +class EcalPerEvtLaserAnalyzer : public edm::one::EDAnalyzer<> { public: explicit EcalPerEvtLaserAnalyzer(const edm::ParameterSet &iConfig); ~EcalPerEvtLaserAnalyzer() override; @@ -44,54 +54,51 @@ class EcalPerEvtLaserAnalyzer : public edm::EDAnalyzer { private: int iEvent; + const std::string eventHeaderCollection_; + const std::string eventHeaderProducer_; + const std::string digiCollection_; + const std::string digiProducer_; + const std::string digiPNCollection_; + + const edm::EDGetTokenT rawDataToken_; + edm::EDGetTokenT ebDigiToken_; + edm::EDGetTokenT eeDigiToken_; + const edm::EDGetTokenT pnDiodeDigiToken_; + const edm::ESGetToken mappingToken_; + // Framework parameters - unsigned int _nsamples; - unsigned int _presample; - unsigned int _firstsample; - unsigned int _lastsample; - unsigned int _samplemin; - unsigned int _samplemax; - unsigned int _nsamplesPN; - unsigned int _presamplePN; - unsigned int _firstsamplePN; - unsigned int _lastsamplePN; - unsigned int _timingcutlow; - unsigned int _timingcuthigh; - unsigned int _niter; - int _fedid; - unsigned int _tower; - unsigned int _channel; - std::string _ecalPart; - - std::string resdir_; - std::string refalphabeta_; - std::string digiCollection_; - std::string digiPNCollection_; - std::string digiProducer_; - std::string eventHeaderCollection_; - std::string eventHeaderProducer_; + const unsigned int _nsamples; + const unsigned int _presample; + const unsigned int _firstsample; + const unsigned int _lastsample; + const unsigned int _nsamplesPN; + const unsigned int _presamplePN; + const unsigned int _firstsamplePN; + const unsigned int _lastsamplePN; + const unsigned int _timingcutlow; + const unsigned int _timingcuthigh; + const unsigned int _niter; + const int _fedid; + const unsigned int _tower; + const unsigned int _channel; + const std::string _ecalPart; + + const std::string resdir_; + const std::string refalphabeta_; // Output file names - std::string alphafile; std::string ADCfile; - std::string APDfile; std::string resfile; // Define geometrical constants // Default values correspond to "EB" geometry (1700 crystals) unsigned int nCrys; - unsigned int nTT; - unsigned int nSides; int IsFileCreated; - // Define number of channels (68 or 1700) for alpha and beta calculation - - unsigned int nCh; - // Identify run type int runType; @@ -137,3 +144,4 @@ class EcalPerEvtLaserAnalyzer : public edm::EDAnalyzer { double apdTime; double pnAmpl; }; +#endif diff --git a/CalibCalorimetry/EcalLaserAnalyzer/plugins/EcalTestPulseAnalyzer.cc b/CalibCalorimetry/EcalLaserAnalyzer/plugins/EcalTestPulseAnalyzer.cc index 94f5dbf20a8fe..2a6b03dce1946 100644 --- a/CalibCalorimetry/EcalLaserAnalyzer/plugins/EcalTestPulseAnalyzer.cc +++ b/CalibCalorimetry/EcalLaserAnalyzer/plugins/EcalTestPulseAnalyzer.cc @@ -8,29 +8,20 @@ #include #include -using namespace std; #include "EcalTestPulseAnalyzer.h" #include -#include #include #include -#include #include #include -#include #include #include -#include -#include -#include - -#include -#include #include +#include #include #include @@ -45,9 +36,15 @@ using namespace std; EcalTestPulseAnalyzer::EcalTestPulseAnalyzer(const edm::ParameterSet& iConfig) //======================================================================== : iEvent(0), - + eventHeaderCollection_(iConfig.getParameter("eventHeaderCollection")), + eventHeaderProducer_(iConfig.getParameter("eventHeaderProducer")), + digiCollection_(iConfig.getParameter("digiCollection")), + digiProducer_(iConfig.getParameter("digiProducer")), + digiPNCollection_(iConfig.getParameter("digiPNCollection")), + rawDataToken_(consumes(edm::InputTag(eventHeaderProducer_, eventHeaderCollection_))), + pnDiodeDigiToken_(consumes(edm::InputTag(digiProducer_, digiPNCollection_))), + mappingToken_(esConsumes()), // framework parameters with default values - _nsamples(iConfig.getUntrackedParameter("nSamples", 10)), _presample(iConfig.getUntrackedParameter("nPresamples", 3)), _firstsample(iConfig.getUntrackedParameter("firstSample", 1)), @@ -63,8 +60,8 @@ EcalTestPulseAnalyzer::EcalTestPulseAnalyzer(const edm::ParameterSet& iConfig) _timeofmax(iConfig.getUntrackedParameter("timeOfMax", 4.5)), _ecalPart(iConfig.getUntrackedParameter("ecalPart", "EB")), _fedid(iConfig.getUntrackedParameter("fedID", -999)), + resdir_(iConfig.getUntrackedParameter("resDir")), nCrys(NCRYSEB), - nTT(NTTEB), nMod(NMODEB), nGainPN(NGAINPN), nGainAPD(NGAINAPD), @@ -89,25 +86,18 @@ EcalTestPulseAnalyzer::EcalTestPulseAnalyzer(const edm::ParameterSet& iConfig) //======================================================================== { - //now do what ever initialization is needed - - resdir_ = iConfig.getUntrackedParameter("resDir"); - - digiCollection_ = iConfig.getParameter("digiCollection"); - digiPNCollection_ = iConfig.getParameter("digiPNCollection"); - digiProducer_ = iConfig.getParameter("digiProducer"); - - eventHeaderCollection_ = iConfig.getParameter("eventHeaderCollection"); - eventHeaderProducer_ = iConfig.getParameter("eventHeaderProducer"); + if (_ecalPart == "EB") { + ebDigiToken_ = consumes(edm::InputTag(digiProducer_, digiCollection_)); + } else if (_ecalPart == "EE") { + eeDigiToken_ = consumes(edm::InputTag(digiProducer_, digiCollection_)); + } // Define geometrical constants if (_ecalPart == "EB") { nCrys = NCRYSEB; - nTT = NTTEB; } else { nCrys = NCRYSEE; - nTT = NTTEE; } iZ = 1; @@ -209,56 +199,47 @@ void EcalTestPulseAnalyzer::analyze(const edm::Event& e, const edm::EventSetup& // Retrieve DCC header edm::Handle pDCCHeader; const EcalRawDataCollection* DCCHeader = nullptr; - try { - e.getByLabel(eventHeaderProducer_, eventHeaderCollection_, pDCCHeader); + e.getByToken(rawDataToken_, pDCCHeader); + if (!pDCCHeader.isValid()) { + edm::LogError("nodata") << "Error! can't get the product retrieving DCC header" << eventHeaderCollection_.c_str(); + } else { DCCHeader = pDCCHeader.product(); - } catch (std::exception& ex) { - std::cerr << "Error! can't get the product retrieving DCC header" << eventHeaderCollection_.c_str() << std::endl; } - // retrieving crystal EB data from Event + // retrieving crystal data from Event edm::Handle pEBDigi; const EBDigiCollection* EBDigi = nullptr; - - // retrieving crystal EE data from Event edm::Handle pEEDigi; const EEDigiCollection* EEDigi = nullptr; - if (_ecalPart == "EB") { - try { - e.getByLabel(digiProducer_, digiCollection_, pEBDigi); + e.getByToken(ebDigiToken_, pEBDigi); + if (!pEBDigi.isValid()) { + edm::LogError("nodata") << "Error! can't get the product retrieving EB crystal data " << digiCollection_.c_str(); + } else { EBDigi = pEBDigi.product(); - } catch (std::exception& ex) { - std::cerr << "Error! can't get the product retrieving EB crystal data " << digiCollection_.c_str() << std::endl; } } else { - try { - e.getByLabel(digiProducer_, digiCollection_, pEEDigi); + e.getByToken(eeDigiToken_, pEEDigi); + if (!pEEDigi.isValid()) { + edm::LogError("nodata") << "Error! can't get the product retrieving EE crystal data " << digiCollection_.c_str(); + } else { EEDigi = pEEDigi.product(); - } catch (std::exception& ex) { - std::cerr << "Error! can't get the product retrieving EE crystal data " << digiCollection_.c_str() << std::endl; } } // Retrieve crystal PN diodes from Event edm::Handle pPNDigi; const EcalPnDiodeDigiCollection* PNDigi = nullptr; - try { - e.getByLabel(digiProducer_, digiPNCollection_, pPNDigi); + e.getByToken(pnDiodeDigiToken_, pPNDigi); + if (!pPNDigi.isValid()) { + edm::LogError("nodata") << "Error! can't get the product " << digiCollection_.c_str(); + } else { PNDigi = pPNDigi.product(); - } catch (std::exception& ex) { - std::cerr << "Error! can't get the product " << digiCollection_.c_str() << std::endl; } // retrieving electronics mapping - edm::ESHandle ecalmapping; - const EcalElectronicsMapping* TheMapping = nullptr; - try { - c.get().get(ecalmapping); - TheMapping = ecalmapping.product(); - } catch (std::exception& ex) { - std::cerr << "Error! can't get the product EcalMappingRcd" << std::endl; - } + const auto& TheMapping = c.getData(mappingToken_); + ; // ==================================== // Decode Basic DCCHeader Information @@ -338,7 +319,7 @@ void EcalTestPulseAnalyzer::analyze(const edm::Event& e, const edm::EventSetup& pnG[samId] = (*pnItr).sample(samId).gainId(); if (pnG[samId] != 1) - std::cout << "PN gain different from 1 for sample " << samId << std::endl; + edm::LogVerbatim("EcalTestPulseAnalyzer") << "PN gain different from 1 for sample " << samId; if (samId == 0) pngain = pnG[samId]; if (samId > 0) @@ -406,7 +387,7 @@ void EcalTestPulseAnalyzer::analyze(const edm::Event& e, const edm::EventSetup& side = MEEBGeom::side(etaG, phiG); - EcalElectronicsId elecid_crystal = TheMapping->getElectronicsId(id_crystal); + EcalElectronicsId elecid_crystal = TheMapping.getElectronicsId(id_crystal); towerID = elecid_crystal.towerId(); int strip = elecid_crystal.stripId(); @@ -522,7 +503,7 @@ void EcalTestPulseAnalyzer::analyze(const edm::Event& e, const edm::EventSetup& // Recover the TT id and the electronic crystal numbering from EcalElectronicsMapping - EcalElectronicsId elecid_crystal = TheMapping->getElectronicsId(id_crystal); + EcalElectronicsId elecid_crystal = TheMapping.getElectronicsId(id_crystal); towerID = elecid_crystal.towerId(); channelID = elecid_crystal.channelId() - 1; @@ -652,16 +633,16 @@ void EcalTestPulseAnalyzer::endJob() { del << "rm " << rootfile; system(del.str().c_str()); - std::cout << " No TP Events " << std::endl; + edm::LogVerbatim("EcalTestPulseAnalyzer") << " No TP Events "; return; } - std::cout << "\n\t+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+" << std::endl; - std::cout << "\t+=+ Analyzing test pulse data: getting APD, PN +=+" << std::endl; + edm::LogVerbatim("EcalTestPulseAnalyzer") << "\n\t+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+"; + edm::LogVerbatim("EcalTestPulseAnalyzer") << "\t+=+ Analyzing test pulse data: getting APD, PN +=+"; // Create output ntuples: - //std::cout<< "TP Test Name File "<< resfile.c_str() << std::endl; + //edm::LogVerbatim("EcalTestPulseAnalyzer")<< "TP Test Name File "<< resfile.c_str(); resFile = new TFile(resfile.c_str(), "RECREATE"); @@ -810,8 +791,8 @@ void EcalTestPulseAnalyzer::endJob() { respntrees->Write(); resFile->Close(); - std::cout << "\t+=+ ...................................... done +=+" << std::endl; - std::cout << "\t+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+" << std::endl; + edm::LogVerbatim("EcalTestPulseAnalyzer") << "\t+=+ ...................................... done +=+"; + edm::LogVerbatim("EcalTestPulseAnalyzer") << "\t+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+"; } DEFINE_FWK_MODULE(EcalTestPulseAnalyzer); diff --git a/CalibCalorimetry/EcalLaserAnalyzer/plugins/EcalTestPulseAnalyzer.h b/CalibCalorimetry/EcalLaserAnalyzer/plugins/EcalTestPulseAnalyzer.h index e21c2eee7ca2b..9e27a5e8ccb78 100644 --- a/CalibCalorimetry/EcalLaserAnalyzer/plugins/EcalTestPulseAnalyzer.h +++ b/CalibCalorimetry/EcalLaserAnalyzer/plugins/EcalTestPulseAnalyzer.h @@ -1,6 +1,17 @@ +#ifndef CalibCalorimetry_EcalLaserAnalyzer_EcalTestPulseAnalyzer_h +#define CalibCalorimetry_EcalLaserAnalyzer_EcalTestPulseAnalyzer_h #include -#include + +#include +#include + +#include + +#include +#include +#include +#include class TFile; class TTree; @@ -17,22 +28,20 @@ class TTree; // 7 8 // // -// "EB" geometry + // "EB" geometry #define NCRYSEB 1700 // Number of crystals per EB supermodule -#define NTTEB 68 // Number of EB Trigger Towers #define NMODEB 9 // Number of EB submodules #define NPNPERMOD 2 // Number of PN per module // "EE" geometry #define NCRYSEE 830 // Number of crystals per EE supermodule -#define NTTEE 68 // Number of EE Trigger Towers #define NMODEE 21 // Number of EE submodules #define NGAINPN 2 // Number of gains #define NGAINAPD 4 // Number of gains -class EcalTestPulseAnalyzer : public edm::EDAnalyzer { +class EcalTestPulseAnalyzer : public edm::one::EDAnalyzer<> { public: explicit EcalTestPulseAnalyzer(const edm::ParameterSet &iConfig); ~EcalTestPulseAnalyzer() override; @@ -44,30 +53,37 @@ class EcalTestPulseAnalyzer : public edm::EDAnalyzer { private: int iEvent; + const std::string eventHeaderCollection_; + const std::string eventHeaderProducer_; + const std::string digiCollection_; + const std::string digiProducer_; + const std::string digiPNCollection_; + + const edm::EDGetTokenT rawDataToken_; + edm::EDGetTokenT ebDigiToken_; + edm::EDGetTokenT eeDigiToken_; + const edm::EDGetTokenT pnDiodeDigiToken_; + const edm::ESGetToken mappingToken_; + // Framework parameters - unsigned int _nsamples; - unsigned int _presample; - unsigned int _firstsample; - unsigned int _lastsample; - unsigned int _samplemin; - unsigned int _samplemax; - unsigned int _nsamplesPN; - unsigned int _presamplePN; - unsigned int _firstsamplePN; - unsigned int _lastsamplePN; - unsigned int _niter; - double _chi2max; - double _timeofmax; - std::string _ecalPart; - int _fedid; - - std::string resdir_; - std::string digiCollection_; - std::string digiPNCollection_; - std::string digiProducer_; - std::string eventHeaderCollection_; - std::string eventHeaderProducer_; + const unsigned int _nsamples; + const unsigned int _presample; + const unsigned int _firstsample; + const unsigned int _lastsample; + const unsigned int _samplemin; + const unsigned int _samplemax; + const unsigned int _nsamplesPN; + const unsigned int _presamplePN; + const unsigned int _firstsamplePN; + const unsigned int _lastsamplePN; + const unsigned int _niter; + const double _chi2max; + const double _timeofmax; + const std::string _ecalPart; + const int _fedid; + + const std::string resdir_; // Output file names @@ -78,7 +94,6 @@ class EcalTestPulseAnalyzer : public edm::EDAnalyzer { // Default values correspond to "EB" geometry (1700 crystals) unsigned int nCrys; - unsigned int nTT; unsigned int nMod; unsigned int nGainPN; unsigned int nGainAPD; @@ -148,3 +163,4 @@ class EcalTestPulseAnalyzer : public edm::EDAnalyzer { unsigned int firstChanMod[NMODEB]; unsigned int isFirstChanModFilled[NMODEB]; }; +#endif diff --git a/CalibCalorimetry/EcalPedestalOffsets/interface/EcalPedOffset.h b/CalibCalorimetry/EcalPedestalOffsets/interface/EcalPedOffset.h index 1d381dfcfcd48..d8800a0bf7756 100644 --- a/CalibCalorimetry/EcalPedestalOffsets/interface/EcalPedOffset.h +++ b/CalibCalorimetry/EcalPedestalOffsets/interface/EcalPedOffset.h @@ -1,5 +1,5 @@ -#ifndef EcalPedOffset_H -#define EcalPedOffset_H +#ifndef CalibCalorimetry_EcalPedestalOffsets_EcalPedOffset_H +#define CalibCalorimetry_EcalPedestalOffsets_EcalPedOffset_H /** * \file EcalPedOffset.h @@ -12,20 +12,20 @@ #include #include -#include "FWCore/Framework/interface/EDAnalyzer.h" +#include "FWCore/Framework/interface/one/EDAnalyzer.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/EventSetup.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" +#include +#include +#include +#include + #include "CalibCalorimetry/EcalPedestalOffsets/interface/TPedResult.h" #include "CalibCalorimetry/EcalPedestalOffsets/interface/TPedValues.h" -class EBDigiCollection; -class EEDigiCollection; - -class EcalElectronicsMapping; - -class EcalPedOffset : public edm::EDAnalyzer { +class EcalPedOffset : public edm::one::EDAnalyzer { public: //! Constructor EcalPedOffset(const edm::ParameterSet &ps); @@ -39,6 +39,9 @@ class EcalPedOffset : public edm::EDAnalyzer { //! BeginRun void beginRun(edm::Run const &, edm::EventSetup const &eventSetup) override; + //! EndRun + void endRun(edm::Run const &, edm::EventSetup const &) override; + //! EndJob void endJob(void) override; @@ -58,9 +61,14 @@ class EcalPedOffset : public edm::EDAnalyzer { void readDACs(const edm::Handle &pDigis, const std::map &DACvalues); void readDACs(const edm::Handle &pDigis, const std::map &DACvalues); - edm::InputTag m_barrelDigiCollection; //!< secondary name given to collection of digis - edm::InputTag m_endcapDigiCollection; //!< secondary name given to collection of digis - edm::InputTag m_headerCollection; //!< name of module/plugin/producer making headers + const edm::InputTag m_barrelDigiCollection; //!< secondary name given to collection of digis + const edm::InputTag m_endcapDigiCollection; //!< secondary name given to collection of digis + const edm::InputTag m_headerCollection; //!< name of module/plugin/producer making headers + + const edm::EDGetTokenT m_rawDataToken; + const edm::EDGetTokenT m_ebDigiToken; + const edm::EDGetTokenT m_eeDigiToken; + const edm::ESGetToken m_mappingToken; std::string m_xmlFile; //!< name of the xml file to be saved diff --git a/CalibCalorimetry/EcalPedestalOffsets/src/EcalPedOffset.cc b/CalibCalorimetry/EcalPedestalOffsets/src/EcalPedOffset.cc index 398c70eafa0b2..318024986dcf4 100644 --- a/CalibCalorimetry/EcalPedestalOffsets/src/EcalPedOffset.cc +++ b/CalibCalorimetry/EcalPedestalOffsets/src/EcalPedOffset.cc @@ -22,14 +22,7 @@ #include "OnlineDB/EcalCondDB/interface/RunIOV.h" #include "OnlineDB/EcalCondDB/interface/RunTag.h" -#include "DataFormats/EcalDigi/interface/EcalDigiCollections.h" - #include "DataFormats/EcalRawData/interface/EcalDCCHeaderBlock.h" -#include "DataFormats/EcalRawData/interface/EcalRawDataCollections.h" - -#include "FWCore/Framework/interface/ESHandle.h" -#include "Geometry/EcalMapping/interface/EcalElectronicsMapping.h" -#include "Geometry/EcalMapping/interface/EcalMappingRcd.h" using namespace cms; using namespace edm; @@ -39,6 +32,10 @@ EcalPedOffset::EcalPedOffset(const ParameterSet ¶mSet) : m_barrelDigiCollection(paramSet.getParameter("EBdigiCollection")), m_endcapDigiCollection(paramSet.getParameter("EEdigiCollection")), m_headerCollection(paramSet.getParameter("headerCollection")), + m_rawDataToken(consumes(m_headerCollection)), + m_ebDigiToken(consumes(m_barrelDigiCollection)), + m_eeDigiToken(consumes(m_endcapDigiCollection)), + m_mappingToken(esConsumes()), m_xmlFile(paramSet.getParameter("xmlFile")), m_DACmin(paramSet.getUntrackedParameter("DACmin", 0)), m_DACmax(paramSet.getUntrackedParameter("DACmax", 256)), @@ -77,13 +74,18 @@ EcalPedOffset::~EcalPedOffset() { void EcalPedOffset::beginRun(Run const &, EventSetup const &eventSetup) { LogDebug("EcalPedOffset") << "entering beginRun..."; - edm::ESHandle handle; - eventSetup.get().get(handle); - ecalElectronicsMap_ = handle.product(); + // get the electronics map + const auto mappingHandle = eventSetup.getHandle(m_mappingToken); + ecalElectronicsMap_ = mappingHandle.product(); } // ----------------------------------------------------------------------------- +//! end the run +void EcalPedOffset::endRun(Run const &, EventSetup const &eventSetup) {} + +// ----------------------------------------------------------------------------- + //! perform the analysis void EcalPedOffset::analyze(Event const &event, EventSetup const &eventSetup) { LogDebug("EcalPedOffset") << "entering analyze ..."; @@ -91,7 +93,7 @@ void EcalPedOffset::analyze(Event const &event, EventSetup const &eventSetup) { // get the headers // (one header for each supermodule) edm::Handle DCCHeaders; - event.getByLabel(m_headerCollection, DCCHeaders); + event.getByToken(m_rawDataToken, DCCHeaders); std::map DACvalues; @@ -112,7 +114,7 @@ void EcalPedOffset::analyze(Event const &event, EventSetup const &eventSetup) { // get the barrel digis // (one digi for each crystal) Handle barrelDigis; - event.getByLabel(m_barrelDigiCollection, barrelDigis); + event.getByToken(m_ebDigiToken, barrelDigis); if (!barrelDigis.isValid()) { edm::LogError("EcalPedOffset") << "Error! can't get the product " << m_barrelDigiCollection << "; not reading barrel digis"; @@ -128,7 +130,7 @@ void EcalPedOffset::analyze(Event const &event, EventSetup const &eventSetup) { // get the endcap digis // (one digi for each crystal) Handle endcapDigis; - event.getByLabel(m_endcapDigiCollection, endcapDigis); + event.getByToken(m_eeDigiToken, endcapDigis); if (!endcapDigis.isValid()) { edm::LogError("EcalPedOffset") << "Error! can't get the product " << m_endcapDigiCollection << "; not reading endcap digis"; diff --git a/CalibCalorimetry/EcalSRTools/interface/EcalDccWeightBuilder.h b/CalibCalorimetry/EcalSRTools/interface/EcalDccWeightBuilder.h index d5078129be939..b90a2407fb64b 100644 --- a/CalibCalorimetry/EcalSRTools/interface/EcalDccWeightBuilder.h +++ b/CalibCalorimetry/EcalSRTools/interface/EcalDccWeightBuilder.h @@ -1,15 +1,16 @@ -/* - */ - -#ifndef ECALDCCWEIGHTBUILDER_CC -#define ECALDCCWEIGHTBUILDER_CC +#ifndef CalibCalorimetry_EcalSRTools_EcalDccWeightBuilder_h +#define CalibCalorimetry_EcalSRTools_EcalDccWeightBuilder_h -#include "FWCore/Framework/interface/EDAnalyzer.h" +#include "FWCore/Framework/interface/one/EDAnalyzer.h" #include "SimCalorimetry/EcalSimAlgos/interface/EBShape.h" #include "SimCalorimetry/EcalSimAlgos/interface/EEShape.h" #include "DataFormats/EcalDetId/interface/EBDetId.h" #include "DataFormats/EcalDetId/interface/EEDetId.h" #include "CondFormats/EcalObjects/interface/EcalIntercalibConstants.h" +#include "CondFormats/DataRecord/interface/EcalIntercalibConstantsRcd.h" +#include "Geometry/EcalMapping/interface/EcalElectronicsMapping.h" +#include "Geometry/EcalMapping/interface/EcalMappingRcd.h" +#include "Geometry/Records/interface/CaloGeometryRecord.h" #include "FWCore/Framework/interface/EventSetup.h" #include "FWCore/Framework/interface/ESHandle.h" #include "Geometry/CaloGeometry/interface/CaloGeometry.h" @@ -23,7 +24,7 @@ class EcalElectronicsMapping; /** */ -class EcalDccWeightBuilder : public edm::EDAnalyzer { +class EcalDccWeightBuilder : public edm::one::EDAnalyzer<> { private: enum mode_t { WEIGHTS_FROM_CONFIG, COMPUTE_WEIGHTS }; @@ -122,12 +123,19 @@ class EcalDccWeightBuilder : public edm::EDAnalyzer { int dbVersion_; bool sqlMode_; + const edm::ESGetToken geometryToken_; + const edm::ESGetToken mappingToken_; + const edm::ESGetToken intercalibConstToken_; + edm::ESHandle geom_; EcalIntercalibConstantMap& calibMap_; EcalIntercalibConstantMap emptyCalibMap_; std::map > encodedWeights_; + EBShape ebShape_; + EEShape eeShape_; + static const double weightScale_; const EcalElectronicsMapping* ecalElectronicsMap_; @@ -136,4 +144,4 @@ class EcalDccWeightBuilder : public edm::EDAnalyzer { static const int nDccs = ecalDccFedIdMax - ecalDccFedIdMin + 1; }; -#endif //ECALDCCWEIGHTBUILDER_CC not defined +#endif //CalibCalorimetry_EcalSRTools_EcalDccWeightBuilder_h not defined diff --git a/CalibCalorimetry/EcalSRTools/src/EcalDccWeightBuilder.cc b/CalibCalorimetry/EcalSRTools/src/EcalDccWeightBuilder.cc index c27a662b64eb2..5c353e98836a3 100644 --- a/CalibCalorimetry/EcalSRTools/src/EcalDccWeightBuilder.cc +++ b/CalibCalorimetry/EcalSRTools/src/EcalDccWeightBuilder.cc @@ -16,16 +16,10 @@ #include #include -#include "CondFormats/EcalObjects/interface/EcalIntercalibConstants.h" -#include "CondFormats/DataRecord/interface/EcalIntercalibConstantsRcd.h" +#include #include "SimCalorimetry/EcalSimAlgos/interface/EcalSimParameterMap.h" -#include "Geometry/Records/interface/CaloGeometryRecord.h" -#include "Geometry/EcalMapping/interface/EcalElectronicsMapping.h" -#include "Geometry/EcalMapping/interface/EcalMappingRcd.h" #include "DataFormats/EcalDetId/interface/EcalSubdetector.h" -#include "DataFormats/EcalDetId/interface/EBDetId.h" -#include "DataFormats/EcalDetId/interface/EEDetId.h" #ifdef DB_WRITE_SUPPORT #include "OnlineDB/EcalCondDB/interface/EcalCondDBInterface.h" @@ -59,7 +53,12 @@ EcalDccWeightBuilder::EcalDccWeightBuilder(edm::ParameterSet const& ps) dbTag_(ps.getParameter("dbTag")), dbVersion_(ps.getParameter("dbVersion")), sqlMode_(ps.getParameter("sqlMode")), - calibMap_(emptyCalibMap_) { + geometryToken_(esConsumes()), + mappingToken_(esConsumes()), + intercalibConstToken_(esConsumes()), + calibMap_(emptyCalibMap_), + ebShape_(consumesCollector()), + eeShape_(consumesCollector()) { if (mode_ == "weightsFromConfig") { imode_ = WEIGHTS_FROM_CONFIG; if (inputWeights_.size() != (unsigned)nDccWeights_) { @@ -76,20 +75,17 @@ EcalDccWeightBuilder::EcalDccWeightBuilder(edm::ParameterSet const& ps) } void EcalDccWeightBuilder::analyze(const edm::Event& event, const edm::EventSetup& es) { - edm::ESHandle handle; - es.get().get(handle); - ecalElectronicsMap_ = handle.product(); + const auto mappingHandle = es.getHandle(mappingToken_); + ecalElectronicsMap_ = mappingHandle.product(); // Retrieval of intercalib constants if (dccWeightsWithIntercalib_) { - ESHandle hIntercalib; - es.get().get(hIntercalib); - const EcalIntercalibConstants* intercalib = hIntercalib.product(); - calibMap_ = intercalib->getMap(); + const auto& intercalibConst = es.getData(intercalibConstToken_); + calibMap_ = intercalibConst.getMap(); } //gets geometry - es.get().get(geom_); + geom_ = es.getHandle(geometryToken_); //computes the weights: computeAllWeights(dccWeightsWithIntercalib_, es); @@ -109,15 +105,8 @@ void EcalDccWeightBuilder::computeAllWeights(bool withIntercalib, const edm::Eve EcalSimParameterMap parameterMap; const vector& ebDetIds = geom_->getValidDetIds(DetId::Ecal, EcalBarrel); - - // cout << __FILE__ << ":" << __LINE__ << ": " - // << "Number of EB det IDs: " << ebDetIds.size() << "\n"; - const vector& eeDetIds = geom_->getValidDetIds(DetId::Ecal, EcalEndcap); - // cout << __FILE__ << ":" << __LINE__ << ": " - // << "Number of EE det IDs: " << eeDetIds.size() << "\n"; - vector detIds(ebDetIds.size() + eeDetIds.size()); copy(ebDetIds.begin(), ebDetIds.end(), detIds.begin()); copy(eeDetIds.begin(), eeDetIds.end(), detIds.begin() + ebDetIds.size()); @@ -138,12 +127,12 @@ void EcalDccWeightBuilder::computeAllWeights(bool withIntercalib, const edm::Eve #if 0 //for debugging... - cout << __FILE__ << ":" << __LINE__ << ": "; + edm::LogVerbatim("EcalDccWeightBuilder") << __FILE__ << ":" << __LINE__ << ": "; if(it->subdetId()==EcalBarrel){ - cout << "ieta = " << setw(4) << ((EBDetId)(*it)).ieta() + edm::LogVerbatim("EcalDccWeightBuilder") << "ieta = " << setw(4) << ((EBDetId)(*it)).ieta() << " iphi = " << setw(4) << ((EBDetId)(*it)).iphi() << " "; } else if(it->subdetId()==EcalEndcap){ - cout << "ix = " << setw(3) << ((EEDetId)(*it)).ix() + edm::LogVerbatim("EcalDccWeightBuilder") << "ix = " << setw(3) << ((EEDetId)(*it)).ix() << " iy = " << setw(3) << ((EEDetId)(*it)).iy() << " iz = " << setw(1) << ((EEDetId)(*it)).iy() << " "; } else{ @@ -152,20 +141,17 @@ void EcalDccWeightBuilder::computeAllWeights(bool withIntercalib, const edm::Eve << "Got a detId which is neither tagged as ECAL Barrel " << "not ECAL endcap while looping on ECAL cell detIds\n"; } - cout << " -> phase: " << phase << "\n"; - cout << " -> binOfMax: " << binOfMax << "\n"; + edm::LogVerbatim("EcalDccWeightBuilder") << " -> phase: " << phase << "\n"; + edm::LogVerbatim("EcalDccWeightBuilder") << " -> binOfMax: " << binOfMax << "\n"; #endif try { - bool useDBShape = true; - EBShape ebShape(useDBShape); - EEShape eeShape(useDBShape); EcalShapeBase* pShape; if (it->subdetId() == EcalBarrel) { - pShape = &ebShape; + pShape = &ebShape_; } else if (it->subdetId() == EcalEndcap) { - pShape = &eeShape; + pShape = &eeShape_; } else { throw cms::Exception("EcalDccWeightBuilder") << "Bug found in " << __FILE__ << ":" << __LINE__ << ": " << "Got a detId which is neither tagged as ECAL Barrel " @@ -188,17 +174,18 @@ void EcalDccWeightBuilder::computeAllWeights(bool withIntercalib, const edm::Eve unbiasWeights(w, &W); encodedWeights_[*it] = W; } catch (std::exception& e) { - cout << __FILE__ << ":" << __LINE__ << ": "; + edm::LogVerbatim("EcalDccWeightBuilder") << __FILE__ << ":" << __LINE__ << ": "; if (it->subdetId() == EcalBarrel) { - cout << "ieta = " << setw(4) << ((EBDetId)(*it)).ieta() << " iphi = " << setw(4) << ((EBDetId)(*it)).iphi() - << " "; + edm::LogVerbatim("EcalDccWeightBuilder") << "ieta = " << setw(4) << ((EBDetId)(*it)).ieta() + << " iphi = " << setw(4) << ((EBDetId)(*it)).iphi() << " "; } else if (it->subdetId() == EcalEndcap) { - cout << "ix = " << setw(3) << ((EEDetId)(*it)).ix() << " iy = " << setw(3) << ((EEDetId)(*it)).iy() - << " iz = " << setw(1) << ((EEDetId)(*it)).iy() << " "; + edm::LogVerbatim("EcalDccWeightBuilder") + << "ix = " << setw(3) << ((EEDetId)(*it)).ix() << " iy = " << setw(3) << ((EEDetId)(*it)).iy() + << " iz = " << setw(1) << ((EEDetId)(*it)).iy() << " "; } else { - cout << "DetId " << (uint32_t)(*it); + edm::LogVerbatim("EcalDccWeightBuilder") << "DetId " << (uint32_t)(*it); } - cout << "phase: " << phase << "\n"; + edm::LogVerbatim("EcalDccWeightBuilder") << "phase: " << phase << "\n"; throw; } } @@ -245,13 +232,6 @@ double EcalDccWeightBuilder::decodeWeight(int W) { return ((double)W) / weightSc template void EcalDccWeightBuilder::sort(const std::vector& a, std::vector& s, bool decreasingOrder) { - // cout << __FILE__ << ":" << __LINE__ << ": " - // << "sort input array:" ; - // for(unsigned i=0; i& a, std::vector& s, bo } } } while (changed); - - // cout << __FILE__ << ":" << __LINE__ << ": " - // << "sorted list of indices:" ; - // for(unsigned i=0; i < s.size(); ++i){ - // cout << "\t" << s[i]; - // } - // cout << "\n"; } void EcalDccWeightBuilder::unbiasWeights(std::vector& weights, std::vector* encodedWeights) { @@ -293,14 +266,6 @@ void EcalDccWeightBuilder::unbiasWeights(std::vector& weights, std::vect wsum += W[i]; } - // cout << __FILE__ << ":" << __LINE__ << ": " - // << "weights before bias correction: "; - // for(unsigned i=0; i iw(nw); sort(dw, iw, true); @@ -330,14 +295,6 @@ void EcalDccWeightBuilder::unbiasWeights(std::vector& weights, std::vect i = 0; } - // cout << __FILE__ << ":" << __LINE__ << ": " - // << "weights after bias correction: "; - // for(unsigned i=0; iresize(nw); @@ -356,19 +313,19 @@ double EcalDccWeightBuilder::intercalib(const DetId& detId) { coef = (*itCalib); } else { coef = 1.; - std::cout << (uint32_t)detId << " not found in EcalIntercalibConstantMap" << std::endl; + edm::LogVerbatim("EcalDccWeightBuilder") << (uint32_t)detId << " not found in EcalIntercalibConstantMap"; } #if 0 - cout << __FILE__ << ":" << __LINE__ << ": "; + edm::LogVerbatim("EcalDccWeightBuilder") << __FILE__ << ":" << __LINE__ << ": "; if(detId.subdetId()==EcalBarrel){ - cout << "ieta = " << ((EBDetId)detId).ieta() + edm::LogVerbatim("EcalDccWeightBuilder") << "ieta = " << ((EBDetId)detId).ieta() << " iphi = " << ((EBDetId)detId).iphi(); } else{ - cout << "ix = " << ((EEDetId)detId).ix() + edm::LogVerbatim("EcalDccWeightBuilder") << "ix = " << ((EEDetId)detId).ix() << " iy = " << ((EEDetId)detId).iy() << " iz = " << ((EEDetId)detId).zside(); } - cout << " coef = " << coef << "\n"; + edm::LogVerbatim("EcalDccWeightBuilder") << " coef = " << coef << "\n"; #endif return coef; } @@ -511,12 +468,12 @@ void EcalDccWeightBuilder::writeWeightToDB() { } #else //DB_WRITE_SUPPORT defined void EcalDccWeightBuilder::writeWeightToDB() { - cout << "going to write to the online DB " << dbSid_ << " user " << dbUser_ << endl; + edm::LogVerbatim("EcalDccWeightBuilder") << "going to write to the online DB " << dbSid_ << " user " << dbUser_; ; EcalCondDBInterface* econn; try { - cout << "Making connection..." << flush; + edm::LogVerbatim("EcalDccWeightBuilder") << "Making connection..." << flush; const string& filePrefix = string("file:"); if (dbPassword_.find(filePrefix) == 0) { //password must be read for a file string fileName = dbPassword_.substr(filePrefix.size()); @@ -525,25 +482,22 @@ void EcalDccWeightBuilder::writeWeightToDB() { pr.readPassword(fileName, dbUser_, dbPassword_); } - // cout << __FILE__ << ":" << __LINE__ << ": " - // << "Password: " << dbPassword_ << "\n"; - econn = new EcalCondDBInterface(dbSid_, dbUser_, dbPassword_); - cout << "Done." << endl; + edm::LogVerbatim("EcalDccWeightBuilder") << "Done."; } catch (runtime_error& e) { - cerr << e.what() << endl; + edm::LogError("dbconnection") << e.what(); exit(-1); } ODFEWeightsInfo weight_info; weight_info.setConfigTag(dbTag_); weight_info.setVersion(dbVersion_); - cout << "Inserting in DB..." << endl; + edm::LogVerbatim("EcalDccWeightBuilder") << "Inserting in DB..."; econn->insertConfigSet(&weight_info); int weight_id = weight_info.getId(); - cout << "WeightInfo inserted with ID " << weight_id << endl; + edm::LogVerbatim("EcalDccWeightBuilder") << "WeightInfo inserted with ID " << weight_id; vector datadel; datadel.reserve(encodedWeights_.size()); @@ -596,9 +550,9 @@ void EcalDccWeightBuilder::writeWeightToDB() { datadel.push_back(one_dat); } econn->insertConfigDataArraySet(datadel, &weight_info); - std::cout << " .. done insertion in DB " << endl; + edm::LogVerbatim("EcalDccWeightBuilder") << " .. done insertion in DB "; delete econn; - cout << "closed DB connection ... done" << endl; + edm::LogVerbatim("EcalDccWeightBuilder") << "closed DB connection ... done"; } #endif //DB_WRITE_SUPPORT not defined @@ -618,22 +572,22 @@ void EcalDccWeightBuilder::dbId(const DetId& detId, int& fedId, int& smId, int& xtalId = (elecId.stripId() - 1) * stripLength + elecId.xtalId(); #if 0 - cout << __FILE__ << ":" << __LINE__ << ": FED ID " + edm::LogVerbatim("EcalDccWeightBuilder") << __FILE__ << ":" << __LINE__ << ": FED ID " << fedId << "\n"; - cout << __FILE__ << ":" << __LINE__ << ": SM logical ID " + edm::LogVerbatim("EcalDccWeightBuilder") << __FILE__ << ":" << __LINE__ << ": SM logical ID " << smId << "\n"; - cout << __FILE__ << ":" << __LINE__ << ": RU ID (TT or SC): " + edm::LogVerbatim("EcalDccWeightBuilder") << __FILE__ << ":" << __LINE__ << ": RU ID (TT or SC): " << ruId << "\n"; - cout << __FILE__ << ":" << __LINE__ << ": strip:" + edm::LogVerbatim("EcalDccWeightBuilder") << __FILE__ << ":" << __LINE__ << ": strip:" << elecId.stripId() << "\n"; - cout << __FILE__ << ":" << __LINE__ << ": xtal in strip: " + edm::LogVerbatim("EcalDccWeightBuilder") << __FILE__ << ":" << __LINE__ << ": xtal in strip: " << elecId.xtalId() << "\n"; - cout << __FILE__ << ":" << __LINE__ << ": xtalId in RU: " + edm::LogVerbatim("EcalDccWeightBuilder") << __FILE__ << ":" << __LINE__ << ": xtalId in RU: " << xtalId << "\n"; #endif } diff --git a/CalibCalorimetry/EcalSRTools/test/produceDccWeights.py b/CalibCalorimetry/EcalSRTools/test/produceDccWeights.py index 69d57d9e5786b..28fef346901d7 100644 --- a/CalibCalorimetry/EcalSRTools/test/produceDccWeights.py +++ b/CalibCalorimetry/EcalSRTools/test/produceDccWeights.py @@ -15,14 +15,18 @@ firstValid = cms.vuint32(1) ) +process.load("Geometry.HcalCommonData.hcalDDDSimConstants_cff") +process.load("Geometry.HcalCommonData.hcalDDDRecConstants_cfi") + # Conditions: # # a) Getting hardcoded conditions the same used for standard digitization: #process.load("CalibCalorimetry.EcalTrivialCondModules.EcalTrivialCondRetriever_cfi") #process.EcalTrivialConditionRetriever.producedEcalIntercalibConstants = True # b) Getting conditions through frontier interface: -process.load('Configuration/StandardSequences/FrontierConditions_GlobalTag_cff') -process.GlobalTag.globaltag = "CRAFT09_R_V4::All" +process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') +from Configuration.AlCa.GlobalTag import GlobalTag +process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:run2_data', '') # c) Getting conditions through oracle interface: #process.load("RecoLocalCalo.EcalRecProducers.getEcalConditions_orcoffint2r_cff") diff --git a/CalibCalorimetry/EcalTPGTools/plugins/EcalTPGDBCopy.cc b/CalibCalorimetry/EcalTPGTools/plugins/EcalTPGDBCopy.cc index 836148ae531dc..7a9acc35ed156 100644 --- a/CalibCalorimetry/EcalTPGTools/plugins/EcalTPGDBCopy.cc +++ b/CalibCalorimetry/EcalTPGTools/plugins/EcalTPGDBCopy.cc @@ -1,57 +1,18 @@ #include "FWCore/ServiceRegistry/interface/Service.h" #include "CondCore/DBOutputService/interface/PoolDBOutputService.h" +#include #include "FWCore/ParameterSet/interface/ParameterSet.h" -#include "FWCore/Framework/interface/ESHandle.h" #include "FWCore/Framework/interface/EventSetup.h" -#include "CondFormats/EcalObjects/interface/EcalTPGPedestals.h" -#include "CondFormats/EcalObjects/interface/EcalTPGLinearizationConst.h" -#include "CondFormats/EcalObjects/interface/EcalTPGSlidingWindow.h" -#include "CondFormats/EcalObjects/interface/EcalTPGFineGrainEBIdMap.h" -#include "CondFormats/EcalObjects/interface/EcalTPGFineGrainStripEE.h" -#include "CondFormats/EcalObjects/interface/EcalTPGFineGrainTowerEE.h" -#include "CondFormats/EcalObjects/interface/EcalTPGLutIdMap.h" -#include "CondFormats/EcalObjects/interface/EcalTPGWeightIdMap.h" -#include "CondFormats/EcalObjects/interface/EcalTPGWeightGroup.h" -#include "CondFormats/EcalObjects/interface/EcalTPGOddWeightIdMap.h" -#include "CondFormats/EcalObjects/interface/EcalTPGOddWeightGroup.h" -#include "CondFormats/EcalObjects/interface/EcalTPGTPMode.h" -#include "CondFormats/EcalObjects/interface/EcalTPGLutGroup.h" -#include "CondFormats/EcalObjects/interface/EcalTPGFineGrainEBGroup.h" -#include "CondFormats/EcalObjects/interface/EcalTPGPhysicsConst.h" -#include "CondFormats/EcalObjects/interface/EcalTPGCrystalStatus.h" -#include "CondFormats/EcalObjects/interface/EcalTPGSpike.h" -#include "CondFormats/EcalObjects/interface/EcalTPGTowerStatus.h" -#include "CondFormats/EcalObjects/interface/EcalTPGStripStatus.h" - -#include "CondFormats/DataRecord/interface/EcalTPGPedestalsRcd.h" -#include "CondFormats/DataRecord/interface/EcalTPGLinearizationConstRcd.h" -#include "CondFormats/DataRecord/interface/EcalTPGSlidingWindowRcd.h" -#include "CondFormats/DataRecord/interface/EcalTPGFineGrainEBIdMapRcd.h" -#include "CondFormats/DataRecord/interface/EcalTPGFineGrainStripEERcd.h" -#include "CondFormats/DataRecord/interface/EcalTPGFineGrainTowerEERcd.h" -#include "CondFormats/DataRecord/interface/EcalTPGLutIdMapRcd.h" -#include "CondFormats/DataRecord/interface/EcalTPGWeightIdMapRcd.h" -#include "CondFormats/DataRecord/interface/EcalTPGWeightGroupRcd.h" -#include "CondFormats/DataRecord/interface/EcalTPGOddWeightIdMapRcd.h" -#include "CondFormats/DataRecord/interface/EcalTPGOddWeightGroupRcd.h" -#include "CondFormats/DataRecord/interface/EcalTPGTPModeRcd.h" -#include "CondFormats/DataRecord/interface/EcalTPGLutGroupRcd.h" -#include "CondFormats/DataRecord/interface/EcalTPGFineGrainEBGroupRcd.h" -#include "CondFormats/DataRecord/interface/EcalTPGPhysicsConstRcd.h" -#include "CondFormats/DataRecord/interface/EcalTPGCrystalStatusRcd.h" -#include "CondFormats/DataRecord/interface/EcalTPGTowerStatusRcd.h" -#include "CondFormats/DataRecord/interface/EcalTPGSpikeRcd.h" -#include "CondFormats/DataRecord/interface/EcalTPGStripStatusRcd.h" - #include "EcalTPGDBCopy.h" #include EcalTPGDBCopy::EcalTPGDBCopy(const edm::ParameterSet& iConfig) : m_timetype(iConfig.getParameter("timetype")), m_cacheIDs(), m_records() { + auto cc = consumesCollector(); std::string container; std::string tag; std::string record; @@ -62,6 +23,7 @@ EcalTPGDBCopy::EcalTPGDBCopy(const edm::ParameterSet& iConfig) record = i->getParameter("record"); m_cacheIDs.insert(std::make_pair(container, 0)); m_records.insert(std::make_pair(container, record)); + setConsumes(cc, container); } } @@ -80,7 +42,51 @@ void EcalTPGDBCopy::analyze(const edm::Event& evt, const edm::EventSetup& evtSet } } -bool EcalTPGDBCopy::shouldCopy(const edm::EventSetup& evtSetup, std::string container) { +void EcalTPGDBCopy::setConsumes(edm::ConsumesCollector& cc, const std::string& container) { + if (container == "EcalTPGPedestals") { + pedestalsToken_ = cc.esConsumes(); + } else if (container == "EcalTPGLinearizationConst") { + linearizationConstToken_ = cc.esConsumes(); + } else if (container == "EcalTPGSlidingWindow") { + slidingWindowToken_ = cc.esConsumes(); + } else if (container == "EcalTPGFineGrainEBIdMap") { + fineGrainEBIdMapToken_ = cc.esConsumes(); + } else if (container == "EcalTPGFineGrainStripEE") { + fineGrainStripEEToken_ = cc.esConsumes(); + } else if (container == "EcalTPGFineGrainTowerEE") { + fineGrainTowerEEToken_ = cc.esConsumes(); + } else if (container == "EcalTPGLutIdMap") { + lutIdMapToken_ = cc.esConsumes(); + } else if (container == "EcalTPGWeightIdMap") { + weightIdMapToken_ = cc.esConsumes(); + } else if (container == "EcalTPGWeightGroup") { + weightGroupToken_ = cc.esConsumes(); + } else if (container == "EcalTPGOddWeightIdMap") { + oddWeightIdMapToken_ = cc.esConsumes(); + } else if (container == "EcalTPGOddWeightGroup") { + oddWeightGroupToken_ = cc.esConsumes(); + } else if (container == "EcalTPGTPMode") { + tpModeToken_ = cc.esConsumes(); + } else if (container == "EcalTPGLutGroup") { + lutGroupToken_ = cc.esConsumes(); + } else if (container == "EcalTPGFineGrainEBGroup") { + fineGrainEBGroupToken_ = cc.esConsumes(); + } else if (container == "EcalTPGPhysicsConst") { + physicsConstToken_ = cc.esConsumes(); + } else if (container == "EcalTPGCrystalStatus") { + crystalStatusToken_ = cc.esConsumes(); + } else if (container == "EcalTPGTowerStatus") { + towerStatusToken_ = cc.esConsumes(); + } else if (container == "EcalTPGSpike") { + spikeToken_ = cc.esConsumes(); + } else if (container == "EcalTPGStripStatus") { + stripStatusToken_ = cc.esConsumes(); + } else { + throw cms::Exception("Unknown container"); + } +} + +bool EcalTPGDBCopy::shouldCopy(const edm::EventSetup& evtSetup, const std::string& container) { unsigned long long cacheID = 0; if (container == "EcalTPGPedestals") { @@ -133,7 +139,7 @@ bool EcalTPGDBCopy::shouldCopy(const edm::EventSetup& evtSetup, std::string cont } } -void EcalTPGDBCopy::copyToDB(const edm::EventSetup& evtSetup, std::string container) { +void EcalTPGDBCopy::copyToDB(const edm::EventSetup& evtSetup, const std::string& container) { edm::Service dbOutput; if (!dbOutput.isAvailable()) { throw cms::Exception("PoolDBOutputService is not available"); @@ -142,148 +148,123 @@ void EcalTPGDBCopy::copyToDB(const edm::EventSetup& evtSetup, std::string contai std::string recordName = m_records[container]; if (container == "EcalTPGPedestals") { - edm::ESHandle handle; - evtSetup.get().get(handle); + const auto handle = evtSetup.getHandle(pedestalsToken_); const EcalTPGPedestals* obj = handle.product(); dbOutput->createNewIOV( new EcalTPGPedestals(*obj), dbOutput->beginOfTime(), dbOutput->endOfTime(), recordName); } else if (container == "EcalTPGLinearizationConst") { - edm::ESHandle handle; - evtSetup.get().get(handle); + const auto handle = evtSetup.getHandle(linearizationConstToken_); const EcalTPGLinearizationConst* obj = handle.product(); - dbOutput->createNewIOV( new EcalTPGLinearizationConst(*obj), dbOutput->beginOfTime(), dbOutput->endOfTime(), recordName); } else if (container == "EcalTPGSlidingWindow") { - edm::ESHandle handle; - evtSetup.get().get(handle); + const auto handle = evtSetup.getHandle(slidingWindowToken_); const EcalTPGSlidingWindow* obj = handle.product(); - dbOutput->createNewIOV( new EcalTPGSlidingWindow(*obj), dbOutput->beginOfTime(), dbOutput->endOfTime(), recordName); } else if (container == "EcalTPGFineGrainEBIdMap") { - edm::ESHandle handle; - evtSetup.get().get(handle); + const auto handle = evtSetup.getHandle(fineGrainEBIdMapToken_); const EcalTPGFineGrainEBIdMap* obj = handle.product(); dbOutput->createNewIOV( new EcalTPGFineGrainEBIdMap(*obj), dbOutput->beginOfTime(), dbOutput->endOfTime(), recordName); } else if (container == "EcalTPGFineGrainStripEE") { - edm::ESHandle handle; - evtSetup.get().get(handle); + const auto handle = evtSetup.getHandle(fineGrainStripEEToken_); const EcalTPGFineGrainStripEE* obj = handle.product(); dbOutput->createNewIOV( new EcalTPGFineGrainStripEE(*obj), dbOutput->beginOfTime(), dbOutput->endOfTime(), recordName); } else if (container == "EcalTPGFineGrainTowerEE") { - edm::ESHandle handle; - evtSetup.get().get(handle); + const auto handle = evtSetup.getHandle(fineGrainTowerEEToken_); const EcalTPGFineGrainTowerEE* obj = handle.product(); dbOutput->createNewIOV( new EcalTPGFineGrainTowerEE(*obj), dbOutput->beginOfTime(), dbOutput->endOfTime(), recordName); } else if (container == "EcalTPGLutIdMap") { - edm::ESHandle handle; - evtSetup.get().get(handle); + const auto handle = evtSetup.getHandle(lutIdMapToken_); const EcalTPGLutIdMap* obj = handle.product(); dbOutput->createNewIOV( new EcalTPGLutIdMap(*obj), dbOutput->beginOfTime(), dbOutput->endOfTime(), recordName); } else if (container == "EcalTPGWeightIdMap") { - edm::ESHandle handle; - evtSetup.get().get(handle); + const auto handle = evtSetup.getHandle(weightIdMapToken_); const EcalTPGWeightIdMap* obj = handle.product(); dbOutput->createNewIOV( new EcalTPGWeightIdMap(*obj), dbOutput->beginOfTime(), dbOutput->endOfTime(), recordName); } else if (container == "EcalTPGWeightGroup") { - edm::ESHandle handle; - evtSetup.get().get(handle); + const auto handle = evtSetup.getHandle(weightGroupToken_); const EcalTPGWeightGroup* obj = handle.product(); dbOutput->createNewIOV( new EcalTPGWeightGroup(*obj), dbOutput->beginOfTime(), dbOutput->endOfTime(), recordName); } else if (container == "EcalTPGOddWeightIdMap") { - edm::ESHandle handle; - evtSetup.get().get(handle); + const auto handle = evtSetup.getHandle(oddWeightIdMapToken_); const EcalTPGOddWeightIdMap* obj = handle.product(); dbOutput->createNewIOV( new EcalTPGOddWeightIdMap(*obj), dbOutput->beginOfTime(), dbOutput->endOfTime(), recordName); } else if (container == "EcalTPGOddWeightGroup") { - edm::ESHandle handle; - evtSetup.get().get(handle); + const auto handle = evtSetup.getHandle(oddWeightGroupToken_); const EcalTPGOddWeightGroup* obj = handle.product(); dbOutput->createNewIOV( new EcalTPGOddWeightGroup(*obj), dbOutput->beginOfTime(), dbOutput->endOfTime(), recordName); } else if (container == "EcalTPGTPMode") { - edm::ESHandle handle; - evtSetup.get().get(handle); + const auto handle = evtSetup.getHandle(tpModeToken_); const EcalTPGTPMode* obj = handle.product(); dbOutput->createNewIOV( new EcalTPGTPMode(*obj), dbOutput->beginOfTime(), dbOutput->endOfTime(), recordName); } else if (container == "EcalTPGLutGroup") { - edm::ESHandle handle; - evtSetup.get().get(handle); + const auto handle = evtSetup.getHandle(lutGroupToken_); const EcalTPGLutGroup* obj = handle.product(); dbOutput->createNewIOV( new EcalTPGLutGroup(*obj), dbOutput->beginOfTime(), dbOutput->endOfTime(), recordName); } else if (container == "EcalTPGFineGrainEBGroup") { - edm::ESHandle handle; - evtSetup.get().get(handle); - + const auto handle = evtSetup.getHandle(fineGrainEBGroupToken_); const EcalTPGFineGrainEBGroup* obj = handle.product(); - dbOutput->createNewIOV( new EcalTPGFineGrainEBGroup(*obj), dbOutput->beginOfTime(), dbOutput->endOfTime(), recordName); } else if (container == "EcalTPGPhysicsConst") { - edm::ESHandle handle; - evtSetup.get().get(handle); + const auto handle = evtSetup.getHandle(physicsConstToken_); const EcalTPGPhysicsConst* obj = handle.product(); dbOutput->createNewIOV( new EcalTPGPhysicsConst(*obj), dbOutput->beginOfTime(), dbOutput->endOfTime(), recordName); } else if (container == "EcalTPGCrystalStatus") { - edm::ESHandle handle; - evtSetup.get().get(handle); + const auto handle = evtSetup.getHandle(crystalStatusToken_); const EcalTPGCrystalStatus* obj = handle.product(); dbOutput->createNewIOV( new EcalTPGCrystalStatus(*obj), dbOutput->beginOfTime(), dbOutput->endOfTime(), recordName); } else if (container == "EcalTPGTowerStatus") { - edm::ESHandle handle; - evtSetup.get().get(handle); + const auto handle = evtSetup.getHandle(towerStatusToken_); const EcalTPGTowerStatus* obj = handle.product(); dbOutput->createNewIOV( new EcalTPGTowerStatus(*obj), dbOutput->beginOfTime(), dbOutput->endOfTime(), recordName); } else if (container == "EcalTPGSpike") { - edm::ESHandle handle; - evtSetup.get().get(handle); + const auto handle = evtSetup.getHandle(spikeToken_); const EcalTPGSpike* obj = handle.product(); dbOutput->createNewIOV( new EcalTPGSpike(*obj), dbOutput->beginOfTime(), dbOutput->endOfTime(), recordName); } else if (container == "EcalTPGStripStatus") { - edm::ESHandle handle; - evtSetup.get().get(handle); + const auto handle = evtSetup.getHandle(stripStatusToken_); const EcalTPGStripStatus* obj = handle.product(); dbOutput->createNewIOV( new EcalTPGStripStatus(*obj), dbOutput->beginOfTime(), dbOutput->endOfTime(), recordName); - } - - else { + } else { throw cms::Exception("Unknown container"); } - std::cout << "EcalTPGDBCopy wrote " << recordName << std::endl; + edm::LogInfo("EcalTPGDBCopy") << "EcalTPGDBCopy wrote " << recordName; } diff --git a/CalibCalorimetry/EcalTPGTools/plugins/EcalTPGDBCopy.h b/CalibCalorimetry/EcalTPGTools/plugins/EcalTPGDBCopy.h index 469cfd7266bc5..faa5bde5f72d5 100644 --- a/CalibCalorimetry/EcalTPGTools/plugins/EcalTPGDBCopy.h +++ b/CalibCalorimetry/EcalTPGTools/plugins/EcalTPGDBCopy.h @@ -1,11 +1,52 @@ -#ifndef ECALTPGDBCOPY_H -#define ECALTPGDBCOPY_H +#ifndef CalibCalorimetry_EcalTPGTools_EcalTPGDBCopy_h +#define CalibCalorimetry_EcalTPGTools_EcalTPGDBCopy_h -#include "FWCore/Framework/interface/EDAnalyzer.h" +#include "FWCore/Framework/interface/one/EDAnalyzer.h" #include "CondCore/CondDB/interface/Exception.h" +#include "FWCore/Framework/interface/ConsumesCollector.h" #include "FWCore/Framework/interface/IOVSyncValue.h" +#include "CondFormats/EcalObjects/interface/EcalTPGPedestals.h" +#include "CondFormats/EcalObjects/interface/EcalTPGLinearizationConst.h" +#include "CondFormats/EcalObjects/interface/EcalTPGSlidingWindow.h" +#include "CondFormats/EcalObjects/interface/EcalTPGFineGrainEBIdMap.h" +#include "CondFormats/EcalObjects/interface/EcalTPGFineGrainStripEE.h" +#include "CondFormats/EcalObjects/interface/EcalTPGFineGrainTowerEE.h" +#include "CondFormats/EcalObjects/interface/EcalTPGLutIdMap.h" +#include "CondFormats/EcalObjects/interface/EcalTPGWeightIdMap.h" +#include "CondFormats/EcalObjects/interface/EcalTPGWeightGroup.h" +#include "CondFormats/EcalObjects/interface/EcalTPGOddWeightIdMap.h" +#include "CondFormats/EcalObjects/interface/EcalTPGOddWeightGroup.h" +#include "CondFormats/EcalObjects/interface/EcalTPGTPMode.h" +#include "CondFormats/EcalObjects/interface/EcalTPGLutGroup.h" +#include "CondFormats/EcalObjects/interface/EcalTPGFineGrainEBGroup.h" +#include "CondFormats/EcalObjects/interface/EcalTPGPhysicsConst.h" +#include "CondFormats/EcalObjects/interface/EcalTPGCrystalStatus.h" +#include "CondFormats/EcalObjects/interface/EcalTPGSpike.h" +#include "CondFormats/EcalObjects/interface/EcalTPGTowerStatus.h" +#include "CondFormats/EcalObjects/interface/EcalTPGStripStatus.h" + +#include "CondFormats/DataRecord/interface/EcalTPGPedestalsRcd.h" +#include "CondFormats/DataRecord/interface/EcalTPGLinearizationConstRcd.h" +#include "CondFormats/DataRecord/interface/EcalTPGSlidingWindowRcd.h" +#include "CondFormats/DataRecord/interface/EcalTPGFineGrainEBIdMapRcd.h" +#include "CondFormats/DataRecord/interface/EcalTPGFineGrainStripEERcd.h" +#include "CondFormats/DataRecord/interface/EcalTPGFineGrainTowerEERcd.h" +#include "CondFormats/DataRecord/interface/EcalTPGLutIdMapRcd.h" +#include "CondFormats/DataRecord/interface/EcalTPGWeightIdMapRcd.h" +#include "CondFormats/DataRecord/interface/EcalTPGWeightGroupRcd.h" +#include "CondFormats/DataRecord/interface/EcalTPGOddWeightIdMapRcd.h" +#include "CondFormats/DataRecord/interface/EcalTPGOddWeightGroupRcd.h" +#include "CondFormats/DataRecord/interface/EcalTPGTPModeRcd.h" +#include "CondFormats/DataRecord/interface/EcalTPGLutGroupRcd.h" +#include "CondFormats/DataRecord/interface/EcalTPGFineGrainEBGroupRcd.h" +#include "CondFormats/DataRecord/interface/EcalTPGPhysicsConstRcd.h" +#include "CondFormats/DataRecord/interface/EcalTPGCrystalStatusRcd.h" +#include "CondFormats/DataRecord/interface/EcalTPGTowerStatusRcd.h" +#include "CondFormats/DataRecord/interface/EcalTPGSpikeRcd.h" +#include "CondFormats/DataRecord/interface/EcalTPGStripStatusRcd.h" + #include #include @@ -15,7 +56,7 @@ namespace edm { class EventSetup; } // namespace edm -class EcalTPGDBCopy : public edm::EDAnalyzer { +class EcalTPGDBCopy : public edm::one::EDAnalyzer<> { public: explicit EcalTPGDBCopy(const edm::ParameterSet& iConfig); ~EcalTPGDBCopy() override; @@ -23,12 +64,33 @@ class EcalTPGDBCopy : public edm::EDAnalyzer { void analyze(const edm::Event& evt, const edm::EventSetup& evtSetup) override; private: - bool shouldCopy(const edm::EventSetup& evtSetup, std::string container); - void copyToDB(const edm::EventSetup& evtSetup, std::string container); + void setConsumes(edm::ConsumesCollector& cc, const std::string& container); + bool shouldCopy(const edm::EventSetup& evtSetup, const std::string& container); + void copyToDB(const edm::EventSetup& evtSetup, const std::string& container); std::string m_timetype; std::map m_cacheIDs; std::map m_records; + + edm::ESGetToken pedestalsToken_; + edm::ESGetToken linearizationConstToken_; + edm::ESGetToken slidingWindowToken_; + edm::ESGetToken fineGrainEBIdMapToken_; + edm::ESGetToken fineGrainStripEEToken_; + edm::ESGetToken fineGrainTowerEEToken_; + edm::ESGetToken lutIdMapToken_; + edm::ESGetToken weightIdMapToken_; + edm::ESGetToken weightGroupToken_; + edm::ESGetToken oddWeightIdMapToken_; + edm::ESGetToken oddWeightGroupToken_; + edm::ESGetToken tpModeToken_; + edm::ESGetToken lutGroupToken_; + edm::ESGetToken fineGrainEBGroupToken_; + edm::ESGetToken physicsConstToken_; + edm::ESGetToken crystalStatusToken_; + edm::ESGetToken towerStatusToken_; + edm::ESGetToken spikeToken_; + edm::ESGetToken stripStatusToken_; }; #endif diff --git a/CalibCalorimetry/EcalTPGTools/plugins/EcalTPGParamBuilder.cc b/CalibCalorimetry/EcalTPGTools/plugins/EcalTPGParamBuilder.cc index a71e02e4214d1..dc8fba95a36fc 100644 --- a/CalibCalorimetry/EcalTPGTools/plugins/EcalTPGParamBuilder.cc +++ b/CalibCalorimetry/EcalTPGTools/plugins/EcalTPGParamBuilder.cc @@ -14,8 +14,6 @@ #include "CalibCalorimetry/EcalLaserCorrection/interface/EcalLaserDbRecord.h" #include "SimCalorimetry/EcalSimAlgos/interface/EcalSimParameterMap.h" -#include "SimCalorimetry/EcalSimAlgos/interface/EBShape.h" -#include "SimCalorimetry/EcalSimAlgos/interface/EEShape.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" #include @@ -53,7 +51,8 @@ EcalTPGParamBuilder::EcalTPGParamBuilder(edm::ParameterSet const& pSet) xtal_LSB_EE_(0), nSample_(5), complement2_(7), - useDBShape_(true) { + shapeEB_(consumesCollector()), // EBShape, EEShape are fetched now from DB (2018.05.22 K. Theofilatos) + shapeEE_(consumesCollector()) { ped_conf_id_ = 0; lin_conf_id_ = 0; lut_conf_id_ = 0; @@ -1610,13 +1609,10 @@ void EcalTPGParamBuilder::analyze(const edm::Event& evt, const edm::EventSetup& const int NWEIGROUPS = 2; std::vector weights[NWEIGROUPS]; - bool useDBShape = useDBShape_; - EBShape shapeEB(useDBShape); - shapeEB.setEventSetup(evtSetup); // EBShape, EEShape are fetched now from DB (2018.05.22 K. Theofilatos) - EEShape shapeEE(useDBShape); - shapeEE.setEventSetup(evtSetup); // - weights[0] = computeWeights(shapeEB, hshapeEB); - weights[1] = computeWeights(shapeEE, hshapeEE); + shapeEB_.setEventSetup(evtSetup); + shapeEE_.setEventSetup(evtSetup); + weights[0] = computeWeights(shapeEB_, hshapeEB); + weights[1] = computeWeights(shapeEE_, hshapeEE); map dataset; diff --git a/CalibCalorimetry/EcalTPGTools/plugins/EcalTPGParamBuilder.h b/CalibCalorimetry/EcalTPGTools/plugins/EcalTPGParamBuilder.h index 0484a330031f5..856ed9e91458d 100644 --- a/CalibCalorimetry/EcalTPGTools/plugins/EcalTPGParamBuilder.h +++ b/CalibCalorimetry/EcalTPGTools/plugins/EcalTPGParamBuilder.h @@ -41,6 +41,8 @@ #include "CondFormats/EcalObjects/interface/EcalLaserAlphas.h" #include "SimCalorimetry/EcalSimAlgos/interface/EcalShapeBase.h" +#include "SimCalorimetry/EcalSimAlgos/interface/EBShape.h" +#include "SimCalorimetry/EcalSimAlgos/interface/EEShape.h" #include @@ -162,6 +164,9 @@ class EcalTPGParamBuilder : public edm::one::EDAnalyzer<> { //modif-alex 30/01/2012 std::map Transparency_Correction_; + EBShape shapeEB_; + EEShape shapeEE_; + std::ofstream* out_file_; std::ofstream* geomFile_; EcalTPGDBApp* db_; @@ -198,7 +203,5 @@ class EcalTPGParamBuilder : public edm::one::EDAnalyzer<> { Int_t* ntupleInts_; Char_t ntupleDet_[10]; Char_t ntupleCrate_[10]; - - bool useDBShape_; }; #endif diff --git a/CalibCalorimetry/EcalTrivialCondModules/interface/EcalLaserCondTools.h b/CalibCalorimetry/EcalTrivialCondModules/interface/EcalLaserCondTools.h index 767c91a27d448..9f179bfd709cf 100644 --- a/CalibCalorimetry/EcalTrivialCondModules/interface/EcalLaserCondTools.h +++ b/CalibCalorimetry/EcalTrivialCondModules/interface/EcalLaserCondTools.h @@ -1,16 +1,17 @@ -#ifndef EcaLaserCondTools_h -#define EcaLaserCondTools_h +#ifndef CalibCalorimetry_EcalTrivialCondModules_EcaLaserCondTools_h +#define CalibCalorimetry_EcalTrivialCondModules_EcaLaserCondTools_h /* * $Id: EcalLaserCondTools.h,v 1.2 2010/06/14 10:45:16 pgras Exp $ */ #include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/EDAnalyzer.h" +#include "FWCore/Framework/interface/one/EDAnalyzer.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "FWCore/ServiceRegistry/interface/Service.h" #include "CondCore/DBOutputService/interface/PoolDBOutputService.h" #include "CondFormats/EcalObjects/interface/EcalLaserAPDPNRatios.h" +#include "CondFormats/DataRecord/interface/EcalLaserAPDPNRatiosRcd.h" #include "DataFormats/DetId/interface/DetId.h" @@ -20,7 +21,7 @@ #include /** */ -class EcalLaserCondTools : public edm::EDAnalyzer { +class EcalLaserCondTools : public edm::one::EDAnalyzer<> { //static fields /** Number of extended laser monitoring regions @@ -83,6 +84,7 @@ class EcalLaserCondTools : public edm::EDAnalyzer { //fields private: + edm::ESGetToken laserAPDPNRatiosToken_; FILE* fout_; FILE* eventList_; std::string eventListFileName_; diff --git a/CalibCalorimetry/EcalTrivialCondModules/interface/EcalTrivialObjectAnalyzer.h b/CalibCalorimetry/EcalTrivialCondModules/interface/EcalTrivialObjectAnalyzer.h index e3308173f5691..cef90d783dc02 100644 --- a/CalibCalorimetry/EcalTrivialCondModules/interface/EcalTrivialObjectAnalyzer.h +++ b/CalibCalorimetry/EcalTrivialCondModules/interface/EcalTrivialObjectAnalyzer.h @@ -1,18 +1,101 @@ +#ifndef CalibCalorimetry_EcalTrivialCondModules_EcalTrivialObjectAnalyzer_h +#define CalibCalorimetry_EcalTrivialCondModules_EcalTrivialObjectAnalyzer_h // // Created: 2 Mar 2006 // Shahram Rahatlou, University of Rome & INFN // -#include "FWCore/Framework/interface/EDAnalyzer.h" +#include "FWCore/Framework/interface/one/EDAnalyzer.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/EventSetup.h" -class EcalTrivialObjectAnalyzer : public edm::EDAnalyzer { +#include "CondFormats/EcalObjects/interface/EcalPedestals.h" +#include "CondFormats/DataRecord/interface/EcalPedestalsRcd.h" + +#include "CondFormats/EcalObjects/interface/EcalWeightXtalGroups.h" +#include "CondFormats/DataRecord/interface/EcalWeightXtalGroupsRcd.h" + +#include "CondFormats/EcalObjects/interface/EcalTBWeights.h" +#include "CondFormats/DataRecord/interface/EcalTBWeightsRcd.h" + +#include "CondFormats/EcalObjects/interface/EcalIntercalibConstants.h" +#include "CondFormats/DataRecord/interface/EcalIntercalibConstantsRcd.h" + +#include "CondFormats/EcalObjects/interface/EcalIntercalibErrors.h" +#include "CondFormats/DataRecord/interface/EcalIntercalibErrorsRcd.h" + +#include "CondFormats/EcalObjects/interface/EcalTimeCalibConstants.h" +#include "CondFormats/DataRecord/interface/EcalTimeCalibConstantsRcd.h" + +#include "CondFormats/EcalObjects/interface/EcalTimeCalibErrors.h" +#include "CondFormats/DataRecord/interface/EcalTimeCalibErrorsRcd.h" + +#include "CondFormats/EcalObjects/interface/EcalTimeOffsetConstant.h" +#include "CondFormats/DataRecord/interface/EcalTimeOffsetConstantRcd.h" + +#include "CondFormats/EcalObjects/interface/EcalGainRatios.h" +#include "CondFormats/DataRecord/interface/EcalGainRatiosRcd.h" + +#include "CondFormats/EcalObjects/interface/EcalADCToGeVConstant.h" +#include "CondFormats/DataRecord/interface/EcalADCToGeVConstantRcd.h" + +#include "CondFormats/EcalObjects/interface/EcalLaserAlphas.h" +#include "CondFormats/DataRecord/interface/EcalLaserAlphasRcd.h" + +#include "CondFormats/EcalObjects/interface/EcalLaserAPDPNRatiosRef.h" +#include "CondFormats/DataRecord/interface/EcalLaserAPDPNRatiosRefRcd.h" + +#include "CondFormats/EcalObjects/interface/EcalLaserAPDPNRatios.h" +#include "CondFormats/DataRecord/interface/EcalLaserAPDPNRatiosRcd.h" + +#include "CondFormats/EcalObjects/interface/EcalClusterLocalContCorrParameters.h" +#include "CondFormats/DataRecord/interface/EcalClusterLocalContCorrParametersRcd.h" +#include "CondFormats/EcalObjects/interface/EcalClusterCrackCorrParameters.h" +#include "CondFormats/DataRecord/interface/EcalClusterCrackCorrParametersRcd.h" +#include "CondFormats/EcalObjects/interface/EcalClusterEnergyCorrectionParameters.h" +#include "CondFormats/DataRecord/interface/EcalClusterEnergyCorrectionParametersRcd.h" +#include "CondFormats/EcalObjects/interface/EcalClusterEnergyUncertaintyParameters.h" +#include "CondFormats/DataRecord/interface/EcalClusterEnergyUncertaintyParametersRcd.h" +#include "CondFormats/EcalObjects/interface/EcalClusterEnergyCorrectionObjectSpecificParameters.h" +#include "CondFormats/DataRecord/interface/EcalClusterEnergyCorrectionObjectSpecificParametersRcd.h" + +#include "CondFormats/EcalObjects/interface/EcalChannelStatus.h" +#include "CondFormats/DataRecord/interface/EcalChannelStatusRcd.h" + +#include "CondFormats/EcalObjects/interface/EcalSampleMask.h" +#include "CondFormats/DataRecord/interface/EcalSampleMaskRcd.h" + +class EcalTrivialObjectAnalyzer : public edm::one::EDAnalyzer<> { public: - explicit EcalTrivialObjectAnalyzer(edm::ParameterSet const& p) {} - explicit EcalTrivialObjectAnalyzer(int i) {} + explicit EcalTrivialObjectAnalyzer(edm::ParameterSet const& p); ~EcalTrivialObjectAnalyzer() override {} void analyze(const edm::Event& e, const edm::EventSetup& c) override; private: + const edm::ESGetToken pedestalsToken_; + const edm::ESGetToken adcToGevConstantToken_; + const edm::ESGetToken weightXtalGroupsToken_; + const edm::ESGetToken gainRatiosToken_; + const edm::ESGetToken intercalibConstantsToken_; + const edm::ESGetToken intercalibErrorsToken_; + const edm::ESGetToken timeCalibConstantsToken_; + const edm::ESGetToken timeCalibErrorsToken_; + const edm::ESGetToken timeOffsetConstantToken_; + const edm::ESGetToken tbWeightsToken_; + const edm::ESGetToken + clusterLocalContCorrToken_; + const edm::ESGetToken clusterCrackCorrToken_; + const edm::ESGetToken + clusterEnergyCorrectionToken_; + const edm::ESGetToken + clusterEnergyUncertaintyToken_; + const edm::ESGetToken + clusterEnergyCorrectionObjectSpecificToken_; + const edm::ESGetToken laserAlphasToken_; + const edm::ESGetToken laserAPDPNRatiosRefToken_; + const edm::ESGetToken laserAPDPNRatiosToken_; + const edm::ESGetToken channelStatusToken_; + const edm::ESGetToken sampleMaskToken_; }; +#endif diff --git a/CalibCalorimetry/EcalTrivialCondModules/src/EcalLaserCondTools.cc b/CalibCalorimetry/EcalTrivialCondModules/src/EcalLaserCondTools.cc index eb836e3c4a5f7..7a6c64d1f22de 100644 --- a/CalibCalorimetry/EcalTrivialCondModules/src/EcalLaserCondTools.cc +++ b/CalibCalorimetry/EcalTrivialCondModules/src/EcalLaserCondTools.cc @@ -7,12 +7,10 @@ #include "CalibCalorimetry/EcalTrivialCondModules/interface/EcalLaserCondTools.h" -#include "FWCore/Framework/interface/ESHandle.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/EventSetup.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" -#include "CondFormats/DataRecord/interface/EcalLaserAPDPNRatiosRcd.h" #include "DataFormats/EcalDetId/interface/EBDetId.h" #include "DataFormats/EcalDetId/interface/EEDetId.h" @@ -36,6 +34,10 @@ EcalLaserCondTools::EcalLaserCondTools(const edm::ParameterSet& ps) toTime_(ps.getParameter("toTime")), minP_(ps.getParameter("transparencyMin")), maxP_(ps.getParameter("transparencyMax")) { + if (mode_ == "db_to_ascii_file") { + laserAPDPNRatiosToken_ = esConsumes(); + } + ferr_ = fopen("corr_errors.txt", "w"); fprintf(ferr_, "#t1\tdetid\tp1\tp2\tp3"); @@ -618,13 +620,10 @@ std::string EcalLaserCondTools::timeToString(time_t t) { } void EcalLaserCondTools::dbToAscii(const edm::EventSetup& es) { - edm::ESHandle hCorr; - es.get().get(hCorr); - - const EcalLaserAPDPNRatios* corr = hCorr.product(); + const auto& laserAPDPNRatios = es.getData(laserAPDPNRatiosToken_); - const EcalLaserAPDPNRatios::EcalLaserAPDPNRatiosMap& p = corr->getLaserMap(); - const EcalLaserAPDPNRatios::EcalLaserTimeStampMap& t = corr->getTimeMap(); + const EcalLaserAPDPNRatios::EcalLaserAPDPNRatiosMap& p = laserAPDPNRatios.getLaserMap(); + const EcalLaserAPDPNRatios::EcalLaserTimeStampMap& t = laserAPDPNRatios.getTimeMap(); if (t.size() != EcalLaserCondTools::nLmes) throw cms::Exception("LasCor") << "Unexpected number time parameter triplets\n"; diff --git a/CalibCalorimetry/EcalTrivialCondModules/src/EcalTrivialObjectAnalyzer.cc b/CalibCalorimetry/EcalTrivialCondModules/src/EcalTrivialObjectAnalyzer.cc index b1613f496bc7a..3b6b52ff96aae 100644 --- a/CalibCalorimetry/EcalTrivialCondModules/src/EcalTrivialObjectAnalyzer.cc +++ b/CalibCalorimetry/EcalTrivialCondModules/src/EcalTrivialObjectAnalyzer.cc @@ -10,90 +10,50 @@ #include #include #include -#include "FWCore/Framework/interface/ESHandle.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" -#include "DataFormats/EcalDetId/interface/EBDetId.h" - -#include "CondFormats/EcalObjects/interface/EcalPedestals.h" -#include "CondFormats/DataRecord/interface/EcalPedestalsRcd.h" - #include "CondFormats/EcalObjects/interface/EcalXtalGroupId.h" -#include "CondFormats/EcalObjects/interface/EcalWeightXtalGroups.h" -#include "CondFormats/DataRecord/interface/EcalWeightXtalGroupsRcd.h" - #include "CondFormats/EcalObjects/interface/EcalWeightSet.h" -#include "CondFormats/EcalObjects/interface/EcalTBWeights.h" -#include "CondFormats/DataRecord/interface/EcalTBWeightsRcd.h" - -#include "CondFormats/EcalObjects/interface/EcalIntercalibConstants.h" -#include "CondFormats/DataRecord/interface/EcalIntercalibConstantsRcd.h" - -#include "CondFormats/EcalObjects/interface/EcalIntercalibErrors.h" -#include "CondFormats/DataRecord/interface/EcalIntercalibErrorsRcd.h" - -#include "CondFormats/EcalObjects/interface/EcalTimeCalibConstants.h" -#include "CondFormats/DataRecord/interface/EcalTimeCalibConstantsRcd.h" - -#include "CondFormats/EcalObjects/interface/EcalTimeCalibErrors.h" -#include "CondFormats/DataRecord/interface/EcalTimeCalibErrorsRcd.h" - -#include "CondFormats/EcalObjects/interface/EcalTimeOffsetConstant.h" -#include "CondFormats/DataRecord/interface/EcalTimeOffsetConstantRcd.h" - +#include "DataFormats/EcalDetId/interface/EBDetId.h" #include "CondFormats/EcalObjects/interface/EcalMGPAGainRatio.h" -#include "CondFormats/EcalObjects/interface/EcalGainRatios.h" -#include "CondFormats/DataRecord/interface/EcalGainRatiosRcd.h" - -#include "CondFormats/EcalObjects/interface/EcalADCToGeVConstant.h" -#include "CondFormats/DataRecord/interface/EcalADCToGeVConstantRcd.h" - -#include "CondFormats/EcalObjects/interface/EcalLaserAlphas.h" -#include "CondFormats/DataRecord/interface/EcalLaserAlphasRcd.h" - -#include "CondFormats/EcalObjects/interface/EcalLaserAPDPNRatiosRef.h" -#include "CondFormats/DataRecord/interface/EcalLaserAPDPNRatiosRefRcd.h" - -#include "CondFormats/EcalObjects/interface/EcalLaserAPDPNRatios.h" -#include "CondFormats/DataRecord/interface/EcalLaserAPDPNRatiosRcd.h" - -#include "CondFormats/EcalObjects/interface/EcalClusterLocalContCorrParameters.h" -#include "CondFormats/DataRecord/interface/EcalClusterLocalContCorrParametersRcd.h" -#include "CondFormats/EcalObjects/interface/EcalClusterCrackCorrParameters.h" -#include "CondFormats/DataRecord/interface/EcalClusterCrackCorrParametersRcd.h" -#include "CondFormats/EcalObjects/interface/EcalClusterEnergyCorrectionParameters.h" -#include "CondFormats/DataRecord/interface/EcalClusterEnergyCorrectionParametersRcd.h" -#include "CondFormats/EcalObjects/interface/EcalClusterEnergyUncertaintyParameters.h" -#include "CondFormats/DataRecord/interface/EcalClusterEnergyUncertaintyParametersRcd.h" -#include "CondFormats/EcalObjects/interface/EcalClusterEnergyCorrectionObjectSpecificParameters.h" -#include "CondFormats/DataRecord/interface/EcalClusterEnergyCorrectionObjectSpecificParametersRcd.h" - -#include "CondFormats/EcalObjects/interface/EcalChannelStatus.h" -#include "CondFormats/DataRecord/interface/EcalChannelStatusRcd.h" - -#include "CondFormats/EcalObjects/interface/EcalSampleMask.h" -#include "CondFormats/DataRecord/interface/EcalSampleMaskRcd.h" #include "CLHEP/Matrix/Matrix.h" using namespace std; +EcalTrivialObjectAnalyzer::EcalTrivialObjectAnalyzer(edm::ParameterSet const& p) + : pedestalsToken_(esConsumes()), + adcToGevConstantToken_(esConsumes()), + weightXtalGroupsToken_(esConsumes()), + gainRatiosToken_(esConsumes()), + intercalibConstantsToken_(esConsumes()), + intercalibErrorsToken_(esConsumes()), + timeCalibConstantsToken_(esConsumes()), + timeCalibErrorsToken_(esConsumes()), + timeOffsetConstantToken_(esConsumes()), + tbWeightsToken_(esConsumes()), + clusterLocalContCorrToken_(esConsumes()), + clusterCrackCorrToken_(esConsumes()), + clusterEnergyCorrectionToken_(esConsumes()), + clusterEnergyUncertaintyToken_(esConsumes()), + clusterEnergyCorrectionObjectSpecificToken_(esConsumes()), + laserAlphasToken_(esConsumes()), + laserAPDPNRatiosRefToken_(esConsumes()), + laserAPDPNRatiosToken_(esConsumes()), + channelStatusToken_(esConsumes()), + sampleMaskToken_(esConsumes()) {} + void EcalTrivialObjectAnalyzer::analyze(const edm::Event& e, const edm::EventSetup& context) { using namespace edm::eventsetup; // Context is not used. edm::LogInfo(">>> EcalTrivialObjectAnalyzer: processing run ") << e.id().run() << " event: " << e.id().event(); - edm::ESHandle pPeds; - context.get().get(pPeds); - // ADC -> GeV Scale - edm::ESHandle pAgc; - context.get().get(pAgc); - const EcalADCToGeVConstant* agc = pAgc.product(); - edm::LogInfo("Global ADC->GeV scale: EB ") << std::setprecision(6) << agc->getEBValue() + const auto& agc = context.getData(adcToGevConstantToken_); + edm::LogInfo("Global ADC->GeV scale: EB ") << std::setprecision(6) << agc.getEBValue() << " GeV/ADC count" " EE " - << std::setprecision(6) << agc->getEEValue() << " GeV/ADC count"; + << std::setprecision(6) << agc.getEEValue() << " GeV/ADC count"; // use a channel to fetch values from DB double r1 = (double)std::rand() / (double(RAND_MAX) + double(1)); @@ -104,9 +64,9 @@ void EcalTrivialObjectAnalyzer::analyze(const edm::Event& e, const edm::EventSet EBDetId ebid(ieta, iphi); //eta,phi edm::LogInfo("EcalTrivialObjectAnalyzer: using EBDetId: ") << ebid; - const EcalPedestals* myped = pPeds.product(); - EcalPedestals::const_iterator it = myped->find(ebid.rawId()); - if (it != myped->end()) { + const auto& myped = context.getData(pedestalsToken_); + EcalPedestals::const_iterator it = myped.find(ebid.rawId()); + if (it != myped.end()) { edm::LogInfo("EcalPedestal: ") << " mean_x1: " << std::setprecision(8) << (*it).mean_x1 << " rms_x1: " << (*it).rms_x1 << " mean_x6: " << (*it).mean_x6 << " rms_x6: " << (*it).rms_x6 << " mean_x12: " << (*it).mean_x12 @@ -116,13 +76,11 @@ void EcalTrivialObjectAnalyzer::analyze(const edm::Event& e, const edm::EventSet } // fetch map of groups of xtals - edm::ESHandle pGrp; - context.get().get(pGrp); - const EcalWeightXtalGroups* grp = pGrp.product(); + const auto& grp = context.getData(weightXtalGroupsToken_); - EcalXtalGroupsMap::const_iterator git = grp->getMap().find(ebid.rawId()); + EcalXtalGroupsMap::const_iterator git = grp.getMap().find(ebid.rawId()); EcalXtalGroupId gid; - if (git != grp->getMap().end()) { + if (git != grp.getMap().end()) { edm::LogInfo("XtalGroupId.id() = ") << std::setprecision(3) << (*git).id(); gid = (*git); } else { @@ -130,13 +88,11 @@ void EcalTrivialObjectAnalyzer::analyze(const edm::Event& e, const edm::EventSet } // Gain Ratios - edm::ESHandle pRatio; - context.get().get(pRatio); - const EcalGainRatios* gr = pRatio.product(); + const auto& gr = context.getData(gainRatiosToken_); - EcalGainRatioMap::const_iterator grit = gr->getMap().find(ebid.rawId()); + EcalGainRatioMap::const_iterator grit = gr.getMap().find(ebid.rawId()); EcalMGPAGainRatio mgpa; - if (grit != gr->getMap().end()) { + if (grit != gr.getMap().end()) { mgpa = (*grit); edm::LogInfo("EcalMGPAGainRatio: ") << "gain 12/6 : " << std::setprecision(4) << mgpa.gain12Over6() @@ -146,13 +102,11 @@ void EcalTrivialObjectAnalyzer::analyze(const edm::Event& e, const edm::EventSet } // Intercalib constants - edm::ESHandle pIcal; - context.get().get(pIcal); - const EcalIntercalibConstants* ical = pIcal.product(); + const auto& ical = context.getData(intercalibConstantsToken_); - EcalIntercalibConstantMap::const_iterator icalit = ical->getMap().find(ebid.rawId()); + EcalIntercalibConstantMap::const_iterator icalit = ical.getMap().find(ebid.rawId()); EcalIntercalibConstant icalconst; - if (icalit != ical->getMap().end()) { + if (icalit != ical.getMap().end()) { icalconst = (*icalit); edm::LogInfo("EcalIntercalibConstant: ") << std::setprecision(6) << icalconst; @@ -161,13 +115,11 @@ void EcalTrivialObjectAnalyzer::analyze(const edm::Event& e, const edm::EventSet } // Intercalib errors - edm::ESHandle pIcalErr; - context.get().get(pIcalErr); - const EcalIntercalibErrors* icalErr = pIcalErr.product(); + const auto& icalErr = context.getData(intercalibErrorsToken_); - EcalIntercalibErrorMap::const_iterator icalitErr = icalErr->getMap().find(ebid.rawId()); + EcalIntercalibErrorMap::const_iterator icalitErr = icalErr.getMap().find(ebid.rawId()); EcalIntercalibError icalconstErr; - if (icalitErr != icalErr->getMap().end()) { + if (icalitErr != icalErr.getMap().end()) { icalconstErr = (*icalitErr); edm::LogInfo("EcalIntercalibError: ") << std::setprecision(6) << icalconstErr; @@ -177,13 +129,11 @@ void EcalTrivialObjectAnalyzer::analyze(const edm::Event& e, const edm::EventSet { // quick and dirty for cut and paste ;) it is a test program... // TimeCalib constants - edm::ESHandle pIcal; - context.get().get(pIcal); - const EcalTimeCalibConstants* ical = pIcal.product(); + const auto& ical = context.getData(timeCalibConstantsToken_); - EcalTimeCalibConstantMap::const_iterator icalit = ical->getMap().find(ebid.rawId()); + EcalTimeCalibConstantMap::const_iterator icalit = ical.getMap().find(ebid.rawId()); EcalTimeCalibConstant icalconst; - if (icalit != ical->getMap().end()) { + if (icalit != ical.getMap().end()) { icalconst = (*icalit); edm::LogInfo("EcalTimeCalibConstant: ") << std::setprecision(6) << icalconst; @@ -192,13 +142,11 @@ void EcalTrivialObjectAnalyzer::analyze(const edm::Event& e, const edm::EventSet } // TimeCalib errors - edm::ESHandle pIcalErr; - context.get().get(pIcalErr); - const EcalTimeCalibErrors* icalErr = pIcalErr.product(); + const auto& icalErr = context.getData(timeCalibErrorsToken_); - EcalTimeCalibErrorMap::const_iterator icalitErr = icalErr->getMap().find(ebid.rawId()); + EcalTimeCalibErrorMap::const_iterator icalitErr = icalErr.getMap().find(ebid.rawId()); EcalTimeCalibError icalconstErr; - if (icalitErr != icalErr->getMap().end()) { + if (icalitErr != icalErr.getMap().end()) { icalconstErr = (*icalitErr); edm::LogInfo("EcalTimeCalibError: ") << std::setprecision(6) << icalconstErr; @@ -211,27 +159,23 @@ void EcalTrivialObjectAnalyzer::analyze(const edm::Event& e, const edm::EventSet //std::cout <<"Fetching TimeOffsetConstant from DB " << std::endl; // Time Offset constants - edm::ESHandle pTOff; - context.get().get(pTOff); - const EcalTimeOffsetConstant* TOff = pTOff.product(); + const auto& TOff = context.getData(timeOffsetConstantToken_); - edm::LogInfo("EcalTimeOffsetConstant: ") << " EB " << TOff->getEBValue() << " EE " << TOff->getEEValue(); + edm::LogInfo("EcalTimeOffsetConstant: ") << " EB " << TOff.getEBValue() << " EE " << TOff.getEEValue(); // fetch TB weights edm::LogInfo("Fetching EcalTBWeights from DB "); - edm::ESHandle pWgts; - context.get().get(pWgts); - const EcalTBWeights* wgts = pWgts.product(); - edm::LogInfo("EcalTBWeightMap.size(): ") << std::setprecision(3) << wgts->getMap().size(); + const auto& wgts = context.getData(tbWeightsToken_); + edm::LogInfo("EcalTBWeightMap.size(): ") << std::setprecision(3) << wgts.getMap().size(); // look up the correct weights for this xtal //EcalXtalGroupId gid( (*git) ); EcalTBWeights::EcalTDCId tdcid(1); edm::LogInfo("Lookup EcalWeightSet for groupid: ") << std::setprecision(3) << gid.id() << " and TDC id " << tdcid; - EcalTBWeights::EcalTBWeightMap::const_iterator wit = wgts->getMap().find(std::make_pair(gid, tdcid)); + EcalTBWeights::EcalTBWeightMap::const_iterator wit = wgts.getMap().find(std::make_pair(gid, tdcid)); EcalWeightSet wset; - if (wit != wgts->getMap().end()) { + if (wit != wgts.getMap().end()) { wset = wit->second; edm::LogInfo("check size of data members in EcalWeightSet"); //wit->second.print(std::cout); @@ -259,52 +203,39 @@ void EcalTrivialObjectAnalyzer::analyze(const edm::Event& e, const edm::EventSet } // cluster functions/corrections - edm::ESHandle pLocalCont; - context.get().get(pLocalCont); - const EcalClusterLocalContCorrParameters* paramLocalCont = pLocalCont.product(); + const auto& paramLocalCont = context.getData(clusterLocalContCorrToken_); edm::LogInfo("LocalContCorrParameters:"); - for (EcalFunctionParameters::const_iterator it = paramLocalCont->params().begin(); - it != paramLocalCont->params().end(); + for (EcalFunctionParameters::const_iterator it = paramLocalCont.params().begin(); it != paramLocalCont.params().end(); ++it) { // edm::LogInfo(" ") << *it; } // std::cout << "\n"; - edm::ESHandle pCrack; - context.get().get(pCrack); - const EcalClusterCrackCorrParameters* paramCrack = pCrack.product(); + const auto& paramCrack = context.getData(clusterCrackCorrToken_); edm::LogInfo("CrackCorrParameters:"); - for (EcalFunctionParameters::const_iterator it = paramCrack->params().begin(); it != paramCrack->params().end(); - ++it) { + for (EcalFunctionParameters::const_iterator it = paramCrack.params().begin(); it != paramCrack.params().end(); ++it) { // edm::LogInfo(" ") << *it; } // std::cout << "\n"; - edm::ESHandle pEnergyCorrection; - context.get().get(pEnergyCorrection); - const EcalClusterEnergyCorrectionParameters* paramEnergyCorrection = pEnergyCorrection.product(); + const auto& paramEnergyCorrection = context.getData(clusterEnergyCorrectionToken_); edm::LogInfo("EnergyCorrectionParameters:"); - for (EcalFunctionParameters::const_iterator it = paramEnergyCorrection->params().begin(); - it != paramEnergyCorrection->params().end(); + for (EcalFunctionParameters::const_iterator it = paramEnergyCorrection.params().begin(); + it != paramEnergyCorrection.params().end(); ++it) { // edm::LogInfo(" ") << *it; } // std::cout << "\n"; - edm::ESHandle pEnergyUncertainty; - context.get().get(pEnergyUncertainty); - const EcalClusterEnergyUncertaintyParameters* paramEnergyUncertainty = pEnergyUncertainty.product(); + const auto& paramEnergyUncertainty = context.getData(clusterEnergyUncertaintyToken_); edm::LogInfo("EnergyCorrectionParameters:"); - for (EcalFunctionParameters::const_iterator it = paramEnergyUncertainty->params().begin(); - it != paramEnergyUncertainty->params().end(); + for (EcalFunctionParameters::const_iterator it = paramEnergyUncertainty.params().begin(); + it != paramEnergyUncertainty.params().end(); ++it) { // edm::LogInfo(" ") << *it; } // std::cout << "\n"; - edm::ESHandle pEnergyCorrectionObjectSpecific; - context.get().get(pEnergyCorrectionObjectSpecific); - const EcalClusterEnergyCorrectionObjectSpecificParameters* paramEnergyCorrectionObjectSpecific = - pEnergyCorrectionObjectSpecific.product(); + const auto& paramEnergyCorrectionObjectSpecific = context.getData(clusterEnergyCorrectionObjectSpecificToken_); edm::LogInfo("EnergyCorrectionObjectSpecificParameters:"); - for (EcalFunctionParameters::const_iterator it = paramEnergyCorrectionObjectSpecific->params().begin(); - it != paramEnergyCorrectionObjectSpecific->params().end(); + for (EcalFunctionParameters::const_iterator it = paramEnergyCorrectionObjectSpecific.params().begin(); + it != paramEnergyCorrectionObjectSpecific.params().end(); ++it) { // edm::LogInfo(" ") << *it; } @@ -313,26 +244,22 @@ void EcalTrivialObjectAnalyzer::analyze(const edm::Event& e, const edm::EventSet // laser correction // laser alphas - edm::ESHandle pAlpha; - context.get().get(pAlpha); - const EcalLaserAlphas* lalpha = pAlpha.product(); + const auto& lalpha = context.getData(laserAlphasToken_); EcalLaserAlphaMap::const_iterator lalphait; - lalphait = lalpha->getMap().find(ebid.rawId()); - if (lalphait != lalpha->getMap().end()) { + lalphait = lalpha.getMap().find(ebid.rawId()); + if (lalphait != lalpha.getMap().end()) { edm::LogInfo("EcalLaserAlpha: ") << std::setprecision(6) << (*lalphait); } else { edm::LogInfo("No laser alpha found for this xtal! something wrong with EcalLaserAlphas in your DB? "); } // laser apdpnref - edm::ESHandle pAPDPNRatiosRef; - context.get().get(pAPDPNRatiosRef); - const EcalLaserAPDPNRatiosRef* lref = pAPDPNRatiosRef.product(); + const auto& lref = context.getData(laserAPDPNRatiosRefToken_); EcalLaserAPDPNRatiosRef::const_iterator lrefit; - lrefit = lref->getMap().find(ebid.rawId()); - if (lrefit != lref->getMap().end()) { + lrefit = lref.getMap().find(ebid.rawId()); + if (lrefit != lref.getMap().end()) { // edm::LogInfo("EcalLaserAPDPNRatiosRef: ") // < pAPDPNRatios; - context.get().get(pAPDPNRatios); - const EcalLaserAPDPNRatios* lratio = pAPDPNRatios.product(); + const auto& lratio = context.getData(laserAPDPNRatiosToken_); EcalLaserAPDPNRatios::EcalLaserAPDPNRatiosMap::const_iterator lratioit; - lratioit = lratio->getLaserMap().find(ebid.rawId()); + lratioit = lratio.getLaserMap().find(ebid.rawId()); EcalLaserAPDPNRatios::EcalLaserAPDPNpair lratioconst; - if (lratioit != lratio->getLaserMap().end()) { + if (lratioit != lratio.getLaserMap().end()) { lratioconst = (*lratioit); // edm::LogInfo("EcalLaserAPDPNRatios: ") @@ -366,20 +291,18 @@ void EcalTrivialObjectAnalyzer::analyze(const edm::Event& e, const edm::EventSet EcalLaserAPDPNRatios::EcalLaserTimeStamp ltimestamp; // EcalLaserAPDPNRatios::EcalLaserTimeStampMap::const_iterator ltimeit; for (int i = 1; i <= 92; i++) { - ltimestamp = lratio->getTimeMap()[i]; + ltimestamp = lratio.getTimeMap()[i]; // edm::LogInfo("i = ") << std::setprecision(6) << i // << ltimestamp.t1.value() << " " << ltimestamp.t2.value() << " : " ; } // edm::LogInfo("Tests finished."); // channel status - edm::ESHandle pChannelStatus; - context.get().get(pChannelStatus); - const EcalChannelStatus* ch_status = pChannelStatus.product(); + const auto& ch_status = context.getData(channelStatusToken_); EcalChannelStatusMap::const_iterator chit; - chit = ch_status->getMap().find(ebid.rawId()); - if (chit != ch_status->getMap().end()) { + chit = ch_status.getMap().find(ebid.rawId()); + if (chit != ch_status.getMap().end()) { EcalChannelStatusCode ch_code = (*chit); edm::LogInfo("EcalChannelStatus: ") << std::setprecision(6) << ch_code.getStatusCode(); } else { @@ -389,11 +312,9 @@ void EcalTrivialObjectAnalyzer::analyze(const edm::Event& e, const edm::EventSet // laser transparency correction // Mask to ignore sample - edm::ESHandle pSMask; - context.get().get(pSMask); - const EcalSampleMask* smask = pSMask.product(); - edm::LogInfo("Sample Mask EB ") << std::hex << smask->getEcalSampleMaskRecordEB() << " EE " << std::hex - << smask->getEcalSampleMaskRecordEE(); + const auto& smask = context.getData(sampleMaskToken_); + edm::LogInfo("Sample Mask EB ") << std::hex << smask.getEcalSampleMaskRecordEB() << " EE " << std::hex + << smask.getEcalSampleMaskRecordEE(); /* std::cout << "make CLHEP matrices from vector>" << std::endl; diff --git a/CalibCalorimetry/HcalTPGAlgos/interface/HcaluLUTTPGCoder.h b/CalibCalorimetry/HcalTPGAlgos/interface/HcaluLUTTPGCoder.h index 99133ebc7d479..34de77cdb33e6 100644 --- a/CalibCalorimetry/HcalTPGAlgos/interface/HcaluLUTTPGCoder.h +++ b/CalibCalorimetry/HcalTPGAlgos/interface/HcaluLUTTPGCoder.h @@ -69,6 +69,7 @@ class HcaluLUTTPGCoder : public HcalTPGCoder { void set1TSContainHE(bool contain1TSHE) { contain1TSHE_ = contain1TSHE; } void setContainPhaseHB(double containPhaseNSHB) { containPhaseNSHB_ = containPhaseNSHB; } void setContainPhaseHE(double containPhaseNSHE) { containPhaseNSHE_ = containPhaseNSHE; } + void setApplyFixPCC(double applyFixPCC) { applyFixPCC_ = applyFixPCC; } void setOverrideDBweightsAndFilterHB(bool overrideDBweightsAndFilterHB) { overrideDBweightsAndFilterHB_ = overrideDBweightsAndFilterHB; } @@ -122,6 +123,7 @@ class HcaluLUTTPGCoder : public HcalTPGCoder { bool contain1TSHB_, contain1TSHE_; double containPhaseNSHB_ = 6.0; double containPhaseNSHE_ = 6.0; + bool applyFixPCC_; double linearLSB_QIE8_, linearLSB_QIE11_, linearLSB_QIE11Overlap_; std::unique_ptr pulseCorr_; bool overrideDBweightsAndFilterHB_ = false; diff --git a/CalibCalorimetry/HcalTPGAlgos/src/HcaluLUTTPGCoder.cc b/CalibCalorimetry/HcalTPGAlgos/src/HcaluLUTTPGCoder.cc index 3009cc3b1d9a8..d8c14a3c067f4 100644 --- a/CalibCalorimetry/HcalTPGAlgos/src/HcaluLUTTPGCoder.cc +++ b/CalibCalorimetry/HcalTPGAlgos/src/HcaluLUTTPGCoder.cc @@ -63,6 +63,7 @@ HcaluLUTTPGCoder::HcaluLUTTPGCoder() allLinear_{}, contain1TSHB_{}, contain1TSHE_{}, + applyFixPCC_{}, linearLSB_QIE8_{}, linearLSB_QIE11_{}, linearLSB_QIE11Overlap_{} {} @@ -78,6 +79,7 @@ void HcaluLUTTPGCoder::init(const HcalTopology* top, const HcalTimeSlew* delay) allLinear_ = false; contain1TSHB_ = false; contain1TSHE_ = false; + applyFixPCC_ = false; linearLSB_QIE8_ = 1.; linearLSB_QIE11_ = 1.; linearLSB_QIE11Overlap_ = 1.; @@ -333,6 +335,7 @@ void HcaluLUTTPGCoder::update(const HcalDbService& conditions) { assert(metadata != nullptr); float nominalgain_ = metadata->getNominalGain(); + pulseCorr_ = std::make_unique(MaximumFractionalError, applyFixPCC_); pulseCorr_->beginRun(&conditions, delay_); make_cosh_ieta_map(); diff --git a/CalibCalorimetry/HcalTPGEventSetup/src/HcalTPGCoderULUT.cc b/CalibCalorimetry/HcalTPGEventSetup/src/HcalTPGCoderULUT.cc index 8a3b32aab8d4a..d81cff7163dcf 100644 --- a/CalibCalorimetry/HcalTPGEventSetup/src/HcalTPGCoderULUT.cc +++ b/CalibCalorimetry/HcalTPGEventSetup/src/HcalTPGCoderULUT.cc @@ -59,6 +59,7 @@ class HcalTPGCoderULUT : public edm::ESProducer { bool read_FGLut_, read_Ascii_, read_XML_, LUTGenerationMode_, linearLUTs_; bool contain1TSHB_, contain1TSHE_; double containPhaseNSHB_, containPhaseNSHE_; + bool applyFixPCC_; bool overrideDBweightsAndFilterHB_, overrideDBweightsAndFilterHE_; double linearLSB_QIE8_, linearLSB_QIE11Overlap_, linearLSB_QIE11_; int maskBit_; @@ -86,6 +87,7 @@ HcalTPGCoderULUT::HcalTPGCoderULUT(const edm::ParameterSet& iConfig) { contain1TSHE_ = iConfig.getParameter("contain1TSHE"); containPhaseNSHB_ = iConfig.getParameter("containPhaseNSHB"); containPhaseNSHE_ = iConfig.getParameter("containPhaseNSHE"); + applyFixPCC_ = iConfig.getParameter("applyFixPCC"); overrideDBweightsAndFilterHB_ = iConfig.getParameter("overrideDBweightsAndFilterHB"); overrideDBweightsAndFilterHE_ = iConfig.getParameter("overrideDBweightsAndFilterHE"); @@ -123,6 +125,8 @@ void HcalTPGCoderULUT::buildCoder(const HcalTopology* topo, const HcalTimeSlew* theCoder->setContainPhaseHB(containPhaseNSHB_); theCoder->setContainPhaseHE(containPhaseNSHE_); + theCoder->setApplyFixPCC(applyFixPCC_); + if (read_Ascii_ || read_XML_) { edm::LogInfo("HCAL") << "Using ASCII/XML LUTs" << ifilename_.fullPath() << " for HcalTPGCoderULUT initialization"; if (read_Ascii_) { diff --git a/CalibFormats/CaloObjects/src/CaloSamples.cc b/CalibFormats/CaloObjects/src/CaloSamples.cc index e8e9eb4f4d5c5..65155fb170966 100644 --- a/CalibFormats/CaloObjects/src/CaloSamples.cc +++ b/CalibFormats/CaloObjects/src/CaloSamples.cc @@ -49,18 +49,32 @@ CaloSamples &CaloSamples::operator+=(double value) { } CaloSamples &CaloSamples::operator+=(const CaloSamples &other) { + bool addHighFidelityPreMix = false; if (size_ != other.size_ || presamples_ != other.presamples_ || preciseSize_ != other.preciseSize_) { - edm::LogError("CaloHitResponse") << "Mismatched calo signals "; - } - int i; - for (i = 0; i < size_; ++i) { - data_[i] += other.data_[i]; + if (presamples_ == other.presamples_ && preciseSize_ == other.size_) { + addHighFidelityPreMix = true; + } else { + edm::LogError("CaloHitResponse") << "Mismatched calo signals "; + } } - if (preciseData_.empty() && !other.preciseData_.empty()) - resetPrecise(); - if (!other.preciseData_.empty()) { - for (i = 0; i < preciseSize_; ++i) { - preciseData_[i] += other.preciseData_[i]; + if (addHighFidelityPreMix) { + int sampleBin(0); + for (int i = 0; i < preciseSize_; ++i) { + sampleBin = floor(i * deltaTprecise_ / 25); + data_[sampleBin] += other.data_[i]; + preciseData_[i] += other.data_[i]; + } + } else { + int i; + for (i = 0; i < size_; ++i) { + data_[i] += other.data_[i]; + } + if (preciseData_.empty() && !other.preciseData_.empty()) + resetPrecise(); + if (!other.preciseData_.empty()) { + for (i = 0; i < preciseSize_; ++i) { + preciseData_[i] += other.preciseData_[i]; + } } } return *this; diff --git a/CalibMuon/CSCCalibration/plugins/CSCL1TPLookupTableEP.cc b/CalibMuon/CSCCalibration/plugins/CSCL1TPLookupTableEP.cc new file mode 100644 index 0000000000000..5b904cb010978 --- /dev/null +++ b/CalibMuon/CSCCalibration/plugins/CSCL1TPLookupTableEP.cc @@ -0,0 +1,289 @@ +// system include files +#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" +#include "FWCore/ParameterSet/interface/ParameterSetDescription.h" +#include "FWCore/ParameterSet/interface/FileInPath.h" +#include "FWCore/Framework/interface/SourceFactory.h" +#include "FWCore/Framework/interface/ModuleFactory.h" +#include "FWCore/Framework/interface/ESProducer.h" +#include "FWCore/Framework/interface/EventSetupRecordIntervalFinder.h" + +#include "CondFormats/DataRecord/interface/CSCL1TPLookupTableCCLUTRcd.h" +#include "CondFormats/DataRecord/interface/CSCL1TPLookupTableME11ILTRcd.h" +#include "CondFormats/DataRecord/interface/CSCL1TPLookupTableME21ILTRcd.h" +#include "CondFormats/CSCObjects/interface/CSCL1TPLookupTableCCLUT.h" +#include "CondFormats/CSCObjects/interface/CSCL1TPLookupTableME11ILT.h" +#include "CondFormats/CSCObjects/interface/CSCL1TPLookupTableME21ILT.h" + +// user include files +#include +#include +#include +#include + +class CSCL1TPLookupTableEP : public edm::ESProducer, public edm::EventSetupRecordIntervalFinder { +public: + CSCL1TPLookupTableEP(const edm::ParameterSet&); + ~CSCL1TPLookupTableEP() override {} + + std::unique_ptr produceCCLUT(const CSCL1TPLookupTableCCLUTRcd&); + std::unique_ptr produceME11ILT(const CSCL1TPLookupTableME11ILTRcd&); + std::unique_ptr produceME21ILT(const CSCL1TPLookupTableME21ILTRcd&); + +protected: + void setIntervalFor(const edm::eventsetup::EventSetupRecordKey&, + const edm::IOVSyncValue&, + edm::ValidityInterval&) override; + +private: + std::vector load(std::string fileName) const; + const edm::ParameterSet pset_; +}; + +CSCL1TPLookupTableEP::CSCL1TPLookupTableEP(const edm::ParameterSet& pset) : pset_(pset) { + setWhatProduced(this, &CSCL1TPLookupTableEP::produceCCLUT); + setWhatProduced(this, &CSCL1TPLookupTableEP::produceME11ILT); + setWhatProduced(this, &CSCL1TPLookupTableEP::produceME21ILT); + findingRecord(); + findingRecord(); + findingRecord(); +} + +void CSCL1TPLookupTableEP::setIntervalFor(const edm::eventsetup::EventSetupRecordKey& iKey, + const edm::IOVSyncValue& iosv, + edm::ValidityInterval& oValidity) { + edm::ValidityInterval infinity(iosv.beginOfTime(), iosv.endOfTime()); + oValidity = infinity; +} + +std::unique_ptr CSCL1TPLookupTableEP::produceCCLUT(const CSCL1TPLookupTableCCLUTRcd&) { + // make the LUT object + std::unique_ptr lut = std::make_unique(); + + // get the text files + std::vector positionLUTFiles_ = pset_.getParameter>("positionLUTFiles"); + std::vector slopeLUTFiles_ = pset_.getParameter>("slopeLUTFiles"); + + std::unordered_map> cclutPosition; + std::unordered_map> cclutSlope; + + // read the text files and extract the data + for (int i = 0; i < 5; ++i) { + cclutPosition[i] = load(positionLUTFiles_[i]); + cclutSlope[i] = load(slopeLUTFiles_[i]); + } + + // set the data in the LUT object + lut->set_cclutPosition(std::move(cclutPosition)); + lut->set_cclutSlope(std::move(cclutSlope)); + + return lut; +} + +std::unique_ptr CSCL1TPLookupTableEP::produceME11ILT(const CSCL1TPLookupTableME11ILTRcd&) { + // make the LUT object + std::unique_ptr lut = std::make_unique(); + + // get the text files + std::vector padToHsME1aFiles_ = pset_.getParameter>("padToHsME1aFiles"); + std::vector padToHsME1bFiles_ = pset_.getParameter>("padToHsME1bFiles"); + + std::vector padToEsME1aFiles_ = pset_.getParameter>("padToEsME1aFiles"); + std::vector padToEsME1bFiles_ = pset_.getParameter>("padToEsME1bFiles"); + + std::vector rollToMaxWgME11Files_ = pset_.getParameter>("rollToMaxWgME11Files"); + std::vector rollToMinWgME11Files_ = pset_.getParameter>("rollToMinWgME11Files"); + + std::vector gemCscSlopeCosiFiles_ = pset_.getParameter>("gemCscSlopeCosiFiles"); + std::vector gemCscSlopeCosiCorrectionFiles_ = + pset_.getParameter>("gemCscSlopeCosiCorrectionFiles"); + std::vector gemCscSlopeCorrectionFiles_ = + pset_.getParameter>("gemCscSlopeCorrectionFiles"); + + std::vector esDiffToSlopeME1aFiles_ = + pset_.getParameter>("esDiffToSlopeME1aFiles"); + std::vector esDiffToSlopeME1bFiles_ = + pset_.getParameter>("esDiffToSlopeME1bFiles"); + + // read the text files and extract the data + auto GEM_pad_CSC_hs_ME1a_even_ = load(padToHsME1aFiles_[0]); + auto GEM_pad_CSC_hs_ME1a_odd_ = load(padToHsME1aFiles_[1]); + auto GEM_pad_CSC_hs_ME1b_even_ = load(padToHsME1bFiles_[0]); + auto GEM_pad_CSC_hs_ME1b_odd_ = load(padToHsME1bFiles_[1]); + + auto GEM_pad_CSC_es_ME1a_even_ = load(padToEsME1aFiles_[0]); + auto GEM_pad_CSC_es_ME1a_odd_ = load(padToEsME1aFiles_[1]); + auto GEM_pad_CSC_es_ME1b_even_ = load(padToEsME1bFiles_[0]); + auto GEM_pad_CSC_es_ME1b_odd_ = load(padToEsME1bFiles_[1]); + + auto GEM_roll_L1_CSC_min_wg_ME11_even_ = load(rollToMinWgME11Files_[0]); + auto GEM_roll_L1_CSC_min_wg_ME11_odd_ = load(rollToMinWgME11Files_[1]); + auto GEM_roll_L2_CSC_min_wg_ME11_even_ = load(rollToMinWgME11Files_[2]); + auto GEM_roll_L2_CSC_min_wg_ME11_odd_ = load(rollToMinWgME11Files_[3]); + + auto GEM_roll_L1_CSC_max_wg_ME11_even_ = load(rollToMaxWgME11Files_[0]); + auto GEM_roll_L1_CSC_max_wg_ME11_odd_ = load(rollToMaxWgME11Files_[1]); + auto GEM_roll_L2_CSC_max_wg_ME11_even_ = load(rollToMaxWgME11Files_[2]); + auto GEM_roll_L2_CSC_max_wg_ME11_odd_ = load(rollToMaxWgME11Files_[3]); + + auto CSC_slope_cosi_2to1_L1_ME11_even_ = load(gemCscSlopeCosiFiles_[0]); + auto CSC_slope_cosi_2to1_L1_ME11_odd_ = load(gemCscSlopeCosiFiles_[1]); + auto CSC_slope_cosi_3to1_L1_ME11_even_ = load(gemCscSlopeCosiFiles_[2]); + auto CSC_slope_cosi_3to1_L1_ME11_odd_ = load(gemCscSlopeCosiFiles_[3]); + + auto CSC_slope_cosi_corr_L1_ME11_even_ = load(gemCscSlopeCosiCorrectionFiles_[0]); + auto CSC_slope_cosi_corr_L2_ME11_even_ = load(gemCscSlopeCosiCorrectionFiles_[1]); + auto CSC_slope_cosi_corr_L1_ME11_odd_ = load(gemCscSlopeCosiCorrectionFiles_[2]); + auto CSC_slope_cosi_corr_L2_ME11_odd_ = load(gemCscSlopeCosiCorrectionFiles_[3]); + + auto CSC_slope_corr_L1_ME11_even_ = load(gemCscSlopeCorrectionFiles_[0]); + auto CSC_slope_corr_L2_ME11_even_ = load(gemCscSlopeCorrectionFiles_[1]); + auto CSC_slope_corr_L1_ME11_odd_ = load(gemCscSlopeCorrectionFiles_[2]); + auto CSC_slope_corr_L2_ME11_odd_ = load(gemCscSlopeCorrectionFiles_[3]); + + auto es_diff_slope_L1_ME1a_even_ = load(esDiffToSlopeME1aFiles_[0]); + auto es_diff_slope_L1_ME1a_odd_ = load(esDiffToSlopeME1aFiles_[1]); + auto es_diff_slope_L2_ME1a_even_ = load(esDiffToSlopeME1aFiles_[2]); + auto es_diff_slope_L2_ME1a_odd_ = load(esDiffToSlopeME1aFiles_[3]); + + auto es_diff_slope_L1_ME1b_even_ = load(esDiffToSlopeME1bFiles_[0]); + auto es_diff_slope_L1_ME1b_odd_ = load(esDiffToSlopeME1bFiles_[1]); + auto es_diff_slope_L2_ME1b_even_ = load(esDiffToSlopeME1bFiles_[2]); + auto es_diff_slope_L2_ME1b_odd_ = load(esDiffToSlopeME1bFiles_[3]); + + // set the data in the LUT object + lut->set_GEM_pad_CSC_hs_ME1b_even(std::move(GEM_pad_CSC_hs_ME1b_even_)); + lut->set_GEM_pad_CSC_hs_ME1a_even(std::move(GEM_pad_CSC_hs_ME1a_even_)); + lut->set_GEM_pad_CSC_hs_ME1b_odd(std::move(GEM_pad_CSC_hs_ME1b_odd_)); + lut->set_GEM_pad_CSC_hs_ME1a_odd(std::move(GEM_pad_CSC_hs_ME1a_odd_)); + + lut->set_GEM_pad_CSC_es_ME1b_even(std::move(GEM_pad_CSC_es_ME1b_even_)); + lut->set_GEM_pad_CSC_es_ME1a_even(std::move(GEM_pad_CSC_es_ME1a_even_)); + lut->set_GEM_pad_CSC_es_ME1b_odd(std::move(GEM_pad_CSC_es_ME1b_odd_)); + lut->set_GEM_pad_CSC_es_ME1a_odd(std::move(GEM_pad_CSC_es_ME1a_odd_)); + + lut->set_GEM_roll_L1_CSC_min_wg_ME11_even(std::move(GEM_roll_L1_CSC_min_wg_ME11_even_)); + lut->set_GEM_roll_L1_CSC_max_wg_ME11_even(std::move(GEM_roll_L1_CSC_max_wg_ME11_even_)); + lut->set_GEM_roll_L1_CSC_min_wg_ME11_odd(std::move(GEM_roll_L1_CSC_min_wg_ME11_odd_)); + lut->set_GEM_roll_L1_CSC_max_wg_ME11_odd(std::move(GEM_roll_L1_CSC_max_wg_ME11_odd_)); + + lut->set_GEM_roll_L2_CSC_min_wg_ME11_even(std::move(GEM_roll_L2_CSC_min_wg_ME11_even_)); + lut->set_GEM_roll_L2_CSC_max_wg_ME11_even(std::move(GEM_roll_L2_CSC_max_wg_ME11_even_)); + lut->set_GEM_roll_L2_CSC_min_wg_ME11_odd(std::move(GEM_roll_L2_CSC_min_wg_ME11_odd_)); + lut->set_GEM_roll_L2_CSC_max_wg_ME11_odd(std::move(GEM_roll_L2_CSC_max_wg_ME11_odd_)); + + // GEM-CSC trigger: slope correction + lut->set_CSC_slope_cosi_2to1_L1_ME11_even(std::move(CSC_slope_cosi_2to1_L1_ME11_even_)); + lut->set_CSC_slope_cosi_2to1_L1_ME11_odd(std::move(CSC_slope_cosi_2to1_L1_ME11_odd_)); + lut->set_CSC_slope_cosi_3to1_L1_ME11_even(std::move(CSC_slope_cosi_3to1_L1_ME11_even_)); + lut->set_CSC_slope_cosi_3to1_L1_ME11_odd(std::move(CSC_slope_cosi_3to1_L1_ME11_odd_)); + + lut->set_CSC_slope_cosi_corr_L1_ME11_even(std::move(CSC_slope_cosi_corr_L1_ME11_even_)); + lut->set_CSC_slope_cosi_corr_L1_ME11_odd(std::move(CSC_slope_cosi_corr_L1_ME11_odd_)); + lut->set_CSC_slope_cosi_corr_L2_ME11_even(std::move(CSC_slope_cosi_corr_L2_ME11_even_)); + lut->set_CSC_slope_cosi_corr_L2_ME11_odd(std::move(CSC_slope_cosi_corr_L2_ME11_odd_)); + + lut->set_CSC_slope_corr_L1_ME11_even(std::move(CSC_slope_corr_L1_ME11_even_)); + lut->set_CSC_slope_corr_L1_ME11_odd(std::move(CSC_slope_corr_L1_ME11_odd_)); + lut->set_CSC_slope_corr_L2_ME11_even(std::move(CSC_slope_corr_L2_ME11_even_)); + lut->set_CSC_slope_corr_L2_ME11_odd(std::move(CSC_slope_corr_L2_ME11_odd_)); + + // GEM-CSC trigger: 1/8-strip difference to slope + lut->set_es_diff_slope_L1_ME1a_even(std::move(es_diff_slope_L1_ME1a_even_)); + lut->set_es_diff_slope_L2_ME1a_even(std::move(es_diff_slope_L2_ME1a_even_)); + lut->set_es_diff_slope_L1_ME1a_odd(std::move(es_diff_slope_L1_ME1a_odd_)); + lut->set_es_diff_slope_L2_ME1a_odd(std::move(es_diff_slope_L2_ME1a_odd_)); + + lut->set_es_diff_slope_L1_ME1b_even(std::move(es_diff_slope_L1_ME1b_even_)); + lut->set_es_diff_slope_L2_ME1b_even(std::move(es_diff_slope_L2_ME1b_even_)); + lut->set_es_diff_slope_L1_ME1b_odd(std::move(es_diff_slope_L1_ME1b_odd_)); + lut->set_es_diff_slope_L2_ME1b_odd(std::move(es_diff_slope_L2_ME1b_odd_)); + + return lut; +} + +std::unique_ptr CSCL1TPLookupTableEP::produceME21ILT(const CSCL1TPLookupTableME21ILTRcd&) { + // make the LUT object + std::unique_ptr lut = std::make_unique(); + + // get the text files + std::vector padToHsME21Files_ = pset_.getParameter>("padToHsME21Files"); + std::vector padToEsME21Files_ = pset_.getParameter>("padToEsME21Files"); + + std::vector rollToMaxWgME21Files_ = pset_.getParameter>("rollToMaxWgME21Files"); + std::vector rollToMinWgME21Files_ = pset_.getParameter>("rollToMinWgME21Files"); + + std::vector esDiffToSlopeME21Files_ = + pset_.getParameter>("esDiffToSlopeME21Files"); + + // read the text files and extract the data + auto GEM_pad_CSC_hs_ME21_even_ = load(padToHsME21Files_[0]); + auto GEM_pad_CSC_hs_ME21_odd_ = load(padToHsME21Files_[1]); + + auto GEM_pad_CSC_es_ME21_even_ = load(padToEsME21Files_[0]); + auto GEM_pad_CSC_es_ME21_odd_ = load(padToEsME21Files_[1]); + + auto GEM_roll_L1_CSC_min_wg_ME21_even_ = load(rollToMinWgME21Files_[0]); + auto GEM_roll_L1_CSC_min_wg_ME21_odd_ = load(rollToMinWgME21Files_[1]); + auto GEM_roll_L2_CSC_min_wg_ME21_even_ = load(rollToMinWgME21Files_[2]); + auto GEM_roll_L2_CSC_min_wg_ME21_odd_ = load(rollToMinWgME21Files_[3]); + + auto GEM_roll_L1_CSC_max_wg_ME21_even_ = load(rollToMaxWgME21Files_[0]); + auto GEM_roll_L1_CSC_max_wg_ME21_odd_ = load(rollToMaxWgME21Files_[1]); + auto GEM_roll_L2_CSC_max_wg_ME21_even_ = load(rollToMaxWgME21Files_[2]); + auto GEM_roll_L2_CSC_max_wg_ME21_odd_ = load(rollToMaxWgME21Files_[3]); + + auto es_diff_slope_L1_ME21_even_ = load(esDiffToSlopeME21Files_[0]); + auto es_diff_slope_L1_ME21_odd_ = load(esDiffToSlopeME21Files_[1]); + auto es_diff_slope_L2_ME21_even_ = load(esDiffToSlopeME21Files_[2]); + auto es_diff_slope_L2_ME21_odd_ = load(esDiffToSlopeME21Files_[3]); + + // set the data in the LUT object + lut->set_GEM_pad_CSC_hs_ME21_even(std::move(GEM_pad_CSC_hs_ME21_even_)); + lut->set_GEM_pad_CSC_hs_ME21_odd(std::move(GEM_pad_CSC_hs_ME21_odd_)); + + lut->set_GEM_pad_CSC_es_ME21_even(std::move(GEM_pad_CSC_es_ME21_even_)); + lut->set_GEM_pad_CSC_es_ME21_odd(std::move(GEM_pad_CSC_es_ME21_odd_)); + + lut->set_GEM_roll_L1_CSC_min_wg_ME21_even(std::move(GEM_roll_L1_CSC_min_wg_ME21_even_)); + lut->set_GEM_roll_L1_CSC_max_wg_ME21_even(std::move(GEM_roll_L1_CSC_max_wg_ME21_even_)); + lut->set_GEM_roll_L1_CSC_min_wg_ME21_odd(std::move(GEM_roll_L1_CSC_min_wg_ME21_odd_)); + lut->set_GEM_roll_L1_CSC_max_wg_ME21_odd(std::move(GEM_roll_L1_CSC_max_wg_ME21_odd_)); + + lut->set_GEM_roll_L2_CSC_min_wg_ME21_even(std::move(GEM_roll_L2_CSC_min_wg_ME21_even_)); + lut->set_GEM_roll_L2_CSC_max_wg_ME21_even(std::move(GEM_roll_L2_CSC_max_wg_ME21_even_)); + lut->set_GEM_roll_L2_CSC_min_wg_ME21_odd(std::move(GEM_roll_L2_CSC_min_wg_ME21_odd_)); + lut->set_GEM_roll_L2_CSC_max_wg_ME21_odd(std::move(GEM_roll_L2_CSC_max_wg_ME21_odd_)); + + lut->set_es_diff_slope_L1_ME21_even(std::move(es_diff_slope_L1_ME21_even_)); + lut->set_es_diff_slope_L2_ME21_even(std::move(es_diff_slope_L2_ME21_even_)); + lut->set_es_diff_slope_L1_ME21_odd(std::move(es_diff_slope_L1_ME21_odd_)); + lut->set_es_diff_slope_L2_ME21_odd(std::move(es_diff_slope_L2_ME21_odd_)); + + return lut; +} + +std::vector CSCL1TPLookupTableEP::load(std::string fileName) const { + std::vector returnV; + std::ifstream fstream; + fstream.open(edm::FileInPath(fileName.c_str()).fullPath()); + // empty file, return empty lut + if (!fstream.good()) { + fstream.close(); + return returnV; + } + + std::string line; + + while (std::getline(fstream, line)) { + //ignore comments + line.erase(std::find(line.begin(), line.end(), '#'), line.end()); + std::istringstream lineStream(line); + std::pair entry; + while (lineStream >> entry.first >> entry.second) { + returnV.push_back(entry.second); + } + } + return returnV; +} + +DEFINE_FWK_EVENTSETUP_SOURCE(CSCL1TPLookupTableEP); diff --git a/CalibMuon/CSCCalibration/python/CSCL1TPLookupTableEP_cff.py b/CalibMuon/CSCCalibration/python/CSCL1TPLookupTableEP_cff.py new file mode 100644 index 0000000000000..0b9b4625c4072 --- /dev/null +++ b/CalibMuon/CSCCalibration/python/CSCL1TPLookupTableEP_cff.py @@ -0,0 +1,122 @@ +import FWCore.ParameterSet.Config as cms + +CSCL1TPLookupTableEP = cms.ESSource( + "CSCL1TPLookupTableEP", + ## CCLUT + positionLUTFiles = cms.vstring( + "L1Trigger/CSCTriggerPrimitives/data/CCLUT/CSCComparatorCodePosOffsetLUT_pat0_v1.txt", + "L1Trigger/CSCTriggerPrimitives/data/CCLUT/CSCComparatorCodePosOffsetLUT_pat1_v1.txt", + "L1Trigger/CSCTriggerPrimitives/data/CCLUT/CSCComparatorCodePosOffsetLUT_pat2_v1.txt", + "L1Trigger/CSCTriggerPrimitives/data/CCLUT/CSCComparatorCodePosOffsetLUT_pat3_v1.txt", + "L1Trigger/CSCTriggerPrimitives/data/CCLUT/CSCComparatorCodePosOffsetLUT_pat4_v1.txt" + ), + slopeLUTFiles = cms.vstring( + "L1Trigger/CSCTriggerPrimitives/data/CCLUT/CSCComparatorCodeSlopeLUT_pat0_v1.txt", + "L1Trigger/CSCTriggerPrimitives/data/CCLUT/CSCComparatorCodeSlopeLUT_pat1_v1.txt", + "L1Trigger/CSCTriggerPrimitives/data/CCLUT/CSCComparatorCodeSlopeLUT_pat2_v1.txt", + "L1Trigger/CSCTriggerPrimitives/data/CCLUT/CSCComparatorCodeSlopeLUT_pat3_v1.txt", + "L1Trigger/CSCTriggerPrimitives/data/CCLUT/CSCComparatorCodeSlopeLUT_pat4_v1.txt" + ), + ## convert pad number to 1/2-strip in ME1a + padToHsME1aFiles = cms.vstring( + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/CoordinateConversion/GEMCSCLUT_pad_hs_ME1a_even.txt", + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/CoordinateConversion/GEMCSCLUT_pad_hs_ME1a_odd.txt", + ), + ## convert pad number to 1/2-strip in ME1b + padToHsME1bFiles = cms.vstring( + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/CoordinateConversion/GEMCSCLUT_pad_hs_ME1b_even.txt", + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/CoordinateConversion/GEMCSCLUT_pad_hs_ME1b_odd.txt", + ), + ## convert pad number to 1/2-strip in ME21 + padToHsME21Files = cms.vstring( + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/CoordinateConversion/GEMCSCLUT_pad_hs_ME21_even.txt", + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/CoordinateConversion/GEMCSCLUT_pad_hs_ME21_odd.txt", + ), + ## convert pad number to 1/8-strip in ME1a + padToEsME1aFiles = cms.vstring( + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/CoordinateConversion/GEMCSCLUT_pad_es_ME1a_even.txt", + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/CoordinateConversion/GEMCSCLUT_pad_es_ME1a_odd.txt", + ), + ## convert pad number to 1/8-strip in ME1b + padToEsME1bFiles = cms.vstring( + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/CoordinateConversion/GEMCSCLUT_pad_es_ME1b_even.txt", + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/CoordinateConversion/GEMCSCLUT_pad_es_ME1b_odd.txt", + ), + ## convert pad number to 1/8-strip in ME21 + padToEsME21Files = cms.vstring( + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/CoordinateConversion/GEMCSCLUT_pad_es_ME21_even.txt", + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/CoordinateConversion/GEMCSCLUT_pad_es_ME21_odd.txt", + ), + ## convert eta partition to minimum wiregroup in ME11 + rollToMinWgME11Files = cms.vstring( + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/CoordinateConversion/GEMCSCLUT_roll_l1_min_wg_ME11_even.txt", + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/CoordinateConversion/GEMCSCLUT_roll_l1_min_wg_ME11_odd.txt", + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/CoordinateConversion/GEMCSCLUT_roll_l2_min_wg_ME11_even.txt", + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/CoordinateConversion/GEMCSCLUT_roll_l2_min_wg_ME11_odd.txt", + ), + ## convert eta partition to maximum wiregroup in ME11 + rollToMaxWgME11Files = cms.vstring( + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/CoordinateConversion/GEMCSCLUT_roll_l1_max_wg_ME11_even.txt", + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/CoordinateConversion/GEMCSCLUT_roll_l1_max_wg_ME11_odd.txt", + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/CoordinateConversion/GEMCSCLUT_roll_l2_max_wg_ME11_even.txt", + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/CoordinateConversion/GEMCSCLUT_roll_l2_max_wg_ME11_odd.txt", + ), + ## convert eta partition to minimum wiregroup in ME21 + rollToMinWgME21Files = cms.vstring( + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/CoordinateConversion/GEMCSCLUT_roll_l1_min_wg_ME21_even.txt", + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/CoordinateConversion/GEMCSCLUT_roll_l1_min_wg_ME21_odd.txt", + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/CoordinateConversion/GEMCSCLUT_roll_l2_min_wg_ME21_even.txt", + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/CoordinateConversion/GEMCSCLUT_roll_l2_min_wg_ME21_odd.txt", + ), + ## convert eta partition to maximum wiregroup in ME21 + rollToMaxWgME21Files = cms.vstring( + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/CoordinateConversion/GEMCSCLUT_roll_l1_max_wg_ME21_even.txt", + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/CoordinateConversion/GEMCSCLUT_roll_l1_max_wg_ME21_odd.txt", + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/CoordinateConversion/GEMCSCLUT_roll_l2_max_wg_ME21_even.txt", + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/CoordinateConversion/GEMCSCLUT_roll_l2_max_wg_ME21_odd.txt", + ), + # lookup tables for the GEM-CSC slope correction + gemCscSlopeCorrectionFiles = cms.vstring( + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/SlopeCorrection/FacingChambers/GEMCSCSlopeCorr_ME11_even_GE11_layer1.txt", + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/SlopeCorrection/FacingChambers/GEMCSCSlopeCorr_ME11_even_GE11_layer2.txt", + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/SlopeCorrection/FacingChambers/GEMCSCSlopeCorr_ME11_odd_GE11_layer1.txt", + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/SlopeCorrection/FacingChambers/GEMCSCSlopeCorr_ME11_odd_GE11_layer2.txt", + ), + # lookup tables for the GEM-CSC slope correction + gemCscSlopeCosiFiles = cms.vstring( + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/SlopeCorrection/FacingChambers/CSCconsistency_2to1_SlopeShift_ME11_even_GE11_layer1.txt", + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/SlopeCorrection/FacingChambers/CSCconsistency_2to1_SlopeShift_ME11_odd_GE11_layer1.txt", + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/SlopeCorrection/FacingChambers/CSCconsistency_3to1_SlopeShift_ME11_even_GE11_layer1.txt", + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/SlopeCorrection/FacingChambers/CSCconsistency_3to1_SlopeShift_ME11_odd_GE11_layer1.txt", + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/SlopeCorrection/FacingChambers/CSCconsistency_2to1_SlopeShift_ME11_even_GE11_layer2.txt", + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/SlopeCorrection/FacingChambers/CSCconsistency_2to1_SlopeShift_ME11_odd_GE11_layer2.txt", + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/SlopeCorrection/FacingChambers/CSCconsistency_3to1_SlopeShift_ME11_even_GE11_layer2.txt", + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/SlopeCorrection/FacingChambers/CSCconsistency_3to1_SlopeShift_ME11_odd_GE11_layer2.txt", + ), + # lookup tables for the GEM-CSC slope correction + gemCscSlopeCosiCorrectionFiles = cms.vstring( + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/SlopeCorrection/FacingChambers/GEMCSCconsistentSlopeCorr_ME11_even_GE11_layer1.txt", + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/SlopeCorrection/FacingChambers/GEMCSCconsistentSlopeCorr_ME11_even_GE11_layer2.txt", + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/SlopeCorrection/FacingChambers/GEMCSCconsistentSlopeCorr_ME11_odd_GE11_layer1.txt", + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/SlopeCorrection/FacingChambers/GEMCSCconsistentSlopeCorr_ME11_odd_GE11_layer2.txt", + ), + # convert differences in 1/8-strip numbers between GEM and CSC to Run-3 slopes + esDiffToSlopeME1aFiles = cms.vstring( + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/BendingAngle/GEMCSCLUT_es_diff_slope_L1_ME1a_even.txt", + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/BendingAngle/GEMCSCLUT_es_diff_slope_L1_ME1a_odd.txt", + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/BendingAngle/GEMCSCLUT_es_diff_slope_L2_ME1a_even.txt", + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/BendingAngle/GEMCSCLUT_es_diff_slope_L2_ME1a_odd.txt", + ), + esDiffToSlopeME1bFiles = cms.vstring( + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/BendingAngle/GEMCSCLUT_es_diff_slope_L1_ME1b_even.txt", + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/BendingAngle/GEMCSCLUT_es_diff_slope_L1_ME1b_odd.txt", + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/BendingAngle/GEMCSCLUT_es_diff_slope_L2_ME1b_even.txt", + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/BendingAngle/GEMCSCLUT_es_diff_slope_L2_ME1b_odd.txt", + ), + esDiffToSlopeME21Files = cms.vstring( + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/BendingAngle/GEMCSCLUT_es_diff_slope_L1_ME21_even.txt", + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/BendingAngle/GEMCSCLUT_es_diff_slope_L1_ME21_odd.txt", + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/BendingAngle/GEMCSCLUT_es_diff_slope_L2_ME21_even.txt", + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/BendingAngle/GEMCSCLUT_es_diff_slope_L2_ME21_odd.txt", + ), + ) diff --git a/CalibMuon/CSCCalibration/test/testNewCalibConstants_global_cfg.py b/CalibMuon/CSCCalibration/test/testNewCalibConstants_global_cfg.py index 131b5c034f37f..0ebe197348b06 100644 --- a/CalibMuon/CSCCalibration/test/testNewCalibConstants_global_cfg.py +++ b/CalibMuon/CSCCalibration/test/testNewCalibConstants_global_cfg.py @@ -3,7 +3,7 @@ process = cms.Process("TEST") # Standard stuff needed for the unpacking and local reco -process.load("Configuration/StandardSequences/Geometry_cff") +process.load("Configuration.StandardSequences.GeometryDB_cff") process.load("Configuration/StandardSequences/MagneticField_cff") process.load("Configuration/StandardSequences/FrontierConditions_GlobalTag_cff") process.load("Configuration/StandardSequences/RawToDigi_Data_cff") diff --git a/CalibMuon/CSCCalibration/test/testNewCalibConstants_sim_cfg.py b/CalibMuon/CSCCalibration/test/testNewCalibConstants_sim_cfg.py index 5890e7fa8b821..bc1f7d57e186d 100644 --- a/CalibMuon/CSCCalibration/test/testNewCalibConstants_sim_cfg.py +++ b/CalibMuon/CSCCalibration/test/testNewCalibConstants_sim_cfg.py @@ -2,7 +2,7 @@ process = cms.Process("TEST") -process.load("Configuration/StandardSequences/Geometry_cff") +process.load("Configuration.StandardSequences.GeometryDB_cff") process.load("Configuration/StandardSequences/MagneticField_cff") process.load("Configuration/StandardSequences/FrontierConditions_GlobalTag_cff") # for Beam diff --git a/CalibMuon/DTCalibration/plugins/DTFakeT0ESProducer.cc b/CalibMuon/DTCalibration/plugins/DTFakeT0ESProducer.cc index d74f7da4ec950..59cddf564e779 100644 --- a/CalibMuon/DTCalibration/plugins/DTFakeT0ESProducer.cc +++ b/CalibMuon/DTCalibration/plugins/DTFakeT0ESProducer.cc @@ -27,13 +27,15 @@ using namespace std; DTFakeT0ESProducer::DTFakeT0ESProducer(const edm::ParameterSet& pset) { //framework - setWhatProduced(this, &DTFakeT0ESProducer::produce); + auto cc = setWhatProduced(this, &DTFakeT0ESProducer::produce); // setWhatProduced(this,dependsOn(& DTGeometryESModule::parseDDD())); findingRecord(); //read constant value for t0 from cfg t0Mean = pset.getParameter("t0Mean"); t0Sigma = pset.getParameter("t0Sigma"); + cpvTokenDDD_ = cc.consumesFrom(edm::ESInputTag()); + mdcToken_ = cc.consumes(); } DTFakeT0ESProducer::~DTFakeT0ESProducer() {} @@ -59,13 +61,10 @@ std::unique_ptr DTFakeT0ESProducer::produce(const DTT0Rcd& iRecord) { } void DTFakeT0ESProducer::parseDDD(const DTT0Rcd& iRecord) { - edm::ESTransientHandle cpv; - edm::ESHandle mdc; + edm::ESTransientHandle cpv = iRecord.getTransientHandle(cpvTokenDDD_); + const auto& mdc = iRecord.get(mdcToken_); - iRecord.getRecord().get(cpv); - iRecord.getRecord().get(mdc); - - DTGeometryParserFromDDD parser(&(*cpv), *mdc, theLayerIdWiresMap); + DTGeometryParserFromDDD parser(&(*cpv), mdc, theLayerIdWiresMap); } void DTFakeT0ESProducer::setIntervalFor(const edm::eventsetup::EventSetupRecordKey&, diff --git a/CalibMuon/DTCalibration/plugins/DTFakeT0ESProducer.h b/CalibMuon/DTCalibration/plugins/DTFakeT0ESProducer.h index 7b69578bc49e6..3ca80375ce1e7 100644 --- a/CalibMuon/DTCalibration/plugins/DTFakeT0ESProducer.h +++ b/CalibMuon/DTCalibration/plugins/DTFakeT0ESProducer.h @@ -21,6 +21,12 @@ #include "FWCore/Framework/interface/MakerMacros.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" + +#include "DetectorDescription/Core/interface/DDCompactView.h" +#include "DetectorDescription/DDCMS/interface/DDCompactView.h" +#include "Geometry/Records/interface/IdealGeometryRecord.h" +#include "Geometry/MuonNumbering/interface/MuonGeometryConstants.h" + //#include #include @@ -48,5 +54,8 @@ class DTFakeT0ESProducer : public edm::ESProducer, public edm::EventSetupRecordI //t0 mean and sigma values read from cfg double t0Mean; double t0Sigma; + + edm::ESGetToken cpvTokenDDD_; + edm::ESGetToken mdcToken_; }; #endif diff --git a/CalibMuon/DTCalibration/plugins/DTNoiseCalibration.cc b/CalibMuon/DTCalibration/plugins/DTNoiseCalibration.cc index 5aca6ce1837fb..7291adf7f2543 100644 --- a/CalibMuon/DTCalibration/plugins/DTNoiseCalibration.cc +++ b/CalibMuon/DTCalibration/plugins/DTNoiseCalibration.cc @@ -51,7 +51,9 @@ DTNoiseCalibration::DTNoiseCalibration(const edm::ParameterSet& pset) dbLabel_(pset.getUntrackedParameter("dbLabel", "")), //fastAnalysis_( pset.getParameter("fastAnalysis", true) ), wireIdWithHisto_(std::vector()), - lumiMax_(3000) { + lumiMax_(3000), + dtGeomToken_(esConsumes()), + ttrigToken_(esConsumes(edm::ESInputTag("", pset.getParameter("dbLabel")))) { // Get the debug parameter for verbose output //debug = ps.getUntrackedParameter("debug"); /*// The analysis type @@ -96,12 +98,10 @@ void DTNoiseCalibration::beginJob() { void DTNoiseCalibration::beginRun(const edm::Run& run, const edm::EventSetup& setup) { // Get the DT Geometry - setup.get().get(dtGeom_); - + dtGeom_ = setup.getHandle(dtGeomToken_); // tTrig if (readDB_) - setup.get().get(dbLabel_, tTrigMap_); - + tTrigMap_ = &setup.getData(ttrigToken_); runBeginTime_ = time_t(run.beginTime().value() >> 32); runEndTime_ = time_t(run.endTime().value() >> 32); /* diff --git a/CalibMuon/DTCalibration/plugins/DTNoiseCalibration.h b/CalibMuon/DTCalibration/plugins/DTNoiseCalibration.h index ef846f0c6c23c..5c5f236f15d49 100644 --- a/CalibMuon/DTCalibration/plugins/DTNoiseCalibration.h +++ b/CalibMuon/DTCalibration/plugins/DTNoiseCalibration.h @@ -12,6 +12,8 @@ #include "FWCore/Framework/interface/EDAnalyzer.h" #include "FWCore/Framework/interface/ESHandle.h" #include "FWCore/Utilities/interface/InputTag.h" +#include "Geometry/Records/interface/MuonGeometryRecord.h" +#include "CondFormats/DataRecord/interface/DTTtrigRcd.h" #include #include @@ -74,8 +76,11 @@ class DTNoiseCalibration : public edm::EDAnalyzer { // Get the DT Geometry edm::ESHandle dtGeom_; + const edm::ESGetToken dtGeomToken_; + // tTrig map edm::ESHandle tTrigMap_; + const edm::ESGetToken ttrigToken_; TFile* rootFile_; // TDC digi distribution diff --git a/CalibMuon/DTCalibration/plugins/DTNoiseComputation.cc b/CalibMuon/DTCalibration/plugins/DTNoiseComputation.cc index b41cf3e8d59bc..e9be264db4b63 100644 --- a/CalibMuon/DTCalibration/plugins/DTNoiseComputation.cc +++ b/CalibMuon/DTCalibration/plugins/DTNoiseComputation.cc @@ -38,7 +38,7 @@ using namespace edm; using namespace std; -DTNoiseComputation::DTNoiseComputation(const edm::ParameterSet &ps) { +DTNoiseComputation::DTNoiseComputation(const edm::ParameterSet &ps) : dtGeomToken_(esConsumes()) { cout << "[DTNoiseComputation]: Constructor" << endl; // Get the debug parameter for verbose output @@ -61,7 +61,7 @@ DTNoiseComputation::DTNoiseComputation(const edm::ParameterSet &ps) { void DTNoiseComputation::beginRun(const edm::Run &, const EventSetup &setup) { // Get the DT Geometry - setup.get().get(dtGeom); + dtGeom = setup.getHandle(dtGeomToken_); static int count = 0; diff --git a/CalibMuon/DTCalibration/plugins/DTNoiseComputation.h b/CalibMuon/DTCalibration/plugins/DTNoiseComputation.h index 1e74be9b61297..de24a0853f9aa 100644 --- a/CalibMuon/DTCalibration/plugins/DTNoiseComputation.h +++ b/CalibMuon/DTCalibration/plugins/DTNoiseComputation.h @@ -14,6 +14,7 @@ #include "DataFormats/MuonDetId/interface/DTWireId.h" #include "DataFormats/MuonDetId/interface/DTChamberId.h" #include "FWCore/Framework/interface/ESHandle.h" +#include "Geometry/Records/interface/MuonGeometryRecord.h" #include #include @@ -57,6 +58,7 @@ class DTNoiseComputation : public edm::EDAnalyzer { // Get the DT Geometry edm::ESHandle dtGeom; + const edm::ESGetToken dtGeomToken_; // The file which contain the occupancy plot and the digi event plot TFile* theFile; diff --git a/CalibMuon/DTCalibration/plugins/DTResidualCalibration.cc b/CalibMuon/DTCalibration/plugins/DTResidualCalibration.cc index af764e74b77ae..1635d11f4c2d0 100644 --- a/CalibMuon/DTCalibration/plugins/DTResidualCalibration.cc +++ b/CalibMuon/DTCalibration/plugins/DTResidualCalibration.cc @@ -35,7 +35,8 @@ DTResidualCalibration::DTResidualCalibration(const edm::ParameterSet& pset) : histRange_(pset.getParameter("histogramRange")), segment4DLabel_(pset.getParameter("segment4DLabel")), rootBaseDir_(pset.getUntrackedParameter("rootBaseDir", "DT/Residuals")), - detailedAnalysis_(pset.getUntrackedParameter("detailedAnalysis", false)) { + detailedAnalysis_(pset.getUntrackedParameter("detailedAnalysis", false)), + dtGeomToken_(esConsumes()) { edm::ConsumesCollector collector(consumesCollector()); select_ = new DTSegmentSelector(pset, collector); @@ -63,7 +64,7 @@ void DTResidualCalibration::beginJob() { TH1::SetDefaultSumw2(true); } void DTResidualCalibration::beginRun(const edm::Run& run, const edm::EventSetup& setup) { // get the geometry edm::ESHandle dtGeomH; - setup.get().get(dtGeomH); + dtGeomH = setup.getHandle(dtGeomToken_); dtGeom_ = dtGeomH.product(); // Loop over all the chambers diff --git a/CalibMuon/DTCalibration/plugins/DTResidualCalibration.h b/CalibMuon/DTCalibration/plugins/DTResidualCalibration.h index 1b6c5f328d0cd..cce4721877c0a 100644 --- a/CalibMuon/DTCalibration/plugins/DTResidualCalibration.h +++ b/CalibMuon/DTCalibration/plugins/DTResidualCalibration.h @@ -13,6 +13,7 @@ #include "FWCore/Framework/interface/ESHandle.h" #include "CalibMuon/DTCalibration/interface/DTSegmentSelector.h" +#include "Geometry/Records/interface/MuonGeometryRecord.h" #include #include @@ -59,6 +60,8 @@ class DTResidualCalibration : public edm::EDAnalyzer { TFile* rootFile_; // Geometry const DTGeometry* dtGeom_; + const edm::ESGetToken dtGeomToken_; + // Histograms per super-layer std::map histoMapTH1F_; std::map histoMapTH2F_; diff --git a/CalibMuon/DTCalibration/plugins/DTT0Calibration.cc b/CalibMuon/DTCalibration/plugins/DTT0Calibration.cc index 4ac67cd7cbbce..ee9d5055e90b9 100644 --- a/CalibMuon/DTCalibration/plugins/DTT0Calibration.cc +++ b/CalibMuon/DTCalibration/plugins/DTT0Calibration.cc @@ -42,9 +42,8 @@ DTT0Calibration::DTT0Calibration(const edm::ParameterSet& pset) tpPeakWidthPerLayer(pset.getParameter("tpPeakWidthPerLayer")), rejectDigiFromPeak(pset.getParameter("rejectDigiFromPeak")), hLayerPeaks("hLayerPeaks", "", 3000, 0, 3000), - spectrum(20) - -{ + spectrum(20), + dtGeomToken_(esConsumes()) { // Get the debug parameter for verbose output if (debug) cout << "[DTT0Calibration]Constructor called!" << endl; @@ -99,7 +98,7 @@ void DTT0Calibration::analyze(const edm::Event& event, const edm::EventSetup& ev // Get the DT Geometry if (nevents == 1) - eventSetup.get().get(dtGeom); + dtGeom = eventSetup.getHandle(dtGeomToken_); // Iterate through all digi collections ordered by LayerId for (const auto& digis_per_layer : *digis) { diff --git a/CalibMuon/DTCalibration/plugins/DTT0Calibration.h b/CalibMuon/DTCalibration/plugins/DTT0Calibration.h index a0d0ac56f994d..459cafe9908b0 100644 --- a/CalibMuon/DTCalibration/plugins/DTT0Calibration.h +++ b/CalibMuon/DTCalibration/plugins/DTT0Calibration.h @@ -17,6 +17,7 @@ #include "DataFormats/MuonDetId/interface/DTWireId.h" #include "DataFormats/DTDigi/interface/DTDigiCollection.h" #include "FWCore/Framework/interface/ESHandle.h" +#include "Geometry/Records/interface/MuonGeometryRecord.h" #include #include @@ -122,5 +123,6 @@ class DTT0Calibration : public edm::one::EDAnalyzer<> { //DTGeometry used to loop on the SL in the endJob edm::ESHandle dtGeom; + const edm::ESGetToken dtGeomToken_; }; #endif diff --git a/CalibMuon/DTCalibration/plugins/DTT0CalibrationRMS.cc b/CalibMuon/DTCalibration/plugins/DTT0CalibrationRMS.cc index 9e82947100e13..395e74d8197f1 100644 --- a/CalibMuon/DTCalibration/plugins/DTT0CalibrationRMS.cc +++ b/CalibMuon/DTCalibration/plugins/DTT0CalibrationRMS.cc @@ -24,7 +24,7 @@ using namespace edm; // using namespace cond; // Constructor -DTT0CalibrationRMS::DTT0CalibrationRMS(const edm::ParameterSet& pset) { +DTT0CalibrationRMS::DTT0CalibrationRMS(const edm::ParameterSet& pset) : dtGeomToken_(esConsumes()) { // Get the debug parameter for verbose output debug = pset.getUntrackedParameter("debug"); if (debug) @@ -102,7 +102,7 @@ void DTT0CalibrationRMS::analyze(const edm::Event& event, const edm::EventSetup& event.getByLabel(digiLabel, digis); // Get the DT Geometry - eventSetup.get().get(dtGeom); + dtGeom = eventSetup.getHandle(dtGeomToken_); // Iterate through all digi collections ordered by LayerId DTDigiCollection::DigiRangeIterator dtLayerIt; diff --git a/CalibMuon/DTCalibration/plugins/DTT0CalibrationRMS.h b/CalibMuon/DTCalibration/plugins/DTT0CalibrationRMS.h index f0145820c40c9..ee97801d2774d 100644 --- a/CalibMuon/DTCalibration/plugins/DTT0CalibrationRMS.h +++ b/CalibMuon/DTCalibration/plugins/DTT0CalibrationRMS.h @@ -13,6 +13,7 @@ #include "Geometry/DTGeometry/interface/DTGeometry.h" #include "DataFormats/MuonDetId/interface/DTWireId.h" #include "FWCore/Framework/interface/ESHandle.h" +#include "Geometry/Records/interface/MuonGeometryRecord.h" #include #include @@ -105,5 +106,6 @@ class DTT0CalibrationRMS : public edm::EDAnalyzer { //DTGeometry used to loop on the SL in the endJob edm::ESHandle dtGeom; + const edm::ESGetToken dtGeomToken_; }; #endif diff --git a/CalibMuon/DTCalibration/plugins/DTT0ChamberReferenceCorrection.cc b/CalibMuon/DTCalibration/plugins/DTT0ChamberReferenceCorrection.cc index f5455d038d8e4..bc9eae7e83648 100644 --- a/CalibMuon/DTCalibration/plugins/DTT0ChamberReferenceCorrection.cc +++ b/CalibMuon/DTCalibration/plugins/DTT0ChamberReferenceCorrection.cc @@ -8,6 +8,7 @@ #include "FWCore/Framework/interface/EventSetup.h" #include "FWCore/Framework/interface/ESHandle.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" +#include "FWCore/Framework/interface/ConsumesCollector.h" #include "DataFormats/MuonDetId/interface/DTWireId.h" #include "CondFormats/DTObjects/interface/DTT0.h" @@ -21,8 +22,8 @@ using namespace edm; namespace dtCalibration { - DTT0ChamberReferenceCorrection::DTT0ChamberReferenceCorrection(const ParameterSet& pset) - : calibChamber_(pset.getParameter("calibChamber")) { + DTT0ChamberReferenceCorrection::DTT0ChamberReferenceCorrection(const ParameterSet& pset, edm::ConsumesCollector cc) + : calibChamber_(pset.getParameter("calibChamber")), t0Token_(cc.esConsumes()) { //DTChamberId chosenChamberId; if (!calibChamber_.empty() && calibChamber_ != "None" && calibChamber_ != "All") { stringstream linestr; @@ -40,8 +41,8 @@ namespace dtCalibration { void DTT0ChamberReferenceCorrection::setES(const EventSetup& setup) { // Get t0 record from DB ESHandle t0H; - setup.get().get(t0H); - t0Map_ = &*t0H; + t0H = setup.getHandle(t0Token_); + t0Map_ = &setup.getData(t0Token_); LogVerbatim("Calibration") << "[DTT0ChamberReferenceCorrection] T0 version: " << t0H->version(); } diff --git a/CalibMuon/DTCalibration/plugins/DTT0ChamberReferenceCorrection.h b/CalibMuon/DTCalibration/plugins/DTT0ChamberReferenceCorrection.h index 3fa4e5bb715c5..723a3b4d9ad20 100644 --- a/CalibMuon/DTCalibration/plugins/DTT0ChamberReferenceCorrection.h +++ b/CalibMuon/DTCalibration/plugins/DTT0ChamberReferenceCorrection.h @@ -11,6 +11,10 @@ #include "CalibMuon/DTCalibration/interface/DTT0BaseCorrection.h" #include "DataFormats/MuonDetId/interface/DTChamberId.h" +#include "FWCore/Framework/interface/ConsumesCollector.h" +#include "FWCore/Utilities/interface/ESGetToken.h" +#include "CondFormats/DataRecord/interface/DTT0Rcd.h" +#include "CondFormats/DTObjects/interface/DTT0.h" #include @@ -25,7 +29,7 @@ namespace dtCalibration { class DTT0ChamberReferenceCorrection : public DTT0BaseCorrection { public: // Constructor - DTT0ChamberReferenceCorrection(const edm::ParameterSet&); + DTT0ChamberReferenceCorrection(const edm::ParameterSet&, edm::ConsumesCollector); // Destructor ~DTT0ChamberReferenceCorrection() override; @@ -40,6 +44,7 @@ namespace dtCalibration { DTChamberId chosenChamberId_; const DTT0* t0Map_; + edm::ESGetToken t0Token_; }; } // namespace dtCalibration diff --git a/CalibMuon/DTCalibration/plugins/DTT0Correction.cc b/CalibMuon/DTCalibration/plugins/DTT0Correction.cc index dcbda683426ef..7a55a301679ba 100644 --- a/CalibMuon/DTCalibration/plugins/DTT0Correction.cc +++ b/CalibMuon/DTCalibration/plugins/DTT0Correction.cc @@ -29,7 +29,9 @@ using namespace std; DTT0Correction::DTT0Correction(const ParameterSet& pset) : correctionAlgo_{DTT0CorrectionFactory::get()->create(pset.getParameter("correctionAlgo"), - pset.getParameter("correctionAlgoConfig"))} { + pset.getParameter("correctionAlgoConfig"))}, + dtGeomToken_(esConsumes()), + t0Token_(esConsumes()) { LogVerbatim("Calibration") << "[DTT0Correction] Constructor called" << endl; } @@ -38,12 +40,12 @@ DTT0Correction::~DTT0Correction() { LogVerbatim("Calibration") << "[DTT0Correcti void DTT0Correction::beginRun(const edm::Run& run, const edm::EventSetup& setup) { // Get t0 record from DB ESHandle t0H; - setup.get().get(t0H); - t0Map_ = &*t0H; + t0H = setup.getHandle(t0Token_); + t0Map_ = &setup.getData(t0Token_); LogVerbatim("Calibration") << "[DTT0Correction]: T0 version: " << t0H->version() << endl; // Get geometry from Event Setup - setup.get().get(muonGeom_); + muonGeom_ = setup.getHandle(dtGeomToken_); // Pass EventSetup to correction Algo correctionAlgo_->setES(setup); diff --git a/CalibMuon/DTCalibration/plugins/DTT0Correction.h b/CalibMuon/DTCalibration/plugins/DTT0Correction.h index 703243093bffd..dda53305e403d 100644 --- a/CalibMuon/DTCalibration/plugins/DTT0Correction.h +++ b/CalibMuon/DTCalibration/plugins/DTT0Correction.h @@ -8,6 +8,9 @@ #include "FWCore/Framework/interface/Frameworkfwd.h" #include "FWCore/Framework/interface/EDAnalyzer.h" #include "FWCore/Framework/interface/ESHandle.h" +#include "Geometry/Records/interface/MuonGeometryRecord.h" +#include "CondFormats/DTObjects/interface/DTT0.h" +#include "CondFormats/DataRecord/interface/DTT0Rcd.h" #include @@ -34,9 +37,12 @@ class DTT0Correction : public edm::EDAnalyzer { protected: private: - const DTT0* t0Map_; + std::unique_ptr correctionAlgo_; + edm::ESHandle muonGeom_; + const edm::ESGetToken dtGeomToken_; - std::unique_ptr correctionAlgo_; + const DTT0* t0Map_; + edm::ESGetToken t0Token_; }; #endif diff --git a/CalibMuon/DTCalibration/plugins/DTT0FEBPathCorrection.cc b/CalibMuon/DTCalibration/plugins/DTT0FEBPathCorrection.cc index 7eea1c9701777..89b6f9407f513 100644 --- a/CalibMuon/DTCalibration/plugins/DTT0FEBPathCorrection.cc +++ b/CalibMuon/DTCalibration/plugins/DTT0FEBPathCorrection.cc @@ -15,6 +15,7 @@ #include "DataFormats/MuonDetId/interface/DTWireId.h" #include "CondFormats/DTObjects/interface/DTT0.h" #include "CondFormats/DataRecord/interface/DTT0Rcd.h" +#include "FWCore/Framework/interface/ConsumesCollector.h" #include #include @@ -24,8 +25,8 @@ using namespace edm; namespace dtCalibration { - DTT0FEBPathCorrection::DTT0FEBPathCorrection(const ParameterSet& pset) - : calibChamber_(pset.getParameter("calibChamber")) { + DTT0FEBPathCorrection::DTT0FEBPathCorrection(const ParameterSet& pset, edm::ConsumesCollector cc) + : calibChamber_(pset.getParameter("calibChamber")), t0Token_(cc.esConsumes()) { //DTChamberId chosenChamberId; if (!calibChamber_.empty() && calibChamber_ != "None" && calibChamber_ != "All") { stringstream linestr; @@ -43,8 +44,8 @@ namespace dtCalibration { void DTT0FEBPathCorrection::setES(const EventSetup& setup) { // Get t0 record from DB ESHandle t0H; - setup.get().get(t0H); - t0Map_ = &*t0H; + t0H = setup.getHandle(t0Token_); + t0Map_ = &setup.getData(t0Token_); LogVerbatim("Calibration") << "[DTT0FEBPathCorrection] T0 version: " << t0H->version(); } diff --git a/CalibMuon/DTCalibration/plugins/DTT0FEBPathCorrection.h b/CalibMuon/DTCalibration/plugins/DTT0FEBPathCorrection.h index 39c1234766657..8a3204a61b1ae 100644 --- a/CalibMuon/DTCalibration/plugins/DTT0FEBPathCorrection.h +++ b/CalibMuon/DTCalibration/plugins/DTT0FEBPathCorrection.h @@ -11,6 +11,10 @@ #include "CalibMuon/DTCalibration/interface/DTT0BaseCorrection.h" #include "DataFormats/MuonDetId/interface/DTChamberId.h" +#include "FWCore/Utilities/interface/ESGetToken.h" +#include "CondFormats/DataRecord/interface/DTT0Rcd.h" +#include "CondFormats/DTObjects/interface/DTT0.h" +#include "FWCore/Framework/interface/ConsumesCollector.h" #include @@ -25,7 +29,7 @@ namespace dtCalibration { class DTT0FEBPathCorrection : public DTT0BaseCorrection { public: // Constructor - DTT0FEBPathCorrection(const edm::ParameterSet&); + DTT0FEBPathCorrection(const edm::ParameterSet&, edm::ConsumesCollector); // Destructor ~DTT0FEBPathCorrection() override; @@ -42,6 +46,7 @@ namespace dtCalibration { DTChamberId chosenChamberId_; const DTT0* t0Map_; + edm::ESGetToken t0Token_; }; } // namespace dtCalibration diff --git a/CalibMuon/DTCalibration/plugins/DTTPAnalyzer.cc b/CalibMuon/DTCalibration/plugins/DTTPAnalyzer.cc index 971ca3500a4e2..3356d9f06cd8a 100644 --- a/CalibMuon/DTCalibration/plugins/DTTPAnalyzer.cc +++ b/CalibMuon/DTCalibration/plugins/DTTPAnalyzer.cc @@ -3,9 +3,11 @@ * \author A. Vilela Pereira */ -#include "FWCore/Framework/interface/EDAnalyzer.h" +#include "FWCore/Framework/interface/one/EDAnalyzer.h" +#include "FWCore/Framework/interface/ConsumesCollector.h" #include "FWCore/Utilities/interface/InputTag.h" #include "FWCore/Framework/interface/ESHandle.h" +#include "Geometry/Records/interface/MuonGeometryRecord.h" #include #include @@ -17,13 +19,11 @@ class DTGeometry; class DTTTrigBaseSync; class TFile; -class DTTPAnalyzer : public edm::EDAnalyzer { +class DTTPAnalyzer : public edm::one::EDAnalyzer<> { public: DTTPAnalyzer(const edm::ParameterSet&); ~DTTPAnalyzer() override; - //void beginJob(); - void beginRun(const edm::Run&, const edm::EventSetup&) override; void analyze(const edm::Event&, const edm::EventSetup&) override; void endJob() override; @@ -34,16 +34,14 @@ class DTTPAnalyzer : public edm::EDAnalyzer { edm::InputTag digiLabel_; TFile* rootFile_; - //const DTT0* tZeroMap_; edm::ESHandle dtGeom_; + const edm::ESGetToken dtGeomToken_; std::unique_ptr tTrigSync_; // Map of the t0 and sigma histos by layer std::map nDigisPerWire_; std::map sumWPerWire_; std::map sumW2PerWire_; - //std::map meanHistoMap_; - //std::map sigmaHistoMap_; }; #include "FWCore/Framework/interface/Event.h" @@ -53,7 +51,6 @@ class DTTPAnalyzer : public edm::EDAnalyzer { #include "CalibMuon/DTDigiSync/interface/DTTTrigSyncFactory.h" #include "CalibMuon/DTDigiSync/interface/DTTTrigBaseSync.h" -#include "Geometry/Records/interface/MuonGeometryRecord.h" #include "Geometry/Records/interface/MuonNumberingRecord.h" #include "Geometry/DTGeometry/interface/DTGeometry.h" @@ -66,35 +63,32 @@ class DTTPAnalyzer : public edm::EDAnalyzer { #include "TFile.h" DTTPAnalyzer::DTTPAnalyzer(const edm::ParameterSet& pset) - : subtractT0_(pset.getParameter("subtractT0")), digiLabel_(pset.getParameter("digiLabel")) { + : subtractT0_(pset.getParameter("subtractT0")), + digiLabel_(pset.getParameter("digiLabel")), + dtGeomToken_(esConsumes()) { std::string rootFileName = pset.getUntrackedParameter("rootFileName"); rootFile_ = new TFile(rootFileName.c_str(), "RECREATE"); rootFile_->cd(); if (subtractT0_) tTrigSync_ = DTTTrigSyncFactory::get()->create(pset.getParameter("tTrigMode"), - pset.getParameter("tTrigModeConfig")); + pset.getParameter("tTrigModeConfig"), + consumesCollector()); } DTTPAnalyzer::~DTTPAnalyzer() { rootFile_->Close(); } -void DTTPAnalyzer::beginRun(const edm::Run& run, const edm::EventSetup& setup) { - // Get the t0 map from the DB - if (subtractT0_) { - /*ESHandle t0; - setup.get().get(t0); - tZeroMap_ = &*t0;*/ - tTrigSync_->setES(setup); - } - // Get the DT Geometry - setup.get().get(dtGeom_); -} - void DTTPAnalyzer::analyze(const edm::Event& event, const edm::EventSetup& setup) { // Get the digis from the event edm::Handle digis; event.getByLabel(digiLabel_, digis); + if (subtractT0_) { + tTrigSync_->setES(setup); + } + // Get the DT Geometry + dtGeom_ = setup.getHandle(dtGeomToken_); + // Iterate through all digi collections ordered by LayerId DTDigiCollection::DigiRangeIterator dtLayerIt; for (dtLayerIt = digis->begin(); dtLayerIt != digis->end(); ++dtLayerIt) { diff --git a/CalibMuon/DTCalibration/plugins/DTTPDeadWriter.cc b/CalibMuon/DTCalibration/plugins/DTTPDeadWriter.cc index 867ae6336bb88..d3d88c3c073eb 100644 --- a/CalibMuon/DTCalibration/plugins/DTTPDeadWriter.cc +++ b/CalibMuon/DTCalibration/plugins/DTTPDeadWriter.cc @@ -33,9 +33,10 @@ using namespace std; using namespace edm; // Constructor -DTTPDeadWriter::DTTPDeadWriter(const ParameterSet& pset) { +DTTPDeadWriter::DTTPDeadWriter(const ParameterSet& pset) : dtGeomToken_(esConsumes()) { // get selected debug option debug = pset.getUntrackedParameter("debug", false); + t0Token_ = esConsumes(edm::ESInputTag("", pset.getParameter("debug"))); // Create the object to be written to DB tpDeadList = new DTDeadFlag(); @@ -52,12 +53,10 @@ DTTPDeadWriter::~DTTPDeadWriter() { void DTTPDeadWriter::beginRun(const edm::Run&, const EventSetup& setup) { // Get the t0 map - ESHandle t0; - setup.get().get(t0); - tZeroMap = &*t0; + tZeroMap = &setup.getData(t0Token_); // Get the muon Geometry - setup.get().get(muonGeom); + muonGeom = setup.getHandle(dtGeomToken_); } // Do the job diff --git a/CalibMuon/DTCalibration/plugins/DTTPDeadWriter.h b/CalibMuon/DTCalibration/plugins/DTTPDeadWriter.h index 0a005ae97fe04..0288bcb8a932c 100644 --- a/CalibMuon/DTCalibration/plugins/DTTPDeadWriter.h +++ b/CalibMuon/DTCalibration/plugins/DTTPDeadWriter.h @@ -10,6 +10,9 @@ #include "FWCore/Framework/interface/EDAnalyzer.h" #include "Geometry/DTGeometry/interface/DTGeometry.h" #include "FWCore/Framework/interface/ESHandle.h" +#include "Geometry/Records/interface/MuonGeometryRecord.h" +#include "CondFormats/DTObjects/interface/DTT0.h" +#include "CondFormats/DataRecord/interface/DTT0Rcd.h" #include @@ -48,11 +51,13 @@ class DTTPDeadWriter : public edm::EDAnalyzer { //The map of t0 to be read from event const DTT0* tZeroMap; + edm::ESGetToken t0Token_; // The object to be written to DB DTDeadFlag* tpDeadList; //The DTGeometry edm::ESHandle muonGeom; + const edm::ESGetToken dtGeomToken_; }; #endif diff --git a/CalibMuon/DTCalibration/plugins/DTTTrigCalibration.cc b/CalibMuon/DTCalibration/plugins/DTTTrigCalibration.cc index 4db5c33df0a9e..106af25a38b2c 100644 --- a/CalibMuon/DTCalibration/plugins/DTTTrigCalibration.cc +++ b/CalibMuon/DTCalibration/plugins/DTTTrigCalibration.cc @@ -10,6 +10,7 @@ #include "FWCore/Framework/interface/EventSetup.h" #include "FWCore/Framework/interface/Event.h" +#include "FWCore/Framework/interface/ConsumesCollector.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "FWCore/Framework/interface/ESHandle.h" @@ -67,7 +68,8 @@ DTTTrigCalibration::DTTTrigCalibration(const edm::ParameterSet& pset) { // Get the synchronizer if (doSubtractT0) { theSync = DTTTrigSyncFactory::get()->create(pset.getUntrackedParameter("tTrigMode"), - pset.getUntrackedParameter("tTrigModeConfig")); + pset.getUntrackedParameter("tTrigModeConfig"), + consumesCollector()); } checkNoisyChannels = pset.getUntrackedParameter("checkNoisyChannels", "false"); @@ -77,6 +79,10 @@ DTTTrigCalibration::DTTTrigCalibration(const edm::ParameterSet& pset) { if (debug) cout << "[DTTTrigCalibration]Constructor called!" << endl; + + if (checkNoisyChannels) { + theStatusMapToken = esConsumes(); + } } // Destructor @@ -106,7 +112,7 @@ void DTTTrigCalibration::analyze(const edm::Event& event, const edm::EventSetup& ESHandle statusMap; if (checkNoisyChannels) { // Get the map of noisy channels - eventSetup.get().get(statusMap); + statusMap = eventSetup.getHandle(theStatusMapToken); } if (doSubtractT0) diff --git a/CalibMuon/DTCalibration/plugins/DTTTrigCalibration.h b/CalibMuon/DTCalibration/plugins/DTTTrigCalibration.h index c45d290ef6da3..b3ebea14e5145 100644 --- a/CalibMuon/DTCalibration/plugins/DTTTrigCalibration.h +++ b/CalibMuon/DTCalibration/plugins/DTTTrigCalibration.h @@ -9,7 +9,7 @@ * \author G. Cerminara - INFN Torino */ -#include "FWCore/Framework/interface/EDAnalyzer.h" +#include "FWCore/Framework/interface/one/EDAnalyzer.h" #include "DataFormats/MuonDetId/interface/DTSuperLayerId.h" #include "DataFormats/MuonDetId/interface/DTLayerId.h" @@ -27,8 +27,10 @@ class TH1F; class DTTimeBoxFitter; class DTTTrigBaseSync; class DTTtrig; +class DTStatusFlag; +class DTStatusFlagRcd; -class DTTTrigCalibration : public edm::EDAnalyzer { +class DTTTrigCalibration : public edm::one::EDAnalyzer<> { public: /// Constructor DTTTrigCalibration(const edm::ParameterSet& pset); @@ -88,5 +90,6 @@ class DTTTrigCalibration : public edm::EDAnalyzer { std::unique_ptr theFitter; // The module for t0 subtraction std::unique_ptr theSync; //FIXME: should be const + edm::ESGetToken theStatusMapToken; }; #endif diff --git a/CalibMuon/DTCalibration/plugins/DTTTrigCorrectionFirst.cc b/CalibMuon/DTCalibration/plugins/DTTTrigCorrectionFirst.cc index 44b0203583001..946c74ee204ee 100644 --- a/CalibMuon/DTCalibration/plugins/DTTTrigCorrectionFirst.cc +++ b/CalibMuon/DTCalibration/plugins/DTTTrigCorrectionFirst.cc @@ -25,7 +25,8 @@ using namespace edm; using namespace std; -DTTTrigCorrectionFirst::DTTTrigCorrectionFirst(const ParameterSet& pset) { +DTTTrigCorrectionFirst::DTTTrigCorrectionFirst(const ParameterSet& pset) + : dtGeomToken_(esConsumes()), ttrigToken_(esConsumes(edm::ESInputTag("", pset.getParameter("dbLabel")))) { debug = pset.getUntrackedParameter("debug", false); ttrigMin = pset.getUntrackedParameter("ttrigMin", 0); ttrigMax = pset.getUntrackedParameter("ttrigMax", 5000); @@ -38,11 +39,10 @@ DTTTrigCorrectionFirst::~DTTTrigCorrectionFirst() {} void DTTTrigCorrectionFirst::beginRun(const edm::Run& run, const edm::EventSetup& setup) { ESHandle tTrig; - setup.get().get(dbLabel, tTrig); - tTrigMap = &*tTrig; + tTrig = setup.getHandle(ttrigToken_); + tTrigMap = &setup.getData(ttrigToken_); cout << "[DTTTrigCorrection]: TTrig version: " << tTrig->version() << endl; - - setup.get().get(muonGeom); + muonGeom = setup.getHandle(dtGeomToken_); } void DTTTrigCorrectionFirst::endJob() { diff --git a/CalibMuon/DTCalibration/plugins/DTTTrigCorrectionFirst.h b/CalibMuon/DTCalibration/plugins/DTTTrigCorrectionFirst.h index 5b0c496e3398a..70803fa64b4e8 100644 --- a/CalibMuon/DTCalibration/plugins/DTTTrigCorrectionFirst.h +++ b/CalibMuon/DTCalibration/plugins/DTTTrigCorrectionFirst.h @@ -11,6 +11,8 @@ #include "FWCore/Framework/interface/Frameworkfwd.h" #include "FWCore/Framework/interface/EDAnalyzer.h" #include "FWCore/Framework/interface/ESHandle.h" +#include "Geometry/Records/interface/MuonGeometryRecord.h" +#include "CondFormats/DataRecord/interface/DTTtrigRcd.h" #include @@ -35,8 +37,11 @@ class DTTTrigCorrectionFirst : public edm::EDAnalyzer { protected: private: - const DTTtrig* tTrigMap; edm::ESHandle muonGeom; + const edm::ESGetToken dtGeomToken_; + + const DTTtrig* tTrigMap; + const edm::ESGetToken ttrigToken_; std::string dbLabel; diff --git a/CalibMuon/DTCalibration/plugins/DTTTrigOffsetCalibration.cc b/CalibMuon/DTCalibration/plugins/DTTTrigOffsetCalibration.cc index 4ea933cd41001..7faccb654a4ab 100644 --- a/CalibMuon/DTCalibration/plugins/DTTTrigOffsetCalibration.cc +++ b/CalibMuon/DTCalibration/plugins/DTTTrigOffsetCalibration.cc @@ -38,7 +38,9 @@ DTTTrigOffsetCalibration::DTTTrigOffsetCalibration(const ParameterSet& pset) : theRecHits4DLabel_(pset.getParameter("recHits4DLabel")), doTTrigCorrection_(pset.getUntrackedParameter("doT0SegCorrection", false)), theCalibChamber_(pset.getUntrackedParameter("calibChamber", "All")), - dbLabel_(pset.getUntrackedParameter("dbLabel", "")) { + dbLabel_(pset.getUntrackedParameter("dbLabel", "")), + ttrigToken_(esConsumes(edm::ESInputTag("", pset.getParameter("dbLabel")))), + dtGeomToken_(esConsumes()) { LogVerbatim("Calibration") << "[DTTTrigOffsetCalibration] Constructor called!"; edm::ConsumesCollector collector(consumesCollector()); @@ -53,8 +55,8 @@ DTTTrigOffsetCalibration::DTTTrigOffsetCalibration(const ParameterSet& pset) void DTTTrigOffsetCalibration::beginRun(const edm::Run& run, const edm::EventSetup& setup) { if (doTTrigCorrection_) { ESHandle tTrig; - setup.get().get(dbLabel_, tTrig); - tTrigMap_ = &*tTrig; + tTrig = setup.getHandle(ttrigToken_); + tTrigMap_ = &setup.getData(ttrigToken_); LogVerbatim("Calibration") << "[DTTTrigOffsetCalibration]: TTrig version: " << tTrig->version() << endl; } } @@ -79,7 +81,7 @@ void DTTTrigOffsetCalibration::analyze(const Event& event, const EventSetup& eve // Get the DT Geometry ESHandle dtGeom; - eventSetup.get().get(dtGeom); + dtGeom = eventSetup.getHandle(dtGeomToken_); // Get the rechit collection from the event Handle all4DSegments; diff --git a/CalibMuon/DTCalibration/plugins/DTTTrigOffsetCalibration.h b/CalibMuon/DTCalibration/plugins/DTTTrigOffsetCalibration.h index d6a0825bfe17b..60c448faad1e4 100644 --- a/CalibMuon/DTCalibration/plugins/DTTTrigOffsetCalibration.h +++ b/CalibMuon/DTCalibration/plugins/DTTTrigOffsetCalibration.h @@ -10,6 +10,9 @@ #include "FWCore/Framework/interface/EDAnalyzer.h" #include "FWCore/Utilities/interface/InputTag.h" #include "CalibMuon/DTCalibration/interface/DTSegmentSelector.h" +#include "Geometry/Records/interface/MuonGeometryRecord.h" +#include "CondFormats/DataRecord/interface/DTTtrigRcd.h" +#include "Geometry/DTGeometry/interface/DTGeometry.h" #include @@ -49,5 +52,8 @@ class DTTTrigOffsetCalibration : public edm::EDAnalyzer { TFile* rootFile_; const DTTtrig* tTrigMap_; ChamberHistosMap theT0SegHistoMap_; + + const edm::ESGetToken ttrigToken_; + const edm::ESGetToken dtGeomToken_; }; #endif diff --git a/CalibMuon/DTCalibration/plugins/DTTTrigResidualCorrection.cc b/CalibMuon/DTCalibration/plugins/DTTTrigResidualCorrection.cc index ee8092ca60883..ac8f7cebfa63b 100644 --- a/CalibMuon/DTCalibration/plugins/DTTTrigResidualCorrection.cc +++ b/CalibMuon/DTCalibration/plugins/DTTTrigResidualCorrection.cc @@ -15,6 +15,8 @@ #include "CondFormats/DataRecord/interface/DTTtrigRcd.h" #include "CondFormats/DTObjects/interface/DTMtime.h" #include "CondFormats/DataRecord/interface/DTMtimeRcd.h" +#include "CondFormats/DTObjects/interface/DTRecoConditions.h" +#include "CondFormats/DataRecord/interface/DTRecoConditionsVdriftRcd.h" #include "CalibMuon/DTCalibration/interface/DTResidualFitter.h" @@ -48,6 +50,7 @@ namespace dtCalibration { //useConstantvDrift_ = pset.getParameter("useConstantDriftVelocity"); dbLabel_ = pset.getUntrackedParameter("dbLabel", ""); useSlopesCalib_ = pset.getUntrackedParameter("useSlopesCalib", false); + readLegacyVDriftDB = pset.getParameter("readLegacyVDriftDB"); // Load external slopes if (useSlopesCalib_) { @@ -83,9 +86,22 @@ namespace dtCalibration { tTrigMap_ = &*tTrig; // Get vDrift record - ESHandle mTimeHandle; - setup.get().get(mTimeHandle); - mTimeMap_ = &*mTimeHandle; + if (readLegacyVDriftDB) { + ESHandle mTimeHandle; + setup.get().get(mTimeHandle); + mTimeMap_ = &*mTimeHandle; + vDriftMap_ = nullptr; + } else { + ESHandle hVdrift; + setup.get().get(hVdrift); + vDriftMap_ = &*hVdrift; + mTimeMap_ = nullptr; + // Consistency check: no parametrization is implemented for the time being + int version = vDriftMap_->version(); + if (version != 1) { + throw cms::Exception("Configuration") << "only version 1 is presently supported for VDriftDB"; + } + } } DTTTrigData DTTTrigResidualCorrection::correction(const DTSuperLayerId& slId) { @@ -94,10 +110,15 @@ namespace dtCalibration { if (status != 0) throw cms::Exception("[DTTTrigResidualCorrection]") << "Could not find tTrig entry in DB for" << slId << endl; - float vDrift, hitResolution; - status = mTimeMap_->get(slId, vDrift, hitResolution, DTVelocityUnits::cm_per_ns); - if (status != 0) - throw cms::Exception("[DTTTrigResidualCorrection]") << "Could not find vDrift entry in DB for" << slId << endl; + float vDrift, hitResolution = 0.; + if (readLegacyVDriftDB) { // Legacy format + status = mTimeMap_->get(slId, vDrift, hitResolution, DTVelocityUnits::cm_per_ns); + if (status != 0) + throw cms::Exception("[DTTTrigResidualCorrection]") << "Could not find vDrift entry in DB for" << slId << endl; + } else { + vDrift = vDriftMap_->get(DTWireId(slId.rawId())); + } + TH1F residualHisto = *(getHisto(slId)); LogTrace("Calibration") << "[DTTTrigResidualCorrection]: \n" << " Mean, RMS = " << residualHisto.GetMean() << ", " << residualHisto.GetRMS(); diff --git a/CalibMuon/DTCalibration/plugins/DTTTrigResidualCorrection.h b/CalibMuon/DTCalibration/plugins/DTTTrigResidualCorrection.h index a9c5e3a01f91e..e13806bce3253 100644 --- a/CalibMuon/DTCalibration/plugins/DTTTrigResidualCorrection.h +++ b/CalibMuon/DTCalibration/plugins/DTTTrigResidualCorrection.h @@ -18,6 +18,7 @@ namespace edm { class DTTtrig; class DTMtime; +class DTRecoConditions; class DTResidualFitter; class TH1F; @@ -50,7 +51,10 @@ namespace dtCalibration { double vDriftEff_[5][14][4][3]; const DTTtrig* tTrigMap_; - const DTMtime* mTimeMap_; + const DTMtime* mTimeMap_; // legacy vdrift DB object + const DTRecoConditions* vDriftMap_; // vdrift DB object in new format + bool readLegacyVDriftDB; // which one to use + DTResidualFitter* fitter_; }; diff --git a/CalibMuon/DTCalibration/plugins/DTTTrigWriter.cc b/CalibMuon/DTCalibration/plugins/DTTTrigWriter.cc index fa85f6a6f69a3..d790e8dcad5f5 100644 --- a/CalibMuon/DTCalibration/plugins/DTTTrigWriter.cc +++ b/CalibMuon/DTCalibration/plugins/DTTTrigWriter.cc @@ -33,7 +33,7 @@ using namespace std; using namespace edm; // Constructor -DTTTrigWriter::DTTTrigWriter(const ParameterSet& pset) { +DTTTrigWriter::DTTTrigWriter(const ParameterSet& pset) : dtGeomToken_(esConsumes()) { // get selected debug option debug = pset.getUntrackedParameter("debug", false); @@ -72,8 +72,7 @@ void DTTTrigWriter::analyze(const Event& event, const EventSetup& eventSetup) { cout << "[DTTTrigWriter]Analyzer called!" << endl; // Get the DT Geometry - ESHandle dtGeom; - eventSetup.get().get(dtGeom); + dtGeom = eventSetup.getHandle(dtGeomToken_); // Get all the sls from the setup const vector superLayers = dtGeom->superLayers(); diff --git a/CalibMuon/DTCalibration/plugins/DTTTrigWriter.h b/CalibMuon/DTCalibration/plugins/DTTTrigWriter.h index 47cf1a4518179..f008f0d4ea0c8 100644 --- a/CalibMuon/DTCalibration/plugins/DTTTrigWriter.h +++ b/CalibMuon/DTCalibration/plugins/DTTTrigWriter.h @@ -8,7 +8,10 @@ */ #include "FWCore/Framework/interface/EDAnalyzer.h" +#include "FWCore/Framework/interface/ESHandle.h" // #include "DataFormats/MuonDetId/interface/DTSuperLayerId.h" +#include "Geometry/Records/interface/MuonGeometryRecord.h" +#include "Geometry/DTGeometry/interface/DTGeometry.h" #include @@ -60,5 +63,9 @@ class DTTTrigWriter : public edm::EDAnalyzer { // The object to be written to DB DTTtrig* tTrig; + + //geom + edm::ESHandle dtGeom; + const edm::ESGetToken dtGeomToken_; }; #endif diff --git a/CalibMuon/DTCalibration/plugins/DTVDriftCalibration.cc b/CalibMuon/DTCalibration/plugins/DTVDriftCalibration.cc index b76a9aade2917..fbe90e32a9589 100644 --- a/CalibMuon/DTCalibration/plugins/DTVDriftCalibration.cc +++ b/CalibMuon/DTCalibration/plugins/DTVDriftCalibration.cc @@ -11,6 +11,7 @@ #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/ESHandle.h" +#include "FWCore/Framework/interface/ConsumesCollector.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" #include "Geometry/DTGeometry/interface/DTGeometry.h" @@ -20,6 +21,7 @@ #include "CalibMuon/DTDigiSync/interface/DTTTrigBaseSync.h" #include "CondFormats/DTObjects/interface/DTMtime.h" +#include "CondFormats/DTObjects/interface/DTRecoConditions.h" #include "CondFormats/DataRecord/interface/DTStatusFlagRcd.h" #include "CondFormats/DTObjects/interface/DTStatusFlag.h" @@ -41,8 +43,10 @@ using namespace dttmaxenums; DTVDriftCalibration::DTVDriftCalibration(const ParameterSet& pset) : // Get the synchronizer + theDTGeomToken{esConsumes()}, theSync{DTTTrigSyncFactory::get()->create(pset.getParameter("tTrigMode"), - pset.getParameter("tTrigModeConfig"))} + pset.getParameter("tTrigModeConfig"), + consumesCollector())} { edm::ConsumesCollector collector(consumesCollector()); @@ -82,6 +86,8 @@ DTVDriftCalibration::DTVDriftCalibration(const ParameterSet& pset) // the granularity to be used for tMax string tMaxGranularity = pset.getUntrackedParameter("tMaxGranularity", "bySL"); + writeLegacyVDriftDB = pset.getParameter("writeLegacyVDriftDB"); + // Enforce it to be by SL since rest is not implemented if (tMaxGranularity != "bySL") { LogError("Calibration") << "[DTVDriftCalibration] tMaxGranularity will be fixed to bySL."; @@ -122,19 +128,12 @@ void DTVDriftCalibration::analyze(const Event& event, const EventSetup& eventSet } // Get the DT Geometry - ESHandle dtGeom; - eventSetup.get().get(dtGeom); + const DTGeometry& dtGeom = eventSetup.getData(theDTGeomToken); // Get the rechit collection from the event Handle all4DSegments; event.getByToken(theRecHits4DToken, all4DSegments); - // Get the map of noisy channels - /*ESHandle statusMap; - if(checkNoisyChannels) { - eventSetup.get().get(statusMap); - }*/ - // Set the event setup in the Synchronizer theSync->setES(eventSetup); @@ -142,7 +141,7 @@ void DTVDriftCalibration::analyze(const Event& event, const EventSetup& eventSet DTRecSegment4DCollection::id_iterator chamberIdIt; for (chamberIdIt = all4DSegments->id_begin(); chamberIdIt != all4DSegments->id_end(); ++chamberIdIt) { // Get the chamber from the setup - const DTChamber* chamber = dtGeom->chamber(*chamberIdIt); + const DTChamber* chamber = dtGeom.chamber(*chamberIdIt); LogTrace("Calibration") << "Chamber Id: " << *chamberIdIt; // Calibrate just the chosen chamber/s @@ -281,7 +280,16 @@ void DTVDriftCalibration::endJob() { // Instantiate a DTCalibrationMap object if you want to calculate the calibration constants DTCalibrationMap calibValuesFile(theCalibFilePar); // Create the object to be written to DB - DTMtime* mTime = new DTMtime(); + DTMtime* mTime = nullptr; + DTRecoConditions* vDrift = nullptr; + if (writeLegacyVDriftDB) { + mTime = new DTMtime(); + } else { + vDrift = new DTRecoConditions(); + vDrift->setFormulaExpr("[0]"); + //vDriftNewMap->setFormulaExpr("[0]*(1-[1]*x)"); // add parametrization for dependency along Y + vDrift->setVersion(1); + } // write the TMax histograms of each SL to the root file if (theGranularity == bySL) { @@ -322,7 +330,12 @@ void DTVDriftCalibration::endJob() { calibValuesFile.addCell(calibValuesFile.getKey(wireId), newConstants); // vdrift is cm/ns , resolution is cm - mTime->set((wireId.layerId()).superlayerId(), vDriftAndReso[0], vDriftAndReso[1], DTVelocityUnits::cm_per_ns); + if (writeLegacyVDriftDB) { + mTime->set((wireId.layerId()).superlayerId(), vDriftAndReso[0], vDriftAndReso[1], DTVelocityUnits::cm_per_ns); + } else { + vector params = {vDriftAndReso[0]}; + vDrift->set(wireId, params); + } LogTrace("Calibration") << " SL: " << (wireId.layerId()).superlayerId() << " vDrift = " << vDriftAndReso[0] << " reso = " << vDriftAndReso[1]; } @@ -366,8 +379,12 @@ void DTVDriftCalibration::endJob() { LogVerbatim("Calibration") << "[DTVDriftCalibration]Writing vdrift object to DB!"; // Write the vdrift object to DB - string record = "DTMtimeRcd"; - DTCalibDBUtils::writeToDB(record, mTime); + if (writeLegacyVDriftDB) { + string record = "DTMtimeRcd"; + DTCalibDBUtils::writeToDB(record, mTime); + } else { + DTCalibDBUtils::writeToDB("DTRecoConditionsVdriftRcd", vDrift); + } } // to be implemented: granularity different from bySL diff --git a/CalibMuon/DTCalibration/plugins/DTVDriftCalibration.h b/CalibMuon/DTCalibration/plugins/DTVDriftCalibration.h index 3cbe0afe81c3e..361365868827d 100644 --- a/CalibMuon/DTCalibration/plugins/DTVDriftCalibration.h +++ b/CalibMuon/DTCalibration/plugins/DTVDriftCalibration.h @@ -7,7 +7,7 @@ * \author M. Giunta */ -#include "FWCore/Framework/interface/EDAnalyzer.h" +#include "FWCore/Framework/interface/one/EDAnalyzer.h" #include "FWCore/Utilities/interface/InputTag.h" #include "DataFormats/MuonDetId/interface/DTWireId.h" #include "DataFormats/DTRecHit/interface/DTRecSegment4DCollection.h" @@ -29,8 +29,10 @@ namespace edm { class TFile; class DTMeanTimerFitter; +class DTGeometry; +class MuonGeometryRecord; -class DTVDriftCalibration : public edm::EDAnalyzer { +class DTVDriftCalibration : public edm::one::EDAnalyzer<> { public: /// Constructor DTVDriftCalibration(const edm::ParameterSet& pset); @@ -87,6 +89,8 @@ class DTVDriftCalibration : public edm::EDAnalyzer { // The label used to retrieve 4D segments from the event edm::EDGetTokenT theRecHits4DToken; + const edm::ESGetToken theDTGeomToken; + // Debug flag bool debug; @@ -129,5 +133,8 @@ class DTVDriftCalibration : public edm::EDAnalyzer { // Choose the chamber you want to calibrate std::string theCalibChamber; + + // which format to be created + bool writeLegacyVDriftDB; }; #endif diff --git a/CalibMuon/DTCalibration/plugins/DTVDriftSegmentCalibration.cc b/CalibMuon/DTCalibration/plugins/DTVDriftSegmentCalibration.cc index 17297347a421a..d851f5735ad64 100644 --- a/CalibMuon/DTCalibration/plugins/DTVDriftSegmentCalibration.cc +++ b/CalibMuon/DTCalibration/plugins/DTVDriftSegmentCalibration.cc @@ -33,7 +33,8 @@ using namespace edm; DTVDriftSegmentCalibration::DTVDriftSegmentCalibration(const ParameterSet& pset) : theRecHits4DLabel_(pset.getParameter("recHits4DLabel")), //writeVDriftDB_(pset.getUntrackedParameter("writeVDriftDB", false)), - theCalibChamber_(pset.getUntrackedParameter("calibChamber", "All")) { + theCalibChamber_(pset.getUntrackedParameter("calibChamber", "All")), + dtGeomToken_(esConsumes()) { LogVerbatim("Calibration") << "[DTVDriftSegmentCalibration] Constructor called!"; edm::ConsumesCollector collector(consumesCollector()); @@ -59,7 +60,7 @@ void DTVDriftSegmentCalibration::analyze(const Event& event, const EventSetup& e // Get the DT Geometry ESHandle dtGeom; - eventSetup.get().get(dtGeom); + dtGeom = eventSetup.getHandle(dtGeomToken_); // Get the rechit collection from the event Handle all4DSegments; diff --git a/CalibMuon/DTCalibration/plugins/DTVDriftSegmentCalibration.h b/CalibMuon/DTCalibration/plugins/DTVDriftSegmentCalibration.h index 398535a960acf..6361953a6552f 100644 --- a/CalibMuon/DTCalibration/plugins/DTVDriftSegmentCalibration.h +++ b/CalibMuon/DTCalibration/plugins/DTVDriftSegmentCalibration.h @@ -11,6 +11,8 @@ #include "FWCore/Framework/interface/EDAnalyzer.h" #include "FWCore/Utilities/interface/InputTag.h" #include "CalibMuon/DTCalibration/interface/DTSegmentSelector.h" +#include "Geometry/Records/interface/MuonGeometryRecord.h" +#include "Geometry/DTGeometry/interface/DTGeometry.h" #include @@ -45,5 +47,7 @@ class DTVDriftSegmentCalibration : public edm::EDAnalyzer { TFile* rootFile_; ChamberHistosMapTH1F theVDriftHistoMapTH1F_; ChamberHistosMapTH2F theVDriftHistoMapTH2F_; + + const edm::ESGetToken dtGeomToken_; }; #endif diff --git a/CalibMuon/DTCalibration/plugins/DTVDriftWriter.cc b/CalibMuon/DTCalibration/plugins/DTVDriftWriter.cc index 363cab5cf2cf3..5a2ba83a87222 100644 --- a/CalibMuon/DTCalibration/plugins/DTVDriftWriter.cc +++ b/CalibMuon/DTCalibration/plugins/DTVDriftWriter.cc @@ -33,7 +33,10 @@ using namespace std; using namespace edm; DTVDriftWriter::DTVDriftWriter(const ParameterSet& pset) - : granularity_(pset.getUntrackedParameter("calibGranularity", "bySL")), + : mTimeMapToken_(esConsumes()), + vDriftMapToken_(esConsumes()), + dtGeomToken_(esConsumes()), + granularity_(pset.getUntrackedParameter("calibGranularity", "bySL")), mTimeMap_(nullptr), vDriftMap_(nullptr), vDriftAlgo_{DTVDriftPluginFactory::get()->create(pset.getParameter("vDriftAlgo"), @@ -53,13 +56,9 @@ DTVDriftWriter::~DTVDriftWriter() { LogVerbatim("Calibration") << "[DTVDriftWrit void DTVDriftWriter::beginRun(const edm::Run& run, const edm::EventSetup& setup) { // Get the map of vdrift from the Setup if (readLegacyVDriftDB) { - ESHandle mTime; - setup.get().get(mTime); - mTimeMap_ = &*mTime; + mTimeMap_ = &setup.getData(mTimeMapToken_); } else { - ESHandle hVdrift; - setup.get().get(hVdrift); - vDriftMap_ = &*hVdrift; + vDriftMap_ = &setup.getData(vDriftMapToken_); // Consistency check: no parametrization is implemented for the time being int version = vDriftMap_->version(); if (version != 1) { @@ -68,7 +67,8 @@ void DTVDriftWriter::beginRun(const edm::Run& run, const edm::EventSetup& setup) } // Get geometry from Event Setup - setup.get().get(dtGeom_); + dtGeom_ = setup.getHandle(dtGeomToken_); + // Pass EventSetup to concrete implementation vDriftAlgo_->setES(setup); } diff --git a/CalibMuon/DTCalibration/plugins/DTVDriftWriter.h b/CalibMuon/DTCalibration/plugins/DTVDriftWriter.h index a95c30059fcc9..ccd7a8bdf80b8 100644 --- a/CalibMuon/DTCalibration/plugins/DTVDriftWriter.h +++ b/CalibMuon/DTCalibration/plugins/DTVDriftWriter.h @@ -12,6 +12,9 @@ #include "FWCore/Framework/interface/EDAnalyzer.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "FWCore/Framework/interface/ESHandle.h" +#include "CondFormats/DataRecord/interface/DTMtimeRcd.h" +#include "CondFormats/DataRecord/interface/DTRecoConditionsVdriftRcd.h" +#include "Geometry/Records/interface/MuonGeometryRecord.h" #include @@ -33,8 +36,10 @@ class DTVDriftWriter : public edm::EDAnalyzer { void endJob() override; private: - std::string granularity_; // enforced by SL - + const edm::ESGetToken mTimeMapToken_; + const edm::ESGetToken vDriftMapToken_; + const edm::ESGetToken dtGeomToken_; + std::string granularity_; // enforced by SL const DTMtime* mTimeMap_; // legacy DB object const DTRecoConditions* vDriftMap_; // DB object in new format bool readLegacyVDriftDB; // which format to use to read old values diff --git a/CalibMuon/DTCalibration/python/PlottingTools/plotT0FromHistos.py b/CalibMuon/DTCalibration/python/PlottingTools/plotT0FromHistos.py index ca58e650f36fd..23b57c9684f19 100644 --- a/CalibMuon/DTCalibration/python/PlottingTools/plotT0FromHistos.py +++ b/CalibMuon/DTCalibration/python/PlottingTools/plotT0FromHistos.py @@ -4,8 +4,8 @@ from .drawHistoAllChambers import drawHisto def binNumber(station,sl): - if sl is 3 and station is 4: return 11 - if sl is 2 and station is 4: return None + if sl == 3 and station == 4: return 11 + if sl == 2 and station == 4: return None start = (station - 1)*3 return start + sl diff --git a/CalibMuon/DTCalibration/python/dtTTrigResidualCorrection_cfi.py b/CalibMuon/DTCalibration/python/dtTTrigResidualCorrection_cfi.py index 58a4af8487e18..e969f2c06bf1b 100644 --- a/CalibMuon/DTCalibration/python/dtTTrigResidualCorrection_cfi.py +++ b/CalibMuon/DTCalibration/python/dtTTrigResidualCorrection_cfi.py @@ -8,6 +8,7 @@ #rootBaseDir = cms.untracked.string('/DQMData/DT/DTCalibValidation'), rootBaseDir = cms.untracked.string('DTResiduals'), dbLabel = cms.untracked.string(''), - useFitToResiduals = cms.bool(True) - ) + useFitToResiduals = cms.bool(True), + readLegacyVDriftDB =cms.bool(True) + ), ) diff --git a/CalibMuon/DTCalibration/python/dtVDriftAnalyzer_cfg.py b/CalibMuon/DTCalibration/python/dtVDriftAnalyzer_cfg.py index 7394e6f75aa1b..1fb4562afc348 100644 --- a/CalibMuon/DTCalibration/python/dtVDriftAnalyzer_cfg.py +++ b/CalibMuon/DTCalibration/python/dtVDriftAnalyzer_cfg.py @@ -14,7 +14,8 @@ ) process.dtVDriftAnalyzer = cms.EDAnalyzer("DTVDriftAnalyzer", - rootFileName = cms.untracked.string('') + rootFileName = cms.untracked.string(''), + readLegacyVDriftDB =cms.bool(True), ) process.p = cms.Path(process.dtVDriftAnalyzer) diff --git a/CalibMuon/DTCalibration/python/dtVDriftMeanTimerCalibration_cfi.py b/CalibMuon/DTCalibration/python/dtVDriftMeanTimerCalibration_cfi.py index ba8fe916a61e2..23cf35716e2d7 100644 --- a/CalibMuon/DTCalibration/python/dtVDriftMeanTimerCalibration_cfi.py +++ b/CalibMuon/DTCalibration/python/dtVDriftMeanTimerCalibration_cfi.py @@ -39,5 +39,9 @@ calibConstFileName = cms.untracked.string('vDriftAndReso.txt') ), # Name of the txt file which will contain the calibrated v_drift - vDriftFileName = cms.untracked.string('vDriftFromMtime.txt') + vDriftFileName = cms.untracked.string('vDriftFromMtime.txt'), + + # Use legacy DB format + writeLegacyVDriftDB =cms.bool(True), + ) diff --git a/CalibMuon/DTCalibration/python/dtVDriftMeanTimerCalibration_cosmics_cfi.py b/CalibMuon/DTCalibration/python/dtVDriftMeanTimerCalibration_cosmics_cfi.py index 02d7ae66d7675..799c7e933088c 100644 --- a/CalibMuon/DTCalibration/python/dtVDriftMeanTimerCalibration_cosmics_cfi.py +++ b/CalibMuon/DTCalibration/python/dtVDriftMeanTimerCalibration_cosmics_cfi.py @@ -39,5 +39,8 @@ calibConstFileName = cms.untracked.string('vDriftAndReso.txt') ), # Name of the txt file which will contain the calibrated v_drift - vDriftFileName = cms.untracked.string('vDriftFromMtime.txt') + vDriftFileName = cms.untracked.string('vDriftFromMtime.txt'), + + # Use legacy DB format + writeLegacyVDriftDB =cms.bool(True), ) diff --git a/CalibMuon/DTCalibration/python/dtVDriftMeanTimerWriter_cfi.py b/CalibMuon/DTCalibration/python/dtVDriftMeanTimerWriter_cfi.py index c06fabd3fc2b3..7b778afccb64b 100644 --- a/CalibMuon/DTCalibration/python/dtVDriftMeanTimerWriter_cfi.py +++ b/CalibMuon/DTCalibration/python/dtVDriftMeanTimerWriter_cfi.py @@ -5,5 +5,7 @@ vDriftAlgoConfig = cms.PSet( rootFileName = cms.string(''), debug = cms.untracked.bool(False) - ) + ), + readLegacyVDriftDB = cms.bool(True), + writeLegacyVDriftDB = cms.bool(True) ) diff --git a/CalibMuon/DTCalibration/test/DBTools/DTVDriftAnalyzer.cc b/CalibMuon/DTCalibration/test/DBTools/DTVDriftAnalyzer.cc index e484fc73d8fc4..6bd906fb2cb6d 100644 --- a/CalibMuon/DTCalibration/test/DBTools/DTVDriftAnalyzer.cc +++ b/CalibMuon/DTCalibration/test/DBTools/DTVDriftAnalyzer.cc @@ -11,6 +11,9 @@ #include "FWCore/Framework/interface/EventSetup.h" #include "CondFormats/DTObjects/interface/DTMtime.h" #include "CondFormats/DataRecord/interface/DTMtimeRcd.h" +#include "CondFormats/DTObjects/interface/DTRecoConditions.h" +#include "CondFormats/DataRecord/interface/DTRecoConditionsVdriftRcd.h" +#include "FWCore/MessageLogger/interface/MessageLogger.h" #include #include "TFile.h" #include "TH1D.h" @@ -19,7 +22,8 @@ using namespace edm; using namespace std; -DTVDriftAnalyzer::DTVDriftAnalyzer(const ParameterSet& pset) { +DTVDriftAnalyzer::DTVDriftAnalyzer(const ParameterSet& pset) + : readLegacyVDriftDB(pset.getParameter("readLegacyVDriftDB")) { // The root file which will contain the histos string rootFileName = pset.getUntrackedParameter("rootFileName"); theFile = new TFile(rootFileName.c_str(), "RECREATE"); @@ -29,23 +33,57 @@ DTVDriftAnalyzer::DTVDriftAnalyzer(const ParameterSet& pset) { DTVDriftAnalyzer::~DTVDriftAnalyzer() { theFile->Close(); } void DTVDriftAnalyzer::beginRun(const edm::Run& run, const edm::EventSetup& eventSetup) { - ESHandle mTime; - eventSetup.get().get(mTime); - mTimeMap = &*mTime; - cout << "[DTVDriftAnalyzer] MTime version: " << mTime->version() << endl; + if (readLegacyVDriftDB) { + ESHandle mTime; + eventSetup.get().get(mTime); + mTimeMap = &*mTime; + vDriftMap_ = nullptr; + edm::LogVerbatim("DTVDriftAnalyzer") << "[DTVDriftAnalyzer] MTime version: " << mTime->version() << endl; + } else { + ESHandle hVdrift; + eventSetup.get().get(hVdrift); + vDriftMap_ = &*hVdrift; + mTimeMap = nullptr; + // Consistency check: no parametrization is implemented for the time being + int version = vDriftMap_->version(); + if (version != 1) { + throw cms::Exception("Configuration") << "only version 1 is presently supported for VDriftDB"; + } + } } void DTVDriftAnalyzer::endJob() { // Loop over DB entries - for (DTMtime::const_iterator mtime = mTimeMap->begin(); mtime != mTimeMap->end(); ++mtime) { - DTWireId wireId( - (*mtime).first.wheelId, (*mtime).first.stationId, (*mtime).first.sectorId, (*mtime).first.slId, 0, 0); - float vdrift; - float reso; - DetId detId(wireId.rawId()); + + map> values; + + if (readLegacyVDriftDB) { + for (DTMtime::const_iterator mtime = mTimeMap->begin(); mtime != mTimeMap->end(); ++mtime) { + DTWireId wireId( + (*mtime).first.wheelId, (*mtime).first.stationId, (*mtime).first.sectorId, (*mtime).first.slId, 0, 0); + float vdrift; + float reso; + DetId detId(wireId.rawId()); + // vdrift is cm/ns , resolution is cm + mTimeMap->get(detId, vdrift, reso, DTVelocityUnits::cm_per_ns); + values[wireId.rawId()] = make_pair(vdrift, reso); + } + } else { + for (DTRecoConditions::const_iterator vd = vDriftMap_->begin(); vd != vDriftMap_->end(); ++vd) { + DTWireId wireId(vd->first); + float vdrift = vDriftMap_->get(wireId); + values[vd->first] = make_pair(vdrift, 0.f); + } + } + + for (map>::const_iterator it = values.begin(); it != values.end(); ++it) { + float vdrift = it->second.first; + float reso = it->second.second; + DTWireId wireId(it->first); // vdrift is cm/ns , resolution is cm - mTimeMap->get(detId, vdrift, reso, DTVelocityUnits::cm_per_ns); - cout << "Wire: " << wireId << endl << " vdrift (cm/ns): " << vdrift << endl << " reso (cm): " << reso << endl; + edm::LogVerbatim("DTVDriftAnalyzer") << "Wire: " << wireId << endl + << " vdrift (cm/ns): " << vdrift << endl + << " reso (cm): " << reso << endl; //Define an histo for each wheel and each superlayer type TH1D* hVDriftHisto = theVDriftHistoMap[make_pair(wireId.wheel(), wireId.superlayer())]; diff --git a/CalibMuon/DTCalibration/test/DBTools/DTVDriftAnalyzer.h b/CalibMuon/DTCalibration/test/DBTools/DTVDriftAnalyzer.h index 72c70442d06be..e6c85041f5c78 100644 --- a/CalibMuon/DTCalibration/test/DBTools/DTVDriftAnalyzer.h +++ b/CalibMuon/DTCalibration/test/DBTools/DTVDriftAnalyzer.h @@ -18,6 +18,7 @@ #include class DTMtime; +class DTRecoConditions; class TFile; class TH1D; @@ -45,7 +46,9 @@ class DTVDriftAnalyzer : public edm::EDAnalyzer { TFile* theFile; //The t0 map - const DTMtime* mTimeMap; + const DTMtime* mTimeMap; // legacy DB object + const DTRecoConditions* vDriftMap_; // DB object in new format + bool readLegacyVDriftDB; // which one to use // Map of the vdrift, reso histos by wheel/sector/SL std::map, TH1D*> theVDriftHistoMap; diff --git a/CalibMuon/DTCalibration/test/DBTools/DumpDBToFile.cc b/CalibMuon/DTCalibration/test/DBTools/DumpDBToFile.cc index 11bd0ff22ad49..aba5fa193fde8 100644 --- a/CalibMuon/DTCalibration/test/DBTools/DumpDBToFile.cc +++ b/CalibMuon/DTCalibration/test/DBTools/DumpDBToFile.cc @@ -15,24 +15,6 @@ #include "FWCore/Utilities/interface/Exception.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" -#include "CondFormats/DTObjects/interface/DTMtime.h" -#include "CondFormats/DataRecord/interface/DTMtimeRcd.h" -#include "CondFormats/DTObjects/interface/DTTtrig.h" -#include "CondFormats/DataRecord/interface/DTTtrigRcd.h" -#include "CondFormats/DTObjects/interface/DTT0.h" -#include "CondFormats/DataRecord/interface/DTT0Rcd.h" -#include "CondFormats/DataRecord/interface/DTStatusFlagRcd.h" -#include "CondFormats/DTObjects/interface/DTStatusFlag.h" -#include "CondFormats/DataRecord/interface/DTDeadFlagRcd.h" -#include "CondFormats/DTObjects/interface/DTDeadFlag.h" -#include "CondFormats/DataRecord/interface/DTReadOutMappingRcd.h" -#include "CondFormats/DTObjects/interface/DTReadOutMapping.h" -#include "CondFormats/DataRecord/interface/DTRecoUncertaintiesRcd.h" -#include "CondFormats/DTObjects/interface/DTRecoUncertainties.h" -#include "CondFormats/DTObjects/interface/DTRecoConditions.h" -#include "CondFormats/DataRecord/interface/DTRecoConditionsTtrigRcd.h" -#include "CondFormats/DataRecord/interface/DTRecoConditionsVdriftRcd.h" -#include "CondFormats/DataRecord/interface/DTRecoConditionsUncertRcd.h" #include #include #include @@ -55,6 +37,30 @@ DumpDBToFile::DumpDBToFile(const ParameterSet& pset) { if (format != "Legacy" && format != "DTRecoConditions") throw cms::Exception("IncorrectSetup") << "Parameter format is not valid, check the cfg file" << endl; + + if (dbToDump == "VDriftDB") { + if (format == "Legacy") { + mTimeMapToken_ = esConsumes(); + } else { + vDriftToken_ = esConsumes(); + } + } else if (dbToDump == "TTrigDB") { + if (format == "Legacy") { + tTrigMapToken_ = esConsumes(); + } else { + tTrigToken_ = esConsumes(); + } + } else if (dbToDump == "TZeroDB") { + t0MapToken_ = esConsumes(); + } else if (dbToDump == "NoiseDB") { + statusMapToken_ = esConsumes(); + } else if (dbToDump == "DeadDB") { + deadMapToken_ = esConsumes(); + } else if (dbToDump == "ChannelsDB") { + readOutMapToken_ = esConsumes(); + } else if (dbToDump == "RecoUncertDB") { + uncertToken_ = esConsumes(); + } } DumpDBToFile::~DumpDBToFile() {} @@ -63,50 +69,26 @@ void DumpDBToFile::beginRun(const edm::Run&, const EventSetup& setup) { // Read the right DB accordingly to the parameter dbToDump if (dbToDump == "VDriftDB") { if (format == "Legacy") { - ESHandle mTime; - setup.get().get(mTime); - mTimeMap = &*mTime; + mTimeMap = &setup.getData(mTimeMapToken_); } else if (format == "DTRecoConditions") { - ESHandle h_rconds; - setup.get().get(h_rconds); - rconds = &*h_rconds; + rconds = &setup.getData(vDriftToken_); } } else if (dbToDump == "TTrigDB") { if (format == "Legacy") { - ESHandle tTrig; - setup.get().get(dbLabel, tTrig); - tTrigMap = &*tTrig; + tTrigMap = &setup.getData(tTrigMapToken_); } else if (format == "DTRecoConditions") { - ESHandle h_rconds; - setup.get().get(h_rconds); - rconds = &*h_rconds; + rconds = &setup.getData(tTrigToken_); } } else if (dbToDump == "TZeroDB") { - ESHandle t0; - setup.get().get(t0); - tZeroMap = &*t0; + tZeroMap = &setup.getData(t0MapToken_); } else if (dbToDump == "NoiseDB") { - ESHandle status; - setup.get().get(status); - statusMap = &*status; + statusMap = &setup.getData(statusMapToken_); } else if (dbToDump == "DeadDB") { - ESHandle dead; - setup.get().get(dead); - deadMap = &*dead; + deadMap = &setup.getData(deadMapToken_); } else if (dbToDump == "ChannelsDB") { - ESHandle channels; - setup.get().get(channels); - channelsMap = &*channels; + channelsMap = &setup.getData(readOutMapToken_); } else if (dbToDump == "RecoUncertDB") { - if (format == "Legacy") { - ESHandle uncerts; - setup.get().get(uncerts); - uncertMap = &*uncerts; - } else if (format == "DTRecoConditions") { - ESHandle h_rconds; - setup.get().get(h_rconds); - rconds = &*h_rconds; - } + rconds = &setup.getData(uncertToken_); } } @@ -245,7 +227,7 @@ void DumpDBToFile::endJob() { float t0rms; // t0s and rms are TDC counts tZeroMap->get(wireId, t0mean, t0rms, DTTimeUnits::counts); - cout << wireId << " TZero mean (TDC counts): " << t0mean << " TZero RMS (TDC counts): " << t0rms << endl; + // cout << wireId << " TZero mean (TDC counts): " << t0mean << " TZero RMS (TDC counts): " << t0rms << endl; vector consts; consts.push_back(-1); consts.push_back(-1); @@ -302,42 +284,23 @@ void DumpDBToFile::endJob() { //---------- Uncertainties } else if (dbToDump == "RecoUncertDB") { - if (format == "Legacy") { - int version = 1; - int type = 2; // par[step] - cout << "RecoUncertDB version: " << uncertMap->version() << endl; - for (DTRecoUncertainties::const_iterator wireAndUncerts = uncertMap->begin(); - wireAndUncerts != uncertMap->end(); - ++wireAndUncerts) { - DTWireId wireId((*wireAndUncerts).first); - vector values = (*wireAndUncerts).second; - // cout << wireId; - // copy(values.begin(), values.end(), ostream_iterator(cout, " cm, ")); - // cout << endl; - int nfields = values.size(); - vector consts = {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, float(version * 1000 + type * 100 + nfields)}; - consts.insert(consts.end(), values.begin(), values.end()); - theCalibFile->addCell(wireId, consts); - } - } else if (format == "DTRecoConditions") { - int version = rconds->version(); - string expr = rconds->getFormulaExpr(); - int type = 2; // par[step] - if (version != 1 || expr != "par[step]") - throw cms::Exception("Configuration") << "only version 1, type 2 is presently supported for RecoUncertDB"; + int version = rconds->version(); + string expr = rconds->getFormulaExpr(); + int type = 2; // par[step] + if (version != 1 || expr != "par[step]") + throw cms::Exception("Configuration") << "only version 1, type 2 is presently supported for RecoUncertDB"; - cout << "[DumpDBToFile] DTRecoConditions (uncerts) version: " << rconds->version() << " expression: " << expr - << endl; + cout << "[DumpDBToFile] DTRecoConditions (uncerts) version: " << rconds->version() << " expression: " << expr + << endl; - for (DTRecoConditions::const_iterator irc = rconds->begin(); irc != rconds->end(); ++irc) { - DTWireId wireId(irc->first); - const vector& data = irc->second; - int nfields = data.size(); - vector consts(11 + nfields, -1); - consts[10] = float(version * 1000 + type * 100 + nfields); - std::copy(data.begin(), data.end(), consts.begin() + 11); - theCalibFile->addCell(wireId, consts); - } + for (DTRecoConditions::const_iterator irc = rconds->begin(); irc != rconds->end(); ++irc) { + DTWireId wireId(irc->first); + const vector& data = irc->second; + int nfields = data.size(); + vector consts(11 + nfields, -1); + consts[10] = float(version * 1000 + type * 100 + nfields); + std::copy(data.begin(), data.end(), consts.begin() + 11); + theCalibFile->addCell(wireId, consts); } } //Write constants into file diff --git a/CalibMuon/DTCalibration/test/DBTools/DumpDBToFile.h b/CalibMuon/DTCalibration/test/DBTools/DumpDBToFile.h index 21ca867d6a64c..c71f3088c4671 100644 --- a/CalibMuon/DTCalibration/test/DBTools/DumpDBToFile.h +++ b/CalibMuon/DTCalibration/test/DBTools/DumpDBToFile.h @@ -10,44 +10,64 @@ */ #include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/EDAnalyzer.h" +#include "FWCore/Framework/interface/one/EDAnalyzer.h" + +#include "CondFormats/DTObjects/interface/DTMtime.h" +#include "CondFormats/DataRecord/interface/DTMtimeRcd.h" +#include "CondFormats/DTObjects/interface/DTTtrig.h" +#include "CondFormats/DataRecord/interface/DTTtrigRcd.h" +#include "CondFormats/DTObjects/interface/DTT0.h" +#include "CondFormats/DataRecord/interface/DTT0Rcd.h" +#include "CondFormats/DataRecord/interface/DTStatusFlagRcd.h" +#include "CondFormats/DTObjects/interface/DTStatusFlag.h" +#include "CondFormats/DataRecord/interface/DTDeadFlagRcd.h" +#include "CondFormats/DTObjects/interface/DTDeadFlag.h" +#include "CondFormats/DataRecord/interface/DTReadOutMappingRcd.h" +#include "CondFormats/DTObjects/interface/DTReadOutMapping.h" +#include "CondFormats/DTObjects/interface/DTRecoConditions.h" +#include "CondFormats/DataRecord/interface/DTRecoConditionsTtrigRcd.h" +#include "CondFormats/DataRecord/interface/DTRecoConditionsVdriftRcd.h" +#include "CondFormats/DataRecord/interface/DTRecoConditionsUncertRcd.h" #include -class DTMtime; -class DTTtrig; -class DTT0; -class DTStatusFlag; -class DTDeadFlag; class DTCalibrationMap; -class DTReadOutMapping; -class DTRecoUncertainties; -class DTRecoConditions; -class DumpDBToFile : public edm::EDAnalyzer { +class DumpDBToFile : public edm::one::EDAnalyzer { public: /// Constructor DumpDBToFile(const edm::ParameterSet &pset); /// Destructor - virtual ~DumpDBToFile(); + ~DumpDBToFile() override; // Operations - virtual void beginRun(const edm::Run &run, const edm::EventSetup &setup); + void beginRun(const edm::Run &run, const edm::EventSetup &setup) override; + + void endRun(const edm::Run &run, const edm::EventSetup &setup) override {} - virtual void analyze(const edm::Event &event, const edm::EventSetup &setup) {} + void analyze(const edm::Event &event, const edm::EventSetup &setup) override {} - virtual void endJob(); + void endJob() override; protected: private: + edm::ESGetToken mTimeMapToken_; + edm::ESGetToken tTrigMapToken_; + edm::ESGetToken t0MapToken_; + edm::ESGetToken statusMapToken_; + edm::ESGetToken deadMapToken_; + edm::ESGetToken readOutMapToken_; + edm::ESGetToken tTrigToken_; + edm::ESGetToken vDriftToken_; + edm::ESGetToken uncertToken_; + const DTMtime *mTimeMap; const DTTtrig *tTrigMap; const DTT0 *tZeroMap; const DTStatusFlag *statusMap; const DTDeadFlag *deadMap; const DTReadOutMapping *channelsMap; - const DTRecoUncertainties *uncertMap; const DTRecoConditions *rconds; DTCalibrationMap *theCalibFile; diff --git a/CalibMuon/DTCalibration/test/DBTools/DumpFileToDB.cc b/CalibMuon/DTCalibration/test/DBTools/DumpFileToDB.cc index 9a031b469f312..f0bf44d53ab32 100644 --- a/CalibMuon/DTCalibration/test/DBTools/DumpFileToDB.cc +++ b/CalibMuon/DTCalibration/test/DBTools/DumpFileToDB.cc @@ -24,7 +24,6 @@ #include "CondFormats/DTObjects/interface/DTStatusFlag.h" #include "CondFormats/DTObjects/interface/DTDeadFlag.h" #include "CondFormats/DTObjects/interface/DTReadOutMapping.h" -#include "CondFormats/DTObjects/interface/DTRecoUncertainties.h" #include "CondFormats/DTObjects/interface/DTRecoConditions.h" #include "CondFormats/DataRecord/interface/DTRecoConditionsTtrigRcd.h" #include "CondFormats/DataRecord/interface/DTRecoConditionsVdriftRcd.h" @@ -268,43 +267,27 @@ void DumpFileToDB::endJob() { //---------- Uncertainties } else if (dbToDump == "RecoUncertDB") { // Write the Uncertainties - if (format == "Legacy") { - DTRecoUncertainties* uncert = new DTRecoUncertainties(); - int version = 1; // Uniform uncertainties per SL and step; parameters 0-3 are for steps 1-4. - uncert->setVersion(version); - // Loop over file entries - for (DTCalibrationMap::const_iterator keyAndCalibs = theCalibFile->keyAndConsts_begin(); - keyAndCalibs != theCalibFile->keyAndConsts_end(); - ++keyAndCalibs) { - vector values = (*keyAndCalibs).second; - vector uncerts(values.begin() + 11, values.end()); - uncert->set((*keyAndCalibs).first, uncerts); - } - DTCalibDBUtils::writeToDB("DTRecoUncertaintiesRcd", uncert); - - } else if (format == "DTRecoConditions") { - DTRecoConditions* conds = new DTRecoConditions(); - conds->setFormulaExpr("par[step]"); - int version = 1; // Uniform uncertainties per SL and step; parameters 0-3 are for steps 1-4. - conds->setVersion(version); - - for (DTCalibrationMap::const_iterator keyAndCalibs = theCalibFile->keyAndConsts_begin(); - keyAndCalibs != theCalibFile->keyAndConsts_end(); - ++keyAndCalibs) { - vector values = (*keyAndCalibs).second; - int fversion = int(values[10] / 1000); - int type = (int(values[10]) % 1000) / 100; - int nfields = int(values[10]) % 100; - if (type != 2) - throw cms::Exception("IncorrectSetup") << "Only type==2 supported for uncertainties DB"; - if (values.size() != unsigned(nfields + 11)) - throw cms::Exception("IncorrectSetup") << "Inconsistent number of fields"; - if (fversion != version) - throw cms::Exception("IncorrectSetup") << "Inconsistent version of file"; + DTRecoConditions* conds = new DTRecoConditions(); + conds->setFormulaExpr("par[step]"); + int version = 1; // Uniform uncertainties per SL and step; parameters 0-3 are for steps 1-4. + conds->setVersion(version); - vector params(values.begin() + 11, values.begin() + 11 + nfields); - conds->set((*keyAndCalibs).first, params); - } + for (DTCalibrationMap::const_iterator keyAndCalibs = theCalibFile->keyAndConsts_begin(); + keyAndCalibs != theCalibFile->keyAndConsts_end(); + ++keyAndCalibs) { + vector values = (*keyAndCalibs).second; + int fversion = int(values[10] / 1000); + int type = (int(values[10]) % 1000) / 100; + int nfields = int(values[10]) % 100; + if (type != 2) + throw cms::Exception("IncorrectSetup") << "Only type==2 supported for uncertainties DB"; + if (values.size() != unsigned(nfields + 11)) + throw cms::Exception("IncorrectSetup") << "Inconsistent number of fields"; + if (fversion != version) + throw cms::Exception("IncorrectSetup") << "Inconsistent version of file"; + + vector params(values.begin() + 11, values.begin() + 11 + nfields); + conds->set((*keyAndCalibs).first, params); DTCalibDBUtils::writeToDB("DTRecoConditionsUncertRcd", conds); } } diff --git a/CalibMuon/DTCalibration/test/DBTools/DumpFileToDB.h b/CalibMuon/DTCalibration/test/DBTools/DumpFileToDB.h index 82dc157111db3..caf00c5652085 100644 --- a/CalibMuon/DTCalibration/test/DBTools/DumpFileToDB.h +++ b/CalibMuon/DTCalibration/test/DBTools/DumpFileToDB.h @@ -10,7 +10,7 @@ */ #include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/EDAnalyzer.h" +#include "FWCore/Framework/interface/one/EDAnalyzer.h" #include #include @@ -19,21 +19,22 @@ class DTCalibrationMap; class DTTtrig; -class DumpFileToDB : public edm::EDAnalyzer { +class DumpFileToDB : public edm::one::EDAnalyzer { public: /// Constructor DumpFileToDB(const edm::ParameterSet& pset); /// Destructor - virtual ~DumpFileToDB(); + ~DumpFileToDB() override; // Operations - // Operations - virtual void beginRun(const edm::Run& run, const edm::EventSetup& setup); + void beginRun(const edm::Run& run, const edm::EventSetup& setup) override; + + void endRun(const edm::Run& run, const edm::EventSetup& setup) override {} - virtual void analyze(const edm::Event& event, const edm::EventSetup& setup) {} + void analyze(const edm::Event& event, const edm::EventSetup& setup) override {} - virtual void endJob(); + void endJob() override; protected: private: diff --git a/CalibMuon/DTCalibration/test/DumpDBToFile_cfg.py b/CalibMuon/DTCalibration/test/DumpDBToFile_cfg.py index 609564a561761..fa3076bb38774 100644 --- a/CalibMuon/DTCalibration/test/DumpDBToFile_cfg.py +++ b/CalibMuon/DTCalibration/test/DumpDBToFile_cfg.py @@ -14,7 +14,7 @@ 'TTrigDB', #default value VarParsing.VarParsing.multiplicity.singleton, VarParsing.VarParsing.varType.string, - "Database to read: 'TZeroDB', 'TTrigDB', 'VDriftDB', or 'UncertDB'") + "Database to read: 'TZeroDB', 'TTrigDB', 'VDriftDB', 'UncertDB', 'NoiseDB', 'DeadDB', 'ChannelsDB'") options.register('GT', 'auto:run2_data', #default value @@ -58,7 +58,7 @@ print('\nERROR: invalid value for dbformat: ', DBFORMAT,'\n') exit() -if TYPE not in ['TZeroDB', 'TTrigDB', 'VDriftDB', 'UncertDB'] : +if TYPE not in ['TZeroDB', 'TTrigDB', 'VDriftDB', 'UncertDB', 'NoiseDB', 'DeadDB', 'ChannelsDB'] : print('\nERROR: invalid value for type: ', TYPE,'\n') exit() @@ -73,7 +73,10 @@ ofExt = {'TZeroDB' : '_t0.txt', 'TTrigDB' : '_ttrig.txt', 'VDriftDB' : '_vdrift.txt', - 'UncertDB' : '_uncert.txt'} + 'UncertDB' : '_uncert.txt', + 'NoiseDB' : '_noise.txt', + 'DeadDB' : '_dead.txt', + 'ChannelsDB' : '_channels.txt'} if INPUTFILE!="": @@ -94,14 +97,18 @@ if TYPE=="TTrigDB" : RECORD = "DTTtrigRcd" if TYPE=="VDriftDB" : RECORD = "DTMtimeRcd" if TYPE=="UncertDB" : - RECORD = "DTRecoUncertaintiesRcd" - print('\nWARNING, Legacy RecoUncertDB is deprecated, as it is no longer used in reconstruction code') + RECORD = "" + print('\nERROR, Legacy RecoUncertDB is no longer supported') elif DBFORMAT=="DTRecoConditions" : if TYPE=="TTrigDB" : RECORD = "DTRecoConditionsTtrigRcd" if TYPE=="VDriftDB" : RECORD = "DTRecoConditionsVdriftRcd" if TYPE=="UncertDB" : RECORD = "DTRecoConditionsUncertRcd" +if TYPE == 'NoiseDB' : RECORD = 'DTStatusFlagRcd' +elif TYPE == 'DeadDB' : RECORD = 'DTDeadFlagRcd' +elif TYPE == 'ChannelsDB' : RECORD = 'DTReadOutMappingRcd' + process = cms.Process("DumpDBToFile") process.load("CondCore.CondDB.CondDB_cfi") @@ -203,10 +210,47 @@ outputFileName = cms.untracked.string(OUTPUTFILE) ) +process.dumpNoiseToFile = cms.EDAnalyzer("DumpDBToFile", + dbToDump = cms.untracked.string('NoiseDB'), + dbLabel = cms.untracked.string(''), + dbFormat = cms.untracked.string(DBFORMAT), + calibFileConfig = cms.untracked.PSet( + nFields = cms.untracked.int32(8), + calibConstGranularity = cms.untracked.string('byWire') + ), + outputFileName = cms.untracked.string(OUTPUTFILE) +) + +process.dumpDeadToFile = cms.EDAnalyzer("DumpDBToFile", + dbToDump = cms.untracked.string('DeadDB'), + dbLabel = cms.untracked.string(''), + dbFormat = cms.untracked.string(DBFORMAT), + calibFileConfig = cms.untracked.PSet( + nFields = cms.untracked.int32(8), + calibConstGranularity = cms.untracked.string('byWire') + ), + outputFileName = cms.untracked.string(OUTPUTFILE) +) + +process.dumpChannelsToFile = cms.EDAnalyzer("DumpDBToFile", + dbToDump = cms.untracked.string('ChannelsDB'), + dbLabel = cms.untracked.string(''), + dbFormat = cms.untracked.string(DBFORMAT), + calibFileConfig = cms.untracked.PSet( + nFields = cms.untracked.int32(8), + calibConstGranularity = cms.untracked.string('byWire') + ), + outputFileName = cms.untracked.string(OUTPUTFILE) +) + + -if TYPE=="TZeroDB" : process.p2 = cms.Path(process.dumpT0ToFile) -if TYPE=="TTrigDB" : process.p2 = cms.Path(process.dumpTTrigToFile) -if TYPE=="VDriftDB" : process.p2 = cms.Path(process.dumpVdToFile) -if TYPE=="UncertDB": process.p2 = cms.Path(process.dumpUncertToFile) +if TYPE=="TZeroDB" : process.p2 = cms.Path(process.dumpT0ToFile) +elif TYPE=="TTrigDB" : process.p2 = cms.Path(process.dumpTTrigToFile) +elif TYPE=="VDriftDB" : process.p2 = cms.Path(process.dumpVdToFile) +elif TYPE=="UncertDB": process.p2 = cms.Path(process.dumpUncertToFile) +elif TYPE=='NoiseDB' : process.p2 = cms.Path(process.dumpNoiseToFile) +elif TYPE=='DeadDB' : process.p2 = cms.Path(process.dumpDeadToFile) +elif TYPE=='ChannelsDB' : process.p2 = cms.Path(process.dumpChannelsToFile) diff --git a/CalibMuon/DTCalibration/test/DumpFileToDB_cfg.py b/CalibMuon/DTCalibration/test/DumpFileToDB_cfg.py index 6a77188143f28..c1303f43c207f 100644 --- a/CalibMuon/DTCalibration/test/DumpFileToDB_cfg.py +++ b/CalibMuon/DTCalibration/test/DumpFileToDB_cfg.py @@ -74,8 +74,8 @@ if TYPE=="TTrigDB" : RECORD = "DTTtrigRcd" if TYPE=="VDriftDB" : RECORD = "DTMtimeRcd" if TYPE=="UncertDB" : - RECORD = "DTRecoUncertaintiesRcd" - print('\nWARNING, Legacy RecoUncertDB is deprecated, as it is no longer used in reconstruction code') + RECORD = "" + print('\nERROR, Legacy RecoUncertDB is no longer supported') elif DBFORMAT=="DTRecoConditions" : if TYPE=="TTrigDB" : RECORD = "DTRecoConditionsTtrigRcd" if TYPE=="VDriftDB" : RECORD = "DTRecoConditionsVdriftRcd" diff --git a/CalibMuon/DTDigiSync/BuildFile.xml b/CalibMuon/DTDigiSync/BuildFile.xml index 09b5b5ba76949..930081092d6b5 100644 --- a/CalibMuon/DTDigiSync/BuildFile.xml +++ b/CalibMuon/DTDigiSync/BuildFile.xml @@ -1,7 +1,4 @@ - - - - + diff --git a/CalibMuon/DTDigiSync/interface/DTTTrigSyncFactory.h b/CalibMuon/DTDigiSync/interface/DTTTrigSyncFactory.h index d356b2923531c..b7f6caa5898d0 100644 --- a/CalibMuon/DTDigiSync/interface/DTTTrigSyncFactory.h +++ b/CalibMuon/DTDigiSync/interface/DTTTrigSyncFactory.h @@ -8,11 +8,13 @@ * \author G. Cerminara - INFN Torino */ #include "FWCore/PluginManager/interface/PluginFactory.h" +#include "FWCore/Framework/interface/FrameworkfwdMostUsed.h" namespace edm { class ParameterSet; } class DTTTrigBaseSync; -typedef edmplugin::PluginFactory DTTTrigSyncFactory; +typedef edmplugin::PluginFactory + DTTTrigSyncFactory; #endif diff --git a/CalibMuon/DTDigiSync/plugins/BuildFile.xml b/CalibMuon/DTDigiSync/plugins/BuildFile.xml new file mode 100644 index 0000000000000..9baa5d2f83b77 --- /dev/null +++ b/CalibMuon/DTDigiSync/plugins/BuildFile.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/CalibMuon/DTDigiSync/src/DTTTrigSyncFromDB.cc b/CalibMuon/DTDigiSync/plugins/DTTTrigSyncFromDB.cc similarity index 62% rename from CalibMuon/DTDigiSync/src/DTTTrigSyncFromDB.cc rename to CalibMuon/DTDigiSync/plugins/DTTTrigSyncFromDB.cc index 853104ddf2001..807fcd98c4c4f 100644 --- a/CalibMuon/DTDigiSync/src/DTTTrigSyncFromDB.cc +++ b/CalibMuon/DTDigiSync/plugins/DTTTrigSyncFromDB.cc @@ -1,11 +1,42 @@ -/* - * See header file for a description of this class. +/** \class DTTTrigSyncFromDB + * Concrete implementation of a DTTTrigBaseSync. + * This class define the offset for RecHit building + * of data and simulation. + * The offset is computes as: + *
+ * offset = t0 + tTrig + wirePropCorr - tofCorr + *
+ * where:
+ * - t0 from test pulses (taken from DB, it is assumed to be in ns; can be switched off) + * - ttrig from the fit of time boxrising edge (taken from DB, it is assumed to be in ns) + * (At the moment a single value is read for ttrig offset + * but this may change in the future) + * - signal propagation along the wire (can be switched off): + * it is assumed the ttrig accounts on average for + * correction from the center of the wire to the frontend. + * Here we just have to correct for the distance of the hit from the wire center. + * - TOF correction (can be switched off for cosmics): + * the ttrig already accounts for average TOF correction, + * depending on the granularity used for the ttrig computation we just have to correct for the + * TOF from the center of the chamber, SL, layer or wire to the hit position. + * NOTE: particles are assumed as coming from the IP. + * + * The emulatorOffset is computed as: + *
+ * offset = int(ttrig/BXspace)*BXspace + t0 + *
+ * where:
+ * - t0 from test pulses (taken from DB, it is assumed to be in ns; can be switched off) + * - ttrig from the fit of time box rising edge (taken from DB, it is assumed to be in ns) + * - BXspace BX spacing (in ns). Can be configured. + * + * NOTE: this should approximate what is seen online by the BTI * * \author G. Cerminara - INFN Torino */ -#include "DTTTrigSyncFromDB.h" - +#include "CalibMuon/DTDigiSync/interface/DTTTrigBaseSync.h" +#include "FWCore/Framework/interface/ConsumesCollector.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "FWCore/Framework/interface/EventSetup.h" #include "FWCore/Framework/interface/ESHandle.h" @@ -19,11 +50,72 @@ #include +namespace edm { + class ParameterSet; +} + +class DTTTrigSyncFromDB : public DTTTrigBaseSync { +public: + /// Constructor + DTTTrigSyncFromDB(const edm::ParameterSet& config, edm::ConsumesCollector); + + /// Destructor + ~DTTTrigSyncFromDB() override; + + // Operations + + /// Pass the Event Setup to the algo at each event + void setES(const edm::EventSetup& setup) override; + + /// Time (ns) to be subtracted to the digi time, + /// Parameters are the layer and the wireId to which the + /// digi is referred and the estimation of + /// the 3D hit position (globPos) + double offset(const DTLayer* layer, + const DTWireId& wireId, + const GlobalPoint& globPos, + double& tTrig, + double& wirePropCorr, + double& tofCorr) const override; + + /// Time (ns) to be subtracted to the digi time. + /// It does not take into account TOF and signal propagation along the wire + double offset(const DTWireId& wireId) const override; + + /// Time (ns) to be subtracted to the digi time for emulation purposes + /// It does not take into account TOF and signal propagation along the wire + /// It also returns the different contributions separately: + /// - tTrig is the offset (t_trig) + /// - t0cell is the t0 from pulses + double emulatorOffset(const DTWireId& wireId, double& tTrig, double& t0cell) const override; + +private: + edm::ESGetToken t0Token_; + const edm::ESGetToken ttrigToken_; + const DTT0* tZeroMap; + const DTTtrig* tTrigMap; + // Set the verbosity level + const bool debug; + // The velocity of signal propagation along the wire (cm/ns) + double theVPropWire; + // Switch on/off the T0 correction from pulses + bool doT0Correction; + // Switch on/off the TOF correction for particles from IP + bool doTOFCorrection; + int theTOFCorrType; + // Switch on/off the correction for the signal propagation along the wire + bool doWirePropCorrection; + int theWirePropCorrType; + // spacing of BX in ns + double theBXspace; +}; + using namespace std; using namespace edm; -DTTTrigSyncFromDB::DTTTrigSyncFromDB(const ParameterSet& config) - : debug(config.getUntrackedParameter("debug")), +DTTTrigSyncFromDB::DTTTrigSyncFromDB(const ParameterSet& config, edm::ConsumesCollector cc) + : ttrigToken_(cc.esConsumes(edm::ESInputTag("", config.getParameter("tTrigLabel")))), + debug(config.getUntrackedParameter("debug")), // The velocity of signal propagation along the wire (cm/ns) theVPropWire(config.getParameter("vPropWire")), // Switch on/off the T0 correction from pulses @@ -35,27 +127,25 @@ DTTTrigSyncFromDB::DTTTrigSyncFromDB(const ParameterSet& config) doWirePropCorrection(config.getParameter("doWirePropCorrection")), theWirePropCorrType(config.getParameter("wirePropCorrType")), // spacing of BX in ns - theBXspace(config.getUntrackedParameter("bxSpace", 25.)), - thetTrigLabel(config.getParameter("tTrigLabel")), - thet0Label(config.getParameter("t0Label")) {} + theBXspace(config.getUntrackedParameter("bxSpace", 25.)) { + if (doT0Correction) { + t0Token_ = cc.esConsumes(edm::ESInputTag("", config.getParameter("t0Label"))); + } +} DTTTrigSyncFromDB::~DTTTrigSyncFromDB() {} void DTTTrigSyncFromDB::setES(const EventSetup& setup) { if (doT0Correction) { // Get the map of t0 from pulses from the Setup - ESHandle t0Handle; - setup.get().get(thet0Label, t0Handle); - tZeroMap = &*t0Handle; + tZeroMap = &setup.getData(t0Token_); if (debug) { cout << "[DTTTrigSyncFromDB] t0 version: " << tZeroMap->version() << endl; } } // Get the map of ttrig from the Setup - ESHandle ttrigHandle; - setup.get().get(thetTrigLabel, ttrigHandle); - tTrigMap = &*ttrigHandle; + tTrigMap = &setup.getData(ttrigToken_); if (debug) { cout << "[DTTTrigSyncFromDB] ttrig version: " << tTrigMap->version() << endl; } @@ -198,3 +288,8 @@ double DTTTrigSyncFromDB::emulatorOffset(const DTWireId& wireId, double& tTrig, return int(tTrig / theBXspace) * theBXspace + t0cell; } + +#include "FWCore/PluginManager/interface/PluginFactory.h" +#include "CalibMuon/DTDigiSync/interface/DTTTrigSyncFactory.h" + +DEFINE_EDM_PLUGIN(DTTTrigSyncFactory, DTTTrigSyncFromDB, "DTTTrigSyncFromDB"); diff --git a/CalibMuon/DTDigiSync/plugins/DTTTrigSyncT0Only.cc b/CalibMuon/DTDigiSync/plugins/DTTTrigSyncT0Only.cc new file mode 100644 index 0000000000000..ad70418b72bf5 --- /dev/null +++ b/CalibMuon/DTDigiSync/plugins/DTTTrigSyncT0Only.cc @@ -0,0 +1,119 @@ +/** \class DTTTrigSyncT0Only + * Concrete implementation of a DTTTrigBaseSync. + * This plugin reads only the t0 from pulses from the DB. + * + * + * \author G. Cerminara - INFN Torino + */ + +#include "CalibMuon/DTDigiSync/interface/DTTTrigBaseSync.h" +#include "FWCore/Framework/interface/ConsumesCollector.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/Framework/interface/EventSetup.h" +#include "FWCore/Framework/interface/ESHandle.h" +#include "FWCore/MessageLogger/interface/MessageLogger.h" +#include "DataFormats/MuonDetId/interface/DTWireId.h" +#include "CondFormats/DTObjects/interface/DTT0.h" +#include "CondFormats/DataRecord/interface/DTT0Rcd.h" + +#include + +namespace edm { + class ParameterSet; +} + +class DTTTrigSyncT0Only : public DTTTrigBaseSync { +public: + /// Constructor + DTTTrigSyncT0Only(const edm::ParameterSet& config, edm::ConsumesCollector); + + /// Destructor + ~DTTTrigSyncT0Only() override; + + // Operations + + /// Pass the Event Setup to the algo at each event + void setES(const edm::EventSetup& setup) override; + + /// Time (ns) to be subtracted to the digi time, + /// Parameters are the layer and the wireId to which the + /// digi is referred and the estimation of + /// the 3D hit position (globPos) + double offset(const DTLayer* layer, + const DTWireId& wireId, + const GlobalPoint& globPos, + double& tTrig, + double& wirePropCorr, + double& tofCorr) const override; + + double offset(const DTWireId& wireId) const override; + + /// Time (ns) to be subtracted to the digi time for emulation purposes + /// Returns just 0 in this implementation of the plugin + double emulatorOffset(const DTWireId& wireId, double& tTrig, double& t0cell) const override; + +private: + const DTT0* tZeroMap; + edm::ESGetToken t0Token_; + + // Set the verbosity level + const bool debug; +}; + +using namespace std; +using namespace edm; + +DTTTrigSyncT0Only::DTTTrigSyncT0Only(const ParameterSet& config, edm::ConsumesCollector cc) + : t0Token_(cc.esConsumes()), debug(config.getUntrackedParameter("debug")) {} + +DTTTrigSyncT0Only::~DTTTrigSyncT0Only() {} + +void DTTTrigSyncT0Only::setES(const EventSetup& setup) { + tZeroMap = &setup.getData(t0Token_); + + if (debug) { + edm::LogPrint("[DTTTrigSyncT0Only]") << "T0 version: " << tZeroMap->version() << endl; + } +} + +double DTTTrigSyncT0Only::offset(const DTLayer* layer, + const DTWireId& wireId, + const GlobalPoint& globPos, + double& tTrig, + double& wirePropCorr, + double& tofCorr) const { + tTrig = offset(wireId); + wirePropCorr = 0; + tofCorr = 0; + + if (debug) { + edm::LogPrint("[DTTTrigSyncT0Only]") << "Offset (ns): " << tTrig + wirePropCorr - tofCorr << endl + << " various contributions are: " + << endl + //<< " tZero (ns): " << t0 << endl + << " Propagation along wire delay (ns): " << wirePropCorr << endl + << " TOF correction (ns): " << tofCorr << endl + << endl; + } + //The global offset is the sum of various contributions + return tTrig + wirePropCorr - tofCorr; +} + +double DTTTrigSyncT0Only::offset(const DTWireId& wireId) const { + float t0 = 0; + float t0rms = 0; + tZeroMap->get(wireId, t0, t0rms, DTTimeUnits::ns); + + return t0; +} + +double DTTTrigSyncT0Only::emulatorOffset(const DTWireId& wireId, double& tTrig, double& t0cell) const { + tTrig = 0.; + t0cell = 0.; + return 0.; +} + +#include "FWCore/PluginManager/interface/PluginFactory.h" +#include "CalibMuon/DTDigiSync/interface/DTTTrigSyncFactory.h" + +DEFINE_EDM_PLUGIN(DTTTrigSyncFactory, DTTTrigSyncT0Only, "DTTTrigSyncT0Only"); diff --git a/CalibMuon/DTDigiSync/src/DTTTrigSyncTOFCorr.cc b/CalibMuon/DTDigiSync/plugins/DTTTrigSyncTOFCorr.cc similarity index 52% rename from CalibMuon/DTDigiSync/src/DTTTrigSyncTOFCorr.cc rename to CalibMuon/DTDigiSync/plugins/DTTTrigSyncTOFCorr.cc index 7a73f1db92c8a..b1c8430a79710 100644 --- a/CalibMuon/DTDigiSync/src/DTTTrigSyncTOFCorr.cc +++ b/CalibMuon/DTDigiSync/plugins/DTTTrigSyncTOFCorr.cc @@ -1,11 +1,40 @@ -/* - * See header file for a description of this class. +/** \class DTTTrigSyncTOFCorr + * Concrete implementation of a DTTTrigBaseSync. + * This class define the offsets for RecHit building + * coherently to the digitization realized with the + * DTDigiSyncTOFCorr module. + * The offset is computes as:
+ * offset = tTrig + wirePropCorr - tofCorr
+ * where:
+ * - tTrig is a fixed offset defined in tTrig parameter + * (default 500 ns)
+ * - wirePropCorr is the correction for the signal propagation along the wire
+ * - tofCorr is the correction for the TOF of the particle set according to + * tofCorrType parameter:
+ * 0: tofCorrType = TOF from IP to 3D Hit position (globPos)
+ * 1: tofCorrType = TOF correction for distance difference + * between 3D center of the chamber and hit position
+ * 2: tofCorrType = TOF correction for distance difference + * between 3D center of the wire and hit position + * (This mode in available for backward compatibility)
+ * + * The emulatorOffset is computed as: + *
+ * offset = int(ttrig/BXspace)*BXspace + *
+ * where:
+ * - ttrig from the fit of time box rising edge (taken from configuration, it is assumed to be in ns) + * - BXspace BX spacing (in ns). Taken from configuration (default 25ns). + * + * NOTE: this should approximate what is seen online by the BTI + * + * * * \author G. Cerminara - INFN Torino */ -#include "DTTTrigSyncTOFCorr.h" - +#include "CalibMuon/DTDigiSync/interface/DTTTrigBaseSync.h" +#include "FWCore/Framework/interface/ConsumesCollector.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "FWCore/Utilities/interface/Exception.h" #include "Geometry/DTGeometry/interface/DTLayer.h" @@ -13,9 +42,69 @@ #include "DataFormats/MuonDetId/interface/DTWireId.h" #include +class DTTTrigSyncTOFCorr : public DTTTrigBaseSync { +public: + /// Constructor + DTTTrigSyncTOFCorr(const edm::ParameterSet& config, edm::ConsumesCollector); + + /// Destructor + ~DTTTrigSyncTOFCorr() override; + + // Operations + + /// Pass the Event Setup to the algo at each event + void setES(const edm::EventSetup& setup) override {} + + /// Time (ns) to be subtracted to the digi time, + /// Parameters are the layer and the wireId to which the + /// digi is referred and the estimation of + /// the 3D hit position (globPos) + /// It also returns the different contributions separately: + /// - tTrig is the offset (t_trig) + /// - wirePropCorr is the delay for signal propagation along the wire + /// - tofCorr is the correction due to the particle TOF + double offset(const DTLayer* layer, + const DTWireId& wireId, + const GlobalPoint& globPos, + double& tTrig, + double& wirePropCorr, + double& tofCorr) const override; + + double offset(const DTWireId& wireId) const override; + + /// Time (ns) to be subtracted to the digi time for emulation purposes + /// It does not take into account TOF and signal propagation along the wire + /// It also returns the different contributions separately: + /// - tTrig is the offset (t_trig) + /// - t0cell is the t0 from pulses (always 0 in this case) + double emulatorOffset(const DTWireId& wireId, double& tTrig, double& t0cell) const override; + +private: + // The fixed t_trig to be subtracted to digi time (ns) + const double theTTrig; + // Velocity of signal propagation along the wire (cm/ns) + // For the value + // cfr. CMS-IN 2000-021: (2.56+-0.17)x1e8 m/s + // CMS NOTE 2003-17: (0.244) m/ns = 24.4 cm/ns + const double theVPropWire; + + // Select the mode for TOF correction: + // 0: tofCorr = TOF from IP to 3D Hit position (globPos) + // 1: tofCorr = TOF correction for distance difference + // between 3D center of the chamber and hit position + // 2: tofCorr = TOF correction for distance difference + // between 3D center of the wire and hit position + const int theTOFCorrType; + + // Set the verbosity level + const bool debug; + // spacing of BX in ns + double theBXspace; +}; + using namespace std; -DTTTrigSyncTOFCorr::DTTTrigSyncTOFCorr(const edm::ParameterSet& config) +DTTTrigSyncTOFCorr::DTTTrigSyncTOFCorr(const edm::ParameterSet& config, edm::ConsumesCollector) : // The fixed t0 (or t_trig) to be subtracted to digi time (ns) theTTrig(config.getParameter("tTrig")), // FIXME: Default was 500 ns // Velocity of signal propagation along the wire (cm/ns) @@ -112,3 +201,8 @@ double DTTTrigSyncTOFCorr::emulatorOffset(const DTWireId& wireId, double& tTrig, return int(tTrig / theBXspace) * theBXspace; } + +#include "FWCore/PluginManager/interface/PluginFactory.h" +#include "CalibMuon/DTDigiSync/interface/DTTTrigSyncFactory.h" + +DEFINE_EDM_PLUGIN(DTTTrigSyncFactory, DTTTrigSyncTOFCorr, "DTTTrigSyncTOFCorr"); diff --git a/CalibMuon/DTDigiSync/src/DTTTrigSyncFromDB.h b/CalibMuon/DTDigiSync/src/DTTTrigSyncFromDB.h deleted file mode 100644 index aa9728054cb75..0000000000000 --- a/CalibMuon/DTDigiSync/src/DTTTrigSyncFromDB.h +++ /dev/null @@ -1,108 +0,0 @@ -#ifndef RecoLocalMuon_DTTTrigSyncFromDB_H -#define RecoLocalMuon_DTTTrigSyncFromDB_H - -/** \class DTTTrigSyncFromDB - * Concrete implementation of a DTTTrigBaseSync. - * This class define the offset for RecHit building - * of data and simulation. - * The offset is computes as: - *
- * offset = t0 + tTrig + wirePropCorr - tofCorr - *
- * where:
- * - t0 from test pulses (taken from DB, it is assumed to be in ns; can be switched off) - * - ttrig from the fit of time boxrising edge (taken from DB, it is assumed to be in ns) - * (At the moment a single value is read for ttrig offset - * but this may change in the future) - * - signal propagation along the wire (can be switched off): - * it is assumed the ttrig accounts on average for - * correction from the center of the wire to the frontend. - * Here we just have to correct for the distance of the hit from the wire center. - * - TOF correction (can be switched off for cosmics): - * the ttrig already accounts for average TOF correction, - * depending on the granularity used for the ttrig computation we just have to correct for the - * TOF from the center of the chamber, SL, layer or wire to the hit position. - * NOTE: particles are assumed as coming from the IP. - * - * The emulatorOffset is computed as: - *
- * offset = int(ttrig/BXspace)*BXspace + t0 - *
- * where:
- * - t0 from test pulses (taken from DB, it is assumed to be in ns; can be switched off) - * - ttrig from the fit of time box rising edge (taken from DB, it is assumed to be in ns) - * - BXspace BX spacing (in ns). Can be configured. - * - * NOTE: this should approximate what is seen online by the BTI - * - * \author G. Cerminara - INFN Torino - */ - -#include "CalibMuon/DTDigiSync/interface/DTTTrigBaseSync.h" - -class DTLayer; -class DTWireId; -class DTT0; -class DTTtrig; - -namespace edm { - class ParameterSet; -} - -class DTTTrigSyncFromDB : public DTTTrigBaseSync { -public: - /// Constructor - DTTTrigSyncFromDB(const edm::ParameterSet& config); - - /// Destructor - ~DTTTrigSyncFromDB() override; - - // Operations - - /// Pass the Event Setup to the algo at each event - void setES(const edm::EventSetup& setup) override; - - /// Time (ns) to be subtracted to the digi time, - /// Parameters are the layer and the wireId to which the - /// digi is referred and the estimation of - /// the 3D hit position (globPos) - double offset(const DTLayer* layer, - const DTWireId& wireId, - const GlobalPoint& globPos, - double& tTrig, - double& wirePropCorr, - double& tofCorr) const override; - - /// Time (ns) to be subtracted to the digi time. - /// It does not take into account TOF and signal propagation along the wire - double offset(const DTWireId& wireId) const override; - - /// Time (ns) to be subtracted to the digi time for emulation purposes - /// It does not take into account TOF and signal propagation along the wire - /// It also returns the different contributions separately: - /// - tTrig is the offset (t_trig) - /// - t0cell is the t0 from pulses - double emulatorOffset(const DTWireId& wireId, double& tTrig, double& t0cell) const override; - -private: - const DTT0* tZeroMap; - const DTTtrig* tTrigMap; - // Set the verbosity level - const bool debug; - // The velocity of signal propagation along the wire (cm/ns) - double theVPropWire; - // Switch on/off the T0 correction from pulses - bool doT0Correction; - // Switch on/off the TOF correction for particles from IP - bool doTOFCorrection; - int theTOFCorrType; - // Switch on/off the correction for the signal propagation along the wire - bool doWirePropCorrection; - int theWirePropCorrType; - // spacing of BX in ns - double theBXspace; - - std::string thetTrigLabel; - std::string thet0Label; -}; -#endif diff --git a/CalibMuon/DTDigiSync/src/DTTTrigSyncT0Only.cc b/CalibMuon/DTDigiSync/src/DTTTrigSyncT0Only.cc deleted file mode 100644 index e44b97b361da4..0000000000000 --- a/CalibMuon/DTDigiSync/src/DTTTrigSyncT0Only.cc +++ /dev/null @@ -1,70 +0,0 @@ -/* - * See header file for a description of this class. - * - * \author G. Cerminara - INFN Torino - */ - -#include "DTTTrigSyncT0Only.h" - -#include "FWCore/ParameterSet/interface/ParameterSet.h" -#include "FWCore/Framework/interface/EventSetup.h" -#include "FWCore/Framework/interface/ESHandle.h" -#include "DataFormats/MuonDetId/interface/DTWireId.h" -#include "CondFormats/DTObjects/interface/DTT0.h" -#include "CondFormats/DataRecord/interface/DTT0Rcd.h" - -#include - -using namespace std; -using namespace edm; - -DTTTrigSyncT0Only::DTTTrigSyncT0Only(const ParameterSet& config) : debug(config.getUntrackedParameter("debug")) {} - -DTTTrigSyncT0Only::~DTTTrigSyncT0Only() {} - -void DTTTrigSyncT0Only::setES(const EventSetup& setup) { - ESHandle t0; - setup.get().get(t0); - tZeroMap = &*t0; - - if (debug) { - cout << "[DTTTrigSyncT0Only] T0 version: " << t0->version() << endl; - } -} - -double DTTTrigSyncT0Only::offset(const DTLayer* layer, - const DTWireId& wireId, - const GlobalPoint& globPos, - double& tTrig, - double& wirePropCorr, - double& tofCorr) const { - tTrig = offset(wireId); - wirePropCorr = 0; - tofCorr = 0; - - if (debug) { - cout << "[DTTTrigSyncT0Only] Offset (ns): " << tTrig + wirePropCorr - tofCorr << endl - << " various contributions are: " - << endl - //<< " tZero (ns): " << t0 << endl - << " Propagation along wire delay (ns): " << wirePropCorr << endl - << " TOF correction (ns): " << tofCorr << endl - << endl; - } - //The global offset is the sum of various contributions - return tTrig + wirePropCorr - tofCorr; -} - -double DTTTrigSyncT0Only::offset(const DTWireId& wireId) const { - float t0 = 0; - float t0rms = 0; - tZeroMap->get(wireId, t0, t0rms, DTTimeUnits::ns); - - return t0; -} - -double DTTTrigSyncT0Only::emulatorOffset(const DTWireId& wireId, double& tTrig, double& t0cell) const { - tTrig = 0.; - t0cell = 0.; - return 0.; -} diff --git a/CalibMuon/DTDigiSync/src/DTTTrigSyncT0Only.h b/CalibMuon/DTDigiSync/src/DTTTrigSyncT0Only.h deleted file mode 100644 index 54c94be5983ae..0000000000000 --- a/CalibMuon/DTDigiSync/src/DTTTrigSyncT0Only.h +++ /dev/null @@ -1,58 +0,0 @@ -#ifndef RecoLocalMuon_DTTTrigSyncT0Only_H -#define RecoLocalMuon_DTTTrigSyncT0Only_H - -/** \class DTTTrigSyncT0Only - * Concrete implementation of a DTTTrigBaseSync. - * This plugin reads only the t0 from pulses from the DB. - * - * - * \author G. Cerminara - INFN Torino - */ - -#include "CalibMuon/DTDigiSync/interface/DTTTrigBaseSync.h" - -class DTLayer; -class DTWireId; -class DTT0; - -namespace edm { - class ParameterSet; -} - -class DTTTrigSyncT0Only : public DTTTrigBaseSync { -public: - /// Constructor - DTTTrigSyncT0Only(const edm::ParameterSet& config); - - /// Destructor - ~DTTTrigSyncT0Only() override; - - // Operations - - /// Pass the Event Setup to the algo at each event - void setES(const edm::EventSetup& setup) override; - - /// Time (ns) to be subtracted to the digi time, - /// Parameters are the layer and the wireId to which the - /// digi is referred and the estimation of - /// the 3D hit position (globPos) - double offset(const DTLayer* layer, - const DTWireId& wireId, - const GlobalPoint& globPos, - double& tTrig, - double& wirePropCorr, - double& tofCorr) const override; - - double offset(const DTWireId& wireId) const override; - - /// Time (ns) to be subtracted to the digi time for emulation purposes - /// Returns just 0 in this implementation of the plugin - double emulatorOffset(const DTWireId& wireId, double& tTrig, double& t0cell) const override; - -private: - const DTT0* tZeroMap; - - // Set the verbosity level - const bool debug; -}; -#endif diff --git a/CalibMuon/DTDigiSync/src/DTTTrigSyncTOFCorr.h b/CalibMuon/DTDigiSync/src/DTTTrigSyncTOFCorr.h deleted file mode 100644 index 023f4f9b32bcb..0000000000000 --- a/CalibMuon/DTDigiSync/src/DTTTrigSyncTOFCorr.h +++ /dev/null @@ -1,107 +0,0 @@ -#ifndef RecoLocalMuon_DTTTrigSyncTOFCorr_H -#define RecoLocalMuon_DTTTrigSyncTOFCorr_H - -/** \class DTTTrigSyncTOFCorr - * Concrete implementation of a DTTTrigBaseSync. - * This class define the offsets for RecHit building - * coherently to the digitization realized with the - * DTDigiSyncTOFCorr module. - * The offset is computes as:
- * offset = tTrig + wirePropCorr - tofCorr
- * where:
- * - tTrig is a fixed offset defined in tTrig parameter - * (default 500 ns)
- * - wirePropCorr is the correction for the signal propagation along the wire
- * - tofCorr is the correction for the TOF of the particle set according to - * tofCorrType parameter:
- * 0: tofCorrType = TOF from IP to 3D Hit position (globPos)
- * 1: tofCorrType = TOF correction for distance difference - * between 3D center of the chamber and hit position
- * 2: tofCorrType = TOF correction for distance difference - * between 3D center of the wire and hit position - * (This mode in available for backward compatibility)
- * - * The emulatorOffset is computed as: - *
- * offset = int(ttrig/BXspace)*BXspace - *
- * where:
- * - ttrig from the fit of time box rising edge (taken from configuration, it is assumed to be in ns) - * - BXspace BX spacing (in ns). Taken from configuration (default 25ns). - * - * NOTE: this should approximate what is seen online by the BTI - * - * - * - * \author G. Cerminara - INFN Torino - */ - -#include "CalibMuon/DTDigiSync/interface/DTTTrigBaseSync.h" - -class DTLayer; -class DTWireId; - -namespace edm { - class ParameterSet; -} - -class DTTTrigSyncTOFCorr : public DTTTrigBaseSync { -public: - /// Constructor - DTTTrigSyncTOFCorr(const edm::ParameterSet& config); - - /// Destructor - ~DTTTrigSyncTOFCorr() override; - - // Operations - - /// Pass the Event Setup to the algo at each event - void setES(const edm::EventSetup& setup) override {} - - /// Time (ns) to be subtracted to the digi time, - /// Parameters are the layer and the wireId to which the - /// digi is referred and the estimation of - /// the 3D hit position (globPos) - /// It also returns the different contributions separately: - /// - tTrig is the offset (t_trig) - /// - wirePropCorr is the delay for signal propagation along the wire - /// - tofCorr is the correction due to the particle TOF - double offset(const DTLayer* layer, - const DTWireId& wireId, - const GlobalPoint& globPos, - double& tTrig, - double& wirePropCorr, - double& tofCorr) const override; - - double offset(const DTWireId& wireId) const override; - - /// Time (ns) to be subtracted to the digi time for emulation purposes - /// It does not take into account TOF and signal propagation along the wire - /// It also returns the different contributions separately: - /// - tTrig is the offset (t_trig) - /// - t0cell is the t0 from pulses (always 0 in this case) - double emulatorOffset(const DTWireId& wireId, double& tTrig, double& t0cell) const override; - -private: - // The fixed t_trig to be subtracted to digi time (ns) - const double theTTrig; - // Velocity of signal propagation along the wire (cm/ns) - // For the value - // cfr. CMS-IN 2000-021: (2.56+-0.17)x1e8 m/s - // CMS NOTE 2003-17: (0.244) m/ns = 24.4 cm/ns - const double theVPropWire; - - // Select the mode for TOF correction: - // 0: tofCorr = TOF from IP to 3D Hit position (globPos) - // 1: tofCorr = TOF correction for distance difference - // between 3D center of the chamber and hit position - // 2: tofCorr = TOF correction for distance difference - // between 3D center of the wire and hit position - const int theTOFCorrType; - - // Set the verbosity level - const bool debug; - // spacing of BX in ns - double theBXspace; -}; -#endif diff --git a/CalibPPS/AlignmentRelative/src/AlignmentTask.cc b/CalibPPS/AlignmentRelative/src/AlignmentTask.cc index 85dbe488d302e..963105120b4b4 100644 --- a/CalibPPS/AlignmentRelative/src/AlignmentTask.cc +++ b/CalibPPS/AlignmentRelative/src/AlignmentTask.cc @@ -530,9 +530,9 @@ void AlignmentTask::buildEqualMeanUMeanVRotZConstraints(vector +#include +#include +#include +#include + +#include "TF1.h" +#include "TProfile.h" +#include "TFile.h" +#include "TKey.h" +#include "TSystemFile.h" + +//--------------------------------------------------------------------------------------------- + +class PPSAlignmentConfigurationESSource : public edm::ESProducer, public edm::EventSetupRecordIntervalFinder { +public: + PPSAlignmentConfigurationESSource(const edm::ParameterSet& iConfig); + + std::unique_ptr produce(const PPSAlignmentConfigurationRcd&); + static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); + +private: + int fitProfile(TProfile* p, double x_mean, double x_rms, double& sl, double& sl_unc); + TDirectory* findDirectoryWithName(TDirectory* dir, std::string searchName); + std::vector buildVectorFromDirectory( + TDirectory* dir, const PPSAlignmentConfiguration::RPConfig& rpd); + + void setIntervalFor(const edm::eventsetup::EventSetupRecordKey& key, + const edm::IOVSyncValue& iosv, + edm::ValidityInterval& oValidity) override; + + bool debug; + + PPSAlignmentConfiguration::SectorConfig sectorConfig45, sectorConfig56; + + double x_ali_sh_step; + + double y_mode_sys_unc; + double chiSqThreshold; + double y_mode_unc_max_valid; + double y_mode_max_valid; + + unsigned int minRPTracksSize; + unsigned int maxRPTracksSize; + double n_si; + + std::map> matchingReferencePoints; + std::map matchingShiftRanges; + + std::map alignment_x_meth_o_ranges; + unsigned int fitProfileMinBinEntries; + unsigned int fitProfileMinNReasonable; + unsigned int methOGraphMinN; + double methOUncFitRange; + + std::map alignment_x_relative_ranges; + unsigned int nearFarMinEntries; + + std::map alignment_y_ranges; + unsigned int modeGraphMinN; + unsigned int multSelProjYMinEntries; + + PPSAlignmentConfiguration::Binning binning; + + std::vector extraParams; + + std::string label; +}; + +//--------------------------------------------------------------------------------------------- + +PPSAlignmentConfigurationESSource::PPSAlignmentConfigurationESSource(const edm::ParameterSet& iConfig) { + label = iConfig.getParameter("label"); + + debug = iConfig.getParameter("debug"); + TFile* debugFile = nullptr; + if (debug) { + debugFile = new TFile(("debug_producer_" + (label.empty() ? "test" : label) + ".root").c_str(), "recreate"); + } + + sectorConfig45.name_ = "sector 45"; + + sectorConfig45.rp_N_.position_ = "N"; + sectorConfig45.rp_F_.position_ = "F"; + + sectorConfig56.name_ = "sector 56"; + + sectorConfig56.rp_N_.position_ = "N"; + sectorConfig56.rp_F_.position_ = "F"; + + for (std::string sectorName : {"sector_45", "sector_56"}) { + const auto& sps = iConfig.getParameter(sectorName); + PPSAlignmentConfiguration::SectorConfig* sc; + if (sectorName == "sector_45") + sc = §orConfig45; + else + sc = §orConfig56; + + for (std::string rpName : {"rp_N", "rp_F"}) { + const auto& rpps = sps.getParameter(rpName); + PPSAlignmentConfiguration::RPConfig* rc; + if (rpName == "rp_N") + rc = &sc->rp_N_; + else + rc = &sc->rp_F_; + + rc->name_ = rpps.getParameter("name"); + rc->id_ = rpps.getParameter("id"); + + rc->slope_ = rpps.getParameter("slope"); + rc->sh_x_ = rpps.getParameter("sh_x"); + + rc->x_min_fit_mode_ = rpps.getParameter("x_min_fit_mode"); + rc->x_max_fit_mode_ = rpps.getParameter("x_max_fit_mode"); + rc->y_max_fit_mode_ = rpps.getParameter("y_max_fit_mode"); + rc->y_cen_add_ = rpps.getParameter("y_cen_add"); + rc->y_width_mult_ = rpps.getParameter("y_width_mult"); + + rc->x_slice_min_ = rpps.getParameter("x_slice_min"); + rc->x_slice_w_ = rpps.getParameter("x_slice_w"); + rc->x_slice_n_ = std::ceil((rpps.getParameter("x_slice_max") - rc->x_slice_min_) / rc->x_slice_w_); + } + + sc->slope_ = sps.getParameter("slope"); + + sc->cut_h_apply_ = sps.getParameter("cut_h_apply"); + sc->cut_h_a_ = sps.getParameter("cut_h_a"); + sc->cut_h_c_ = sps.getParameter("cut_h_c"); + sc->cut_h_si_ = sps.getParameter("cut_h_si"); + + sc->cut_v_apply_ = sps.getParameter("cut_v_apply"); + sc->cut_v_a_ = sps.getParameter("cut_v_a"); + sc->cut_v_c_ = sps.getParameter("cut_v_c"); + sc->cut_v_si_ = sps.getParameter("cut_v_si"); + } + + std::map rpTags = {{sectorConfig45.rp_F_.id_, "rp_L_F"}, + {sectorConfig45.rp_N_.id_, "rp_L_N"}, + {sectorConfig56.rp_N_.id_, "rp_R_N"}, + {sectorConfig56.rp_F_.id_, "rp_R_F"}}; + + std::map sectorNames = {{sectorConfig45.rp_F_.id_, sectorConfig45.name_}, + {sectorConfig45.rp_N_.id_, sectorConfig45.name_}, + {sectorConfig56.rp_N_.id_, sectorConfig56.name_}, + {sectorConfig56.rp_F_.id_, sectorConfig56.name_}}; + + std::map rpConfigs = { + {sectorConfig45.rp_F_.id_, §orConfig45.rp_F_}, + {sectorConfig45.rp_N_.id_, §orConfig45.rp_N_}, + {sectorConfig56.rp_N_.id_, §orConfig56.rp_N_}, + {sectorConfig56.rp_F_.id_, §orConfig56.rp_F_}}; + + x_ali_sh_step = iConfig.getParameter("x_ali_sh_step"); + + y_mode_sys_unc = iConfig.getParameter("y_mode_sys_unc"); + chiSqThreshold = iConfig.getParameter("chiSqThreshold"); + y_mode_unc_max_valid = iConfig.getParameter("y_mode_unc_max_valid"); + y_mode_max_valid = iConfig.getParameter("y_mode_max_valid"); + + minRPTracksSize = iConfig.getParameter("min_RP_tracks_size"); + maxRPTracksSize = iConfig.getParameter("max_RP_tracks_size"); + n_si = iConfig.getParameter("n_si"); + + const auto& c_axo = iConfig.getParameter("x_alignment_meth_o"); + for (const auto& p : rpTags) { + const auto& ps = c_axo.getParameter(p.second); + alignment_x_meth_o_ranges[p.first] = {ps.getParameter("x_min"), ps.getParameter("x_max")}; + } + fitProfileMinBinEntries = c_axo.getParameter("fit_profile_min_bin_entries"); + fitProfileMinNReasonable = c_axo.getParameter("fit_profile_min_N_reasonable"); + methOGraphMinN = c_axo.getParameter("meth_o_graph_min_N"); + methOUncFitRange = c_axo.getParameter("meth_o_unc_fit_range"); + + const auto& c_m = iConfig.getParameter("matching"); + const auto& referenceDataset = c_m.getParameter("reference_dataset"); + + // constructing vectors with reference data + if (!referenceDataset.empty()) { + TFile* f_ref = TFile::Open(referenceDataset.c_str()); + if (!f_ref->IsOpen()) { + edm::LogWarning("PPS") << "[ESSource] could not find reference dataset file: " << referenceDataset; + } else { + TDirectory* ad_ref = findDirectoryWithName((TDirectory*)f_ref, sectorConfig45.name_); + if (ad_ref == nullptr) { + edm::LogWarning("PPS") << "[ESSource] could not find reference dataset in " << referenceDataset; + } else { + edm::LogInfo("PPS") << "[ESSource] loading reference dataset from " << ad_ref->GetPath(); + + for (const auto& p : rpTags) { + if (debug) + gDirectory = debugFile->mkdir(rpConfigs[p.first]->name_.c_str())->mkdir("fits_ref"); + + auto* d_ref = (TDirectory*)ad_ref->Get( + (sectorNames[p.first] + "/near_far/x slices, " + rpConfigs[p.first]->position_).c_str()); + if (d_ref == nullptr) { + edm::LogWarning("PPS") << "[ESSource] could not load d_ref"; + } else { + matchingReferencePoints[p.first] = buildVectorFromDirectory(d_ref, *rpConfigs[p.first]); + } + } + } + } + delete f_ref; + } + + for (const auto& p : rpTags) { + const auto& ps = c_m.getParameter(p.second); + matchingShiftRanges[p.first] = {ps.getParameter("sh_min"), ps.getParameter("sh_max")}; + } + + const auto& c_axr = iConfig.getParameter("x_alignment_relative"); + for (const auto& p : rpTags) { + if (p.second.back() == 'N') { // only near RPs + const auto& ps = c_axr.getParameter(p.second); + alignment_x_relative_ranges[p.first] = {ps.getParameter("x_min"), ps.getParameter("x_max")}; + } + } + nearFarMinEntries = c_axr.getParameter("near_far_min_entries"); + + const auto& c_ay = iConfig.getParameter("y_alignment"); + for (const auto& p : rpTags) { + const auto& ps = c_ay.getParameter(p.second); + alignment_y_ranges[p.first] = {ps.getParameter("x_min"), ps.getParameter("x_max")}; + } + modeGraphMinN = c_ay.getParameter("mode_graph_min_N"); + multSelProjYMinEntries = c_ay.getParameter("mult_sel_proj_y_min_entries"); + + const auto& bps = iConfig.getParameter("binning"); + binning.bin_size_x_ = bps.getParameter("bin_size_x"); + binning.n_bins_x_ = bps.getParameter("n_bins_x"); + binning.pixel_x_offset_ = bps.getParameter("pixel_x_offset"); + binning.n_bins_y_ = bps.getParameter("n_bins_y"); + binning.y_min_ = bps.getParameter("y_min"); + binning.y_max_ = bps.getParameter("y_max"); + + binning.diffFN_n_bins_x_ = bps.getParameter("diffFN_n_bins_x"); + binning.diffFN_x_min_ = bps.getParameter("diffFN_x_min"); + binning.diffFN_x_max_ = bps.getParameter("diffFN_x_max"); + + binning.slice_n_bins_x_ = bps.getParameter("slice_n_bins_x"); + binning.slice_x_min_ = bps.getParameter("slice_x_min"); + binning.slice_x_max_ = bps.getParameter("slice_x_max"); + binning.slice_n_bins_y_ = bps.getParameter("slice_n_bins_y"); + binning.slice_y_min_ = bps.getParameter("slice_y_min"); + binning.slice_y_max_ = bps.getParameter("slice_y_max"); + + extraParams = iConfig.getParameter>("extra_params"); + + setWhatProduced(this, label); + findingRecord(); + + if (debug) + delete debugFile; +} + +//--------------------------------------------------------------------------------------------- + +std::unique_ptr PPSAlignmentConfigurationESSource::produce( + const PPSAlignmentConfigurationRcd&) { + auto p = std::make_unique(); + + p->setSectorConfig45(sectorConfig45); + p->setSectorConfig56(sectorConfig56); + + p->setX_ali_sh_step(x_ali_sh_step); + + p->setY_mode_sys_unc(y_mode_sys_unc); + p->setChiSqThreshold(chiSqThreshold); + p->setY_mode_unc_max_valid(y_mode_unc_max_valid); + p->setY_mode_max_valid(y_mode_max_valid); + + p->setMinRPTracksSize(minRPTracksSize); + p->setMaxRPTracksSize(maxRPTracksSize); + p->setN_si(n_si); + + p->setMatchingReferencePoints(matchingReferencePoints); + p->setMatchingShiftRanges(matchingShiftRanges); + + p->setAlignment_x_meth_o_ranges(alignment_x_meth_o_ranges); + p->setFitProfileMinBinEntries(fitProfileMinBinEntries); + p->setFitProfileMinNReasonable(fitProfileMinNReasonable); + p->setMethOGraphMinN(methOGraphMinN); + p->setMethOUncFitRange(methOUncFitRange); + + p->setAlignment_x_relative_ranges(alignment_x_relative_ranges); + p->setNearFarMinEntries(nearFarMinEntries); + + p->setAlignment_y_ranges(alignment_y_ranges); + p->setModeGraphMinN(modeGraphMinN); + p->setMultSelProjYMinEntries(multSelProjYMinEntries); + + p->setBinning(binning); + + p->setExtraParams(extraParams); + + edm::LogInfo("PPS") << "\n" + << "[ESSource] " << (label.empty() ? "empty label" : "label = " + label) << ":\n\n" + << (*p); + + return p; +} + +//--------------------------------------------------------------------------------------------- + +// most default values come from 2018 period +void PPSAlignmentConfigurationESSource::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { + edm::ParameterSetDescription desc; + + desc.add("debug", false); + + desc.add("label", ""); + + // sector_45 + { + edm::ParameterSetDescription sector45; + + edm::ParameterSetDescription rp_N; + rp_N.add("name", "L_1_F"); + rp_N.add("id", 3); + + rp_N.add("slope", 0.19); + rp_N.add("sh_x", -3.6); + + rp_N.add("x_min_fit_mode", 2.); + rp_N.add("x_max_fit_mode", 7.0); + rp_N.add("y_max_fit_mode", 7.0); + rp_N.add("y_cen_add", -0.3); + rp_N.add("y_width_mult", 1.1); + + rp_N.add("x_slice_min", 7.); + rp_N.add("x_slice_max", 19.); + rp_N.add("x_slice_w", 0.2); + sector45.add("rp_N", rp_N); + + edm::ParameterSetDescription rp_F; + rp_F.add("name", "L_2_F"); + rp_F.add("id", 23); + + rp_F.add("slope", 0.19); + rp_F.add("sh_x", -42.); + + rp_F.add("x_min_fit_mode", 2.); + rp_F.add("x_max_fit_mode", 7.5); + rp_F.add("y_max_fit_mode", 7.5); + rp_F.add("y_cen_add", -0.3); + rp_F.add("y_width_mult", 1.1); + + rp_F.add("x_slice_min", 46.); + rp_F.add("x_slice_max", 58.); + rp_F.add("x_slice_w", 0.2); + sector45.add("rp_F", rp_F); + + sector45.add("slope", 0.006); + sector45.add("cut_h_apply", true); + sector45.add("cut_h_a", -1.); + sector45.add("cut_h_c", -38.55); + sector45.add("cut_h_si", 0.2); + sector45.add("cut_v_apply", true); + sector45.add("cut_v_a", -1.07); + sector45.add("cut_v_c", 1.63); + sector45.add("cut_v_si", 0.15); + + desc.add("sector_45", sector45); + } + + // sector_56 + { + edm::ParameterSetDescription sector56; + + edm::ParameterSetDescription rp_N; + rp_N.add("name", "R_1_F"); + rp_N.add("id", 103); + + rp_N.add("slope", 0.40); + rp_N.add("sh_x", -2.8); + + rp_N.add("x_min_fit_mode", 2.); + rp_N.add("x_max_fit_mode", 7.4); + rp_N.add("y_max_fit_mode", 7.4); + rp_N.add("y_cen_add", -0.8); + rp_N.add("y_width_mult", 1.0); + + rp_N.add("x_slice_min", 6.); + rp_N.add("x_slice_max", 17.); + rp_N.add("x_slice_w", 0.2); + sector56.add("rp_N", rp_N); + + edm::ParameterSetDescription rp_F; + rp_F.add("name", "R_2_F"); + rp_F.add("id", 123); + + rp_F.add("slope", 0.39); + rp_F.add("sh_x", -41.9); + + rp_F.add("x_min_fit_mode", 2.); + rp_F.add("x_max_fit_mode", 8.0); + rp_F.add("y_max_fit_mode", 8.0); + rp_F.add("y_cen_add", -0.8); + rp_F.add("y_width_mult", 1.0); + + rp_F.add("x_slice_min", 45.); + rp_F.add("x_slice_max", 57.); + rp_F.add("x_slice_w", 0.2); + sector56.add("rp_F", rp_F); + + sector56.add("slope", -0.015); + sector56.add("cut_h_apply", true); + sector56.add("cut_h_a", -1.); + sector56.add("cut_h_c", -39.26); + sector56.add("cut_h_si", 0.2); + sector56.add("cut_v_apply", true); + sector56.add("cut_v_a", -1.07); + sector56.add("cut_v_c", 1.49); + sector56.add("cut_v_si", 0.15); + + desc.add("sector_56", sector56); + } + + desc.add("x_ali_sh_step", 0.01); + + desc.add("y_mode_sys_unc", 0.03); + desc.add("chiSqThreshold", 50.); + desc.add("y_mode_unc_max_valid", 5.); + desc.add("y_mode_max_valid", 20.); + + desc.add("min_RP_tracks_size", 1); + desc.add("max_RP_tracks_size", 1); + desc.add("n_si", 4.); + + // matching + { + edm::ParameterSetDescription matching; + matching.add("reference_dataset", ""); + + edm::ParameterSetDescription rpLF; + rpLF.add("sh_min", -43.); + rpLF.add("sh_max", -41.); + matching.add("rp_L_F", rpLF); + + edm::ParameterSetDescription rpLN; + rpLN.add("sh_min", -4.2); + rpLN.add("sh_max", -2.4); + matching.add("rp_L_N", rpLN); + + edm::ParameterSetDescription rpRN; + rpRN.add("sh_min", -3.6); + rpRN.add("sh_max", -1.8); + matching.add("rp_R_N", rpRN); + + edm::ParameterSetDescription rpRF; + rpRF.add("sh_min", -43.2); + rpRF.add("sh_max", -41.2); + matching.add("rp_R_F", rpRF); + + desc.add("matching", matching); + } + + // x alignment meth o + { + edm::ParameterSetDescription x_alignment_meth_o; + + edm::ParameterSetDescription rpLF; + rpLF.add("x_min", 47.); + rpLF.add("x_max", 56.5); + x_alignment_meth_o.add("rp_L_F", rpLF); + + edm::ParameterSetDescription rpLN; + rpLN.add("x_min", 9.); + rpLN.add("x_max", 18.5); + x_alignment_meth_o.add("rp_L_N", rpLN); + + edm::ParameterSetDescription rpRN; + rpRN.add("x_min", 7.); + rpRN.add("x_max", 15.); + x_alignment_meth_o.add("rp_R_N", rpRN); + + edm::ParameterSetDescription rpRF; + rpRF.add("x_min", 46.); + rpRF.add("x_max", 54.); + x_alignment_meth_o.add("rp_R_F", rpRF); + + x_alignment_meth_o.add("fit_profile_min_bin_entries", 5); + x_alignment_meth_o.add("fit_profile_min_N_reasonable", 10); + x_alignment_meth_o.add("meth_o_graph_min_N", 5); + x_alignment_meth_o.add("meth_o_unc_fit_range", 0.5); + + desc.add("x_alignment_meth_o", x_alignment_meth_o); + } + + // x alignment relative + { + edm::ParameterSetDescription x_alignment_relative; + + edm::ParameterSetDescription rpLN; + rpLN.add("x_min", 7.5); + rpLN.add("x_max", 12.); + x_alignment_relative.add("rp_L_N", rpLN); + + edm::ParameterSetDescription rpRN; + rpRN.add("x_min", 6.); + rpRN.add("x_max", 10.); + x_alignment_relative.add("rp_R_N", rpRN); + + x_alignment_relative.add("near_far_min_entries", 100); + + desc.add("x_alignment_relative", x_alignment_relative); + } + + // y alignment + { + edm::ParameterSetDescription y_alignment; + + edm::ParameterSetDescription rpLF; + rpLF.add("x_min", 44.5); + rpLF.add("x_max", 49.); + y_alignment.add("rp_L_F", rpLF); + + edm::ParameterSetDescription rpLN; + rpLN.add("x_min", 6.7); + rpLN.add("x_max", 11.); + y_alignment.add("rp_L_N", rpLN); + + edm::ParameterSetDescription rpRN; + rpRN.add("x_min", 5.9); + rpRN.add("x_max", 10.); + y_alignment.add("rp_R_N", rpRN); + + edm::ParameterSetDescription rpRF; + rpRF.add("x_min", 44.5); + rpRF.add("x_max", 49.); + y_alignment.add("rp_R_F", rpRF); + + y_alignment.add("mode_graph_min_N", 5); + y_alignment.add("mult_sel_proj_y_min_entries", 300); + + desc.add("y_alignment", y_alignment); + } + + // binning + { + edm::ParameterSetDescription binning; + + binning.add("bin_size_x", 142.3314E-3); + binning.add("n_bins_x", 210); + binning.add("pixel_x_offset", 40.); + binning.add("n_bins_y", 400); + binning.add("y_min", -20.); + binning.add("y_max", 20.); + + binning.add("diffFN_n_bins_x", 100); + binning.add("diffFN_x_min", 0.); + binning.add("diffFN_x_max", 20.); + + binning.add("slice_n_bins_x", 100); + binning.add("slice_x_min", -10.); + binning.add("slice_x_max", 10.); + binning.add("slice_n_bins_y", 100); + binning.add("slice_y_min", -2.); + binning.add("slice_y_max", 2.); + + desc.add("binning", binning); + } + + desc.add>("extra_params", {}); + + descriptions.add("ppsAlignmentConfigurationESSource", desc); +} + +//--------------------------------------------------------------------------------------------- + +// Fits a linear function to a TProfile (similar method in PPSAlignmentHarvester). +int PPSAlignmentConfigurationESSource::fitProfile(TProfile* p, double x_mean, double x_rms, double& sl, double& sl_unc) { + unsigned int n_reasonable = 0; + for (int bi = 1; bi <= p->GetNbinsX(); bi++) { + if (p->GetBinEntries(bi) < fitProfileMinBinEntries) { + p->SetBinContent(bi, 0.); + p->SetBinError(bi, 0.); + } else { + n_reasonable++; + } + } + + if (n_reasonable < fitProfileMinNReasonable) + return 1; + + double x_min = x_mean - x_rms, x_max = x_mean + x_rms; + + TF1* ff_pol1 = new TF1("ff_pol1", "[0] + [1]*x"); + + ff_pol1->SetParameter(0., 0.); + p->Fit(ff_pol1, "Q", "", x_min, x_max); + + sl = ff_pol1->GetParameter(1); + sl_unc = ff_pol1->GetParError(1); + + return 0; +} + +//--------------------------------------------------------------------------------------------- + +// Performs a breadth first search on dir. If found, returns the directory with object +// named searchName inside. Otherwise, returns nullptr. +TDirectory* PPSAlignmentConfigurationESSource::findDirectoryWithName(TDirectory* dir, std::string searchName) { + TIter next(dir->GetListOfKeys()); + std::queue dirQueue; + TObject* o; + while ((o = next())) { + TKey* k = (TKey*)o; + + std::string name = k->GetName(); + if (name == searchName) + return dir; + + if (((TSystemFile*)k)->IsDirectory()) + dirQueue.push((TDirectory*)k->ReadObj()); + } + + while (!dirQueue.empty()) { + TDirectory* resultDir = findDirectoryWithName(dirQueue.front(), searchName); + dirQueue.pop(); + if (resultDir != nullptr) + return resultDir; + } + + return nullptr; +} + +//--------------------------------------------------------------------------------------------- + +// Builds vector of PointErrors instances from slice plots in dir. +std::vector PPSAlignmentConfigurationESSource::buildVectorFromDirectory( + TDirectory* dir, const PPSAlignmentConfiguration::RPConfig& rpd) { + std::vector pv; + + TIter next(dir->GetListOfKeys()); + TObject* o; + while ((o = next())) { + TKey* k = (TKey*)o; + + std::string name = k->GetName(); + size_t d = name.find('-'); + const double x_min = std::stod(name.substr(0, d)); + const double x_max = std::stod(name.substr(d + 1)); + + TDirectory* d_slice = (TDirectory*)k->ReadObj(); + + TH1D* h_y = (TH1D*)d_slice->Get("h_y"); + TProfile* p_y_diffFN_vs_y = (TProfile*)d_slice->Get("p_y_diffFN_vs_y"); + + double y_cen = h_y->GetMean(); + double y_width = h_y->GetRMS(); + + y_cen += rpd.y_cen_add_; + y_width *= rpd.y_width_mult_; + + double sl = 0., sl_unc = 0.; + int fr = fitProfile(p_y_diffFN_vs_y, y_cen, y_width, sl, sl_unc); + if (fr != 0) + continue; + + if (debug) + p_y_diffFN_vs_y->Write(name.c_str()); + + pv.push_back({(x_max + x_min) / 2., sl, (x_max - x_min) / 2., sl_unc}); + } + + return pv; +} + +//--------------------------------------------------------------------------------------------- + +void PPSAlignmentConfigurationESSource::setIntervalFor(const edm::eventsetup::EventSetupRecordKey& key, + const edm::IOVSyncValue& iosv, + edm::ValidityInterval& oValidity) { + edm::LogInfo("PPS") << ">> PPSAlignmentConfigurationESSource::setIntervalFor(" << key.name() << ")\n" + << " run=" << iosv.eventID().run() << ", event=" << iosv.eventID().event(); + + edm::ValidityInterval infinity(iosv.beginOfTime(), iosv.endOfTime()); + oValidity = infinity; +} + +DEFINE_FWK_EVENTSETUP_SOURCE(PPSAlignmentConfigurationESSource); diff --git a/CalibPPS/ESProducers/plugins/PPSAssociationCutsESSource.cc b/CalibPPS/ESProducers/plugins/PPSAssociationCutsESSource.cc new file mode 100644 index 0000000000000..9f7b3d3f4ef37 --- /dev/null +++ b/CalibPPS/ESProducers/plugins/PPSAssociationCutsESSource.cc @@ -0,0 +1,129 @@ +/**************************************************************************** + * Authors: + * Jan Kašpar + * Grzegorz Sroka + ****************************************************************************/ + +#include "FWCore/Framework/interface/MakerMacros.h" +#include "FWCore/Framework/interface/SourceFactory.h" +#include "FWCore/Framework/interface/ModuleFactory.h" + +#include "FWCore/Framework/interface/ESProducer.h" +#include "FWCore/Framework/interface/EventSetupRecordIntervalFinder.h" +#include "FWCore/Framework/interface/ESProducts.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/ParameterSet/interface/ParameterSetDescription.h" +#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" +#include "FWCore/MessageLogger/interface/MessageLogger.h" + +#include "CondFormats/PPSObjects/interface/PPSAssociationCuts.h" +#include "CondFormats/DataRecord/interface/PPSAssociationCutsRcd.h" +#include + +using namespace std; + +class PPSAssociationCutsESSource : public edm::ESProducer, public edm::EventSetupRecordIntervalFinder { +public: + PPSAssociationCutsESSource(const edm::ParameterSet &); + + ~PPSAssociationCutsESSource() override = default; + + std::shared_ptr produce(const PPSAssociationCutsRcd &); + + static void fillDescriptions(edm::ConfigurationDescriptions &); + +protected: + void setIntervalFor(const edm::eventsetup::EventSetupRecordKey &, + const edm::IOVSyncValue &, + edm::ValidityInterval &) override; + +private: + static edm::ParameterSetDescription getIOVDefaultParameters(); + bool currentAssociationCutValid_; + unsigned int currentAssociationCutIdx_; + std::vector> ppsAssociationCuts_; + std::vector validityRanges_; +}; + +//---------------------------------------------------------------------------------------------------- + +PPSAssociationCutsESSource::PPSAssociationCutsESSource(const edm::ParameterSet &iConfig) { + for (const auto &interval : iConfig.getParameter>("configuration")) { + ppsAssociationCuts_.push_back(make_shared(interval)); + validityRanges_.push_back(interval.getParameter("validityRange")); + } + + setWhatProduced(this); + findingRecord(); +} + +//---------------------------------------------------------------------------------------------------- + +void PPSAssociationCutsESSource::setIntervalFor(const edm::eventsetup::EventSetupRecordKey &key, + const edm::IOVSyncValue &iosv, + edm::ValidityInterval &oValidity) { + for (unsigned int idx = 0; idx < ppsAssociationCuts_.size(); ++idx) { + // is within an entry ? + if (edm::contains(validityRanges_[idx], iosv.eventID())) { + currentAssociationCutValid_ = true; + currentAssociationCutIdx_ = idx; + oValidity = edm::ValidityInterval(edm::IOVSyncValue(validityRanges_[idx].startEventID()), + edm::IOVSyncValue(validityRanges_[idx].endEventID())); + return; + } + } + + currentAssociationCutValid_ = false; + currentAssociationCutIdx_ = 0; + + edm::LogInfo("PPSAssociationCutsESSource") + << ">> PPSAssociationCutsESSource::setIntervalFor(" << key.name() << ")\n" + << " run=" << iosv.eventID().run() << ", event=" << iosv.eventID().event(); + + const edm::EventID start(iosv.eventID().run(), iosv.eventID().luminosityBlock(), iosv.eventID().event()); + const edm::EventID end(iosv.eventID().run(), iosv.eventID().luminosityBlock(), iosv.eventID().event()); + oValidity = edm::ValidityInterval(edm::IOVSyncValue(start), edm::IOVSyncValue(end)); +} + +//---------------------------------------------------------------------------------------------------- + +std::shared_ptr PPSAssociationCutsESSource::produce(const PPSAssociationCutsRcd &) { + auto output = std::make_shared(); + + if (currentAssociationCutValid_) { + const auto &associationCut = ppsAssociationCuts_[currentAssociationCutIdx_]; + output = associationCut; + } + + return output; +} + +//---------------------------------------------------------------------------------------------------- + +void PPSAssociationCutsESSource::fillDescriptions(edm::ConfigurationDescriptions &descriptions) { + edm::ParameterSetDescription desc; + desc.add("ppsAssociationCutsLabel", ""); + + edm::ParameterSetDescription validator = PPSAssociationCutsESSource::getIOVDefaultParameters(); + + std::vector vDefaults; + desc.addVPSet("configuration", validator, vDefaults); + + descriptions.add("ppsAssociationCutsESSource", desc); +} + +edm::ParameterSetDescription PPSAssociationCutsESSource::getIOVDefaultParameters() { + edm::ParameterSetDescription desc; + desc.add("validityRange", edm::EventRange())->setComment("interval of validity"); + + for (const std::string §or : {"45", "56"}) { + desc.add("association_cuts_" + sector, PPSAssociationCuts::getDefaultParameters()) + ->setComment("track-association cuts for sector " + sector); + } + + return desc; +} + +//---------------------------------------------------------------------------------------------------- + +DEFINE_FWK_EVENTSETUP_SOURCE(PPSAssociationCutsESSource); \ No newline at end of file diff --git a/CalibPPS/ESProducers/plugins/PPSPixelTopologyESSource.cc b/CalibPPS/ESProducers/plugins/PPSPixelTopologyESSource.cc index 034065c1caef0..00a98f1279cc0 100644 --- a/CalibPPS/ESProducers/plugins/PPSPixelTopologyESSource.cc +++ b/CalibPPS/ESProducers/plugins/PPSPixelTopologyESSource.cc @@ -24,6 +24,7 @@ #include "CondFormats/PPSObjects/interface/PPSPixelTopology.h" #include "CondFormats/DataRecord/interface/PPSPixelTopologyRcd.h" +#include "FWCore/Utilities/interface/Exception.h" #include @@ -82,6 +83,11 @@ PPSPixelTopologyESSource::PPSPixelTopologyESSource(const edm::ParameterSet& iCon active_edge_sigma_(0.), phys_active_edge_dist_(0.) { setPPSPixelTopology(iConfig); + + // validate input + if (runType_ != "Run2" && runType_ != "Run3") + throw cms::Exception("PPS") << runType_ << " is not valid runType."; + setWhatProduced(this); findingRecord(); } diff --git a/CalibPPS/ESProducers/python/ctppsOpticalFunctions_non_DB_cff.py b/CalibPPS/ESProducers/python/ctppsOpticalFunctions_non_DB_cff.py new file mode 100644 index 0000000000000..b8683b5675ea4 --- /dev/null +++ b/CalibPPS/ESProducers/python/ctppsOpticalFunctions_non_DB_cff.py @@ -0,0 +1,142 @@ +import FWCore.ParameterSet.Config as cms + +from CalibPPS.ESProducers.ctppsLHCInfo_cff import * + +# (source) optical functions sampled at few xangles +from CalibPPS.ESProducers.ctppsOpticalFunctionsESSource_cfi import * + +optics_2016_preTS2 = cms.PSet( + validityRange = cms.EventRange("273725:min - 280385:max"), + + opticalFunctions = cms.VPSet( + cms.PSet( xangle = cms.double(185), fileName = cms.FileInPath("CalibPPS/ESProducers/data/optical_functions/2016_preTS2/version2/185urad.root") ) + ), + + scoringPlanes = cms.VPSet( + # z in cm + cms.PSet( rpId = cms.uint32(0x76100000), dirName = cms.string("XRPH_C6L5_B2"), z = cms.double(-20382.7) ), # RP 002, strip + cms.PSet( rpId = cms.uint32(0x76180000), dirName = cms.string("XRPH_D6L5_B2"), z = cms.double(-21255.0) ), # RP 003, strip + + cms.PSet( rpId = cms.uint32(0x77100000), dirName = cms.string("XRPH_C6R5_B1"), z = cms.double(+20382.7) ), # RP 102, strip + cms.PSet( rpId = cms.uint32(0x77180000), dirName = cms.string("XRPH_D6R5_B1"), z = cms.double(+21255.0) ), # RP 103, strip + ) +) + +ctppsOpticalFunctionsESSource.configuration.append(optics_2016_preTS2) + +optics_2016_postTS2 = cms.PSet( + validityRange = cms.EventRange("282730:min - 284044:max"), + + opticalFunctions = cms.VPSet( + cms.PSet( xangle = cms.double(140), fileName = cms.FileInPath("CalibPPS/ESProducers/data/optical_functions/2016_postTS2/version2/140urad.root") ) + ), + + scoringPlanes = cms.VPSet( + # z in cm + cms.PSet( rpId = cms.uint32(0x76100000), dirName = cms.string("XRPH_C6L5_B2"), z = cms.double(-20382.7) ), # RP 002, strip + cms.PSet( rpId = cms.uint32(0x76180000), dirName = cms.string("XRPH_D6L5_B2"), z = cms.double(-21255.0) ), # RP 003, strip + + cms.PSet( rpId = cms.uint32(0x77100000), dirName = cms.string("XRPH_C6R5_B1"), z = cms.double(+20382.7) ), # RP 102, strip + cms.PSet( rpId = cms.uint32(0x77180000), dirName = cms.string("XRPH_D6R5_B1"), z = cms.double(+21255.0) ), # RP 103, strip + ) +) + +ctppsOpticalFunctionsESSource.configuration.append(optics_2016_postTS2) + +optics_2017 = cms.PSet( + validityRange = cms.EventRange("297046:min - 307082:max"), + + opticalFunctions = cms.VPSet( + cms.PSet( xangle = cms.double(120), fileName = cms.FileInPath("CalibPPS/ESProducers/data/optical_functions/2017/version5tim/120urad.root") ), + cms.PSet( xangle = cms.double(130), fileName = cms.FileInPath("CalibPPS/ESProducers/data/optical_functions/2017/version5tim/130urad.root") ), + cms.PSet( xangle = cms.double(140), fileName = cms.FileInPath("CalibPPS/ESProducers/data/optical_functions/2017/version5tim/140urad.root") ) + ), + + scoringPlanes = cms.VPSet( + # z in cm + cms.PSet( rpId = cms.uint32(0x76180000), dirName = cms.string("XRPH_D6L5_B2"), z = cms.double(-21255.0) ), # RP 003, strip + cms.PSet( rpId = cms.uint32(2054160384), dirName = cms.string("XRPH_E6L5_B2"), z = cms.double(-21570.0) ), # RP 016, diamond + cms.PSet( rpId = cms.uint32(2023227392), dirName = cms.string("XRPH_B6L5_B2"), z = cms.double(-21955.0) ), # RP 023, pixel + + cms.PSet( rpId = cms.uint32(0x77180000), dirName = cms.string("XRPH_D6R5_B1"), z = cms.double(+21255.0) ), # RP 103, strip + cms.PSet( rpId = cms.uint32(2070937600), dirName = cms.string("XRPH_E6R5_B1"), z = cms.double(+21570.0) ), # RP 116, diamond + cms.PSet( rpId = cms.uint32(2040004608), dirName = cms.string("XRPH_B6R5_B1"), z = cms.double(+21955.0) ), # RP 123, pixel + ) +) + +ctppsOpticalFunctionsESSource.configuration.append(optics_2017) + +optics_2018 = cms.PSet( + validityRange = cms.EventRange("314747:min - 325175:max"), + + opticalFunctions = cms.VPSet( + cms.PSet( xangle = cms.double(120), fileName = cms.FileInPath("CalibPPS/ESProducers/data/optical_functions/2018/version6/120urad.root") ), + cms.PSet( xangle = cms.double(130), fileName = cms.FileInPath("CalibPPS/ESProducers/data/optical_functions/2018/version6/130urad.root") ), + cms.PSet( xangle = cms.double(140), fileName = cms.FileInPath("CalibPPS/ESProducers/data/optical_functions/2018/version6/140urad.root") ) + ), + + scoringPlanes = cms.VPSet( + # z in cm + cms.PSet( rpId = cms.uint32(2014838784), dirName = cms.string("XRPH_D6L5_B2"), z = cms.double(-21255.0) ), # RP 003, pixel + cms.PSet( rpId = cms.uint32(2054160384), dirName = cms.string("XRPH_E6L5_B2"), z = cms.double(-21570.0) ), # RP 016, diamond + cms.PSet( rpId = cms.uint32(2023227392), dirName = cms.string("XRPH_B6L5_B2"), z = cms.double(-21955.0) ), # RP 023, pixel + + cms.PSet( rpId = cms.uint32(2031616000), dirName = cms.string("XRPH_D6R5_B1"), z = cms.double(+21255.0) ), # RP 103, pixel + cms.PSet( rpId = cms.uint32(2070937600), dirName = cms.string("XRPH_E6R5_B1"), z = cms.double(+21570.0) ), # RP 116, diamond + cms.PSet( rpId = cms.uint32(2040004608), dirName = cms.string("XRPH_B6R5_B1"), z = cms.double(+21955.0) ), # RP 123, pixel + ) +) + +ctppsOpticalFunctionsESSource.configuration.append(optics_2018) + +optics_2021 = cms.PSet( + validityRange = cms.EventRange("1234:1 - 1234:max"), # NB: a fake IOV, this optics was never used for LHC + + opticalFunctions = cms.VPSet( + cms.PSet( xangle = cms.double(110.444), fileName = cms.FileInPath("CalibPPS/ESProducers/data/optical_functions/2021/version_pre3/110.444urad.root") ), + cms.PSet( xangle = cms.double(184.017), fileName = cms.FileInPath("CalibPPS/ESProducers/data/optical_functions/2021/version_pre3/184.017urad.root") ) + ), + + scoringPlanes = cms.VPSet( + # z in cm + cms.PSet( rpId = cms.uint32(2014838784), dirName = cms.string("XRPH_D6L5_B2"), z = cms.double(-21255.0) ), # RP 003, pixel + cms.PSet( rpId = cms.uint32(2056257536), dirName = cms.string("XRPH_A6L5_B2"), z = cms.double(-21507.8) ), # RP 022, diamond + cms.PSet( rpId = cms.uint32(2054160384), dirName = cms.string("XRPH_E6L5_B2"), z = cms.double(-21570.0) ), # RP 016, diamond + cms.PSet( rpId = cms.uint32(2023227392), dirName = cms.string("XRPH_B6L5_B2"), z = cms.double(-21955.0) ), # RP 023, pixel + + cms.PSet( rpId = cms.uint32(2031616000), dirName = cms.string("XRPH_D6R5_B1"), z = cms.double(+21255.0) ), # RP 103, pixel + cms.PSet( rpId = cms.uint32(2073034752), dirName = cms.string("XRPH_A6R5_B1"), z = cms.double(+21507.8) ), # RP 122, diamond + cms.PSet( rpId = cms.uint32(2070937600), dirName = cms.string("XRPH_E6R5_B1"), z = cms.double(+21570.0) ), # RP 116, diamond + cms.PSet( rpId = cms.uint32(2040004608), dirName = cms.string("XRPH_B6R5_B1"), z = cms.double(+21955.0) ), # RP 123, pixel + ) +) + +# NB: do not append the 2021 config - not used for any LHC data + +optics_2022 = cms.PSet( + validityRange = cms.EventRange("343890:min - 999999:max"), + + opticalFunctions = cms.VPSet( + cms.PSet( xangle = cms.double(144.974), fileName = cms.FileInPath("CalibPPS/ESProducers/data/optical_functions/2022/version_pre1/144.974urad.root") ), + cms.PSet( xangle = cms.double(160.000), fileName = cms.FileInPath("CalibPPS/ESProducers/data/optical_functions/2022/version_pre1/160.000urad.root") ) + ), + + scoringPlanes = cms.VPSet( + # z in cm + cms.PSet( rpId = cms.uint32(2014838784), dirName = cms.string("XRPH_D6L5_B2"), z = cms.double(-21255.0) ), # RP 003, pixel + cms.PSet( rpId = cms.uint32(2056257536), dirName = cms.string("XRPH_A6L5_B2"), z = cms.double(-21507.8) ), # RP 022, diamond + cms.PSet( rpId = cms.uint32(2054160384), dirName = cms.string("XRPH_E6L5_B2"), z = cms.double(-21570.0) ), # RP 016, diamond + cms.PSet( rpId = cms.uint32(2023227392), dirName = cms.string("XRPH_B6L5_B2"), z = cms.double(-21955.0) ), # RP 023, pixel + + cms.PSet( rpId = cms.uint32(2031616000), dirName = cms.string("XRPH_D6R5_B1"), z = cms.double(+21255.0) ), # RP 103, pixel + cms.PSet( rpId = cms.uint32(2073034752), dirName = cms.string("XRPH_A6R5_B1"), z = cms.double(+21507.8) ), # RP 122, diamond + cms.PSet( rpId = cms.uint32(2070937600), dirName = cms.string("XRPH_E6R5_B1"), z = cms.double(+21570.0) ), # RP 116, diamond + cms.PSet( rpId = cms.uint32(2040004608), dirName = cms.string("XRPH_B6R5_B1"), z = cms.double(+21955.0) ), # RP 123, pixel + ) +) + +ctppsOpticalFunctionsESSource.configuration.append(optics_2022) + +# optics interpolation between crossing angles +from CalibPPS.ESProducers.ctppsInterpolatedOpticalFunctionsESSource_cfi import * +ctppsInterpolatedOpticalFunctionsESSource.lhcInfoLabel = ctppsLHCInfoLabel diff --git a/CalibPPS/ESProducers/python/ppsAssociationCuts_non_DB_cff.py b/CalibPPS/ESProducers/python/ppsAssociationCuts_non_DB_cff.py new file mode 100644 index 0000000000000..145a1de631460 --- /dev/null +++ b/CalibPPS/ESProducers/python/ppsAssociationCuts_non_DB_cff.py @@ -0,0 +1,118 @@ +import FWCore.ParameterSet.Config as cms + +from CalibPPS.ESProducers.ppsAssociationCutsESSource_cfi import * + +p2016 = cms.PSet( + validityRange=cms.EventRange("273725:min - 284044:max"), + association_cuts_45=cms.PSet( + xi_cut_mean =cms.string("0."), + xi_cut_threshold=cms.string("0.010"), + + ti_tr_min=cms.double(-1.5), + ti_tr_max=cms.double(2.0) + ), + association_cuts_56=cms.PSet( + xi_cut_mean= cms.string("0."), + xi_cut_threshold=cms.string("0.015"), + + ti_tr_min=cms.double(-1.5), + ti_tr_max=cms.double(2.0) + ), +) +ppsAssociationCutsESSource.configuration.append(p2016) + +p2017 = cms.PSet( + validityRange=cms.EventRange("297046:min - 307082:max"), + association_cuts_45=cms.PSet( + xi_cut_mean=cms.string("+6.0695e-5"), + xi_cut_threshold=cms.string("5. * 0.00121"), + ti_tr_min=cms.double(-1.5), + ti_tr_max=cms.double(2.0) + ), + association_cuts_56=cms.PSet( + y_cut_mean=cms.string("-0.022612"), + y_cut_threshold=cms.string("5. * 0.14777"), + xi_cut_mean=cms.string("+8.012857e-5"), + xi_cut_threshold=cms.string("5. * 0.0020627"), + ti_tr_min=cms.double(-1.5), + ti_tr_max=cms.double(2.0) + ), +) +ppsAssociationCutsESSource.configuration.append(p2017) + +p2018 = cms.PSet( + validityRange=cms.EventRange("314747:min - 325175:max"), + association_cuts_45=cms.PSet( + x_cut_mean=cms.string("-0.065194856"), + x_cut_threshold=cms.string("4. * 0.16008188"), + y_cut_mean=cms.string("+0.10973631"), + y_cut_threshold=cms.string("4. * 0.1407986"), + xi_cut_mean=cms.string("+3.113062e-5"), + xi_cut_threshold=cms.string("4. * 0.0012403586"), + ti_tr_min=cms.double(-1.5), + ti_tr_max=cms.double(2.0) + ), + association_cuts_56=cms.PSet( + x_cut_mean=cms.string("+0.073016431"), + x_cut_threshold=cms.string("5. * 0.18126434"), + y_cut_mean=cms.string("+0.064261029"), + y_cut_threshold=cms.string("5. * 0.14990802"), + xi_cut_mean=cms.string("-1.1852528e-5"), + xi_cut_threshold=cms.string("5. * 0.002046409"), + ti_tr_min=cms.double(-1.5), + ti_tr_max=cms.double(2.0) + ), +) +ppsAssociationCutsESSource.configuration.append(p2018) + +p2021 = cms.PSet( + validityRange=cms.EventRange("1234:1 - 1234:max"), # NB: a fake IOV, there are no LHC data from 2021 - keep it just for MC + association_cuts_45=cms.PSet( + x_cut_mean = cms.string("- ( (-0.530895+0.112595*[x_near]+-0.006785*[x_near]*[x_near]) - (0.046487+0.179333/[x_near])*abs([y_near]) )"), + x_cut_threshold = cms.string("4 * ( (0.091692+0.009316*[x_near]) + (-0.000727)*[y_near]*[y_near] )"), + y_cut_mean = cms.string("- ( (0.672525+-0.619398/[x_near])*TMath::Erf([y_near]/(0.968499+0.597136*[x_near])) )"), + y_cut_threshold = cms.string("4 * ( (0.015202+0.962944/[x_near]/[x_near]) + (0.009804+-7.710241/pow([x_near],5))*abs([y_near]) )"), + + ti_tr_min=cms.double(-1.5), + ti_tr_max=cms.double(2.0) + ), + association_cuts_56=cms.PSet( + x_cut_mean = cms.string("- ( (-0.530895+0.112595*[x_near]+-0.006785*[x_near]*[x_near]) - (0.046487+0.179333/[x_near])*abs([y_near]) )"), + x_cut_threshold = cms.string("4 * ( (0.091692+0.009316*[x_near]) + (-0.000727)*[y_near]*[y_near] )"), + y_cut_mean = cms.string("- ( (0.672525+-0.619398/[x_near])*TMath::Erf([y_near]/(0.968499+0.597136*[x_near])) )"), + y_cut_threshold = cms.string("4 * ( (0.015202+0.962944/[x_near]/[x_near]) + (0.009804+-7.710241/pow([x_near],5))*abs([y_near]) )"), + + ti_tr_min=cms.double(-1.5), + ti_tr_max=cms.double(2.0) + ), +) + +# NB: do not append the 2021 config - not used for any LHC data + +p2022 = cms.PSet( + validityRange=cms.EventRange("343890:min - 999999:max"), + association_cuts_45=cms.PSet( + x_cut_mean = cms.string("- ( (-0.530895+0.112595*[x_near]+-0.006785*[x_near]*[x_near]) - (0.046487+0.179333/[x_near])*abs([y_near]) )"), + x_cut_threshold = cms.string("4 * ( (0.091692+0.009316*[x_near]) + (-0.000727)*[y_near]*[y_near] )"), + y_cut_mean = cms.string("- ( (0.672525+-0.619398/[x_near])*TMath::Erf([y_near]/(0.968499+0.597136*[x_near])) )"), + y_cut_threshold = cms.string("4 * ( (0.015202+0.962944/[x_near]/[x_near]) + (0.009804+-7.710241/pow([x_near],5))*abs([y_near]) )"), + + ti_tr_min=cms.double(-1.5), + ti_tr_max=cms.double(2.0) + ), + association_cuts_56=cms.PSet( + x_cut_mean = cms.string("- ( (-0.530895+0.112595*[x_near]+-0.006785*[x_near]*[x_near]) - (0.046487+0.179333/[x_near])*abs([y_near]) )"), + x_cut_threshold = cms.string("4 * ( (0.091692+0.009316*[x_near]) + (-0.000727)*[y_near]*[y_near] )"), + y_cut_mean = cms.string("- ( (0.672525+-0.619398/[x_near])*TMath::Erf([y_near]/(0.968499+0.597136*[x_near])) )"), + y_cut_threshold = cms.string("4 * ( (0.015202+0.962944/[x_near]/[x_near]) + (0.009804+-7.710241/pow([x_near],5))*abs([y_near]) )"), + + ti_tr_min=cms.double(-1.5), + ti_tr_max=cms.double(2.0) + ), +) +ppsAssociationCutsESSource.configuration.append(p2022) + +def use_single_infinite_iov_entry(ppsAssociationCutsESSource, iov): + ppsAssociationCutsESSource.configuration = cms.VPSet() + iov.validityRange = cms.EventRange("0:min - 999999:max") + ppsAssociationCutsESSource.configuration.append(iov) diff --git a/CalibPPS/TimingCalibration/plugins/BuildFile.xml b/CalibPPS/TimingCalibration/plugins/BuildFile.xml index b67b7d23683d5..83f19f4dc0ff3 100644 --- a/CalibPPS/TimingCalibration/plugins/BuildFile.xml +++ b/CalibPPS/TimingCalibration/plugins/BuildFile.xml @@ -6,4 +6,5 @@ +
diff --git a/CalibPPS/TimingCalibration/plugins/PPSDiamondSampicTimingCalibrationPCLHarvester.cc b/CalibPPS/TimingCalibration/plugins/PPSDiamondSampicTimingCalibrationPCLHarvester.cc new file mode 100644 index 0000000000000..ed66659cc760a --- /dev/null +++ b/CalibPPS/TimingCalibration/plugins/PPSDiamondSampicTimingCalibrationPCLHarvester.cc @@ -0,0 +1,290 @@ +// -*- C++ -*- +// +// Package: CalibPPS/TimingCalibration/PPSDiamondSampicTimingCalibrationPCLHarvester +// Class: PPSDiamondSampicTimingCalibrationPCLHarvester +// +/**\class PPSDiamondSampicTimingCalibrationPCLHarvester PPSDiamondSampicTimingCalibrationPCLHarvester.cc CalibPPS/TimingCalibration/PPSDiamondSampicTimingCalibrationPCLHarvester/plugins/PPSDiamondSampicTimingCalibrationPCLHarvester.cc + + Description: Harvester of the DiamondSampic calibration which produces sqlite file with a new channel alignment + + Implementation: + [Notes on implementation] +*/ +// +// Original Author: Christopher Misan +// Created: Mon, 26 Jul 2021 16:36:13 GMT +// +// +#include "TAxis.h" +#include "TH1.h" +#include "TArrayD.h" +#include "DQMServices/Core/interface/DQMEDHarvester.h" + +#include "FWCore/Framework/interface/Frameworkfwd.h" +#include "FWCore/Framework/interface/MakerMacros.h" +#include "FWCore/Framework/interface/ESHandle.h" +#include "FWCore/Framework/interface/EventSetup.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/ServiceRegistry/interface/Service.h" + +#include +#include + +#include "Geometry/VeryForwardGeometryBuilder/interface/CTPPSGeometry.h" +#include "Geometry/Records/interface/VeryForwardRealGeometryRecord.h" + +#include "CalibPPS/TimingCalibration/interface/TimingCalibrationStruct.h" +#include "CondCore/DBOutputService/interface/PoolDBOutputService.h" + +#include "DataFormats/CTPPSDetId/interface/CTPPSDiamondDetId.h" +#include "CondFormats/PPSObjects/interface/PPSTimingCalibration.h" +#include "CondFormats/DataRecord/interface/PPSTimingCalibrationRcd.h" + +namespace pt = boost::property_tree; + +class PPSDiamondSampicTimingCalibrationPCLHarvester : public DQMEDHarvester { +public: + PPSDiamondSampicTimingCalibrationPCLHarvester(const edm::ParameterSet&); + void beginRun(const edm::Run&, const edm::EventSetup&) override; + static void fillDescriptions(edm::ConfigurationDescriptions&); + +private: + void dqmEndJob(DQMStore::IBooker&, DQMStore::IGetter&) override; + void calibJson(DQMStore::IGetter& iGetter); + void calibDb(DQMStore::IGetter& iGetter); + bool getDbSampicChannel( + DQMStore::IGetter& iGetter, int& db, int& sampic, int& channel, std::string ch_name, CTPPSDiamondDetId detid); + edm::ESGetToken geomEsToken_; + edm::ESGetToken timingCalibrationToken_; + edm::ESHandle hTimingCalib_; + std::vector detids_; + const std::string dqmDir_; + const unsigned int min_entries_; + const std::string jsonCalibFile_, jsonOutputPath_; +}; + +//------------------------------------------------------------------------------ + +PPSDiamondSampicTimingCalibrationPCLHarvester::PPSDiamondSampicTimingCalibrationPCLHarvester( + const edm::ParameterSet& iConfig) + : geomEsToken_(esConsumes()), + dqmDir_(iConfig.getParameter("dqmDir")), + min_entries_(iConfig.getParameter("minEntries")), + jsonCalibFile_(iConfig.getParameter("jsonCalibFile")), + jsonOutputPath_(iConfig.getParameter("jsonOutputPath")) { + if (jsonCalibFile_.empty()) + timingCalibrationToken_ = esConsumes( + edm::ESInputTag(iConfig.getParameter("timingCalibrationTag"))); +} + +//------------------------------------------------------------------------------ + +void PPSDiamondSampicTimingCalibrationPCLHarvester::beginRun(const edm::Run& iRun, const edm::EventSetup& iSetup) { + if (jsonCalibFile_.empty()) + hTimingCalib_ = iSetup.getHandle(timingCalibrationToken_); + const auto& geom = iSetup.getData(geomEsToken_); + for (auto it = geom.beginSensor(); it != geom.endSensor(); ++it) { + if (!CTPPSDiamondDetId::check(it->first)) + continue; + const CTPPSDiamondDetId detid(it->first); + detids_.emplace_back(detid); + } +} + +//------------------------------------------------------------------------------ + +bool PPSDiamondSampicTimingCalibrationPCLHarvester::getDbSampicChannel( + DQMStore::IGetter& iGetter, int& db, int& sampic, int& channel, std::string path, CTPPSDiamondDetId detid) { + auto histDb = iGetter.get(path + "db"); + auto histSampic = iGetter.get(path + "sampic"); + auto histChannel = iGetter.get(path + "channel"); + + if (histDb == nullptr) { + edm::LogWarning("PPSDiamondSampicTimingCalibrationPCLHarvester:dqmEndJob") + << "Failed to retrieve db for detid: " << detid; + return false; + } + + if (histSampic == nullptr) { + edm::LogWarning("PPSDiamondSampicTimingCalibrationPCLHarvester:dqmEndJob") + << "Failed to retrieve sampic for detid: " << detid; + return false; + } + + if (histChannel == nullptr) { + edm::LogWarning("PPSDiamondSampicTimingCalibrationPCLHarvester:dqmEndJob") + << "Failed to retrieve channel hwId for detid: " << detid; + return false; + } + + db = histDb->getIntValue(); + sampic = histSampic->getIntValue(); + channel = histChannel->getIntValue(); + + return true; +} +//------------------------------------------------------------------------------ + +void PPSDiamondSampicTimingCalibrationPCLHarvester::calibJson(DQMStore::IGetter& iGetter) { + std::unordered_map timeHisto; + std::string ch_name, path; + + pt::ptree node; + pt::read_json(jsonCalibFile_, node); + const std::string formula = node.get("formula"); + + for (const auto& detid : detids_) { + detid.channelName(path, CTPPSDiamondDetId::nPath); + detid.channelName(ch_name); + path = dqmDir_ + "/" + path + "/" + ch_name; + const auto chid = detid.rawId(); + + int db, sampic, channel; + if (!getDbSampicChannel(iGetter, db, sampic, channel, path, detid)) + continue; + + int ct = 0; + for (pt::ptree::value_type& par : node.get_child("parameters." + std::to_string(db))) { + double new_time_offset; + if (ct == 16 * (1 - sampic) + channel) { //flip the calibration - sampic 1 is first in json + double old_time_offset = par.second.get("time_offset"); + + timeHisto[chid] = iGetter.get(path); + + if (timeHisto[chid] == nullptr) { + edm::LogWarning("PPSDiamondSampicTimingCalibrationPCLHarvester:dqmEndJob") + << "Failed to retrieve time monitor for detid" << detid; + par.second.put("time_offset", old_time_offset); + continue; + } + + if (min_entries_ > 0 && timeHisto[chid]->getEntries() < min_entries_) { + edm::LogWarning("PPSDiamondSampicTimingCalibrationPCLHarvester:dqmEndJob") + << "Not enough entries for channel (" << detid << "): " << timeHisto[chid]->getEntries() << " < " + << min_entries_ << ". Skipping calibration."; + par.second.put("time_offset", old_time_offset); + continue; + } + new_time_offset = old_time_offset - timeHisto[chid]->getMean(); + //scale x axis of the plots by calculated offset + timeHisto[chid]->getTH1F()->GetXaxis()->Set( + timeHisto[chid]->getTH1F()->GetXaxis()->GetNbins(), + timeHisto[chid]->getTH1F()->GetXaxis()->GetXmin() + new_time_offset, // new Xmin + timeHisto[chid]->getTH1F()->GetXaxis()->GetXmax() + new_time_offset); // new Xmax + timeHisto[chid]->getTH1F()->ResetStats(); + + par.second.put("time_offset", new_time_offset); + break; + } + ct++; + } + } + pt::write_json(jsonOutputPath_, node); +} + +//------------------------------------------------------------------------------ + +void PPSDiamondSampicTimingCalibrationPCLHarvester::calibDb(DQMStore::IGetter& iGetter) { + PPSTimingCalibration calib = *hTimingCalib_; + + // book the parameters containers + PPSTimingCalibration::ParametersMap params; + PPSTimingCalibration::TimingMap time_info; + + std::unordered_map timeHisto; + std::string rp_name, plane_name, ch_name, path; + const std::string& formula = calib.formula(); + + for (const auto& detid : detids_) { + detid.channelName(path, CTPPSDiamondDetId::nPath); + detid.channelName(ch_name); + path = dqmDir_ + "/" + path + "/" + ch_name; + const auto chid = detid.rawId(); + + int db, sampic, channel; + if (!getDbSampicChannel(iGetter, db, sampic, channel, path, detid)) + continue; + + PPSTimingCalibration::Key key; + key.db = db; + key.sampic = sampic; + key.channel = channel; + + double timeOffset = calib.timeOffset(db, sampic, channel); + double timePrecision = calib.timePrecision(db, sampic, channel); + if (timeOffset == 0 && timePrecision == 0) { + edm::LogWarning("PPSDiamondSampicTimingCalibrationPCLHarvester:dqmEndJob") + << "No calibration found for db: " << db << " sampic: " << sampic << " channel: " << channel; + continue; + } + + int cell_ct = 0; + while (!calib.parameters(db, sampic, channel, cell_ct).empty()) { + auto parameters = calib.parameters(db, sampic, channel, cell_ct); + key.cell = cell_ct; + params[key] = parameters; + cell_ct++; + } + + key.cell = -1; + + time_info[key] = {timeOffset, timePrecision}; + timeHisto[chid] = iGetter.get(path); + if (timeHisto[chid] == nullptr) { + edm::LogWarning("PPSDiamondSampicTimingCalibrationPCLHarvester:dqmEndJob") + << "Failed to retrieve time monitor for detid: " << detid; + continue; + } + + if (min_entries_ > 0 && timeHisto[chid]->getEntries() < min_entries_) { + edm::LogInfo("PPSDiamondSampicTimingCalibrationPCLHarvester:dqmEndJob") + << "Not enough entries (" << detid << "): " << timeHisto[chid]->getEntries() << " < " << min_entries_ + << ". Skipping calibration."; + continue; + } + + double new_time_offset = timeOffset - timeHisto[chid]->getMean(); + //scale x axis of the plots by calculated offset + timeHisto[chid]->getTH1F()->GetXaxis()->Set( + timeHisto[chid]->getTH1F()->GetXaxis()->GetNbins(), + timeHisto[chid]->getTH1F()->GetXaxis()->GetXmin() + new_time_offset, // new Xmin + timeHisto[chid]->getTH1F()->GetXaxis()->GetXmax() + new_time_offset); // new Xmax + timeHisto[chid]->getTH1F()->ResetStats(); + + time_info[key] = {new_time_offset, timePrecision}; + } + + auto calibPPS = PPSTimingCalibration(formula, params, time_info); + // write the object + edm::Service poolDbService; + poolDbService->writeOne(&calibPPS, poolDbService->currentTime(), "PPSTimingCalibrationRcd"); +} + +//------------------------------------------------------------------------------ + +void PPSDiamondSampicTimingCalibrationPCLHarvester::dqmEndJob(DQMStore::IBooker& iBooker, DQMStore::IGetter& iGetter) { + iBooker.cd(); + iBooker.setCurrentFolder(dqmDir_); + if (jsonCalibFile_.empty()) + calibDb(iGetter); + else + calibJson(iGetter); +} + +//------------------------------------------------------------------------------ + +void PPSDiamondSampicTimingCalibrationPCLHarvester::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { + edm::ParameterSetDescription desc; + desc.add("timingCalibrationTag", "GlobalTag:DiamondSampicCalibration") + ->setComment("input tag for timing calibration retrieval"); + desc.add("dqmDir", "AlCaReco/PPSDiamondSampicTimingCalibrationPCL") + ->setComment("input path for the various DQM plots"); + desc.add("minEntries", 1)->setComment("minimal number of hits to extract calibration"); + desc.add("jsonCalibFile", "") + ->setComment( + "input path for json file containing calibration, if none, calibration will be obtained from db instead"); + desc.add("jsonOutputPath", "offset_cal.json")->setComment("output path for the new json calibration"); + descriptions.add("PPSDiamondSampicTimingCalibrationPCLHarvester", desc); +} + +DEFINE_FWK_MODULE(PPSDiamondSampicTimingCalibrationPCLHarvester); \ No newline at end of file diff --git a/CalibPPS/TimingCalibration/plugins/PPSDiamondSampicTimingCalibrationPCLWorker.cc b/CalibPPS/TimingCalibration/plugins/PPSDiamondSampicTimingCalibrationPCLWorker.cc new file mode 100644 index 0000000000000..71c3b20357778 --- /dev/null +++ b/CalibPPS/TimingCalibration/plugins/PPSDiamondSampicTimingCalibrationPCLWorker.cc @@ -0,0 +1,155 @@ +// -*- C++ -*- +// +// Package: CalibPPS/TimingCalibration/PPSDiamondSampicTimingCalibrationPCLWorker +// Class: PPSDiamondSampicTimingCalibrationPCLWorker +// +/**\class PPSDiamondSampicTimingCalibrationPCLWorker PPSDiamondSampicTimingCalibrationPCLWorker.cc CalibPPS/TimingCalibration/PPSDiamondSampicTimingCalibrationPCLWorker/plugins/PPSDiamondSampicTimingCalibrationPCLWorker.cc + + Description: Worker of DiamondSampic calibration which produces RecHitsTime histograms and id mapping for the Harvester + + Implementation: + [Notes on implementation] +*/ +// +// Original Author: Christopher Misan +// Created: Mon, 26 Jul 2021 07:37:13 GMT +// +// + +#include + +#include "FWCore/Framework/interface/Frameworkfwd.h" +#include "DQMServices/Core/interface/DQMGlobalEDAnalyzer.h" + +#include "FWCore/Framework/interface/Event.h" +#include "FWCore/Framework/interface/MakerMacros.h" + +#include "FWCore/ParameterSet/interface/ParameterSet.h" + +#include "Geometry/VeryForwardGeometryBuilder/interface/CTPPSGeometry.h" +#include "Geometry/Records/interface/VeryForwardRealGeometryRecord.h" + +#include "DataFormats/CTPPSDetId/interface/TotemTimingDetId.h" +#include "DataFormats/CTPPSDetId/interface/CTPPSDiamondDetId.h" +#include "DataFormats/CTPPSDigi/interface/TotemTimingDigi.h" +#include "DataFormats/CTPPSReco/interface/TotemTimingRecHit.h" +#include "DataFormats/Common/interface/DetSetVector.h" + +//------------------------------------------------------------------------------ + +struct Histograms_PPSDiamondSampicTimingCalibrationPCLWorker { + std::unordered_map timeHisto; + std::unordered_map db; + std::unordered_map sampic; + std::unordered_map channel; +}; + +class PPSDiamondSampicTimingCalibrationPCLWorker + : public DQMGlobalEDAnalyzer { +public: + explicit PPSDiamondSampicTimingCalibrationPCLWorker(const edm::ParameterSet&); + ~PPSDiamondSampicTimingCalibrationPCLWorker() override; + + static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); + +private: + void bookHistograms(DQMStore::IBooker&, + edm::Run const&, + edm::EventSetup const&, + Histograms_PPSDiamondSampicTimingCalibrationPCLWorker&) const override; + + void dqmAnalyze(edm::Event const&, + edm::EventSetup const&, + Histograms_PPSDiamondSampicTimingCalibrationPCLWorker const&) const override; + + // ------------ member data ------------ + edm::EDGetTokenT> totemTimingDigiToken_; + edm::EDGetTokenT> totemTimingRecHitToken_; + edm::ESGetToken geomEsToken_; + std::string folder_; +}; + +//------------------------------------------------------------------------------ + +PPSDiamondSampicTimingCalibrationPCLWorker::PPSDiamondSampicTimingCalibrationPCLWorker(const edm::ParameterSet& iConfig) + : totemTimingDigiToken_( + consumes>(iConfig.getParameter("totemTimingDigiTag"))), + totemTimingRecHitToken_( + consumes>(iConfig.getParameter("totemTimingRecHitTag"))), + geomEsToken_(esConsumes()), + folder_(iConfig.getParameter("folder")) {} + +PPSDiamondSampicTimingCalibrationPCLWorker::~PPSDiamondSampicTimingCalibrationPCLWorker() {} + +//------------------------------------------------------------------------------ + +void PPSDiamondSampicTimingCalibrationPCLWorker::dqmAnalyze( + edm::Event const& iEvent, + edm::EventSetup const& iSetup, + Histograms_PPSDiamondSampicTimingCalibrationPCLWorker const& histos) const { + edm::Handle> timingDigi; + edm::Handle> timingRecHit; + iEvent.getByToken(totemTimingRecHitToken_, timingRecHit); + iEvent.getByToken(totemTimingDigiToken_, timingDigi); + + if (timingRecHit->empty()) { + edm::LogWarning("PPSDiamondSampicTimingCalibrationPCLWorker:dqmAnalyze") + << "No rechits retrieved from the event content."; + return; + } + + for (const auto& digis : *timingDigi) { + const CTPPSDiamondDetId detId(digis.detId()); + for (const auto& digi : digis) { + histos.db.at(detId.rawId())->Fill(digi.hardwareBoardId()); + histos.sampic.at(detId.rawId())->Fill(digi.hardwareSampicId()); + histos.channel.at(detId.rawId())->Fill(digi.hardwareChannelId()); + } + } + + for (const auto& recHits : *timingRecHit) { + const CTPPSDiamondDetId detId(recHits.detId()); + for (const auto& recHit : recHits) + histos.timeHisto.at(detId.rawId())->Fill(recHit.time()); + } +} + +//------------------------------------------------------------------------------ + +void PPSDiamondSampicTimingCalibrationPCLWorker::bookHistograms( + DQMStore::IBooker& ibook, + edm::Run const& run, + edm::EventSetup const& iSetup, + Histograms_PPSDiamondSampicTimingCalibrationPCLWorker& histos) const { + ibook.setCurrentFolder(folder_); + std::string ch_name; + const auto& geom = iSetup.getData(geomEsToken_); + for (auto it = geom.beginSensor(); it != geom.endSensor(); ++it) { + if (!CTPPSDiamondDetId::check(it->first)) + continue; + const CTPPSDiamondDetId detid(it->first); + + std::string path; + detid.channelName(path, CTPPSDiamondDetId::nPath); + detid.channelName(ch_name); + histos.timeHisto[detid.rawId()] = ibook.book1D(path + "/" + ch_name, ch_name, 500, -25, 25); + histos.db[detid.rawId()] = ibook.bookInt(path + "/" + ch_name + "db"); + histos.sampic[detid.rawId()] = ibook.bookInt(path + "/" + ch_name + "sampic"); + histos.channel[detid.rawId()] = ibook.bookInt(path + "/" + ch_name + "channel"); + } +} + +//------------------------------------------------------------------------------ + +void PPSDiamondSampicTimingCalibrationPCLWorker::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { + edm::ParameterSetDescription desc; + desc.add("totemTimingDigiTag", edm::InputTag("totemTimingRawToDigi", "TotemTiming")) + ->setComment("input tag for the PPS diamond detectors digi"); + desc.add("totemTimingRecHitTag", edm::InputTag("totemTimingRecHits")) + ->setComment("input tag for the PPS diamond detectors rechits"); + desc.add("folder", "AlCaReco/PPSDiamondSampicTimingCalibrationPCL") + ->setComment("output path for the various DQM plots"); + descriptions.add("PPSDiamondSampicTimingCalibrationPCLWorker", desc); +} + +DEFINE_FWK_MODULE(PPSDiamondSampicTimingCalibrationPCLWorker); diff --git a/CalibPPS/TimingCalibration/python/ALCARECOPPSCalTrackBasedSel_Output_cff.py b/CalibPPS/TimingCalibration/python/ALCARECOPPSCalTrackBasedSel_Output_cff.py index 1415b8c708f01..20bee7ec6c60e 100644 --- a/CalibPPS/TimingCalibration/python/ALCARECOPPSCalTrackBasedSel_Output_cff.py +++ b/CalibPPS/TimingCalibration/python/ALCARECOPPSCalTrackBasedSel_Output_cff.py @@ -6,7 +6,9 @@ ), outputCommands = cms.untracked.vstring( 'keep *_ALCARECOPPSCalTrackBasedSel_*_*', - 'keep *_ctppsDiamondRawToDigi_*_*' + 'keep *_ctppsDiamondRawToDigi_*_*', + 'keep *_totemTimingRawToDigi_*_*' + # will be updated to add the spatial alignment required collections ) ) diff --git a/CalibPPS/TimingCalibration/python/ALCARECOPPSDiamondSampicTimingCalibHarvester_cff.py b/CalibPPS/TimingCalibration/python/ALCARECOPPSDiamondSampicTimingCalibHarvester_cff.py new file mode 100644 index 0000000000000..1c6ecf70c86a7 --- /dev/null +++ b/CalibPPS/TimingCalibration/python/ALCARECOPPSDiamondSampicTimingCalibHarvester_cff.py @@ -0,0 +1,13 @@ +import FWCore.ParameterSet.Config as cms + +from Geometry.VeryForwardGeometry.geometryRPFromDB_cfi import * +from CalibPPS.TimingCalibration.PPSDiamondSampicTimingCalibrationPCLHarvester_cfi import * + + +DQMStore = cms.Service("DQMStore") + +from DQMServices.Core.DQMEDHarvester import DQMEDHarvester +dqmEnv = DQMEDHarvester('DQMHarvestingMetadata', + subSystemFolder=cms.untracked.string('AlCaReco/PPSDiamondSampicTimingCalibrationPCL/AlignedChannels')) + +ALCAHARVESTPPSDiamondSampicTimingCalibration = cms.Sequence(PPSDiamondSampicTimingCalibrationPCLHarvester + dqmEnv) diff --git a/CalibPPS/TimingCalibration/python/ALCARECOPPSDiamondSampicTimingCalib_Output_cff.py b/CalibPPS/TimingCalibration/python/ALCARECOPPSDiamondSampicTimingCalib_Output_cff.py new file mode 100644 index 0000000000000..d86911e241cde --- /dev/null +++ b/CalibPPS/TimingCalibration/python/ALCARECOPPSDiamondSampicTimingCalib_Output_cff.py @@ -0,0 +1,13 @@ +import FWCore.ParameterSet.Config as cms + +OutALCARECOPPSDiamondSampicTimingCalib_noDrop = cms.PSet( + SelectEvents = cms.untracked.PSet( + SelectEvents = cms.vstring('pathALCARECOPPSDiamondSampicTimingCalib') + ), + outputCommands = cms.untracked.vstring( + 'keep *_MEtoEDMConvertPPSDiamondSampicTimingCalib_*_*', + ) +) + +OutALCARECOPPSDiamondSampicTimingCalib = OutALCARECOPPSDiamondSampicTimingCalib_noDrop.clone() +OutALCARECOPPSDiamondSampicTimingCalib.outputCommands.insert(0, 'drop *') diff --git a/CalibPPS/TimingCalibration/python/ALCARECOPPSDiamondSampicTimingCalib_cff.py b/CalibPPS/TimingCalibration/python/ALCARECOPPSDiamondSampicTimingCalib_cff.py new file mode 100644 index 0000000000000..060a364dced8e --- /dev/null +++ b/CalibPPS/TimingCalibration/python/ALCARECOPPSDiamondSampicTimingCalib_cff.py @@ -0,0 +1,18 @@ +import FWCore.ParameterSet.Config as cms + +from RecoPPS.Configuration.recoCTPPS_cff import diamondSampicLocalReconstructionTask +from CalibPPS.TimingCalibration.PPSDiamondSampicTimingCalibrationPCLWorker_cfi import PPSDiamondSampicTimingCalibrationPCLWorker +from DQMServices.Core.DQMEDAnalyzer import DQMEDAnalyzer + +MEtoEDMConvertPPSDiamondSampicTimingCalib = cms.EDProducer('MEtoEDMConverter', + Name = cms.untracked.string('MEtoEDMConverter'), + Verbosity = cms.untracked.int32(0), + Frequency = cms.untracked.int32(50), + MEPathToSave = cms.untracked.string('AlCaReco/PPSDiamondSampicTimingCalibrationPCL') +) + +taskALCARECOPPSDiamondSampicTimingCalib = cms.Task( + diamondSampicLocalReconstructionTask, + PPSDiamondSampicTimingCalibrationPCLWorker, + MEtoEDMConvertPPSDiamondSampicTimingCalib +) diff --git a/CalibPPS/TimingCalibration/test/DiamondSampicCalibrationHarvester_cfg.py b/CalibPPS/TimingCalibration/test/DiamondSampicCalibrationHarvester_cfg.py new file mode 100644 index 0000000000000..62477a79dae75 --- /dev/null +++ b/CalibPPS/TimingCalibration/test/DiamondSampicCalibrationHarvester_cfg.py @@ -0,0 +1,68 @@ +import FWCore.ParameterSet.Config as cms + +process = cms.Process("harvester") + +process.load("FWCore.MessageService.MessageLogger_cfi") + +process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(-1) ) + +process.load('Configuration.StandardSequences.Services_cff') +process.load('Configuration.EventContent.EventContent_cff') +process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') +from Configuration.AlCa.GlobalTag import GlobalTag +process.GlobalTag = GlobalTag(process.GlobalTag, '113X_dataRun3_Prompt_PPStestSampicPCL_v1') + +# Source (histograms) +process.source = cms.Source("DQMRootSource", + fileNames = cms.untracked.vstring("file:worker_output.root"), +) + +# output service for database +process.load('CondCore.CondDB.CondDB_cfi') +process.CondDB.connect = 'sqlite_file:ppsDiamondSampicTiming_calibration.sqlite' # SQLite output + +process.PoolDBOutputService = cms.Service('PoolDBOutputService', + process.CondDB, + timetype = cms.untracked.string('runnumber'), + toPut = cms.VPSet( + cms.PSet( + record = cms.string('PPSTimingCalibrationRcd'), + tag = cms.string('DiamondSampicCalibration'), + ) + ) +) + +################ +#geometry +################ +process.load('Geometry.VeryForwardGeometry.geometryRPFromDD_2021_cfi') + +process.load("CalibPPS.TimingCalibration.PPSDiamondSampicTimingCalibrationPCLHarvester_cfi") +#process.PPSDiamondSampicTimingCalibrationPCLHarvester.jsonCalibFile=cms.string("initial.cal.json") + +# load DQM framework +process.load("DQMServices.Core.DQMStore_cfi") +process.load("DQMServices.Components.DQMEnvironment_cfi") +process.dqmEnv.subSystemFolder = "CalibPPS" +process.dqmSaver.convention = 'Offline' +process.dqmSaver.workflow = "/CalibPPS/TimingCalibration/CMSSW_12_0_0_pre2" +process.dqmSaver.saveByRun = -1 +process.dqmSaver.saveAtJobEnd = True +process.dqmSaver.forceRunNumber = 999999 + +process.p = cms.Path( + process.PPSDiamondSampicTimingCalibrationPCLHarvester +) + +process.end_path = cms.EndPath( + process.dqmEnv + + process.dqmSaver +) + +process.schedule = cms.Schedule( + process.p, + process.end_path +) + + + diff --git a/CalibPPS/TimingCalibration/test/DiamondSampicCalibrationWorker_cfg.py b/CalibPPS/TimingCalibration/test/DiamondSampicCalibrationWorker_cfg.py new file mode 100644 index 0000000000000..b1b58bb878e33 --- /dev/null +++ b/CalibPPS/TimingCalibration/test/DiamondSampicCalibrationWorker_cfg.py @@ -0,0 +1,83 @@ +import FWCore.ParameterSet.Config as cms + +process = cms.Process("worker") + +process.load("FWCore.MessageService.MessageLogger_cfi") +process.load('RecoPPS.Local.totemTimingLocalReconstruction_cff') +process.source = cms.Source("EmptySource") +process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(10000) ) + +process.load('Configuration.StandardSequences.Services_cff') +process.load('Configuration.EventContent.EventContent_cff') +process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') +from Configuration.AlCa.GlobalTag import GlobalTag +process.GlobalTag = GlobalTag(process.GlobalTag, '113X_dataRun3_Prompt_PPStestSampicPCL_v1') + +################ +#digi converter +################ +process.totemTimingRawToDigi = cms.EDProducer('DiamondSampicDigiProducer', + #input path of the testbeam data + sampicFilesVec=cms.vstring("/eos/cms/store/group/dpg_ctpps/comm_ctpps/201905_DesyTestbeam/MergedDev/Ntuple_runsampic_159_runtelescope_636.root"), + ################ + #channel mapping + ################ + idsMapping = cms.VPSet( + cms.PSet(detId = cms.vuint32(2054160384,2054553600,2056257536,2056650752), treeChId = cms.uint32(8)), + cms.PSet(detId = cms.vuint32(2054164480,2054557696,2056261632,2056654848), treeChId = cms.uint32(9)), + cms.PSet(detId = cms.vuint32(2054168576,2054561792,2056265728,2056658944), treeChId = cms.uint32(10)), + cms.PSet(detId = cms.vuint32(2054172672,2054565888,2056269824,2056663040), treeChId = cms.uint32(11)), + cms.PSet(detId = cms.vuint32(2054176768,2054569984,2056273920,2056667136), treeChId = cms.uint32(12)), + cms.PSet(detId = cms.vuint32(2054180864,2054574080,2056278016,2056671232), treeChId = cms.uint32(13)), + cms.PSet(detId = cms.vuint32(2054184960,2054578176,2056282112,2056675328), treeChId = cms.uint32(14)), + cms.PSet(detId = cms.vuint32(2054189056,2054582272,2056286208,2056679424), treeChId = cms.uint32(15)), + cms.PSet(detId = cms.vuint32(2054193152,2054586368,2056290304,2056683520), treeChId = cms.uint32(16)), + cms.PSet(detId = cms.vuint32(2054197248,2054590464,2056294400,2056687616), treeChId = cms.uint32(17)), + cms.PSet(detId = cms.vuint32(2054201344,2054594560,2056298496,2056691712), treeChId = cms.uint32(18)), + cms.PSet(detId = cms.vuint32(2054205440,2054598656,2056302592,2056695808), treeChId = cms.uint32(19)), + + cms.PSet(detId = cms.vuint32(2054291456,2054422528,2056388608,2056519680), treeChId = cms.uint32(20)), + cms.PSet(detId = cms.vuint32(2054295552,2054426624,2056392704,2056523776), treeChId = cms.uint32(21)), + cms.PSet(detId = cms.vuint32(2054299648,2054430720,2056396800,2056527872), treeChId = cms.uint32(22)), + cms.PSet(detId = cms.vuint32(2054303744,2054434816,2056400896,2056531968), treeChId = cms.uint32(23)), + cms.PSet(detId = cms.vuint32(2054307840,2054438912,2056404992,2056536064), treeChId = cms.uint32(24)), + cms.PSet(detId = cms.vuint32(2054311936,2054443008,2056409088,2056540160), treeChId = cms.uint32(25)), + cms.PSet(detId = cms.vuint32(2054316032,2054447104,2056413184,2056544256), treeChId = cms.uint32(26)), + cms.PSet(detId = cms.vuint32(2054320128,2054451200,2056417280,2056548352), treeChId = cms.uint32(27)), + cms.PSet(detId = cms.vuint32(2054324224,2054455296,2056421376,2056552448), treeChId = cms.uint32(28)), + cms.PSet(detId = cms.vuint32(2054328320,2054459392,2056425472,2056556544), treeChId = cms.uint32(29)), + cms.PSet(detId = cms.vuint32(2054332416,2054463488,2056429568,2056560640), treeChId = cms.uint32(30)), + cms.PSet(detId = cms.vuint32(2054336512,2054467584,2056433664,2056564736), treeChId = cms.uint32(31)) + + ) +) + +process.totemTimingRecHits.mergeTimePeaks= cms.bool(False) +process.totemTimingRecHits.timingCalibrationTag= cms.string('GlobalTag:DiamondSampicCalibration') +################ +#geometry +################ +process.load('Geometry.VeryForwardGeometry.geometryRPFromDD_2021_cfi') + +process.load("CalibPPS.TimingCalibration.PPSDiamondSampicTimingCalibrationPCLWorker_cfi") +process.DQMStore = cms.Service("DQMStore") + +process.dqmOutput = cms.OutputModule("DQMRootOutputModule", + fileName = cms.untracked.string("worker_output.root") +) + + +process.path = cms.Path( + process.totemTimingRawToDigi* + process.diamondSampicLocalReconstruction* + process.PPSDiamondSampicTimingCalibrationPCLWorker +) + +process.end_path = cms.EndPath( + process.dqmOutput +) + +process.schedule = cms.Schedule( + process.path, + process.end_path +) diff --git a/CalibPPS/TimingCalibration/test/runDiamondSampicCalibration b/CalibPPS/TimingCalibration/test/runDiamondSampicCalibration new file mode 100755 index 0000000000000..3c8c617d6009a --- /dev/null +++ b/CalibPPS/TimingCalibration/test/runDiamondSampicCalibration @@ -0,0 +1,7 @@ +#!/bin/bash + +#---------------------------------------------------------------------------------------------------- + +cmsRun DiamondSampicCalibrationWorker_cfg.py &> log_DiamondSampicCalibrationWorker.log & +wait +cmsRun DiamondSampicCalibrationHarvester_cfg.py &> log_DiamondSampicCalibrationHarvester.log & diff --git a/CalibTracker/Configuration/python/Tracker_DependentRecords_forGlobalTag_nofakes_cff.py b/CalibTracker/Configuration/python/Tracker_DependentRecords_forGlobalTag_nofakes_cff.py index 90cef7dd880b8..51f4de06462d5 100644 --- a/CalibTracker/Configuration/python/Tracker_DependentRecords_forGlobalTag_nofakes_cff.py +++ b/CalibTracker/Configuration/python/Tracker_DependentRecords_forGlobalTag_nofakes_cff.py @@ -45,3 +45,6 @@ tag = cms.string("") ) ) + +# Multiple scattering parametrisation +from RecoTracker.TkMSParametrization.multipleScatteringParametrisationMakerESProducer_cfi import * diff --git a/CalibTracker/SiPixelConnectivity/test/SiPixelFedCablingMapWriter_cfg.py b/CalibTracker/SiPixelConnectivity/test/SiPixelFedCablingMapWriter_cfg.py index 2720fb38a2c02..0be7eb390f9f9 100644 --- a/CalibTracker/SiPixelConnectivity/test/SiPixelFedCablingMapWriter_cfg.py +++ b/CalibTracker/SiPixelConnectivity/test/SiPixelFedCablingMapWriter_cfg.py @@ -3,7 +3,6 @@ process = cms.Process("MapWriter") process.load("CondCore.DBCommon.CondDBCommon_cfi") -#process.load("Configuration.StandardSequences.Geometry_cff") process.load("Configuration.StandardSequences.GeometryDB_cff") process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff") diff --git a/CalibTracker/SiPixelESProducers/interface/SiPixelDetInfoFileWriter.h b/CalibTracker/SiPixelESProducers/interface/SiPixelDetInfoFileWriter.h index fb44a80d783ea..9bc6284489a67 100644 --- a/CalibTracker/SiPixelESProducers/interface/SiPixelDetInfoFileWriter.h +++ b/CalibTracker/SiPixelESProducers/interface/SiPixelDetInfoFileWriter.h @@ -18,14 +18,14 @@ // // -#include "FWCore/Framework/interface/EDAnalyzer.h" +#include "FWCore/Framework/interface/one/EDAnalyzer.h" #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h" #include "Geometry/Records/interface/TrackerDigiGeometryRecord.h" #include #include #include -class SiPixelDetInfoFileWriter : public edm::EDAnalyzer { +class SiPixelDetInfoFileWriter : public edm::one::EDAnalyzer { public: explicit SiPixelDetInfoFileWriter(const edm::ParameterSet &); ~SiPixelDetInfoFileWriter() override; @@ -34,6 +34,7 @@ class SiPixelDetInfoFileWriter : public edm::EDAnalyzer { void beginJob() override; void beginRun(const edm::Run &, const edm::EventSetup &) override; void analyze(const edm::Event &, const edm::EventSetup &) override; + void endRun(const edm::Run &, const edm::EventSetup &) override{}; private: edm::ESGetToken trackerGeomTokenBeginRun_; diff --git a/CalibTracker/SiPixelESProducers/plugins/SiPixelGenErrorDBObjectESProducer.cc b/CalibTracker/SiPixelESProducers/plugins/SiPixelGenErrorDBObjectESProducer.cc index 4f3303c817ed1..ddaf98f31268f 100644 --- a/CalibTracker/SiPixelESProducers/plugins/SiPixelGenErrorDBObjectESProducer.cc +++ b/CalibTracker/SiPixelESProducers/plugins/SiPixelGenErrorDBObjectESProducer.cc @@ -48,18 +48,9 @@ SiPixelGenErrorDBObjectESProducer::SiPixelGenErrorDBObjectESProducer(const edm:: const float theMagField = iMagfield->inTesla(center).mag(); if (theMagField >= -0.1 && theMagField < 1.0) return get("", "0T"); - else if (theMagField >= 1.0 && theMagField < 2.5) - return get("", "2T"); - else if (theMagField >= 2.5 && theMagField < 3.25) - return get("", "3T"); - else if (theMagField >= 3.25 && theMagField < 3.65) - return get("", "35T"); - else if (theMagField >= 3.9 && theMagField < 4.1) - return get("", "4T"); else { - if (theMagField >= 4.1 || theMagField < -0.1) + if (theMagField >= 3.9 || theMagField < 3.65) edm::LogWarning("UnexpectedMagneticFieldUsingDefaultPixelGenError") << "Magnetic field is " << theMagField; - //return get("", "3.8T"); return get("", ""); } }, diff --git a/CalibTracker/SiPixelESProducers/plugins/SiPixelTemplateDBObjectESProducer.cc b/CalibTracker/SiPixelESProducers/plugins/SiPixelTemplateDBObjectESProducer.cc index 6680121239cf7..5586ec5840149 100644 --- a/CalibTracker/SiPixelESProducers/plugins/SiPixelTemplateDBObjectESProducer.cc +++ b/CalibTracker/SiPixelESProducers/plugins/SiPixelTemplateDBObjectESProducer.cc @@ -49,18 +49,9 @@ SiPixelTemplateDBObjectESProducer::SiPixelTemplateDBObjectESProducer(const edm:: const float theMagField = iMagfield->inTesla(center).mag(); if (theMagField >= -0.1 && theMagField < 1.0) return get("", "0T"); - else if (theMagField >= 1.0 && theMagField < 2.5) - return get("", "2T"); - else if (theMagField >= 2.5 && theMagField < 3.25) - return get("", "3T"); - else if (theMagField >= 3.25 && theMagField < 3.65) - return get("", "35T"); - else if (theMagField >= 3.9 && theMagField < 4.1) - return get("", "4T"); else { - if (theMagField >= 4.1 || theMagField < -0.1) + if (theMagField >= 3.9 || theMagField < 3.65) edm::LogWarning("UnexpectedMagneticFieldUsingDefaultPixelTemplate") << "Magnetic field is " << theMagField; - //return get("", "3.8T"); return get("", ""); } }, diff --git a/CalibTracker/SiPixelLorentzAngle/test/SiPixelLorentzAngleCosmic_cfg.py b/CalibTracker/SiPixelLorentzAngle/test/SiPixelLorentzAngleCosmic_cfg.py index 02327a0895e6f..e42aa66e1e3a4 100644 --- a/CalibTracker/SiPixelLorentzAngle/test/SiPixelLorentzAngleCosmic_cfg.py +++ b/CalibTracker/SiPixelLorentzAngle/test/SiPixelLorentzAngleCosmic_cfg.py @@ -4,7 +4,7 @@ process.load("Configuration.StandardSequences.Services_cff") -process.load("Configuration.StandardSequences.Geometry_cff") +process.load("Configuration.StandardSequences.GeometryDB_cff") process.load("Configuration.StandardSequences.MagneticField_38T_cff") process.load("Configuration.StandardSequences.ReconstructionCosmics_cff") diff --git a/CalibTracker/SiPixelLorentzAngle/test/SiPixelLorentzAngle_cfg.py b/CalibTracker/SiPixelLorentzAngle/test/SiPixelLorentzAngle_cfg.py index 3f40eab89988f..016b2f17c6e2b 100644 --- a/CalibTracker/SiPixelLorentzAngle/test/SiPixelLorentzAngle_cfg.py +++ b/CalibTracker/SiPixelLorentzAngle/test/SiPixelLorentzAngle_cfg.py @@ -4,7 +4,7 @@ process.load("Configuration.StandardSequences.Services_cff") -#process.load("Configuration.StandardSequences.Geometry_cff") +#process.load("Configuration.StandardSequences.GeometryDB_cff") process.load('Configuration/StandardSequences/GeometryExtended_cff') process.load('Configuration.StandardSequences.MagneticField_cff') diff --git a/CalibTracker/SiPixelQuality/plugins/SiPixelStatusHarvester.cc b/CalibTracker/SiPixelQuality/plugins/SiPixelStatusHarvester.cc index 48ea04ec37fa0..15c2dd56a7027 100644 --- a/CalibTracker/SiPixelQuality/plugins/SiPixelStatusHarvester.cc +++ b/CalibTracker/SiPixelQuality/plugins/SiPixelStatusHarvester.cc @@ -194,7 +194,7 @@ void SiPixelStatusHarvester::dqmEndRun(const edm::Run& iRun, const edm::EventSet } if (debug_ == true) { // only produced for debugging reason cond::Time_t thisIOV = (cond::Time_t)iRun.id().run(); - poolDbService->writeOne(siPixelQualityPermBad, thisIOV, recordName_ + "_permanentBad"); + poolDbService->writeOne(*siPixelQualityPermBad, thisIOV, recordName_ + "_permanentBad"); } // IOV for final payloads. FEDerror25 and pcl @@ -298,7 +298,7 @@ void SiPixelStatusHarvester::dqmEndRun(const edm::Run& iRun, const edm::EventSet fedError25IOV[it->first] = it->first; if (debug_ == true) // only produced for debugging reason - poolDbService->writeOne(siPixelQuality_FEDerror25, thisIOV, recordName_ + "_FEDerror25"); + poolDbService->writeOne(*siPixelQuality_FEDerror25, thisIOV, recordName_ + "_FEDerror25"); delete siPixelQuality_FEDerror25; } @@ -556,12 +556,12 @@ void SiPixelStatusHarvester::dqmEndRun(const edm::Run& iRun, const edm::EventSet edm::LuminosityBlockID lu(iRun.id().run(), endLumiBlock_ + 1); cond::Time_t thisIOV = (cond::Time_t)(lu.value()); if (!SiPixelStatusHarvester::equal(lastPrompt, siPixelQualityPermBad)) - poolDbService->writeOne(siPixelQualityPermBad, thisIOV, recordName_ + "_prompt"); + poolDbService->writeOne(*siPixelQualityPermBad, thisIOV, recordName_ + "_prompt"); // add empty bad components to last lumi+1 IF AND ONLY IF the last payload of other is not equal to empty SiPixelQuality* siPixelQualityDummy = new SiPixelQuality(); if (!SiPixelStatusHarvester::equal(lastOther, siPixelQualityDummy)) - poolDbService->writeOne(siPixelQualityDummy, thisIOV, recordName_ + "_other"); + poolDbService->writeOne(*siPixelQualityDummy, thisIOV, recordName_ + "_other"); delete siPixelQualityDummy; } @@ -657,12 +657,12 @@ void SiPixelStatusHarvester::constructTag(std::map siPixel SiPixelQuality* thisPayload = qIt->second; if (qIt == siPixelQualityTag.begin()) - poolDbService->writeOne(thisPayload, thisIOV, recordName_ + "_" + tagName); + poolDbService->writeOne(*thisPayload, thisIOV, recordName_ + "_" + tagName); else { SiPixelQuality* prevPayload = (std::prev(qIt))->second; if (!SiPixelStatusHarvester::equal(thisPayload, prevPayload)) // only append newIOV if this payload differs wrt last - poolDbService->writeOne(thisPayload, thisIOV, recordName_ + "_" + tagName); + poolDbService->writeOne(*thisPayload, thisIOV, recordName_ + "_" + tagName); } } } diff --git a/CalibTracker/SiStripChannelGain/test/SSTGain_PCL_Config_cfg.py b/CalibTracker/SiStripChannelGain/test/SSTGain_PCL_Config_cfg.py index d67f208006f2d..a39d3607cfb1d 100644 --- a/CalibTracker/SiStripChannelGain/test/SSTGain_PCL_Config_cfg.py +++ b/CalibTracker/SiStripChannelGain/test/SSTGain_PCL_Config_cfg.py @@ -2,7 +2,7 @@ process = cms.Process("APVGAIN") -process.load('Configuration.StandardSequences.Geometry_cff') +process.load('Configuration.StandardSequences.GeometryDB_cff') process.load('Configuration.StandardSequences.MagneticField_cff') process.load("Geometry.CMSCommonData.cmsIdealGeometryXML_cfi") process.load("Geometry.TrackerGeometryBuilder.trackerGeometry_cfi") diff --git a/CalibTracker/SiStripCommon/BuildFile.xml b/CalibTracker/SiStripCommon/BuildFile.xml index 17b87a3ad87ae..48d76ab54c886 100644 --- a/CalibTracker/SiStripCommon/BuildFile.xml +++ b/CalibTracker/SiStripCommon/BuildFile.xml @@ -2,14 +2,18 @@ + + + + diff --git a/CalibTracker/SiStripCommon/interface/SiStripOnTrackClusterTableProducerBase.h b/CalibTracker/SiStripCommon/interface/SiStripOnTrackClusterTableProducerBase.h new file mode 100644 index 0000000000000..4dec2d9591a6c --- /dev/null +++ b/CalibTracker/SiStripCommon/interface/SiStripOnTrackClusterTableProducerBase.h @@ -0,0 +1,56 @@ +#include "FWCore/Framework/interface/stream/EDProducer.h" +#include "FWCore/Framework/interface/ConsumesCollector.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" + +#include "DataFormats/NanoAOD/interface/FlatTable.h" +#include "DataFormats/SiStripCluster/interface/SiStripCluster.h" +#include "DataFormats/TrackReco/interface/Track.h" +#include "TrackingTools/PatternTools/interface/TrajTrackAssociation.h" + +class SiStripOnTrackClusterTableProducerBase : public edm::stream::EDProducer<> { +public: + explicit SiStripOnTrackClusterTableProducerBase(const edm::ParameterSet& params) + : m_name(params.getParameter("name")), + m_doc(params.existsAs("doc") ? params.getParameter("doc") : ""), + m_extension(params.existsAs("extension") ? params.getParameter("extension") : true), + m_tracks_token(consumes>(params.getParameter("Tracks"))), + m_association_token(consumes(params.getParameter("Tracks"))) { + produces(); + } + ~SiStripOnTrackClusterTableProducerBase() override; + + void produce(edm::Event& iEvent, const edm::EventSetup& iSetup) final; + + struct OnTrackCluster { + uint32_t det; + const SiStripCluster* cluster; + const Trajectory* traj; + const reco::Track* track; + const TrajectoryMeasurement& measurement; + OnTrackCluster(uint32_t detId, + const SiStripCluster* stripCluster, + const Trajectory* trajectory, + const reco::Track* track_, + const TrajectoryMeasurement& measurement_) + : det{detId}, cluster{stripCluster}, traj{trajectory}, track{track_}, measurement{measurement_} {} + }; + + virtual void fillTable(const std::vector& clusters, + const edm::View& tracks, + nanoaod::FlatTable* table, + const edm::EventSetup& iSetup) = 0; + + template + static void addColumn(nanoaod::FlatTable* table, const std::string& name, VALUES&& values, const std::string& doc) { + using value_type = typename std::remove_reference::type::value_type; + table->template addColumn(name, values, doc); + } + +private: + const std::string m_name; + const std::string m_doc; + bool m_extension; + + const edm::EDGetTokenT> m_tracks_token; + const edm::EDGetTokenT m_association_token; +}; diff --git a/CalibTracker/SiStripCommon/plugins/BuildFile.xml b/CalibTracker/SiStripCommon/plugins/BuildFile.xml index 039a07453e59c..64a3dcae11884 100644 --- a/CalibTracker/SiStripCommon/plugins/BuildFile.xml +++ b/CalibTracker/SiStripCommon/plugins/BuildFile.xml @@ -9,6 +9,7 @@ + diff --git a/CalibTracker/SiStripCommon/plugins/SealModules.cc b/CalibTracker/SiStripCommon/plugins/SealModules.cc index 6613d45b91294..1bafc65ef6f88 100644 --- a/CalibTracker/SiStripCommon/plugins/SealModules.cc +++ b/CalibTracker/SiStripCommon/plugins/SealModules.cc @@ -1,10 +1,6 @@ #include "FWCore/PluginManager/interface/ModuleDef.h" #include "FWCore/Framework/interface/MakerMacros.h" -#include "CalibTracker/SiStripCommon/plugins/SiStripDetInfoFileWriter.h" - -DEFINE_FWK_MODULE(SiStripDetInfoFileWriter); - #include "ShallowTree.h" #include "ShallowEventDataProducer.h" #include "ShallowDigisProducer.h" @@ -24,3 +20,7 @@ DEFINE_FWK_MODULE(ShallowSimhitClustersProducer); DEFINE_FWK_MODULE(ShallowTracksProducer); DEFINE_FWK_MODULE(ShallowSimTracksProducer); DEFINE_FWK_MODULE(ShallowGainCalibration); + +#include "PhysicsTools/NanoAOD/interface/SimpleFlatTableProducer.h" +typedef SimpleFlatTableProducer SimpleTrackFlatTableProducer; +DEFINE_FWK_MODULE(SimpleTrackFlatTableProducer); diff --git a/CalibTracker/SiStripCommon/plugins/SiStripDetInfoFileWriter.cc b/CalibTracker/SiStripCommon/plugins/SiStripDetInfoFileWriter.cc index 9aa18d1401659..e85d85cf9a99c 100644 --- a/CalibTracker/SiStripCommon/plugins/SiStripDetInfoFileWriter.cc +++ b/CalibTracker/SiStripCommon/plugins/SiStripDetInfoFileWriter.cc @@ -1,16 +1,52 @@ // -*- C++ -*- -// Package: SiStripCommon +// +// Package: SiStripDetInfoFileWriter // Class: SiStripDetInfoFileWriter -// Original Author: G. Bruno -// Created: Mon May 20 10:04:31 CET 2007 +// +/**\class SiStripDetInfoFileWriter SiStripDetInfoFileWriter.cc CalibTracker/SiStripCommon/src/SiStripDetInfoFileWriter.cc + + Description: -#include "CalibTracker/SiStripCommon/plugins/SiStripDetInfoFileWriter.h" + Implementation: + +*/ +// +// Original Author: G. Bruno +// Created: Mon Nov 20 10:04:31 CET 2006 +// +// + +// C++ includes +#include +#include +#include + +// User includes +#include "FWCore/Framework/interface/MakerMacros.h" +#include "FWCore/Framework/interface/one/EDAnalyzer.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" - #include "Geometry/CommonDetUnit/interface/GeomDet.h" #include "Geometry/CommonTopologies/interface/StripTopology.h" +#include "Geometry/Records/interface/TrackerDigiGeometryRecord.h" #include "Geometry/TrackerGeometryBuilder/interface/StripGeomDetUnit.h" +#include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h" + +class SiStripDetInfoFileWriter : public edm::one::EDAnalyzer { +public: + explicit SiStripDetInfoFileWriter(const edm::ParameterSet&); + ~SiStripDetInfoFileWriter() override; + +private: + void beginRun(const edm::Run&, const edm::EventSetup& iSetup) override; + void analyze(const edm::Event&, const edm::EventSetup&) override{}; + void endRun(const edm::Run&, const edm::EventSetup& iSetup) override{}; + +private: + std::ofstream outputFile_; + std::string filePath_; + edm::ESGetToken tkGeomToken_; +}; using namespace cms; using namespace std; @@ -55,13 +91,11 @@ void SiStripDetInfoFileWriter::beginRun(const edm::Run&, const edm::EventSetup& outputFile_ << detid << " " << numberOfAPVs << " " << stripLength << " " << thickness << "\n"; } } - outputFile_.close(); - - } - - else { + } else { edm::LogError("SiStripDetInfoFileWriter::beginRun - Unable to open file") << endl; return; } } + +DEFINE_FWK_MODULE(SiStripDetInfoFileWriter); diff --git a/CalibTracker/SiStripCommon/plugins/SiStripDetInfoFileWriter.h b/CalibTracker/SiStripCommon/plugins/SiStripDetInfoFileWriter.h deleted file mode 100644 index fd3d1353abc43..0000000000000 --- a/CalibTracker/SiStripCommon/plugins/SiStripDetInfoFileWriter.h +++ /dev/null @@ -1,44 +0,0 @@ -#ifndef CalibTracker_SiStripChannelGain_SiStripDetInfoFileWriter_h -#define CalibTracker_SiStripChannelGain_SiStripDetInfoFileWriter_h -// -*- C++ -*- -// -// Package: SiStripDetInfoFileWriter -// Class: SiStripDetInfoFileWriter -// -/**\class SiStripDetInfoFileWriter SiStripDetInfoFileWriter.cc CalibTracker/SiStripCommon/src/SiStripDetInfoFileWriter.cc - - Description: - - Implementation: - -*/ -// -// Original Author: G. Bruno -// Created: Mon Nov 20 10:04:31 CET 2006 -// -// - -#include "FWCore/Framework/interface/EDAnalyzer.h" -#include -#include -#include - -#include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h" -#include "Geometry/Records/interface/TrackerDigiGeometryRecord.h" - -class SiStripDetInfoFileWriter : public edm::EDAnalyzer { -public: - explicit SiStripDetInfoFileWriter(const edm::ParameterSet&); - ~SiStripDetInfoFileWriter() override; - -private: - void beginRun(const edm::Run&, const edm::EventSetup& iSetup) override; - - void analyze(const edm::Event&, const edm::EventSetup&) override{}; - -private: - std::ofstream outputFile_; - std::string filePath_; - edm::ESGetToken tkGeomToken_; -}; -#endif diff --git a/CalibTracker/SiStripCommon/plugins/SiStripLorentzAngleRunInfoTableProducer.cc b/CalibTracker/SiStripCommon/plugins/SiStripLorentzAngleRunInfoTableProducer.cc new file mode 100644 index 0000000000000..7e09ef4f58a7a --- /dev/null +++ b/CalibTracker/SiStripCommon/plugins/SiStripLorentzAngleRunInfoTableProducer.cc @@ -0,0 +1,107 @@ +#include "FWCore/Framework/interface/global/EDProducer.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/Framework/interface/ConsumesCollector.h" +#include "DataFormats/NanoAOD/interface/FlatTable.h" + +#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" +#include "FWCore/ParameterSet/interface/ParameterSetDescription.h" + +#include "MagneticField/Engine/interface/MagneticField.h" +#include "MagneticField/Records/interface/IdealMagneticFieldRecord.h" +#include "CondFormats/SiStripObjects/interface/SiStripLorentzAngle.h" +#include "CalibTracker/Records/interface/SiStripDependentRecords.h" +#include "Geometry/TrackerGeometryBuilder/interface/StripGeomDetUnit.h" +#include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h" +#include "Geometry/Records/interface/TrackerDigiGeometryRecord.h" + +#include "CalibTracker/SiStripCommon/interface/ShallowTools.h" + +class SiStripLorentzAngleRunInfoTableProducer : public edm::global::EDProducer { +public: + explicit SiStripLorentzAngleRunInfoTableProducer(const edm::ParameterSet& params) + : m_name{params.getParameter("name")}, + m_magFieldName{params.getParameter("magFieldName")}, + m_doc{params.existsAs("doc") ? params.getParameter("doc") : ""}, + m_tkGeomToken{esConsumes()}, + m_magFieldToken{esConsumes()}, + m_lorentzAngleToken{esConsumes()} { + produces(); + produces("magField"); + } + + void produce(edm::StreamID, edm::Event&, edm::EventSetup const&) const override {} + + static void fillDescriptions(edm::ConfigurationDescriptions& descriptions) { + edm::ParameterSetDescription desc; + desc.add("name", "Det"); + desc.add("magFieldName", "magField"); + desc.add("doc", "Run info for the Lorentz angle measurement"); + descriptions.add("siStripLorentzAngleRunInfoTable", desc); + } + + void globalBeginRunProduce(edm::Run& iRun, edm::EventSetup const& iSetup) const override; + +private: + const std::string m_name, m_magFieldName; + const std::string m_doc; + edm::ESGetToken m_tkGeomToken; + edm::ESGetToken m_magFieldToken; + edm::ESGetToken m_lorentzAngleToken; +}; + +namespace { + template + void addColumn(nanoaod::FlatTable* table, const std::string& name, VALUES&& values, const std::string& doc) { + using value_type = typename std::remove_reference::type::value_type; + table->template addColumn(name, values, doc); + } +} // namespace + +void SiStripLorentzAngleRunInfoTableProducer::globalBeginRunProduce(edm::Run& iRun, + edm::EventSetup const& iSetup) const { + const auto& tkGeom = iSetup.getData(m_tkGeomToken); + const auto& magField = iSetup.getData(m_magFieldToken); + const auto& lorentzAngle = iSetup.getData(m_lorentzAngleToken); + std::vector c_rawid; + std::vector c_globalZofunitlocalY, c_localB, c_BdotY, c_driftx, c_drifty, c_driftz, c_lorentzAngle; + + auto dets = tkGeom.detsTIB(); + dets.insert(dets.end(), tkGeom.detsTID().begin(), tkGeom.detsTID().end()); + dets.insert(dets.end(), tkGeom.detsTOB().begin(), tkGeom.detsTOB().end()); + dets.insert(dets.end(), tkGeom.detsTEC().begin(), tkGeom.detsTEC().end()); + for (auto det : dets) { + auto detid = det->geographicalId().rawId(); + const StripGeomDetUnit* stripDet = dynamic_cast(tkGeom.idToDet(det->geographicalId())); + if (stripDet) { + c_rawid.push_back(detid); + c_globalZofunitlocalY.push_back(stripDet->toGlobal(LocalVector(0, 1, 0)).z()); + const auto locB = magField.inTesla(stripDet->surface().position()); + c_localB.push_back(locB.mag()); + c_BdotY.push_back(stripDet->surface().toLocal(locB).y()); + const auto drift = shallow::drift(stripDet, magField, lorentzAngle); + c_driftx.push_back(drift.x()); + c_drifty.push_back(drift.y()); + c_driftz.push_back(drift.z()); + c_lorentzAngle.push_back(lorentzAngle.getLorentzAngle(detid)); + } + } + auto out = std::make_unique(c_rawid.size(), m_name, false, false); + addColumn(out.get(), "rawid", c_rawid, "DetId"); + addColumn(out.get(), "globalZofunitlocalY", c_globalZofunitlocalY, "z component of a local unit vector along y"); + addColumn(out.get(), "localB", c_localB, "Local magnitude of the magnetic field"); + addColumn(out.get(), "BdotY", c_BdotY, "Magnetic field projection on the local y axis"); + addColumn(out.get(), "driftx", c_driftx, "x component of the drift vector"); + addColumn(out.get(), "drifty", c_drifty, "y component of the drift vector"); + addColumn(out.get(), "driftz", c_driftz, "z component of the drift vector"); + addColumn(out.get(), "lorentzAngle", c_lorentzAngle, "Lorentz angle from database"); + iRun.put(std::move(out)); + + auto out2 = std::make_unique(1, m_magFieldName, true, false); + out2->addColumnValue( + "origin", magField.inTesla(GlobalPoint(0, 0, 0)).z(), "z-component of the magnetic field at (0,0,0) in Tesla"); + iRun.put(std::move(out2), "magField"); +} + +#include "FWCore/PluginManager/interface/ModuleDef.h" +#include "FWCore/Framework/interface/MakerMacros.h" +DEFINE_FWK_MODULE(SiStripLorentzAngleRunInfoTableProducer); diff --git a/CalibTracker/SiStripCommon/plugins/SiStripPositionCorrectionsTableProducer.cc b/CalibTracker/SiStripCommon/plugins/SiStripPositionCorrectionsTableProducer.cc new file mode 100644 index 0000000000000..1f7d93008807f --- /dev/null +++ b/CalibTracker/SiStripCommon/plugins/SiStripPositionCorrectionsTableProducer.cc @@ -0,0 +1,75 @@ +#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" +#include "FWCore/ParameterSet/interface/ParameterSetDescription.h" + +#include "Geometry/TrackerGeometryBuilder/interface/StripGeomDetUnit.h" +#include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h" +#include "Geometry/Records/interface/TrackerDigiGeometryRecord.h" + +#include "RecoLocalTracker/SiStripClusterizer/interface/SiStripClusterInfo.h" + +#include "CalibTracker/SiStripCommon/interface/SiStripOnTrackClusterTableProducerBase.h" + +class SiStripPositionCorrectionsTableProducer : public SiStripOnTrackClusterTableProducerBase { +public: + explicit SiStripPositionCorrectionsTableProducer(const edm::ParameterSet& params) + : SiStripOnTrackClusterTableProducerBase(params), + m_clusterInfo(consumesCollector()), + m_tkGeomToken{esConsumes<>()} {} + + static void fillDescriptions(edm::ConfigurationDescriptions& descriptions) { + edm::ParameterSetDescription desc; + desc.add("name", "cluster"); + desc.add("doc", "On-track cluster properties for Lorentz angle and backplane correction measurement"); + desc.add("extension", false); + desc.add("Tracks", edm::InputTag{"generalTracks"}); + descriptions.add("siStripPositionCorrectionsTable", desc); + } + + void fillTable(const std::vector& clusters, + const edm::View& tracks, + nanoaod::FlatTable* table, + const edm::EventSetup& iSetup) final; + +private: + SiStripClusterInfo m_clusterInfo; + edm::ESGetToken m_tkGeomToken; +}; + +void SiStripPositionCorrectionsTableProducer::fillTable(const std::vector& clusters, + const edm::View& tracks, + nanoaod::FlatTable* table, + const edm::EventSetup& iSetup) { + const auto& tkGeom = iSetup.getData(m_tkGeomToken); + std::vector c_nstrips; + std::vector c_barycenter, c_variance, c_localdirx, c_localdiry, c_localdirz, c_localx, c_rhlocalx, + c_rhlocalxerr; + for (const auto clus : clusters) { + c_nstrips.push_back(clus.cluster->amplitudes().size()); + m_clusterInfo.setCluster(*clus.cluster, clus.det); + c_variance.push_back(m_clusterInfo.variance()); + const auto& trajState = clus.measurement.updatedState(); + const auto trackDir = trajState.localDirection(); + c_localdirx.push_back(trackDir.x()); + c_localdiry.push_back(trackDir.y()); + c_localdirz.push_back(trackDir.z()); + const auto hit = clus.measurement.recHit()->hit(); + const auto stripDet = dynamic_cast(tkGeom.idToDet(hit->geographicalId())); + c_barycenter.push_back(stripDet->specificTopology().localPosition(clus.cluster->barycenter()).x()); + c_localx.push_back(stripDet->toLocal(trajState.globalPosition()).x()); + c_rhlocalx.push_back(hit->localPosition().x()); + c_rhlocalxerr.push_back(hit->localPositionError().xx()); + } + addColumn(table, "nstrips", c_nstrips, "cluster width"); + addColumn(table, "variance", c_variance, "Cluster variance"); + addColumn(table, "localdirx", c_localdirx, "x component of the local track direction"); + addColumn(table, "localdiry", c_localdiry, "y component of the local track direction"); + addColumn(table, "localdirz", c_localdirz, "z component of the local track direction"); + addColumn(table, "barycenter", c_barycenter, "Cluster barycenter (local x without corrections)"); + addColumn(table, "localx", c_localx, "Track local x"); + addColumn(table, "rhlocalx", c_rhlocalx, "RecHit local x"); + addColumn(table, "rhlocalxerr", c_rhlocalxerr, "RecHit local x uncertainty"); +} + +#include "FWCore/PluginManager/interface/ModuleDef.h" +#include "FWCore/Framework/interface/MakerMacros.h" +DEFINE_FWK_MODULE(SiStripPositionCorrectionsTableProducer); diff --git a/CalibTracker/SiStripCommon/src/SiStripOnTrackClusterTableProducerBase.cc b/CalibTracker/SiStripCommon/src/SiStripOnTrackClusterTableProducerBase.cc new file mode 100644 index 0000000000000..36e8804a3e88e --- /dev/null +++ b/CalibTracker/SiStripCommon/src/SiStripOnTrackClusterTableProducerBase.cc @@ -0,0 +1,68 @@ +#include "DataFormats/TrackerRecHit2D/interface/SiStripMatchedRecHit2D.h" +#include "DataFormats/TrackerRecHit2D/interface/SiStripRecHit2D.h" +#include "DataFormats/TrackerRecHit2D/interface/SiStripRecHit1D.h" + +#include "CalibTracker/SiStripCommon/interface/SiStripOnTrackClusterTableProducerBase.h" + +SiStripOnTrackClusterTableProducerBase::~SiStripOnTrackClusterTableProducerBase() {} + +namespace { + int findTrackIndex(const edm::View& tracks, const reco::Track* track) { + for (auto iTr = tracks.begin(); iTr != tracks.end(); ++iTr) { + if (&(*iTr) == track) { + return iTr - tracks.begin(); + } + } + return -2; + } +} // namespace + +void SiStripOnTrackClusterTableProducerBase::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) { + edm::Handle> tracks; + iEvent.getByToken(m_tracks_token, tracks); + edm::Handle trajTrackAssociations; + iEvent.getByToken(m_association_token, trajTrackAssociations); + + std::vector clusters{}; + + for (const auto& assoc : *trajTrackAssociations) { + const auto traj = assoc.key.get(); + const auto track = assoc.val.get(); + + for (const auto& meas : traj->measurements()) { + const auto& trajState = meas.updatedState(); + if (!trajState.isValid()) + continue; + + // there can be 2 (stereo module), 1 (no stereo module), or 0 (no strip hit) clusters per measurement + const auto trechit = meas.recHit()->hit(); + const auto simple1d = dynamic_cast(trechit); + const auto simple = dynamic_cast(trechit); + const auto matched = dynamic_cast(trechit); + if (matched) { + clusters.emplace_back(matched->monoId(), &matched->monoCluster(), traj, track, meas); + clusters.emplace_back(matched->stereoId(), &matched->stereoCluster(), traj, track, meas); + } else if (simple) { + clusters.emplace_back(simple->geographicalId().rawId(), simple->cluster().get(), traj, track, meas); + } else if (simple1d) { + clusters.emplace_back(simple1d->geographicalId().rawId(), simple1d->cluster().get(), traj, track, meas); + } + } + } + + auto out = std::make_unique(clusters.size(), m_name, false, m_extension); + if (!m_extension) { + std::vector c_trackindex; + c_trackindex.reserve(clusters.size()); + std::vector c_rawid; + c_rawid.reserve(clusters.size()); + for (const auto clus : clusters) { + c_trackindex.push_back(findTrackIndex(*tracks, clus.track)); + c_rawid.push_back(clus.det); + } + addColumn(out.get(), "trackindex", c_trackindex, "Track index"); + addColumn(out.get(), "rawid", c_rawid, "DetId"); + } + fillTable(clusters, *tracks, out.get(), iSetup); + iEvent.put(std::move(out)); +} diff --git a/CalibTracker/SiStripCommon/test/MakeCalibrationTrees/produceCalibrationTree_CosmicsLABP_cfg.py b/CalibTracker/SiStripCommon/test/MakeCalibrationTrees/produceCalibrationTree_CosmicsLABP_cfg.py new file mode 100644 index 0000000000000..bc5062a7a833b --- /dev/null +++ b/CalibTracker/SiStripCommon/test/MakeCalibrationTrees/produceCalibrationTree_CosmicsLABP_cfg.py @@ -0,0 +1,173 @@ +from __future__ import print_function +import FWCore.ParameterSet.Config as cms +from FWCore.ParameterSet.VarParsing import VarParsing + +################################################################### +# Setup 'standard' options +################################################################### +options = VarParsing() + +options.register('conditionGT', + "auto:run2_data", + VarParsing.multiplicity.singleton, + VarParsing.varType.string, + "condition global tag for the job (\"auto:run2_data\" is default)") + +options.register('conditionOverwrite', + "", + VarParsing.multiplicity.singleton, + VarParsing.varType.string, + "configuration to overwrite the condition into the GT (\"\" is default)") + +options.register('inputCollection', + "ALCARECOSiStripCalMinBias", + VarParsing.multiplicity.singleton, + VarParsing.varType.string, + "collections to be used for input (\"ALCARECOSiStripCalMinBias\" is default, use 'generalTracks' for prompt reco and 'ctfWithMaterialTracksP5' for cosmic reco)") + +options.register('outputFile', + "calibTreeTest.root", + VarParsing.multiplicity.singleton, + VarParsing.varType.string, + "name for the output root file (\"calibTreeTest.root\" is default)") + +options.register('inputFiles', + '/store/data/Run2018D/Cosmics/ALCARECO/SiStripCalCosmics-UL18-v1/40000/0346DCE4-0C70-1344-A7EB-D488B627208C.root', + VarParsing.multiplicity.list, + VarParsing.varType.string, + "file to process") + +options.register('maxEvents', + -1, + VarParsing.multiplicity.singleton, + VarParsing.varType.int, + "number of events to process (\"-1\" for all)") + +options.register('runNumber', + -1, + VarParsing.multiplicity.singleton, + VarParsing.varType.int, + "run number to process (\"-1\" for all)") + +options.register('cosmicTriggers', '', + VarParsing.multiplicity.list, + VarParsing.varType.string, + 'cosmic triggers') + +options.parseArguments() +################################################################### +# To use the prompt reco dataset please use 'generalTracks' as inputCollection +# To use the cosmic reco dataset please use 'ctfWithMaterialTracksP5' as inputCollection + + +process = cms.Process('CALIB') +process.load('Configuration/StandardSequences/MagneticField_cff') +process.load('Configuration.Geometry.GeometryRecoDB_cff') +process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') + +from Configuration.AlCa.GlobalTag import GlobalTag +process.GlobalTag = GlobalTag(process.GlobalTag, options.conditionGT, options.conditionOverwrite) + +process.load('FWCore.MessageService.MessageLogger_cfi') +process.load('Configuration.StandardSequences.Services_cff') + +process.maxEvents = cms.untracked.PSet(input=cms.untracked.int32(options.maxEvents)) + +process.source = cms.Source("PoolSource", fileNames=cms.untracked.vstring(options.inputFiles)) +if options.runNumber != -1: + if 'Cosmics' not in options.inputCollection: + print("Restricting to the following events :") + print('%s:1-%s:MAX'%(options.runNumber,options.runNumber)) + process.source.eventsToProcess = cms.untracked.VEventRange('%s:1-%s:MAX'%(options.runNumber,options.runNumber)) + else: + print("Restricting to the following lumis for Cosmic runs only:") + print('%s:1-%s:MAX'%(options.runNumber,options.runNumber)) + process.source.lumisToProcess = cms.untracked.VLuminosityBlockRange('%s:1-%s:MAX'%(options.runNumber,options.runNumber)) + +process.options = cms.untracked.PSet( + wantSummary = cms.untracked.bool(True) + ) +process.MessageLogger.cerr.FwkReport.reportEvery = 10000 + +inTracks = cms.InputTag(options.inputCollection) + +process.load('CalibTracker.SiStripCommon.prescaleEvent_cfi') +process.load('CalibTracker.Configuration.Filter_Refit_cff') +## use CalibrationTracks (for clusters) and CalibrationTracksRefit (for tracks) +process.CalibrationTracks.src = inTracks +tracksForCalib = cms.InputTag("CalibrationTracksRefit") + +process.prescaleEvent.prescale = 1 +process.load("CalibTracker.SiStripCommon.SiStripBFieldFilter_cfi") + +from HLTrigger.HLTfilters.triggerResultsFilter_cfi import triggerResultsFilter + +process.IsolatedMuonFilter = triggerResultsFilter.clone( + triggerConditions = cms.vstring("HLT_IsoMu20_*"), + hltResults = cms.InputTag("TriggerResults", "", "HLT"), + l1tResults = cms.InputTag(""), + throw = cms.bool(False) + ) +if len(options.cosmicTriggers) > 0: + print("Cosmic triggers: {0}".format(", ".join(options.cosmicTriggers))) + process.IsolatedMuonFilter.triggerConditions = cms.vstring(options.cosmicTriggers) +else: + print("Cosmic triggers: {0} (default)".format(", ".join(process.IsolatedMuonFilter.triggerConditions))) + print("Argument passed: {0}".format(options.cosmicTriggers)) + +process.TkCalSeq = cms.Sequence( + process.prescaleEvent* + process.IsolatedMuonFilter* + process.siStripBFieldOnFilter* + process.CalibrationTracks, + cms.Task(process.MeasurementTrackerEvent), + cms.Task(process.offlineBeamSpot), + cms.Task(process.CalibrationTracksRefit) + ) + +process.load("PhysicsTools.NanoAOD.nano_cff") +process.load("PhysicsTools.NanoAOD.NanoAODEDMEventContent_cff") + +## as a test: it should be possible to add tracks fully at configuration level (+ declaring the plugin) +from PhysicsTools.NanoAOD.common_cff import * +## this is equivalent to ShallowTrackProducer as configured for the gain calibration +process.tracksTable = cms.EDProducer("SimpleTrackFlatTableProducer", + src=tracksForCalib, + cut=cms.string(""), + name=cms.string("track"), + doc=cms.string("SiStripCalMinBias ALCARECO tracks"), + singleton=cms.bool(False), + extension=cms.bool(False), + variables=cms.PSet( + chi2ndof=Var("chi2()/ndof", float), + pt=Var("pt()", float), + hitsvalid=Var("numberOfValidHits()", int), ## unsigned? + phi=Var("phi()", float), + eta=Var("eta()", float), + ) + ) +process.load("CalibTracker.SiStripCommon.siStripPositionCorrectionsTable_cfi") +process.siStripPositionCorrectionsTable.Tracks = tracksForCalib +process.load("CalibTracker.SiStripCommon.siStripLorentzAngleRunInfoTable_cfi") + +siStripCalCosmicsNanoTables = cms.Task( + process.nanoMetadata, + process.tracksTable, + process.siStripPositionCorrectionsTable, + process.siStripLorentzAngleRunInfoTable + ) + +process.nanoCTPath = cms.Path(process.TkCalSeq, siStripCalCosmicsNanoTables) + +process.out = cms.OutputModule("NanoAODOutputModule", + fileName=cms.untracked.string(options.outputFile), + outputCommands=process.NANOAODEventContent.outputCommands+[ + "drop edmTriggerResults_*_*_*" + ], + SelectEvents=cms.untracked.PSet( + SelectEvents=cms.vstring("nanoCTPath") + ) + ) +process.end = cms.EndPath(process.out) + +process.schedule = cms.Schedule(process.nanoCTPath, process.end) diff --git a/CalibTracker/SiStripDCS/plugins/FilterTrackerOn.cc b/CalibTracker/SiStripDCS/plugins/FilterTrackerOn.cc index 7f490897bdf12..7c8d1ed6c6cb3 100644 --- a/CalibTracker/SiStripDCS/plugins/FilterTrackerOn.cc +++ b/CalibTracker/SiStripDCS/plugins/FilterTrackerOn.cc @@ -1,31 +1,74 @@ -#include "CalibTracker/SiStripDCS/plugins/FilterTrackerOn.h" +// -*- C++ -*- +// +// Package: CalibTracker/SiStripDCS/plugins +// Class: FilterTrackerOn +// +/**\class FilterTrackerOn FilterTrackerOn.cc -#include "FWCore/Framework/interface/EventSetup.h" + Description: EDFilter returning true when the number of modules with HV on in the Tracker is + above a given threshold. + +*/ +// +// Original Author: Marco DE MATTIA +// Created: 2010/03/10 10:51:00 +// +// +// system include files +#include #include #include +// user include files +#include "CondFormats/DataRecord/interface/SiStripCondDataRecords.h" +#include "CondFormats/SiStripObjects/interface/SiStripDetVOff.h" +#include "FWCore/Framework/interface/Event.h" +#include "FWCore/Framework/interface/EventSetup.h" +#include "FWCore/Framework/interface/Frameworkfwd.h" +#include "FWCore/Framework/interface/MakerMacros.h" +#include "FWCore/Framework/interface/stream/EDFilter.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/MessageLogger/interface/MessageLogger.h" + +class FilterTrackerOn : public edm::stream::EDFilter<> { +public: + explicit FilterTrackerOn(const edm::ParameterSet&); + static void fillDescriptions(edm::ConfigurationDescriptions&); + ~FilterTrackerOn() override; + +private: + bool filter(edm::Event&, const edm::EventSetup&) override; + + int minModulesWithHVoff_; + edm::ESGetToken detVOffToken_; +}; + FilterTrackerOn::FilterTrackerOn(const edm::ParameterSet& iConfig) : minModulesWithHVoff_(iConfig.getParameter("MinModulesWithHVoff")), detVOffToken_(esConsumes()) {} -FilterTrackerOn::~FilterTrackerOn() {} +FilterTrackerOn::~FilterTrackerOn() = default; + +void FilterTrackerOn::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { + edm::ParameterSetDescription desc; + desc.setComment("Filters out events in which at least a fraction of Tracker is DCS ON"); + desc.addUntracked("MinModulesWithHVoff", 0); + descriptions.addWithDefaultLabel(desc); +} bool FilterTrackerOn::filter(edm::Event& iEvent, const edm::EventSetup& iSetup) { using namespace edm; - const auto& detVOff = iSetup.getData(detVOffToken_); - // std::cout << "detVOff.getHVoffCounts() = " << detVOff.getHVoffCounts() << " < " << minModulesWithHVoff_; + LogDebug("FilterTrackerOn") << "detVOff.getHVoffCounts() = " << detVOff.getHVoffCounts() << " < " + << minModulesWithHVoff_; if (detVOff.getHVoffCounts() > minModulesWithHVoff_) { - // std::cout << " skipping event" << std::endl; + LogDebug("FilterTrackerOn") << " skipping event"; return false; } - // cout << " keeping event" << endl; + LogDebug("FilterTrackerOn") << " keeping event"; return true; } -// ------------ method called once each job just before starting event loop ------------ -void FilterTrackerOn::beginJob() {} - -// ------------ method called once each job just after ending the event loop ------------ -void FilterTrackerOn::endJob() {} +// EDFilter on the max number of modules with HV off +DEFINE_FWK_MODULE(FilterTrackerOn); diff --git a/CalibTracker/SiStripDCS/plugins/FilterTrackerOn.h b/CalibTracker/SiStripDCS/plugins/FilterTrackerOn.h deleted file mode 100644 index 8dec5dd9d7269..0000000000000 --- a/CalibTracker/SiStripDCS/plugins/FilterTrackerOn.h +++ /dev/null @@ -1,45 +0,0 @@ -// -*- C++ -*- -// -// Package: CalibTracker/SiStripDCS/plugins -// Class: SyncDCSO2O -// -/**\class FilterTrackerOn FilterTrackerOn.cc - - Description: EDFilter returning true when the number of modules with HV on in the Tracker is - above a given threshold. - -*/ -// -// Original Author: Marco DE MATTIA -// Created: 2010/03/10 10:51:00 -// -// - -// system include files -#include - -// user include files -#include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/EDFilter.h" - -#include "FWCore/Framework/interface/Event.h" -#include "FWCore/Framework/interface/MakerMacros.h" - -#include "FWCore/ParameterSet/interface/ParameterSet.h" - -#include "CondFormats/SiStripObjects/interface/SiStripDetVOff.h" -#include "CondFormats/DataRecord/interface/SiStripCondDataRecords.h" - -class FilterTrackerOn : public edm::EDFilter { -public: - explicit FilterTrackerOn(const edm::ParameterSet&); - ~FilterTrackerOn() override; - -private: - void beginJob() override; - bool filter(edm::Event&, const edm::EventSetup&) override; - void endJob() override; - - int minModulesWithHVoff_; - edm::ESGetToken detVOffToken_; -}; diff --git a/CalibTracker/SiStripDCS/plugins/SealModules.cc b/CalibTracker/SiStripDCS/plugins/SealModules.cc index b1a302e87c57b..8affcebcffd82 100644 --- a/CalibTracker/SiStripDCS/plugins/SealModules.cc +++ b/CalibTracker/SiStripDCS/plugins/SealModules.cc @@ -4,7 +4,3 @@ #include "FWCore/ServiceRegistry/interface/ServiceMaker.h" #include "CalibTracker/SiStripDCS/interface/SiStripDetVOffBuilder.h" DEFINE_FWK_SERVICE(SiStripDetVOffBuilder); - -// EDFilter on the max number of modules with HV off -#include "CalibTracker/SiStripDCS/plugins/FilterTrackerOn.h" -DEFINE_FWK_MODULE(FilterTrackerOn); diff --git a/CalibTracker/SiStripDCS/plugins/SiStripDetVOffHandler.cc b/CalibTracker/SiStripDCS/plugins/SiStripDetVOffHandler.cc index 226ff86079b6f..2c5079f695aa2 100644 --- a/CalibTracker/SiStripDCS/plugins/SiStripDetVOffHandler.cc +++ b/CalibTracker/SiStripDCS/plugins/SiStripDetVOffHandler.cc @@ -1,5 +1,5 @@ #include "FWCore/Framework/interface/Event.h" -#include "FWCore/Framework/interface/EDAnalyzer.h" +#include "FWCore/Framework/interface/one/EDAnalyzer.h" #include "FWCore/Framework/interface/MakerMacros.h" #include "FWCore/ServiceRegistry/interface/Service.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" @@ -11,7 +11,7 @@ #include "CalibTracker/SiStripDCS/interface/SiStripDetVOffBuilder.h" -class SiStripDetVOffHandler : public edm::EDAnalyzer { +class SiStripDetVOffHandler : public edm::one::EDAnalyzer<> { public: explicit SiStripDetVOffHandler(const edm::ParameterSet& iConfig); ~SiStripDetVOffHandler() override; @@ -43,7 +43,7 @@ SiStripDetVOffHandler::SiStripDetVOffHandler(const edm::ParameterSet& iConfig) m_condDb = m_localCondDbFile; } -SiStripDetVOffHandler::~SiStripDetVOffHandler() {} +SiStripDetVOffHandler::~SiStripDetVOffHandler() = default; void SiStripDetVOffHandler::analyze(const edm::Event& evt, const edm::EventSetup& evtSetup) { // get last payload from condDb diff --git a/CalibTracker/SiStripDCS/plugins/SiStripDetVOffPrinter.cc b/CalibTracker/SiStripDCS/plugins/SiStripDetVOffPrinter.cc index cc80302fa0594..86a17d6c149db 100644 --- a/CalibTracker/SiStripDCS/plugins/SiStripDetVOffPrinter.cc +++ b/CalibTracker/SiStripDCS/plugins/SiStripDetVOffPrinter.cc @@ -60,7 +60,7 @@ SiStripDetVOffPrinter::SiStripDetVOffPrinter(const edm::ParameterSet& iConfig) m_connectionPool.configure(); } -SiStripDetVOffPrinter::~SiStripDetVOffPrinter() {} +SiStripDetVOffPrinter::~SiStripDetVOffPrinter() = default; void SiStripDetVOffPrinter::analyze(const edm::Event& evt, const edm::EventSetup& evtSetup) { // use start and end time from config file diff --git a/CalibTracker/SiStripDCS/plugins/SiStripDetVOffTkMapPlotter.cc b/CalibTracker/SiStripDCS/plugins/SiStripDetVOffTkMapPlotter.cc index 52ccc3ac514ea..bfaa543608797 100644 --- a/CalibTracker/SiStripDCS/plugins/SiStripDetVOffTkMapPlotter.cc +++ b/CalibTracker/SiStripDCS/plugins/SiStripDetVOffTkMapPlotter.cc @@ -1,5 +1,5 @@ #include "FWCore/Framework/interface/Event.h" -#include "FWCore/Framework/interface/EDAnalyzer.h" +#include "FWCore/Framework/interface/one/EDAnalyzer.h" #include "FWCore/Framework/interface/MakerMacros.h" #include "FWCore/ServiceRegistry/interface/Service.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" @@ -19,12 +19,11 @@ #include "DQM/SiStripCommon/interface/TkHistoMap.h" #include "CommonTools/TrackerMap/interface/TrackerMap.h" -class SiStripDetVOffTkMapPlotter : public edm::EDAnalyzer { +class SiStripDetVOffTkMapPlotter : public edm::one::EDAnalyzer<> { public: explicit SiStripDetVOffTkMapPlotter(const edm::ParameterSet& iConfig); ~SiStripDetVOffTkMapPlotter() override; void analyze(const edm::Event& evt, const edm::EventSetup& evtSetup) override; - void endJob() override; private: std::string formatIOV(cond::Time_t iov, std::string format = "%Y-%m-%d__%H_%M_%S"); @@ -60,7 +59,7 @@ SiStripDetVOffTkMapPlotter::SiStripDetVOffTkMapPlotter(const edm::ParameterSet& m_connectionPool.configure(); } -SiStripDetVOffTkMapPlotter::~SiStripDetVOffTkMapPlotter() {} +SiStripDetVOffTkMapPlotter::~SiStripDetVOffTkMapPlotter() = default; void SiStripDetVOffTkMapPlotter::analyze(const edm::Event& evt, const edm::EventSetup& evtSetup) { cond::Time_t theIov = 0; @@ -121,8 +120,6 @@ void SiStripDetVOffTkMapPlotter::analyze(const edm::Event& evt, const edm::Event } } -void SiStripDetVOffTkMapPlotter::endJob() {} - std::string SiStripDetVOffTkMapPlotter::formatIOV(cond::Time_t iov, std::string format) { auto facet = new boost::posix_time::time_facet(format.c_str()); std::ostringstream stream; diff --git a/CalibTracker/SiStripDCS/plugins/SiStripDetVOffTrendPlotter.cc b/CalibTracker/SiStripDCS/plugins/SiStripDetVOffTrendPlotter.cc index 5565d22c58fd3..e55053925de2c 100644 --- a/CalibTracker/SiStripDCS/plugins/SiStripDetVOffTrendPlotter.cc +++ b/CalibTracker/SiStripDCS/plugins/SiStripDetVOffTrendPlotter.cc @@ -1,5 +1,5 @@ #include "FWCore/Framework/interface/Event.h" -#include "FWCore/Framework/interface/EDAnalyzer.h" +#include "FWCore/Framework/interface/one/EDAnalyzer.h" #include "FWCore/Framework/interface/MakerMacros.h" #include "FWCore/ServiceRegistry/interface/Service.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" @@ -26,14 +26,13 @@ #include #include -class SiStripDetVOffTrendPlotter : public edm::EDAnalyzer { +class SiStripDetVOffTrendPlotter : public edm::one::EDAnalyzer<> { public: const std::vector PLOT_COLORS{kRed, kBlue, kBlack, kOrange, kMagenta}; explicit SiStripDetVOffTrendPlotter(const edm::ParameterSet &iConfig); ~SiStripDetVOffTrendPlotter() override; void analyze(const edm::Event &evt, const edm::EventSetup &evtSetup) override; - void endJob() override; private: std::string formatIOV(cond::Time_t iov, std::string format = "%Y-%m-%d__%H_%M_%S"); @@ -212,8 +211,6 @@ void SiStripDetVOffTrendPlotter::analyze(const edm::Event &evt, const edm::Event } } -void SiStripDetVOffTrendPlotter::endJob() {} - std::string SiStripDetVOffTrendPlotter::formatIOV(cond::Time_t iov, std::string format) { auto facet = new boost::posix_time::time_facet(format.c_str()); std::ostringstream stream; diff --git a/CalibTracker/SiStripDCS/plugins/TkVoltageMapCreator.cc b/CalibTracker/SiStripDCS/plugins/TkVoltageMapCreator.cc index 1b79296cbe9e7..c479acc1b5231 100644 --- a/CalibTracker/SiStripDCS/plugins/TkVoltageMapCreator.cc +++ b/CalibTracker/SiStripDCS/plugins/TkVoltageMapCreator.cc @@ -11,7 +11,7 @@ #include #include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/EDAnalyzer.h" +#include "FWCore/Framework/interface/one/EDAnalyzer.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/MakerMacros.h" @@ -29,7 +29,7 @@ // class decleration // -class TkVoltageMapCreator : public edm::EDAnalyzer { +class TkVoltageMapCreator : public edm::one::EDAnalyzer { public: explicit TkVoltageMapCreator(const edm::ParameterSet&); ~TkVoltageMapCreator() override; @@ -73,10 +73,7 @@ TkVoltageMapCreator::TkVoltageMapCreator(const edm::ParameterSet& iConfig) //now do what ever initialization is needed } -TkVoltageMapCreator::~TkVoltageMapCreator() { - // do anything here that needs to be done at desctruction time - // (e.g. close files, deallocate resources etc.) -} +TkVoltageMapCreator::~TkVoltageMapCreator() = default; // // member functions diff --git a/CalibTracker/SiStripESProducers/plugins/DBWriter/DummyCondDBWriter.h b/CalibTracker/SiStripESProducers/plugins/DBWriter/DummyCondDBWriter.h index 3e948958f0517..65fa38cdf2db4 100644 --- a/CalibTracker/SiStripESProducers/plugins/DBWriter/DummyCondDBWriter.h +++ b/CalibTracker/SiStripESProducers/plugins/DBWriter/DummyCondDBWriter.h @@ -68,7 +68,7 @@ void DummyCondDBWriter::endRun(const edm::Run& run, else Time_ = iConfig_.getUntrackedParameter("OpenIovAtTime", 1); - dbservice->writeOne(obj.release(), Time_, rcdName); + dbservice->writeOne(*obj, Time_, rcdName); } else { edm::LogError("SiStripFedCablingBuilder") << "Service is unavailable" << std::endl; } diff --git a/CalibTracker/SiStripESProducers/plugins/DBWriter/SiStripFedCablingManipulator.cc b/CalibTracker/SiStripESProducers/plugins/DBWriter/SiStripFedCablingManipulator.cc index 4d4432bdca850..20c230a5c48a3 100644 --- a/CalibTracker/SiStripESProducers/plugins/DBWriter/SiStripFedCablingManipulator.cc +++ b/CalibTracker/SiStripESProducers/plugins/DBWriter/SiStripFedCablingManipulator.cc @@ -41,12 +41,12 @@ void SiStripFedCablingManipulator::endRun(const edm::Run& run, const edm::EventS edm::LogInfo("SiStripFedCablingManipulator") << "first request for storing objects with Record " << "SiStripFedCablingRcd" << " at time " << Time_ << std::endl; - dbservice->createNewIOV(obj.release(), Time_, dbservice->endOfTime(), "SiStripFedCablingRcd"); + dbservice->createNewIOV(*obj, Time_, "SiStripFedCablingRcd"); } else { edm::LogInfo("SiStripFedCablingManipulator") << "appending a new object to existing tag " << "SiStripFedCablingRcd" << " in since mode " << std::endl; - dbservice->appendSinceTime(obj.release(), Time_, "SiStripFedCablingRcd"); + dbservice->appendSinceTime(*obj, Time_, "SiStripFedCablingRcd"); } } else { edm::LogError("SiStripFedCablingManipulator") << "Service is unavailable" << std::endl; diff --git a/CalibTracker/SiStripLorentzAngle/interface/SiStripLAProfileBooker.h b/CalibTracker/SiStripLorentzAngle/interface/SiStripLAProfileBooker.h index 4ca90c18f8235..ee72005afe896 100644 --- a/CalibTracker/SiStripLorentzAngle/interface/SiStripLAProfileBooker.h +++ b/CalibTracker/SiStripLorentzAngle/interface/SiStripLAProfileBooker.h @@ -3,7 +3,7 @@ #include -#include "FWCore/Framework/interface/EDAnalyzer.h" +#include "FWCore/Framework/interface/one/EDAnalyzer.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h" @@ -30,7 +30,7 @@ class TrackerTopology; -class SiStripLAProfileBooker : public edm::EDAnalyzer { +class SiStripLAProfileBooker : public edm::one::EDAnalyzer { public: typedef dqm::legacy::MonitorElement MonitorElement; typedef dqm::legacy::DQMStore DQMStore; @@ -40,6 +40,8 @@ class SiStripLAProfileBooker : public edm::EDAnalyzer { void beginRun(edm::Run const&, const edm::EventSetup& c) override; + void endRun(edm::Run const&, const edm::EventSetup& c) override; + void endJob() override; void analyze(const edm::Event& e, const edm::EventSetup& c) override; diff --git a/CalibTracker/SiStripLorentzAngle/plugins/EnsembleCalibrationLA.cc b/CalibTracker/SiStripLorentzAngle/plugins/EnsembleCalibrationLA.cc index 48a1576d89a40..9f2bafdb5dc26 100644 --- a/CalibTracker/SiStripLorentzAngle/plugins/EnsembleCalibrationLA.cc +++ b/CalibTracker/SiStripLorentzAngle/plugins/EnsembleCalibrationLA.cc @@ -3,7 +3,6 @@ #include "FWCore/ParameterSet/interface/ParameterSet.h" #include #include -#include #include #include @@ -21,6 +20,8 @@ namespace sistrip { vMethods(conf.getParameter >("Methods")), tTopoToken_(esConsumes()) {} + EnsembleCalibrationLA::~EnsembleCalibrationLA(){}; + void EnsembleCalibrationLA::endJob() { Book book("la_ensemble"); TChain* const chain = new TChain("la_ensemble"); @@ -42,6 +43,8 @@ namespace sistrip { write_calibrations(); } + void EnsembleCalibrationLA::beginRun(const edm::Run&, const edm::EventSetup& eSetup) {} + void EnsembleCalibrationLA::endRun(const edm::Run&, const edm::EventSetup& eSetup) { tTopo_ = &eSetup.getData(tTopoToken_); } @@ -64,7 +67,7 @@ namespace sistrip { if (std::regex_match(ensemble.first, format)) { const bool TIB = "TIB" == std::regex_replace(ensemble.first, format, "\\1"); const bool stereo = "s" == std::regex_replace(ensemble.first, format, "\\3"); - const unsigned layer = boost::lexical_cast(std::regex_replace(ensemble.first, format, "\\2")); + const unsigned layer = std::stoul(std::regex_replace(ensemble.first, format, "\\2")); label = std::regex_replace(ensemble.first, format, "\\4"); index = LA_Filler_Fitter::layer_index(TIB, stereo, layer); diff --git a/CalibTracker/SiStripLorentzAngle/plugins/EnsembleCalibrationLA.h b/CalibTracker/SiStripLorentzAngle/plugins/EnsembleCalibrationLA.h index 584a711c89933..6b7d4b9a6b018 100644 --- a/CalibTracker/SiStripLorentzAngle/plugins/EnsembleCalibrationLA.h +++ b/CalibTracker/SiStripLorentzAngle/plugins/EnsembleCalibrationLA.h @@ -2,18 +2,21 @@ #define CalibTracker_SiStripLorentzAngle_EnsembleCalibrationLA_h #include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/EDAnalyzer.h" +#include "FWCore/Framework/interface/one/EDAnalyzer.h" #include "CalibTracker/SiStripLorentzAngle/interface/LA_Filler_Fitter.h" #include "Geometry/Records/interface/TrackerTopologyRcd.h" namespace sistrip { - class EnsembleCalibrationLA : public edm::EDAnalyzer { + class EnsembleCalibrationLA : public edm::one::EDAnalyzer { public: explicit EnsembleCalibrationLA(const edm::ParameterSet&); void analyze(const edm::Event&, const edm::EventSetup&) override {} + void beginRun(const edm::Run&, const edm::EventSetup&) override; void endRun(const edm::Run&, const edm::EventSetup&) override; void endJob() override; + ~EnsembleCalibrationLA() override; + private: void write_ensembles_text(const Book&); void write_ensembles_plots(const Book&) const; diff --git a/CalibTracker/SiStripLorentzAngle/plugins/MeasureLA.cc b/CalibTracker/SiStripLorentzAngle/plugins/MeasureLA.cc index 2e6bd68da8909..cf1f860066349 100644 --- a/CalibTracker/SiStripLorentzAngle/plugins/MeasureLA.cc +++ b/CalibTracker/SiStripLorentzAngle/plugins/MeasureLA.cc @@ -3,7 +3,6 @@ #include "CalibTracker/SiStripCommon/interface/SiStripDetInfoFileReader.h" #include "CalibTracker/StandaloneTrackerTopology/interface/StandaloneTrackerTopology.h" -#include #include #include #include @@ -184,7 +183,7 @@ namespace sistrip { std::regex format(".*(T[IO]B)_layer(\\d)([as]).*"); const bool isTIB = "TIB" == std::regex_replace(layer, format, "\\1"); const bool stereo = "s" == std::regex_replace(layer, format, "\\3"); - const unsigned layerNum = boost::lexical_cast(std::regex_replace(layer, format, "\\2")); + const unsigned layerNum = std::stoul(std::regex_replace(layer, format, "\\2")); return std::make_pair(LA_Filler_Fitter::layer_index(isTIB, stereo, layerNum), method); } diff --git a/CalibTracker/SiStripLorentzAngle/plugins/SiStripLAProfileBooker.cc b/CalibTracker/SiStripLorentzAngle/plugins/SiStripLAProfileBooker.cc index a0596808db304..c4a87b1562b0f 100644 --- a/CalibTracker/SiStripLorentzAngle/plugins/SiStripLAProfileBooker.cc +++ b/CalibTracker/SiStripLorentzAngle/plugins/SiStripLAProfileBooker.cc @@ -237,6 +237,8 @@ void SiStripLAProfileBooker::beginRun(const edm::Run&, const edm::EventSetup& c) TrackCounter = 1; } +void SiStripLAProfileBooker::endRun(const edm::Run&, const edm::EventSetup& c) {} + SiStripLAProfileBooker::~SiStripLAProfileBooker() { detparmap::iterator detpariter; for (detpariter = detmap.begin(); detpariter != detmap.end(); ++detpariter) diff --git a/CalibTracker/SiStripLorentzAngle/src/LA_Results.cc b/CalibTracker/SiStripLorentzAngle/src/LA_Results.cc index ebdff1c20c389..b9ce21ae6e018 100644 --- a/CalibTracker/SiStripLorentzAngle/src/LA_Results.cc +++ b/CalibTracker/SiStripLorentzAngle/src/LA_Results.cc @@ -3,7 +3,6 @@ #include #include -#include #include #include #include @@ -60,8 +59,8 @@ LA_Filler_Fitter::Result LA_Filler_Fitter::result(Method m, const std::string na std::map LA_Filler_Fitter::module_results(const Book& book, const Method m) { std::map results; for (Book::const_iterator it = book.begin(".*_module\\d*" + method(m)); it != book.end(); ++it) { - const uint32_t detid = boost::lexical_cast( - std::regex_replace(it->first, std::regex(".*_module(\\d*)_.*"), std::string("\\1"))); + const uint32_t detid = + std::stoul(std::regex_replace(it->first, std::regex(".*_module(\\d*)_.*"), std::string("\\1"))); results[detid] = result(m, it->first, book); } return results; diff --git a/Calibration/EcalAlCaRecoProducers/plugins/SelectedElectronFEDListProducer.cc b/Calibration/EcalAlCaRecoProducers/plugins/SelectedElectronFEDListProducer.cc index c020bc7a498c9..71e552878eb9a 100644 --- a/Calibration/EcalAlCaRecoProducers/plugins/SelectedElectronFEDListProducer.cc +++ b/Calibration/EcalAlCaRecoProducers/plugins/SelectedElectronFEDListProducer.cc @@ -8,21 +8,13 @@ #include "FWCore/ParameterSet/interface/ParameterSetDescription.h" #include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" -//#include "DataFormats/Common/interface/Handle.h" - #include "DataFormats/FEDRawData/interface/FEDRawDataCollection.h" #include "FWCore/Utilities/interface/InputTag.h" // raw data #include "DataFormats/FEDRawData/interface/FEDRawData.h" -//#include "DataFormats/FEDRawData/interface/FEDNumbering.h" // Geometry -#include "Geometry/CaloGeometry/interface/CaloGeometry.h" #include "Geometry/HcalTowerAlgo/interface/HcalGeometry.h" -#include "Geometry/EcalMapping/interface/EcalElectronicsMapping.h" -// strip geometry -#include "CalibFormats/SiStripObjects/interface/SiStripRegionCabling.h" -#include "CalibTracker/Records/interface/SiStripRegionCablingRcd.h" // egamma objects #include "DataFormats/EgammaReco/interface/SuperCluster.h" @@ -37,7 +29,6 @@ // Strip and pixel #include "CondFormats/SiStripObjects/interface/SiStripFedCabling.h" -#include "CondFormats/SiPixelObjects/interface/SiPixelFedCablingMap.h" // detector id #include "DataFormats/HcalDetId/interface/HcalDetId.h" @@ -47,30 +38,26 @@ #include "DataFormats/TrackingRecHit/interface/TrackingRecHitFwd.h" // Geometry #include "Geometry/Records/interface/CaloTopologyRecord.h" -#include "Geometry/EcalMapping/interface/EcalMappingRcd.h" #include "Geometry/EcalAlgo/interface/EcalPreshowerGeometry.h" -#include "Geometry/Records/interface/CaloGeometryRecord.h" -#include "Geometry/Records/interface/TrackerDigiGeometryRecord.h" -#include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h" // strip geometry #include "CalibFormats/SiStripObjects/interface/SiStripDetCabling.h" -#include "CalibTracker/Records/interface/SiStripDetCablingRcd.h" // Message logger #include "FWCore/MessageLogger/interface/MessageLogger.h" // Strip and pixel #include "CondFormats/SiStripObjects/interface/FedChannelConnection.h" -#include "CondFormats/DataRecord/interface/SiPixelFedCablingMapRcd.h" #include "CondFormats/SiPixelObjects/interface/SiPixelFedCablingTree.h" -// Hcal objects -#include "CalibFormats/HcalObjects/interface/HcalDbService.h" -#include "CalibFormats/HcalObjects/interface/HcalDbRecord.h" - using namespace std; /// Producer constructor template -SelectedElectronFEDListProducer::SelectedElectronFEDListProducer(const edm::ParameterSet& iConfig) { +SelectedElectronFEDListProducer::SelectedElectronFEDListProducer(const edm::ParameterSet& iConfig) + : hcalDbToken_(esConsumes()), + ecalMappingToken_(esConsumes()), + caloGeometryToken_(esConsumes()), + siPixelFedCablingMapToken_(esConsumes()), + trackerGeometryToken_(esConsumes()), + siStripRegionCablingToken_(esConsumes()) { // input electron collection Tag if (iConfig.existsAs>("electronTags")) { electronTags_ = iConfig.getParameter>("electronTags"); @@ -309,36 +296,30 @@ void SelectedElectronFEDListProducer::beginJob() { template void SelectedElectronFEDListProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) { // get the hcal electronics map - edm::ESHandle pSetup; - iSetup.get().get(pSetup); - HcalReadoutMap_ = pSetup->getHcalMapping(); + const auto& pSetup = iSetup.getData(hcalDbToken_); + HcalReadoutMap_ = pSetup.getHcalMapping(); // get the ecal electronics map - edm::ESHandle ecalmapping; - iSetup.get().get(ecalmapping); - EcalMapping_ = ecalmapping.product(); + EcalMapping_ = &iSetup.getData(ecalMappingToken_); // get the calo geometry - edm::ESHandle caloGeometry; - iSetup.get().get(caloGeometry); - GeometryCalo_ = caloGeometry.product(); + const auto& caloGeometry = iSetup.getData(caloGeometryToken_); + GeometryCalo_ = &caloGeometry; //ES geometry - GeometryES_ = caloGeometry->getSubdetectorGeometry(DetId::Ecal, EcalPreshower); + GeometryES_ = caloGeometry.getSubdetectorGeometry(DetId::Ecal, EcalPreshower); // pixel tracker cabling map - edm::ESTransientHandle pixelCablingMap; - iSetup.get().get(pixelCablingMap); + const auto pixelCablingMap = iSetup.getTransientHandle(siPixelFedCablingMapToken_); PixelCabling_.reset(); PixelCabling_ = pixelCablingMap->cablingTree(); - edm::ESHandle trackerGeometry; - iSetup.get().get(trackerGeometry); + const auto& trackerGeometry = iSetup.getData(trackerGeometryToken_); if (pixelModuleVector_.empty()) { // build the tracker pixel module map - std::vector::const_iterator itTracker = trackerGeometry->dets().begin(); - for (; itTracker != trackerGeometry->dets().end(); ++itTracker) { + std::vector::const_iterator itTracker = trackerGeometry.dets().begin(); + for (; itTracker != trackerGeometry.dets().end(); ++itTracker) { int subdet = (*itTracker)->geographicalId().subdetId(); if (!(subdet == PixelSubdetector::PixelBarrel || subdet == PixelSubdetector::PixelEndcap)) continue; @@ -357,9 +338,7 @@ void SelectedElectronFEDListProducer::produce(edm::Event& iEvent, c std::sort(pixelModuleVector_.begin(), pixelModuleVector_.end()); } - edm::ESHandle SiStripCablingHandle; - iSetup.get().get(SiStripCablingHandle); - StripRegionCabling_ = SiStripCablingHandle.product(); + StripRegionCabling_ = &iSetup.getData(siStripRegionCablingToken_); SiStripRegionCabling::Cabling SiStripCabling; SiStripCabling = StripRegionCabling_->getRegionCabling(); diff --git a/Calibration/EcalAlCaRecoProducers/plugins/SelectedElectronFEDListProducer.h b/Calibration/EcalAlCaRecoProducers/plugins/SelectedElectronFEDListProducer.h index 006b01cf69721..16157c5d0e6ec 100644 --- a/Calibration/EcalAlCaRecoProducers/plugins/SelectedElectronFEDListProducer.h +++ b/Calibration/EcalAlCaRecoProducers/plugins/SelectedElectronFEDListProducer.h @@ -1,17 +1,33 @@ -#ifndef SelectedElectronFEDListProducer_h -#define SelectedElectronFEDListProducer_h +#ifndef Calibration_EcalAlCaRecoProducers_SelectedElectronFEDListProducer_h +#define Calibration_EcalAlCaRecoProducers_SelectedElectronFEDListProducer_h #include "DataFormats/BeamSpot/interface/BeamSpot.h" // egamma objects #include "DataFormats/HLTReco/interface/TriggerFilterObjectWithRefs.h" +#include "Geometry/EcalMapping/interface/EcalElectronicsMapping.h" +// Geometry +#include "Geometry/CaloGeometry/interface/CaloGeometry.h" +#include "Geometry/EcalMapping/interface/EcalMappingRcd.h" +#include "Geometry/Records/interface/CaloGeometryRecord.h" +#include "Geometry/Records/interface/TrackerDigiGeometryRecord.h" +#include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h" +// strip geometry +#include "CalibFormats/SiStripObjects/interface/SiStripRegionCabling.h" +#include "CalibTracker/Records/interface/SiStripDetCablingRcd.h" +#include "CalibTracker/Records/interface/SiStripRegionCablingRcd.h" +// Strip and pixel +#include "CondFormats/DataRecord/interface/SiPixelFedCablingMapRcd.h" +#include "CondFormats/SiPixelObjects/interface/SiPixelFedCablingMap.h" +// Hcal objects +#include "CalibFormats/HcalObjects/interface/HcalDbService.h" +#include "CalibFormats/HcalObjects/interface/HcalDbRecord.h" + // Math #include "DataFormats/Math/interface/normalizedPhi.h" #include "FWCore/Framework/interface/stream/EDProducer.h" -// #include "FWCore/Framework/interface/EDProducer.h" #include "FWCore/Framework/interface/EventSetup.h" -#include "FWCore/Framework/interface/ESHandle.h" // Message logger #include "FWCore/ServiceRegistry/interface/Service.h" @@ -19,14 +35,10 @@ class InputTag; class FEDRawDataCollection; -class SiPixelFedCablingMap; class SiPixelFedCablingTree; class SiStripFedCabling; -class SiStripRegionCabling; -class CaloGeometry; class CaloSubdetectorGeometry; -class EcalElectronicsMapping; class HcalElectronicsMap; // Hcal rec hit: this is a Fwd file defining typedefs @@ -131,6 +143,14 @@ class SelectedElectronFEDListProducer : public edm::stream::EDProducer<> { std::vector > recoEcalCandidateToken_; std::vector > electronToken_; + // Token for the input collection + const edm::ESGetToken hcalDbToken_; + const edm::ESGetToken ecalMappingToken_; + const edm::ESGetToken caloGeometryToken_; + const edm::ESGetToken siPixelFedCablingMapToken_; + const edm::ESGetToken trackerGeometryToken_; + const edm::ESGetToken siStripRegionCablingToken_; + // used inside the producer math::XYZVector beamSpotPosition_; diff --git a/Calibration/EcalAlCaRecoProducers/test/AlCaDoubleElectrons_cfg.py b/Calibration/EcalAlCaRecoProducers/test/AlCaDoubleElectrons_cfg.py index fc99782e80542..3a10b2e7867c3 100644 --- a/Calibration/EcalAlCaRecoProducers/test/AlCaDoubleElectrons_cfg.py +++ b/Calibration/EcalAlCaRecoProducers/test/AlCaDoubleElectrons_cfg.py @@ -3,7 +3,7 @@ process = cms.Process("AlCaElectronsProduction") process.load("FWCore.MessageLogger.MessageLogger_cfi") -process.load("Configuration.StandardSequences.Geometry_cff") +process.load("Configuration.StandardSequences.GeometryDB_cff") process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff") process.GlobalTag.globaltag = cms.string('GR_R_52_V7::All') process.load("Configuration.StandardSequences.MagneticField_cff") diff --git a/Calibration/EcalCalibAlgos/interface/ECALpedestalPCLHarvester.h b/Calibration/EcalCalibAlgos/interface/ECALpedestalPCLHarvester.h index 388ccf14639be..bb607057da860 100644 --- a/Calibration/EcalCalibAlgos/interface/ECALpedestalPCLHarvester.h +++ b/Calibration/EcalCalibAlgos/interface/ECALpedestalPCLHarvester.h @@ -29,6 +29,8 @@ #include "DataFormats/EcalDetId/interface/EEDetId.h" #include "CondFormats/EcalObjects/interface/EcalPedestals.h" #include "CondFormats/EcalObjects/interface/EcalChannelStatus.h" +#include "CondFormats/DataRecord/interface/EcalPedestalsRcd.h" +#include "CondFormats/DataRecord/interface/EcalChannelStatusRcd.h" class ECALpedestalPCLHarvester : public DQMEDHarvester { public: @@ -41,24 +43,30 @@ class ECALpedestalPCLHarvester : public DQMEDHarvester { void dqmPlots(const EcalPedestals& newpeds, DQMStore::IBooker& ibooker); - const EcalPedestals* currentPedestals_; - const EcalPedestals* g6g1Pedestals_; - const EcalChannelStatus* channelStatus_; + bool checkVariation(const EcalPedestalsMap& oldPedestals, const EcalPedestalsMap& newPedestals); bool checkStatusCode(const DetId& id); bool isGood(const DetId& id); - bool checkVariation(const EcalPedestalsMap& oldPedestals, const EcalPedestalsMap& newPedestals); std::vector chStatusToExclude_; - int minEntries_; + const int minEntries_; int entriesEB_[EBDetId::kSizeForDenseIndexing]; int entriesEE_[EEDetId::kSizeForDenseIndexing]; - bool checkAnomalies_; // whether or not to avoid creating sqlite file in case of many changed pedestals - double nSigma_; // threshold in sigmas to define a pedestal as changed - double thresholdAnomalies_; // threshold (fraction of changed pedestals) to avoid creation of sqlite file - std::string dqmDir_; // DQM directory where histograms are stored - std::string labelG6G1_; // DB label from which pedestals for G6 and G1 are to be copied - float threshDiffEB_; // if the new pedestals differs more than this from old, keep old - float threshDiffEE_; // same as above for EE. Stray channel protection - float threshChannelsAnalyzed_; // threshold for minimum percentage of channels analized to produce DQM plots + const bool checkAnomalies_; // whether or not to avoid creating sqlite file in case of many changed pedestals + const double nSigma_; // threshold in sigmas to define a pedestal as changed + const double thresholdAnomalies_; // threshold (fraction of changed pedestals) to avoid creation of sqlite file + const std::string dqmDir_; // DQM directory where histograms are stored + const std::string labelG6G1_; // DB label from which pedestals for G6 and G1 are to be copied + const float threshDiffEB_; // if the new pedestals differs more than this from old, keep old + const float threshDiffEE_; // same as above for EE. Stray channel protection + const float threshChannelsAnalyzed_; // threshold for minimum percentage of channels analized to produce DQM plots + + // ES token + const edm::ESGetToken channelsStatusToken_; + const edm::ESGetToken pedestalsToken_; + const edm::ESGetToken g6g1PedestalsToken_; + + const EcalPedestals* currentPedestals_; + const EcalPedestals* g6g1Pedestals_; + const EcalChannelStatus* channelStatus_; }; diff --git a/Calibration/EcalCalibAlgos/interface/ECALpedestalPCLworker.h b/Calibration/EcalCalibAlgos/interface/ECALpedestalPCLworker.h index 8c5014c873740..2dc10a29a8577 100644 --- a/Calibration/EcalCalibAlgos/interface/ECALpedestalPCLworker.h +++ b/Calibration/EcalCalibAlgos/interface/ECALpedestalPCLworker.h @@ -23,6 +23,8 @@ #include "FWCore/Framework/interface/MakerMacros.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "CondFormats/EcalObjects/interface/EcalPedestals.h" +#include "CondFormats/DataRecord/interface/EcalPedestalsRcd.h" #include "DataFormats/EcalDigi/interface/EcalDigiCollections.h" #include "DataFormats/TCDS/interface/BSTRecord.h" #include "DataFormats/TCDS/interface/TCDSRecord.h" @@ -43,6 +45,7 @@ class ECALpedestalPCLworker : public DQMEDAnalyzer { edm::EDGetTokenT digiTokenEB_; edm::EDGetTokenT digiTokenEE_; edm::EDGetTokenT tcdsToken_; + const edm::ESGetToken pedestalToken_; std::vector meEB_; std::vector meEE_; diff --git a/Calibration/EcalCalibAlgos/interface/EcalEleCalibLooper.h b/Calibration/EcalCalibAlgos/interface/EcalEleCalibLooper.h index 4508b89ebd4a0..856124fc12240 100644 --- a/Calibration/EcalCalibAlgos/interface/EcalEleCalibLooper.h +++ b/Calibration/EcalCalibAlgos/interface/EcalEleCalibLooper.h @@ -25,6 +25,8 @@ #include "DataFormats/EgammaCandidates/interface/Electron.h" #include "DataFormats/EgammaCandidates/interface/GsfElectron.h" #include "DataFormats/EgammaCandidates/interface/GsfElectronFwd.h" +#include "Geometry/CaloGeometry/interface/CaloGeometry.h" +#include "Geometry/Records/interface/CaloGeometryRecord.h" #include "CLHEP/Matrix/GenMatrix.h" #include "CLHEP/Matrix/Matrix.h" @@ -60,64 +62,64 @@ class EcalEleCalibLooper : public edm::EDLooper { private: //! EcalBarrel Input Collection name - edm::InputTag m_barrelAlCa; + const edm::InputTag m_barrelAlCa; //! EcalEndcap Input Collection name - edm::InputTag m_endcapAlCa; + const edm::InputTag m_endcapAlCa; + //! To take the electrons + edm::InputTag m_ElectronLabel; //! reconstruction window size - int m_recoWindowSidex; - int m_recoWindowSidey; + const int m_recoWindowSidex; + const int m_recoWindowSidey; //! eta size of the sub-matrix - int m_etaWidth; //PG sub matrix size and borders + const int m_etaWidth; //PG sub matrix size and borders //! eta size of the additive border to the sub-matrix // int m_etaBorder ; //FIXME //! phi size of the sub-matrix - int m_phiWidthEB; + const int m_phiWidthEB; //! phi size of the additive border to the sub-matrix // int m_phiBorderEB //FIXME; //! eta start of the region of interest - int m_etaStart; //PG ECAL region to be calibrated + const int m_etaStart; //PG ECAL region to be calibrated //! eta end of the region of interest - int m_etaEnd; + const int m_etaEnd; //! phi start of the region of interest - int m_phiStartEB; + const int m_phiStartEB; //! phi end of the region of interest - int m_phiEndEB; + const int m_phiEndEB; //!DS For the EE - int m_radStart; - int m_radEnd; - int m_radWidth; + const int m_radStart; + const int m_radEnd; + const int m_radWidth; //FIXME int m_radBorder ; - int m_phiStartEE; - int m_phiEndEE; - int m_phiWidthEE; + const int m_phiStartEE; + const int m_phiEndEE; + const int m_phiWidthEE; //! maximum number of events per crystal - int m_maxSelectedNumPerXtal; + const int m_maxSelectedNumPerXtal; //! single blocks calibrators std::vector m_EcalCalibBlocks; //! minimum energy per crystal cut - double m_minEnergyPerCrystal; + const double m_minEnergyPerCrystal; //! maximum energy per crystal cut - double m_maxEnergyPerCrystal; + const double m_maxEnergyPerCrystal; //! minimum coefficient accepted (RAW) - double m_minCoeff; + const double m_minCoeff; //! maximum coefficient accepted (RAW) - double m_maxCoeff; + const double m_maxCoeff; //! to exclude the blocksolver - int m_usingBlockSolver; + const int m_usingBlockSolver; //!the maps of recalib coeffs EcalIntercalibConstantMap m_barrelMap; EcalIntercalibConstantMap m_endcapMap; //! DS sets the number of loops to do - unsigned int m_loops; - //! To take the electrons - edm::InputTag m_ElectronLabel; + const unsigned int m_loops; //The map Filler VFillMap *m_MapFiller; @@ -136,6 +138,13 @@ class EcalEleCalibLooper : public edm::EDLooper { std::map m_xtalNumOfHits; bool isfirstcall_; + + //! ED token + const edm::EDGetTokenT m_ebRecHitToken; + const edm::EDGetTokenT m_eeRecHitToken; + const edm::EDGetTokenT m_gsfElectronToken; + //! ES token + const edm::ESGetToken m_geometryToken; }; #endif #endif diff --git a/Calibration/EcalCalibAlgos/interface/ElectronCalibrationUniv.h b/Calibration/EcalCalibAlgos/interface/ElectronCalibrationUniv.h index d5d2d4d9d215c..a602561587602 100644 --- a/Calibration/EcalCalibAlgos/interface/ElectronCalibrationUniv.h +++ b/Calibration/EcalCalibAlgos/interface/ElectronCalibrationUniv.h @@ -24,9 +24,8 @@ // user include files #include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/EDAnalyzer.h" +#include "FWCore/Framework/interface/one/EDAnalyzer.h" -#include "FWCore/Framework/interface/ESHandle.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" // Geometry @@ -40,6 +39,9 @@ #include "FWCore/Framework/interface/EventSetup.h" #include "FWCore/Framework/interface/ESHandle.h" #include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h" +#include "DataFormats/EgammaCandidates/interface/Electron.h" +#include "DataFormats/EgammaCandidates/interface/GsfElectron.h" +#include "DataFormats/EgammaCandidates/interface/GsfElectronFwd.h" #include "Calibration/Tools/interface/HouseholderDecomposition.h" #include "Calibration/Tools/interface/MinL3Algorithm.h" #include "Calibration/Tools/interface/CalibrationCluster.h" @@ -53,7 +55,7 @@ // class decleration // -class ElectronCalibrationUniv : public edm::EDAnalyzer { +class ElectronCalibrationUniv : public edm::one::EDAnalyzer { public: explicit ElectronCalibrationUniv(const edm::ParameterSet &); ~ElectronCalibrationUniv() override; @@ -61,6 +63,7 @@ class ElectronCalibrationUniv : public edm::EDAnalyzer { void analyze(const edm::Event &, const edm::EventSetup &) override; void beginJob() override; void beginRun(edm::Run const &, edm::EventSetup const &) override; + void endRun(edm::Run const &, edm::EventSetup const &) override; void endJob() override; private: @@ -69,35 +72,32 @@ class ElectronCalibrationUniv : public edm::EDAnalyzer { // ----------member data --------------------------- - std::string rootfile_; - edm::InputTag EBrecHitLabel_; - edm::InputTag EErecHitLabel_; - edm::InputTag electronLabel_; - edm::InputTag trackLabel_; - std::string calibAlgo_; - std::string miscalibfile_; - std::string miscalibfileEndCap_; - int keventweight_; - double ElePt_; - int maxeta_; - int mineta_; - int maxphi_; - int minphi_; - double cut1_; - double cut2_; - double cut3_; - double cutEPCalo1_; - double cutEPCalo2_; - double cutEPin1_; - double cutEPin2_; - double cutCalo1_; - double cutCalo2_; - double cutESeed_; - int ClusterSize_; - int elecclass_; - int theMaxLoops; - - bool FirstIteration; + const edm::InputTag ebRecHitLabel_; + const edm::InputTag eeRecHitLabel_; + const edm::InputTag electronLabel_; + const std::string rootfile_; + const std::string calibAlgo_; + const std::string miscalibfile_; + const std::string miscalibfileEndCap_; + const int keventweight_; + const double elePt_; + const int maxeta_; + const int mineta_; + const int maxphi_; + const int minphi_; + const double cut1_; + const double cut2_; + const double cut3_; + const int numevent_; + const double cutEPCalo1_; + const double cutEPCalo2_; + const double cutEPin1_; + const double cutEPin2_; + const double cutCalo1_; + const double cutCalo2_; + const double cutESeed_; + const int clusterSize_; + const int elecclass_; int read_events; @@ -116,7 +116,11 @@ class ElectronCalibrationUniv : public edm::EDAnalyzer { MinL3Algorithm *MyL3Algo1; MinL3AlgoUniv *UnivL3; - edm::ESHandle theCaloTopology; + const edm::EDGetTokenT ebRecHitToken_; + const edm::EDGetTokenT eeRecHitToken_; + const edm::EDGetTokenT gsfElectronToken_; + const edm::ESGetToken topologyToken_; + const CaloTopology *theCaloTopology_; std::vector solution; std::vector solutionNoCuts; @@ -126,7 +130,6 @@ class ElectronCalibrationUniv : public edm::EDAnalyzer { std::map Univsolution; // int eventcrystal[25][25]; - int numevent_; TFile *f; diff --git a/Calibration/EcalCalibAlgos/interface/InvRingCalib.h b/Calibration/EcalCalibAlgos/interface/InvRingCalib.h index 822ca0c490944..8e0b4623b9980 100644 --- a/Calibration/EcalCalibAlgos/interface/InvRingCalib.h +++ b/Calibration/EcalCalibAlgos/interface/InvRingCalib.h @@ -13,13 +13,17 @@ #include "FWCore/Framework/interface/Event.h" #include "DataFormats/GeometryVector/interface/GlobalPoint.h" #include "DataFormats/DetId/interface/DetId.h" +#include "DataFormats/CaloRecHit/interface/CaloRecHit.h" +#include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h" +#include "DataFormats/EgammaCandidates/interface/GsfElectron.h" +#include "DataFormats/EgammaCandidates/interface/GsfElectronFwd.h" #include "FWCore/Framework/interface/EventSetup.h" #include "CondFormats/EcalObjects/interface/EcalIntercalibConstants.h" +#include "Geometry/CaloGeometry/interface/CaloGeometry.h" +#include "Geometry/Records/interface/CaloGeometryRecord.h" #include #include -//#include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h" -#include "DataFormats/CaloRecHit/interface/CaloRecHit.h" #include "Calibration/EcalCalibAlgos/interface/VFillMap.h" @@ -60,37 +64,37 @@ class InvRingCalib : public edm::EDLooper { private: //! EcalBarrel Input Collection name - edm::InputTag m_barrelAlCa; + const edm::InputTag m_barrelAlCa; //! EcalEndcap Input Collection name - edm::InputTag m_endcapAlCa; + const edm::InputTag m_endcapAlCa; //! To take the electrons - edm::InputTag m_ElectronLabel; + const edm::InputTag m_ElectronLabel; //! reconstruction window size - int m_recoWindowSidex; - int m_recoWindowSidey; + const int m_recoWindowSidex; + const int m_recoWindowSidey; //! minimum energy per crystal cut - double m_minEnergyPerCrystal; + const double m_minEnergyPerCrystal; //! maximum energy per crystal cut - double m_maxEnergyPerCrystal; + const double m_maxEnergyPerCrystal; //! eta start of the zone of interest - int m_etaStart; + const int m_etaStart; //! eta end of the zone of interest - int m_etaEnd; + const int m_etaEnd; //! eta size of the regions - int m_etaWidth; + const int m_etaWidth; // std::map m_eta; //! maximum number of events per Ring - int m_maxSelectedNumPerRing; + const int m_maxSelectedNumPerRing; //! number of events already read per Ring std::map m_RingNumOfHits; //! single blocks calibrators std::vector m_IMACalibBlocks; //! minimum coefficient accepted (RAW) - double m_minCoeff; + const double m_minCoeff; //! maximum coefficient accepted (RAW) - double m_maxCoeff; + const double m_maxCoeff; //! to exclude the blocksolver - int m_usingBlockSolver; + const int m_usingBlockSolver; //!position of the cell, borders, coords etc... std::map m_cellPos; std::map m_cellPhi; @@ -101,8 +105,8 @@ class InvRingCalib : public edm::EDLooper { //! LP sets the number of loops to do unsigned int m_loops; //! LP define the EE region to calibrate - int m_startRing; - int m_endRing; + const int m_startRing; + const int m_endRing; //!association map between Raw detIds and Rings std::map m_xtalRing; //!association map between raw detIds and Region @@ -114,14 +118,21 @@ class InvRingCalib : public edm::EDLooper { std::vector m_barrelCells; std::vector m_endcapCells; //!coeffs filenames - std::string m_EBcoeffFile; - std::string m_EEcoeffFile; + const std::string m_EBcoeffFile; + const std::string m_EEcoeffFile; //!endcap zone to be calibrated - int m_EEZone; + const int m_EEZone; //!EB regions vs. eta index std::map m_Reg; std::string m_mapFillerType; bool isfirstcall_; + + //! ED token + const edm::EDGetTokenT m_ebRecHitToken; + const edm::EDGetTokenT m_eeRecHitToken; + const edm::EDGetTokenT m_gsfElectronToken; + //! ES token + const edm::ESGetToken m_geometryToken; }; #endif #endif diff --git a/Calibration/EcalCalibAlgos/interface/PhiSymmetryCalibration.h b/Calibration/EcalCalibAlgos/interface/PhiSymmetryCalibration.h index 00033a1c2e5c9..ec976ea70b01a 100644 --- a/Calibration/EcalCalibAlgos/interface/PhiSymmetryCalibration.h +++ b/Calibration/EcalCalibAlgos/interface/PhiSymmetryCalibration.h @@ -19,19 +19,25 @@ #include "Calibration/EcalCalibAlgos/interface/EcalGeomPhiSymHelper.h" // Framework -#include "FWCore/Framework/interface/EDAnalyzer.h" +#include "FWCore/Framework/interface/one/EDAnalyzer.h" #include "FWCore/Framework/interface/EventSetup.h" #include "FWCore/Framework/interface/ProducerBase.h" #include "FWCore/Framework/interface/Frameworkfwd.h" #include "FWCore/Framework/interface/Event.h" -#include "FWCore/Framework/interface/ESHandle.h" #include "CondFormats/EcalObjects/interface/EcalIntercalibConstants.h" +#include "CondFormats/DataRecord/interface/EcalIntercalibConstantsRcd.h" +#include "CondFormats/EcalObjects/interface/EcalChannelStatus.h" +#include "CondFormats/DataRecord/interface/EcalChannelStatusRcd.h" +#include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h" #include "DataFormats/DetId/interface/DetId.h" +#include "Geometry/CaloGeometry/interface/CaloGeometry.h" +#include "Geometry/Records/interface/CaloGeometryRecord.h" class TH1F; -class PhiSymmetryCalibration : public edm::EDAnalyzer { +class PhiSymmetryCalibration + : public edm::one::EDAnalyzer { public: /// Constructor PhiSymmetryCalibration(const edm::ParameterSet& iConfig); @@ -41,7 +47,9 @@ class PhiSymmetryCalibration : public edm::EDAnalyzer { /// Called at beginning of job void beginJob() override; + void beginRun(edm::Run const&, const edm::EventSetup&) override; void endRun(edm::Run const&, const edm::EventSetup&) override; + void beginLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) override; void endLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) override; /// Called at end of job @@ -111,27 +119,32 @@ class PhiSymmetryCalibration : public edm::EDAnalyzer { // steering parameters - std::string ecalHitsProducer_; - std::string barrelHits_; - std::string endcapHits_; + const std::string ecalHitsProducer_; + const std::string barrelHits_; + const std::string endcapHits_; + + const edm::EDGetTokenT ebRecHitToken_; + const edm::EDGetTokenT eeRecHitToken_; + const edm::ESGetToken channelStatusToken_; + const edm::ESGetToken geometryToken_; // energy cut in the barrel - double eCut_barl_; + const double eCut_barl_; // parametrized energy cut EE : e_cut = ap + eta_ring*b - double ap_; - double b_; + const double ap_; + const double b_; - int eventSet_; + const int eventSet_; /// threshold in channel status beyond which channel is marked bad - int statusThreshold_; + const int statusThreshold_; static const int kMaxEndciPhi = 360; float phi_endc[kMaxEndciPhi][kEndcEtaRings]; - bool reiteration_; - std::string oldcalibfile_; //searched for in Calibration/EcalCalibAlgos/data + const bool reiteration_; + const std::string oldcalibfile_; //searched for in Calibration/EcalCalibAlgos/data /// the old calibration constants (when reiterating, the last ones derived) EcalIntercalibConstants oldCalibs_; diff --git a/Calibration/EcalCalibAlgos/interface/Pi0FixedMassWindowCalibration.h b/Calibration/EcalCalibAlgos/interface/Pi0FixedMassWindowCalibration.h index 1d462def498a3..b39ceb82c72e3 100644 --- a/Calibration/EcalCalibAlgos/interface/Pi0FixedMassWindowCalibration.h +++ b/Calibration/EcalCalibAlgos/interface/Pi0FixedMassWindowCalibration.h @@ -11,16 +11,15 @@ // Framework #include "FWCore/Framework/interface/LooperFactory.h" #include "FWCore/Framework/interface/ESProducerLooper.h" -#include "FWCore/Framework/interface/ESHandle.h" #include "FWCore/Framework/interface/Frameworkfwd.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" #include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" #include "FWCore/Framework/interface/EDProducer.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/EventSetup.h" -#include "FWCore/Framework/interface/ESHandle.h" #include "CondFormats/EcalObjects/interface/EcalIntercalibConstants.h" +#include "CondFormats/DataRecord/interface/EcalIntercalibConstantsRcd.h" #include "DataFormats/DetId/interface/DetId.h" #include "DataFormats/EcalRecHit/interface/EcalRecHit.h" @@ -34,13 +33,10 @@ #include "DataFormats/EcalDetId/interface/ESDetId.h" #include "DataFormats/DetId/interface/DetId.h" -#include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/EDProducer.h" -#include "FWCore/Framework/interface/Event.h" -#include "FWCore/Framework/interface/EventSetup.h" +#include "Geometry/CaloGeometry/interface/CaloGeometry.h" +#include "Geometry/Records/interface/CaloGeometryRecord.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" -#include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h" #include "RecoEcal/EgammaClusterAlgos/interface/IslandClusterAlgo.h" #include "RecoEcal/EgammaCoreTools/interface/PositionCalc.h" #include "RecoEcal/EgammaCoreTools/interface/ClusterShapeAlgo.h" @@ -87,9 +83,9 @@ class Pi0FixedMassWindowCalibration : public edm::ESProducerLooper { int nevent; - unsigned int theMaxLoops; - std::string ecalHitsProducer_; - std::string barrelHits_; + const unsigned int theMaxLoops; + const std::string ecalHitsProducer_; + const std::string barrelHits_; IslandClusterAlgo::VerbosityLevel verbosity; @@ -140,6 +136,10 @@ class Pi0FixedMassWindowCalibration : public edm::ESProducerLooper { const EcalRecHitCollection* ecalRecHitBarrelCollection; const EcalRecHitCollection* recalibEcalRecHitCollection; + const edm::EDGetTokenT recHitToken_; + const edm::ESGetToken intercalibConstantsToken_; + const edm::ESGetToken geometryToken_; + // root tree TFile* theFile; diff --git a/Calibration/EcalCalibAlgos/interface/ZeeCalibration.h b/Calibration/EcalCalibAlgos/interface/ZeeCalibration.h index b10e543e039df..9e78f35854233 100644 --- a/Calibration/EcalCalibAlgos/interface/ZeeCalibration.h +++ b/Calibration/EcalCalibAlgos/interface/ZeeCalibration.h @@ -21,17 +21,16 @@ #include #include #include +#include // user include files #include "FWCore/Framework/interface/LooperFactory.h" #include "FWCore/Framework/interface/ESProducerLooper.h" -#include "FWCore/Framework/interface/ESHandle.h" #include "FWCore/Framework/interface/Frameworkfwd.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" -#include "FWCore/Framework/interface/EDProducer.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/EventSetup.h" -#include "FWCore/Framework/interface/ESHandle.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" #include "Calibration/Tools/interface/ZIterativeAlgorithmWithFit.h" #include "Calibration/Tools/interface/CalibElectron.h" @@ -42,9 +41,13 @@ #include "CondFormats/EcalObjects/interface/EcalIntercalibConstants.h" #include "CondFormats/DataRecord/interface/EcalIntercalibConstantsRcd.h" +#include "DataFormats/Common/interface/TriggerResults.h" #include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h" #include "DataFormats/DetId/interface/DetId.h" +#include "Geometry/CaloGeometry/interface/CaloGeometry.h" +#include "Geometry/Records/interface/CaloGeometryRecord.h" + #include "TTree.h" #include "TFile.h" #include "TGraph.h" @@ -53,18 +56,12 @@ #include "TH2.h" #include "SimDataFormats/GeneratorProducts/interface/HepMCProduct.h" +#include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h" #include "DataFormats/EgammaCandidates/interface/ElectronFwd.h" #include "DataFormats/EgammaCandidates/interface/Electron.h" #include "DataFormats/EgammaCandidates/interface/GsfElectron.h" #include "DataFormats/EgammaCandidates/interface/GsfElectronFwd.h" -#include "FWCore/Framework/interface/Event.h" -#include "FWCore/Framework/interface/EDAnalyzer.h" -#include "FWCore/ParameterSet/interface/ParameterSet.h" - -#include -#include - // class declaration // @@ -145,23 +142,33 @@ class ZeeCalibration : public edm::ESProducerLooper { std::string outputFileName_; - std::string rechitProducer_; - std::string rechitCollection_; - std::string erechitProducer_; - std::string erechitCollection_; - std::string scProducer_; - std::string scCollection_; + const edm::InputTag hlTriggerResults_; - std::string scIslandProducer_; - std::string scIslandCollection_; + const std::string mcProducer_; + const std::string rechitProducer_; + const std::string rechitCollection_; + const std::string erechitProducer_; + const std::string erechitCollection_; + const std::string scProducer_; + const std::string scCollection_; + + const std::string scIslandProducer_; + const std::string scIslandCollection_; + + const std::string electronProducer_; + const std::string electronCollection_; - std::string mcProducer_; std::string calibMode_; - std::string electronProducer_; - std::string electronCollection_; + const edm::EDGetTokenT trigResultsToken_; + const edm::EDGetTokenT hepMCToken_; + const edm::EDGetTokenT ebRecHitToken_; + const edm::EDGetTokenT eeRecHitToken_; + const edm::EDGetTokenT scToken_; + const edm::EDGetTokenT islandSCToken_; + const edm::EDGetTokenT gsfElectronToken_; - std::string RecalibBarrelHits_; + const edm::ESGetToken geometryToken_; unsigned int etaBins_; unsigned int etBins_; @@ -338,8 +345,6 @@ class ZeeCalibration : public edm::ESProducerLooper { int CRACK_ELECTRONS_IN_BARREL; int CRACK_ELECTRONS_IN_ENDCAP; - edm::InputTag hlTriggerResults_; - unsigned int nEvents_; // number of events processed unsigned int nWasRun_; // # where at least one HLT was run diff --git a/Calibration/EcalCalibAlgos/src/ECALpedestalPCLHarvester.cc b/Calibration/EcalCalibAlgos/src/ECALpedestalPCLHarvester.cc index 1b2d111e3006f..1876ff44fd6ba 100644 --- a/Calibration/EcalCalibAlgos/src/ECALpedestalPCLHarvester.cc +++ b/Calibration/EcalCalibAlgos/src/ECALpedestalPCLHarvester.cc @@ -5,29 +5,29 @@ // user include files #include "Calibration/EcalCalibAlgos/interface/ECALpedestalPCLHarvester.h" #include "CondCore/DBOutputService/interface/PoolDBOutputService.h" -#include "FWCore/Framework/interface/ESHandle.h" #include "FWCore/Framework/interface/EventSetup.h" -#include "CondFormats/EcalObjects/interface/EcalChannelStatus.h" #include "CondFormats/EcalObjects/interface/EcalChannelStatusCode.h" -#include "CondFormats/DataRecord/interface/EcalPedestalsRcd.h" -#include "CondFormats/DataRecord/interface/EcalChannelStatusRcd.h" #include "CommonTools/Utils/interface/StringToEnumValue.h" -#include #include ECALpedestalPCLHarvester::ECALpedestalPCLHarvester(const edm::ParameterSet& ps) - : currentPedestals_(nullptr), channelStatus_(nullptr) { + : minEntries_(ps.getParameter("MinEntries")), + checkAnomalies_(ps.getParameter("checkAnomalies")), + nSigma_(ps.getParameter("nSigma")), + thresholdAnomalies_(ps.getParameter("thresholdAnomalies")), + dqmDir_(ps.getParameter("dqmDir")), + labelG6G1_(ps.getParameter("labelG6G1")), + threshDiffEB_(ps.getParameter("threshDiffEB")), + threshDiffEE_(ps.getParameter("threshDiffEE")), + threshChannelsAnalyzed_(ps.getParameter("threshChannelsAnalyzed")), + channelsStatusToken_(esConsumes()), + pedestalsToken_(esConsumes()), + g6g1PedestalsToken_(esConsumes(edm::ESInputTag("", labelG6G1_))), + currentPedestals_(nullptr), + g6g1Pedestals_(nullptr), + channelStatus_(nullptr) { chStatusToExclude_ = StringToEnumValue( ps.getParameter >("ChannelStatusToExclude")); - minEntries_ = ps.getParameter("MinEntries"); - checkAnomalies_ = ps.getParameter("checkAnomalies"); - nSigma_ = ps.getParameter("nSigma"); - thresholdAnomalies_ = ps.getParameter("thresholdAnomalies"); - dqmDir_ = ps.getParameter("dqmDir"); - labelG6G1_ = ps.getParameter("labelG6G1"); - threshDiffEB_ = ps.getParameter("threshDiffEB"); - threshDiffEE_ = ps.getParameter("threshDiffEE"); - threshChannelsAnalyzed_ = ps.getParameter("threshChannelsAnalyzed"); } void ECALpedestalPCLHarvester::dqmEndJob(DQMStore::IBooker& ibooker_, DQMStore::IGetter& igetter_) { @@ -155,17 +155,9 @@ void ECALpedestalPCLHarvester::fillDescriptions(edm::ConfigurationDescriptions& } void ECALpedestalPCLHarvester::endRun(edm::Run const& run, edm::EventSetup const& isetup) { - edm::ESHandle chStatus; - isetup.get().get(chStatus); - channelStatus_ = chStatus.product(); - - edm::ESHandle peds; - isetup.get().get(peds); - currentPedestals_ = peds.product(); - - edm::ESHandle g6g1peds; - isetup.get().get(labelG6G1_, g6g1peds); - g6g1Pedestals_ = g6g1peds.product(); + channelStatus_ = &isetup.getData(channelsStatusToken_); + currentPedestals_ = &isetup.getData(pedestalsToken_); + g6g1Pedestals_ = &isetup.getData(g6g1PedestalsToken_); } bool ECALpedestalPCLHarvester::checkStatusCode(const DetId& id) { diff --git a/Calibration/EcalCalibAlgos/src/ECALpedestalPCLworker.cc b/Calibration/EcalCalibAlgos/src/ECALpedestalPCLworker.cc index 90296dc37b65c..e90fcfbbf8427 100644 --- a/Calibration/EcalCalibAlgos/src/ECALpedestalPCLworker.cc +++ b/Calibration/EcalCalibAlgos/src/ECALpedestalPCLworker.cc @@ -2,16 +2,11 @@ #include "Calibration/EcalCalibAlgos/interface/ECALpedestalPCLworker.h" #include "DataFormats/EcalDetId/interface/EBDetId.h" #include "DataFormats/EcalDetId/interface/EEDetId.h" -#include "FWCore/Framework/interface/ESHandle.h" #include "FWCore/Framework/interface/EventSetup.h" -#include "CondFormats/EcalObjects/interface/EcalPedestals.h" -#include "CondFormats/DataRecord/interface/EcalPedestalsRcd.h" -#include #include ECALpedestalPCLworker::ECALpedestalPCLworker(const edm::ParameterSet& iConfig) - -{ + : pedestalToken_(esConsumes()) { edm::InputTag digiTagEB = iConfig.getParameter("BarrelDigis"); edm::InputTag digiTagEE = iConfig.getParameter("EndcapDigis"); @@ -106,8 +101,7 @@ void ECALpedestalPCLworker::bookHistograms(DQMStore::IBooker& ibooker, edm::Run ibooker.cd(); ibooker.setCurrentFolder(dqmDir_); - edm::ESHandle peds; - es.get().get(peds); + const auto& peds = es.getData(pedestalToken_); for (uint32_t i = 0; i < EBDetId::kSizeForDenseIndexing; ++i) { ibooker.setCurrentFolder(dqmDir_ + "/EB/" + std::to_string(int(i / 100))); @@ -117,7 +111,7 @@ void ECALpedestalPCLworker::bookHistograms(DQMStore::IBooker& ibooker, edm::Run int centralBin = fixedBookingCenterBin_; if (dynamicBooking_) { - centralBin = int((peds->find(id))->mean_x12); + centralBin = int((peds.find(id))->mean_x12); } int min = centralBin - nBins_ / 2; @@ -135,7 +129,7 @@ void ECALpedestalPCLworker::bookHistograms(DQMStore::IBooker& ibooker, edm::Run int centralBin = fixedBookingCenterBin_; if (dynamicBooking_) { - centralBin = int((peds->find(id))->mean_x12); + centralBin = int((peds.find(id))->mean_x12); } int min = centralBin - nBins_ / 2; diff --git a/Calibration/EcalCalibAlgos/src/EcalEleCalibLooper.cc b/Calibration/EcalCalibAlgos/src/EcalEleCalibLooper.cc index 137c8cd0c5719..f6b3c73d5b09b 100644 --- a/Calibration/EcalCalibAlgos/src/EcalEleCalibLooper.cc +++ b/Calibration/EcalCalibAlgos/src/EcalEleCalibLooper.cc @@ -1,6 +1,5 @@ #include #include -#include #include "FWCore/Framework/interface/Frameworkfwd.h" #include "FWCore/Framework/interface/MakerMacros.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" @@ -9,11 +8,8 @@ #include "Calibration/EcalCalibAlgos/interface/EcalEleCalibLooper.h" #include "DataFormats/Common/interface/Handle.h" #include "DataFormats/EgammaReco/interface/ClusterShape.h" -#include "Geometry/Records/interface/CaloGeometryRecord.h" #include "Geometry/CaloGeometry/interface/CaloCellGeometry.h" -#include "Geometry/CaloGeometry/interface/CaloGeometry.h" #include "Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h" -#include "CondFormats/DataRecord/interface/EcalIntercalibConstantsRcd.h" #include "Calibration/Tools/interface/calibXMLwriter.h" #include "CalibCalorimetry/CaloMiscalibTools/interface/CaloMiscalibTools.h" #include "RecoEcal/EgammaCoreTools/interface/EcalClusterTools.h" @@ -33,6 +29,7 @@ EcalEleCalibLooper::EcalEleCalibLooper(const edm::ParameterSet& iConfig) : m_barrelAlCa(iConfig.getParameter("alcaBarrelHitCollection")), m_endcapAlCa(iConfig.getParameter("alcaEndcapHitCollection")), + m_ElectronLabel(iConfig.getParameter("electronLabel")), m_recoWindowSidex(iConfig.getParameter("recoWindowSidex")), m_recoWindowSidey(iConfig.getParameter("recoWindowSidey")), m_etaWidth(iConfig.getParameter("etaWidth")), @@ -54,7 +51,10 @@ EcalEleCalibLooper::EcalEleCalibLooper(const edm::ParameterSet& iConfig) m_maxCoeff(iConfig.getParameter("maxCoeff")), m_usingBlockSolver(iConfig.getParameter("usingBlockSolver")), m_loops(iConfig.getParameter("loops")), - m_ElectronLabel(iConfig.getParameter("electronLabel")) { + m_ebRecHitToken(consumes(m_barrelAlCa)), + m_eeRecHitToken(consumes(m_endcapAlCa)), + m_gsfElectronToken(consumes(m_ElectronLabel)), + m_geometryToken(esConsumes()) { edm::LogInfo("IML") << "[EcalEleCalibLooper][ctor] asserts"; assert(!((m_etaEnd - m_etaStart) % m_etaWidth)); @@ -168,9 +168,7 @@ edm::EDLooper::Status EcalEleCalibLooper::duringLoop(const edm::Event& iEvent, c // with the beginJob without arguments migration if (isfirstcall_) { - edm::ESHandle geoHandle; - iSetup.get().get(geoHandle); - const CaloGeometry& geometry = *geoHandle; + const auto& geometry = iSetup.getData(m_geometryToken); m_barrelCells = geometry.getValidDetIds(DetId::Ecal, EcalBarrel); m_endcapCells = geometry.getValidDetIds(DetId::Ecal, EcalEndcap); for (std::vector::const_iterator barrelIt = m_barrelCells.begin(); barrelIt != m_barrelCells.end(); @@ -190,7 +188,7 @@ edm::EDLooper::Status EcalEleCalibLooper::duringLoop(const edm::Event& iEvent, c //take the collection of recHits in the barrel const EBRecHitCollection* barrelHitsCollection = nullptr; edm::Handle barrelRecHitsHandle; - iEvent.getByLabel(m_barrelAlCa, barrelRecHitsHandle); + iEvent.getByToken(m_ebRecHitToken, barrelRecHitsHandle); barrelHitsCollection = barrelRecHitsHandle.product(); if (!barrelRecHitsHandle.isValid()) { edm::LogError("reading") << "[EcalEleCalibLooper] barrel rec hits not found"; @@ -200,7 +198,7 @@ edm::EDLooper::Status EcalEleCalibLooper::duringLoop(const edm::Event& iEvent, c //take the collection of rechis in the endcap const EERecHitCollection* endcapHitsCollection = nullptr; edm::Handle endcapRecHitsHandle; - iEvent.getByLabel(m_endcapAlCa, endcapRecHitsHandle); + iEvent.getByToken(m_eeRecHitToken, endcapRecHitsHandle); endcapHitsCollection = endcapRecHitsHandle.product(); if (!endcapRecHitsHandle.isValid()) { edm::LogError("reading") << "[EcalEleCalibLooper] endcap rec hits not found"; @@ -209,7 +207,7 @@ edm::EDLooper::Status EcalEleCalibLooper::duringLoop(const edm::Event& iEvent, c //Takes the electron collection of the pixel detector edm::Handle pElectrons; - iEvent.getByLabel(m_ElectronLabel, pElectrons); + iEvent.getByToken(m_gsfElectronToken, pElectrons); if (!pElectrons.isValid()) { edm::LogError("reading") << "[EcalEleCalibLooper] electrons not found"; return kContinue; diff --git a/Calibration/EcalCalibAlgos/src/ElectronCalibrationUniv.cc b/Calibration/EcalCalibAlgos/src/ElectronCalibrationUniv.cc index fe6aefb4eba96..4b49ad3749602 100644 --- a/Calibration/EcalCalibAlgos/src/ElectronCalibrationUniv.cc +++ b/Calibration/EcalCalibAlgos/src/ElectronCalibrationUniv.cc @@ -1,25 +1,14 @@ #include "FWCore/ParameterSet/interface/ParameterSet.h" -#include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h" #include "DataFormats/EcalDetId/interface/EBDetId.h" #include "DataFormats/DetId/interface/DetId.h" -#include "CondFormats/EcalObjects/interface/EcalIntercalibConstants.h" -#include "CondFormats/DataRecord/interface/EcalIntercalibConstantsRcd.h" #include "Calibration/Tools/interface/calibXMLwriter.h" #include "Calibration/Tools/interface/CalibrationCluster.h" #include "Calibration/Tools/interface/HouseholderDecomposition.h" #include "Calibration/Tools/interface/MinL3Algorithm.h" #include "Calibration/EcalCalibAlgos/interface/ElectronCalibrationUniv.h" -#include "DataFormats/EgammaCandidates/interface/Electron.h" -#include "DataFormats/EgammaReco/interface/SuperCluster.h" -#include "DataFormats/TrackReco/interface/Track.h" -#include "DataFormats/TrackReco/interface/TrackFwd.h" -#include "DataFormats/TrackReco/interface/TrackExtraFwd.h" #include "FWCore/Utilities/interface/isFinite.h" -#include "TFile.h" -#include "TH1.h" -#include "TH2.h" #include "TF1.h" #include "TRandom.h" @@ -28,40 +17,37 @@ #include #include -#include "DataFormats/EgammaCandidates/interface/GsfElectron.h" -#include "DataFormats/EgammaCandidates/interface/GsfElectronFwd.h" - -ElectronCalibrationUniv::ElectronCalibrationUniv(const edm::ParameterSet& iConfig) { - rootfile_ = iConfig.getParameter("rootfile"); - EBrecHitLabel_ = iConfig.getParameter("ebRecHitsLabel"); - EErecHitLabel_ = iConfig.getParameter("eeRecHitsLabel"); - electronLabel_ = iConfig.getParameter("electronLabel"); - trackLabel_ = iConfig.getParameter("trackLabel"); - calibAlgo_ = iConfig.getParameter("CALIBRATION_ALGO"); - keventweight_ = iConfig.getParameter("keventweight"); - ClusterSize_ = iConfig.getParameter("Clustersize"); - ElePt_ = iConfig.getParameter("ElePt"); - maxeta_ = iConfig.getParameter("maxeta"); - mineta_ = iConfig.getParameter("mineta"); - maxphi_ = iConfig.getParameter("maxphi"); - minphi_ = iConfig.getParameter("minphi"); - cut1_ = iConfig.getParameter("cut1"); - cut2_ = iConfig.getParameter("cut2"); - cut3_ = iConfig.getParameter("cut3"); - elecclass_ = iConfig.getParameter("elecclass"); - numevent_ = iConfig.getParameter("numevent"); - miscalibfile_ = iConfig.getParameter("miscalibfile"); - miscalibfileEndCap_ = iConfig.getParameter("miscalibfileEndCap"); - - cutEPCalo1_ = iConfig.getParameter("cutEPCaloMin"); - cutEPCalo2_ = iConfig.getParameter("cutEPCaloMax"); - cutEPin1_ = iConfig.getParameter("cutEPinMin"); - cutEPin2_ = iConfig.getParameter("cutEPinMax"); - cutCalo1_ = iConfig.getParameter("cutCaloMin"); - cutCalo2_ = iConfig.getParameter("cutCaloMax"); - - cutESeed_ = iConfig.getParameter("cutESeed"); -} +ElectronCalibrationUniv::ElectronCalibrationUniv(const edm::ParameterSet& iConfig) + : ebRecHitLabel_(iConfig.getParameter("ebRecHitsLabel")), + eeRecHitLabel_(iConfig.getParameter("eeRecHitsLabel")), + electronLabel_(iConfig.getParameter("electronLabel")), + rootfile_(iConfig.getParameter("rootfile")), + calibAlgo_(iConfig.getParameter("CALIBRATION_ALGO")), + miscalibfile_(iConfig.getParameter("miscalibfile")), + miscalibfileEndCap_(iConfig.getParameter("miscalibfileEndCap")), + keventweight_(iConfig.getParameter("keventweight")), + elePt_(iConfig.getParameter("ElePt")), + maxeta_(iConfig.getParameter("maxeta")), + mineta_(iConfig.getParameter("mineta")), + maxphi_(iConfig.getParameter("maxphi")), + minphi_(iConfig.getParameter("minphi")), + cut1_(iConfig.getParameter("cut1")), + cut2_(iConfig.getParameter("cut2")), + cut3_(iConfig.getParameter("cut3")), + numevent_(iConfig.getParameter("numevent")), + cutEPCalo1_(iConfig.getParameter("cutEPCaloMin")), + cutEPCalo2_(iConfig.getParameter("cutEPCaloMax")), + cutEPin1_(iConfig.getParameter("cutEPinMin")), + cutEPin2_(iConfig.getParameter("cutEPinMax")), + cutCalo1_(iConfig.getParameter("cutCaloMin")), + cutCalo2_(iConfig.getParameter("cutCaloMax")), + cutESeed_(iConfig.getParameter("cutESeed")), + clusterSize_(iConfig.getParameter("Clustersize")), + elecclass_(iConfig.getParameter("elecclass")), + ebRecHitToken_(consumes(ebRecHitLabel_)), + eeRecHitToken_(consumes(eeRecHitLabel_)), + gsfElectronToken_(consumes(electronLabel_)), + topologyToken_(esConsumes()) {} ElectronCalibrationUniv::~ElectronCalibrationUniv() {} @@ -223,7 +209,7 @@ void ElectronCalibrationUniv::beginJob() { GeneralMapEndCapPlusBeforePt = new TH2F("GeneralMapEndCapPlusBeforePt", "Map without any cuts", 100, 0, 100, 100, 0, 100); - calibClusterSize = ClusterSize_; + calibClusterSize = clusterSize_; etaMin = int(mineta_); etaMax = int(maxeta_); phiMin = int(minphi_); @@ -250,9 +236,13 @@ void ElectronCalibrationUniv::beginRun(edm::Run const&, edm::EventSetup const& i //======================================================================== //To Deal with Geometry: - iSetup.get().get(theCaloTopology); + theCaloTopology_ = &iSetup.getData(topologyToken_); } +//======================================================================== +void ElectronCalibrationUniv::endRun(edm::Run const&, edm::EventSetup const& iSetup) {} +//======================================================================== + //======================================================================== void ElectronCalibrationUniv::endJob() { @@ -622,7 +612,7 @@ void ElectronCalibrationUniv::analyze(const edm::Event& iEvent, const edm::Event // Get EBRecHits edm::Handle EBphits; - iEvent.getByLabel(EBrecHitLabel_, EBphits); + iEvent.getByToken(ebRecHitToken_, EBphits); if (!EBphits.isValid()) { std::cerr << "Error! can't get the product EBRecHitCollection: " << std::endl; } @@ -631,7 +621,7 @@ void ElectronCalibrationUniv::analyze(const edm::Event& iEvent, const edm::Event // Get EERecHits edm::Handle EEphits; - iEvent.getByLabel(EErecHitLabel_, EEphits); + iEvent.getByToken(eeRecHitToken_, EEphits); if (!EEphits.isValid()) { std::cerr << "Error! can't get the product EERecHitCollection: " << std::endl; } @@ -639,7 +629,7 @@ void ElectronCalibrationUniv::analyze(const edm::Event& iEvent, const edm::Event // Get pixelElectrons edm::Handle pElectrons; - iEvent.getByLabel(electronLabel_, pElectrons); + iEvent.getByToken(gsfElectronToken_, pElectrons); if (!pElectrons.isValid()) { std::cerr << "Error! can't get the product ElectronCollection: " << std::endl; } @@ -737,9 +727,9 @@ void ElectronCalibrationUniv::analyze(const edm::Event& iEvent, const edm::Event float energy3x3 = 0.; float energy5x5 = 0.; //Should be moved to cfg file! - int ClusterSize = ClusterSize_; + int ClusterSize = clusterSize_; - const CaloSubdetectorTopology* topology = theCaloTopology->getSubdetectorTopology(DetId::Ecal, maxHitId.subdetId()); + const CaloSubdetectorTopology* topology = theCaloTopology_->getSubdetectorTopology(DetId::Ecal, maxHitId.subdetId()); std::vector NxNaroundMax = topology->getWindow(maxHitId, ClusterSize, ClusterSize); //ToCompute 3x3 std::vector S9aroundMax = topology->getWindow(maxHitId, 3, 3); @@ -822,7 +812,7 @@ void ElectronCalibrationUniv::analyze(const edm::Event& iEvent, const edm::Event } EventsAfterCuts->Fill(11); - if (highestElePt < ElePt_) + if (highestElePt < elePt_) return; if (maxHitId.subdetId() == EcalBarrel) { diff --git a/Calibration/EcalCalibAlgos/src/InvRingCalib.cc b/Calibration/EcalCalibAlgos/src/InvRingCalib.cc index 0d0f78d9ae3bd..e476a262457af 100644 --- a/Calibration/EcalCalibAlgos/src/InvRingCalib.cc +++ b/Calibration/EcalCalibAlgos/src/InvRingCalib.cc @@ -1,8 +1,6 @@ #include #include #include "FWCore/Framework/interface/Frameworkfwd.h" -#include "Geometry/Records/interface/CaloGeometryRecord.h" -#include "FWCore/Framework/interface/ESHandle.h" #include "FWCore/Framework/interface/MakerMacros.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "Calibration/EcalCalibAlgos/interface/InvRingCalib.h" @@ -12,7 +10,6 @@ #include "Calibration/Tools/interface/calibXMLwriter.h" #include "CalibCalorimetry/CaloMiscalibTools/interface/MiscalibReaderFromXMLEcalBarrel.h" #include "CalibCalorimetry/CaloMiscalibTools/interface/MiscalibReaderFromXMLEcalEndcap.h" -#include "DataFormats/EgammaCandidates/interface/GsfElectronFwd.h" #include "DataFormats/EgammaReco/interface/SuperCluster.h" #include "DataFormats/EgammaReco/interface/BasicCluster.h" #include "RecoEcal/EgammaCoreTools/interface/EcalClusterTools.h" @@ -23,7 +20,6 @@ //Not to remain in the final version #include "TH2.h" #include "TFile.h" -#include //---------------------------------------------------------------- //ctor @@ -46,7 +42,11 @@ InvRingCalib::InvRingCalib(const edm::ParameterSet& iConfig) m_endRing(iConfig.getParameter("endRing")), m_EBcoeffFile(iConfig.getParameter("EBcoeffs")), m_EEcoeffFile(iConfig.getParameter("EEcoeffs")), - m_EEZone(iConfig.getParameter("EEZone")) { + m_EEZone(iConfig.getParameter("EEZone")), + m_ebRecHitToken(consumes(m_barrelAlCa)), + m_eeRecHitToken(consumes(m_endcapAlCa)), + m_gsfElectronToken(consumes(m_ElectronLabel)), + m_geometryToken(esConsumes()) { //controls if the parameters inputed are correct if ((m_etaEnd * m_etaStart) > 0) assert(!((m_etaEnd - m_etaStart) % m_etaWidth)); @@ -130,13 +130,11 @@ edm::EDLooper::Status InvRingCalib::duringLoop(const edm::Event& iEvent, const e if (isfirstcall_) { edm::LogInfo("IML") << "[InvRingCalib][beginOfJob]"; //gets the geometry from the event setup - edm::ESHandle geoHandle; - iSetup.get().get(geoHandle); - const CaloGeometry* geometry = geoHandle.product(); + const auto& geometry = iSetup.getData(m_geometryToken); edm::LogInfo("IML") << "[InvRingCalib] Event Setup read"; //fills a vector with all the cells - m_barrelCells = geometry->getValidDetIds(DetId::Ecal, EcalBarrel); - m_endcapCells = geometry->getValidDetIds(DetId::Ecal, EcalEndcap); + m_barrelCells = geometry.getValidDetIds(DetId::Ecal, EcalBarrel); + m_endcapCells = geometry.getValidDetIds(DetId::Ecal, EcalEndcap); //Defines the EB regions edm::LogInfo("IML") << "[InvRingCalib] Defining Barrel Regions"; EBRegionDef(); @@ -234,17 +232,18 @@ edm::EDLooper::Status InvRingCalib::duringLoop(const edm::Event& iEvent, const e double pTk = 0.; const EcalRecHitCollection* barrelHitsCollection = nullptr; edm::Handle barrelRecHitsHandle; - iEvent.getByLabel(m_barrelAlCa, barrelRecHitsHandle); + iEvent.getByToken(m_ebRecHitToken, barrelRecHitsHandle); barrelHitsCollection = barrelRecHitsHandle.product(); if (!barrelRecHitsHandle.isValid()) { edm::LogError("IML") << "[EcalEleCalibLooper] barrel rec hits not found"; return kContinue; } + //gets the endcap recHits const EcalRecHitCollection* endcapHitsCollection = nullptr; edm::Handle endcapRecHitsHandle; - iEvent.getByLabel(m_endcapAlCa, endcapRecHitsHandle); + iEvent.getByToken(m_eeRecHitToken, endcapRecHitsHandle); endcapHitsCollection = endcapRecHitsHandle.product(); if (!endcapRecHitsHandle.isValid()) { @@ -254,7 +253,7 @@ edm::EDLooper::Status InvRingCalib::duringLoop(const edm::Event& iEvent, const e //gets the electrons edm::Handle pElectrons; - iEvent.getByLabel(m_ElectronLabel, pElectrons); + iEvent.getByToken(m_gsfElectronToken, pElectrons); if (!pElectrons.isValid()) { edm::LogError("IML") << "[EcalEleCalibLooper] electrons not found"; @@ -382,13 +381,9 @@ void InvRingCalib::endOfJob() { //!EE ring definition void InvRingCalib::EERingDef(const edm::EventSetup& iSetup) { - //Gets the Handle for the geometry from the eventSetup - edm::ESHandle geoHandle; - iSetup.get().get(geoHandle); //Gets the geometry of the endcap - const CaloGeometry* geometry = geoHandle.product(); - const CaloSubdetectorGeometry* endcapGeometry = geometry->getSubdetectorGeometry(DetId::Ecal, EcalEndcap); - // const CaloSubdetectorGeometry *barrelGeometry = geometry->getSubdetectorGeometry(DetId::Ecal, EcalBarrel); + const auto& geometry = iSetup.getData(m_geometryToken); + const CaloSubdetectorGeometry* endcapGeometry = geometry.getSubdetectorGeometry(DetId::Ecal, EcalEndcap); //for every xtal gets the position Vector and the phi position // for (std::vector::const_iterator barrelIt = m_barrelCells.begin(); diff --git a/Calibration/EcalCalibAlgos/src/PhiSymmetryCalibration.cc b/Calibration/EcalCalibAlgos/src/PhiSymmetryCalibration.cc index d0f5d8f8e449a..65aef4d2e594c 100644 --- a/Calibration/EcalCalibAlgos/src/PhiSymmetryCalibration.cc +++ b/Calibration/EcalCalibAlgos/src/PhiSymmetryCalibration.cc @@ -5,26 +5,19 @@ // Framework #include "FWCore/MessageLogger/interface/MessageLogger.h" -#include "FWCore/Framework/interface/ESHandle.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" -#include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h" #include "DataFormats/EcalDetId/interface/EBDetId.h" #include "DataFormats/EcalDetId/interface/EEDetId.h" -#include "CondFormats/DataRecord/interface/EcalIntercalibConstantsRcd.h" #include "CondFormats/EcalObjects/interface/EcalIntercalibErrors.h" #include "CondTools/Ecal/interface/EcalIntercalibConstantsXMLTranslator.h" #include "FWCore/Framework/interface/LuminosityBlock.h" // Geometry -#include "Geometry/Records/interface/CaloGeometryRecord.h" #include "Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h" #include "Geometry/CaloGeometry/interface/CaloCellGeometry.h" -#include "Geometry/CaloGeometry/interface/CaloGeometry.h" //Channel status -#include "CondFormats/EcalObjects/interface/EcalChannelStatus.h" -#include "CondFormats/DataRecord/interface/EcalChannelStatusRcd.h" #include "CondFormats/EcalObjects/interface/EcalChannelStatusCode.h" #include "FWCore/Framework/interface/Run.h" @@ -47,11 +40,13 @@ const float PhiSymmetryCalibration::kMiscalRangeEE = .10; // Class constructor PhiSymmetryCalibration::PhiSymmetryCalibration(const edm::ParameterSet& iConfig) - : - - ecalHitsProducer_(iConfig.getParameter("ecalRecHitsProducer")), + : ecalHitsProducer_(iConfig.getParameter("ecalRecHitsProducer")), barrelHits_(iConfig.getParameter("barrelHitCollection")), endcapHits_(iConfig.getParameter("endcapHitCollection")), + ebRecHitToken_(consumes(edm::InputTag(ecalHitsProducer_, barrelHits_))), + eeRecHitToken_(consumes(edm::InputTag(ecalHitsProducer_, endcapHits_))), + channelStatusToken_(esConsumes()), + geometryToken_(esConsumes()), eCut_barl_(iConfig.getParameter("eCut_barrel")), ap_(iConfig.getParameter("ap")), b_(iConfig.getParameter("b")), @@ -71,6 +66,9 @@ PhiSymmetryCalibration::PhiSymmetryCalibration(const edm::ParameterSet& iConfig) nevents_ = 0; eventsinrun_ = 0; eventsinlb_ = 0; + + // because ROOT draws something + usesResource(); } //_____________________________________________________________________________ @@ -239,21 +237,20 @@ void PhiSymmetryCalibration::analyze(const edm::Event& event, const edm::EventSe Handle barrelRecHitsHandle; Handle endcapRecHitsHandle; - event.getByLabel(ecalHitsProducer_, barrelHits_, barrelRecHitsHandle); + event.getByToken(ebRecHitToken_, barrelRecHitsHandle); if (!barrelRecHitsHandle.isValid()) { LogError("") << "[PhiSymmetryCalibration] Error! Can't get product!" << std::endl; } - event.getByLabel(ecalHitsProducer_, endcapHits_, endcapRecHitsHandle); + event.getByToken(ebRecHitToken_, endcapRecHitsHandle); if (!endcapRecHitsHandle.isValid()) { LogError("") << "[PhiSymmetryCalibration] Error! Can't get product!" << std::endl; } // get the ecal geometry - edm::ESHandle geoHandle; - setup.get().get(geoHandle); - const CaloSubdetectorGeometry* barrelGeometry = geoHandle->getSubdetectorGeometry(DetId::Ecal, EcalBarrel); - const CaloSubdetectorGeometry* endcapGeometry = geoHandle->getSubdetectorGeometry(DetId::Ecal, EcalEndcap); + const auto& geometry = setup.getData(geometryToken_); + const auto* barrelGeometry = geometry.getSubdetectorGeometry(DetId::Ecal, EcalBarrel); + const auto* endcapGeometry = geometry.getSubdetectorGeometry(DetId::Ecal, EcalEndcap); bool pass = false; // select interesting EcalRecHits (barrel) @@ -377,6 +374,8 @@ void PhiSymmetryCalibration::analyze(const edm::Event& event, const edm::EventSe } } +void PhiSymmetryCalibration::beginRun(edm::Run const&, const edm::EventSetup&) {} + void PhiSymmetryCalibration::endRun(edm::Run const& run, const edm::EventSetup&) { std::cout << "PHIREPRT : run " << run.run() << " start " << (run.beginTime().value() >> 32) << " end " << (run.endTime().value() >> 32) << " dur " @@ -478,13 +477,11 @@ void PhiSymmetryCalibration::getKfactors() { //_____________________________________________________________________________ void PhiSymmetryCalibration::setUp(const edm::EventSetup& setup) { - edm::ESHandle chStatus; - setup.get().get(chStatus); + const auto& chStatus = setup.getData(channelStatusToken_); - edm::ESHandle geoHandle; - setup.get().get(geoHandle); + const auto& geometry = setup.getData(geometryToken_); - e_.setup(&(*geoHandle), &(*chStatus), statusThreshold_); + e_.setup(&geometry, &chStatus, statusThreshold_); if (reiteration_) { EcalCondHeader h; @@ -498,16 +495,11 @@ void PhiSymmetryCalibration::setUp(const edm::EventSetup& setup) { int ret = EcalIntercalibConstantsXMLTranslator::readXML(fip.fullPath(), h, oldCalibs_); if (ret) edm::LogError("PhiSym") << "Error reading XML files" << endl; - ; - - } else { - // in fact if not reiterating, oldCalibs_ will never be used - edm::ESHandle pIcal; - setup.get().get(pIcal); - oldCalibs_ = *pIcal; } } +void PhiSymmetryCalibration::beginLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) {} + void PhiSymmetryCalibration::endLuminosityBlock(edm::LuminosityBlock const& lb, edm::EventSetup const&) { if ((lb.endTime().value() >> 32) - (lb.beginTime().value() >> 32) < 60) return; diff --git a/Calibration/EcalCalibAlgos/src/PhiSymmetryCalibration_step2.cc b/Calibration/EcalCalibAlgos/src/PhiSymmetryCalibration_step2.cc index b0a3b2cbb9883..525c8a40c77ea 100644 --- a/Calibration/EcalCalibAlgos/src/PhiSymmetryCalibration_step2.cc +++ b/Calibration/EcalCalibAlgos/src/PhiSymmetryCalibration_step2.cc @@ -4,9 +4,6 @@ #include "CondFormats/EcalObjects/interface/EcalIntercalibConstants.h" #include "CondTools/Ecal/interface/EcalIntercalibConstantsXMLTranslator.h" #include "CondFormats/DataRecord/interface/EcalIntercalibConstantsRcd.h" -#include "CondFormats/DataRecord/interface/EcalChannelStatusRcd.h" -#include "Geometry/Records/interface/CaloGeometryRecord.h" -#include "Geometry/CaloGeometry/interface/CaloGeometry.h" #include "TH2F.h" @@ -20,14 +17,15 @@ using namespace std; PhiSymmetryCalibration_step2::~PhiSymmetryCalibration_step2() {} -PhiSymmetryCalibration_step2::PhiSymmetryCalibration_step2(const edm::ParameterSet& iConfig) { - statusThreshold_ = iConfig.getUntrackedParameter("statusThreshold", 0); - have_initial_miscalib_ = iConfig.getUntrackedParameter("haveInitialMiscalib", false); - initialmiscalibfile_ = iConfig.getUntrackedParameter("initialmiscalibfile", "InitialMiscalib.xml"); - oldcalibfile_ = iConfig.getUntrackedParameter("oldcalibfile", "EcalIntercalibConstants.xml"); - reiteration_ = iConfig.getUntrackedParameter("reiteration", false); - firstpass_ = true; -} +PhiSymmetryCalibration_step2::PhiSymmetryCalibration_step2(const edm::ParameterSet& iConfig) + : channelStatusToken_(esConsumes()), + geometryToken_(esConsumes()), + firstpass_(true), + statusThreshold_(iConfig.getUntrackedParameter("statusThreshold", 0)), + reiteration_(iConfig.getUntrackedParameter("reiteration", false)), + oldcalibfile_(iConfig.getUntrackedParameter("oldcalibfile", "EcalIntercalibConstants.xml")), + have_initial_miscalib_(iConfig.getUntrackedParameter("haveInitialMiscalib", false)), + initialmiscalibfile_(iConfig.getUntrackedParameter("initialmiscalibfile", "InitialMiscalib.xml")) {} void PhiSymmetryCalibration_step2::analyze(const edm::Event& ev, const edm::EventSetup& se) { if (firstpass_) { @@ -37,16 +35,14 @@ void PhiSymmetryCalibration_step2::analyze(const edm::Event& ev, const edm::Even } void PhiSymmetryCalibration_step2::setUp(const edm::EventSetup& se) { - edm::ESHandle chStatus; - se.get().get(chStatus); + const auto& chStatus = se.getData(channelStatusToken_); - edm::ESHandle geoHandle; - se.get().get(geoHandle); + const auto& geometry = se.getData(geometryToken_); - barrelCells = geoHandle->getValidDetIds(DetId::Ecal, EcalBarrel); - endcapCells = geoHandle->getValidDetIds(DetId::Ecal, EcalEndcap); + barrelCells = geometry.getValidDetIds(DetId::Ecal, EcalBarrel); + endcapCells = geometry.getValidDetIds(DetId::Ecal, EcalEndcap); - e_.setup(&(*geoHandle), &(*chStatus), statusThreshold_); + e_.setup(&geometry, &chStatus, statusThreshold_); /// if a miscalibration was applied, load it, if not put it to 1 if (have_initial_miscalib_) { diff --git a/Calibration/EcalCalibAlgos/src/PhiSymmetryCalibration_step2.h b/Calibration/EcalCalibAlgos/src/PhiSymmetryCalibration_step2.h index 99bb7044b2611..bc6de209ed439 100644 --- a/Calibration/EcalCalibAlgos/src/PhiSymmetryCalibration_step2.h +++ b/Calibration/EcalCalibAlgos/src/PhiSymmetryCalibration_step2.h @@ -1,15 +1,20 @@ +#ifndef Calibration_EcalCalibAlgos_PhiSymmetryCalibration_step2_h +#define Calibration_EcalCalibAlgos_PhiSymmetryCalibration_step2_h + #include "Calibration/EcalCalibAlgos/interface/EcalGeomPhiSymHelper.h" +#include "CondFormats/DataRecord/interface/EcalChannelStatusRcd.h" #include "CondFormats/EcalObjects/interface/EcalIntercalibConstants.h" -#include "FWCore/Framework/interface/EDAnalyzer.h" +#include "Geometry/Records/interface/CaloGeometryRecord.h" +#include "Geometry/CaloGeometry/interface/CaloGeometry.h" +#include "FWCore/Framework/interface/one/EDAnalyzer.h" #include "FWCore/Framework/interface/EventSetup.h" #include "FWCore/Framework/interface/ProducerBase.h" #include "FWCore/Framework/interface/Event.h" -#include "FWCore/Framework/interface/ESHandle.h" class TH1F; class TH2F; -class PhiSymmetryCalibration_step2 : public edm::EDAnalyzer { +class PhiSymmetryCalibration_step2 : public edm::one::EDAnalyzer<> { public: PhiSymmetryCalibration_step2(const edm::ParameterSet& iConfig); ~PhiSymmetryCalibration_step2() override; @@ -29,6 +34,9 @@ class PhiSymmetryCalibration_step2 : public edm::EDAnalyzer { void readEtSums(); private: + const edm::ESGetToken channelStatusToken_; + const edm::ESGetToken geometryToken_; + // Transverse energy sum arrays double etsum_barl_[kBarlRings][kBarlWedges][kSides]; double etsum_endc_[kEndcWedgesX][kEndcWedgesX][kSides]; @@ -62,10 +70,10 @@ class PhiSymmetryCalibration_step2 : public edm::EDAnalyzer { std::vector endcapCells; bool firstpass_; - int statusThreshold_; + const int statusThreshold_; - bool reiteration_; - std::string oldcalibfile_; + const bool reiteration_; + const std::string oldcalibfile_; /// the old calibration constants (when reiterating, the last ones derived) EcalIntercalibConstants oldCalibs_; @@ -77,8 +85,8 @@ class PhiSymmetryCalibration_step2 : public edm::EDAnalyzer { EcalIntercalibConstants miscalib_; /// - bool have_initial_miscalib_; - std::string initialmiscalibfile_; + const bool have_initial_miscalib_; + const std::string initialmiscalibfile_; /// res miscalib histos std::vector miscal_resid_barl_histos; @@ -87,3 +95,4 @@ class PhiSymmetryCalibration_step2 : public edm::EDAnalyzer { std::vector miscal_resid_endc_histos; std::vector correl_endc_histos; }; +#endif diff --git a/Calibration/EcalCalibAlgos/src/PhiSymmetryCalibration_step2_SM.cc b/Calibration/EcalCalibAlgos/src/PhiSymmetryCalibration_step2_SM.cc index 26920ad29267f..412de801b7bf1 100644 --- a/Calibration/EcalCalibAlgos/src/PhiSymmetryCalibration_step2_SM.cc +++ b/Calibration/EcalCalibAlgos/src/PhiSymmetryCalibration_step2_SM.cc @@ -4,9 +4,6 @@ #include "CondFormats/EcalObjects/interface/EcalIntercalibConstants.h" #include "CondTools/Ecal/interface/EcalIntercalibConstantsXMLTranslator.h" #include "CondFormats/DataRecord/interface/EcalIntercalibConstantsRcd.h" -#include "CondFormats/DataRecord/interface/EcalChannelStatusRcd.h" -#include "Geometry/Records/interface/CaloGeometryRecord.h" -#include "Geometry/CaloGeometry/interface/CaloGeometry.h" #include "TH2F.h" @@ -20,14 +17,15 @@ using namespace std; PhiSymmetryCalibration_step2_SM::~PhiSymmetryCalibration_step2_SM() {} -PhiSymmetryCalibration_step2_SM::PhiSymmetryCalibration_step2_SM(const edm::ParameterSet& iConfig) { - statusThreshold_ = iConfig.getUntrackedParameter("statusThreshold", 0); - have_initial_miscalib_ = iConfig.getUntrackedParameter("haveInitialMiscalib", false); - initialmiscalibfile_ = iConfig.getUntrackedParameter("initialmiscalibfile", "InitialMiscalib.xml"); - oldcalibfile_ = iConfig.getUntrackedParameter("oldcalibfile", "EcalIntercalibConstants.xml"); - reiteration_ = iConfig.getUntrackedParameter("reiteration", false); - firstpass_ = true; -} +PhiSymmetryCalibration_step2_SM::PhiSymmetryCalibration_step2_SM(const edm::ParameterSet& iConfig) + : channelStatusToken_(esConsumes()), + geometryToken_(esConsumes()), + firstpass_(true), + statusThreshold_(iConfig.getUntrackedParameter("statusThreshold", 0)), + reiteration_(iConfig.getUntrackedParameter("reiteration", false)), + oldcalibfile_(iConfig.getUntrackedParameter("oldcalibfile", "EcalIntercalibConstants.xml")), + have_initial_miscalib_(iConfig.getUntrackedParameter("haveInitialMiscalib", false)), + initialmiscalibfile_(iConfig.getUntrackedParameter("initialmiscalibfile", "InitialMiscalib.xml")) {} void PhiSymmetryCalibration_step2_SM::analyze(const edm::Event& ev, const edm::EventSetup& se) { if (firstpass_) { @@ -37,16 +35,14 @@ void PhiSymmetryCalibration_step2_SM::analyze(const edm::Event& ev, const edm::E } void PhiSymmetryCalibration_step2_SM::setUp(const edm::EventSetup& se) { - edm::ESHandle chStatus; - se.get().get(chStatus); + const auto& chStatus = se.getData(channelStatusToken_); - edm::ESHandle geoHandle; - se.get().get(geoHandle); + const auto& geometry = se.getData(geometryToken_); - barrelCells = geoHandle->getValidDetIds(DetId::Ecal, EcalBarrel); - endcapCells = geoHandle->getValidDetIds(DetId::Ecal, EcalEndcap); + barrelCells = geometry.getValidDetIds(DetId::Ecal, EcalBarrel); + endcapCells = geometry.getValidDetIds(DetId::Ecal, EcalEndcap); - e_.setup(&(*geoHandle), &(*chStatus), statusThreshold_); + e_.setup(&geometry, &chStatus, statusThreshold_); for (int sign = 0; sign < kSides; sign++) { for (int ieta = 0; ieta < kBarlRings; ieta++) { diff --git a/Calibration/EcalCalibAlgos/src/PhiSymmetryCalibration_step2_SM.h b/Calibration/EcalCalibAlgos/src/PhiSymmetryCalibration_step2_SM.h index 9e6fb71e8d9ea..a042821b6c560 100644 --- a/Calibration/EcalCalibAlgos/src/PhiSymmetryCalibration_step2_SM.h +++ b/Calibration/EcalCalibAlgos/src/PhiSymmetryCalibration_step2_SM.h @@ -1,15 +1,20 @@ +#ifndef Calibration_EcalCalibAlgos_PhiSymmetryCalibration_step2_SM_h +#define Calibration_EcalCalibAlgos_PhiSymmetryCalibration_step2_SM_h + #include "Calibration/EcalCalibAlgos/interface/EcalGeomPhiSymHelper.h" +#include "CondFormats/DataRecord/interface/EcalChannelStatusRcd.h" #include "CondFormats/EcalObjects/interface/EcalIntercalibConstants.h" -#include "FWCore/Framework/interface/EDAnalyzer.h" +#include "Geometry/Records/interface/CaloGeometryRecord.h" +#include "Geometry/CaloGeometry/interface/CaloGeometry.h" +#include "FWCore/Framework/interface/one/EDAnalyzer.h" #include "FWCore/Framework/interface/EventSetup.h" #include "FWCore/Framework/interface/ProducerBase.h" #include "FWCore/Framework/interface/Event.h" -#include "FWCore/Framework/interface/ESHandle.h" class TH1F; class TH2F; -class PhiSymmetryCalibration_step2_SM : public edm::EDAnalyzer { +class PhiSymmetryCalibration_step2_SM : public edm::one::EDAnalyzer<> { public: PhiSymmetryCalibration_step2_SM(const edm::ParameterSet& iConfig); ~PhiSymmetryCalibration_step2_SM() override; @@ -29,6 +34,9 @@ class PhiSymmetryCalibration_step2_SM : public edm::EDAnalyzer { void readEtSums(); private: + const edm::ESGetToken channelStatusToken_; + const edm::ESGetToken geometryToken_; + // Transverse energy sum arrays double etsum_barl_[kBarlRings][kBarlWedges][kSides]; @@ -71,10 +79,10 @@ class PhiSymmetryCalibration_step2_SM : public edm::EDAnalyzer { std::vector endcapCells; bool firstpass_; - int statusThreshold_; + const int statusThreshold_; - bool reiteration_; - std::string oldcalibfile_; + const bool reiteration_; + const std::string oldcalibfile_; /// the old calibration constants (when reiterating, the last ones derived) EcalIntercalibConstants oldCalibs_; @@ -86,8 +94,8 @@ class PhiSymmetryCalibration_step2_SM : public edm::EDAnalyzer { EcalIntercalibConstants miscalib_; /// - bool have_initial_miscalib_; - std::string initialmiscalibfile_; + const bool have_initial_miscalib_; + const std::string initialmiscalibfile_; /// res miscalib histos std::vector miscal_resid_barl_histos; @@ -96,3 +104,4 @@ class PhiSymmetryCalibration_step2_SM : public edm::EDAnalyzer { std::vector miscal_resid_endc_histos; std::vector correl_endc_histos; }; +#endif diff --git a/Calibration/EcalCalibAlgos/src/Pi0FixedMassWindowCalibration.cc b/Calibration/EcalCalibAlgos/src/Pi0FixedMassWindowCalibration.cc index 3a7c38e93878c..dc0f53472473e 100644 --- a/Calibration/EcalCalibAlgos/src/Pi0FixedMassWindowCalibration.cc +++ b/Calibration/EcalCalibAlgos/src/Pi0FixedMassWindowCalibration.cc @@ -6,17 +6,14 @@ // Conditions database -#include "CondFormats/DataRecord/interface/EcalIntercalibConstantsRcd.h" #include "Calibration/Tools/interface/Pi0CalibXMLwriter.h" // Reconstruction Classes #include "DataFormats/EgammaReco/interface/BasicCluster.h" #include "DataFormats/EgammaReco/interface/BasicClusterFwd.h" // Geometry -#include "Geometry/Records/interface/CaloGeometryRecord.h" #include "Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h" #include "Geometry/CaloGeometry/interface/CaloCellGeometry.h" -#include "Geometry/CaloGeometry/interface/CaloGeometry.h" #include "Geometry/CaloTopology/interface/EcalEndcapTopology.h" #include "Geometry/CaloTopology/interface/EcalBarrelTopology.h" @@ -35,7 +32,10 @@ using namespace std; Pi0FixedMassWindowCalibration::Pi0FixedMassWindowCalibration(const edm::ParameterSet& iConfig) : theMaxLoops(iConfig.getUntrackedParameter("maxLoops", 0)), ecalHitsProducer_(iConfig.getParameter("ecalRecHitsProducer")), - barrelHits_(iConfig.getParameter("barrelHitCollection")) { + barrelHits_(iConfig.getParameter("barrelHitCollection")), + recHitToken_(consumes(edm::InputTag(ecalHitsProducer_, barrelHits_))), + intercalibConstantsToken_(esConsumes()), + geometryToken_(esConsumes()) { std::cout << "[Pi0FixedMassWindowCalibration] Constructor " << std::endl; // The verbosity level std::string verbosityString = iConfig.getParameter("VerbosityLevel"); @@ -272,6 +272,9 @@ edm::EDLooper::Status Pi0FixedMassWindowCalibration::duringLoop(const edm::Event // this chunk used to belong to beginJob(isetup). Moved here // with the beginJob without arguments migration + // get the ecal geometry: + const auto& geometry = setup.getData(geometryToken_); + if (isfirstcall_) { // initialize arrays @@ -288,23 +291,9 @@ edm::EDLooper::Status Pi0FixedMassWindowCalibration::duringLoop(const edm::Event // get initial constants out of DB - edm::ESHandle pIcal; - EcalIntercalibConstantMap imap; - - try { - setup.get().get(pIcal); - std::cout << "Taken EcalIntercalibConstants" << std::endl; - imap = pIcal.product()->getMap(); - std::cout << "imap.size() = " << imap.size() << std::endl; - } catch (std::exception& ex) { - std::cerr << "Error! can't get EcalIntercalibConstants " << std::endl; - } - - // get the ecal geometry: - edm::ESHandle geoHandle; - setup.get().get(geoHandle); - const CaloGeometry& geometry = *geoHandle; - //const CaloSubdetectorGeometry *barrelGeometry = geometry.getSubdetectorGeometry(DetId::Ecal, EcalBarrel); + const auto& pIcal = setup.getData(intercalibConstantsToken_); + const auto& imap = pIcal.getMap(); + std::cout << "imap.size() = " << imap.size() << std::endl; // loop over all barrel crystals barrelCells = geometry.getValidDetIds(DetId::Ecal, EcalBarrel); @@ -340,7 +329,7 @@ edm::EDLooper::Status Pi0FixedMassWindowCalibration::duringLoop(const edm::Event int nRecHitsEB = 0; Handle pEcalRecHitBarrelCollection; - event.getByLabel(ecalHitsProducer_, barrelHits_, pEcalRecHitBarrelCollection); + event.getByToken(recHitToken_, pEcalRecHitBarrelCollection); const EcalRecHitCollection* ecalRecHitBarrelCollection = pEcalRecHitBarrelCollection.product(); cout << " ECAL Barrel RecHits # " << ecalRecHitBarrelCollection->size() << endl; for (EcalRecHitCollection::const_iterator aRecHitEB = ecalRecHitBarrelCollection->begin(); @@ -380,18 +369,14 @@ edm::EDLooper::Status Pi0FixedMassWindowCalibration::duringLoop(const edm::Event irecalib++; } - // get the geometry and topology from the event setup: - edm::ESHandle geoHandle; - setup.get().get(geoHandle); - const CaloSubdetectorGeometry* geometry_p; std::string clustershapetag; - geometry_p = geoHandle->getSubdetectorGeometry(DetId::Ecal, EcalBarrel); - EcalBarrelTopology topology{*geoHandle}; + geometry_p = geometry.getSubdetectorGeometry(DetId::Ecal, EcalBarrel); + EcalBarrelTopology topology{geometry}; const CaloSubdetectorGeometry* geometryES_p; - geometryES_p = geoHandle->getSubdetectorGeometry(DetId::Ecal, EcalPreshower); + geometryES_p = geometry.getSubdetectorGeometry(DetId::Ecal, EcalPreshower); /* reco::BasicClusterCollection clusters; diff --git a/Calibration/EcalCalibAlgos/src/ZeeCalibration.cc b/Calibration/EcalCalibAlgos/src/ZeeCalibration.cc index 7d483783b7514..316830af6c303 100644 --- a/Calibration/EcalCalibAlgos/src/ZeeCalibration.cc +++ b/Calibration/EcalCalibAlgos/src/ZeeCalibration.cc @@ -1,22 +1,12 @@ #include #include -#include -#include -#include #include -#include #include #include #include -#include -#include -#include -#include -#include #include #include -#include #include @@ -35,36 +25,39 @@ #include "CondFormats/EcalObjects/interface/EcalIntercalibConstants.h" #include "DataFormats/CaloRecHit/interface/CaloRecHit.h" #include "DataFormats/Common/interface/Handle.h" -#include "DataFormats/Common/interface/TriggerResults.h" -#include "DataFormats/DetId/interface/DetId.h" #include "DataFormats/EcalDetId/interface/EBDetId.h" #include "DataFormats/EcalDetId/interface/EEDetId.h" -#include "DataFormats/EcalRecHit/interface/EcalRecHit.h" -#include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h" -#include "DataFormats/EgammaCandidates/interface/Electron.h" -#include "DataFormats/EgammaCandidates/interface/GsfElectron.h" -#include "DataFormats/EgammaCandidates/interface/GsfElectronFwd.h" #include "DataFormats/EgammaReco/interface/BasicCluster.h" #include "DataFormats/EgammaReco/interface/SuperCluster.h" -#include "DataFormats/TrackReco/interface/Track.h" -#include "DataFormats/TrackReco/interface/TrackExtraFwd.h" -#include "DataFormats/TrackReco/interface/TrackFwd.h" -#include "FWCore/Framework/interface/ESHandle.h" -#include "FWCore/Framework/interface/EventSetup.h" #include "FWCore/Framework/interface/TriggerNamesService.h" -#include "FWCore/MessageLogger/interface/MessageLogger.h" -#include "FWCore/ParameterSet/interface/ParameterSet.h" #include "FWCore/ServiceRegistry/interface/Service.h" -#include "Geometry/CaloGeometry/interface/CaloGeometry.h" #include "Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h" -#include "Geometry/Records/interface/CaloGeometryRecord.h" -#include "SimDataFormats/GeneratorProducts/interface/HepMCProduct.h" #define MZ 91.1876 #define DEBUG 1 -ZeeCalibration::ZeeCalibration(const edm::ParameterSet& iConfig) { +ZeeCalibration::ZeeCalibration(const edm::ParameterSet& iConfig) + : hlTriggerResults_(iConfig.getParameter("HLTriggerResults")), + mcProducer_(iConfig.getUntrackedParameter("mcProducer", "")), + rechitProducer_(iConfig.getParameter("rechitProducer")), + rechitCollection_(iConfig.getParameter("rechitCollection")), + erechitProducer_(iConfig.getParameter("erechitProducer")), + erechitCollection_(iConfig.getParameter("erechitCollection")), + scProducer_(iConfig.getParameter("scProducer")), + scCollection_(iConfig.getParameter("scCollection")), + scIslandProducer_(iConfig.getParameter("scIslandProducer")), + scIslandCollection_(iConfig.getParameter("scIslandCollection")), + electronProducer_(iConfig.getParameter("electronProducer")), + electronCollection_(iConfig.getParameter("electronCollection")), + trigResultsToken_(consumes(hlTriggerResults_)), + hepMCToken_(consumes(edm::InputTag(mcProducer_))), + ebRecHitToken_(consumes(edm::InputTag(rechitProducer_, rechitCollection_))), + eeRecHitToken_(consumes(edm::InputTag(erechitProducer_, erechitCollection_))), + scToken_(consumes(edm::InputTag(scProducer_, scCollection_))), + islandSCToken_(consumes(edm::InputTag(scIslandProducer_, scIslandCollection_))), + gsfElectronToken_(consumes(edm::InputTag(electronProducer_, electronCollection_))), + geometryToken_(esConsumes()) { #ifdef DEBUG std::cout << "[ZeeCalibration] Starting the ctor" << std::endl; #endif @@ -78,25 +71,8 @@ ZeeCalibration::ZeeCalibration(const edm::ParameterSet& iConfig) { minInvMassCut_ = iConfig.getUntrackedParameter("minInvMassCut", 70.); maxInvMassCut_ = iConfig.getUntrackedParameter("maxInvMassCut", 110.); - rechitProducer_ = iConfig.getParameter("rechitProducer"); - rechitCollection_ = iConfig.getParameter("rechitCollection"); - - erechitProducer_ = iConfig.getParameter("erechitProducer"); - erechitCollection_ = iConfig.getParameter("erechitCollection"); - - scProducer_ = iConfig.getParameter("scProducer"); - scCollection_ = iConfig.getParameter("scCollection"); - - scIslandProducer_ = iConfig.getParameter("scIslandProducer"); - scIslandCollection_ = iConfig.getParameter("scIslandCollection"); - calibMode_ = iConfig.getUntrackedParameter("ZCalib_CalibType"); - mcProducer_ = iConfig.getUntrackedParameter("mcProducer", ""); - - electronProducer_ = iConfig.getParameter("electronProducer"); - electronCollection_ = iConfig.getParameter("electronCollection"); - outputFile_ = TFile::Open(outputFileName_.c_str(), "RECREATE"); // open output file to store histograms myTree = new TTree("myTree", "myTree"); @@ -124,8 +100,6 @@ ZeeCalibration::ZeeCalibration(const edm::ParameterSet& iConfig) { //ZeeCalibrationPLots("zeeCalibPlots"); //ZeecaPlots->bookHistos(maxsIter); - hlTriggerResults_ = iConfig.getParameter("HLTriggerResults"); - theParameterSet = iConfig; EcalIndexingTools* myIndexTool = nullptr; @@ -585,9 +559,8 @@ edm::EDLooper::Status ZeeCalibration::duringLoop(const edm::Event& iEvent, const // code that used to be in beginJob if (isfirstcall_) { //inizializzare la geometria di ecal - edm::ESHandle pG; - iSetup.get().get(pG); - EcalRingCalibrationTools::setCaloGeometry(&(*pG)); + const auto& geometry = iSetup.getData(geometryToken_); + EcalRingCalibrationTools::setCaloGeometry(&geometry); myZeePlots_ = new ZeePlots("zeePlots.root"); // myZeeRescaleFactorPlots_ = new ZeeRescaleFactorPlots("zeeRescaleFactorPlots.root"); @@ -717,7 +690,7 @@ edm::EDLooper::Status ZeeCalibration::duringLoop(const edm::Event& iEvent, const #endif edm::Handle hltTriggerResultHandle; - iEvent.getByLabel(hlTriggerResults_, hltTriggerResultHandle); + iEvent.getByToken(trigResultsToken_, hltTriggerResultHandle); if (!hltTriggerResultHandle.isValid()) { //std::cout << "invalid handle for HLT TriggerResults" << std::endl; @@ -757,8 +730,7 @@ edm::EDLooper::Status ZeeCalibration::duringLoop(const edm::Event& iEvent, const if (!mcProducer_.empty()) { //DUMP GENERATED Z MASS - BEGIN Handle hepProd; - // iEvent.getByLabel( "source", hepProd ) ; - iEvent.getByLabel(mcProducer_, hepProd); + iEvent.getByToken(hepMCToken_, hepProd); const HepMC::GenEvent* myGenEvent = hepProd->GetEvent(); @@ -809,27 +781,24 @@ edm::EDLooper::Status ZeeCalibration::duringLoop(const edm::Event& iEvent, const // Get EBRecHits Handle phits; - try { - iEvent.getByLabel(rechitProducer_, rechitCollection_, phits); - } catch (std::exception& ex) { + iEvent.getByToken(ebRecHitToken_, phits); + if (!phits.isValid()) { std::cerr << "Error! can't get the product EBRecHitCollection " << std::endl; } const EBRecHitCollection* hits = phits.product(); // get a ptr to the product // Get EERecHits Handle ephits; - try { - iEvent.getByLabel(erechitProducer_, erechitCollection_, ephits); - } catch (std::exception& ex) { + iEvent.getByToken(eeRecHitToken_, ephits); + if (!ephits.isValid()) { std::cerr << "Error! can't get the product EERecHitCollection " << std::endl; } const EERecHitCollection* ehits = ephits.product(); // get a ptr to the product //Get Hybrid SuperClusters Handle pSuperClusters; - try { - iEvent.getByLabel(scProducer_, scCollection_, pSuperClusters); - } catch (std::exception& ex) { + iEvent.getByToken(scToken_, pSuperClusters); + if (!pSuperClusters.isValid()) { std::cerr << "Error! can't get the product SuperClusterCollection " << std::endl; } const reco::SuperClusterCollection* scCollection = pSuperClusters.product(); @@ -843,9 +812,8 @@ edm::EDLooper::Status ZeeCalibration::duringLoop(const edm::Event& iEvent, const //Get Island SuperClusters Handle pIslandSuperClusters; - try { - iEvent.getByLabel(scIslandProducer_, scIslandCollection_, pIslandSuperClusters); - } catch (std::exception& ex) { + iEvent.getByToken(islandSCToken_, pIslandSuperClusters); + if (!pIslandSuperClusters.isValid()) { std::cerr << "Error! can't get the product IslandSuperClusterCollection " << std::endl; } const reco::SuperClusterCollection* scIslandCollection = pIslandSuperClusters.product(); @@ -859,9 +827,8 @@ edm::EDLooper::Status ZeeCalibration::duringLoop(const edm::Event& iEvent, const // Get Electrons Handle pElectrons; - try { - iEvent.getByLabel(electronProducer_, electronCollection_, pElectrons); - } catch (std::exception& ex) { + iEvent.getByToken(gsfElectronToken_, pElectrons); + if (!pElectrons.isValid()) { std::cerr << "Error! can't get the product ElectronCollection " << std::endl; } const reco::GsfElectronCollection* electronCollection = pElectrons.product(); diff --git a/Calibration/HcalAlCaRecoProducers/BuildFile.xml b/Calibration/HcalAlCaRecoProducers/BuildFile.xml deleted file mode 100644 index 70a45f24766ba..0000000000000 --- a/Calibration/HcalAlCaRecoProducers/BuildFile.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Calibration/HcalAlCaRecoProducers/interface/AlCaEcalHcalReadoutsProducer.h b/Calibration/HcalAlCaRecoProducers/interface/AlCaEcalHcalReadoutsProducer.h deleted file mode 100644 index 71980b641a95c..0000000000000 --- a/Calibration/HcalAlCaRecoProducers/interface/AlCaEcalHcalReadoutsProducer.h +++ /dev/null @@ -1,51 +0,0 @@ -// -*- C++ -*- - -// system include files -#include -#include -// user include files -#include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/global/EDProducer.h" - -#include "FWCore/Framework/interface/Event.h" -#include "FWCore/Framework/interface/MakerMacros.h" - -#include "FWCore/ParameterSet/interface/ParameterSet.h" -#include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/Event.h" -#include "FWCore/Framework/interface/MakerMacros.h" -#include "FWCore/Framework/interface/EventSetup.h" -#include "FWCore/ParameterSet/interface/ParameterSet.h" - -#include "DataFormats/Common/interface/Ref.h" -#include "DataFormats/CaloTowers/interface/CaloTowerCollection.h" -#include "DataFormats/DetId/interface/DetId.h" - -#include "Geometry/Records/interface/IdealGeometryRecord.h" -#include "Geometry/CaloGeometry/interface/CaloGeometry.h" -#include "DataFormats/GeometryVector/interface/GlobalPoint.h" -#include "DataFormats/CaloTowers/interface/CaloTowerDetId.h" -#include "DataFormats/HcalRecHit/interface/HcalRecHitCollections.h" -#include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h" - -// -// class decleration -// - -class AlCaEcalHcalReadoutsProducer : public edm::global::EDProducer<> { -public: - explicit AlCaEcalHcalReadoutsProducer(const edm::ParameterSet &); - - void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override; - -private: - // ----------member data --------------------------- - - edm::EDGetTokenT tok_hbhe_; - edm::EDGetTokenT tok_ho_; - edm::EDGetTokenT tok_hf_; - - edm::EDPutTokenT put_hbhe_; - edm::EDPutTokenT put_ho_; - edm::EDPutTokenT put_hf_; -}; diff --git a/Calibration/HcalAlCaRecoProducers/interface/AlCaHcalNoiseProducer.h b/Calibration/HcalAlCaRecoProducers/interface/AlCaHcalNoiseProducer.h deleted file mode 100644 index f1c5d19926916..0000000000000 --- a/Calibration/HcalAlCaRecoProducers/interface/AlCaHcalNoiseProducer.h +++ /dev/null @@ -1,72 +0,0 @@ -// -*- C++ -*- - -// system include files -#include -#include -// user include files -#include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/EDProducer.h" - -#include "FWCore/Framework/interface/Event.h" -#include "FWCore/Framework/interface/MakerMacros.h" - -#include "FWCore/ParameterSet/interface/ParameterSet.h" -#include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/Event.h" -#include "FWCore/Framework/interface/MakerMacros.h" -#include "FWCore/Framework/interface/EventSetup.h" -#include "FWCore/ParameterSet/interface/ParameterSet.h" - -#include "DataFormats/Common/interface/Ref.h" -#include "DataFormats/CaloTowers/interface/CaloTowerCollection.h" -#include "DataFormats/DetId/interface/DetId.h" - -#include "Geometry/Records/interface/IdealGeometryRecord.h" -#include "Geometry/CaloGeometry/interface/CaloGeometry.h" -#include "DataFormats/GeometryVector/interface/GlobalPoint.h" -#include "DataFormats/CaloTowers/interface/CaloTowerDetId.h" -#include "DataFormats/HcalRecHit/interface/HcalRecHitCollections.h" -#include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h" - -#include "DataFormats/FEDRawData/interface/FEDRawDataCollection.h" -#include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h" -#include "DataFormats/METReco/interface/CaloMETCollection.h" -#include "DataFormats/JetReco/interface/CaloJetCollection.h" -#include "DataFormats/CaloTowers/interface/CaloTowerCollection.h" - -// -// class decleration -// - -class AlCaHcalNoiseProducer : public edm::EDProducer { -public: - explicit AlCaHcalNoiseProducer(const edm::ParameterSet &); - ~AlCaHcalNoiseProducer() override; - - void produce(edm::Event &, const edm::EventSetup &) override; - -private: - // ----------member data --------------------------- - - bool useMet_; - bool useJet_; - double MetCut_; - double JetMinE_; - double JetHCALminEnergyFraction_; - int nAnomalousEvents; - int nEvents; - - std::vector ecalLabels_; - - edm::EDGetTokenT tok_jets_; - edm::EDGetTokenT tok_met_; - edm::EDGetTokenT tok_tower_; - - edm::EDGetTokenT tok_hbhe_; - edm::EDGetTokenT tok_ho_; - edm::EDGetTokenT tok_hf_; - - edm::EDGetTokenT tok_ps_; - edm::EDGetTokenT tok_raw_; - std::vector > toks_ecal_; -}; diff --git a/Calibration/HcalAlCaRecoProducers/src/AlCaDiJetsProducer.cc b/Calibration/HcalAlCaRecoProducers/plugins/AlCaDiJetsProducer.cc similarity index 100% rename from Calibration/HcalAlCaRecoProducers/src/AlCaDiJetsProducer.cc rename to Calibration/HcalAlCaRecoProducers/plugins/AlCaDiJetsProducer.cc diff --git a/Calibration/HcalAlCaRecoProducers/plugins/AlCaEcalHcalReadoutsProducer.cc b/Calibration/HcalAlCaRecoProducers/plugins/AlCaEcalHcalReadoutsProducer.cc new file mode 100644 index 0000000000000..7d7d636267716 --- /dev/null +++ b/Calibration/HcalAlCaRecoProducers/plugins/AlCaEcalHcalReadoutsProducer.cc @@ -0,0 +1,92 @@ +// -*- C++ -*- + +// system include files +#include +#include +// user include files +#include "FWCore/Framework/interface/Frameworkfwd.h" +#include "FWCore/Framework/interface/global/EDProducer.h" +#include "FWCore/Framework/interface/Event.h" +#include "FWCore/Framework/interface/EventSetup.h" +#include "FWCore/MessageLogger/interface/MessageLogger.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" + +#include "DataFormats/Common/interface/Ref.h" +#include "DataFormats/CaloTowers/interface/CaloTowerCollection.h" +#include "DataFormats/DetId/interface/DetId.h" + +#include "Geometry/Records/interface/IdealGeometryRecord.h" +#include "Geometry/CaloGeometry/interface/CaloGeometry.h" +#include "DataFormats/GeometryVector/interface/GlobalPoint.h" +#include "DataFormats/CaloTowers/interface/CaloTowerDetId.h" +#include "DataFormats/HcalRecHit/interface/HcalRecHitCollections.h" +#include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h" + +// +// class decleration +// + +class AlCaEcalHcalReadoutsProducer : public edm::global::EDProducer<> { +public: + explicit AlCaEcalHcalReadoutsProducer(const edm::ParameterSet&); + + void produce(edm::StreamID, edm::Event&, const edm::EventSetup&) const override; + +private: + // ----------member data --------------------------- + + edm::EDGetTokenT tok_hbhe_; + edm::EDGetTokenT tok_ho_; + edm::EDGetTokenT tok_hf_; + + edm::EDPutTokenT put_hbhe_; + edm::EDPutTokenT put_ho_; + edm::EDPutTokenT put_hf_; +}; + +AlCaEcalHcalReadoutsProducer::AlCaEcalHcalReadoutsProducer(const edm::ParameterSet& iConfig) { + tok_ho_ = consumes(iConfig.getParameter("hoInput")); + tok_hf_ = consumes(iConfig.getParameter("hfInput")); + tok_hbhe_ = consumes(iConfig.getParameter("hbheInput")); + + //register your products + put_hbhe_ = produces("HBHERecHitCollection"); + put_ho_ = produces("HORecHitCollection"); + put_hf_ = produces("HFRecHitCollection"); +} + +// ------------ method called to produce the data ------------ +void AlCaEcalHcalReadoutsProducer::produce(edm::StreamID, edm::Event& iEvent, const edm::EventSetup& iSetup) const { + using namespace edm; + using namespace std; + + edm::Handle hbhe; + edm::Handle ho; + edm::Handle hf; + + iEvent.getByToken(tok_hbhe_, hbhe); + if (!hbhe.isValid()) { + LogDebug("") << "AlCaEcalHcalReadoutProducer: Error! can't get hbhe product!" << std::endl; + return; + } + + iEvent.getByToken(tok_ho_, ho); + if (!ho.isValid()) { + LogDebug("") << "AlCaEcalHcalReadoutProducer: Error! can't get ho product!" << std::endl; + } + + iEvent.getByToken(tok_hf_, hf); + if (!hf.isValid()) { + LogDebug("") << "AlCaEcalHcalReadoutProducer: Error! can't get hf product!" << std::endl; + } + + //Put selected information in the event + iEvent.emplace(put_hbhe_, *hbhe); + iEvent.emplace(put_ho_, *ho); + iEvent.emplace(put_hf_, *hf); +} + +#include "FWCore/PluginManager/interface/ModuleDef.h" +#include "FWCore/Framework/interface/MakerMacros.h" + +DEFINE_FWK_MODULE(AlCaEcalHcalReadoutsProducer); diff --git a/Calibration/HcalAlCaRecoProducers/src/AlCaGammaJetProducer.cc b/Calibration/HcalAlCaRecoProducers/plugins/AlCaGammaJetProducer.cc similarity index 100% rename from Calibration/HcalAlCaRecoProducers/src/AlCaGammaJetProducer.cc rename to Calibration/HcalAlCaRecoProducers/plugins/AlCaGammaJetProducer.cc diff --git a/Calibration/HcalAlCaRecoProducers/plugins/AlCaHBHEMuonFilter.cc b/Calibration/HcalAlCaRecoProducers/plugins/AlCaHBHEMuonFilter.cc index d641028461442..1b099430b64cc 100644 --- a/Calibration/HcalAlCaRecoProducers/plugins/AlCaHBHEMuonFilter.cc +++ b/Calibration/HcalAlCaRecoProducers/plugins/AlCaHBHEMuonFilter.cc @@ -70,6 +70,7 @@ class AlCaHBHEMuonFilter : public edm::stream::EDFilter tok_trigEvt; @@ -104,6 +105,7 @@ AlCaHBHEMuonFilter::AlCaHBHEMuonFilter(edm::ParameterSet const& iConfig, const A preScale_ = iConfig.getParameter("PreScale"); if (preScale_ < 1) preScale_ = 1; + onlyOuterTrack_ = iConfig.getParameter("OnlyOuterTrack"); // define tokens for access tok_trigRes_ = consumes(triggerResults_); @@ -112,9 +114,11 @@ AlCaHBHEMuonFilter::AlCaHBHEMuonFilter(edm::ParameterSet const& iConfig, const A tok_geom_ = esConsumes(); tok_magField_ = esConsumes(); - edm::LogVerbatim("HBHEMuon") << "Parameters read from config file \n" - << "Process " << processName_ << " Prescale " << preScale_ << " Isolation Cuts " - << trackIsoCut_ << ":" << caloIsoCut_ << "\n"; + edm::LogVerbatim("HBHEMuon") << "Parameters read from config file \nProcess " << processName_ << " Prescale " + << preScale_ << " Isolation Cuts " << pfCut_ << ":" << pfIsoCut_ << ":" << trackIsoCut_ + << ":" << caloIsoCut_ << " OnlyOuterTrack " << onlyOuterTrack_ << "\nInput tags " + << labelMuon_ << " and " << triggerResults_ << "\nStudy " << trigNames_.size() + << " triggers: "; for (unsigned int k = 0; k < trigNames_.size(); ++k) edm::LogVerbatim("HBHEMuon") << "Trigger[" << k << "] " << trigNames_[k] << "\n"; } // AlCaHBHEMuonFilter::AlCaHBHEMuonFilter constructor @@ -171,9 +175,12 @@ bool AlCaHBHEMuonFilter::filter(edm::Event& iEvent, edm::EventSetup const& iSetu edm::Handle _Muon; iEvent.getByToken(tok_Muon_, _Muon); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("HBHEMuon") << "AlCaHBHEMuonFilter::Muon Handle " << _Muon.isValid() << std::endl; + edm::LogVerbatim("HBHEMuon") << "AlCaHBHEMuonFilter::Muon Handle " << _Muon.isValid(); #endif if (_Muon.isValid()) { +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("HBHEMuon") << "AlCaHBHEMuonFilter::Size of collection " << _Muon->size(); +#endif for (reco::MuonCollection::const_iterator RecMuon = _Muon->begin(); RecMuon != _Muon->end(); ++RecMuon) { #ifdef EDM_ML_DEBUG edm::LogVerbatim("HBHEMuon") << "AlCaHBHEMuonFilter::Muon:Track " << RecMuon->track().isNonnull() @@ -181,9 +188,11 @@ bool AlCaHBHEMuonFilter::filter(edm::Event& iEvent, edm::EventSetup const& iSetu << RecMuon->outerTrack().isNonnull() << " globalTrack " << RecMuon->globalTrack().isNonnull() << std::endl; #endif - if ((RecMuon->track().isNonnull()) && (RecMuon->innerTrack().isNonnull()) && - (RecMuon->outerTrack().isNonnull()) && (RecMuon->globalTrack().isNonnull())) { - const reco::Track* pTrack = (RecMuon->innerTrack()).get(); + bool check = (onlyOuterTrack_) ? (RecMuon->outerTrack().isNonnull()) + : ((RecMuon->track().isNonnull()) && (RecMuon->innerTrack().isNonnull()) && + (RecMuon->outerTrack().isNonnull()) && (RecMuon->globalTrack().isNonnull())); + if (check) { + const reco::Track* pTrack = (onlyOuterTrack_) ? (RecMuon->outerTrack()).get() : (RecMuon->innerTrack()).get(); spr::propagatedTrackID trackID = spr::propagateCALO(pTrack, geo, bField, false); #ifdef EDM_ML_DEBUG edm::LogVerbatim("HBHEMuon") << "AlCaHBHEMuonFilter::Propagate: ECAL " << trackID.okECAL << " to HCAL " @@ -198,6 +207,10 @@ bool AlCaHBHEMuonFilter::filter(edm::Event& iEvent, edm::EventSetup const& iSetu (0.5 * RecMuon->pfIsolationR04().sumPUPt))) / RecMuon->pt()); bool isoCut = (pfCut_) ? (isolR04 < pfIsoCut_) : ((trackIso < trackIsoCut_) && (caloIso < caloIsoCut_)); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("HBHEMuon") << "AlCaHBHEMuonFilter::Isolation: " << trackIso << ":" << caloIso << ":" + << isolR04 << " --> " << isoCut; +#endif if ((trackID.okECAL) && (trackID.okHCAL) && isoCut) { accept = true; break; @@ -260,6 +273,7 @@ void AlCaHBHEMuonFilter::fillDescriptions(edm::ConfigurationDescriptions& descri desc.add("TrackIsolationCut", 3.0); desc.add("CaloIsolationCut", 5.0); desc.add("PreScale", 2); + desc.add("OnlyOuterTrack", false); descriptions.add("AlcaHBHEMuonFilter", desc); } diff --git a/Calibration/HcalAlCaRecoProducers/src/AlCaHBHEMuonProducer.cc b/Calibration/HcalAlCaRecoProducers/plugins/AlCaHBHEMuonProducer.cc similarity index 99% rename from Calibration/HcalAlCaRecoProducers/src/AlCaHBHEMuonProducer.cc rename to Calibration/HcalAlCaRecoProducers/plugins/AlCaHBHEMuonProducer.cc index 9a556e426f578..41a728411843d 100644 --- a/Calibration/HcalAlCaRecoProducers/src/AlCaHBHEMuonProducer.cc +++ b/Calibration/HcalAlCaRecoProducers/plugins/AlCaHBHEMuonProducer.cc @@ -33,6 +33,7 @@ #include "DataFormats/VertexReco/interface/VertexFwd.h" #include "DataFormats/VertexReco/interface/Vertex.h" +//#define EDM_ML_DEBUG // // class declaration // diff --git a/Calibration/HcalAlCaRecoProducers/src/AlCaHOCalibProducer.cc b/Calibration/HcalAlCaRecoProducers/plugins/AlCaHOCalibProducer.cc similarity index 100% rename from Calibration/HcalAlCaRecoProducers/src/AlCaHOCalibProducer.cc rename to Calibration/HcalAlCaRecoProducers/plugins/AlCaHOCalibProducer.cc diff --git a/Calibration/HcalAlCaRecoProducers/plugins/AlCaHcalHBHEMuonFilter.cc b/Calibration/HcalAlCaRecoProducers/plugins/AlCaHcalHBHEMuonFilter.cc new file mode 100644 index 0000000000000..87750d77738e3 --- /dev/null +++ b/Calibration/HcalAlCaRecoProducers/plugins/AlCaHcalHBHEMuonFilter.cc @@ -0,0 +1,127 @@ +// system include files +#include +#include +#include + +// user include files +#include "FWCore/Framework/interface/Frameworkfwd.h" +#include "FWCore/Framework/interface/global/EDFilter.h" +#include "FWCore/Framework/interface/Event.h" +#include "FWCore/Framework/interface/EventSetup.h" +#include "FWCore/Framework/interface/Run.h" +#include "FWCore/MessageLogger/interface/MessageLogger.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" + +#include "DataFormats/Common/interface/Handle.h" +#include "DataFormats/Common/interface/Ref.h" +#include "DataFormats/HcalCalibObjects/interface/HcalHBHEMuonVariables.h" + +//#define EDM_ML_DEBUG +// +// class declaration +// + +namespace alcaHcalHBHEMuon { + struct Counters { + Counters() : nAll_(0), nGood_(0), nFinal_(0) {} + mutable std::atomic nAll_, nGood_, nFinal_; + }; +} // namespace alcaHcalHBHEMuon + +class AlCaHcalHBHEMuonFilter : public edm::global::EDFilter > { +public: + AlCaHcalHBHEMuonFilter(edm::ParameterSet const&); + ~AlCaHcalHBHEMuonFilter() override = default; + + std::shared_ptr globalBeginRun(edm::Run const&, edm::EventSetup const&) const override; + + bool filter(edm::StreamID, edm::Event&, edm::EventSetup const&) const override; + void globalEndRun(edm::Run const& iRun, edm::EventSetup const&) const override; + static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); + +private: + // ----------member data --------------------------- + int prescale_; + edm::InputTag labelHBHEMuonVar_; + edm::EDGetTokenT tokHBHEMuonVar_; +}; + +// +// constructors and destructor +// +AlCaHcalHBHEMuonFilter::AlCaHcalHBHEMuonFilter(edm::ParameterSet const& iConfig) + : prescale_(iConfig.getParameter("prescale")), + labelHBHEMuonVar_(iConfig.getParameter("hbheMuonLabel")), + tokHBHEMuonVar_(consumes(labelHBHEMuonVar_)) { + edm::LogVerbatim("HBHEMuon") << "Parameters read from config file \n\t prescale_ " << prescale_ << "\n\t Labels " + << labelHBHEMuonVar_; +} // AlCaHcalHBHEMuonFilter::AlCaHcalHBHEMuonFilter constructor + +// +// member functions +// + +// ------------ method called on each new Event ------------ +bool AlCaHcalHBHEMuonFilter::filter(edm::StreamID, edm::Event& iEvent, edm::EventSetup const&) const { + bool accept(false); + ++(runCache(iEvent.getRun().index())->nAll_); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("HBHEMuon") << "AlCaHcalHBHEMuonFilter::Run " << iEvent.id().run() << " Event " + << iEvent.id().event() << " Luminosity " << iEvent.luminosityBlock() << " Bunch " + << iEvent.bunchCrossing(); +#endif + + auto const& hbheMuonColl = iEvent.getHandle(tokHBHEMuonVar_); + if (hbheMuonColl.isValid()) { + auto hbheMuon = hbheMuonColl.product(); + if (!hbheMuon->empty()) { + ++(runCache(iEvent.getRun().index())->nGood_); + if (prescale_ <= 1) + accept = true; + else if (runCache(iEvent.getRun().index())->nGood_ % prescale_ == 1) + accept = true; + } + } else { + edm::LogVerbatim("HBHEMuon") << "AlCaHcalHBHEMuonFilter::Cannot find the collection for HcalHBHEMuonVariables"; + } + + // Return the acceptance flag + if (accept) + ++(runCache(iEvent.getRun().index())->nFinal_); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("HBHEMuon") << "AlCaHcalHBHEMuonFilter::Accept flag " << accept << " All " + << runCache(iEvent.getRun().index())->nAll_ << " Good " + << runCache(iEvent.getRun().index())->nGood_ << " Final " + << runCache(iEvent.getRun().index())->nFinal_; +#endif + return accept; + +} // AlCaHcalHBHEMuonFilter::filter + +// ------------ method called when starting to processes a run ------------ +std::shared_ptr AlCaHcalHBHEMuonFilter::globalBeginRun(edm::Run const& iRun, + edm::EventSetup const&) const { + edm::LogVerbatim("HBHEMuon") << "Start the Run " << iRun.run(); + return std::make_shared(); +} + +// ------------ method called when ending the processing of a run ------------ +void AlCaHcalHBHEMuonFilter::globalEndRun(edm::Run const& iRun, edm::EventSetup const&) const { + edm::LogVerbatim("HBHEMuon") << "Select " << runCache(iRun.index())->nFinal_ << " out of " + << runCache(iRun.index())->nGood_ << " good and " << runCache(iRun.index())->nAll_ + << " total events"; +} + +// ------------ method fills 'descriptions' with the allowed parameters for the module ------------ +void AlCaHcalHBHEMuonFilter::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { + edm::ParameterSetDescription desc; + desc.add("prescale", 1); + desc.add("hbheMuonLabel", edm::InputTag("alcaHcalHBHEMuonProducer", "hbheMuon")); + descriptions.add("alcaHcalHBHEMuonFilter", desc); +} + +//define this as a plug-in +#include "FWCore/Framework/interface/MakerMacros.h" + +DEFINE_FWK_MODULE(AlCaHcalHBHEMuonFilter); diff --git a/Calibration/HcalAlCaRecoProducers/plugins/AlCaHcalHBHEMuonProducer.cc b/Calibration/HcalAlCaRecoProducers/plugins/AlCaHcalHBHEMuonProducer.cc new file mode 100644 index 0000000000000..5fd7e1ce0f87f --- /dev/null +++ b/Calibration/HcalAlCaRecoProducers/plugins/AlCaHcalHBHEMuonProducer.cc @@ -0,0 +1,906 @@ +#include +#include +#include +#include +#include +#include +#include "TPRegexp.h" + +// user include files +#include "FWCore/Framework/interface/Frameworkfwd.h" +#include "FWCore/Framework/interface/stream/EDProducer.h" +#include "FWCore/Framework/interface/Event.h" +#include "FWCore/MessageLogger/interface/MessageLogger.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" +#include "FWCore/ServiceRegistry/interface/Service.h" +#include "FWCore/Common/interface/TriggerNames.h" + +#include "DataFormats/HcalCalibObjects/interface/HcalHBHEMuonVariables.h" +#include "DataFormats/HcalDetId/interface/HcalDetId.h" +#include "DataFormats/MuonReco/interface/Muon.h" +#include "DataFormats/MuonReco/interface/MuonFwd.h" +#include "DataFormats/MuonReco/interface/MuonSelectors.h" +#include "DataFormats/VertexReco/interface/Vertex.h" +#include "DataFormats/VertexReco/interface/VertexFwd.h" +#include "DataFormats/TrackReco/interface/Track.h" + +//////////////trigger info//////////////////////////////////// + +#include "DataFormats/Common/interface/TriggerResults.h" +#include "DataFormats/HLTReco/interface/TriggerObject.h" +#include "DataFormats/HLTReco/interface/TriggerEvent.h" +#include "DataFormats/EcalDetId/interface/EcalSubdetector.h" +#include "DataFormats/EcalDetId/interface/EBDetId.h" +#include "DataFormats/EcalDetId/interface/EEDetId.h" +#include "DataFormats/HcalDetId/interface/HcalDetId.h" +#include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h" +#include "DataFormats/HcalRecHit/interface/HcalRecHitCollections.h" + +#include "HLTrigger/HLTcore/interface/HLTConfigProvider.h" +#include "HLTrigger/HLTcore/interface/HLTConfigData.h" + +#include "CondFormats/HcalObjects/interface/HcalRespCorrs.h" +#include "CondFormats/DataRecord/interface/HcalRespCorrsRcd.h" + +#include "CondFormats/DataRecord/interface/EcalChannelStatusRcd.h" +#include "RecoLocalCalo/EcalRecAlgos/interface/EcalSeverityLevelAlgo.h" +#include "RecoLocalCalo/EcalRecAlgos/interface/EcalSeverityLevelAlgoRcd.h" + +#include "CalibFormats/HcalObjects/interface/HcalCalibrations.h" +#include "CalibFormats/HcalObjects/interface/HcalDbService.h" +#include "CalibFormats/HcalObjects/interface/HcalDbRecord.h" + +#include "Calibration/IsolatedParticles/interface/CaloPropagateTrack.h" +#include "Calibration/IsolatedParticles/interface/eECALMatrix.h" +#include "Calibration/IsolatedParticles/interface/eHCALMatrix.h" + +#include "Geometry/CaloGeometry/interface/CaloGeometry.h" +#include "Geometry/Records/interface/CaloGeometryRecord.h" +#include "Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h" +#include "Geometry/Records/interface/CaloTopologyRecord.h" +#include "Geometry/CaloTopology/interface/CaloSubdetectorTopology.h" +#include "Geometry/CaloTopology/interface/HcalTopology.h" +#include "Geometry/CaloTopology/interface/CaloTopology.h" +#include "Geometry/HcalCommonData/interface/HcalDDDRecConstants.h" +#include "Geometry/HcalTowerAlgo/interface/HcalGeometry.h" +#include "MagneticField/Engine/interface/MagneticField.h" +#include "MagneticField/Records/interface/IdealMagneticFieldRecord.h" + +//#define EDM_ML_DEBUG + +namespace alcaHcalHBHEMuon { + struct Counters { + Counters() : nAll_(0), nGood_(0) {} + mutable std::atomic nAll_, nGood_; + }; +} // namespace alcaHcalHBHEMuon + +class AlCaHcalHBHEMuonProducer : public edm::stream::EDProducer> { +public: + explicit AlCaHcalHBHEMuonProducer(const edm::ParameterSet&, const alcaHcalHBHEMuon::Counters*); + ~AlCaHcalHBHEMuonProducer() override = default; + + static std::unique_ptr initializeGlobalCache(edm::ParameterSet const&) { + return std::make_unique(); + } + + void produce(edm::Event&, const edm::EventSetup&) override; + + void endStream() override; + + static void globalEndJob(const alcaHcalHBHEMuon::Counters* counters); + + static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); + +private: + void beginRun(edm::Run const&, edm::EventSetup const&) override; + void endRun(edm::Run const&, edm::EventSetup const&) override; + int matchId(const HcalDetId&, const HcalDetId&); + double activeLength(const DetId&); + bool isGoodVertex(const reco::Vertex& vtx); + double respCorr(const DetId& id); + double gainFactor(const HcalDbService* dbserv, const HcalDetId& id); + int depth16HE(int ieta, int iphi); + bool goodCell(const HcalDetId& hcid, const reco::Track* pTrack, const CaloGeometry* geo, const MagneticField* bField); + + // ----------member data --------------------------- + HLTConfigProvider hltConfig_; + const std::vector trigNames_; + const std::string processName_; + const edm::InputTag triggerResults_; + const edm::InputTag labelEBRecHit_, labelEERecHit_, labelHBHERecHit_; + const std::string labelVtx_, labelMuon_, labelHBHEMuon_; + const int useRaw_; + const bool collapseDepth_, isItPlan1_; + const int verbosity_; + const bool isItPreRecHit_, writeRespCorr_; + const std::string fileInCorr_; + bool mergedDepth_, useMyCorr_; + int nRun_, nAll_, nGood_, maxDepth_; + + const HcalDDDRecConstants* hdc_; + const HcalTopology* theHBHETopology_; + const CaloGeometry* geo_; + const HcalRespCorrs* respCorrs_; + + edm::EDGetTokenT tok_trigRes_; + edm::EDGetTokenT tok_Vtx_; + edm::EDGetTokenT tok_EB_; + edm::EDGetTokenT tok_EE_; + edm::EDGetTokenT tok_HBHE_; + edm::EDGetTokenT tok_Muon_; + + edm::ESGetToken tok_ddrec_; + edm::ESGetToken tok_htopo_; + edm::ESGetToken tok_respcorr_; + edm::ESGetToken tok_geom_; + edm::ESGetToken tok_magField_; + edm::ESGetToken tok_chan_; + edm::ESGetToken tok_sevlv_; + edm::ESGetToken tok_topo_; + edm::ESGetToken tok_dbservice_; + + ////////////////////////////////////////////////////// + static const int depthMax_ = 7; + std::vector all_triggers_; + std::vector hltresults_; + + std::vector actHB, actHE; + std::map corrValue_; + //////////////////////////////////////////////////////////// +}; + +AlCaHcalHBHEMuonProducer::AlCaHcalHBHEMuonProducer(const edm::ParameterSet& iConfig, const alcaHcalHBHEMuon::Counters*) + : trigNames_(iConfig.getParameter>("triggers")), + processName_(iConfig.getParameter("processName")), + triggerResults_(iConfig.getParameter("triggerResults")), + labelEBRecHit_(iConfig.getParameter("labelEBRecHit")), + labelEERecHit_(iConfig.getParameter("labelEERecHit")), + labelHBHERecHit_(iConfig.getParameter("labelHBHERecHit")), + labelVtx_(iConfig.getParameter("labelVertex")), + labelMuon_(iConfig.getParameter("labelMuon")), + labelHBHEMuon_(iConfig.getParameter("labelHBHEMuon")), + useRaw_(iConfig.getParameter("useRaw")), + collapseDepth_(iConfig.getParameter("collapseDepth")), + isItPlan1_(iConfig.getParameter("isItPlan1")), + verbosity_(iConfig.getUntrackedParameter("verbosity", 0)), + isItPreRecHit_(iConfig.getUntrackedParameter("isItPreRecHit", false)), + writeRespCorr_(iConfig.getUntrackedParameter("writeRespCorr", false)), + fileInCorr_(iConfig.getUntrackedParameter("fileInCorr", "")), + nRun_(0), + nAll_(0), + nGood_(0), + hdc_(nullptr), + theHBHETopology_(nullptr), + respCorrs_(nullptr) { + //now do what ever initialization is needed + maxDepth_ = iConfig.getUntrackedParameter("maxDepth", 4); + if (maxDepth_ > depthMax_) + maxDepth_ = depthMax_; + else if (maxDepth_ < 1) + maxDepth_ = 4; + + mergedDepth_ = (!isItPreRecHit_) || (collapseDepth_); + tok_trigRes_ = consumes(triggerResults_); + tok_EB_ = consumes(labelEBRecHit_); + tok_EE_ = consumes(labelEERecHit_); + tok_HBHE_ = consumes(labelHBHERecHit_); + tok_Vtx_ = consumes(labelVtx_); + tok_Muon_ = consumes(labelMuon_); + edm::LogVerbatim("HBHEMuon") << "Labels used: Trig " << triggerResults_ << " Vtx " << labelVtx_ << " EB " + << labelEBRecHit_ << " EE " << labelEERecHit_ << " HBHE " << labelHBHERecHit_ << " MU " + << labelMuon_; + + tok_ddrec_ = esConsumes(); + tok_htopo_ = esConsumes(); + tok_respcorr_ = esConsumes(); + tok_geom_ = esConsumes(); + tok_magField_ = esConsumes(); + tok_chan_ = esConsumes(); + tok_sevlv_ = esConsumes(); + tok_topo_ = esConsumes(); + tok_dbservice_ = esConsumes(); + + if (!fileInCorr_.empty()) { + std::ifstream infile(fileInCorr_.c_str()); + if (infile.is_open()) { + while (true) { + unsigned int id; + double cfac; + infile >> id >> cfac; + if (!infile.good()) + break; + corrValue_[DetId(id)] = cfac; + } + infile.close(); + } + } + useMyCorr_ = (!corrValue_.empty()); + edm::LogVerbatim("HBHEMuon") << "Flags used: UseRaw " << useRaw_ << " CollapseDepth " << collapseDepth_ << ":" + << mergedDepth_ << " IsItPlan1 " << isItPlan1_ << " IsItPreRecHit " << isItPreRecHit_ + << " UseMyCorr " << useMyCorr_; + + //create the objects for HcalHBHEMuonVariables which has information of isolated muons + produces(labelHBHEMuon_); + edm::LogVerbatim("HcalIsoTrack") << " Expected to produce the collections:\n" + << "HcalHBHEMuonVariablesCollection with label " << labelHBHEMuon_; +} + +// +// member functions +// + +// ------------ method called for each event ------------ +void AlCaHcalHBHEMuonProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) { + ++nAll_; + auto outputHcalHBHEMuonColl = std::make_unique(); + + unsigned int runNumber = iEvent.id().run(); + unsigned int eventNumber = iEvent.id().event(); + unsigned int lumiNumber = iEvent.id().luminosityBlock(); + unsigned int bxNumber = iEvent.bunchCrossing(); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("HBHEMuon") << "Run " << runNumber << " Event " << eventNumber << " Lumi " << lumiNumber << " BX " + << bxNumber << std::endl; +#endif + + //Step1: Find if the event passes one of the chosen triggers + bool ok(false); + /////////////////////////////TriggerResults + if (trigNames_.empty()) { + ok = true; + } else { + edm::Handle triggerResults; + iEvent.getByToken(tok_trigRes_, triggerResults); + if (triggerResults.isValid()) { + std::vector modules; + const edm::TriggerNames& triggerNames = iEvent.triggerNames(*triggerResults); + const std::vector& triggerNames_ = triggerNames.triggerNames(); + for (unsigned int iHLT = 0; iHLT < triggerResults->size(); iHLT++) { + int hlt = triggerResults->accept(iHLT); + for (unsigned int i = 0; i < trigNames_.size(); ++i) { + if (triggerNames_[iHLT].find(trigNames_[i]) != std::string::npos) { + if (hlt > 0) { + ok = true; + } +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("HBHEMuon") << "AlCaHcalHBHEMuonFilter::Trigger " << triggerNames_[iHLT] << " Flag " << hlt + << ":" << ok << std::endl; +#endif + } + } + } + } + } + + // get handles to calogeometry and calotopology + const MagneticField* bField = &iSetup.getData(tok_magField_); + const EcalChannelStatus* theEcalChStatus = &iSetup.getData(tok_chan_); + const EcalSeverityLevelAlgo* sevlv = &iSetup.getData(tok_sevlv_); + const CaloTopology* caloTopology = &iSetup.getData(tok_topo_); + const HcalDbService* conditions = &iSetup.getData(tok_dbservice_); + + // Relevant blocks from iEvent + auto const& vtx = iEvent.getHandle(tok_Vtx_); + auto barrelRecHitsHandle = iEvent.getHandle(tok_EB_); + auto endcapRecHitsHandle = iEvent.getHandle(tok_EE_); + auto hbhe = iEvent.getHandle(tok_HBHE_); + auto const& muons = iEvent.getHandle(tok_Muon_); + + // require a good vertex + math::XYZPoint pvx; + unsigned int goodVertex = 0; + reco::VertexCollection::const_iterator firstGoodVertex; + if (!vtx.isValid()) { +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("HBHEMuon") << "No Good Vertex found == Reject"; +#endif + } else { + firstGoodVertex = vtx->end(); + for (reco::VertexCollection::const_iterator it = vtx->begin(); it != vtx->end(); it++) { + if (isGoodVertex(*it)) { + if (firstGoodVertex == vtx->end()) + firstGoodVertex = it; + ++goodVertex; + } + } + if (firstGoodVertex != vtx->end()) + pvx = firstGoodVertex->position(); + } + + if (ok && (goodVertex > 0) && muons.isValid() && barrelRecHitsHandle.isValid() && endcapRecHitsHandle.isValid() && + hbhe.isValid()) { + for (reco::MuonCollection::const_iterator recMuon = muons->begin(); recMuon != muons->end(); ++recMuon) { + HcalHBHEMuonVariables hbheMuon; + hbheMuon.runNumber_ = runNumber; + hbheMuon.eventNumber_ = eventNumber; + hbheMuon.lumiNumber_ = lumiNumber; + hbheMuon.bxNumber_ = bxNumber; + hbheMuon.goodVertex_ = goodVertex; + hbheMuon.muonGood_ = (recMuon->isPFMuon()); + hbheMuon.muonGlobal_ = (recMuon->isGlobalMuon()); + hbheMuon.muonTracker_ = (recMuon->isTrackerMuon()); + hbheMuon.ptGlob_ = ((recMuon)->pt()); + hbheMuon.etaGlob_ = (recMuon->eta()); + hbheMuon.phiGlob_ = (recMuon->phi()); + hbheMuon.energyMuon_ = (recMuon->energy()); + hbheMuon.pMuon_ = (recMuon->p()); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("HBHEMuon") << "Energy:" << recMuon->energy() << " P:" << recMuon->p(); +#endif + hbheMuon.muonTight_ = (muon::isTightMuon(*recMuon, *firstGoodVertex)); + hbheMuon.muonMedium_ = (muon::isMediumMuon(*recMuon)); + hbheMuon.muonTrkKink_ = (recMuon->combinedQuality().trkKink); + hbheMuon.muonChi2LocalPosition_ = (recMuon->combinedQuality().chi2LocalPosition); + hbheMuon.muonSegComp_ = (muon::segmentCompatibility(*recMuon)); + // acessing tracker hits info + if (recMuon->track().isNonnull()) { + hbheMuon.trackerLayer_ = (recMuon->track()->hitPattern().trackerLayersWithMeasurement()); + } else { + hbheMuon.trackerLayer_ = -1; + } + if (recMuon->innerTrack().isNonnull()) { + hbheMuon.innerTrack_ = true; + hbheMuon.numPixelLayers_ = (recMuon->innerTrack()->hitPattern().pixelLayersWithMeasurement()); + hbheMuon.chiTracker_ = (recMuon->innerTrack()->normalizedChi2()); + hbheMuon.dxyTracker_ = (fabs(recMuon->innerTrack()->dxy(pvx))); + hbheMuon.dzTracker_ = (fabs(recMuon->innerTrack()->dz(pvx))); + hbheMuon.innerTrackPt_ = (recMuon->innerTrack()->pt()); + hbheMuon.innerTrackEta_ = (recMuon->innerTrack()->eta()); + hbheMuon.innerTrackPhi_ = (recMuon->innerTrack()->phi()); + hbheMuon.tightPixelHits_ = (recMuon->innerTrack()->hitPattern().numberOfValidPixelHits()); + hbheMuon.tightValidFraction_ = (recMuon->innerTrack()->validFraction()); + } + // outer track info + if (recMuon->outerTrack().isNonnull()) { + hbheMuon.outerTrack_ = true; + hbheMuon.outerTrackPt_ = (recMuon->outerTrack()->pt()); + hbheMuon.outerTrackEta_ = (recMuon->outerTrack()->eta()); + hbheMuon.outerTrackPhi_ = (recMuon->outerTrack()->phi()); + hbheMuon.outerTrackChi_ = (recMuon->outerTrack()->normalizedChi2()); + hbheMuon.outerTrackHits_ = (recMuon->outerTrack()->numberOfValidHits()); + hbheMuon.outerTrackRHits_ = (recMuon->outerTrack()->recHitsSize()); + } + // Tight Muon cuts + if (recMuon->globalTrack().isNonnull()) { + hbheMuon.globalTrack_ = true; + hbheMuon.chiGlobal_ = (recMuon->globalTrack()->normalizedChi2()); + hbheMuon.globalMuonHits_ = (recMuon->globalTrack()->hitPattern().numberOfValidMuonHits()); + hbheMuon.matchedStat_ = (recMuon->numberOfMatchedStations()); + hbheMuon.globalTrackPt_ = (recMuon->globalTrack()->pt()); + hbheMuon.globalTrackEta_ = (recMuon->globalTrack()->eta()); + hbheMuon.globalTrackPhi_ = (recMuon->globalTrack()->phi()); + hbheMuon.tightTransImpara_ = (fabs(recMuon->muonBestTrack()->dxy(pvx))); + hbheMuon.tightLongPara_ = (fabs(recMuon->muonBestTrack()->dz(pvx))); + } + + hbheMuon.isolationR04_ = + ((recMuon->pfIsolationR04().sumChargedHadronPt + + std::max(0., + recMuon->pfIsolationR04().sumNeutralHadronEt + recMuon->pfIsolationR04().sumPhotonEt - + (0.5 * recMuon->pfIsolationR04().sumPUPt))) / + recMuon->pt()); + + hbheMuon.isolationR03_ = + ((recMuon->pfIsolationR03().sumChargedHadronPt + + std::max(0., + recMuon->pfIsolationR03().sumNeutralHadronEt + recMuon->pfIsolationR03().sumPhotonEt - + (0.5 * recMuon->pfIsolationR03().sumPUPt))) / + recMuon->pt()); + + hbheMuon.ecalEnergy_ = (recMuon->calEnergy().emS9); + hbheMuon.hcalEnergy_ = (recMuon->calEnergy().hadS9); + hbheMuon.hoEnergy_ = (recMuon->calEnergy().hoS9); + + if (recMuon->innerTrack().isNonnull()) { + const reco::Track* pTrack = (recMuon->innerTrack()).get(); + spr::propagatedTrackID trackID = spr::propagateCALO(pTrack, geo_, bField, (((verbosity_ / 100) % 10 > 0))); + + double activeLengthTot(0), activeLengthHotTot(0); + double eHcalDepth[depthMax_], eHcalDepthHot[depthMax_]; + double eHcalDepthC[depthMax_], eHcalDepthHotC[depthMax_]; + double cHcalDepthHot[depthMax_], cHcalDepthHotBG[depthMax_]; + double activeL[depthMax_], activeHotL[depthMax_]; + bool matchDepth[depthMax_], matchDepthHot[depthMax_]; + HcalDetId eHcalDetId[depthMax_]; + unsigned int isHot(0); + int ieta(-1000), iphi(-1000); + for (int i = 0; i < depthMax_; ++i) { + eHcalDepth[i] = eHcalDepthHot[i] = 0; + eHcalDepthC[i] = eHcalDepthHotC[i] = 0; + cHcalDepthHot[i] = cHcalDepthHotBG[i] = 0; + activeL[i] = activeHotL[i] = 0; + matchDepth[i] = matchDepthHot[i] = true; + } +#ifdef EDM_ML_DEBUG + double eHcal(0); +#endif + + hbheMuon.ecalDetId_ = ((trackID.detIdECAL)()); + hbheMuon.hcalDetId_ = ((trackID.detIdHCAL)()); + hbheMuon.ehcalDetId_ = ((trackID.detIdEHCAL)()); + + HcalDetId check(false); + std::pair info = spr::propagateHCALBack(pTrack, geo_, bField, (((verbosity_ / 100) % 10 > 0))); + if (info.first) { + check = info.second; + } + + bool okE = trackID.okECAL; + if (okE) { + const DetId isoCell(trackID.detIdECAL); + std::pair e3x3 = spr::eECALmatrix(isoCell, + barrelRecHitsHandle, + endcapRecHitsHandle, + *theEcalChStatus, + geo_, + caloTopology, + sevlv, + 1, + 1, + -100.0, + -100.0, + -500.0, + 500.0, + false); + hbheMuon.ecal3x3Energy_ = e3x3.first; + okE = e3x3.second; + } +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("HBHEMuon") << "Propagate Track to ECAL: " << okE << ":" << trackID.okECAL << " E " + << hbheMuon.ecal3x3Energy_; +#endif + + if (trackID.okHCAL) { + DetId closestCell(trackID.detIdHCAL); + HcalDetId hcidt(closestCell.rawId()); + if ((hcidt.ieta() == check.ieta()) && (hcidt.iphi() == check.iphi())) + hbheMuon.matchedId_ = true; +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("HBHEMuon") << "Front " << hcidt << " Back " << info.first << ":" << check << " Match " + << hbheMuon.matchedId_; +#endif + HcalSubdetector subdet = hcidt.subdet(); + ieta = hcidt.ieta(); + iphi = hcidt.iphi(); + bool hborhe = (std::abs(ieta) == 16); + + hbheMuon.hcal1x1Energy_ = spr::eHCALmatrix(theHBHETopology_, + closestCell, + hbhe, + 0, + 0, + false, + true, + -100.0, + -100.0, + -100.0, + -100.0, + -500., + 500., + useRaw_); + std::vector> ehdepth; + spr::energyHCALCell((HcalDetId)closestCell, + hbhe, + ehdepth, + maxDepth_, + -100.0, + -100.0, + -100.0, + -100.0, + -500.0, + 500.0, + useRaw_, + depth16HE(ieta, iphi), + (((verbosity_ / 1000) % 10) > 0)); + for (int i = 0; i < depthMax_; ++i) + eHcalDetId[i] = HcalDetId(); + for (unsigned int i = 0; i < ehdepth.size(); ++i) { + HcalSubdetector subdet0 = + (hborhe) ? ((ehdepth[i].second >= depth16HE(ieta, iphi)) ? HcalEndcap : HcalBarrel) : subdet; + HcalDetId hcid0(subdet0, ieta, iphi, ehdepth[i].second); + double actL = activeLength(DetId(hcid0)); + double ene = ehdepth[i].first; + bool tmpC(false); + if (ene > 0.0) { + if (!(theHBHETopology_->validHcal(hcid0))) { + edm::LogWarning("HBHEMuon") << "(1) Invalid ID " << hcid0 << " with E = " << ene; + edm::LogWarning("HBHEMuon") << HcalDetId(closestCell) << " with " << ehdepth.size() << " depths:"; + for (const auto& ehd : ehdepth) + edm::LogWarning("HBHEMuon") << " " << ehd.second << ":" << ehd.first; + } else { + tmpC = goodCell(hcid0, pTrack, geo_, bField); + double enec(ene); + double corr = respCorr(DetId(hcid0)); + if (corr != 0) + ene /= corr; +#ifdef EDM_ML_DEBUG + HcalDetId id = (isItPlan1_ && isItPreRecHit_) ? hdc_->mergedDepthDetId(hcid0) : hcid0; + edm::LogVerbatim("HBHEMuon") << hcid0 << ":" << id << " Corr " << corr; +#endif + int depth = ehdepth[i].second - 1; + if (collapseDepth_) { + HcalDetId id = hdc_->mergedDepthDetId(hcid0); + depth = id.depth() - 1; + } + eHcalDepth[depth] += ene; + eHcalDepthC[depth] += enec; + activeL[depth] += actL; + activeLengthTot += actL; + matchDepth[depth] = (matchDepth[depth] && tmpC); +#ifdef EDM_ML_DEBUG + if ((verbosity_ % 10) > 0) + edm::LogVerbatim("HBHEMuon") + << hcid0 << " E " << ene << ":" << enec << " L " << actL << " Match " << tmpC; +#endif + } + } + } +#ifdef EDM_ML_DEBUG + if ((verbosity_ % 10) > 0) { + edm::LogVerbatim("HBHEMuon") << hcidt << " Match " << hbheMuon.matchedId_ << " Depths " << ehdepth.size(); + for (unsigned int k = 0; k < ehdepth.size(); ++k) + edm::LogVerbatim("HBHEMuon") << " [" << k << ":" << ehdepth[k].second << "] " << matchDepth[k]; + } +#endif + HcalDetId hotCell; + spr::eHCALmatrix(geo_, theHBHETopology_, closestCell, hbhe, 1, 1, hotCell, false, useRaw_, false); + isHot = matchId(closestCell, hotCell); + if (hotCell != HcalDetId()) { + subdet = HcalDetId(hotCell).subdet(); + ieta = HcalDetId(hotCell).ieta(); + iphi = HcalDetId(hotCell).iphi(); + hborhe = (std::abs(ieta) == 16); + std::vector> ehdepth; + spr::energyHCALCell(hotCell, + hbhe, + ehdepth, + maxDepth_, + -100.0, + -100.0, + -100.0, + -100.0, + -500.0, + 500.0, + useRaw_, + depth16HE(ieta, iphi), + false); //(((verbosity_/1000)%10)>0 )); + for (int i = 0; i < depthMax_; ++i) + eHcalDetId[i] = HcalDetId(); + for (unsigned int i = 0; i < ehdepth.size(); ++i) { + HcalSubdetector subdet0 = + (hborhe) ? ((ehdepth[i].second >= depth16HE(ieta, iphi)) ? HcalEndcap : HcalBarrel) : subdet; + HcalDetId hcid0(subdet0, ieta, iphi, ehdepth[i].second); + double actL = activeLength(DetId(hcid0)); + double ene = ehdepth[i].first; + bool tmpC(false); + if (ene > 0.0) { + if (!(theHBHETopology_->validHcal(hcid0))) { + edm::LogWarning("HBHEMuon") << "(2) Invalid ID " << hcid0 << " with E = " << ene; + edm::LogWarning("HBHEMuon") << HcalDetId(hotCell) << " with " << ehdepth.size() << " depths:"; + for (const auto& ehd : ehdepth) + edm::LogWarning("HBHEMuon") << " " << ehd.second << ":" << ehd.first; + } else { + tmpC = goodCell(hcid0, pTrack, geo_, bField); + double chg(ene), enec(ene); + double corr = respCorr(DetId(hcid0)); + if (corr != 0) + ene /= corr; +#ifdef EDM_ML_DEBUG + HcalDetId id = (isItPlan1_ && isItPreRecHit_) ? hdc_->mergedDepthDetId(hcid0) : hcid0; + edm::LogVerbatim("HBHEMuon") << hcid0 << ":" << id << " Corr " << corr << " E " << ene << ":" << enec; +#endif + double gain = gainFactor(conditions, hcid0); + if (gain != 0) + chg /= gain; +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("HBHEMuon") << hcid0 << " Gain " << gain << " C " << chg; +#endif + int depth = ehdepth[i].second - 1; + if (collapseDepth_) { + HcalDetId id = hdc_->mergedDepthDetId(hcid0); + depth = id.depth() - 1; + } + eHcalDepthHot[depth] += ene; + eHcalDepthHotC[depth] += enec; + cHcalDepthHot[depth] += chg; + activeHotL[depth] += actL; + activeLengthHotTot += actL; + matchDepthHot[depth] = (matchDepthHot[depth] && tmpC); +#ifdef EDM_ML_DEBUG + eHcal += ene; + if ((verbosity_ % 10) > 0) + edm::LogVerbatim("HBHEMuon") << hcid0 << " depth " << depth << " E " << ene << ":" << enec << " C " + << chg << " L " << actL << " Match " << tmpC; +#endif + } + } + } + + HcalDetId oppCell(subdet, -ieta, iphi, HcalDetId(hotCell).depth()); + std::vector> ehdeptho; + spr::energyHCALCell(oppCell, + hbhe, + ehdeptho, + maxDepth_, + -100.0, + -100.0, + -100.0, + -100.0, + -500.0, + 500.0, + useRaw_, + depth16HE(-ieta, iphi), + false); //(((verbosity_/1000)%10)>0)); + for (unsigned int i = 0; i < ehdeptho.size(); ++i) { + HcalSubdetector subdet0 = + (hborhe) ? ((ehdeptho[i].second >= depth16HE(-ieta, iphi)) ? HcalEndcap : HcalBarrel) : subdet; + HcalDetId hcid0(subdet0, -ieta, iphi, ehdeptho[i].second); + double ene = ehdeptho[i].first; + if (ene > 0.0) { + if (!(theHBHETopology_->validHcal(hcid0))) { + edm::LogWarning("HBHEMuon") << "(3) Invalid ID " << hcid0 << " with E = " << ene; + edm::LogWarning("HBHEMuon") << oppCell << " with " << ehdeptho.size() << " depths:"; + for (const auto& ehd : ehdeptho) + edm::LogWarning("HBHEMuon") << " " << ehd.second << ":" << ehd.first; + } else { + double chg(ene); + double corr = respCorr(DetId(hcid0)); + if (corr != 0) + ene /= corr; +#ifdef EDM_ML_DEBUG + HcalDetId id = (isItPlan1_ && isItPreRecHit_) ? hdc_->mergedDepthDetId(hcid0) : hcid0; + edm::LogVerbatim("HBHEMuon") + << hcid0 << ":" << id << " Corr " << corr << " E " << ene << ":" << ehdeptho[i].first; +#endif + double gain = gainFactor(conditions, hcid0); + if (gain != 0) + chg /= gain; +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("HBHEMuon") << hcid0 << " Gain " << gain << " C " << chg; +#endif + int depth = ehdeptho[i].second - 1; + if (collapseDepth_) { + HcalDetId id = hdc_->mergedDepthDetId(hcid0); + depth = id.depth() - 1; + } + cHcalDepthHotBG[depth] += chg; +#ifdef EDM_ML_DEBUG + if ((verbosity_ % 10) > 0) + edm::LogVerbatim("HBHEMuon") << hcid0 << " Depth " << depth << " E " << ene << " C " << chg; +#endif + } + } + } + } + } +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("HBHEMuon") << "Propagate Track to HCAL: " << trackID.okHCAL << " Match " + << hbheMuon.matchedId_ << " Hot " << isHot << " Energy " << eHcal; +#endif + hbheMuon.hcalIeta_ = ieta; + hbheMuon.hcalIphi_ = iphi; + for (int i = 0; i < depthMax_; ++i) { + hbheMuon.hcalDepthEnergy_.push_back(eHcalDepth[i]); + hbheMuon.hcalDepthActiveLength_.push_back(activeL[i]); + hbheMuon.hcalDepthEnergyHot_.push_back(eHcalDepthHot[i]); + hbheMuon.hcalDepthActiveLengthHot_.push_back(activeHotL[i]); + hbheMuon.hcalDepthEnergyCorr_.push_back(eHcalDepthC[i]); + hbheMuon.hcalDepthEnergyHotCorr_.push_back(eHcalDepthHotC[i]); + hbheMuon.hcalDepthChargeHot_.push_back(cHcalDepthHot[i]); + hbheMuon.hcalDepthChargeHotBG_.push_back(cHcalDepthHotBG[i]); + hbheMuon.hcalDepthMatch_.push_back(matchDepth[i]); + hbheMuon.hcalDepthMatchHot_.push_back(matchDepthHot[i]); + } + hbheMuon.hcalActiveLength_ = activeLengthTot; + hbheMuon.hcalHot_ = isHot; + hbheMuon.hcalActiveLengthHot_ = activeLengthHotTot; + + if ((recMuon->p() > 10.0) && (trackID.okHCAL)) + outputHcalHBHEMuonColl->emplace_back(hbheMuon); + } + } + } + if (!outputHcalHBHEMuonColl->empty()) + ++nGood_; + iEvent.put(std::move(outputHcalHBHEMuonColl), labelHBHEMuon_); +} + +// ------------ method fills 'descriptions' with the allowed parameters for the module ------------ +void AlCaHcalHBHEMuonProducer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { + edm::ParameterSetDescription desc; + std::vector triggers = {"HLT_IsoMu", "HLT_Mu"}; + desc.add>("triggers", triggers); + desc.add("processName", "HLT"); + desc.add("triggerResults", edm::InputTag("TriggerResults", "", "HLT")); + desc.add("labelEBRecHit", edm::InputTag("ecalRecHit", "EcalRecHitsEB")); + desc.add("labelEERecHit", edm::InputTag("ecalRecHit", "EcalRecHitsEE")); + desc.add("labelHBHERecHit", edm::InputTag("hbhereco")); + desc.add("labelVertex", "offlinePrimaryVertices"); + desc.add("labelMuon", "muons"); + desc.add("labelHBHEMuon", "hbheMuon"); + desc.add("useRaw", 0); + desc.add("collapseDepth", false); + desc.add("isItPlan1", false); + desc.addUntracked("verbosity", 0); + desc.addUntracked("isItPreRecHit", false); + desc.addUntracked("writeRespCorr", false); + desc.addUntracked("fileInCorr", ""); + desc.addUntracked("maxDepth", 4); + descriptions.add("alcaHcalHBHEMuonProducer", desc); +} + +// ------------ method called once each job just after ending the event loop ------------ +void AlCaHcalHBHEMuonProducer::endStream() { + globalCache()->nAll_ += nAll_; + globalCache()->nGood_ += nGood_; +} + +void AlCaHcalHBHEMuonProducer::globalEndJob(const alcaHcalHBHEMuon::Counters* count) { + edm::LogVerbatim("HBHEMuon") << "Selects " << count->nGood_ << " out of " << count->nAll_ << " total # of events\n"; +} + +// ------------ method called when starting or ending a run ------------ +void AlCaHcalHBHEMuonProducer::beginRun(edm::Run const& iRun, edm::EventSetup const& iSetup) { + hdc_ = &iSetup.getData(tok_ddrec_); + actHB.clear(); + actHE.clear(); + actHB = hdc_->getThickActive(0); + actHE = hdc_->getThickActive(1); +#ifdef EDM_ML_DEBUG + unsigned int k1(0), k2(0); + edm::LogVerbatim("HBHEMuon") << actHB.size() << " Active Length for HB"; + for (const auto& act : actHB) { + edm::LogVerbatim("HBHEMuon") << "[" << k1 << "] ieta " << act.ieta << " depth " << act.depth << " zside " + << act.zside << " type " << act.stype << " phi " << act.iphis.size() << ":" + << act.iphis[0] << " L " << act.thick; + HcalDetId hcid1(HcalBarrel, (act.ieta) * (act.zside), act.iphis[0], act.depth); + HcalDetId hcid2 = mergedDepth_ ? hdc_->mergedDepthDetId(hcid1) : hcid1; + edm::LogVerbatim("HBHEMuon") << hcid1 << " | " << hcid2 << " L " << activeLength(DetId(hcid2)); + ++k1; + } + edm::LogVerbatim("HBHEMuon") << actHE.size() << " Active Length for HE"; + for (const auto& act : actHE) { + edm::LogVerbatim("HBHEMuon") << "[" << k2 << "] ieta " << act.ieta << " depth " << act.depth << " zside " + << act.zside << " type " << act.stype << " phi " << act.iphis.size() << ":" + << act.iphis[0] << " L " << act.thick; + HcalDetId hcid1(HcalEndcap, (act.ieta) * (act.zside), act.iphis[0], act.depth); + HcalDetId hcid2 = mergedDepth_ ? hdc_->mergedDepthDetId(hcid1) : hcid1; + edm::LogVerbatim("HBHEMuon") << hcid1 << " | " << hcid2 << " L " << activeLength(DetId(hcid2)); + ++k2; + } +#endif + + bool changed = true; + bool flag = hltConfig_.init(iRun, iSetup, processName_, changed); + edm::LogVerbatim("HBHEMuon") << "Run[" << nRun_ << "] " << iRun.run() << " hltconfig.init " << flag << std::endl; + + theHBHETopology_ = &iSetup.getData(tok_htopo_); + respCorrs_ = &iSetup.getData(tok_respcorr_); + geo_ = &iSetup.getData(tok_geom_); + + // Write correction factors for all HB/HE events + if (writeRespCorr_) { + const HcalGeometry* gHcal = static_cast(geo_->getSubdetectorGeometry(DetId::Hcal, HcalBarrel)); + const std::vector& ids = gHcal->getValidDetIds(DetId::Hcal, 0); + edm::LogVerbatim("HBHEMuon") << "\nTable of Correction Factors for Run " << iRun.run() << "\n"; + for (auto const& id : ids) { + if ((id.det() == DetId::Hcal) && ((id.subdetId() == HcalBarrel) || (id.subdetId() == HcalEndcap))) { + edm::LogVerbatim("HBHEMuon") << HcalDetId(id) << " " << id.rawId() << " " + << (respCorrs_->getValues(id))->getValue(); + } + } + } +} + +void AlCaHcalHBHEMuonProducer::endRun(edm::Run const& iRun, edm::EventSetup const&) { + edm::LogVerbatim("HBHEMuon") << "endRun[" << nRun_ << "] " << iRun.run() << "\n"; + ++nRun_; +} + +// ------------ methods called by produce() ------------ + +int AlCaHcalHBHEMuonProducer::matchId(const HcalDetId& id1, const HcalDetId& id2) { + HcalDetId kd1(id1.subdet(), id1.ieta(), id1.iphi(), 1); + HcalDetId kd2(id1.subdet(), id2.ieta(), id2.iphi(), 1); + int match = ((kd1 == kd2) ? 1 : 0); + return match; +} + +double AlCaHcalHBHEMuonProducer::activeLength(const DetId& id_) { + HcalDetId id(id_); + int ieta = id.ietaAbs(); + int zside = id.zside(); + int iphi = id.iphi(); + std::vector dpths; + if (mergedDepth_) { + std::vector ids; + hdc_->unmergeDepthDetId(id, ids); + for (auto idh : ids) + dpths.emplace_back(idh.depth()); + } else { + dpths.emplace_back(id.depth()); + } + double lx(0); + if (id.subdet() == HcalBarrel) { + for (unsigned int i = 0; i < actHB.size(); ++i) { + if ((ieta == actHB[i].ieta) && (zside == actHB[i].zside) && + (std::find(dpths.begin(), dpths.end(), actHB[i].depth) != dpths.end()) && + (std::find(actHB[i].iphis.begin(), actHB[i].iphis.end(), iphi) != actHB[i].iphis.end())) { + lx += actHB[i].thick; + } + } + } else { + for (unsigned int i = 0; i < actHE.size(); ++i) { + if ((ieta == actHE[i].ieta) && (zside == actHE[i].zside) && + (std::find(dpths.begin(), dpths.end(), actHE[i].depth) != dpths.end()) && + (std::find(actHE[i].iphis.begin(), actHE[i].iphis.end(), iphi) != actHE[i].iphis.end())) { + lx += actHE[i].thick; + } + } + } + return lx; +} + +bool AlCaHcalHBHEMuonProducer::isGoodVertex(const reco::Vertex& vtx) { + if (vtx.isFake()) + return false; + if (vtx.ndof() < 4) + return false; + if (vtx.position().Rho() > 2.) + return false; + if (fabs(vtx.position().Z()) > 24.) + return false; + return true; +} + +double AlCaHcalHBHEMuonProducer::respCorr(const DetId& id) { + double cfac(1.0); + if (useMyCorr_) { + auto itr = corrValue_.find(id); + if (itr != corrValue_.end()) + cfac = itr->second; + } else if (respCorrs_ != nullptr) { + cfac = (respCorrs_->getValues(id))->getValue(); + } + return cfac; +} + +double AlCaHcalHBHEMuonProducer::gainFactor(const HcalDbService* conditions, const HcalDetId& id) { + double gain(0.0); + const HcalCalibrations& calibs = conditions->getHcalCalibrations(id); + for (int capid = 0; capid < 4; ++capid) + gain += (0.25 * calibs.respcorrgain(capid)); + return gain; +} + +int AlCaHcalHBHEMuonProducer::depth16HE(int ieta, int iphi) { + // Transition between HB/HE is special + // For Run 1 or for Plan1 standard reconstruction it is 3 + // For runs beyond 2018 or in Plan1 for HEP17 it is 4 + int zside = (ieta > 0) ? 1 : -1; + int depth = theHBHETopology_->dddConstants()->getMinDepth(1, 16, iphi, zside); + if (isItPlan1_ && (!isItPreRecHit_)) + depth = 3; +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("HBHEMuon") << "Plan1 " << isItPlan1_ << " PreRecHit " << isItPreRecHit_ << " phi " << iphi + << " depth " << depth; +#endif + return depth; +} + +bool AlCaHcalHBHEMuonProducer::goodCell(const HcalDetId& hcid, + const reco::Track* pTrack, + const CaloGeometry* geo, + const MagneticField* bField) { + std::pair rz = hdc_->getRZ(hcid); + bool typeRZ = (hcid.subdet() == HcalEndcap) ? false : true; + bool match = spr::propagateHCAL(pTrack, geo, bField, typeRZ, rz, (((verbosity_ / 10000) % 10) > 0)); + return match; +} + +//define this as a plug-in +#include "FWCore/Framework/interface/MakerMacros.h" + +DEFINE_FWK_MODULE(AlCaHcalHBHEMuonProducer); diff --git a/Calibration/HcalAlCaRecoProducers/plugins/AlCaHcalIsotrkFilter.cc b/Calibration/HcalAlCaRecoProducers/plugins/AlCaHcalIsotrkFilter.cc new file mode 100644 index 0000000000000..9d7cc3d4557b5 --- /dev/null +++ b/Calibration/HcalAlCaRecoProducers/plugins/AlCaHcalIsotrkFilter.cc @@ -0,0 +1,164 @@ +// system include files +#include +#include +#include + +// user include files +#include "FWCore/Framework/interface/Frameworkfwd.h" +#include "FWCore/Framework/interface/global/EDFilter.h" +#include "FWCore/Framework/interface/Event.h" +#include "FWCore/Framework/interface/EventSetup.h" +#include "FWCore/Framework/interface/Run.h" +#include "FWCore/MessageLogger/interface/MessageLogger.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" + +#include "DataFormats/Common/interface/Handle.h" +#include "DataFormats/Common/interface/Ref.h" +#include "DataFormats/HcalCalibObjects/interface/HcalIsoTrkCalibVariables.h" + +//#define EDM_ML_DEBUG +// +// class declaration +// + +namespace alcaHcalIsoTrk { + struct Counters { + Counters() : nAll_(0), nGood_(0), nLow_(0), nHigh_(0) {} + mutable std::atomic nAll_, nGood_, nLow_, nHigh_; + }; +} // namespace alcaHcalIsoTrk + +class AlCaHcalIsotrkFilter : public edm::global::EDFilter > { +public: + AlCaHcalIsotrkFilter(edm::ParameterSet const&); + + std::shared_ptr globalBeginRun(edm::Run const&, edm::EventSetup const&) const override; + + bool filter(edm::StreamID, edm::Event&, edm::EventSetup const&) const override; + void globalEndRun(edm::Run const& iRun, edm::EventSetup const&) const override; + static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); + +private: + // ----------member data --------------------------- + double pTrackLow_, pTrackHigh_; + int prescaleLow_, prescaleHigh_; + edm::InputTag labelIsoTkVar_; + edm::EDGetTokenT tokIsoTrkVar_; +}; + +// +// constructors and destructor +// +AlCaHcalIsotrkFilter::AlCaHcalIsotrkFilter(edm::ParameterSet const& iConfig) + : pTrackLow_(iConfig.getParameter("momentumLow")), + pTrackHigh_(iConfig.getParameter("momentumHigh")), + prescaleLow_(iConfig.getParameter("prescaleLow")), + prescaleHigh_(iConfig.getParameter("prescaleHigh")), + labelIsoTkVar_(iConfig.getParameter("isoTrackLabel")), + tokIsoTrkVar_(consumes(labelIsoTkVar_)) { + edm::LogVerbatim("HcalIsoTrack") << "Parameters read from config file \n\t momentumLow_ " << pTrackLow_ + << "\t prescaleLow_ " << prescaleLow_ << "\t momentumHigh_ " << pTrackHigh_ + << "\t prescaleHigh_ " << prescaleHigh_ << "\n\t Labels " << labelIsoTkVar_; +} // AlCaHcalIsotrkFilter::AlCaHcalIsotrkFilter constructor + +// +// member functions +// + +// ------------ method called on each new Event ------------ +bool AlCaHcalIsotrkFilter::filter(edm::StreamID, edm::Event& iEvent, edm::EventSetup const&) const { + bool accept(false); + ++(runCache(iEvent.getRun().index())->nAll_); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("HcalIsoTrack") << "AlCaHcalIsotrkFilter::Run " << iEvent.id().run() << " Event " + << iEvent.id().event() << " Luminosity " << iEvent.luminosityBlock() << " Bunch " + << iEvent.bunchCrossing(); +#endif + + auto const& isotrkCalibColl = iEvent.getHandle(tokIsoTrkVar_); + if (isotrkCalibColl.isValid()) { + auto isotrkCalib = isotrkCalibColl.product(); + bool low(false), high(false), inRange(false); + for (auto itr = isotrkCalib->begin(); itr != isotrkCalib->end(); ++itr) { + if (itr->p_ < pTrackLow_) { + low = true; + } else if (itr->p_ > pTrackHigh_) { + high = true; + } else { + inRange = true; + } + } +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("HcalIsoTrack") << "AlCaHcalIsotrkFilter::Finds " << isotrkCalib->size() + << " entries in HcalIsoTrkCalibVariables collection with inRange " << inRange + << " low " << low << " high " << high; +#endif + if (low) + ++(runCache(iEvent.getRun().index())->nLow_); + if (high) + ++(runCache(iEvent.getRun().index())->nHigh_); + if (inRange) { + accept = true; + } else { + if (low) { + if (prescaleLow_ <= 1) + accept = true; + else if (runCache(iEvent.getRun().index())->nLow_ % prescaleLow_ == 1) + accept = true; + } + if (high) { + if (prescaleHigh_ <= 1) + accept = true; + else if (runCache(iEvent.getRun().index())->nHigh_ % prescaleHigh_ == 1) + accept = true; + } + } + } else { + edm::LogVerbatim("HcalIsoTrack") << "AlCaHcalIsotrkFilter::Cannot find the collection for HcalIsoTrkCalibVariables"; + } + + // Return the acceptance flag + if (accept) + ++(runCache(iEvent.getRun().index())->nGood_); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("HcalIsoTrack") << "AlCaHcalIsotrkFilter::Accept flag " << accept << " All " + << runCache(iEvent.getRun().index())->nAll_ << " Good " + << runCache(iEvent.getRun().index())->nGood_ << " Low " + << runCache(iEvent.getRun().index())->nLow_ << " High " + << runCache(iEvent.getRun().index())->nHigh_; +#endif + return accept; + +} // AlCaHcalIsotrkFilter::filter + +// ------------ method called when starting to processes a run ------------ +std::shared_ptr AlCaHcalIsotrkFilter::globalBeginRun(edm::Run const& iRun, + edm::EventSetup const&) const { + edm::LogVerbatim("HcalIsoTrack") << "Start the Run " << iRun.run(); + return std::make_shared(); +} + +// ------------ method called when ending the processing of a run ------------ +void AlCaHcalIsotrkFilter::globalEndRun(edm::Run const& iRun, edm::EventSetup const&) const { + edm::LogVerbatim("HcalIsoTrack") << "Select " << runCache(iRun.index())->nGood_ << " good events out of " + << runCache(iRun.index())->nAll_ << " total # of events with " + << runCache(iRun.index())->nLow_ << ":" << runCache(iRun.index())->nHigh_ + << " events below and above the required range"; +} + +// ------------ method fills 'descriptions' with the allowed parameters for the module ------------ +void AlCaHcalIsotrkFilter::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { + edm::ParameterSetDescription desc; + desc.add("momentumLow", 40.0); + desc.add("momentumHigh", 60.0); + desc.add("prescaleLow", 1); + desc.add("prescaleHigh", 1); + desc.add("isoTrackLabel", edm::InputTag("alcaHcalIsotrkProducer", "HcalIsoTrack")); + descriptions.add("alcaHcalIsotrkFilter", desc); +} + +//define this as a plug-in +#include "FWCore/Framework/interface/MakerMacros.h" + +DEFINE_FWK_MODULE(AlCaHcalIsotrkFilter); diff --git a/Calibration/HcalAlCaRecoProducers/plugins/AlCaHcalIsotrkProducer.cc b/Calibration/HcalAlCaRecoProducers/plugins/AlCaHcalIsotrkProducer.cc new file mode 100644 index 0000000000000..67cd96c4c1d9b --- /dev/null +++ b/Calibration/HcalAlCaRecoProducers/plugins/AlCaHcalIsotrkProducer.cc @@ -0,0 +1,1405 @@ +// -*- C++ -*- + +// system include files +#include +#include +#include +#include +#include +#include +#include +#include + +// user include files +#include "Calibration/IsolatedParticles/interface/CaloPropagateTrack.h" +#include "Calibration/IsolatedParticles/interface/ChargeIsolation.h" +#include "Calibration/IsolatedParticles/interface/eCone.h" +#include "Calibration/IsolatedParticles/interface/eECALMatrix.h" +#include "Calibration/IsolatedParticles/interface/eHCALMatrix.h" +#include "Calibration/IsolatedParticles/interface/TrackSelection.h" + +#include "CondFormats/DataRecord/interface/EcalChannelStatusRcd.h" +#include "CondFormats/DataRecord/interface/HcalRespCorrsRcd.h" +#include "CondFormats/HcalObjects/interface/HcalRespCorrs.h" + +#include "DataFormats/BeamSpot/interface/BeamSpot.h" +#include "DataFormats/CaloTowers/interface/CaloTowerCollection.h" +#include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h" +#include "DataFormats/HcalCalibObjects/interface/HcalIsoTrkCalibVariables.h" +#include "DataFormats/HcalCalibObjects/interface/HcalIsoTrkEventVariables.h" +#include "DataFormats/HcalRecHit/interface/HcalRecHitCollections.h" +#include "DataFormats/Math/interface/LorentzVector.h" +#include "DataFormats/Math/interface/deltaR.h" +#include "DataFormats/MuonReco/interface/Muon.h" +#include "DataFormats/MuonReco/interface/MuonFwd.h" +#include "DataFormats/MuonReco/interface/MuonSelectors.h" +#include "DataFormats/TrackReco/interface/Track.h" +#include "DataFormats/TrackReco/interface/TrackFwd.h" +#include "DataFormats/TrackReco/interface/HitPattern.h" +#include "DataFormats/TrackReco/interface/TrackBase.h" +#include "DataFormats/VertexReco/interface/VertexFwd.h" +#include "DataFormats/VertexReco/interface/Vertex.h" +#include "DataFormats/Common/interface/TriggerResults.h" +#include "DataFormats/HLTReco/interface/TriggerEvent.h" +#include "DataFormats/HLTReco/interface/TriggerObject.h" +#include "DataFormats/Luminosity/interface/LumiDetails.h" +#include "DataFormats/L1TGlobal/interface/GlobalAlgBlk.h" +#include "DataFormats/L1TGlobal/interface/GlobalExtBlk.h" +#include "DataFormats/L1Trigger/interface/BXVector.h" +#include "L1Trigger/L1TGlobal/interface/L1TGlobalUtil.h" +#include "HLTrigger/HLTcore/interface/HLTConfigProvider.h" +#include "DataFormats/HepMCCandidate/interface/GenParticle.h" +#include "DataFormats/HepMCCandidate/interface/GenParticleFwd.h" +#include "SimDataFormats/GeneratorProducts/interface/GenEventInfoProduct.h" + +#include "FWCore/Common/interface/TriggerNames.h" +#include "FWCore/Framework/interface/Frameworkfwd.h" +#include "FWCore/Framework/interface/stream/EDProducer.h" +#include "FWCore/Framework/interface/Event.h" +#include "FWCore/Framework/interface/EventSetup.h" +#include "FWCore/MessageLogger/interface/MessageLogger.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" + +#include "Geometry/CaloGeometry/interface/CaloGeometry.h" +#include "Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h" +#include "Geometry/Records/interface/CaloTopologyRecord.h" +#include "Geometry/CaloTopology/interface/CaloSubdetectorTopology.h" +#include "Geometry/CaloTopology/interface/HcalTopology.h" +#include "Geometry/CaloTopology/interface/CaloTopology.h" +#include "Geometry/HcalCommonData/interface/HcalDDDRecConstants.h" +#include "Geometry/CaloTopology/interface/EcalTrigTowerConstituentsMap.h" + +#include "MagneticField/Engine/interface/MagneticField.h" +#include "MagneticField/Records/interface/IdealMagneticFieldRecord.h" +#include "RecoLocalCalo/EcalRecAlgos/interface/EcalSeverityLevelAlgo.h" +#include "RecoLocalCalo/EcalRecAlgos/interface/EcalSeverityLevelAlgoRcd.h" + +//#define EDM_ML_DEBUG +// +// class declaration +// + +namespace alcaHcalIsoTracks { + struct Counters { + Counters() : nAll_(0), nGood_(0), nRange_(0) {} + mutable std::atomic nAll_, nGood_, nRange_; + }; +} // namespace alcaHcalIsoTracks + +class AlCaHcalIsotrkProducer : public edm::stream::EDProducer > { +public: + explicit AlCaHcalIsotrkProducer(edm::ParameterSet const&, const alcaHcalIsoTracks::Counters*); + ~AlCaHcalIsotrkProducer() override = default; + + static std::unique_ptr initializeGlobalCache(edm::ParameterSet const&) { + return std::make_unique(); + } + + void produce(edm::Event&, edm::EventSetup const&) override; + void endStream() override; + static void globalEndJob(const alcaHcalIsoTracks::Counters* counters); + static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); + +private: + void beginRun(edm::Run const&, edm::EventSetup const&) override; + void endRun(edm::Run const&, edm::EventSetup const&) override; + std::array getProducts(int goodPV, + double eventWeight, + std::vector& vecL1, + std::vector& vecL3, + math::XYZPoint& leadPV, + std::vector& trkCaloDirections, + std::vector& trkCaloDets, + const CaloGeometry* geo, + const CaloTopology* topo, + const HcalTopology* theHBHETopology, + const EcalChannelStatus* theEcalChStatus, + const EcalSeverityLevelAlgo* theEcalSevlv, + edm::Handle& barrelRecHitsHandle, + edm::Handle& endcapRecHitsHandle, + edm::Handle& hbhe, + edm::Handle& towerHandle, + const edm::Handle& genParticles, + const HcalRespCorrs* respCorrs, + const edm::Handle& muonh, + std::vector& hocalib, + HcalIsoTrkEventVariables& hocalibEvent); + double dR(math::XYZTLorentzVector&, math::XYZTLorentzVector&); + double trackP(const reco::Track*, const edm::Handle&); + double rhoh(const edm::Handle&); + double eThreshold(const DetId& id, const CaloGeometry* geo) const; + DetId newId(const DetId&); + void storeEnergy(const HcalRespCorrs* respCorrs, + const std::vector& ids, + std::vector& edet, + double& eHcal, + std::vector& detIds, + std::vector& hitEnergies); + std::pair storeEnergy(const HcalRespCorrs* respCorrs, + edm::Handle& hbhe, + const std::vector& ids, + std::vector& hitEnergy1, + std::vector& hitEnergy2); + bool notaMuon(const reco::Track* pTrack0, const edm::Handle& muonh); + + // ----------member data --------------------------- + l1t::L1TGlobalUtil* l1GtUtils_; + HLTConfigProvider hltConfig_; + unsigned int nRun_, nAll_, nGood_, nRange_; + const std::vector trigNames_; + spr::trackSelectionParameters selectionParameter_; + const std::string theTrackQuality_; + const std::string processName_, l1Filter_; + const std::string l2Filter_, l3Filter_; + const double a_coneR_, a_mipR_, a_mipR2_, a_mipR3_; + const double a_mipR4_, a_mipR5_, pTrackMin_, eEcalMax_; + const double maxRestrictionP_, slopeRestrictionP_; + const double hcalScale_, eIsolate1_, eIsolate2_; + const double pTrackLow_, pTrackHigh_; + const bool ignoreTrigger_, useL1Trigger_; + const bool unCorrect_, collapseDepth_; + const double hitEthrEB_, hitEthrEE0_, hitEthrEE1_; + const double hitEthrEE2_, hitEthrEE3_; + const double hitEthrEELo_, hitEthrEEHi_; + const edm::InputTag triggerEvent_, theTriggerResultsLabel_; + const std::string labelGenTrack_, labelRecVtx_, labelEB_; + const std::string labelEE_, labelHBHE_, labelTower_, l1TrigName_; + const std::vector oldID_, newDepth_; + const bool hep17_; + const std::string labelIsoTkVar_, labelIsoTkEvtVar_; + + double a_charIsoR_, a_coneR1_, a_coneR2_; + const HcalDDDRecConstants* hdc_; + std::vector etabins_, phibins_; + std::vector oldDet_, oldEta_, oldDepth_; + double etadist_, phidist_, etahalfdist_, phihalfdist_; + + edm::EDGetTokenT tok_trigEvt_; + edm::EDGetTokenT tok_trigRes_; + edm::EDGetTokenT tok_parts_; + edm::EDGetTokenT tok_genTrack_; + edm::EDGetTokenT tok_recVtx_; + edm::EDGetTokenT tok_bs_; + edm::EDGetTokenT tok_EB_; + edm::EDGetTokenT tok_EE_; + edm::EDGetTokenT tok_hbhe_; + edm::EDGetTokenT tok_cala_; + edm::EDGetTokenT tok_ew_; + edm::EDGetTokenT > tok_alg_; + edm::EDGetTokenT tok_Muon_; + + edm::ESGetToken tok_ddrec_; + edm::ESGetToken tok_bFieldH_; + edm::ESGetToken tok_ecalChStatus_; + edm::ESGetToken tok_sevlv_; + edm::ESGetToken tok_geom_; + edm::ESGetToken tok_caloTopology_; + edm::ESGetToken tok_htopo_; + edm::ESGetToken tok_resp_; +}; + +AlCaHcalIsotrkProducer::AlCaHcalIsotrkProducer(edm::ParameterSet const& iConfig, + const alcaHcalIsoTracks::Counters* counters) + : nRun_(0), + nAll_(0), + nGood_(0), + nRange_(0), + trigNames_(iConfig.getParameter >("triggers")), + theTrackQuality_(iConfig.getParameter("trackQuality")), + processName_(iConfig.getParameter("processName")), + l1Filter_(iConfig.getParameter("l1Filter")), + l2Filter_(iConfig.getParameter("l2Filter")), + l3Filter_(iConfig.getParameter("l3Filter")), + a_coneR_(iConfig.getParameter("coneRadius")), + a_mipR_(iConfig.getParameter("coneRadiusMIP")), + a_mipR2_(iConfig.getParameter("coneRadiusMIP2")), + a_mipR3_(iConfig.getParameter("coneRadiusMIP3")), + a_mipR4_(iConfig.getParameter("coneRadiusMIP4")), + a_mipR5_(iConfig.getParameter("coneRadiusMIP5")), + pTrackMin_(iConfig.getParameter("minimumTrackP")), + eEcalMax_(iConfig.getParameter("maximumEcalEnergy")), + maxRestrictionP_(iConfig.getParameter("maxTrackP")), + slopeRestrictionP_(iConfig.getParameter("slopeTrackP")), + hcalScale_(iConfig.getUntrackedParameter("hHcalScale", 1.0)), + eIsolate1_(iConfig.getParameter("isolationEnergyTight")), + eIsolate2_(iConfig.getParameter("isolationEnergyLoose")), + pTrackLow_(iConfig.getParameter("momentumLow")), + pTrackHigh_(iConfig.getParameter("momentumHigh")), + ignoreTrigger_(iConfig.getUntrackedParameter("ignoreTriggers", false)), + useL1Trigger_(iConfig.getUntrackedParameter("useL1Trigger", false)), + unCorrect_(iConfig.getUntrackedParameter("unCorrect", false)), + collapseDepth_(iConfig.getUntrackedParameter("collapseDepth", false)), + hitEthrEB_(iConfig.getParameter("EBHitEnergyThreshold")), + hitEthrEE0_(iConfig.getParameter("EEHitEnergyThreshold0")), + hitEthrEE1_(iConfig.getParameter("EEHitEnergyThreshold1")), + hitEthrEE2_(iConfig.getParameter("EEHitEnergyThreshold2")), + hitEthrEE3_(iConfig.getParameter("EEHitEnergyThreshold3")), + hitEthrEELo_(iConfig.getParameter("EEHitEnergyThresholdLow")), + hitEthrEEHi_(iConfig.getParameter("EEHitEnergyThresholdHigh")), + triggerEvent_(iConfig.getParameter("labelTriggerEvent")), + theTriggerResultsLabel_(iConfig.getParameter("labelTriggerResult")), + labelGenTrack_(iConfig.getParameter("labelTrack")), + labelRecVtx_(iConfig.getParameter("labelVertex")), + labelEB_(iConfig.getParameter("labelEBRecHit")), + labelEE_(iConfig.getParameter("labelEERecHit")), + labelHBHE_(iConfig.getParameter("labelHBHERecHit")), + labelTower_(iConfig.getParameter("labelCaloTower")), + l1TrigName_(iConfig.getUntrackedParameter("l1TrigName", "L1_SingleJet60")), + oldID_(iConfig.getUntrackedParameter >("oldID")), + newDepth_(iConfig.getUntrackedParameter >("newDepth")), + hep17_(iConfig.getUntrackedParameter("hep17")), + labelIsoTkVar_(iConfig.getParameter("isoTrackLabel")), + labelIsoTkEvtVar_(iConfig.getParameter("isoTrackEventLabel")) { + // Get the run parameters + const double isolationRadius(28.9), innerR(10.0), outerR(30.0); + reco::TrackBase::TrackQuality trackQuality_ = reco::TrackBase::qualityByName(theTrackQuality_); + selectionParameter_.minPt = iConfig.getParameter("minTrackPt"); + selectionParameter_.maxChi2 = iConfig.getParameter("maxChi2"); + selectionParameter_.maxDpOverP = iConfig.getParameter("maxDpOverP"); + selectionParameter_.minOuterHit = iConfig.getParameter("minOuterHit"); + selectionParameter_.minLayerCrossed = iConfig.getParameter("minLayerCrossed"); + selectionParameter_.maxInMiss = iConfig.getParameter("maxInMiss"); + selectionParameter_.minQuality = trackQuality_; + selectionParameter_.maxDxyPV = iConfig.getParameter("maxDxyPV"); + selectionParameter_.maxDzPV = iConfig.getParameter("maxDzPV"); + selectionParameter_.maxChi2 = iConfig.getParameter("maxChi2"); + selectionParameter_.maxDpOverP = iConfig.getParameter("maxDpOverP"); + selectionParameter_.minOuterHit = iConfig.getParameter("minOuterHit"); + selectionParameter_.minLayerCrossed = iConfig.getParameter("minLayerCrossed"); + selectionParameter_.maxInMiss = iConfig.getParameter("maxInMiss"); + selectionParameter_.maxOutMiss = iConfig.getParameter("maxOutMiss"); + a_charIsoR_ = a_coneR_ + isolationRadius; + a_coneR1_ = a_coneR_ + innerR; + a_coneR2_ = a_coneR_ + outerR; + // Different isolation cuts are described in DN-2016/029 + // Tight cut uses 2 GeV; Loose cut uses 10 GeV + // Eta dependent cut uses (maxRestrictionP_ * exp(|ieta|*log(2.5)/18)) + // with the factor for exponential slopeRestrictionP_ = log(2.5)/18 + // maxRestrictionP_ = 8 GeV as came from a study + std::string labelBS = iConfig.getParameter("labelBeamSpot"); + edm::InputTag algTag = iConfig.getParameter("algInputTag"); + edm::InputTag extTag = iConfig.getParameter("extInputTag"); + std::string labelMuon = iConfig.getParameter("labelMuon"); + + for (unsigned int k = 0; k < oldID_.size(); ++k) { + oldDet_.emplace_back((oldID_[k] / 10000) % 10); + oldEta_.emplace_back((oldID_[k] / 100) % 100); + oldDepth_.emplace_back(oldID_[k] % 100); + } + l1GtUtils_ = new l1t::L1TGlobalUtil(iConfig, consumesCollector(), *this, algTag, extTag, l1t::UseEventSetupIn::Event); + // define tokens for access + tok_trigEvt_ = consumes(triggerEvent_); + tok_trigRes_ = consumes(theTriggerResultsLabel_); + tok_bs_ = consumes(labelBS); + tok_genTrack_ = consumes(labelGenTrack_); + tok_ew_ = consumes(edm::InputTag("generator")); + tok_parts_ = consumes(edm::InputTag("genParticles")); + tok_cala_ = consumes(labelTower_); + tok_alg_ = consumes >(algTag); + tok_Muon_ = consumes(labelMuon); + tok_recVtx_ = consumes(labelRecVtx_); + tok_EB_ = consumes(edm::InputTag("ecalRecHit", labelEB_)); + tok_EE_ = consumes(edm::InputTag("ecalRecHit", labelEE_)); + tok_hbhe_ = consumes(labelHBHE_); + edm::LogVerbatim("HcalIsoTrack") << "Labels used " << triggerEvent_ << " " << theTriggerResultsLabel_ << " " + << labelBS << " " << labelRecVtx_ << " " << labelGenTrack_ << " " + << edm::InputTag("ecalRecHit", labelEB_) << " " + << edm::InputTag("ecalRecHit", labelEE_) << " " << labelHBHE_ << " " << labelTower_ + << " " << labelMuon; + + tok_ddrec_ = esConsumes(); + tok_bFieldH_ = esConsumes(); + tok_ecalChStatus_ = esConsumes(); + tok_sevlv_ = esConsumes(); + tok_geom_ = esConsumes(); + tok_caloTopology_ = esConsumes(); + tok_htopo_ = esConsumes(); + tok_resp_ = esConsumes(); + + edm::LogVerbatim("HcalIsoTrack") << "Parameters read from config file \n" + << "\t minPt " << selectionParameter_.minPt << "\t theTrackQuality " + << theTrackQuality_ << "\t minQuality " << selectionParameter_.minQuality + << "\t maxDxyPV " << selectionParameter_.maxDxyPV << "\t maxDzPV " + << selectionParameter_.maxDzPV << "\t maxChi2 " << selectionParameter_.maxChi2 + << "\t maxDpOverP " << selectionParameter_.maxDpOverP << "\t minOuterHit " + << selectionParameter_.minOuterHit << "\t minLayerCrossed " + << selectionParameter_.minLayerCrossed << "\t maxInMiss " + << selectionParameter_.maxInMiss << "\t maxOutMiss " + << selectionParameter_.maxOutMiss << "\t a_coneR " << a_coneR_ << ":" << a_coneR1_ + << ":" << a_coneR2_ << "\t a_charIsoR " << a_charIsoR_ << "\t a_mipR " << a_mipR_ + << "\t a_mipR2 " << a_mipR2_ << "\t a_mipR3 " << a_mipR3_ << "\t a_mipR4 " + << a_mipR4_ << "\t a_mipR5 " << a_mipR5_ << "\n pTrackMin_ " << pTrackMin_ + << "\t eEcalMax_ " << eEcalMax_ << "\t maxRestrictionP_ " << maxRestrictionP_ + << "\t slopeRestrictionP_ " << slopeRestrictionP_ << "\t eIsolateStrong_ " + << eIsolate1_ << "\t eIsolateSoft_ " << eIsolate2_ << "\t hcalScale_ " << hcalScale_ + << "\n\t momentumLow_ " << pTrackLow_ << "\t momentumHigh_ " << pTrackHigh_ + << "\n\t ignoreTrigger_ " << ignoreTrigger_ << "\n\t useL1Trigger_ " << useL1Trigger_ + << "\t unCorrect_ " << unCorrect_ << "\t collapseDepth_ " << collapseDepth_ + << "\t L1TrigName_ " << l1TrigName_ << "\nThreshold for EB " << hitEthrEB_ + << " EE " << hitEthrEE0_ << ":" << hitEthrEE1_ << ":" << hitEthrEE2_ << ":" + << hitEthrEE3_ << ":" << hitEthrEELo_ << ":" << hitEthrEEHi_; + edm::LogVerbatim("HcalIsoTrack") << "Process " << processName_ << " L1Filter:" << l1Filter_ + << " L2Filter:" << l2Filter_ << " L3Filter:" << l3Filter_; + for (unsigned int k = 0; k < trigNames_.size(); ++k) { + edm::LogVerbatim("HcalIsoTrack") << "Trigger[" << k << "] " << trigNames_[k]; + } + edm::LogVerbatim("HcalIsoTrack") << oldID_.size() << " DetIDs to be corrected with HEP17 flag:" << hep17_; + for (unsigned int k = 0; k < oldID_.size(); ++k) + edm::LogVerbatim("HcalIsoTrack") << "[" << k << "] Det " << oldDet_[k] << " EtaAbs " << oldEta_[k] << " Depth " + << oldDepth_[k] << ":" << newDepth_[k]; + + for (int i = 0; i < 10; i++) + phibins_.push_back(-M_PI + 0.1 * (2 * i + 1) * M_PI); + for (int i = 0; i < 8; ++i) + etabins_.push_back(-2.1 + 0.6 * i); + etadist_ = etabins_[1] - etabins_[0]; + phidist_ = phibins_[1] - phibins_[0]; + etahalfdist_ = 0.5 * etadist_; + phihalfdist_ = 0.5 * phidist_; + edm::LogVerbatim("HcalIsoTrack") << "EtaDist " << etadist_ << " " << etahalfdist_ << " PhiDist " << phidist_ << " " + << phihalfdist_; + //create also IsolatedPixelTrackCandidateCollection which contains isolation info and reference to primary track + produces(labelIsoTkVar_); + produces(labelIsoTkEvtVar_); + edm::LogVerbatim("HcalIsoTrack") << " Expected to produce the collections:\n" + << "HcalIsoTrkCalibVariablesCollection with label " << labelIsoTkVar_ + << "\nand HcalIsoTrkEventVariablesCollection with label " << labelIsoTkEvtVar_; +} + +void AlCaHcalIsotrkProducer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { + edm::ParameterSetDescription desc; + desc.add("processName", "HLT"); + std::vector trig; + desc.add >("triggers", trig); + desc.add("l1Filter", ""); + desc.add("l2Filter", "L2Filter"); + desc.add("l3Filter", "Filter"); + // following 10 parameters are parameters to select good tracks + desc.add("trackQuality", "highPurity"); + desc.add("minTrackPt", 1.0); + desc.add("maxDxyPV", 0.02); + desc.add("maxDzPV", 0.02); + desc.add("maxChi2", 5.0); + desc.add("maxDpOverP", 0.1); + desc.add("minOuterHit", 4); + desc.add("minLayerCrossed", 8); + desc.add("maxInMiss", 0); + desc.add("maxOutMiss", 0); + // Minimum momentum of selected isolated track and signal zone + desc.add("minimumTrackP", 10.0); + desc.add("coneRadius", 34.98); + // signal zone in ECAL and MIP energy cutoff + desc.add("coneRadiusMIP", 14.0); + desc.add("coneRadiusMIP2", 18.0); + desc.add("coneRadiusMIP3", 20.0); + desc.add("coneRadiusMIP4", 22.0); + desc.add("coneRadiusMIP5", 24.0); + desc.add("maximumEcalEnergy", 2.0); + // following 4 parameters are for isolation cuts and described in the code + desc.add("maxTrackP", 8.0); + desc.add("slopeTrackP", 0.05090504066); + desc.add("isolationEnergyTight", 2.0); + desc.add("isolationEnergyLoose", 10.0); + // energy thershold for ECAL (from Egamma group) + desc.add("EBHitEnergyThreshold", 0.08); + desc.add("EEHitEnergyThreshold0", 0.30); + desc.add("EEHitEnergyThreshold1", 0.00); + desc.add("EEHitEnergyThreshold2", 0.00); + desc.add("EEHitEnergyThreshold3", 0.00); + desc.add("EEHitEnergyThresholdLow", 0.30); + desc.add("EEHitEnergyThresholdHigh", 0.30); + // prescale factors + desc.add("momentumLow", 40.0); + desc.add("momentumHigh", 60.0); + desc.add("prescaleLow", 1); + desc.add("prescaleHigh", 1); + // various labels for collections used in the code + desc.add("labelTriggerEvent", edm::InputTag("hltTriggerSummaryAOD", "", "HLT")); + desc.add("labelTriggerResult", edm::InputTag("TriggerResults", "", "HLT")); + desc.add("labelTrack", "generalTracks"); + desc.add("labelVertex", "offlinePrimaryVertices"); + desc.add("labelEBRecHit", "EcalRecHitsEB"); + desc.add("labelEERecHit", "EcalRecHitsEE"); + desc.add("labelHBHERecHit", "hbhereco"); + desc.add("labelBeamSpot", "offlineBeamSpot"); + desc.add("labelCaloTower", "towerMaker"); + desc.add("labelMuon", "muons"); + desc.add("algInputTag", edm::InputTag("gtStage2Digis")); + desc.add("extInputTag", edm::InputTag("gtStage2Digis")); + desc.add("isoTrackLabel", "HcalIsoTrack"); + desc.add("isoTrackEventLabel", "HcalIsoTrackEvent"); + // Various flags used for selecting tracks, choice of energy Method2/0 + // Data type 0/1 for single jet trigger or others + desc.addUntracked("ignoreTriggers", false); + desc.addUntracked("useL1Trigger", false); + desc.addUntracked("hcalScale", 1.0); + desc.addUntracked("unCorrect", false); + desc.addUntracked("collapseDepth", false); + desc.addUntracked("l1TrigName", "L1_SingleJet60"); + std::vector dummy; + desc.addUntracked >("oldID", dummy); + desc.addUntracked >("newDepth", dummy); + desc.addUntracked("hep17", false); + descriptions.add("alcaHcalIsotrkProducer", desc); +} + +void AlCaHcalIsotrkProducer::produce(edm::Event& iEvent, edm::EventSetup const& iSetup) { + nAll_++; +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("HcalIsoTrack") << "Run " << iEvent.id().run() << " Event " << iEvent.id().event() << " Luminosity " + << iEvent.luminosityBlock() << " Bunch " << iEvent.bunchCrossing(); +#endif + + HcalIsoTrkEventVariables isoTrkEvent; + //Step1: Get all the relevant containers + const MagneticField* bField = &iSetup.getData(tok_bFieldH_); + const EcalChannelStatus* theEcalChStatus = &iSetup.getData(tok_ecalChStatus_); + const EcalSeverityLevelAlgo* theEcalSevlv = &iSetup.getData(tok_sevlv_); + + // get handles to calogeometry and calotopology + const CaloGeometry* geo = &iSetup.getData(tok_geom_); + const CaloTopology* caloTopology = &iSetup.getData(tok_caloTopology_); + const HcalTopology* theHBHETopology = &iSetup.getData(tok_htopo_); + const HcalRespCorrs* respCorrs = &iSetup.getData(tok_resp_); + bool okC(true); + //Get track collection + auto trkCollection = iEvent.getHandle(tok_genTrack_); + if (!trkCollection.isValid()) { + edm::LogWarning("HcalIsoTrack") << "Cannot access the collection " << labelGenTrack_; + okC = false; + } + + //Get muon collection + auto const& muonh = iEvent.getHandle(tok_Muon_); + + //Define the best vertex and the beamspot + auto const& recVtxs = iEvent.getHandle(tok_recVtx_); + auto const& beamSpotH = iEvent.getHandle(tok_bs_); + math::XYZPoint leadPV(0, 0, 0); + int goodPV(0); + if (recVtxs.isValid() && !(recVtxs->empty())) { + isoTrkEvent.allvertex_ = recVtxs->size(); + for (unsigned int k = 0; k < recVtxs->size(); ++k) { + if (!((*recVtxs)[k].isFake()) && ((*recVtxs)[k].ndof() > 4)) { + if (goodPV == 0) + leadPV = math::XYZPoint((*recVtxs)[k].x(), (*recVtxs)[k].y(), (*recVtxs)[k].z()); + goodPV++; + } + } + } + if (goodPV == 0 && beamSpotH.isValid()) { + leadPV = beamSpotH->position(); + } +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("HcalIsoTrack") << "Primary Vertex " << leadPV << " out of " << goodPV << " vertex"; + if (beamSpotH.isValid()) { + edm::LogVerbatim("HcalIsoTrack") << " Beam Spot " << beamSpotH->position(); + } +#endif + + // RecHits + auto barrelRecHitsHandle = iEvent.getHandle(tok_EB_); + if (!barrelRecHitsHandle.isValid()) { + edm::LogWarning("HcalIsoTrack") << "Cannot access the collection " << labelEB_; + okC = false; + } + auto endcapRecHitsHandle = iEvent.getHandle(tok_EE_); + if (!endcapRecHitsHandle.isValid()) { + edm::LogWarning("HcalIsoTrack") << "Cannot access the collection " << labelEE_; + okC = false; + } + auto hbhe = iEvent.getHandle(tok_hbhe_); + if (!hbhe.isValid()) { + edm::LogWarning("HcalIsoTrack") << "Cannot access the collection " << labelHBHE_; + okC = false; + } + auto caloTower = iEvent.getHandle(tok_cala_); + + //=== genParticle information + auto const& genParticles = iEvent.getHandle(tok_parts_); + auto const& genEventInfo = iEvent.getHandle(tok_ew_); + double eventWeight = (genEventInfo.isValid()) ? genEventInfo->weight() : 1.0; + + //Propagate tracks to calorimeter surface) + std::vector trkCaloDirections; + spr::propagateCALO(trkCollection, geo, bField, theTrackQuality_, trkCaloDirections, false); + std::vector trkCaloDets; + spr::propagateCALO(trkCollection, geo, bField, theTrackQuality_, trkCaloDets, false); + std::vector vecL1, vecL3; + isoTrkEvent.tracks_ = trkCollection->size(); + isoTrkEvent.tracksProp_ = trkCaloDirections.size(); + isoTrkEvent.hltbits_.assign(trigNames_.size(), false); + + if (!ignoreTrigger_) { + //L1 + l1GtUtils_->retrieveL1(iEvent, iSetup, tok_alg_); + const std::vector >& finalDecisions = l1GtUtils_->decisionsFinal(); + for (const auto& decision : finalDecisions) { + if (decision.first.find(l1TrigName_) != std::string::npos) { + isoTrkEvent.l1Bit_ = decision.second; + break; + } + } +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("HcalIsoTrack") << "Trigger Information for " << l1TrigName_ << " is " << isoTrkEvent.l1Bit_ + << " from a list of " << finalDecisions.size() << " decisions"; +#endif + + //HLT + auto const& triggerResults = iEvent.getHandle(tok_trigRes_); + if (triggerResults.isValid()) { + const edm::TriggerNames& triggerNames = iEvent.triggerNames(*triggerResults); + const std::vector& names = triggerNames.triggerNames(); + if (!trigNames_.empty()) { + for (unsigned int iHLT = 0; iHLT < triggerResults->size(); iHLT++) { + int hlt = triggerResults->accept(iHLT); + for (unsigned int i = 0; i < trigNames_.size(); ++i) { + if (names[iHLT].find(trigNames_[i]) != std::string::npos) { + isoTrkEvent.hltbits_[i] = (hlt > 0); + if (hlt > 0) + isoTrkEvent.trigPass_ = true; +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("HcalIsoTrack") + << "This trigger " << names[iHLT] << " Flag " << hlt << ":" << isoTrkEvent.hltbits_[i]; +#endif + } + } + } + } + } +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("HcalIsoTrack") << "HLT Information shows " << isoTrkEvent.trigPass_ << ":" << trigNames_.empty() + << ":" << okC; +#endif + } + + auto outputHcalIsoTrackColl = std::make_unique(); + std::array ntksave{{0, 0, 0}}; + if (ignoreTrigger_ || useL1Trigger_) { + if (ignoreTrigger_ || isoTrkEvent.l1Bit_) + ntksave = getProducts(goodPV, + eventWeight, + vecL1, + vecL3, + leadPV, + trkCaloDirections, + trkCaloDets, + geo, + caloTopology, + theHBHETopology, + theEcalChStatus, + theEcalSevlv, + barrelRecHitsHandle, + endcapRecHitsHandle, + hbhe, + caloTower, + genParticles, + respCorrs, + muonh, + *outputHcalIsoTrackColl, + isoTrkEvent); + isoTrkEvent.tracksSaved_ = ntksave[0]; + isoTrkEvent.tracksLoose_ = ntksave[1]; + isoTrkEvent.tracksTight_ = ntksave[2]; + } else { + trigger::TriggerEvent triggerEvent; + auto const& triggerEventHandle = iEvent.getHandle(tok_trigEvt_); + if (!triggerEventHandle.isValid()) { + edm::LogWarning("HcalIsoTrack") << "Error! Can't get the product " << triggerEvent_.label(); + } else if (okC) { + triggerEvent = *(triggerEventHandle.product()); + const trigger::TriggerObjectCollection& TOC(triggerEvent.getObjects()); + bool done(false); + auto const& triggerResults = iEvent.getHandle(tok_trigRes_); + if (triggerResults.isValid()) { + std::vector modules; + const edm::TriggerNames& triggerNames = iEvent.triggerNames(*triggerResults); + const std::vector& names = triggerNames.triggerNames(); + for (unsigned int iHLT = 0; iHLT < triggerResults->size(); iHLT++) { + bool ok = (isoTrkEvent.trigPass_) || (trigNames_.empty()); + if (ok) { + unsigned int triggerindx = hltConfig_.triggerIndex(names[iHLT]); + const std::vector& moduleLabels(hltConfig_.moduleLabels(triggerindx)); + std::vector vecL2; + vecL1.clear(); + vecL3.clear(); + //loop over all trigger filters in event (i.e. filters passed) + for (unsigned int ifilter = 0; ifilter < triggerEvent.sizeFilters(); ++ifilter) { + std::vector Keys; + std::string label = triggerEvent.filterTag(ifilter).label(); + //loop over keys to objects passing this filter + for (unsigned int imodule = 0; imodule < moduleLabels.size(); imodule++) { + if (label.find(moduleLabels[imodule]) != std::string::npos) { +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("HcalIsoTrack") << "FilterName " << label; +#endif + for (unsigned int ifiltrKey = 0; ifiltrKey < triggerEvent.filterKeys(ifilter).size(); ++ifiltrKey) { + Keys.push_back(triggerEvent.filterKeys(ifilter)[ifiltrKey]); + const trigger::TriggerObject& TO(TOC[Keys[ifiltrKey]]); + math::XYZTLorentzVector v4(TO.px(), TO.py(), TO.pz(), TO.energy()); + if (label.find(l2Filter_) != std::string::npos) { + vecL2.push_back(v4); + } else if (label.find(l3Filter_) != std::string::npos) { + vecL3.push_back(v4); + } else if ((label.find(l1Filter_) != std::string::npos) || (l1Filter_.empty())) { + vecL1.push_back(v4); + } +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("HcalIsoTrack") + << "key " << ifiltrKey << " : pt " << TO.pt() << " eta " << TO.eta() << " phi " << TO.phi() + << " mass " << TO.mass() << " Id " << TO.id(); +#endif + } +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("HcalIsoTrack") + << "sizes " << vecL1.size() << ":" << vecL2.size() << ":" << vecL3.size(); +#endif + } + } + } + + // Now Make the products for all selected tracks + if (!done) { + ntksave = getProducts(goodPV, + eventWeight, + vecL1, + vecL3, + leadPV, + trkCaloDirections, + trkCaloDets, + geo, + caloTopology, + theHBHETopology, + theEcalChStatus, + theEcalSevlv, + barrelRecHitsHandle, + endcapRecHitsHandle, + hbhe, + caloTower, + genParticles, + respCorrs, + muonh, + *outputHcalIsoTrackColl, + isoTrkEvent); + isoTrkEvent.tracksSaved_ += ntksave[0]; + isoTrkEvent.tracksLoose_ += ntksave[1]; + isoTrkEvent.tracksTight_ += ntksave[2]; + done = true; + } + } + } + } + } + } + isoTrkEvent.trigPassSel_ = (isoTrkEvent.tracksSaved_ > 0); + if (isoTrkEvent.trigPassSel_) { + ++nGood_; + for (auto itr = outputHcalIsoTrackColl->begin(); itr != outputHcalIsoTrackColl->end(); ++itr) { + if (itr->p_ > pTrackLow_ && itr->p_ < pTrackHigh_) + ++nRange_; + } + } + + auto outputEventcol = std::make_unique(); + outputEventcol->emplace_back(isoTrkEvent); + iEvent.put(std::move(outputEventcol), labelIsoTkEvtVar_); + iEvent.put(std::move(outputHcalIsoTrackColl), labelIsoTkVar_); +} + +void AlCaHcalIsotrkProducer::endStream() { + globalCache()->nAll_ += nAll_; + globalCache()->nGood_ += nGood_; + globalCache()->nRange_ += nRange_; +} + +void AlCaHcalIsotrkProducer::globalEndJob(const alcaHcalIsoTracks::Counters* count) { + edm::LogVerbatim("HcalIsoTrack") << "Finds " << count->nGood_ << " good tracks in " << count->nAll_ << " events and " + << count->nRange_ << " events in the momentum range"; +} + +void AlCaHcalIsotrkProducer::beginRun(edm::Run const& iRun, edm::EventSetup const& iSetup) { + hdc_ = &iSetup.getData(tok_ddrec_); + if (!ignoreTrigger_) { + bool changed(false); + edm::LogVerbatim("HcalIsoTrack") << "Run[" << nRun_ << "] " << iRun.run() << " hltconfig.init " + << hltConfig_.init(iRun, iSetup, processName_, changed); + } +} + +void AlCaHcalIsotrkProducer::endRun(edm::Run const& iRun, edm::EventSetup const&) { + edm::LogVerbatim("HcalIsoTrack") << "endRun [" << nRun_ << "] " << iRun.run(); + ++nRun_; +} + +std::array AlCaHcalIsotrkProducer::getProducts(int goodPV, + double eventWeight, + std::vector& vecL1, + std::vector& vecL3, + math::XYZPoint& leadPV, + std::vector& trkCaloDirections, + std::vector& trkCaloDets, + const CaloGeometry* geo, + const CaloTopology* caloTopology, + const HcalTopology* theHBHETopology, + const EcalChannelStatus* theEcalChStatus, + const EcalSeverityLevelAlgo* theEcalSevlv, + edm::Handle& barrelRecHitsHandle, + edm::Handle& endcapRecHitsHandle, + edm::Handle& hbhe, + edm::Handle& tower, + const edm::Handle& genParticles, + const HcalRespCorrs* respCorrs, + const edm::Handle& muonh, + std::vector& hocalib, + HcalIsoTrkEventVariables& hocalibEvent) { + int nSave(0), nLoose(0), nTight(0); + unsigned int nTracks(0), nselTracks(0); + double rhohEV = (tower.isValid()) ? rhoh(tower) : 0; + + //Loop over tracks + std::vector::const_iterator trkDetItr; + for (trkDetItr = trkCaloDirections.begin(), nTracks = 0; trkDetItr != trkCaloDirections.end(); + trkDetItr++, nTracks++) { + const reco::Track* pTrack = &(*(trkDetItr->trkItr)); + math::XYZTLorentzVector v4(pTrack->px(), pTrack->py(), pTrack->pz(), pTrack->p()); + bool accept(false); + HcalIsoTrkCalibVariables isoTk; + isoTk.eventWeight_ = eventWeight; + isoTk.goodPV_ = goodPV; + isoTk.nVtx_ = hocalibEvent.allvertex_; + isoTk.nTrk_ = trkCaloDirections.size(); + isoTk.rhoh_ = rhohEV; + for (const auto& trig : hocalibEvent.hltbits_) + isoTk.trgbits_.emplace_back(trig); + if (!vecL1.empty()) { + isoTk.l1pt_ = vecL1[0].pt(); + isoTk.l1eta_ = vecL1[0].eta(); + isoTk.l1phi_ = vecL1[0].phi(); + } + if (!vecL3.empty()) { + isoTk.l3pt_ = vecL3[0].pt(); + isoTk.l3eta_ = vecL3[0].eta(); + isoTk.l3phi_ = vecL3[0].phi(); + } + + isoTk.p_ = pTrack->p(); + isoTk.pt_ = pTrack->pt(); + isoTk.phi_ = pTrack->phi(); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("HcalIsoTrack") << "This track : " << nTracks << " (pt|eta|phi|p) :" << isoTk.pt_ << "|" + << pTrack->eta() << "|" << isoTk.phi_ << "|" << isoTk.p_; + int flag(0); +#endif + isoTk.mindR2_ = 999; + for (unsigned int k = 0; k < vecL3.size(); ++k) { + double dr = dR(vecL3[k], v4); + if (dr < isoTk.mindR2_) { + isoTk.mindR2_ = dr; + } + } + isoTk.mindR1_ = (!vecL1.empty()) ? dR(vecL1[0], v4) : 999; +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("HcalIsoTrack") << "Closest L3 object at dr :" << isoTk.mindR2_ << " and from L1 " + << isoTk.mindR1_; +#endif + isoTk.ieta_ = isoTk.iphi_ = 0; + if (trkDetItr->okHCAL) { + HcalDetId detId = (HcalDetId)(trkDetItr->detIdHCAL); + isoTk.ieta_ = detId.ieta(); + isoTk.iphi_ = detId.iphi(); + if (isoTk.p_ > 40.0 && isoTk.p_ <= 60.0) + hocalibEvent.ietaAll_.emplace_back(isoTk.ieta_); + } + //Selection of good track + isoTk.selectTk_ = spr::goodTrack(pTrack, leadPV, selectionParameter_, false); + spr::trackSelectionParameters oneCutParameters = selectionParameter_; + oneCutParameters.maxDxyPV = 10; + oneCutParameters.maxDzPV = 100; + oneCutParameters.maxInMiss = 2; + oneCutParameters.maxOutMiss = 2; + bool qltyFlag = spr::goodTrack(pTrack, leadPV, oneCutParameters, false); + oneCutParameters = selectionParameter_; + oneCutParameters.maxDxyPV = 10; + oneCutParameters.maxDzPV = 100; + isoTk.qltyMissFlag_ = spr::goodTrack(pTrack, leadPV, oneCutParameters, false); + oneCutParameters = selectionParameter_; + oneCutParameters.maxInMiss = 2; + oneCutParameters.maxOutMiss = 2; + isoTk.qltyPVFlag_ = spr::goodTrack(pTrack, leadPV, oneCutParameters, false); + double eIsolation = maxRestrictionP_ * exp(slopeRestrictionP_ * std::abs((double)isoTk.ieta_)); + if (eIsolation < eIsolate1_) + eIsolation = eIsolate1_; + if (eIsolation < eIsolate2_) + eIsolation = eIsolate2_; +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("HcalIsoTrack") << "qltyFlag|okECAL|okHCAL : " << qltyFlag << "|" << trkDetItr->okECAL << "|" + << trkDetItr->okHCAL << " eIsolation " << eIsolation; + if (qltyFlag) + flag += 1; + if (trkDetItr->okECAL) + flag += 2; + if (trkDetItr->okHCAL) + flag += 4; +#endif + isoTk.qltyFlag_ = (qltyFlag && trkDetItr->okECAL && trkDetItr->okHCAL); + bool notMuon = (muonh.isValid()) ? notaMuon(pTrack, muonh) : true; +#ifdef EDM_ML_DEBUG + if (notMuon) + flag += 8; +#endif + if (isoTk.qltyFlag_ && notMuon) { + nselTracks++; + int nNearTRKs(0); + ////////////////////////////////-MIP STUFF-////////////////////////////// + std::vector eIds; + std::vector eHit; +#ifdef EDM_ML_DEBUG + double eMipDR = +#endif + spr::eCone_ecal(geo, + barrelRecHitsHandle, + endcapRecHitsHandle, + trkDetItr->pointHCAL, + trkDetItr->pointECAL, + a_mipR_, + trkDetItr->directionECAL, + eIds, + eHit); + double eEcal(0); + for (unsigned int k = 0; k < eIds.size(); ++k) { + if (eHit[k] > eThreshold(eIds[k], geo)) + eEcal += eHit[k]; + } +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("HcalIsoTrack") << "eMIP before and after: " << eMipDR << ":" << eEcal; +#endif + isoTk.eMipDR_.emplace_back(eEcal); + ////////////////////////////////-MIP STUFF-/////////////////////////////// + ////////////////////////////////-MIP STUFF-2////////////////////////////// + std::vector eIds2; + std::vector eHit2; +#ifdef EDM_ML_DEBUG + double eMipDR2 = +#endif + spr::eCone_ecal(geo, + barrelRecHitsHandle, + endcapRecHitsHandle, + trkDetItr->pointHCAL, + trkDetItr->pointECAL, + a_mipR2_, + trkDetItr->directionECAL, + eIds2, + eHit2); + double eEcal2(0); + for (unsigned int k = 0; k < eIds2.size(); ++k) { + if (eHit2[k] > eThreshold(eIds2[k], geo)) + eEcal2 += eHit2[k]; + } +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("HcalIsoTrack") << "eMIP before and after: " << eMipDR2 << ":" << eEcal2; +#endif + isoTk.eMipDR_.emplace_back(eEcal2); + ////////////////////////////////-MIP STUFF-2///////////////////////////// + ////////////////////////////////-MIP STUFF-3///////////////////////////// + std::vector eIds3; + std::vector eHit3; +#ifdef EDM_ML_DEBUG + double eMipDR3 = +#endif + spr::eCone_ecal(geo, + barrelRecHitsHandle, + endcapRecHitsHandle, + trkDetItr->pointHCAL, + trkDetItr->pointECAL, + a_mipR3_, + trkDetItr->directionECAL, + eIds3, + eHit3); + double eEcal3(0); + for (unsigned int k = 0; k < eIds3.size(); ++k) { + if (eHit3[k] > eThreshold(eIds3[k], geo)) + eEcal3 += eHit3[k]; + } +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("HcalIsoTrack") << "eMIP before and after: " << eMipDR3 << ":" << eEcal3; +#endif + isoTk.eMipDR_.emplace_back(eEcal3); + ////////////////////////////////-MIP STUFF-3///////////////////////////// + ////////////////////////////////-MIP STUFF-4///////////////////////////// + std::vector eIds4; + std::vector eHit4; +#ifdef EDM_ML_DEBUG + double eMipDR4 = +#endif + spr::eCone_ecal(geo, + barrelRecHitsHandle, + endcapRecHitsHandle, + trkDetItr->pointHCAL, + trkDetItr->pointECAL, + a_mipR4_, + trkDetItr->directionECAL, + eIds4, + eHit4); + double eEcal4(0); + for (unsigned int k = 0; k < eIds4.size(); ++k) { + if (eHit4[k] > eThreshold(eIds4[k], geo)) + eEcal4 += eHit4[k]; + } +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("HcalIsoTrack") << "eMIP before and after: " << eMipDR4 << ":" << eEcal4; +#endif + isoTk.eMipDR_.emplace_back(eEcal4); + ////////////////////////////////-MIP STUFF-4///////////////////////////// + ////////////////////////////////-MIP STUFF-5///////////////////////////// + std::vector eIds5; + std::vector eHit5; +#ifdef EDM_ML_DEBUG + double eMipDR5 = +#endif + spr::eCone_ecal(geo, + barrelRecHitsHandle, + endcapRecHitsHandle, + trkDetItr->pointHCAL, + trkDetItr->pointECAL, + a_mipR5_, + trkDetItr->directionECAL, + eIds5, + eHit5); + double eEcal5(0); + for (unsigned int k = 0; k < eIds5.size(); ++k) { + if (eHit5[k] > eThreshold(eIds5[k], geo)) + eEcal5 += eHit5[k]; + } +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("HcalIsoTrack") << "eMIP before and after: " << eMipDR5 << ":" << eEcal5; +#endif + isoTk.eMipDR_.emplace_back(eEcal5); + ////////////////////////////////-MIP STUFF-5///////////////////////////// + + isoTk.emaxNearP_ = spr::chargeIsolationEcal(nTracks, trkCaloDets, geo, caloTopology, 15, 15); + const DetId cellE(trkDetItr->detIdECAL); + std::pair e11x11P = spr::eECALmatrix(cellE, + barrelRecHitsHandle, + endcapRecHitsHandle, + *theEcalChStatus, + geo, + caloTopology, + theEcalSevlv, + 5, + 5, + -100.0, + -100.0, + -100.0, + 100.0); + std::pair e15x15P = spr::eECALmatrix(cellE, + barrelRecHitsHandle, + endcapRecHitsHandle, + *theEcalChStatus, + geo, + caloTopology, + theEcalSevlv, + 7, + 7, + -100.0, + -100.0, + -100.0, + 100.0); + if (e11x11P.second && e15x15P.second) { + isoTk.eAnnular_ = (e15x15P.first - e11x11P.first); + } else { + isoTk.eAnnular_ = -(e15x15P.first - e11x11P.first); + } + isoTk.hmaxNearP_ = spr::chargeIsolationCone(nTracks, trkCaloDirections, a_charIsoR_, nNearTRKs, false); + const DetId cellH(trkDetItr->detIdHCAL); + double h5x5 = spr::eHCALmatrix( + theHBHETopology, cellH, hbhe, 2, 2, false, true, -100.0, -100.0, -100.0, -100.0, -100.0, 100.0); + double h7x7 = spr::eHCALmatrix( + theHBHETopology, cellH, hbhe, 3, 3, false, true, -100.0, -100.0, -100.0, -100.0, -100.0, 100.0); + isoTk.hAnnular_ = h7x7 - h5x5; +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("HcalIsoTrack") << "max p Near (Ecal) " << isoTk.emaxNearP_ << " (Hcal) " << isoTk.hmaxNearP_ + << " Annular E (Ecal) " << e11x11P.first << ":" << e15x15P.first << ":" + << isoTk.eAnnular_ << " (Hcal) " << h5x5 << ":" << h7x7 << ":" + << isoTk.hAnnular_; + if (isoTk.eMipDR_[0] < eEcalMax_) + flag += 16; + if (isoTk.hmaxNearP_ < eIsolation) + flag += 32; +#endif + isoTk.gentrackP_ = trackP(pTrack, genParticles); + if (isoTk.eMipDR_[0] < eEcalMax_ && isoTk.hmaxNearP_ < eIsolation) { + int nRecHits(-999), nRecHits1(-999), nRecHits3(-999); + std::vector ids, ids1, ids3; + std::vector edet0, edet1, edet3; + isoTk.eHcal_ = spr::eCone_hcal(geo, + hbhe, + trkDetItr->pointHCAL, + trkDetItr->pointECAL, + a_coneR_, + trkDetItr->directionHCAL, + nRecHits, + ids, + edet0, + 0); + if (!oldID_.empty()) { + for (unsigned k = 0; k < ids.size(); ++k) + ids[k] = newId(ids[k]); + } + storeEnergy(respCorrs, ids, edet0, isoTk.eHcal_, isoTk.detIds_, isoTk.hitEnergies_); + std::pair ehcal0 = + storeEnergy(respCorrs, hbhe, ids, isoTk.hitEnergiesRaw_, isoTk.hitEnergiesAux_); + isoTk.eHcalRaw_ = ehcal0.first; + isoTk.eHcalAux_ = ehcal0.second; + + //----- hcal energy in the extended cone 1 (a_coneR+10) -------------- + isoTk.eHcal10_ = spr::eCone_hcal(geo, + hbhe, + trkDetItr->pointHCAL, + trkDetItr->pointECAL, + a_coneR1_, + trkDetItr->directionHCAL, + nRecHits1, + ids1, + edet1, + 0); + if (!oldID_.empty()) { + for (unsigned k = 0; k < ids1.size(); ++k) + ids1[k] = newId(ids1[k]); + } + storeEnergy(respCorrs, ids1, edet1, isoTk.eHcal10_, isoTk.detIds1_, isoTk.hitEnergies1_); + std::pair ehcal1 = + storeEnergy(respCorrs, hbhe, ids1, isoTk.hitEnergies1Raw_, isoTk.hitEnergies1Aux_); + isoTk.eHcal10Raw_ = ehcal1.first; + isoTk.eHcal10Aux_ = ehcal1.second; + + //----- hcal energy in the extended cone 3 (a_coneR+30) -------------- + isoTk.eHcal30_ = spr::eCone_hcal(geo, + hbhe, + trkDetItr->pointHCAL, + trkDetItr->pointECAL, + a_coneR2_, + trkDetItr->directionHCAL, + nRecHits3, + ids3, + edet3, + 0); + if (!oldID_.empty()) { + for (unsigned k = 0; k < ids3.size(); ++k) + ids3[k] = newId(ids3[k]); + } + storeEnergy(respCorrs, ids3, edet3, isoTk.eHcal30_, isoTk.detIds3_, isoTk.hitEnergies3_); + std::pair ehcal3 = + storeEnergy(respCorrs, hbhe, ids3, isoTk.hitEnergies3Raw_, isoTk.hitEnergies3Aux_); + isoTk.eHcal30Raw_ = ehcal3.first; + isoTk.eHcal30Aux_ = ehcal3.second; + +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("HcalIsoTrack") << "This track : " << nTracks << " (pt|eta|phi|p) :" << isoTk.pt_ << "|" + << pTrack->eta() << "|" << isoTk.phi_ << "|" << isoTk.p_ + << " Generator Level p " << isoTk.gentrackP_; + edm::LogVerbatim("HcalIsoTrack") << "e_MIP " << isoTk.eMipDR_[0] << " Chg Isolation " << isoTk.hmaxNearP_ + << " eHcal" << isoTk.eHcal_ << ":" << isoTk.eHcalRaw_ << ":" << isoTk.eHcalAux_ + << " ieta " << isoTk.ieta_ << " Quality " << isoTk.qltyMissFlag_ << ":" + << isoTk.qltyPVFlag_ << ":" << isoTk.selectTk_; + for (unsigned int ll = 0; ll < isoTk.detIds_.size(); ll++) { + edm::LogVerbatim("HcalIsoTrack") + << "det id is = " << HcalDetId(isoTk.detIds_[ll]) << " hit enery is = " << isoTk.hitEnergies_[ll] + << " : " << isoTk.hitEnergiesRaw_[ll] << " : " << isoTk.hitEnergiesAux_[ll]; + } + for (unsigned int ll = 0; ll < isoTk.detIds1_.size(); ll++) { + edm::LogVerbatim("HcalIsoTrack") + << "det id is = " << HcalDetId(isoTk.detIds1_[ll]) << " hit enery is = " << isoTk.hitEnergies1_[ll] + << " : " << isoTk.hitEnergies1Raw_[ll] << " : " << isoTk.hitEnergies1Aux_[ll]; + ; + } + for (unsigned int ll = 0; ll < isoTk.detIds3_.size(); ll++) { + edm::LogVerbatim("HcalIsoTrack") + << "det id is = " << HcalDetId(isoTk.detIds3_[ll]) << " hit enery is = " << isoTk.hitEnergies3_[ll] + << " : " << isoTk.hitEnergies3Raw_[ll] << " : " << isoTk.hitEnergies3Aux_[ll]; + ; + } + if (isoTk.p_ > pTrackMin_) + flag += 64; +#endif + if (isoTk.p_ > pTrackMin_) + accept = true; + if (accept) { + hocalib.emplace_back(isoTk); + nSave++; + int type(0); + if (isoTk.eMipDR_[0] < 1.0) { + if (isoTk.hmaxNearP_ < eIsolate2_) { + ++nLoose; + type = 1; + } + if (isoTk.hmaxNearP_ < eIsolate1_) { + ++nTight; + type = 2; + } + } + if (isoTk.p_ > 40.0 && isoTk.p_ <= 60.0 && isoTk.selectTk_) { + hocalibEvent.ietaGood_.emplace_back(isoTk.ieta_); + hocalibEvent.trackType_.emplace_back(type); + } +#ifdef EDM_ML_DEBUG + for (unsigned int k = 0; k < isoTk.trgbits_.size(); k++) { + edm::LogVerbatim("HcalIsoTrack") << "trigger bit is = " << isoTk.trgbits_[k]; + } +#endif + } + } + } +#ifdef EDM_ML_DEBUG + if (isoTk.eMipDR_.empty()) + edm::LogVerbatim("HcalIsoTrack") << "Track " << nTracks << " Selection Flag " << std::hex << flag << std::dec + << " Accept " << accept << " Momentum " << isoTk.p_ << ":" << pTrackMin_; + else + edm::LogVerbatim("HcalIsoTrack") << "Track " << nTracks << " Selection Flag " << std::hex << flag << std::dec + << " Accept " << accept << " Momentum " << isoTk.p_ << ":" << pTrackMin_ + << " Ecal Energy " << isoTk.eMipDR_[0] << ":" << eEcalMax_ + << " Charge Isolation " << isoTk.hmaxNearP_ << ":" << eIsolation; +#endif + } + std::array i3{{nSave, nLoose, nTight}}; + return i3; +} + +double AlCaHcalIsotrkProducer::dR(math::XYZTLorentzVector& vec1, math::XYZTLorentzVector& vec2) { + return reco::deltaR(vec1.eta(), vec1.phi(), vec2.eta(), vec2.phi()); +} + +double AlCaHcalIsotrkProducer::trackP(const reco::Track* pTrack, + const edm::Handle& genParticles) { + double pmom = -1.0; + if (genParticles.isValid()) { + double mindR(999.9); + for (const auto& p : (*genParticles)) { + double dR = reco::deltaR(pTrack->eta(), pTrack->phi(), p.momentum().Eta(), p.momentum().Phi()); + if (dR < mindR) { + mindR = dR; + pmom = p.momentum().R(); + } + } + } + return pmom; +} + +double AlCaHcalIsotrkProducer::rhoh(const edm::Handle& tower) { + std::vector sumPFNallSMDQH2; + sumPFNallSMDQH2.reserve(phibins_.size() * etabins_.size()); + for (auto eta : etabins_) { + for (auto phi : phibins_) { + double hadder = 0; + for (const auto& pf_it : (*tower)) { + if (fabs(eta - pf_it.eta()) > etahalfdist_) + continue; + if (fabs(reco::deltaPhi(phi, pf_it.phi())) > phihalfdist_) + continue; + hadder += pf_it.hadEt(); + } + sumPFNallSMDQH2.emplace_back(hadder); + } + } + + double evt_smdq(0); + std::sort(sumPFNallSMDQH2.begin(), sumPFNallSMDQH2.end()); + if (sumPFNallSMDQH2.size() % 2) + evt_smdq = sumPFNallSMDQH2[(sumPFNallSMDQH2.size() - 1) / 2]; + else + evt_smdq = (sumPFNallSMDQH2[sumPFNallSMDQH2.size() / 2] + sumPFNallSMDQH2[(sumPFNallSMDQH2.size() - 2) / 2]) / 2.; + double rhoh = evt_smdq / (etadist_ * phidist_); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("HcalIsoTrack") << "Rho " << evt_smdq << ":" << rhoh; +#endif + return rhoh; +} + +double AlCaHcalIsotrkProducer::eThreshold(const DetId& id, const CaloGeometry* geo) const { + const GlobalPoint& pos = geo->getPosition(id); + double eta = std::abs(pos.eta()); + double eThr(hitEthrEB_); + if (id.subdetId() != EcalBarrel) { + eThr = (((eta * hitEthrEE3_ + hitEthrEE2_) * eta + hitEthrEE1_) * eta + hitEthrEE0_); + if (eThr < hitEthrEELo_) + eThr = hitEthrEELo_; + else if (eThr > hitEthrEEHi_) + eThr = hitEthrEEHi_; + } + return eThr; +} + +DetId AlCaHcalIsotrkProducer::newId(const DetId& id) { + HcalDetId hid(id); + if (hep17_ && ((hid.iphi() < 63) || (hid.iphi() > 66) || (hid.zside() < 0))) + return id; + for (unsigned int k = 0; k < oldID_.size(); ++k) { + if ((hid.subdetId() == oldDet_[k]) && (hid.ietaAbs() == oldEta_[k]) && (hid.depth() == oldDepth_[k])) { + return static_cast(HcalDetId(hid.subdet(), hid.ieta(), hid.iphi(), newDepth_[k])); + } + } + return id; +} + +void AlCaHcalIsotrkProducer::storeEnergy(const HcalRespCorrs* respCorrs, + const std::vector& ids, + std::vector& edet, + double& eHcal, + std::vector& detIds, + std::vector& hitEnergies) { + double ehcal(0); + if (unCorrect_) { + for (unsigned int k = 0; k < ids.size(); ++k) { + double corr = (respCorrs->getValues(ids[k]))->getValue(); + if (corr != 0) + edet[k] /= corr; + ehcal += edet[k]; + } + } else { + for (const auto& en : edet) + ehcal += en; + } + if ((std::abs(ehcal - eHcal) > 0.001) && (!unCorrect_)) + edm::LogWarning("HcalIsoTrack") << "Check inconsistent energies: " << eHcal << ":" << ehcal << " from " + << ids.size() << " cells"; + eHcal = hcalScale_ * ehcal; + + if (collapseDepth_) { + std::map hitMap; + for (unsigned int k = 0; k < ids.size(); ++k) { + HcalDetId id = hdc_->mergedDepthDetId(HcalDetId(ids[k])); + auto itr = hitMap.find(id); + if (itr == hitMap.end()) { + hitMap[id] = edet[k]; + } else { + (itr->second) += edet[k]; + } + } + detIds.reserve(hitMap.size()); + hitEnergies.reserve(hitMap.size()); + for (const auto& hit : hitMap) { + detIds.emplace_back(hit.first.rawId()); + hitEnergies.emplace_back(hit.second); + } + } else { + detIds.reserve(ids.size()); + hitEnergies.reserve(ids.size()); + for (unsigned int k = 0; k < ids.size(); ++k) { + detIds.emplace_back(ids[k].rawId()); + hitEnergies.emplace_back(edet[k]); + } + } +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("HcalIsoTrack") << "StoreEnergy1::Input to storeEnergy with " << ids.size() << " cells"; + for (unsigned int k = 0; k < ids.size(); ++k) + edm::LogVerbatim("HcalIsoTrack") << "Hit [" << k << "] " << HcalDetId(ids[k]) << " E " << edet[k]; + edm::LogVerbatim("HcalIsoTrack") << "StoreEnergy1::Output of storeEnergy with " << detIds.size() << " cells and Etot " + << eHcal; + for (unsigned int k = 0; k < detIds.size(); ++k) + edm::LogVerbatim("HcalIsoTrack") << "Hit [" << k << "] " << HcalDetId(detIds[k]) << " E " << hitEnergies[k]; +#endif +} + +std::pair AlCaHcalIsotrkProducer::storeEnergy(const HcalRespCorrs* respCorrs, + edm::Handle& hbhe, + const std::vector& ids, + std::vector& hitEnergy1, + std::vector& hitEnergy2) { + double ehcal1(0), ehcal2(0); + std::vector edet1, edet2; + for (unsigned int k = 0; k < ids.size(); ++k) { + double e1(0), e2(0); + for (auto itr = hbhe->begin(); itr != hbhe->end(); ++itr) { + if (itr->id() == ids[k]) { + e1 = itr->eraw(); + e2 = itr->eaux(); + break; + } + } + if (e1 < 1.e-10) + e1 = 0; + if (e2 < 1.e-10) + e2 = 0; + edet1.emplace_back(e1); + edet2.emplace_back(e2); + } + if (unCorrect_) { + for (unsigned int k = 0; k < ids.size(); ++k) { + double corr = (respCorrs->getValues(ids[k]))->getValue(); + if (corr != 0) { + edet1[k] /= corr; + edet2[k] /= corr; + } + } + } + for (unsigned int k = 0; k < ids.size(); ++k) { + ehcal1 += edet1[k]; + ehcal2 += edet2[k]; + } + ehcal1 *= hcalScale_; + ehcal2 *= hcalScale_; + + if (collapseDepth_) { + std::map > hitMap; + for (unsigned int k = 0; k < ids.size(); ++k) { + HcalDetId id = hdc_->mergedDepthDetId(HcalDetId(ids[k])); + auto itr = hitMap.find(id); + if (itr == hitMap.end()) { + hitMap[id] = std::make_pair(edet1[k], edet2[k]); + } else { + (itr->second).first += edet1[k]; + (itr->second).second += edet2[k]; + } + } + hitEnergy1.reserve(hitMap.size()); + hitEnergy2.reserve(hitMap.size()); + for (const auto& hit : hitMap) { + hitEnergy1.emplace_back(hit.second.first); + hitEnergy2.emplace_back(hit.second.second); + } + } else { + hitEnergy1.reserve(ids.size()); + hitEnergy2.reserve(ids.size()); + for (unsigned int k = 0; k < ids.size(); ++k) { + hitEnergy1.emplace_back(edet1[k]); + hitEnergy2.emplace_back(edet2[k]); + } + } +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("HcalIsoTrack") << "StoreEnergy2::Input to storeEnergy with " << ids.size() << " cells"; + edm::LogVerbatim("HcalIsoTrack") << "StoreEnergy2::Output of storeEnergy with " << hitEnergy1.size() + << " cells and Etot " << ehcal1 << ":" << ehcal2; + for (unsigned int k = 0; k < hitEnergy1.size(); ++k) + edm::LogVerbatim("HcalIsoTrack") << "Hit [" << k << "] " << hitEnergy1[k] << " : " << hitEnergy2[k]; +#endif + return std::make_pair(ehcal1, ehcal2); +} + +bool AlCaHcalIsotrkProducer::notaMuon(const reco::Track* pTrack0, const edm::Handle& muonh) { + bool flag(true); + for (reco::MuonCollection::const_iterator recMuon = muonh->begin(); recMuon != muonh->end(); ++recMuon) { + if (recMuon->innerTrack().isNonnull()) { + const reco::Track* pTrack = (recMuon->innerTrack()).get(); + bool mediumMuon = (((recMuon->isPFMuon()) && (recMuon->isGlobalMuon() || recMuon->isTrackerMuon())) && + (recMuon->innerTrack()->validFraction() > 0.49)); + if (mediumMuon) { + double chiGlobal = ((recMuon->globalTrack().isNonnull()) ? recMuon->globalTrack()->normalizedChi2() : 999); + bool goodGlob = (recMuon->isGlobalMuon() && chiGlobal < 3 && + recMuon->combinedQuality().chi2LocalPosition < 12 && recMuon->combinedQuality().trkKink < 20); + mediumMuon = muon::segmentCompatibility(*recMuon) > (goodGlob ? 0.303 : 0.451); + } + if (mediumMuon) { + double dR = reco::deltaR(pTrack->eta(), pTrack->phi(), pTrack0->eta(), pTrack0->phi()); + if (dR < 0.1) { + flag = false; + break; + } + } + } + } + return flag; +} + +#include "FWCore/Framework/interface/MakerMacros.h" + +DEFINE_FWK_MODULE(AlCaHcalIsotrkProducer); diff --git a/Calibration/HcalAlCaRecoProducers/src/AlCaHcalNoiseProducer.cc b/Calibration/HcalAlCaRecoProducers/plugins/AlCaHcalNoiseProducer.cc similarity index 78% rename from Calibration/HcalAlCaRecoProducers/src/AlCaHcalNoiseProducer.cc rename to Calibration/HcalAlCaRecoProducers/plugins/AlCaHcalNoiseProducer.cc index 294aa251650f3..3c2c29b1b82e0 100644 --- a/Calibration/HcalAlCaRecoProducers/src/AlCaHcalNoiseProducer.cc +++ b/Calibration/HcalAlCaRecoProducers/plugins/AlCaHcalNoiseProducer.cc @@ -8,19 +8,88 @@ Calibration/HcalIsolatedTrackReco/src/SubdetFEDSelector.cc */ -#include "Calibration/HcalAlCaRecoProducers/interface/AlCaHcalNoiseProducer.h" +// -*- C++ -*- + +// system include files +#include +#include +// user include files + +#include "FWCore/Framework/interface/Frameworkfwd.h" +#include "FWCore/Framework/interface/one/EDProducer.h" +#include "FWCore/Framework/interface/Event.h" +#include "FWCore/Framework/interface/MakerMacros.h" + +#include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/Framework/interface/Frameworkfwd.h" +#include "FWCore/Framework/interface/Event.h" +#include "FWCore/Framework/interface/MakerMacros.h" +#include "FWCore/Framework/interface/EventSetup.h" +#include "FWCore/MessageLogger/interface/MessageLogger.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" -#include "DataFormats/FEDRawData/interface/FEDRawData.h" -#include "DataFormats/FEDRawData/interface/FEDNumbering.h" +#include "DataFormats/Common/interface/Ref.h" +#include "DataFormats/CaloTowers/interface/CaloTowerCollection.h" +#include "DataFormats/DetId/interface/DetId.h" -#include "EventFilter/RawDataCollector/interface/RawDataFEDSelector.h" +#include "Geometry/Records/interface/IdealGeometryRecord.h" +#include "Geometry/CaloGeometry/interface/CaloGeometry.h" +#include "DataFormats/GeometryVector/interface/GlobalPoint.h" +#include "DataFormats/CaloTowers/interface/CaloTowerDetId.h" +#include "DataFormats/HcalRecHit/interface/HcalRecHitCollections.h" +#include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h" #include "DataFormats/CaloTowers/interface/CaloTower.h" +#include "DataFormats/CaloTowers/interface/CaloTowerCollection.h" +#include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h" #include "DataFormats/JetReco/interface/CaloJet.h" -#include "DataFormats/METReco/interface/CaloMET.h" +#include "DataFormats/JetReco/interface/CaloJetCollection.h" #include "DataFormats/Math/interface/deltaR.h" +#include "DataFormats/METReco/interface/CaloMET.h" +#include "DataFormats/METReco/interface/CaloMETCollection.h" -#include "FWCore/MessageLogger/interface/MessageLogger.h" +#include "DataFormats/FEDRawData/interface/FEDRawData.h" +#include "DataFormats/FEDRawData/interface/FEDNumbering.h" +#include "DataFormats/FEDRawData/interface/FEDRawDataCollection.h" + +#include "EventFilter/RawDataCollector/interface/RawDataFEDSelector.h" + +// +// class decleration +// + +class AlCaHcalNoiseProducer : public edm::one::EDProducer<> { +public: + explicit AlCaHcalNoiseProducer(const edm::ParameterSet&); + ~AlCaHcalNoiseProducer() override; + + void produce(edm::Event&, const edm::EventSetup&) override; + +private: + // ----------member data --------------------------- + + bool useMet_; + bool useJet_; + double MetCut_; + double JetMinE_; + double JetHCALminEnergyFraction_; + int nAnomalousEvents; + int nEvents; + + std::vector ecalLabels_; + + edm::EDGetTokenT tok_jets_; + edm::EDGetTokenT tok_met_; + edm::EDGetTokenT tok_tower_; + + edm::EDGetTokenT tok_hbhe_; + edm::EDGetTokenT tok_ho_; + edm::EDGetTokenT tok_hf_; + + edm::EDGetTokenT tok_ps_; + edm::EDGetTokenT tok_raw_; + std::vector > toks_ecal_; +}; AlCaHcalNoiseProducer::AlCaHcalNoiseProducer(const edm::ParameterSet& iConfig) { tok_jets_ = consumes(iConfig.getParameter("JetSource")); @@ -240,3 +309,7 @@ void AlCaHcalNoiseProducer::produce(edm::Event& iEvent, const edm::EventSetup& i iEvent.put(std::move(outputESColl), "PSEcalRecHitCollectionFHN"); iEvent.put(std::move(outputFEDs), "HcalFEDsFHN"); } + +#include "FWCore/Framework/interface/MakerMacros.h" + +DEFINE_FWK_MODULE(AlCaHcalNoiseProducer); diff --git a/Calibration/HcalAlCaRecoProducers/plugins/AlCaIsoTracksFilter.cc b/Calibration/HcalAlCaRecoProducers/plugins/AlCaIsoTracksFilter.cc index c3a8ea75e6c5f..c68147717d559 100644 --- a/Calibration/HcalAlCaRecoProducers/plugins/AlCaIsoTracksFilter.cc +++ b/Calibration/HcalAlCaRecoProducers/plugins/AlCaIsoTracksFilter.cc @@ -53,6 +53,7 @@ #include "RecoLocalCalo/EcalRecAlgos/interface/EcalSeverityLevelAlgo.h" #include "RecoLocalCalo/EcalRecAlgos/interface/EcalSeverityLevelAlgoRcd.h" +//#define EDM_ML_DEBUG // // class declaration // @@ -266,6 +267,9 @@ bool AlCaIsoTracksFilter::filter(edm::Event& iEvent, edm::EventSetup const& iSet } } } +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("HcalIsoTrack") << "AlCaIsoTracksFilter:: triggerSatisfied: " << triggerSatisfied; +#endif //Step2: Get geometry/B-field information if (triggerSatisfied) { @@ -315,6 +319,9 @@ bool AlCaIsoTracksFilter::filter(edm::Event& iEvent, edm::EventSetup const& iSet edm::LogWarning("HcalIsoTrack") << "Cannot access the collection " << labelHBHE_; foundCollections = false; } +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("HcalIsoTrack") << "AlCaIsoTracksFilter:: foundCollections: " << foundCollections; +#endif //Step3 propagate the tracks to calorimeter surface and find // candidates for isolated tracks @@ -324,14 +331,20 @@ bool AlCaIsoTracksFilter::filter(edm::Event& iEvent, edm::EventSetup const& iSet spr::propagateCALO(trkCollection, geo, bField, theTrackQuality_, trkCaloDirections, false); std::vector::const_iterator trkDetItr; +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("HcalIsoTrack") << "AlCaIsoTracksFilter:: Has " << trkCaloDirections.size() + << " propagated tracks from a total of " << trkCollection->size(); +#endif unsigned int nTracks(0), nselTracks(0), ntrin(0), ntrout(0), ntrH(0); for (trkDetItr = trkCaloDirections.begin(), nTracks = 0; trkDetItr != trkCaloDirections.end(); trkDetItr++, nTracks++) { const reco::Track* pTrack = &(*(trkDetItr->trkItr)); math::XYZTLorentzVector v4(pTrack->px(), pTrack->py(), pTrack->pz(), pTrack->p()); +#ifdef EDM_ML_DEBUG edm::LogVerbatim("HcalIsoTrack") << "This track : " << nTracks << " (pt|eta|phi|p) :" << pTrack->pt() << "|" - << pTrack->eta() << "|" << pTrack->phi() << "|" << pTrack->p(); - + << pTrack->eta() << "|" << pTrack->phi() << "|" << pTrack->p() << " OK HCAL " + << trkDetItr->okHCAL; +#endif //Selection of good track int ieta(0); if (trkDetItr->okHCAL) { @@ -339,23 +352,28 @@ bool AlCaIsoTracksFilter::filter(edm::Event& iEvent, edm::EventSetup const& iSet ieta = detId.ietaAbs(); } bool qltyFlag = spr::goodTrack(pTrack, leadPV, selectionParameter_, false); +#ifdef EDM_ML_DEBUG edm::LogVerbatim("HcalIsoTrack") << "qltyFlag|okECAL|okHCAL : " << qltyFlag << "|" << trkDetItr->okECAL << "|" << trkDetItr->okHCAL; +#endif if (qltyFlag && trkDetItr->okECAL && trkDetItr->okHCAL) { double t_p = pTrack->p(); nselTracks++; int nNearTRKs(0); std::vector eIds; std::vector eHit; - double eEcal = spr::eCone_ecal(geo, - barrelRecHitsHandle, - endcapRecHitsHandle, - trkDetItr->pointHCAL, - trkDetItr->pointECAL, - a_mipR_, - trkDetItr->directionECAL, - eIds, - eHit); +#ifdef EDM_ML_DEBUG + double eEcal = +#endif + spr::eCone_ecal(geo, + barrelRecHitsHandle, + endcapRecHitsHandle, + trkDetItr->pointHCAL, + trkDetItr->pointECAL, + a_mipR_, + trkDetItr->directionECAL, + eIds, + eHit); double eMipDR(0); for (unsigned int k = 0; k < eIds.size(); ++k) { const GlobalPoint& pos = geo->getPosition(eIds[k]); @@ -375,9 +393,11 @@ bool AlCaIsoTracksFilter::filter(edm::Event& iEvent, edm::EventSetup const& iSet double eIsolation = (maxRestrictionP_ * exp(slopeRestrictionP_ * ((double)(ieta)))); if (eIsolation < eIsolate_) eIsolation = eIsolate_; +#ifdef EDM_ML_DEBUG edm::LogVerbatim("HcalIsoTrack") << "This track : " << nTracks << " (pt|eta|phi|p) :" << pTrack->pt() << "|" << pTrack->eta() << "|" << pTrack->phi() << "|" << t_p << "e_MIP " << eMipDR << ":" << eEcal << " Chg Isolation " << hmaxNearP << ":" << eIsolation; +#endif if (t_p > pTrackMin_ && eMipDR < eEcalMax_ && hmaxNearP < eIsolation) { if (t_p > pTrackLow_ && t_p < pTrackHigh_) ntrin++; diff --git a/Calibration/HcalAlCaRecoProducers/src/AlCaIsoTracksProducer.cc b/Calibration/HcalAlCaRecoProducers/plugins/AlCaIsoTracksProducer.cc similarity index 99% rename from Calibration/HcalAlCaRecoProducers/src/AlCaIsoTracksProducer.cc rename to Calibration/HcalAlCaRecoProducers/plugins/AlCaIsoTracksProducer.cc index 1bf027d6c1cfc..c4ddcfe929362 100644 --- a/Calibration/HcalAlCaRecoProducers/src/AlCaIsoTracksProducer.cc +++ b/Calibration/HcalAlCaRecoProducers/plugins/AlCaIsoTracksProducer.cc @@ -71,6 +71,7 @@ #include "RecoLocalCalo/EcalRecAlgos/interface/EcalSeverityLevelAlgo.h" #include "RecoLocalCalo/EcalRecAlgos/interface/EcalSeverityLevelAlgoRcd.h" +//#define EDM_ML_DEBUG // // class declaration // diff --git a/Calibration/HcalAlCaRecoProducers/plugins/AlCaIsoTracksProducerFilter.cc b/Calibration/HcalAlCaRecoProducers/plugins/AlCaIsoTracksProducerFilter.cc index a0521f4d4f885..5d0bef19f4847 100644 --- a/Calibration/HcalAlCaRecoProducers/plugins/AlCaIsoTracksProducerFilter.cc +++ b/Calibration/HcalAlCaRecoProducers/plugins/AlCaIsoTracksProducerFilter.cc @@ -23,6 +23,7 @@ #include "DataFormats/Common/interface/TriggerResults.h" #include "HLTrigger/HLTcore/interface/HLTConfigProvider.h" +//#define EDM_ML_DEBUG // // class declaration // @@ -101,8 +102,10 @@ bool AlCaIsoTracksProducerFilter::filter(edm::Event& iEvent, edm::EventSetup con int hlt = triggerResults->accept(iHLT); for (unsigned int i = 0; i < trigNames_.size(); ++i) { if (triggerNames_[iHLT].find(trigNames_[i]) != std::string::npos) { +#ifdef EDM_ML_DEBUG edm::LogVerbatim("HcalIsoTrack") - << triggerNames_[iHLT] << " has got HLT flag " << hlt << ":" << triggerSatisfied << std::endl; + << triggerNames_[iHLT] << " has got HLT flag " << hlt << ":" << triggerSatisfied; +#endif if (hlt > 0) { triggerSatisfied = true; break; @@ -114,6 +117,9 @@ bool AlCaIsoTracksProducerFilter::filter(edm::Event& iEvent, edm::EventSetup con } } } +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("HcalIsoTrack") << "AlCaIsoTracksProducerFilter:: triggerSatisfied: " << triggerSatisfied; +#endif if (triggerSatisfied) ++nGood_; return triggerSatisfied; diff --git a/Calibration/HcalAlCaRecoProducers/plugins/BuildFile.xml b/Calibration/HcalAlCaRecoProducers/plugins/BuildFile.xml index 32d601e1f18a7..fff6c2671b4ce 100644 --- a/Calibration/HcalAlCaRecoProducers/plugins/BuildFile.xml +++ b/Calibration/HcalAlCaRecoProducers/plugins/BuildFile.xml @@ -1,10 +1,33 @@ + + + + + + + + + + + + + + + + + + - - + + + + + + + diff --git a/Calibration/HcalAlCaRecoProducers/src/ProducerAnalyzer.cc b/Calibration/HcalAlCaRecoProducers/plugins/ProducerAnalyzer.cc similarity index 76% rename from Calibration/HcalAlCaRecoProducers/src/ProducerAnalyzer.cc rename to Calibration/HcalAlCaRecoProducers/plugins/ProducerAnalyzer.cc index fadac8bf6beb7..a6d35c010e047 100644 --- a/Calibration/HcalAlCaRecoProducers/src/ProducerAnalyzer.cc +++ b/Calibration/HcalAlCaRecoProducers/plugins/ProducerAnalyzer.cc @@ -1,20 +1,87 @@ // system include files +#include +#include +#include // user include files -#include "Calibration/HcalAlCaRecoProducers/src/ProducerAnalyzer.h" #include "DataFormats/Provenance/interface/StableProvenance.h" #include "DataFormats/MuonReco/interface/Muon.h" -#include "TrackingTools/TransientTrack/interface/TransientTrack.h" -#include "FWCore/MessageLogger/interface/MessageLogger.h" -#include "Geometry/Records/interface/CaloGeometryRecord.h" -#include "Geometry/CaloGeometry/interface/CaloGeometry.h" -#include "Geometry/HcalTowerAlgo/interface/HcalGeometry.h" #include "DataFormats/GeometryVector/interface/GlobalPoint.h" #include "DataFormats/HcalCalibObjects/interface/HOCalibVariables.h" #include "DataFormats/TrackReco/interface/TrackExtra.h" #include "DataFormats/TrackReco/interface/TrackExtraFwd.h" +// collections +#include "DataFormats/HcalRecHit/interface/HcalRecHitCollections.h" +#include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h" +#include "DataFormats/JetReco/interface/CaloJetCollection.h" +#include "DataFormats/HcalCalibObjects/interface/HOCalibVariableCollection.h" +#include "DataFormats/EgammaReco/interface/SuperCluster.h" +#include "DataFormats/EgammaReco/interface/SuperClusterFwd.h" +#include "DataFormats/TrackReco/interface/Track.h" +#include "DataFormats/TrackReco/interface/TrackFwd.h" +#include "DataFormats/MuonReco/interface/MuonFwd.h" + +#include "FWCore/Framework/interface/Frameworkfwd.h" +#include "FWCore/Framework/interface/one/EDAnalyzer.h" +#include "FWCore/Framework/interface/Event.h" +#include "FWCore/Framework/interface/MakerMacros.h" +#include "FWCore/Framework/interface/EventSetup.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/MessageLogger/interface/MessageLogger.h" + +#include "Geometry/Records/interface/CaloGeometryRecord.h" +#include "Geometry/CaloGeometry/interface/CaloGeometry.h" +#include "Geometry/HcalTowerAlgo/interface/HcalGeometry.h" + #include "RecoTracker/TrackProducer/interface/TrackProducerBase.h" +#include "TrackingTools/TransientTrack/interface/TransientTrack.h" + +namespace cms { + + // + // class declaration + // + + class ProducerAnalyzer : public edm::one::EDAnalyzer<> { + public: + explicit ProducerAnalyzer(const edm::ParameterSet&); + ~ProducerAnalyzer() override; + + void analyze(const edm::Event&, const edm::EventSetup&) override; + void beginJob() override {} + void endJob() override {} + + private: + // ----------member data --------------------------- + std::string nameProd_; + std::string jetCalo_; + std::string gammaClus_; + std::string ecalInput_; + std::string hbheInput_; + std::string hoInput_; + std::string hfInput_; + std::string tracks_; + + edm::EDGetTokenT tok_hovar_; + edm::EDGetTokenT tok_horeco_; + edm::EDGetTokenT tok_ho_; + edm::EDGetTokenT tok_hoProd_; + + edm::EDGetTokenT tok_hf_; + + edm::EDGetTokenT tok_jets_; + edm::EDGetTokenT tok_gamma_; + edm::EDGetTokenT tok_muons_; + edm::EDGetTokenT tok_ecal_; + edm::EDGetTokenT tok_tracks_; + + edm::EDGetTokenT tok_hbhe_; + edm::EDGetTokenT tok_hbheProd_; + + edm::ESGetToken tok_geom_; + }; +} // end namespace cms using namespace reco; @@ -33,7 +100,7 @@ namespace cms { hbheInput_ = iConfig.getUntrackedParameter("hbheInput"); hoInput_ = iConfig.getUntrackedParameter("hoInput"); hfInput_ = iConfig.getUntrackedParameter("hfInput"); - Tracks_ = iConfig.getUntrackedParameter("Tracks", "GammaJetTracksCollection"); + tracks_ = iConfig.getUntrackedParameter("Tracks", "GammaJetTracksCollection"); tok_hovar_ = consumes(edm::InputTag(nameProd_, hoInput_)); tok_horeco_ = consumes(edm::InputTag("horeco")); @@ -46,7 +113,7 @@ namespace cms { tok_gamma_ = consumes(edm::InputTag(nameProd_, gammaClus_)); tok_muons_ = consumes(edm::InputTag(nameProd_, "SelectedMuons")); tok_ecal_ = consumes(edm::InputTag(nameProd_, ecalInput_)); - tok_tracks_ = consumes(edm::InputTag(nameProd_, Tracks_)); + tok_tracks_ = consumes(edm::InputTag(nameProd_, tracks_)); tok_hbheProd_ = consumes(edm::InputTag(nameProd_, hbheInput_)); tok_hbhe_ = consumes(edm::InputTag(hbheInput_)); @@ -59,10 +126,6 @@ namespace cms { // (e.g. close files, deallocate resources etc.) } - void ProducerAnalyzer::beginJob() {} - - void ProducerAnalyzer::endJob() {} - // // member functions // @@ -193,6 +256,10 @@ namespace cms { } } } - //define this as a plug-in - //DEFINE_FWK_MODULE(ProducerAnalyzer) } // namespace cms + +#include "FWCore/PluginManager/interface/ModuleDef.h" +#include "FWCore/Framework/interface/MakerMacros.h" + +using cms::ProducerAnalyzer; +DEFINE_FWK_MODULE(ProducerAnalyzer); diff --git a/Calibration/HcalAlCaRecoProducers/python/ALCARECOHcalCalHBHEMuonProducerFilter_Output_cff.py b/Calibration/HcalAlCaRecoProducers/python/ALCARECOHcalCalHBHEMuonProducerFilter_Output_cff.py new file mode 100644 index 0000000000000..d4181c3320a66 --- /dev/null +++ b/Calibration/HcalAlCaRecoProducers/python/ALCARECOHcalCalHBHEMuonProducerFilter_Output_cff.py @@ -0,0 +1,19 @@ +import FWCore.ParameterSet.Config as cms + +# output block for alcastream HCAL HBHEMuon +# output module +# module alcastreamHcalHBHEMuonOutput = PoolOutputModule +OutALCARECOHcalCalHBHEMuonProducerFilter_noDrop = cms.PSet( + # use this in case of filter available + SelectEvents = cms.untracked.PSet( + SelectEvents = cms.vstring('pathALCARECOHcalCalHBHEMuonProducerFilter') + ), + outputCommands = cms.untracked.vstring( + 'keep *_alcaHcalHBHEMuonProducer_hbheMuon_*', + ) +) + + +import copy +OutALCARECOHcalCalHBHEMuonProducerFilter=copy.deepcopy(OutALCARECOHcalCalHBHEMuonProducerFilter_noDrop) +OutALCARECOHcalCalHBHEMuonProducerFilter.outputCommands.insert(0, "drop *") diff --git a/Calibration/HcalAlCaRecoProducers/python/ALCARECOHcalCalHBHEMuonProducerFilter_cff.py b/Calibration/HcalAlCaRecoProducers/python/ALCARECOHcalCalHBHEMuonProducerFilter_cff.py new file mode 100644 index 0000000000000..c5b8687fd333c --- /dev/null +++ b/Calibration/HcalAlCaRecoProducers/python/ALCARECOHcalCalHBHEMuonProducerFilter_cff.py @@ -0,0 +1,14 @@ +import FWCore.ParameterSet.Config as cms + +#------------------------------------------------ +#AlCaReco filtering for HCAL isotrk: +#------------------------------------------------ + +from Calibration.HcalAlCaRecoProducers.alcaHcalHBHEMuonProducer_cfi import * +from Calibration.HcalAlCaRecoProducers.alcaHcalHBHEMuonFilter_cfi import * + +seqALCARECOHcalCalHBHEMuonProducerFilter = cms.Sequence(alcaHcalHBHEMuonProducer * alcaHcalHBHEMuonFilter) + + + + diff --git a/Calibration/HcalAlCaRecoProducers/python/ALCARECOHcalCalIsoTrkFilterNoHLT_cff.py b/Calibration/HcalAlCaRecoProducers/python/ALCARECOHcalCalIsoTrkFilterNoHLT_cff.py new file mode 100644 index 0000000000000..f6be9f9e68800 --- /dev/null +++ b/Calibration/HcalAlCaRecoProducers/python/ALCARECOHcalCalIsoTrkFilterNoHLT_cff.py @@ -0,0 +1,11 @@ +import FWCore.ParameterSet.Config as cms + +#------------------------------------------------ +#AlCaReco filtering for HCAL isotrk: +#------------------------------------------------ + +from Calibration.HcalAlCaRecoProducers.alcaIsoTracksFilter_cff import * + +seqALCARECOHcalCalIsoTrkFilterNoHLT = cms.Sequence(alcaIsoTracksFilter) + + diff --git a/Calibration/HcalAlCaRecoProducers/python/ALCARECOHcalCalIsoTrkProducerFilter_Output_cff.py b/Calibration/HcalAlCaRecoProducers/python/ALCARECOHcalCalIsoTrkProducerFilter_Output_cff.py new file mode 100644 index 0000000000000..bc8cc438bd64d --- /dev/null +++ b/Calibration/HcalAlCaRecoProducers/python/ALCARECOHcalCalIsoTrkProducerFilter_Output_cff.py @@ -0,0 +1,20 @@ +import FWCore.ParameterSet.Config as cms + +# output block for alcastream HCAL Isotrk +# output module +# module alcastreamHcalIsotrkOutput = PoolOutputModule +OutALCARECOHcalCalIsoTrkProducerFilter_noDrop = cms.PSet( + # use this in case of filter available + SelectEvents = cms.untracked.PSet( + SelectEvents = cms.vstring('pathALCARECOHcalCalIsoTrkProducerFilter') + ), + outputCommands = cms.untracked.vstring( + 'keep *_alcaHcalIsotrkProducer_HcalIsoTrack_*', + 'keep *_alcaHcalIsotrkProducer_HcalIsoTrackEvent_*', + ) +) + + +import copy +OutALCARECOHcalCalIsoTrkProducerFilter=copy.deepcopy(OutALCARECOHcalCalIsoTrkProducerFilter_noDrop) +OutALCARECOHcalCalIsoTrkProducerFilter.outputCommands.insert(0, "drop *") diff --git a/Calibration/HcalAlCaRecoProducers/python/ALCARECOHcalCalIsoTrkProducerFilter_cff.py b/Calibration/HcalAlCaRecoProducers/python/ALCARECOHcalCalIsoTrkProducerFilter_cff.py new file mode 100644 index 0000000000000..061621a1e4bae --- /dev/null +++ b/Calibration/HcalAlCaRecoProducers/python/ALCARECOHcalCalIsoTrkProducerFilter_cff.py @@ -0,0 +1,14 @@ +import FWCore.ParameterSet.Config as cms + +#------------------------------------------------ +#AlCaReco filtering for HCAL isotrk: +#------------------------------------------------ + +from Calibration.HcalAlCaRecoProducers.alcaHcalIsotrkProducer_cfi import * +from Calibration.HcalAlCaRecoProducers.alcaHcalIsotrkFilter_cfi import * + +seqALCARECOHcalCalIsoTrkProducerFilter = cms.Sequence(alcaHcalIsotrkProducer * alcaHcalIsotrkFilter) + + + + diff --git a/Calibration/HcalAlCaRecoProducers/src/AlCaEcalHcalReadoutsProducer.cc b/Calibration/HcalAlCaRecoProducers/src/AlCaEcalHcalReadoutsProducer.cc deleted file mode 100644 index f2792c3ee36d9..0000000000000 --- a/Calibration/HcalAlCaRecoProducers/src/AlCaEcalHcalReadoutsProducer.cc +++ /dev/null @@ -1,44 +0,0 @@ -#include "Calibration/HcalAlCaRecoProducers/interface/AlCaEcalHcalReadoutsProducer.h" -#include "FWCore/MessageLogger/interface/MessageLogger.h" - -AlCaEcalHcalReadoutsProducer::AlCaEcalHcalReadoutsProducer(const edm::ParameterSet& iConfig) { - tok_ho_ = consumes(iConfig.getParameter("hoInput")); - tok_hf_ = consumes(iConfig.getParameter("hfInput")); - tok_hbhe_ = consumes(iConfig.getParameter("hbheInput")); - - //register your products - put_hbhe_ = produces("HBHERecHitCollection"); - put_ho_ = produces("HORecHitCollection"); - put_hf_ = produces("HFRecHitCollection"); -} - -// ------------ method called to produce the data ------------ -void AlCaEcalHcalReadoutsProducer::produce(edm::StreamID, edm::Event& iEvent, const edm::EventSetup& iSetup) const { - using namespace edm; - using namespace std; - - edm::Handle hbhe; - edm::Handle ho; - edm::Handle hf; - - iEvent.getByToken(tok_hbhe_, hbhe); - if (!hbhe.isValid()) { - LogDebug("") << "AlCaEcalHcalReadoutProducer: Error! can't get hbhe product!" << std::endl; - return; - } - - iEvent.getByToken(tok_ho_, ho); - if (!ho.isValid()) { - LogDebug("") << "AlCaEcalHcalReadoutProducer: Error! can't get ho product!" << std::endl; - } - - iEvent.getByToken(tok_hf_, hf); - if (!hf.isValid()) { - LogDebug("") << "AlCaEcalHcalReadoutProducer: Error! can't get hf product!" << std::endl; - } - - //Put selected information in the event - iEvent.emplace(put_hbhe_, *hbhe); - iEvent.emplace(put_ho_, *ho); - iEvent.emplace(put_hf_, *hf); -} diff --git a/Calibration/HcalAlCaRecoProducers/src/ProducerAnalyzer.h b/Calibration/HcalAlCaRecoProducers/src/ProducerAnalyzer.h deleted file mode 100644 index 05cb0dfc7966a..0000000000000 --- a/Calibration/HcalAlCaRecoProducers/src/ProducerAnalyzer.h +++ /dev/null @@ -1,82 +0,0 @@ -#ifndef CalibrationHcalAlCaRecoProducersProducerAnalyzer_h -#define CalibrationHcalAlCaRecoProducersProducerAnalyzer_h - -// system include files -#include -#include -#include - -// user include files -#include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/EDAnalyzer.h" -#include "FWCore/Framework/interface/Event.h" -#include "FWCore/Framework/interface/MakerMacros.h" -#include "FWCore/Framework/interface/EventSetup.h" -#include "FWCore/ParameterSet/interface/ParameterSet.h" - -// collections -#include "DataFormats/HcalRecHit/interface/HcalRecHitCollections.h" -#include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h" -#include "DataFormats/JetReco/interface/CaloJetCollection.h" -#include "DataFormats/HcalCalibObjects/interface/HOCalibVariableCollection.h" -#include "DataFormats/EgammaReco/interface/SuperCluster.h" -#include "DataFormats/EgammaReco/interface/SuperClusterFwd.h" -#include "DataFormats/TrackReco/interface/Track.h" -#include "DataFormats/TrackReco/interface/TrackFwd.h" -#include "DataFormats/MuonReco/interface/MuonFwd.h" - -#include "Geometry/CaloGeometry/interface/CaloGeometry.h" -#include "Geometry/Records/interface/CaloGeometryRecord.h" - -namespace edm { - class ParameterSet; - class Event; - class EventSetup; -} // namespace edm - -namespace cms { - - // - // class declaration - // - - class ProducerAnalyzer : public edm::EDAnalyzer { - public: - explicit ProducerAnalyzer(const edm::ParameterSet&); - ~ProducerAnalyzer() override; - - void analyze(const edm::Event&, const edm::EventSetup&) override; - void beginJob() override; - void endJob() override; - - private: - // ----------member data --------------------------- - std::string nameProd_; - std::string jetCalo_; - std::string gammaClus_; - std::string ecalInput_; - std::string hbheInput_; - std::string hoInput_; - std::string hfInput_; - std::string Tracks_; - - edm::EDGetTokenT tok_hovar_; - edm::EDGetTokenT tok_horeco_; - edm::EDGetTokenT tok_ho_; - edm::EDGetTokenT tok_hoProd_; - - edm::EDGetTokenT tok_hf_; - - edm::EDGetTokenT tok_jets_; - edm::EDGetTokenT tok_gamma_; - edm::EDGetTokenT tok_muons_; - edm::EDGetTokenT tok_ecal_; - edm::EDGetTokenT tok_tracks_; - - edm::EDGetTokenT tok_hbhe_; - edm::EDGetTokenT tok_hbheProd_; - - edm::ESGetToken tok_geom_; - }; -} // end namespace cms -#endif diff --git a/Calibration/HcalAlCaRecoProducers/src/SealModule.cc b/Calibration/HcalAlCaRecoProducers/src/SealModule.cc deleted file mode 100644 index ced88749c125e..0000000000000 --- a/Calibration/HcalAlCaRecoProducers/src/SealModule.cc +++ /dev/null @@ -1,9 +0,0 @@ -#include "FWCore/PluginManager/interface/ModuleDef.h" -#include "FWCore/Framework/interface/MakerMacros.h" -#include "Calibration/HcalAlCaRecoProducers/interface/AlCaEcalHcalReadoutsProducer.h" -#include "Calibration/HcalAlCaRecoProducers/src/ProducerAnalyzer.h" - -using cms::ProducerAnalyzer; - -DEFINE_FWK_MODULE(AlCaEcalHcalReadoutsProducer); -DEFINE_FWK_MODULE(ProducerAnalyzer); diff --git a/Calibration/HcalAlCaRecoProducers/test/AlCaHBHEMuonFilterProducer_cfg.py b/Calibration/HcalAlCaRecoProducers/test/AlCaHBHEMuonFilterProducer_cfg.py index dc4b65bf402db..f9f9c9ac90439 100644 --- a/Calibration/HcalAlCaRecoProducers/test/AlCaHBHEMuonFilterProducer_cfg.py +++ b/Calibration/HcalAlCaRecoProducers/test/AlCaHBHEMuonFilterProducer_cfg.py @@ -1,6 +1,7 @@ import FWCore.ParameterSet.Config as cms -process = cms.Process("AlCaHBHEMuon") +from Configuration.Eras.Era_Run2_2018_cff import Run2_2018 +process = cms.Process("AlCaHBHEMuon",Run2_2018) process.load('Configuration.StandardSequences.Services_cff') process.load('FWCore.MessageService.MessageLogger_cfi') @@ -10,16 +11,21 @@ process.load('Configuration.StandardSequences.EndOfProcess_cff') process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') from Configuration.AlCa.autoCond import autoCond -process.GlobalTag.globaltag=autoCond['run2_mc'] +process.GlobalTag.globaltag=autoCond['run2_data'] process.load("RecoLocalCalo.EcalRecAlgos.EcalSeverityLevelESProducer_cfi") +if hasattr(process,'MessageLogger'): + process.MessageLogger.HBHEMuon=dict() + +process.maxEvents = cms.untracked.PSet( + input = cms.untracked.int32(-1) +) -process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(10) ) process.source = cms.Source("PoolSource", fileNames = cms.untracked.vstring( - 'file:/afs/cern.ch/user/a/amkalsi/public/RecoFileForAlcaProducer.root' -# 'root://xrootd.unl.edu//store/mc/Phys14DR/DYToMuMu_M-50_Tune4C_13TeV-pythia8/GEN-SIM-RECO/PU20bx25_tsg_castor_PHYS14_25_V1-v1/10000/184C1AC9-A775-E411-9196-002590200824.root' + 'file:/eos/cms/store/group/dpg_hcal/comm_hcal/AmanKaur/HLTPhysics/RawtoReco_HLTPhysics/210910_053130/0000/RECO_RAW2DIGI_L1Reco_RECO_ALCA_1.root', + 'file:/eos/cms/store/group/dpg_hcal/comm_hcal/AmanKaur/HLTPhysics/RawtoReco_HLTPhysics/210910_053130/0000/RECO_RAW2DIGI_L1Reco_RECO_ALCA_2.root', ) ) @@ -33,9 +39,11 @@ ), eventAutoFlushCompressedSize = cms.untracked.int32(5242880), outputCommands = process.OutALCARECOHcalCalHBHEMuonFilter.outputCommands, - fileName = cms.untracked.string('PoolOutput.root'), + fileName = cms.untracked.string('OutputHBHEMuon.root'), ) +process.AlcaHBHEMuonFilter.Triggers = [] + # Path and EndPath definitions process.endjob_step = cms.EndPath(process.endOfProcess) process.ALCARECOStreamHcalCalHBHEMuonOutPath = cms.EndPath(process.ALCARECOStreamHcalCalHBHEMuon) diff --git a/Calibration/HcalAlCaRecoProducers/test/AlCaHBHEMuonProducerFilter_cfg.py b/Calibration/HcalAlCaRecoProducers/test/AlCaHBHEMuonProducerFilter_cfg.py new file mode 100644 index 0000000000000..3e2ce47f39995 --- /dev/null +++ b/Calibration/HcalAlCaRecoProducers/test/AlCaHBHEMuonProducerFilter_cfg.py @@ -0,0 +1,52 @@ +import FWCore.ParameterSet.Config as cms + +from Configuration.Eras.Era_Run2_2018_cff import Run2_2018 +process = cms.Process("AlCaHBHEMuon",Run2_2018) + +process.load('Configuration.StandardSequences.Services_cff') +process.load('FWCore.MessageService.MessageLogger_cfi') +process.load("Configuration.StandardSequences.GeometryRecoDB_cff") +process.load("Configuration.StandardSequences.MagneticField_cff") +process.load('Configuration.StandardSequences.AlCaRecoStreams_cff') +process.load('Configuration.StandardSequences.EndOfProcess_cff') +process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') +from Configuration.AlCa.autoCond import autoCond +process.GlobalTag.globaltag=autoCond['run2_data'] + +process.load("RecoLocalCalo.EcalRecAlgos.EcalSeverityLevelESProducer_cfi") + +if hasattr(process,'MessageLogger'): + process.MessageLogger.HBHEMuon=dict() + +process.maxEvents = cms.untracked.PSet( + input = cms.untracked.int32(-1) +) + +process.source = cms.Source("PoolSource", + fileNames = cms.untracked.vstring( + 'file:/eos/cms/store/group/dpg_hcal/comm_hcal/AmanKaur/HLTPhysics/RawtoReco_HLTPhysics/210910_053130/0000/RECO_RAW2DIGI_L1Reco_RECO_ALCA_1.root', + 'file:/eos/cms/store/group/dpg_hcal/comm_hcal/AmanKaur/HLTPhysics/RawtoReco_HLTPhysics/210910_053130/0000/RECO_RAW2DIGI_L1Reco_RECO_ALCA_2.root', + ) +) + +process.ALCARECOStreamHcalCalHBHEMuon = cms.OutputModule("PoolOutputModule", + SelectEvents = cms.untracked.PSet( + SelectEvents = cms.vstring('pathALCARECOHcalCalHBHEMuonProducerFilter') + ), + dataset = cms.untracked.PSet( + dataTier = cms.untracked.string('ALCARECO'), + filterName = cms.untracked.string('ALCARECOHcalCalHBHEMuonProducerFilter') + ), + eventAutoFlushCompressedSize = cms.untracked.int32(5242880), + outputCommands = process.OutALCARECOHcalCalHBHEMuonProducerFilter.outputCommands, + fileName = cms.untracked.string('OutputBHEMuonProducerFilter.root'), + ) + +process.alcaHcalHBHEMuonProducer.triggers = [] + +# Path and EndPath definitions +process.endjob_step = cms.EndPath(process.endOfProcess) +process.ALCARECOStreamHcalCalHBHEMuonProducerFilterOutPath = cms.EndPath(process.ALCARECOStreamHcalCalHBHEMuon) + +# Schedule definition +process.schedule = cms.Schedule(process.pathALCARECOHcalCalHBHEMuonProducerFilter,process.endjob_step,process.ALCARECOStreamHcalCalHBHEMuonProducerFilterOutPath) diff --git a/Calibration/HcalAlCaRecoProducers/test/AlCaHcalIsoTrk_cfg.py b/Calibration/HcalAlCaRecoProducers/test/AlCaHcalIsoTrk_cfg.py new file mode 100644 index 0000000000000..519aaf83573c2 --- /dev/null +++ b/Calibration/HcalAlCaRecoProducers/test/AlCaHcalIsoTrk_cfg.py @@ -0,0 +1,65 @@ +import FWCore.ParameterSet.Config as cms + +from Configuration.Eras.Era_Run2_2018_cff import Run2_2018 +process = cms.Process("ALCAISOTRACK",Run2_2018) + +process.load('Configuration.StandardSequences.Services_cff') +process.load('FWCore.MessageService.MessageLogger_cfi') +process.load("Configuration.StandardSequences.GeometryRecoDB_cff") +process.load("Configuration.StandardSequences.MagneticField_cff") +process.load('Configuration.StandardSequences.AlCaRecoStreams_cff') +process.load('Configuration.StandardSequences.EndOfProcess_cff') +process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') +from Configuration.AlCa.autoCond import autoCond +process.GlobalTag.globaltag=autoCond['run2_mc'] +process.load("RecoLocalCalo.EcalRecAlgos.EcalSeverityLevelESProducer_cfi") + +if hasattr(process,'MessageLogger'): + process.MessageLogger.HcalIsoTrack=dict() + +process.options = cms.untracked.PSet( + wantSummary = cms.untracked.bool(True) +) + +process.maxEvents = cms.untracked.PSet( + input = cms.untracked.int32(-1) +) + +process.source = cms.Source("PoolSource", + fileNames = cms.untracked.vstring( + 'file:/afs/cern.ch/user/h/huwang/work/public/for_Sunanda/RECO_data.root', + ) +) + +process.load('RecoLocalCalo.CaloTowersCreator.calotowermaker_cfi') +process.towerMakerAll = process.calotowermaker.clone() +process.towerMakerAll.hbheInput = cms.InputTag("hbhereco") +process.towerMakerAll.hoInput = cms.InputTag("none") +process.towerMakerAll.hfInput = cms.InputTag("none") +process.towerMakerAll.ecalInputs = cms.VInputTag(cms.InputTag("ecalRecHit","EcalRecHitsEB"), cms.InputTag("ecalRecHit","EcalRecHitsEE")) +process.towerMakerAll.AllowMissingInputs = True + +process.ALCARECOStreamHcalCalIsoTrkProducerFilter = cms.OutputModule("PoolOutputModule", + SelectEvents = cms.untracked.PSet( + SelectEvents = cms.vstring('pathALCARECOHcalCalIsoTrkProducerFilter') + ), + dataset = cms.untracked.PSet( + dataTier = cms.untracked.string('ALCARECO'), + filterName = cms.untracked.string('ALCARECOHcalCalIsoTrkProducerFilter') + ), + eventAutoFlushCompressedSize = cms.untracked.int32(5242880), + outputCommands = process.OutALCARECOHcalCalIsoTrkProducerFilter.outputCommands, +# outputCommands = cms.untracked.vstring( +# 'keep *', +# ), + fileName = cms.untracked.string('newPoolOutput.root'), + ) + +process.alcaHcalIsotrkProducer.ignoreTriggers = True + +# Path and EndPath definitions +process.endjob_step = cms.EndPath(process.endOfProcess) +process.ALCARECOStreamHcalCalIsoTrkProducerFilterOutPath = cms.EndPath(process.ALCARECOStreamHcalCalIsoTrkProducerFilter) + +# Schedule definition +process.schedule = cms.Schedule(process.pathALCARECOHcalCalIsoTrkProducerFilter,process.endjob_step,process.ALCARECOStreamHcalCalIsoTrkProducerFilterOutPath) diff --git a/Calibration/HcalAlCaRecoProducers/test/AlCaIsoTrackFilterNoHLT_cfg.py b/Calibration/HcalAlCaRecoProducers/test/AlCaIsoTrackFilterNoHLT_cfg.py new file mode 100644 index 0000000000000..59b8090941980 --- /dev/null +++ b/Calibration/HcalAlCaRecoProducers/test/AlCaIsoTrackFilterNoHLT_cfg.py @@ -0,0 +1,93 @@ +import FWCore.ParameterSet.Config as cms + +from Configuration.Eras.Era_Run2_2018_cff import Run2_2018 + +process = cms.Process('RECO',Run2_2018) + +# import of standard configurations +process.load('Configuration.StandardSequences.Services_cff') +process.load('SimGeneral.HepPDTESSource.pythiapdt_cfi') +process.load('FWCore.MessageService.MessageLogger_cfi') +process.load('Configuration.EventContent.EventContent_cff') +process.load('SimGeneral.MixingModule.mixNoPU_cfi') +process.load('Configuration.StandardSequences.GeometryRecoDB_cff') +process.load('Configuration.StandardSequences.MagneticField_cff') +process.load('Configuration.StandardSequences.RawToDigi_cff') +process.load('Configuration.StandardSequences.Reconstruction_cff') +process.load('Configuration.StandardSequences.AlCaRecoStreams_cff') +process.load('Configuration.StandardSequences.EndOfProcess_cff') +process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') + +process.maxEvents = cms.untracked.PSet( + input = cms.untracked.int32(10) +) + +# Input source +process.source = cms.Source("PoolSource", + fileNames = cms.untracked.vstring( + 'file:/afs/cern.ch/user/h/huwang/work/public/for_Sunanda/UL_1TeV_pion_gun_RAW_0_0.root', +# "root://cmseos.fnal.gov//eos/uscms/store/user/lpcrutgers/huiwang/HCAL/UL_DoublePion_E-50_RAW_noPU-2020-12-25/UL_1TeV_pion_gun_RAW_0_0.root" + ), + #skipEvents = cms.untracked.uint32(516), + secondaryFileNames = cms.untracked.vstring() +) + +process.options = cms.untracked.PSet( + +) + +# Production Info +process.configurationMetadata = cms.untracked.PSet( + annotation = cms.untracked.string('reco_MC nevts:100'), + name = cms.untracked.string('Applications'), + version = cms.untracked.string('$Revision: 1.19 $') +) + +# Output definition +process.ALCARECOStreamHcalCalIsoTrkFilter = cms.OutputModule("PoolOutputModule", + SelectEvents = cms.untracked.PSet( + SelectEvents = cms.vstring('pathALCARECOHcalCalIsoTrkFilterNoHLT') + ), + dataset = cms.untracked.PSet( + dataTier = cms.untracked.string('ALCARECO'), + filterName = cms.untracked.string('ALCARECOHcalCalIsoTrkFilterNoHLT') + ), + eventAutoFlushCompressedSize = cms.untracked.int32(5242880), + outputCommands = process.OutALCARECOHcalCalIsoTrkFilter.outputCommands, + fileName = cms.untracked.string('PoolOutput.root'), +) + +# Additional output definition + +# Other statements +from Configuration.AlCa.GlobalTag import GlobalTag +process.GlobalTag = GlobalTag(process.GlobalTag, '106X_upgrade2018_realistic_v11_L1v1', '') + +# Path and EndPath definitions +process.raw2digi_step = cms.Path(process.RawToDigi) +process.reconstruction_step = cms.Path(process.reconstruction) +process.endjob_step = cms.EndPath(process.endOfProcess) +process.ALCARECOStreamHcalCalIsoTrkFilterOutPath = cms.EndPath(process.ALCARECOStreamHcalCalIsoTrkFilter) + +# Schedule definition +process.schedule = cms.Schedule(process.raw2digi_step,process.reconstruction_step,process.pathALCARECOHcalCalIsoTrkFilterNoHLT,process.endjob_step,process.ALCARECOStreamHcalCalIsoTrkFilterOutPath) + +from PhysicsTools.PatAlgos.tools.helpers import associatePatAlgosToolsTask +associatePatAlgosToolsTask(process) + +#Setup FWK for multithreaded +process.options.numberOfThreads=cms.untracked.uint32(1) +process.options.numberOfStreams=cms.untracked.uint32(0) +process.options.numberOfConcurrentLuminosityBlocks=cms.untracked.uint32(1) + + +# Customisation from command line + +#Have logErrorHarvester wait for the same EDProducers to finish as those providing data for the OutputModule +from FWCore.Modules.logErrorHarvester_cff import customiseLogErrorHarvesterUsingOutputCommands +process = customiseLogErrorHarvesterUsingOutputCommands(process) + +# Add early deletion of temporary data products to reduce peak memory need +from Configuration.StandardSequences.earlyDeleteSettings_cff import customiseEarlyDelete +process = customiseEarlyDelete(process) +# End adding early deletion diff --git a/Calibration/HcalAlCaRecoProducers/test/di_cfg.py b/Calibration/HcalAlCaRecoProducers/test/di_cfg.py index 0c1ad62b0fac9..4a65cc9b38ce3 100644 --- a/Calibration/HcalAlCaRecoProducers/test/di_cfg.py +++ b/Calibration/HcalAlCaRecoProducers/test/di_cfg.py @@ -3,7 +3,7 @@ process = cms.Process("DIJETS") -process.load("Configuration.StandardSequences.Geometry_cff") +process.load("Configuration.StandardSequences.GeometryDB_cff") process.load("Configuration.StandardSequences.MagneticField_cff") process.maxEvents = cms.untracked.PSet( diff --git a/Calibration/HcalAlCaRecoProducers/test/phi_sym_cfg.py b/Calibration/HcalAlCaRecoProducers/test/phi_sym_cfg.py index a27e15e08809c..e3df22946ff96 100644 --- a/Calibration/HcalAlCaRecoProducers/test/phi_sym_cfg.py +++ b/Calibration/HcalAlCaRecoProducers/test/phi_sym_cfg.py @@ -3,7 +3,7 @@ process = cms.Process("PHISYM") -process.load("Configuration.StandardSequences.Geometry_cff") +process.load("Configuration.StandardSequences.GeometryDB_cff") process.load("Configuration.StandardSequences.MagneticField_cff") process.maxEvents = cms.untracked.PSet( diff --git a/Calibration/HcalCalibAlgos/src/TCell.h b/Calibration/HcalCalibAlgos/interface/TCell.h similarity index 100% rename from Calibration/HcalCalibAlgos/src/TCell.h rename to Calibration/HcalCalibAlgos/interface/TCell.h diff --git a/Calibration/HcalCalibAlgos/interface/hcalCalib.h b/Calibration/HcalCalibAlgos/interface/hcalCalib.h index c2311f816ac9f..c59db703b3ed9 100644 --- a/Calibration/HcalCalibAlgos/interface/hcalCalib.h +++ b/Calibration/HcalCalibAlgos/interface/hcalCalib.h @@ -27,9 +27,17 @@ #include #include -#include "TLorentzVector.h" -#include "TClonesArray.h" -#include "TRefArray.h" +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include // needed to get cell coordinates #include "Geometry/CaloGeometry/interface/CaloGeometry.h" @@ -84,6 +92,32 @@ class hcalCalib : public TSelector { TBranch *b_tagJetP4; //! TBranch *b_probeJetP4; //! + UInt_t nEvents; + + TFile *histoFile; + + // sanity check histograms + TH1F *h1_trkP; + TH1F *h1_allTrkP; + + TH1F *h1_selTrkP_iEta10; + + TH1F *h1_rawSumE; + TH1F *h1_rawResp; + TH1F *h1_corResp; + TH1F *h1_rawRespBarrel; + TH1F *h1_corRespBarrel; + TH1F *h1_rawRespEndcap; + TH1F *h1_corRespEndcap; + TH1F *h1_numEventsTwrIEta; + + TH2F *h2_dHitRefBarrel; + TH2F *h2_dHitRefEndcap; + + // histograms based on iEta, iPhi of refPosition forthe cluster (at the moment: hottest tower) + // expect range |iEta|<=24 (to do: add flexibility for arbitrary range) + TH1F *h1_corRespIEta[48]; + hcalCalib(TTree * /*tree*/ = nullptr) {} ~hcalCalib() override {} Int_t Version() const override { return 2; } @@ -204,60 +238,3 @@ class hcalCalib : public TSelector { }; #endif - -#ifdef hcalCalib_cxx -inline void hcalCalib::Init(TTree *tree) { - // The Init() function is called when the selector needs to initialize - // a new tree or chain. Typically here the branch addresses and branch - // pointers of the tree will be set. - // It is normaly not necessary to make changes to the generated - // code, but the routine can be extended by the user if needed. - // Init() will be called many times when running on PROOF - // (once per file to be processed). - - // Set object pointer - cells = nullptr; - tagJetP4 = nullptr; - probeJetP4 = nullptr; - - // Set branch addresses and branch pointers - if (!tree) - return; - fChain = tree; - - // fChain->SetMakeClass(1); - - fChain->SetBranchAddress("eventNumber", &eventNumber, &b_eventNumber); - fChain->SetBranchAddress("runNumber", &runNumber, &b_runNumber); - fChain->SetBranchAddress("iEtaHit", &iEtaHit, &b_iEtaHit); - fChain->SetBranchAddress("iPhiHit", &iPhiHit, &b_iPhiHit); - fChain->SetBranchAddress("cells", &cells, &b_cells); - fChain->SetBranchAddress("emEnergy", &emEnergy, &b_emEnergy); - fChain->SetBranchAddress("targetE", &targetE, &b_targetE); - fChain->SetBranchAddress("etVetoJet", &etVetoJet, &b_etVetoJet); - - fChain->SetBranchAddress("xTrkHcal", &xTrkHcal, &b_xTrkHcal); - fChain->SetBranchAddress("yTrkHcal", &yTrkHcal, &b_yTrkHcal); - fChain->SetBranchAddress("zTrkHcal", &zTrkHcal, &b_zTrkHcal); - fChain->SetBranchAddress("xTrkEcal", &xTrkEcal, &b_xTrkEcal); - fChain->SetBranchAddress("yTrkEcal", &yTrkEcal, &b_yTrkEcal); - fChain->SetBranchAddress("zTrkEcal", &zTrkEcal, &b_zTrkEcal); - - fChain->SetBranchAddress("tagJetEmFrac", &tagJetEmFrac, &b_tagJetEmFrac); - fChain->SetBranchAddress("probeJetEmFrac", &probeJetEmFrac, &b_probeJetEmFrac); - - fChain->SetBranchAddress("tagJetP4", &tagJetP4, &b_tagJetP4); - fChain->SetBranchAddress("probeJetP4", &probeJetP4, &b_probeJetP4); -} - -inline Bool_t hcalCalib::Notify() { - // The Notify() function is called when a new file is opened. This - // can be either for a new TTree in a TChain or when when a new TTree - // is started when using PROOF. It is normaly not necessary to make changes - // to the generated code, but the routine can be extended by the - // user if needed. The return value is currently not used. - - return kTRUE; -} - -#endif // #ifdef hcalCalib_cxx diff --git a/Calibration/HcalCalibAlgos/interface/hcalCalibUtils.h b/Calibration/HcalCalibAlgos/interface/hcalCalibUtils.h index 088d7ea7e5d1c..106a843b0753e 100644 --- a/Calibration/HcalCalibAlgos/interface/hcalCalibUtils.h +++ b/Calibration/HcalCalibAlgos/interface/hcalCalibUtils.h @@ -8,7 +8,7 @@ #include "DataFormats/DetId/interface/DetId.h" #include "DataFormats/HcalDetId/interface/HcalDetId.h" -#include "Calibration/HcalCalibAlgos/src/TCell.h" +#include "Calibration/HcalCalibAlgos/interface/TCell.h" #include "DataFormats/GeometryVector/interface/GlobalPoint.h" #include "DataFormats/GeometryVector/interface/GlobalVector.h" diff --git a/Calibration/HcalCalibAlgos/macros/CalibMonitor.C b/Calibration/HcalCalibAlgos/macros/CalibMonitor.C index 7b232b9ef9d83..4f02bdee4df30 100644 --- a/Calibration/HcalCalibAlgos/macros/CalibMonitor.C +++ b/Calibration/HcalCalibAlgos/macros/CalibMonitor.C @@ -1248,7 +1248,7 @@ void CalibMonitor::Loop() { fileout_.close(); std::cout << "Writes " << good << " events in the file " << outFileName_ << std::endl; } - std::cout << "Finds " << duplicate << " Duplicate events out of " << kount << " evnts in this file with p>10 Gev" + std::cout << "Finds " << duplicate << " Duplicate events out of " << kount << " events in this file with p>10 Gev" << std::endl; std::cout << "Number of selected events:" << std::endl; for (unsigned int k = 1; k < ps_.size(); ++k) diff --git a/Calibration/HcalCalibAlgos/macros/HBHEMuonOfflineAnalyzer.C b/Calibration/HcalCalibAlgos/macros/HBHEMuonOfflineAnalyzer.C index 5f46b5b9e68a4..f90c379bea2e0 100644 --- a/Calibration/HcalCalibAlgos/macros/HBHEMuonOfflineAnalyzer.C +++ b/Calibration/HcalCalibAlgos/macros/HBHEMuonOfflineAnalyzer.C @@ -63,132 +63,132 @@ public: UInt_t LumiNumber; UInt_t BXNumber; UInt_t GoodVertex; - std::vector *PF_Muon; - std::vector *Global_Muon; - std::vector *Tracker_muon; - std::vector *MuonIsTight; - std::vector *MuonIsMedium; - std::vector *pt_of_muon; - std::vector *eta_of_muon; - std::vector *phi_of_muon; - std::vector *energy_of_muon; - std::vector *p_of_muon; - std::vector *muon_trkKink; - std::vector *muon_chi2LocalPosition; - std::vector *muon_segComp; - std::vector *TrackerLayer; - std::vector *NumPixelLayers; - std::vector *InnerTrackPixelHits; - std::vector *innerTrack; - std::vector *chiTracker; - std::vector *DxyTracker; - std::vector *DzTracker; - std::vector *innerTrackpt; - std::vector *innerTracketa; - std::vector *innerTrackphi; - std::vector *tight_validFraction; - std::vector *OuterTrack; - std::vector *OuterTrackPt; - std::vector *OuterTrackEta; - std::vector *OuterTrackPhi; - std::vector *OuterTrackChi; - std::vector *OuterTrackHits; - std::vector *OuterTrackRHits; - std::vector *GlobalTrack; - std::vector *GlobalTrckPt; - std::vector *GlobalTrckEta; - std::vector *GlobalTrckPhi; - std::vector *Global_Muon_Hits; - std::vector *MatchedStations; - std::vector *GlobTrack_Chi; - std::vector *Tight_LongitudinalImpactparameter; - std::vector *Tight_TransImpactparameter; - std::vector *IsolationR04; - std::vector *IsolationR03; - std::vector *ecal_3into3; - std::vector *hcal_3into3; - std::vector *tracker_3into3; - std::vector *matchedId; - std::vector *hcal_cellHot; - std::vector *ecal_3x3; - std::vector *hcal_1x1; - std::vector *ecal_detID; - std::vector *hcal_detID; - std::vector *ehcal_detID; - std::vector *hcal_ieta; - std::vector *hcal_iphi; - std::vector *hcal_edepth1; - std::vector *hcal_activeL1; - std::vector *hcal_edepthHot1; - std::vector *hcal_activeHotL1; - std::vector *hcal_edepthCorrect1; - std::vector *hcal_edepthHotCorrect1; - std::vector *hcal_cdepthHot1; - std::vector *hcal_cdepthHotBG1; - std::vector *hcal_depthMatch1; - std::vector *hcal_depthMatchHot1; - std::vector *hcal_edepth2; - std::vector *hcal_activeL2; - std::vector *hcal_edepthHot2; - std::vector *hcal_activeHotL2; - std::vector *hcal_edepthCorrect2; - std::vector *hcal_edepthHotCorrect2; - std::vector *hcal_cdepthHot2; - std::vector *hcal_cdepthHotBG2; - std::vector *hcal_depthMatch2; - std::vector *hcal_depthMatchHot2; - std::vector *hcal_edepth3; - std::vector *hcal_activeL3; - std::vector *hcal_edepthHot3; - std::vector *hcal_activeHotL3; - std::vector *hcal_edepthCorrect3; - std::vector *hcal_edepthHotCorrect3; - std::vector *hcal_cdepthHot3; - std::vector *hcal_cdepthHotBG3; - std::vector *hcal_depthMatch3; - std::vector *hcal_depthMatchHot3; - std::vector *hcal_edepth4; - std::vector *hcal_activeL4; - std::vector *hcal_edepthHot4; - std::vector *hcal_activeHotL4; - std::vector *hcal_edepthCorrect4; - std::vector *hcal_edepthHotCorrect4; - std::vector *hcal_cdepthHot4; - std::vector *hcal_cdepthHotBG4; - std::vector *hcal_depthMatch4; - std::vector *hcal_depthMatchHot4; - std::vector *hcal_edepth5; - std::vector *hcal_activeL5; - std::vector *hcal_edepthHot5; - std::vector *hcal_activeHotL5; - std::vector *hcal_edepthCorrect5; - std::vector *hcal_edepthHotCorrect5; - std::vector *hcal_cdepthHot5; - std::vector *hcal_cdepthHotBG5; - std::vector *hcal_depthMatch5; - std::vector *hcal_depthMatchHot5; - std::vector *hcal_edepth6; - std::vector *hcal_activeL6; - std::vector *hcal_edepthHot6; - std::vector *hcal_activeHotL6; - std::vector *hcal_edepthCorrect6; - std::vector *hcal_edepthHotCorrect6; - std::vector *hcal_cdepthHot6; - std::vector *hcal_cdepthHotBG6; - std::vector *hcal_depthMatch6; - std::vector *hcal_depthMatchHot6; - std::vector *hcal_edepth7; - std::vector *hcal_activeL7; - std::vector *hcal_edepthHot7; - std::vector *hcal_activeHotL7; - std::vector *hcal_edepthCorrect7; - std::vector *hcal_edepthHotCorrect7; - std::vector *hcal_cdepthHot7; - std::vector *hcal_cdepthHotBG7; - std::vector *hcal_depthMatch7; - std::vector *hcal_depthMatchHot7; - std::vector *activeLength; - std::vector *activeLengthHot; + bool PF_Muon; + bool Global_Muon; + bool Tracker_muon; + bool MuonIsTight; + bool MuonIsMedium; + double pt_of_muon; + double eta_of_muon; + double phi_of_muon; + double energy_of_muon; + double p_of_muon; + float muon_trkKink; + float muon_chi2LocalPosition; + float muon_segComp; + int TrackerLayer; + int NumPixelLayers; + int InnerTrackPixelHits; + bool innerTrack; + double chiTracker; + double DxyTracker; + double DzTracker; + double innerTrackpt; + double innerTracketa; + double innerTrackphi; + double tight_validFraction; + bool OuterTrack; + double OuterTrackPt; + double OuterTrackEta; + double OuterTrackPhi; + double OuterTrackChi; + int OuterTrackHits; + int OuterTrackRHits; + bool GlobalTrack; + double GlobalTrckPt; + double GlobalTrckEta; + double GlobalTrckPhi; + int Global_Muon_Hits; + int MatchedStations; + double GlobTrack_Chi; + double Tight_LongitudinalImpactparameter; + double Tight_TransImpactparameter; + double IsolationR04; + double IsolationR03; + double ecal_3into3; + double hcal_3into3; + double tracker_3into3; + bool matchedId; + bool hcal_cellHot; + double ecal_3x3; + double hcal_1x1; + unsigned int ecal_detID; + unsigned int hcal_detID; + unsigned int ehcal_detID; + int hcal_ieta; + int hcal_iphi; + double hcal_edepth1; + double hcal_activeL1; + double hcal_edepthHot1; + double hcal_activeHotL1; + double hcal_edepthCorrect1; + double hcal_edepthHotCorrect1; + double hcal_cdepthHot1; + double hcal_cdepthHotBG1; + bool hcal_depthMatch1; + bool hcal_depthMatchHot1; + double hcal_edepth2; + double hcal_activeL2; + double hcal_edepthHot2; + double hcal_activeHotL2; + double hcal_edepthCorrect2; + double hcal_edepthHotCorrect2; + double hcal_cdepthHot2; + double hcal_cdepthHotBG2; + bool hcal_depthMatch2; + bool hcal_depthMatchHot2; + double hcal_edepth3; + double hcal_activeL3; + double hcal_edepthHot3; + double hcal_activeHotL3; + double hcal_edepthCorrect3; + double hcal_edepthHotCorrect3; + double hcal_cdepthHot3; + double hcal_cdepthHotBG3; + bool hcal_depthMatch3; + bool hcal_depthMatchHot3; + double hcal_edepth4; + double hcal_activeL4; + double hcal_edepthHot4; + double hcal_activeHotL4; + double hcal_edepthCorrect4; + double hcal_edepthHotCorrect4; + double hcal_cdepthHot4; + double hcal_cdepthHotBG4; + bool hcal_depthMatch4; + bool hcal_depthMatchHot4; + double hcal_edepth5; + double hcal_activeL5; + double hcal_edepthHot5; + double hcal_activeHotL5; + double hcal_edepthCorrect5; + double hcal_edepthHotCorrect5; + double hcal_cdepthHot5; + double hcal_cdepthHotBG5; + bool hcal_depthMatch5; + bool hcal_depthMatchHot5; + double hcal_edepth6; + double hcal_activeL6; + double hcal_edepthHot6; + double hcal_activeHotL6; + double hcal_edepthCorrect6; + double hcal_edepthHotCorrect6; + double hcal_cdepthHot6; + double hcal_cdepthHotBG6; + bool hcal_depthMatch6; + bool hcal_depthMatchHot6; + double hcal_edepth7; + double hcal_activeL7; + double hcal_edepthHot7; + double hcal_activeHotL7; + double hcal_edepthCorrect7; + double hcal_edepthHotCorrect7; + double hcal_cdepthHot7; + double hcal_cdepthHotBG7; + bool hcal_depthMatch7; + bool hcal_depthMatchHot7; + double activeLength; + double activeLengthHot; std::vector *hltresults; std::vector *all_triggers; @@ -375,20 +375,12 @@ public: bool fillChain(TChain *chain, const char *inputFileList); bool readCorr(const char *rcorFileName); void bookHistograms(const char *); - bool getEnergy(unsigned int ml, - int dep, - double &enb, - double &enu, - double &enh, - double &enc, - double &chgS, - double &chgB, - double &actL); + bool getEnergy(int dep, double &enb, double &enu, double &enh, double &enc, double &chgS, double &chgB, double &actL); void writeHistograms(); - bool looseMuon(unsigned int ml); - bool tightMuon(unsigned int ml); - bool softMuon(unsigned int ml); - bool mediumMuon2016(unsigned int ml); + bool looseMuon(); + bool tightMuon(); + bool softMuon(); + bool mediumMuon2016(); void etaPhiHcal(unsigned int detId, int &eta, int &phi, int &depth); void etaPhiEcal(unsigned int detId, int &type, int &zside, int &etaX, int &phiY, int &plane, int &strip); void calculateP(double pt, double eta, double &pM); @@ -862,224 +854,220 @@ void HBHEMuonOfflineAnalyzer::Loop() { if ((int)(Run_No) < runLo_ || (int)(Run_No) > runHi_) continue; if (debug_) - std::cout << "Run " << Run_No << " Event " << Event_No << " Muons " << pt_of_muon->size() << std::endl; + std::cout << "Run " << Run_No << " Event " << Event_No << " Muon pt " << pt_of_muon << std::endl; bool loose(false), soft(false), tight(false), pcut(false), ptcut(false); - for (unsigned int ml = 0; ml < pt_of_muon->size(); ml++) { - t_ene.clear(); - t_enec.clear(); - t_charge.clear(); - t_actln.clear(); - t_depth.clear(); + t_ene.clear(); + t_enec.clear(); + t_charge.clear(); + t_actln.clear(); + t_depth.clear(); - if (debug_) - std::cout << "ecal_det_id " << ecal_detID->at(ml) << std::endl; + if (debug_) + std::cout << "ecal_det_id " << ecal_detID << std::endl; - int typeEcal, etaXEcal, phiYEcal, zsideEcal, planeEcal, stripEcal; - etaPhiEcal(ecal_detID->at(ml), typeEcal, zsideEcal, etaXEcal, phiYEcal, planeEcal, stripEcal); - double etaEcal = (etaXEcal - 0.5) * zsideEcal; - double phiEcal = phiYEcal - 0.5; + int typeEcal, etaXEcal, phiYEcal, zsideEcal, planeEcal, stripEcal; + etaPhiEcal(ecal_detID, typeEcal, zsideEcal, etaXEcal, phiYEcal, planeEcal, stripEcal); + double etaEcal = (etaXEcal - 0.5) * zsideEcal; + double phiEcal = phiYEcal - 0.5; - if (debug_) - std::cout << "hcal_det_id " << std::hex << hcal_detID->at(ml) << std::dec; - - int etaHcal, phiHcal, depthHcal; - etaPhiHcal(hcal_detID->at(ml), etaHcal, phiHcal, depthHcal); - - int eta = (etaHcal > 0) ? etaHcal - 1 : -(1 + etaHcal); - double etaXHcal = (etaHcal > 0) ? etaHcal - 0.5 : etaHcal + 0.5; - int nDepth = nDepthBins(eta + 1, phiHcal); - int nPhi = nPhiBins(eta + 1); - int PHI = (nPhi > 36) ? (phiHcal - 1) : (phiHcal - 1) / 2; - double phiYHcal = (phiHcal - 0.5); - t_ieta = etaHcal; - t_iphi = PHI; - t_p = p_of_muon->at(ml); - t_ediff = hcal_3into3->at(ml) - hcal_1x1->at(ml); - t_nvtx = GoodVertex; - if (p_of_muon->at(ml) > 20) - pcut = true; - if (pt_of_muon->at(ml) > 20) - ptcut = true; - if (looseMuon(ml)) - loose = true; - if (softMuon(ml)) - soft = true; - if (tightMuon(ml)) - tight = true; + if (debug_) + std::cout << "hcal_det_id " << std::hex << hcal_detID << std::dec; + + int etaHcal, phiHcal, depthHcal; + etaPhiHcal(hcal_detID, etaHcal, phiHcal, depthHcal); + + int eta = (etaHcal > 0) ? etaHcal - 1 : -(1 + etaHcal); + double etaXHcal = (etaHcal > 0) ? etaHcal - 0.5 : etaHcal + 0.5; + int nDepth = nDepthBins(eta + 1, phiHcal); + int nPhi = nPhiBins(eta + 1); + int PHI = (nPhi > 36) ? (phiHcal - 1) : (phiHcal - 1) / 2; + double phiYHcal = (phiHcal - 0.5); + t_ieta = etaHcal; + t_iphi = PHI; + t_p = p_of_muon; + t_ediff = hcal_3into3 - hcal_1x1; + t_nvtx = GoodVertex; + if (p_of_muon > 20) + pcut = true; + if (pt_of_muon > 20) + ptcut = true; + if (looseMuon()) + loose = true; + if (softMuon()) + soft = true; + if (tightMuon()) + tight = true; - if (debug_) - std::cout << " etaHcal " << etaHcal << ":" << etaXHcal << " phiHcal " << phiHcal << ":" << phiYHcal << ":" - << PHI << " Depth " << nDepth << " Muon Pt " << pt_of_muon->at(ml) << " Isol " << IsolationR04->at(ml) - << std::endl; - - for (int cut = 0; cut < nCut_; ++cut) { - bool select(false); - if (cut == 0) - select = tightMuon(ml); - else if (cut == 1) - select = softMuon(ml); - else - select = looseMuon(ml); - - if (select && ((eta + 1) >= etaMin_) && ((eta + 1) <= etaMax_)) { - // h_P_Muon[cut]->Fill(p_of_muon->at(ml)); - h_Pt_Muon[cut]->Fill(pt_of_muon->at(ml)); - h_Eta_Muon[cut]->Fill(eta_of_muon->at(ml)); - h_Phi_Muon[cut]->Fill(phi_of_muon->at(ml)); - h_PF_Muon[cut]->Fill(PF_Muon->at(ml)); - h_GlobTrack_Chi[cut]->Fill(GlobTrack_Chi->at(ml)); - h_Global_Muon_Hits[cut]->Fill(Global_Muon_Hits->at(ml)); - h_MatchedStations[cut]->Fill(MatchedStations->at(ml)); - h_Tight_TransImpactparameter[cut]->Fill(Tight_TransImpactparameter->at(ml)); - h_Tight_LongitudinalImpactparameter[cut]->Fill(Tight_LongitudinalImpactparameter->at(ml)); - h_InnerTrackPixelHits[cut]->Fill(InnerTrackPixelHits->at(ml)); - h_TrackerLayer[cut]->Fill(TrackerLayer->at(ml)); - h_IsolationR04[cut]->Fill(IsolationR04->at(ml)); - h_Global_Muon[cut]->Fill(Global_Muon->at(ml)); - - h_TransImpactParameter[cut]->Fill(Tight_TransImpactparameter->at(ml)); - h_LongImpactParameter[cut]->Fill(Tight_LongitudinalImpactparameter->at(ml)); - - //in Phi Bins - if (((phi_of_muon->at(ml)) >= -1.5) || ((phi_of_muon->at(ml)) <= 0.5)) { - h_TransImpactParameterBin1[cut]->Fill(Tight_TransImpactparameter->at(ml)); - h_LongImpactParameterBin1[cut]->Fill(Tight_LongitudinalImpactparameter->at(ml)); - h_2D_Bin1[cut]->Fill(Tight_TransImpactparameter->at(ml), Tight_LongitudinalImpactparameter->at(ml)); - } + if (debug_) + std::cout << " etaHcal " << etaHcal << ":" << etaXHcal << " phiHcal " << phiHcal << ":" << phiYHcal << ":" << PHI + << " Depth " << nDepth << " Muon Pt " << pt_of_muon << " Isol " << IsolationR04 << std::endl; + + for (int cut = 0; cut < nCut_; ++cut) { + bool select(false); + if (cut == 0) + select = tightMuon(); + else if (cut == 1) + select = softMuon(); + else + select = looseMuon(); + + if (select && ((eta + 1) >= etaMin_) && ((eta + 1) <= etaMax_)) { + h_Pt_Muon[cut]->Fill(pt_of_muon); + h_Eta_Muon[cut]->Fill(eta_of_muon); + h_Phi_Muon[cut]->Fill(phi_of_muon); + h_PF_Muon[cut]->Fill(PF_Muon); + h_GlobTrack_Chi[cut]->Fill(GlobTrack_Chi); + h_Global_Muon_Hits[cut]->Fill(Global_Muon_Hits); + h_MatchedStations[cut]->Fill(MatchedStations); + h_Tight_TransImpactparameter[cut]->Fill(Tight_TransImpactparameter); + h_Tight_LongitudinalImpactparameter[cut]->Fill(Tight_LongitudinalImpactparameter); + h_InnerTrackPixelHits[cut]->Fill(InnerTrackPixelHits); + h_TrackerLayer[cut]->Fill(TrackerLayer); + h_IsolationR04[cut]->Fill(IsolationR04); + h_Global_Muon[cut]->Fill(Global_Muon); + + h_TransImpactParameter[cut]->Fill(Tight_TransImpactparameter); + h_LongImpactParameter[cut]->Fill(Tight_LongitudinalImpactparameter); + + //in Phi Bins + if (((phi_of_muon) >= -1.5) || ((phi_of_muon) <= 0.5)) { + h_TransImpactParameterBin1[cut]->Fill(Tight_TransImpactparameter); + h_LongImpactParameterBin1[cut]->Fill(Tight_LongitudinalImpactparameter); + h_2D_Bin1[cut]->Fill(Tight_TransImpactparameter, Tight_LongitudinalImpactparameter); + } - if ((phi_of_muon->at(ml) > 0.5) || (phi_of_muon->at(ml) < -1.5)) { - h_TransImpactParameterBin2[cut]->Fill(Tight_TransImpactparameter->at(ml)); - h_LongImpactParameterBin2[cut]->Fill(Tight_LongitudinalImpactparameter->at(ml)); - h_2D_Bin2[cut]->Fill(Tight_TransImpactparameter->at(ml), Tight_LongitudinalImpactparameter->at(ml)); - } + if ((phi_of_muon > 0.5) || (phi_of_muon < -1.5)) { + h_TransImpactParameterBin2[cut]->Fill(Tight_TransImpactparameter); + h_LongImpactParameterBin2[cut]->Fill(Tight_LongitudinalImpactparameter); + h_2D_Bin2[cut]->Fill(Tight_TransImpactparameter, Tight_LongitudinalImpactparameter); + } - h_ecal_energy[cut]->Fill(ecal_3into3->at(ml)); - h_3x3_ecal[cut]->Fill(ecal_3x3->at(ml)); - h_Eta_ecal[cut]->Fill(eta_of_muon->at(ml), ecal_3x3->at(ml)); - h_Phi_ecal[cut]->Fill(phi_of_muon->at(ml), ecal_3x3->at(ml)); - h_MuonHittingEcal[cut]->Fill(typeEcal); - if (typeEcal == 1) { - h_EtaX_ecal[cut]->Fill(etaEcal, ecal_3x3->at(ml)); - h_PhiY_ecal[cut]->Fill(phiEcal, ecal_3x3->at(ml)); + h_ecal_energy[cut]->Fill(ecal_3into3); + h_3x3_ecal[cut]->Fill(ecal_3x3); + h_Eta_ecal[cut]->Fill(eta_of_muon, ecal_3x3); + h_Phi_ecal[cut]->Fill(phi_of_muon, ecal_3x3); + h_MuonHittingEcal[cut]->Fill(typeEcal); + if (typeEcal == 1) { + h_EtaX_ecal[cut]->Fill(etaEcal, ecal_3x3); + h_PhiY_ecal[cut]->Fill(phiEcal, ecal_3x3); + } + + h_hcal_energy[cut]->Fill(hcal_3into3); + h_1x1_hcal[cut]->Fill(hcal_1x1); + h_EtaX_hcal[cut]->Fill(etaXHcal, hcal_1x1); + h_PhiY_hcal[cut]->Fill(phiYHcal, hcal_1x1); + h_HotCell[cut]->Fill(hcal_cellHot); + if (mergeDepth_) { + double en1(0), en2(0), energyFill(0), chargeS(0), chargeBG(0); + double enh(0), enc(0); + for (int dep = 0; dep < nDepth; ++dep) { + double enb(0), enu(0), eh0(0), ec0(0), chgS(0), chgB(0), actL(0); + getEnergy(dep, enb, enu, eh0, ec0, chgS, chgB, actL); + en1 += ((useCorrect_) ? enu : enb); + en2 += ((useCorrect_) ? ec0 : eh0); + enh += (eh0); + enc += (ec0); + energyFill += (actL); + chargeS += (chgS); + chargeBG += (chgB); } + int ind = (etaHcal > 0) ? indxEta[eta][0][PHI] : 1 + indxEta[eta][0][PHI]; + if (debug_) // || eta==15 || eta==17) + std::cout << "Matched Id " << matchedId << " Hot " << hcal_cellHot << " eta " << etaHcal << ":" << eta + << " phi " << phiHcal << ":" << PHI << " Index " << ind << " E " << en1 << ":" << en2 << ":" + << enh << ":" << enc << " L " << energyFill << " Charge " << chargeS << ":" << chargeBG + << std::endl; + if (!(matchedId)) + continue; + if (hcal_cellHot == 1) { + if (energyFill > 0) { + h_Hot_MuonEnergy_hcal_HotCell[cut][ind]->Fill(en2); + h_Hot_MuonEnergy_hcal_HotCell_VsActiveLength[cut][ind]->Fill(en2 / energyFill); + h_active_length_Fill[cut][ind]->Fill(energyFill); + h_p_muon_ineta[cut][ind]->Fill(p_of_muon); + h_charge_signal[cut][ind]->Fill(chargeS); + h_charge_bg[cut][ind]->Fill(chargeBG); + + t_ene.push_back(enh); + t_enec.push_back(enc); + t_charge.push_back(chargeS); + t_actln.push_back(energyFill); + t_depth.push_back(0); - h_hcal_energy[cut]->Fill(hcal_3into3->at(ml)); - h_1x1_hcal[cut]->Fill(hcal_1x1->at(ml)); - h_EtaX_hcal[cut]->Fill(etaXHcal, hcal_1x1->at(ml)); - h_PhiY_hcal[cut]->Fill(phiYHcal, hcal_1x1->at(ml)); - h_HotCell[cut]->Fill(hcal_cellHot->at(ml)); - if (mergeDepth_) { - double en1(0), en2(0), energyFill(0), chargeS(0), chargeBG(0); - double enh(0), enc(0); - for (int dep = 0; dep < nDepth; ++dep) { - double enb(0), enu(0), eh0(0), ec0(0), chgS(0), chgB(0), actL(0); - getEnergy(ml, dep, enb, enu, eh0, ec0, chgS, chgB, actL); - en1 += ((useCorrect_) ? enu : enb); - en2 += ((useCorrect_) ? ec0 : eh0); - enh += (eh0); - enc += (ec0); - energyFill += (actL); - chargeS += (chgS); - chargeBG += (chgB); - } - int ind = (etaHcal > 0) ? indxEta[eta][0][PHI] : 1 + indxEta[eta][0][PHI]; - if (debug_) // || eta==15 || eta==17) - std::cout << "Matched Id " << matchedId->at(ml) << " Hot " << hcal_cellHot->at(ml) << " eta " << etaHcal - << ":" << eta << " phi " << phiHcal << ":" << PHI << " Index " << ind << " E " << en1 << ":" - << en2 << ":" << enh << ":" << enc << " L " << energyFill << " Charge " << chargeS << ":" - << chargeBG << std::endl; - if (!(matchedId->at(ml))) - continue; - if (hcal_cellHot->at(ml) == 1) { - if (energyFill > 0) { - h_Hot_MuonEnergy_hcal_HotCell[cut][ind]->Fill(en2); - h_Hot_MuonEnergy_hcal_HotCell_VsActiveLength[cut][ind]->Fill(en2 / energyFill); - h_active_length_Fill[cut][ind]->Fill(energyFill); - h_p_muon_ineta[cut][ind]->Fill(p_of_muon->at(ml)); - h_charge_signal[cut][ind]->Fill(chargeS); - h_charge_bg[cut][ind]->Fill(chargeBG); - - t_ene.push_back(enh); - t_enec.push_back(enc); - t_charge.push_back(chargeS); - t_actln.push_back(energyFill); - t_depth.push_back(0); - - outtree_->Fill(); - } + outtree_->Fill(); } - } else { - bool fillTree(false); - for (int dep = 0; dep < nDepth; ++dep) { - if (debug_) - std::cout << "dep:" << dep << std::endl; + } + } else { + bool fillTree(false); + for (int dep = 0; dep < nDepth; ++dep) { + if (debug_) + std::cout << "dep:" << dep << std::endl; - double energyFill(0), chargeS(-9999), chargeBG(-9999); - double enh(-9999), enc(-9999), enb(0), enu(0); - bool ok1 = getEnergy(ml, dep, enb, enu, enh, enc, chargeS, chargeBG, energyFill); - double en1 = ((useCorrect_) ? enu : enb); - double en2 = ((useCorrect_) ? enc : enh); - if (debug_) - std::cout << "Hello in " << dep + 1 << " " << en1 << ":" << en2 << ":" << energyFill << std::endl; + double energyFill(0), chargeS(-9999), chargeBG(-9999); + double enh(-9999), enc(-9999), enb(0), enu(0); + bool ok1 = getEnergy(dep, enb, enu, enh, enc, chargeS, chargeBG, energyFill); + double en1 = ((useCorrect_) ? enu : enb); + double en2 = ((useCorrect_) ? enc : enh); + if (debug_) + std::cout << "Hello in " << dep + 1 << " " << en1 << ":" << en2 << ":" << energyFill << std::endl; - bool ok2 = ok1; + bool ok2 = ok1; + if (debug_) + std::cout << "Before Index " << ok1 << ":" << ok2 << std::endl; + + int ind = (etaHcal > 0) ? indxEta[eta][dep][PHI] : 1 + indxEta[eta][dep][PHI]; + if (debug_) // || eta==15 || eta==17) + std::cout << "Matched Id " << matchedId << " Hot " << hcal_cellHot << " eta " << etaHcal << ":" << eta + << " phi " << phiHcal << ":" << PHI << " depth " << dep << " Index " << ind << " E " << en1 + << ":" << en2 << ":" << enh << ":" << enc << " L " << energyFill << " Charge " << chargeS << ":" + << chargeBG << std::endl; + if (!(matchedId)) + continue; + if (ok1) { if (debug_) - std::cout << "Before Index " << ok1 << ":" << ok2 << std::endl; - - int ind = (etaHcal > 0) ? indxEta[eta][dep][PHI] : 1 + indxEta[eta][dep][PHI]; - if (debug_) // || eta==15 || eta==17) - std::cout << "Matched Id " << matchedId->at(ml) << " Hot " << hcal_cellHot->at(ml) << " eta " << etaHcal - << ":" << eta << " phi " << phiHcal << ":" << PHI << " depth " << dep << " Index " << ind - << " E " << en1 << ":" << en2 << ":" << enh << ":" << enc << " L " << energyFill << " Charge " - << chargeS << ":" << chargeBG << std::endl; - if (!(matchedId->at(ml))) - continue; - if (ok1) { - if (debug_) - std::cout << "enter ok1" << std::endl; - - if (hcal_cellHot->at(ml) == 1) { - if (energyFill > 0) { - h_Hot_MuonEnergy_hcal_HotCell[cut][ind]->Fill(en2); - h_Hot_MuonEnergy_hcal_HotCell_VsActiveLength[cut][ind]->Fill(en2 / energyFill); - h_active_length_Fill[cut][ind]->Fill(energyFill); - h_p_muon_ineta[cut][ind]->Fill(p_of_muon->at(ml)); - h_charge_signal[cut][ind]->Fill(chargeS); - h_charge_bg[cut][ind]->Fill(chargeBG); - t_ene.push_back(enh); - t_enec.push_back(enc); - t_charge.push_back(chargeS); - t_actln.push_back(energyFill); - // added depth vector AmanKalsi - t_depth.push_back(dep); - fillTree = true; - } else { - t_ene.push_back(-999.0); - t_enec.push_back(-999.0); - t_charge.push_back(-999.0); - t_actln.push_back(-999.0); - t_depth.push_back(-999.0); - } - if (debug_) - std::cout << "enter hot cell" << std::endl; + std::cout << "enter ok1" << std::endl; + + if (hcal_cellHot == 1) { + if (energyFill > 0) { + h_Hot_MuonEnergy_hcal_HotCell[cut][ind]->Fill(en2); + h_Hot_MuonEnergy_hcal_HotCell_VsActiveLength[cut][ind]->Fill(en2 / energyFill); + h_active_length_Fill[cut][ind]->Fill(energyFill); + h_p_muon_ineta[cut][ind]->Fill(p_of_muon); + h_charge_signal[cut][ind]->Fill(chargeS); + h_charge_bg[cut][ind]->Fill(chargeBG); + t_ene.push_back(enh); + t_enec.push_back(enc); + t_charge.push_back(chargeS); + t_actln.push_back(energyFill); + // added depth vector AmanKalsi + t_depth.push_back(dep); + fillTree = true; + } else { + t_ene.push_back(-999.0); + t_enec.push_back(-999.0); + t_charge.push_back(-999.0); + t_actln.push_back(-999.0); + t_depth.push_back(-999.0); } - } - - if (ok2) { if (debug_) - std::cout << "enter ok2" << std::endl; - if (hcal_cellHot->at(ml) != 1) { - } + std::cout << "enter hot cell" << std::endl; } + } + if (ok2) { if (debug_) - std::cout << "ETA \t" << eta << "DEPTH \t" << dep << std::endl; + std::cout << "enter ok2" << std::endl; + if (hcal_cellHot != 1) { + } } - if (fillTree) - outtree_->Fill(); + + if (debug_) + std::cout << "ETA \t" << eta << "DEPTH \t" << dep << std::endl; } + if (fillTree) + outtree_->Fill(); } } } @@ -1482,90 +1470,78 @@ void HBHEMuonOfflineAnalyzer::bookHistograms(const char *fname) { //output_file->cd(); } -bool HBHEMuonOfflineAnalyzer::getEnergy(unsigned int ml, - int dep, - double &enb, - double &enu, - double &enh, - double &enc, - double &chgS, - double &chgB, - double &actL) { +bool HBHEMuonOfflineAnalyzer::getEnergy( + int dep, double &enb, double &enu, double &enh, double &enc, double &chgS, double &chgB, double &actL) { double cfac(1.0); bool flag(true); if (cFactor_) { - int ieta = hcal_ieta->at(ml); - int iphi = hcal_iphi->at(ml); + int ieta = hcal_ieta; + int iphi = hcal_iphi; unsigned int detId = getDetIdHBHE(ieta, iphi, dep + 1); cfac = getCorr(Run_No, detId); } if (dep == 0) { - enb = cfac * hcal_edepth1->at(ml); - enu = cfac * hcal_edepthCorrect1->at(ml); - enh = cfac * hcal_edepthHot1->at(ml); - enc = cfac * hcal_edepthHotCorrect1->at(ml); - chgS = hcal_cdepthHot1->at(ml); - actL = hcal_activeHotL1->at(ml); - chgB = hcal_cdepthHotBG1->at(ml); + enb = cfac * hcal_edepth1; + enu = cfac * hcal_edepthCorrect1; + enh = cfac * hcal_edepthHot1; + enc = cfac * hcal_edepthHotCorrect1; + chgS = hcal_cdepthHot1; + actL = hcal_activeHotL1; + chgB = hcal_cdepthHotBG1; } else if (dep == 1) { - enb = cfac * hcal_edepth2->at(ml); - enu = cfac * hcal_edepthCorrect2->at(ml); - enh = cfac * hcal_edepthHot2->at(ml); - enc = cfac * hcal_edepthHotCorrect2->at(ml); - chgS = hcal_cdepthHot2->at(ml); - actL = hcal_activeHotL2->at(ml); - chgB = hcal_cdepthHotBG2->at(ml); + enb = cfac * hcal_edepth2; + enu = cfac * hcal_edepthCorrect2; + enh = cfac * hcal_edepthHot2; + enc = cfac * hcal_edepthHotCorrect2; + chgS = hcal_cdepthHot2; + actL = hcal_activeHotL2; + chgB = hcal_cdepthHotBG2; } else if (dep == 2) { - enb = cfac * hcal_edepth3->at(ml); - enu = cfac * hcal_edepthCorrect3->at(ml); - enh = cfac * hcal_edepthHot3->at(ml); - enc = cfac * hcal_edepthHotCorrect3->at(ml); - chgS = hcal_cdepthHot3->at(ml); - actL = hcal_activeHotL3->at(ml); - chgB = hcal_cdepthHotBG3->at(ml); + enb = cfac * hcal_edepth3; + enu = cfac * hcal_edepthCorrect3; + enh = cfac * hcal_edepthHot3; + enc = cfac * hcal_edepthHotCorrect3; + chgS = hcal_cdepthHot3; + actL = hcal_activeHotL3; + chgB = hcal_cdepthHotBG3; } else if (dep == 3) { - enb = cfac * hcal_edepth4->at(ml); - enu = cfac * hcal_edepthCorrect4->at(ml); - enh = cfac * hcal_edepthHot4->at(ml); - enc = cfac * hcal_edepthHotCorrect4->at(ml); - chgS = hcal_cdepthHot4->at(ml); - actL = hcal_activeHotL4->at(ml); - chgB = hcal_cdepthHotBG4->at(ml); + enb = cfac * hcal_edepth4; + enu = cfac * hcal_edepthCorrect4; + enh = cfac * hcal_edepthHot4; + enc = cfac * hcal_edepthHotCorrect4; + chgS = hcal_cdepthHot4; + actL = hcal_activeHotL4; + chgB = hcal_cdepthHotBG4; } else if (dep == 4) { - if (hcal_edepthCorrect5->size() > ml) { - enb = cfac * hcal_edepth5->at(ml); - enu = cfac * hcal_edepthCorrect5->at(ml); - enh = cfac * hcal_edepthHot5->at(ml); - enc = cfac * hcal_edepthHotCorrect5->at(ml); - chgS = hcal_cdepthHot5->at(ml); - actL = hcal_activeHotL5->at(ml); - chgB = hcal_cdepthHotBG5->at(ml); - } else { - enb = enu = enh = enc = chgS = actL = chgB = 0; - flag = false; - } + enb = cfac * hcal_edepth5; + enu = cfac * hcal_edepthCorrect5; + enh = cfac * hcal_edepthHot5; + enc = cfac * hcal_edepthHotCorrect5; + chgS = hcal_cdepthHot5; + actL = hcal_activeHotL5; + chgB = hcal_cdepthHotBG5; } else if (dep == 5) { - if (hcal_edepthCorrect6->size() > ml) { - enb = cfac * hcal_edepth6->at(ml); - enu = cfac * hcal_edepthCorrect6->at(ml); - enh = cfac * hcal_edepthHot6->at(ml); - enc = cfac * hcal_edepthHotCorrect6->at(ml); - chgS = hcal_cdepthHot6->at(ml); - actL = hcal_activeHotL6->at(ml); - chgB = hcal_cdepthHotBG6->at(ml); + if (dep <= maxDepth_) { + enb = cfac * hcal_edepth6; + enu = cfac * hcal_edepthCorrect6; + enh = cfac * hcal_edepthHot6; + enc = cfac * hcal_edepthHotCorrect6; + chgS = hcal_cdepthHot6; + actL = hcal_activeHotL6; + chgB = hcal_cdepthHotBG6; } else { enb = enu = enh = enc = chgS = actL = chgB = 0; flag = false; } } else if (dep == 6) { - if (hcal_edepthCorrect7->size() > ml) { - enb = cfac * hcal_edepth7->at(ml); - enu = cfac * hcal_edepthCorrect7->at(ml); - enh = cfac * hcal_edepthHot7->at(ml); - enc = cfac * hcal_edepthHotCorrect7->at(ml); - chgS = hcal_cdepthHot7->at(ml); - actL = hcal_activeHotL7->at(ml); - chgB = hcal_cdepthHotBG7->at(ml); + if (dep <= maxDepth_) { + enb = cfac * hcal_edepth7; + enu = cfac * hcal_edepthCorrect7; + enh = cfac * hcal_edepthHot7; + enc = cfac * hcal_edepthHotCorrect7; + chgS = hcal_cdepthHot7; + actL = hcal_activeHotL7; + chgB = hcal_cdepthHotBG7; } else { enb = enu = enh = enc = chgS = actL = chgB = 0; flag = false; @@ -1577,10 +1553,10 @@ bool HBHEMuonOfflineAnalyzer::getEnergy(unsigned int ml, return flag; } -bool HBHEMuonOfflineAnalyzer::looseMuon(unsigned int ml) { - if (pt_of_muon->at(ml) > 20.) { - if (mediumMuon2016(ml)) { - if (IsolationR04->at(ml) < 0.25) { +bool HBHEMuonOfflineAnalyzer::looseMuon() { + if (pt_of_muon > 20.) { + if (mediumMuon2016()) { + if (IsolationR04 < 0.25) { return true; } } @@ -1588,10 +1564,10 @@ bool HBHEMuonOfflineAnalyzer::looseMuon(unsigned int ml) { return false; } -bool HBHEMuonOfflineAnalyzer::softMuon(unsigned int ml) { - if (pt_of_muon->at(ml) > 20.) { - if (mediumMuon2016(ml)) { - if (IsolationR03->at(ml) < 0.10) { +bool HBHEMuonOfflineAnalyzer::softMuon() { + if (pt_of_muon > 20.) { + if (mediumMuon2016()) { + if (IsolationR03 < 0.10) { return true; } } @@ -1599,10 +1575,10 @@ bool HBHEMuonOfflineAnalyzer::softMuon(unsigned int ml) { return false; } -bool HBHEMuonOfflineAnalyzer::tightMuon(unsigned int ml) { - if (pt_of_muon->at(ml) > 20.) { - if (mediumMuon2016(ml)) { - if (IsolationR04->at(ml) < 0.15) { +bool HBHEMuonOfflineAnalyzer::tightMuon() { + if (pt_of_muon > 20.) { + if (mediumMuon2016()) { + if (IsolationR04 < 0.15) { return true; } } @@ -1610,15 +1586,13 @@ bool HBHEMuonOfflineAnalyzer::tightMuon(unsigned int ml) { return false; } -bool HBHEMuonOfflineAnalyzer::mediumMuon2016(unsigned int ml) { - bool medium16 = - (((PF_Muon->at(ml)) && (Global_Muon->at(ml) || Tracker_muon->at(ml))) && (tight_validFraction->at(ml) > 0.49)); +bool HBHEMuonOfflineAnalyzer::mediumMuon2016() { + bool medium16 = (((PF_Muon) && (Global_Muon || Tracker_muon)) && (tight_validFraction > 0.49)); if (!medium16) return medium16; - bool goodGlob = (Global_Muon->at(ml) && GlobTrack_Chi->at(ml) < 3 && muon_chi2LocalPosition->at(ml) < 12 && - muon_trkKink->at(ml) < 20); - medium16 = muon_segComp->at(ml) > (goodGlob ? 0.303 : 0.451); + bool goodGlob = (Global_Muon && GlobTrack_Chi < 3 && muon_chi2LocalPosition < 12 && muon_trkKink < 20); + medium16 = muon_segComp > (goodGlob ? 0.303 : 0.451); return medium16; } diff --git a/Calibration/HcalCalibAlgos/macros/HBHEMuonOfflineSimAnalyzer.C b/Calibration/HcalCalibAlgos/macros/HBHEMuonOfflineSimAnalyzer.C index 62bf6e1179919..46ef4652d2786 100644 --- a/Calibration/HcalCalibAlgos/macros/HBHEMuonOfflineSimAnalyzer.C +++ b/Calibration/HcalCalibAlgos/macros/HBHEMuonOfflineSimAnalyzer.C @@ -43,46 +43,46 @@ private: UInt_t Event_No; UInt_t LumiNumber; UInt_t BXNumber; - std::vector *pt_of_muon; - std::vector *eta_of_muon; - std::vector *phi_of_muon; - std::vector *p_of_muon; - std::vector *ecal_3x3; - std::vector *ecal_detID; - std::vector *hcal_1x1; - std::vector *matchedId; - std::vector *hcal_detID; - std::vector *hcal_cellHot; - std::vector *activeLength; - std::vector *hcal_edepth1; - std::vector *hcal_edepth2; - std::vector *hcal_edepth3; - std::vector *hcal_edepth4; - std::vector *hcal_activeL1; - std::vector *hcal_activeL2; - std::vector *hcal_activeL3; - std::vector *hcal_activeL4; - std::vector *activeLengthHot; - std::vector *hcal_edepthHot1; - std::vector *hcal_edepthHot2; - std::vector *hcal_edepthHot3; - std::vector *hcal_edepthHot4; - std::vector *hcal_activeHotL1; - std::vector *hcal_activeHotL2; - std::vector *hcal_activeHotL3; - std::vector *hcal_activeHotL4; - std::vector *hcal_edepth5; - std::vector *hcal_activeL5; - std::vector *hcal_edepthHot5; - std::vector *hcal_activeHotL5; - std::vector *hcal_edepth6; - std::vector *hcal_activeL6; - std::vector *hcal_edepthHot6; - std::vector *hcal_activeHotL6; - std::vector *hcal_edepth7; - std::vector *hcal_activeL7; - std::vector *hcal_edepthHot7; - std::vector *hcal_activeHotL7; + double pt_of_muon; + double eta_of_muon; + double phi_of_muon; + double p_of_muon; + double ecal_3x3; + unsigned int ecal_detID; + double hcal_1x1; + double matchedId; + unsigned int hcal_detID; + unsigned int hcal_cellHot; + double activeLength; + double hcal_edepth1; + double hcal_edepth2; + double hcal_edepth3; + double hcal_edepth4; + double hcal_activeL1; + double hcal_activeL2; + double hcal_activeL3; + double hcal_activeL4; + double activeLengthHot; + double hcal_edepthHot1; + double hcal_edepthHot2; + double hcal_edepthHot3; + double hcal_edepthHot4; + double hcal_activeHotL1; + double hcal_activeHotL2; + double hcal_activeHotL3; + double hcal_activeHotL4; + double hcal_edepth5; + double hcal_activeL5; + double hcal_edepthHot5; + double hcal_activeHotL5; + double hcal_edepth6; + double hcal_activeL6; + double hcal_edepthHot6; + double hcal_activeHotL6; + double hcal_edepth7; + double hcal_activeL7; + double hcal_edepthHot7; + double hcal_activeHotL7; TBranch *b_Run_No; //! TBranch *b_Event_No; //! @@ -147,9 +147,9 @@ public: std::vector firedTriggers; void BookHistograms(const char *); void WriteHistograms(); - bool LooseMuon(unsigned int ml); - bool tightMuon(unsigned int ml); - bool SoftMuon(unsigned int ml); + bool LooseMuon(); + bool tightMuon(); + bool SoftMuon(); void etaPhiHcal(unsigned int detId, int &eta, int &phi, int &depth); void etaPhiEcal(unsigned int detId, int &type, int &zside, int &etaX, int &phiY, int &plane, int &strip); void calculateP(double pt, double eta, double &pM); @@ -370,129 +370,126 @@ void HBHEMuonOfflineSimAnalyzer::Loop() { nb = fChain->GetEntry(jentry); nbytes += nb; - for (unsigned int ml = 0; ml < pt_of_muon->size(); ml++) { - if (debug_) { - std::cout << "ecal_det_id " << ecal_detID->at(ml) << std::endl; - std::cout << "hcal_det_id " << std::hex << hcal_detID->at(ml) << std::dec; - } - int etaHcal, phiHcal, depthHcal; - etaPhiHcal(hcal_detID->at(ml), etaHcal, phiHcal, depthHcal); + if (debug_) { + std::cout << "ecal_det_id " << ecal_detID << std::endl; + std::cout << "hcal_det_id " << std::hex << hcal_detID << std::dec; + } + int etaHcal, phiHcal, depthHcal; + etaPhiHcal(hcal_detID, etaHcal, phiHcal, depthHcal); - int eta = (etaHcal > 0) ? (etaHcal - 1) : -(1 + etaHcal); - int nDepth = NDepthBins(eta + 1, phiHcal); - int nPhi = NPhiBins(eta + 1); + int eta = (etaHcal > 0) ? (etaHcal - 1) : -(1 + etaHcal); + int nDepth = NDepthBins(eta + 1, phiHcal); + int nPhi = NPhiBins(eta + 1); - double phiYHcal = (phiHcal - 0.5); - if (debug_) - std::cout << "phiHcal" << phiHcal << " phiYHcal" << phiYHcal << std::endl; - - for (int cut = 0; cut < 3; ++cut) { - bool select(false); - if (cut == 0) - select = tightMuon(ml); - else if (cut == 1) - select = SoftMuon(ml); - else - select = LooseMuon(ml); - - if (select) { - // h_P_Muon[cut]->Fill(p_of_muon->at(ml)); - h_P_Muon[cut]->Fill(p_of_muon->at(ml)); - h_Pt_Muon[cut]->Fill(pt_of_muon->at(ml)); - h_Eta_Muon[cut]->Fill(eta_of_muon->at(ml)); - - double energyFill; - for (int dep = 0; dep < nDepth; ++dep) { - if (debug_) { - std::cout << "why on 15/2 only" << std::endl; - std::cout << "dep:" << dep << std::endl; - } - int PHI = (nPhi > 36) ? (phiHcal - 1) : (phiHcal - 1) / 2; - double en1(-9999), en2(-9999); - if (dep == 0) { - en1 = hcal_edepth1->at(ml); - en2 = hcal_edepthHot1->at(ml); - energyFill = (hcal_activeHotL1->at(ml) > 0) ? hcal_activeHotL1->at(ml) : 999; - - } else if (dep == 1) { - en1 = hcal_edepth2->at(ml); - en2 = hcal_edepthHot2->at(ml); - energyFill = (hcal_activeHotL2->at(ml) > 0) ? hcal_activeHotL2->at(ml) : 999; - if (debug_) - std::cout << "problem here.. lets see if it got printed\n"; - } else if (dep == 2) { - en1 = hcal_edepth3->at(ml); - en2 = hcal_edepthHot3->at(ml); - energyFill = (hcal_activeHotL3->at(ml) > 0) ? hcal_activeHotL3->at(ml) : 999; - } else if (dep == 3) { - en1 = hcal_edepth4->at(ml); - en2 = hcal_edepthHot4->at(ml); - if (debug_) - std::cout << "Hello in 4" << std::endl; - energyFill = (hcal_activeHotL4->at(ml) > 0) ? hcal_activeHotL4->at(ml) : 999; - } else if (dep == 4) { - en1 = hcal_edepth5->at(ml); - en2 = hcal_edepthHot5->at(ml); - energyFill = (hcal_activeHotL5->at(ml) > 0) ? hcal_activeHotL5->at(ml) : 999; - } else if (dep == 5) { - if (debug_) - std::cout << "Energy in depth 6 " << hcal_edepth6->size() << ":" << hcal_edepthHot6->size() - << std::endl; - en1 = (hcal_edepth6->size() > ml) ? hcal_edepth6->at(ml) : 0; - en2 = (hcal_edepthHot6->size() > ml) ? hcal_edepthHot6->at(ml) : 0; - energyFill = (hcal_activeHotL6->at(ml) > 0) ? hcal_activeHotL6->at(ml) : 999; - } else if (dep == 6) { - if (debug_) - std::cout << "Energy in depth 7 " << hcal_edepth7->size() << ":" << hcal_edepthHot7->size() - << std::endl; - en1 = (hcal_edepth7->size() > ml) ? hcal_edepth7->at(ml) : 0; - en2 = (hcal_edepthHot7->size() > ml) ? hcal_edepthHot7->at(ml) : 0; - energyFill = (hcal_activeHotL7->at(ml) > 0) ? hcal_activeHotL7->at(ml) : 999; - } + double phiYHcal = (phiHcal - 0.5); + if (debug_) + std::cout << "phiHcal" << phiHcal << " phiYHcal" << phiYHcal << std::endl; + + for (int cut = 0; cut < 3; ++cut) { + bool select(false); + if (cut == 0) + select = tightMuon(); + else if (cut == 1) + select = SoftMuon(); + else + select = LooseMuon(); + + if (select) { + // h_P_Muon[cut]->Fill(p_of_muon); + h_P_Muon[cut]->Fill(p_of_muon); + h_Pt_Muon[cut]->Fill(pt_of_muon); + h_Eta_Muon[cut]->Fill(eta_of_muon); + + double energyFill; + for (int dep = 0; dep < nDepth; ++dep) { + if (debug_) { + std::cout << "why on 15/2 only" << std::endl; + std::cout << "dep:" << dep << std::endl; + } + int PHI = (nPhi > 36) ? (phiHcal - 1) : (phiHcal - 1) / 2; + double en1(-9999), en2(-9999); + if (dep == 0) { + en1 = hcal_edepth1; + en2 = hcal_edepthHot1; + energyFill = (hcal_activeHotL1 > 0) ? hcal_activeHotL1 : 999; + } else if (dep == 1) { + en1 = hcal_edepth2; + en2 = hcal_edepthHot2; + energyFill = (hcal_activeHotL2 > 0) ? hcal_activeHotL2 : 999; + if (debug_) + std::cout << "problem here.. lets see if it got printed\n"; + } else if (dep == 2) { + en1 = hcal_edepth3; + en2 = hcal_edepthHot3; + energyFill = (hcal_activeHotL3 > 0) ? hcal_activeHotL3 : 999; + } else if (dep == 3) { + en1 = hcal_edepth4; + en2 = hcal_edepthHot4; + if (debug_) + std::cout << "Hello in 4" << std::endl; + energyFill = (hcal_activeHotL4 > 0) ? hcal_activeHotL4 : 999; + } else if (dep == 4) { + en1 = hcal_edepth5; + en2 = hcal_edepthHot5; + energyFill = (hcal_activeHotL5 > 0) ? hcal_activeHotL5 : 999; + } else if (dep == 5) { + if (debug_) + std::cout << "Energy in depth 6 " << maxDepth_ << ":" << hcal_edepth6 << ":" << hcal_edepthHot6 + << std::endl; + en1 = (maxDepth_ > 5) ? hcal_edepth6 : 0; + en2 = (maxDepth_ > 5) ? hcal_edepthHot6 : 0; + energyFill = (hcal_activeHotL6 > 0) ? hcal_activeHotL6 : 999; + } else if (dep == 6) { + if (debug_) + std::cout << "Energy in depth 7 " << maxDepth_ << ":" << hcal_edepth7 << ":" << hcal_edepthHot7 + << std::endl; + en1 = (maxDepth_ > 6) ? hcal_edepth7 : 0; + en2 = (maxDepth_ > 6) ? hcal_edepthHot7 : 0; + energyFill = (hcal_activeHotL7 > 0) ? hcal_activeHotL7 : 999; + } - if (debug_) { - std::cout << " Debug2" << std::endl; - std::cout << "ok1" << en1 << std::endl; - std::cout << "ok2" << en2 << std::endl; - } - bool ok1 = (en1 > -9999); - bool ok2 = (en2 > -9999); + if (debug_) { + std::cout << " Debug2" << std::endl; + std::cout << "ok1" << en1 << std::endl; + std::cout << "ok2" << en2 << std::endl; + } + bool ok1 = (en1 > -9999); + bool ok2 = (en2 > -9999); - if (debug_) - std::cout << "Before Index" << std::endl; + if (debug_) + std::cout << "Before Index" << std::endl; - int ind = (etaHcal > 0) ? indxEta[eta][dep][PHI] : 1 + indxEta[eta][dep][PHI]; + int ind = (etaHcal > 0) ? indxEta[eta][dep][PHI] : 1 + indxEta[eta][dep][PHI]; - if (debug_) { - std::cout << "ieta " << eta << "depth " << dep << "indxEta[eta][dep]:" << indxEta[eta][dep][PHI] - << std::endl; - std::cout << "index showing eta,depth:" << ind << std::endl; - std::cout << "etaHcal: " << etaHcal << " eta " << eta << " dep " << dep << " indx " << ind << std::endl; - } - if (!(matchedId->at(ml))) - continue; - if (ok1) { - if (debug_) - std::cout << "enter ok1" << std::endl; - if (hcal_cellHot->at(ml) == 1) { - if (en2 > 0) { - h_Hot_MuonEnergy_hcal_HotCell_VsActiveLength[cut][ind]->Fill(en2 / energyFill); - } - if (debug_) - std::cout << "enter hot cell" << std::endl; + if (debug_) { + std::cout << "ieta " << eta << "depth " << dep << "indxEta[eta][dep]:" << indxEta[eta][dep][PHI] + << std::endl; + std::cout << "index showing eta,depth:" << ind << std::endl; + std::cout << "etaHcal: " << etaHcal << " eta " << eta << " dep " << dep << " indx " << ind << std::endl; + } + if (!(matchedId)) + continue; + if (ok1) { + if (debug_) + std::cout << "enter ok1" << std::endl; + if (hcal_cellHot == 1) { + if (en2 > 0) { + h_Hot_MuonEnergy_hcal_HotCell_VsActiveLength[cut][ind]->Fill(en2 / energyFill); } - } - - if (ok2) { if (debug_) - std::cout << "enter ok2" << std::endl; - if (hcal_cellHot->at(ml) != 1) { - } + std::cout << "enter hot cell" << std::endl; } + } + if (ok2) { if (debug_) - std::cout << "ETA \t" << eta << "DEPTH \t" << dep << std::endl; + std::cout << "enter ok2" << std::endl; + if (hcal_cellHot != 1) { + } } + + if (debug_) + std::cout << "ETA \t" << eta << "DEPTH \t" << dep << std::endl; } } } @@ -729,9 +726,9 @@ void HBHEMuonOfflineSimAnalyzer::BookHistograms(const char *fname) { //output_file->cd(); } -bool HBHEMuonOfflineSimAnalyzer::LooseMuon(unsigned int ml) { - if (pt_of_muon->at(ml) > 20.) { - if (fabs(eta_of_muon->at(ml)) <= 5.0) { +bool HBHEMuonOfflineSimAnalyzer::LooseMuon() { + if (pt_of_muon > 20.) { + if (fabs(eta_of_muon) <= 5.0) { return true; } } @@ -739,9 +736,9 @@ bool HBHEMuonOfflineSimAnalyzer::LooseMuon(unsigned int ml) { return false; } -bool HBHEMuonOfflineSimAnalyzer::SoftMuon(unsigned int ml) { - if (pt_of_muon->at(ml) > 20.) { - if (fabs(eta_of_muon->at(ml)) <= 5.0) { +bool HBHEMuonOfflineSimAnalyzer::SoftMuon() { + if (pt_of_muon > 20.) { + if (fabs(eta_of_muon) <= 5.0) { return true; } } @@ -749,9 +746,9 @@ bool HBHEMuonOfflineSimAnalyzer::SoftMuon(unsigned int ml) { return false; } -bool HBHEMuonOfflineSimAnalyzer::tightMuon(unsigned int ml) { - if (pt_of_muon->at(ml) > 20.) { - if (fabs(eta_of_muon->at(ml)) <= 5.0) { +bool HBHEMuonOfflineSimAnalyzer::tightMuon() { + if (pt_of_muon > 20.) { + if (fabs(eta_of_muon) <= 5.0) { return true; } } diff --git a/Calibration/HcalCalibAlgos/macros/hocalib_pl18.C b/Calibration/HcalCalibAlgos/macros/hocalib_pl18.C new file mode 100644 index 0000000000000..4b383859b1ff7 --- /dev/null +++ b/Calibration/HcalCalibAlgos/macros/hocalib_pl18.C @@ -0,0 +1,4005 @@ +/* +Identify digi and other correlaions +Increase range of Digi plots +Swap digi reco option +Noise : Second TS has sharp fall +Previous postion of SiPM : Problematic + + +hadd hist_hoprompt_r2017ae.root hist_r2017a_hoprompt_v2a_1.root hist_r2017a_hoprompt_v3a_1.root hist_hoprompt_r2017b_v1.root hist_r2017b_hoprompt_v2a_1.root hist_r2017c_hoprompt_v1a_1.root hist_hoprompt_r2017c_v2.root hist_hoprompt_r2017c_v3.root hist_hoprompt_r2017d_v1.root hist_hoprompt_r2017e_v1.root + + +*/ +const int netamx = 30; +const int nphimx = 72; +int getieta(int ij) { return (ij < netamx / 2) ? -netamx / 2 + ij : -netamx / 2 + ij + 1; } +int invert_ieta(int ieta) { return (ieta < 0) ? netamx / 2 + ieta : netamx / 2 + ieta - 1; } + +const int ncut = 14; +const int ringmx = 5; +const int nchnmx = 10; +const int routmx = 36; +const int rout12mx = 24; + +const int rbxmx = 12; // HO readout box in Ring 0 +const int rbx12mx = 6; //HO readout box in Ring+-1/2 +const int nprojtype = 5; // Varities due to types of muon projection +const char* projname[nprojtype] = {"Noise", "In RM", "3x3", "Proj", "Signal"}; +const int nprojmx = 4; +const int nseltype = 4; //Different crit for muon selection +const int nadmx = 18; +const int shapemx = 10; //checking shape + +static const int nhothresh = 10; // set threshold for noise filter + +TH2F* totalmuon; +TH2F* totalproj[9]; +TH2F* totalhpd[18]; + +TH2F* totalprojsig[9]; +TH2F* totalhpdsig[18]; + +TH2F* total2muon; +TH2F* total2proj[9]; +TH2F* total2hpd[18]; + +TH2F* total2projsig[9]; +TH2F* total2hpdsig[18]; + +Double_t gausX(Double_t* x, Double_t* par) { return par[0] * (TMath::Gaus(x[0], par[1], par[2], kTRUE)); } + +Double_t landX(Double_t* x, Double_t* par) { return par[0] * (TMath::Landau(x[0], par[1], par[2])); } + +Double_t completefit(Double_t* x, Double_t* par) { return gausX(x, par) + landX(x, &par[3]); } + +Double_t langaufun(Double_t* x, Double_t* par) { + //Fit parameters: + //par[0]*par[1]=Width (scale) parameter of Landau density + //par[1]=Most Probable (MP, location) parameter of Landau density + //par[2]=Total area (integral -inf to inf, normalization constant) + //par[3]=Width (sigma) of convoluted Gaussian function + // + //In the Landau distribution (represented by the CERNLIB approximation), + //the maximum is located at x=-0.22278298 with the location parameter=0. + //This shift is corrected within this function, so that the actual + //maximum is identical to the MP parameter. + // /* + // Numeric constants + Double_t invsq2pi = 0.3989422804014; // (2 pi)^(-1/2) + Double_t mpshift = -0.22278298; // Landau maximum location + + // Control constants + Double_t np = 100.0; // number of convolution steps + Double_t sc = 5.0; // convolution extends to +-sc Gaussian sigmas + + // Variables + Double_t xx; + Double_t mpc; + Double_t fland; + Double_t sum = 0.0; + Double_t xlow, xupp; + Double_t step; + + // MP shift correction + mpc = par[1] - mpshift * par[0] * par[1]; + double scale = 1; // par[1]; + double scale2 = 1; //anormglb; // for notmalisation this is one, otehrwise use the normalisation; + if (scale2 < .1) + scale2 = 0.1; + // double scale=par[1]; + // Range of convolution integral + xlow = x[0] - sc * scale * par[3]; + xupp = x[0] + sc * scale * par[3]; + + step = (xupp - xlow) / np; + + // Convolution integral of Landau and Gaussian by sum + for (double ij = 1.0; ij <= np / 2; ij++) { + xx = xlow + (ij - .5) * step; + fland = TMath::Landau(xx, mpc, par[0] * par[1], kTRUE); // / par[0]; + if (xx > par[1]) { + fland *= exp(-(xx - par[1]) / par[4]); + } + sum += fland * TMath::Gaus(x[0], xx, scale * par[3]); + xx = xupp - (ij - .5) * step; + fland = TMath::Landau(xx, mpc, par[0] * par[1], kTRUE); // / par[0]; + if (xx > par[1]) { + fland *= exp(-(xx - par[1]) / par[4]); + } + sum += fland * TMath::Gaus(x[0], xx, scale * par[3]); + } + return (par[2] * step * sum * invsq2pi / (scale2 * par[3])); +} + +Double_t totalfunc(Double_t* x, Double_t* par) { + return gausX(x, par) + langaufun(x, &par[3]); // /max(.001,anormglb); +} +// binroot hocalib_r2017e_hoprompt_v1a_1.root hocalib_r2017g_hoprompt_v1a_1.root hocalib_r2017h_hoprompt_v1a_1.root +void momentum() { + gStyle->SetOptStat(1110); + const int nfile = 3; + TH1F* histx[nfile]; + TTree* T1x; + char name[100]; + TCanvas* c1 = new TCanvas("c1", "runfile", 700, 300); + c1->Divide(3, 1); + + for (int ij = 0; ij < nfile; ij++) { + c1->cd(ij + 1); + sprintf(name, "hist_%i", ij); + histx[ij] = new TH1F(name, name, 120, -150., 150.); + if (ij == 0) { + // _file2->cd(); // T1x = (TTree*)_file0->Get("T1"); + } else if (ij == 1) { + // _file0->cd(); // T1x = (TTree*)_file1->Get("T1"); + } else { + // _file2->cd();// T1x = (TTree*)_file2->Get("T1"); + } + switch (ij) { + case 0: + _file0->cd(); + break; + case 1: + _file1->cd(); + break; + case 2: + _file2->cd(); + break; + } + + T1x = (TTree*)gDirectory->Get("T1"); + T1x->Project(name, "trkmm"); + // histx[ij]->Scale(1./TMath::Max(1.,histx[ij]->Integral())); + histx[ij]->Draw(); + // T1x->Draw("trkmm"); + } +} + +/* +binroot histalla_hcalcalho_2016btog.root + .L tdrstyle.C +setTDRStyle() +.L hocalib_pl16.C +plot_fitres(23, 42); + + +*/ + +void plot_fitres(int ieta = 13, int iphi = 70) { + gStyle->SetOptTitle(0); + gStyle->SetOptLogy(1); + // gStyle->SetOptStat(0); //1110); + // gStyle->SetLabelSize(0.095,"XYZ"); + // gStyle->SetLabelOffset(0.01,"XYZ"); + // gStyle->SetHistLineColor(1); + // gStyle->SetHistLineWidth(3); + // gStyle->SetPadTopMargin(0.02); + // gStyle->SetPadBottomMargin(0.12); + // gStyle->SetPadLeftMargin(0.14); + // gStyle->SetPadRightMargin(0.04); + // gStyle->SetPadGridX(3); + // gStyle->SetPadGridY(3); + // gStyle->SetGridStyle(2); + // gStyle->SetMarkerColor(1); + // gStyle->SetMarkerStyle(20); + // gStyle->SetMarkerSize(0.95); + // gStyle->SetNdivisions(506,"XY"); + // gStyle->SetLabelSize(0.095,"XYZ"); + // gStyle->SetLabelOffset(0.01,"XYZ"); + // gStyle->SetStatH(.1); + // gStyle->SetStatW(.4); + + // -14, 1 plot_fitres(1,0); + // double par[8]={139.1, 0.0327856, 0.070529, 0.137647, 1.69858, 79549.1, 0.307275, 5.71755}; + + // -8, 1 plot_fitres(7,0); + // double par[8]={31.5185, 0.0342954, 0.0599271, 0.151538, 1.10591, 91530.5, 0.22909, 8.65218}; + // -1, 1 plot_fitres(14,0); + double par[8] = {23.6947, 0.0178834, 0.0318413, 0.160218, 0.985584, 77652.5, 0.15613, 10.0053}; + + //-15, 1 + // double par[8]={89.055, 0.0277592, 0.057265, 0.106515, 1.80511, 36326, 0.36995, 6.04276}; + // 9, 43 plot_fitres(23,42) + // double par[8]={ 29.3954, 0.0339121, 0.0644736, 0.160249, 1.15268, 94723.6, 0.239194, 10.5442}; + // 10, 43 plot_fitres(24,42) + // double par[8]={0.100621, 0.0413684, 0.077322, 0.154082, 1.22422, 80333, 0.315477, 12.1145}; + // 11, 43 plot_fitres(25,42) + // double par[8]={0.91, 0.0523604, 0.1, 0.25, 1.24822, 71042.8, 0.373684, 5.42163}; + // 12, 43 plot_fitres(26,42) + // double par[8]={0.550151, 0.0584881, 0.1, 0.246599, 1.38702, 84966.5, 0.35758, 4.92687}; + + par[0] /= 18.0; + par[5] /= 18.0; + + const char title[100]; + TH1F* histx[2]; + TH1F* histy[2]; + + TF1* ped0fun; + TF1* pedfun; + TF1* sigfun; + TF1* signalx; + double xmn = -15.; + double xmx = 20.; + + TCanvas* c1 = new TCanvas("c1", "runfile", 600, 600); + // c1->Divide(2,1); + for (int i = 1; i < 2; i++) { + // c1->cd(i+1); + switch (i) { + case 0: + sprintf(title, "hoCalibc/ped_eta%i_phi%i", ieta, iphi); + break; + case 1: + sprintf(title, "hoCalibc/sig_eta%i_phi%i", ieta, iphi); + break; + } + + histy[i] = (TH1F*)gDirectory->Get(title); + histx[i] = (TH1F*)histy[i]->Clone(); + cout << "name " << title << " " << histx[i]->GetBinWidth(100) << " " << histx[i]->GetTitle() << endl; + // histx[i]->GetXaxis()->SetRangeUser(xmn, (i+1)*xmx); + histx[i]->SetLineColor(2 * (i + 1)); + histx[i]->SetLineWidth(2); + histx[i]->Rebin(10); + + histx[i]->SetMaximum(1.52 * histx[i]->GetMaximum()); + + // histx[i]->SetNdivisions(506,"XY"); + + // histx[i]->GetXaxis()->SetLabelSize(.055); + // histx[i]->GetYaxis()->SetLabelSize(.055); + // histx[i]->GetYaxis()->SetTitleOffset(1.4); + + switch (i) { + case 0: + histx[i]->GetXaxis()->SetRangeUser(-16., 16.); + histx[i]->GetXaxis()->SetTitle("HO Pedestal (GeV)"); + break; + case 1: + histx[i]->GetXaxis()->SetRangeUser(-20., 40.); + histx[i]->GetXaxis()->SetTitle("HO Signal (GeV)"); + break; + } + // histx[i]->GetXaxis()->SetTitleSize(.055); + // // histx[i]->GetXaxis()->CenterTitle(); + histx[i]->GetYaxis()->SetTitle("Nevents"); + // histx[i]->GetYaxis()->SetTitleSize(.055); + // if (i==0) histx[i]->GetXaxis()->SetRangeUser(-5., 5.); + histx[i]->Draw(); + } + + // c1->cd(1); + // TPaveText *ptst1 = new TPaveText(.85,0.9,.90,.95,"brNDC"); + // ptst1->SetFillColor(10); + // TText* text1 = ptst1->AddText("(a)"); + // text1->SetTextSize(0.062); + // ptst1->SetBorderSize(0); + // ptst1->Draw(); + + // ped0fun = new TF1("temp", gausX, xmn, xmx, 3); + // ped0fun->SetParameters(gaupr); + // ped0fun->SetLineColor(3); + // ped0fun->SetLineWidth(2); + // ped0fun->Draw("same"); + + // c1->cd(2); + + // TPaveText *ptst = new TPaveText(0.85,0.9,0.90,.95,"brNDC"); + // ptst->SetFillColor(10); + // TText* text = ptst->AddText("(b)"); + // text->SetTextSize(0.062); + // ptst->SetBorderSize(0); + // ptst->Draw(); + + pedfun = new TF1("ped0", gausX, xmn, 4 * xmx, 3); + pedfun->SetParameters(par); + pedfun->SetLineWidth(2); + pedfun->SetLineColor(3); + pedfun->Draw("same"); + + sigfun = new TF1("signalfun", langaufun, xmn, 4 * xmx, 5); + sigfun->SetParameters(&par[3]); + sigfun->SetLineWidth(2); + sigfun->SetLineColor(4); + sigfun->Draw("same"); + + signalx = new TF1("total", totalfunc, xmn, 4 * xmx, 8); + signalx->SetParameters(par); + signalx->SetLineWidth(2); + signalx->SetLineWidth(1); + signalx->Draw("same"); + + cmsPrel(.55, .75, .55, .75, 0.045, 35); +} + +/* + binroot fit_2016btog_ar1_float_par8_rng30.root + .L tdrstyle.C +setTDRStyle() +.L hocalib_pl16.C +const_term_1dx("const_eta_phi") +const_term_2d() +*/ + +/* +binroot fit_r2017a_v2_ar1_float_par8_rng25.root fit_r2017a_v3_ar1_float_par8_rng25.root fit_r2017b_v1_ar1_float_par8_rng25.root fit_r2017b_v2_ar1_float_par8_rng25.root fit_r2017c_v1_ar1_float_par8_rng25.root fit_r2017c_v2_ar1_float_par8_rng25.root fit_r2017c_v3_ar1_float_par8_rng25.root fit_r2017d_v1_ar1_float_par8_rng25.root fit_r2017e_v1_ar1_float_par8_rng25.root fit_r2017f_v1_ar1_float_par8_rng25.root fit_r2017g_v1_ar1_float_par8_rng25.root fit_r2017h_v1_ar1_float_par8_rng25.root fit_r2017ae_ar1_float_par8_rng25.root fit_r2017af_ar1_float_par8_rng25.root + + + + +*/ + +void all_1d4x() { + TCanvas* c1 = new TCanvas("c1", "c1", 700, 500); + c1->Divide(2, 2); + + _file0->cd(); + const_term_1d4x(); + _file1->cd(); + const_term_1d4x(); + _file2->cd(); + const_term_1d4x(); + _file3->cd(); + const_term_1d4x(); + _file4->cd(); + const_term_1d4x(); + _file5->cd(); + const_term_1d4x(); + _file6->cd(); + const_term_1d4x(); + _file7->cd(); + const_term_1d4x(); + _file8->cd(); + const_term_1d4x(); + _file9->cd(); + const_term_1d4x(); + _file10->cd(); + const_term_1d4x(); + _file11->cd(); + const_term_1d4x(); + _file12->cd(); + const_term_1d4x(); + _file13->cd(); + const_term_1d4x(); + + /* +fit_r2017a_v2_a +val 0.363+- 0.294 0.211+- 0.173 0.468+- 0.184 0.282+- 0.11 +err 5.461+- 0.27 4.622+- 0.155 4.444+- 0.177 4.765+- 0.092 +fit_r2017a_v3_a +val 0.554+- 0.105 -0.372+- 0.073 -0.165+- 0.08 -0.063+- 0.047 +err 2.205+- 0.096 2.039+- 0.06 2.029+- 0.066 2.159+- 0.037 +fit_r2017b_v1_a +val 1.577+- 0.043 0.964+- 0.032 1.234+- 0.035 1.208+- 0.021 +err 0.944+- 0.036 0.9+- 0.027 0.934+- 0.028 0.974+- 0.018 +fit_r2017b_v2_a +val 2.209+- 0.072 1.826+- 0.05 2.038+- 0.055 1.969+- 0.032 +err 1.54+- 0.073 1.37+- 0.039 1.397+- 0.047 1.485+- 0.026 +fit_r2017c_v1_a +val 2.439+- 0.056 1.933+- 0.04 2.125+- 0.046 2.118+- 0.027 +err 1.208+- 0.05 1.12+- 0.032 1.225+- 0.038 1.22+- 0.022 +fit_r2017c_v2_a +val 2.569+- 0.045 1.996+- 0.032 2.289+- 0.038 2.247+- 0.022 +err 0.969+- 0.035 0.93+- 0.028 0.97+- 0.034 0.995+- 0.018 +fit_r2017c_v3_a +val 2.657+- 0.044 2.128+- 0.033 2.349+- 0.036 2.332+- 0.021 +err 0.909+- 0.034 0.952+- 0.03 0.955+- 0.03 0.985+- 0.019 +fit_r2017d_v1_a +val 2.852+- 0.044 2.287+- 0.037 2.512+- 0.037 2.512+- 0.023 +err 0.925+- 0.042 1.019+- 0.032 0.925+- 0.031 1.018+- 0.02 +fit_r2017e_v1_a +val 3.04+- 0.042 2.448+- 0.034 2.836+- 0.036 2.742+- 0.021 +err 0.872+- 0.034 0.856+- 0.028 0.9+- 0.03 0.932+- 0.017 +fit_r2017f_v1_a +val 3.18+- 0.048 2.541+- 0.037 2.868+- 0.039 2.817+- 0.024 +err 1.036+- 0.037 1.038+- 0.033 1.038+- 0.035 1.092+- 0.021 +fit_r2017g_v1_a +val 0.035+- 0.155 -2.666+- 0.116 -4.415+- 0.099 -2.728+- 0.084 +err 3.17+- 0.141 3.098+- 0.102 2.42+- 0.087 3.351+- 0.062 +fit_r2017h_v1_a +val 0.116+- 0.079 -2.594+- 0.057 -4.639+- 0.055 -2.684+- 0.061 +err 1.705+- 0.077 1.531+- 0.052 1.43+- 0.041 2.384+- 0.041 +fit_r2017ae_ar1 +val 2.569+- 0.032 1.989+- 0.027 2.265+- 0.029 2.238+- 0.017 +err 0.711+- 0.027 0.738+- 0.023 0.761+- 0.026 0.795+- 0.015 +fit_r2017af_ar1 +val 2.68+- 0.032 2.064+- 0.027 2.36+- 0.029 2.328+- 0.018 +err 0.694+- 0.025 0.748+- 0.023 0.76+- 0.025 0.804+- 0.014 + + + + + */ +} + +void all_2d() { + TCanvas* c1 = new TCanvas("c1", "c1", 700, 400); + // c1->Divide(2,2); + + _file0->cd(); + const_term_2d(); + _file1->cd(); + const_term_2d(); + _file2->cd(); + const_term_2d(); + _file3->cd(); + const_term_2d(); + _file4->cd(); + const_term_2d(); + _file5->cd(); + const_term_2d(); + _file6->cd(); + const_term_2d(); + _file7->cd(); + const_term_2d(); + _file8->cd(); + const_term_2d(); + _file9->cd(); + const_term_2d(); + _file10->cd(); + const_term_2d(); + _file11->cd(); + const_term_2d(); + _file12->cd(); + const_term_2d(); + _file13->cd(); + const_term_2d(); +} + +void const_term_1d4x(const char* varname = "const_eta_phi") { + gStyle->SetOptTitle(0); + gStyle->SetOptFit(111); + gStyle->SetOptStat(1110); + gStyle->SetOptLogy(1); + gStyle->SetPadTopMargin(0.01); + gStyle->SetPadBottomMargin(0.13); + gStyle->SetPadLeftMargin(0.12); + gStyle->SetPadRightMargin(0.01); + gStyle->SetStatY(.99); //89); + gStyle->SetStatX(.99); //94); + gStyle->SetStatH(.22); + gStyle->SetStatW(.27); + + TLatex latex; + latex.SetNDC(); + latex.SetTextSize(0.075); + latex.SetTextFont(42); + latex.SetTextAlign(31); // align right + + TCanvas* c1 = new TCanvas("c1", "c1", 700, 400); + c1->Divide(2, 2); + + // for (int ixj=0; ixj<14; ixj++) { + // switch(ixj) { + // case 0 : _file0->cd(); break; + // case 1 : _file1->cd(); break; + // case 2 : _file2->cd(); break; + // case 3 : _file3->cd(); break; + // case 4 : _file4->cd(); break; + // case 5 : _file5->cd(); break; + // case 6 : _file6->cd(); break; + // case 7 : _file7->cd(); break; + // case 8 : _file8->cd(); break; + // case 9 : _file9->cd(); break; + // case 10 : _file10->cd(); break; + // case 11 : _file11->cd(); break; + // case 12 : _file12->cd(); break; + // case 13 : _file13->cd(); break; + // default : _file0->cd(); break; + // } + + TH2F* hist2d = (TH2F*)gDirectory->Get(varname); + TH1F* histx[4]; + histx[0] = new TH1F("histx0", "Correction factor - 1 (R0)", 120, -0.11, 0.29); //.9, 1.3); + histx[1] = new TH1F("histx1", "Correction factor - 1 (R#pm1)", 120, -0.11, 0.29); //.9, 1.3); + histx[2] = new TH1F("histx2", "Correction factor - 1 (R#pm2)", 120, -0.11, 0.29); //.9, 1.3); + histx[3] = new TH1F("histx3", "Correction factor - 1 (All)", 120, -0.11, 0.29); //.9, 1.3); + + char name[100] = gDirectory->GetName(); + char namex[20]; + char namey[50]; + strncpy(namex, name, 15); + char* pchy = strchr(namex, '_'); + int len = pchy - namex; + strncpy(namey, namex, len); + + cout << namex << " " << namey << endl; + float value[2][4] = {0}; + float error[2][4] = {0}; + + for (int ij = 0; ij < hist2d->GetNbinsX(); ij++) { + int ieta = getieta(ij); + for (int jk = 0; jk < hist2d->GetNbinsY(); jk++) { + double xx = hist2d->GetBinContent(ij + 1, jk + 1) - 1.0; + if (xx > -0.5) { + if (abs(ieta) <= 4) { + histx[0]->Fill(xx); + } else if (abs(ieta) <= 10) { + histx[1]->Fill(xx); + } else if (abs(ieta) <= 15) { + histx[2]->Fill(xx); + } + histx[3]->Fill(xx); + } + } + } + for (int ij = 0; ij < 4; ij++) { + c1->cd(ij + 1); + histx[ij]->GetXaxis()->SetTitle(histx[ij]->GetTitle()); + histx[ij]->GetXaxis()->SetLabelOffset(.001); + histx[ij]->GetXaxis()->SetLabelSize(0.0645); + histx[ij]->GetXaxis()->SetTitleSize(0.065); + histx[ij]->GetXaxis()->SetTitleOffset(0.99); + + histx[ij]->GetYaxis()->SetTitle("Entries/0.005"); + histx[ij]->GetYaxis()->SetLabelOffset(.001); + histx[ij]->GetYaxis()->SetLabelSize(0.0645); + histx[ij]->GetYaxis()->SetTitleSize(0.065); + histx[ij]->GetYaxis()->SetTitleOffset(0.85); + + histx[ij]->SetLineWidth(1); + TFitResultPtr ptr = histx[ij]->Fit("gaus", "QS"); + Int_t fitStatus = ptr; + if (fitStatus == 0) { + value[0][ij] = int(100000 * ptr->Parameter(1)) / 1000.; + value[1][ij] = int(100000 * ptr->Parameter(2)) / 1000.; + error[0][ij] = int(100000 * ptr->ParError(1)) / 1000.; + error[1][ij] = int(100000 * ptr->ParError(2)) / 1000.; + + // cout<Parameter(1))/1000.<<"+-"<< int(100000*ptr->ParError(1))/1000.<<" "<Parameter(2))/1000.<<"+-"<< int(100000*ptr->ParError(2))/1000.<SaveAs(namey); + + cout << "val "; + for (int ij = 0; ij < 4; ij++) { + cout << " " << setw(6) << value[0][ij] << "+-" << setw(6) << error[0][ij]; + } + cout << endl; + cout << "err "; + for (int ij = 0; ij < 4; ij++) { + cout << " " << setw(6) << value[1][ij] << "+-" << setw(6) << error[1][ij]; + } + cout << endl; + for (int ij = 0; ij < 4; ij++) { + if (histx[ij]) { + delete histx[ij]; + histx[ij] = 0; + } + } + // } +} + +void const_term_1dx(const char* varname = "const_eta_phi") { + ofstream file_out("test_output.log"); + gStyle->SetOptFit(101); + gStyle->SetOptStat(0); + gStyle->SetOptLogy(1); + gStyle->SetPadTopMargin(0.1); + gStyle->SetPadBottomMargin(0.11); + gStyle->SetPadLeftMargin(0.14); + gStyle->SetPadRightMargin(0.03); + gStyle->SetStatY(.93); //89); + gStyle->SetStatX(.98); //94); + gStyle->SetStatH(.16); + gStyle->SetStatW(.19); + + TH2F* hist2d[3]; + + hist2d[0] = (TH2F*)gDirectory->Get(varname); + hist2d[1] = (TH2F*)gDirectory->Get("const_eta_phisum"); + TH1F* histx[3]; + histx[0] = new TH1F("histx0", "const_eta_phi", 120, .7, 1.3); + histx[1] = new TH1F("histx1", "const_eta_phisum", 120, .7, 1.3); + histx[2] = new TH1F("histx2", "Correction term", 120, -.2, .2); + hist2d[2] = new TH2F("hist2d2", "hist2d2", 120, .9, 1.1, 120, .9, 1.1); + for (int ij = 0; ij < hist2d[0]->GetNbinsX(); ij++) { + // if (hist2d[0]->GetBinCenter(ij+1)==0) continue; + for (int jk = 0; jk < hist2d[0]->GetNbinsY(); jk++) { + double xx = hist2d[0]->GetBinContent(ij + 1, jk + 1); + if (xx > 0.5) { + histx[0]->Fill(xx); + } + if (ij != 15) + file_out << hist2d[0]->GetXaxis()->GetBinCenter(ij + 1) << "\t" << jk + 1 << "\t " << xx << endl; + + double yy = hist2d[1]->GetBinContent(ij + 1, jk + 1); + if (yy > 0.5) { + histx[1]->Fill(yy); + } + if (xx > .5 && yy > .5) { + histx[2]->Fill(yy - xx); + hist2d[2]->Fill(xx, yy); + } + } + } + TCanvas* c1 = new TCanvas("c1", "c1", 500, 500); + // c1->Divide(2,2); + /* c1->cd(1); histx[0]->Fit("gaus"); + c1->cd(2); histx[1]->Fit("gaus"); + c1->cd(3); histx[2]->Fit("gaus"); + */ + + histx[0]->GetXaxis()->SetTitle("Correction factor"); + histx[0]->GetXaxis()->SetLabelOffset(.001); + histx[0]->GetXaxis()->SetLabelSize(0.0645); + histx[0]->GetXaxis()->SetTitleSize(0.065); + histx[0]->GetXaxis()->SetTitleOffset(0.75); + + histx[0]->GetYaxis()->SetTitle("Entries/0.005"); + histx[0]->GetYaxis()->SetLabelOffset(.001); + histx[0]->GetYaxis()->SetLabelSize(0.0645); + histx[0]->GetYaxis()->SetTitleSize(0.065); + histx[0]->GetYaxis()->SetTitleOffset(1.05); + + histx[0]->SetLineWidth(1); + histx[0]->Fit("gaus"); + // c1->cd(4); gPad->SetLogy(0); hist2d[2]->Draw("colz"); + // cmsPrel(.25, .45, .85, .62, 0.04, 35); + file_out.close(); +} + +void const_term_2dx(const char* varname = "const_eta_phi") { + gStyle->SetOptStat(0); + gStyle->SetOptTitle(0); + gStyle->SetOptLogy(0); + + gStyle->SetPalette(1, 0); + gStyle->SetPadTopMargin(0.12); + gStyle->SetPadBottomMargin(0.12); + gStyle->SetPadLeftMargin(0.08); + gStyle->SetPadRightMargin(0.15); + + TH2F* hist2d = (TH2F*)gDirectory->Get(varname); + + hist2d->SetMaximum(1.5); + hist2d->SetMinimum(0.7); + hist2d->GetXaxis()->SetTitle("i#eta"); + hist2d->GetYaxis()->SetTitle("i#phi"); + + hist2d->Draw("colz"); + + cmsPrel2(.75, .5, .15, .92, 0.025, 35); +} + +double hothreshs[nhothresh + 1] = {0.15, 0.25, 0.5, 1.0, 2.0, 5.0, 10.0, 20., 50, 100., 10000.}; +void def_setting() { + gStyle->SetPadTopMargin(0.02); + gStyle->SetPadBottomMargin(0.15); + gStyle->SetPadLeftMargin(0.08); + gStyle->SetPadRightMargin(0.16); + gStyle->SetOptStat(0); + // gStyle->SetPadGridX(1); + // gStyle->SetPadGridY(1); + // gStyle->SetGridStyle(3); + gStyle->SetGridWidth(1); + gStyle->SetTitleFontSize(0.09); + gStyle->SetTitleOffset(-0.09); + gStyle->SetTitleBorderSize(1); + gStyle->SetLabelSize(0.095, "XY"); + gStyle->SetOptTitle(0); + gStyle->SetOptStat(0); + gStyle->SetNdivisions(404, "XYZ"); + + gStyle->SetStatTextColor(1); + gStyle->SetStatX(.99); + gStyle->SetStatY(.99); + gStyle->SetStatW(.3); + gStyle->SetStatH(.2); + + gStyle->SetOptLogy(0); +} + +void const_term(const char* varname = "const_eta_phi") { + ofstream file_out("test_output.log"); + gStyle->SetOptFit(101); + gStyle->SetOptStat(0); + gStyle->SetOptLogy(1); + gStyle->SetLabelSize(.065, "XY"); + + TH2F* hist2d[3]; + + hist2d[0] = (TH2F*)gDirectory->Get("const_eta_phi"); + hist2d[1] = (TH2F*)gDirectory->Get("const_eta_phisum"); + + TH1F* histx[3]; + histx[0] = new TH1F("histx0", "const_eta_phi", 120, .7, 1.3); + histx[1] = new TH1F("histx1", "const_eta_phisum", 120, .7, 1.3); + histx[2] = new TH1F("histx2", "diff", 120, -.2, .2); + hist2d[2] = new TH2F("hist2d2", "hist2d2", 120, .9, 1.1, 120, .9, 1.1); + + for (int ij = 0; ij < hist2d[0]->GetNbinsX(); ij++) { + // if (hist2d[0]->GetBinCenter(ij+1)==0) continue; + for (int jk = 0; jk < hist2d[0]->GetNbinsY(); jk++) { + double xx = hist2d[0]->GetBinContent(ij + 1, jk + 1); + if (xx > 0.5) { + histx[0]->Fill(xx); + } + if (ij != 15) + file_out << hist2d[0]->GetXaxis()->GetBinCenter(ij + 1) << "\t" << jk + 1 << "\t " << xx << endl; + + double yy = hist2d[1]->GetBinContent(ij + 1, jk + 1); + if (yy > 0.5) { + histx[1]->Fill(yy); + } + if (xx > .5 && yy > .5) { + histx[2]->Fill(yy - xx); + hist2d[2]->Fill(xx, yy); + } + } + } + TCanvas* c1 = new TCanvas("c1", "c1", 700, 900); + c1->Divide(2, 2); + c1->cd(1); + histx[0]->Fit("gaus"); + c1->cd(2); + histx[1]->Fit("gaus"); + c1->cd(3); + histx[2]->Fit("gaus"); + c1->cd(4); + gPad->SetLogy(0); + hist2d[2]->Draw("colz"); + file_out.close(); +} + +void const_term_2d(const char* varname = "const_eta_phi") { + gStyle->SetOptStat(0); + gStyle->SetOptTitle(0); + gStyle->SetPalette(1, 0); + gStyle->SetPadTopMargin(0.09); + gStyle->SetPadBottomMargin(0.11); + gStyle->SetPadLeftMargin(0.11); + gStyle->SetPadRightMargin(0.15); + + TLatex latex; + latex.SetNDC(); + latex.SetTextSize(0.065); + latex.SetTextFont(42); + latex.SetTextAlign(31); // align right + + TH2F* hist2d = (TH2F*)gDirectory->Get(varname); + + hist2d->GetXaxis()->SetLabelOffset(.001); + hist2d->GetXaxis()->SetLabelSize(0.064); + hist2d->GetXaxis()->SetTitle("i#eta"); + hist2d->GetXaxis()->SetTitleSize(0.065); + hist2d->GetXaxis()->SetTitleOffset(0.75); + hist2d->GetXaxis()->SetTitleColor(1); + hist2d->GetXaxis()->CenterTitle(); + + hist2d->GetYaxis()->SetLabelOffset(.001); + hist2d->GetYaxis()->SetLabelSize(0.064); + hist2d->GetYaxis()->SetTitleSize(0.065); + hist2d->GetYaxis()->SetTitle("i#phi"); + hist2d->GetYaxis()->SetTitleOffset(0.68); + hist2d->GetYaxis()->CenterTitle(); + + hist2d->GetZaxis()->SetLabelSize(0.045); + + // hist2d->SetMaximum(1.2); + hist2d->SetMinimum(0.7); + hist2d->Draw("colz"); //"colz"); + // //c1->SaveAs("test.png"); + // cout <<"XX "<SetLabelColor(1); + // palette->SetLabelFont(22); + // palette->SetLabelOffset(0.005); + // palette->SetLabelSize(0.0436); + // palette->SetTitleOffset(1); + // palette->SetTitleSize(0.08); + // palette->SetFillColor(100); + // palette->SetFillStyle(1001); + // hist2d->GetListOfFunctions()->Add(palette,"br"); + // hist2d->Draw("colz"); + // // cmsPrel2(.75, .5, .15, .92, 0.03, 35); + + char name[100] = gDirectory->GetName(); + char namex[20]; + char namey[50]; + strncpy(namex, name, 15); + cout << namex << endl; + latex.DrawLatex(0.65, 0.92, namex); + sprintf(namey, "statistics_2d_%s.png", namex); + c1->SaveAs(namey); +} + +void signal4(int ival = 0, int ndvy = 3) { + gStyle->SetOptStat(0); + gStyle->SetPadTopMargin(0.11); + gStyle->SetPadBottomMargin(0.08); + gStyle->SetPadLeftMargin(0.08); + gStyle->SetPadRightMargin(0.20); + TCanvas* c1 = new TCanvas("c1", "c1", 700, 900); + + char name[100]; + + c1->Divide(3, ndvy); + + TH2F* histx[100]; + for (int ij = 0; ij < 3 * ndvy; ij++) { + // sprintf(name, "hoCalibc/%s_%i", varnam, ij); + histx[ij] = (TH2F*)gDirectory->Get(name); + switch (ival) { + case 0: + histx[ij] = (TH2F*)totalproj[ij]->Clone(); + break; + case 1: + histx[ij] = (TH2F*)total2proj[ij]->Clone(); + break; + case 2: + histx[ij] = (TH2F*)totalprojsig[ij]->Clone(); + break; + case 3: + histx[ij] = (TH2F*)total2projsig[ij]->Clone(); + break; + case 4: + histx[ij] = (TH2F*)totalhpd[ij]->Clone(); + break; + case 5: + histx[ij] = (TH2F*)total2hpd[ij]->Clone(); + break; + case 6: + histx[ij] = (TH2F*)totalhpdsig[ij]->Clone(); + break; + case 7: + histx[ij] = (TH2F*)total2hpdsig[ij]->Clone(); + break; + default: + break; + } + c1->cd(ij + 1); + if (strstr(histx[ij]->GetName(), "sig")) { + histx[ij]->SetMaximum(TMath::Min(3., histx[ij]->GetMaximum())); + } + histx[ij]->GetXaxis()->SetLabelSize(0.075); + histx[ij]->GetYaxis()->SetLabelSize(0.075); + histx[ij]->GetZaxis()->SetLabelSize(0.065); + histx[ij]->GetXaxis()->SetNdivisions(404); + histx[ij]->GetYaxis()->SetNdivisions(404); + histx[ij]->Draw("colz"); + } + c1->Update(); +} + +// plot_var("sigvsacc") +void plot_var(int icut) { + const int nvar = 15; + gStyle->SetTitleFontSize(0.075); + gStyle->SetTitleBorderSize(1); + gStyle->SetPadTopMargin(0.10); + gStyle->SetPadBottomMargin(0.10); + char title[100]; + TCanvas* c1 = new TCanvas("c1", "runfile", 700., 900.); + c1->Divide(5, 3, 1.e-5, 1.e-5, 0); + + TH2F* fprofx[nvar]; + for (int ij = 0; ij < nvar; ij++) { + c1->cd(ij + 1); + sprintf(title, "hoCalibc/sigring_%i_%i", icut, ij); + + fprofx[ij] = (TH2F*)gDirectory->Get(title); + fprofx[ij]->GetXaxis()->SetLabelOffset(-0.03); + fprofx[ij]->GetXaxis()->SetLabelSize(0.085); + fprofx[ij]->GetYaxis()->SetLabelSize(0.075); + fprofx[ij]->GetZaxis()->SetLabelSize(0.065); + fprofx[ij]->GetYaxis()->SetNdivisions(404); + fprofx[ij]->GetXaxis()->SetNdivisions(404); + fprofx[ij]->SetLineColor(2); + fprofx[ij]->SetLineWidth(2); + + fprofx[ij]->Draw("colz"); + fprofx[ij]->ProfileX()->Draw("same"); + + // if (ij==7) { + // TPaveStats *ptst = new TPaveStats(0.5,0.5,0.7,0.6,"brNDC"); + // ptst->SetFillColor(10); + // TText* text = ptst->AddText(var); + // text->SetTextSize(0.092); + // ptst->SetBorderSize(1); + // // ptst->AddText(name); + // ptst->Draw(); + // } + } + c1->Update(); +} + +// plot_var("sigvsacc") +void plot_varprof(int icut) { + const int nvar = 15; + gStyle->SetTitleFontSize(0.075); + gStyle->SetTitleBorderSize(1); + gStyle->SetPadTopMargin(0.12); + gStyle->SetPadBottomMargin(0.10); + char title[100]; + TCanvas* c1 = new TCanvas("c1", "runfile", 700., 900.); + c1->Divide(5, 3, 1.e-5, 1.e-5, 0); + + TProfile* fprofx[nvar]; + for (int ij = 0; ij < nvar; ij++) { + c1->cd(ij + 1); + sprintf(title, "hoCalibc/sigring_%i_%i", icut, ij); + + fprofx[ij] = (TProfile*)(((TH2F*)gDirectory->Get(title))->ProfileX()); + fprofx[ij]->GetXaxis()->SetLabelOffset(-0.03); + fprofx[ij]->GetXaxis()->SetLabelSize(0.085); + fprofx[ij]->GetYaxis()->SetLabelSize(0.075); + fprofx[ij]->GetYaxis()->SetNdivisions(404); + fprofx[ij]->GetXaxis()->SetNdivisions(404); + fprofx[ij]->SetLineColor(2); + fprofx[ij]->SetLineWidth(2); + + fprofx[ij]->Draw(); + + // if (ij==7) { + // TPaveStats *ptst = new TPaveStats(0.5,0.5,0.7,0.6,"brNDC"); + // ptst->SetFillColor(10); + // TText* text = ptst->AddText(var); + // text->SetTextSize(0.092); + // ptst->SetBorderSize(1); + // // ptst->AddText(name); + // ptst->Draw(); + // } + } + c1->Update(); +} + +void plot_var_tray(int id = 0, int icut = 0) { + //plot_var_tray(0,1) + + char title[100]; + TCanvas* c1 = new TCanvas("c1", "runfile", 700., 900.); + c1->Divide(5, 6, 1.e-5, 1.e-5, 0); + + TH2F* fprofx[30]; + int itag = 0; + for (int jk = 0; jk < 6; jk++) { + for (int ij = 0; ij < 5; ij++) { + c1->cd(itag + 1); + sprintf(title, "hoCalibc/sigtray_%i_%i_%i", icut, 5 * id + ij, jk); + + fprofx[itag] = (TH2F*)gDirectory->Get(title); + fprofx[itag]->GetXaxis()->SetLabelOffset(-.001); + fprofx[itag]->GetXaxis()->SetLabelSize(0.085); + fprofx[itag]->GetYaxis()->SetLabelSize(0.085); + fprofx[itag]->GetZaxis()->SetLabelSize(0.065); + fprofx[itag]->GetYaxis()->SetNdivisions(404); + fprofx[itag]->GetXaxis()->SetNdivisions(404); + fprofx[itag]->SetLineColor(2); + fprofx[itag]->SetLineWidth(2); + + fprofx[itag]->Draw("colz"); + fprofx[itag]->ProfileX()->Draw("same"); + // if (itag==7) { + // TPaveStats *ptst = new TPaveStats(0.5,0.5,0.7,0.6,"brNDC"); + // ptst->SetFillColor(10); + // TText* text = ptst->AddText(var); + // text->SetTextSize(0.092); + // ptst->SetBorderSize(1); + // // ptst->AddText(name); + // ptst->Draw(); + // } + + itag++; + } + } + c1->Update(); +} + +void plot_var_trayprof(int id = 0, int icut = 0) { + //plot_var_tray(0,1) + + char title[100]; + TCanvas* c1 = new TCanvas("c1", "runfile", 700., 900.); + c1->Divide(5, 6, 1.e-5, 1.e-5, 0); + + TProfile* fprofx[30]; + int itag = 0; + for (int jk = 0; jk < 6; jk++) { + for (int ij = 0; ij < 5; ij++) { + c1->cd(itag + 1); + sprintf(title, "hoCalibc/sigtray_%i_%i_%i", icut, 5 * id + ij, jk); + + fprofx[itag] = (TProfile*)(((TH2F*)gDirectory->Get(title))->ProfileX()); + fprofx[itag]->GetXaxis()->SetLabelOffset(-.001); + fprofx[itag]->GetXaxis()->SetLabelSize(0.085); + fprofx[itag]->GetYaxis()->SetLabelSize(0.085); + fprofx[itag]->GetYaxis()->SetNdivisions(404); + fprofx[itag]->GetXaxis()->SetNdivisions(404); + fprofx[itag]->SetLineColor(2); + fprofx[itag]->SetLineWidth(2); + + fprofx[itag]->Draw(); + // if (itag==7) { + // TPaveStats *ptst = new TPaveStats(0.5,0.5,0.7,0.6,"brNDC"); + // ptst->SetFillColor(10); + // TText* text = ptst->AddText(var); + // text->SetTextSize(0.092); + // ptst->SetBorderSize(1); + // // ptst->AddText(name); + // ptst->Draw(); + // } + + itag++; + } + } + c1->Update(); +} + +void plot_var_eta(int id = 0, int icut = 0) { + //plot_var_eta(0,1) + + const int netamx = 30; + + char title[100]; + TCanvas* c1 = new TCanvas("c1", "runfile", 700., 900.); + c1->Divide(5, 6, 1.e-5, 1.e-5, 0); + + TH2F* fprofx[netamx]; + for (int ij = 0; ij < netamx; ij++) { + c1->cd(ij + 1); + sprintf(title, "hoCalibc/sigeta_%i_%i_%i", icut, id, ij); + fprofx[ij] = (TH2F*)gDirectory->Get(title); + fprofx[ij]->GetXaxis()->SetLabelOffset(-0.001); + fprofx[ij]->GetXaxis()->SetLabelSize(0.085); + fprofx[ij]->GetYaxis()->SetLabelSize(0.085); + fprofx[ij]->GetZaxis()->SetLabelSize(0.065); + fprofx[ij]->GetYaxis()->SetNdivisions(404); + fprofx[ij]->GetXaxis()->SetNdivisions(404); + fprofx[ij]->SetLineColor(2); + fprofx[ij]->SetLineWidth(2); + + fprofx[ij]->Draw("colz"); + fprofx[ij]->ProfileX()->Draw("same"); + + // if (ij==7) { + // TPaveStats *ptst = new TPaveStats(0.5,0.5,0.7,0.6,"brNDC"); + // ptst->SetFillColor(10); + // TText* text = ptst->AddText(var); + // text->SetTextSize(0.092); + // ptst->SetBorderSize(1); + // // ptst->AddText(name); + // ptst->Draw(); + // } + } + c1->Update(); +} + +void plot_var_etaprof(int id = 0, int icut = 0) { + //plot_var_eta(0,1) + + const int netamx = 30; + + char title[100]; + TCanvas* c1 = new TCanvas("c1", "runfile", 700., 900.); + c1->Divide(5, 6, 1.e-5, 1.e-5, 0); + + TProfile* fprofx[netamx]; + for (int ij = 0; ij < netamx; ij++) { + c1->cd(ij + 1); + sprintf(title, "hoCalibc/sigeta_%i_%i_%i", icut, id, ij); + fprofx[ij] = (TProfile*)(((TH2F*)gDirectory->Get(title))->ProfileX()); + fprofx[ij]->GetXaxis()->SetLabelOffset(-0.001); + fprofx[ij]->GetXaxis()->SetLabelSize(0.085); + fprofx[ij]->GetYaxis()->SetLabelSize(0.085); + fprofx[ij]->GetYaxis()->SetNdivisions(404); + fprofx[ij]->GetXaxis()->SetNdivisions(404); + fprofx[ij]->SetLineColor(2); + fprofx[ij]->SetLineWidth(2); + + fprofx[ij]->Draw(); + } + c1->Update(); +} + +void plotyx() { + // // sprintf (outfile,"%s.ps",outfilx); + // TPostScript ps("test.ps",111); + // ps.Range(20,28); + TCanvas* c1 = new TCanvas("c1", "runfile", 700., 900.); + + for (int kl = 0; kl < ncut; kl++) { + // ps.NewPage(); + plot_var(kl); + } + // ps.Close(); +} + +void plotallx() { + // // gDirectory->DeleteAll(); + // gStyle->Reset(); + gStyle->SetTitleFontSize(0.075); + gStyle->SetTitleBorderSize(1); + gStyle->SetPadTopMargin(0.12); + gStyle->SetPadBottomMargin(0.10); + gStyle->SetPadGridX(1); + gStyle->SetPadGridY(1); + gStyle->SetGridStyle(3); + gStyle->SetOptStat(0); + gStyle->SetTitleBorderSize(1); + + TCanvas* c1 = new TCanvas("c1", "runfile", 700., 900.); + int ips = 111; + // // sprintf (outfile,"%s.ps",outfilx); + TPostScript ps("test_2016e.ps", ips); + ps.Range(20, 28); + bool m_select_plot = true; + // cout<<"1xx "<SetTitleFontSize(0.095); + for (int ix = 0; ix < 3; ix++) { + for (int iy = 0; iy < ncut; iy++) { + ps.NewPage(); + plot_var_eta(ix, iy); + ps.NewPage(); + plot_var_etaprof(ix, iy); + } + } + + for (int ix = 0; ix < 3; ix++) { + for (int iy = 0; iy < ncut; iy++) { + ps.NewPage(); + plot_var_tray(ix, iy); + ps.NewPage(); + plot_var_trayprof(ix, iy); + } + } + } + + char name[100]; + totalmuon = (TH2F*)gDirectory->Get("hoCalibc/totalmuon"); + total2muon = (TH2F*)gDirectory->Get("hoCalibc/total2muon"); + + for (int ij = 0; ij < 9; ij++) { + sprintf(name, "hoCalibc/totalproj_%i", ij); + totalproj[ij] = (TH2F*)gDirectory->Get(name); + + sprintf(name, "hoCalibc/totalprojsig_%i", ij); + totalprojsig[ij] = (TH2F*)gDirectory->Get(name); + + sprintf(name, "hoCalibc/total2proj_%i", ij); + total2proj[ij] = (TH2F*)gDirectory->Get(name); + + sprintf(name, "hoCalibc/total2projsig_%i", ij); + total2projsig[ij] = (TH2F*)gDirectory->Get(name); + + total2projsig[ij]->Divide(total2proj[ij]); + totalprojsig[ij]->Divide(totalproj[ij]); + + total2proj[ij]->Divide(total2muon); + totalproj[ij]->Divide(totalmuon); + } + + for (int ij = 0; ij < 18; ij++) { + sprintf(name, "hoCalibc/totalhpd_%i", ij); + totalhpd[ij] = (TH2F*)gDirectory->Get(name); + + sprintf(name, "hoCalibc/totalhpdsig_%i", ij); + totalhpdsig[ij] = (TH2F*)gDirectory->Get(name); + + sprintf(name, "hoCalibc/total2hpd_%i", ij); + total2hpd[ij] = (TH2F*)gDirectory->Get(name); + + sprintf(name, "hoCalibc/total2hpdsig_%i", ij); + total2hpdsig[ij] = (TH2F*)gDirectory->Get(name); + + total2hpdsig[ij]->Divide(total2hpd[ij]); + totalhpdsig[ij]->Divide(totalhpd[ij]); + + total2hpd[ij]->Divide(total2muon); + totalhpd[ij]->Divide(totalmuon); + } + for (int ij = 0; ij < 8; ij++) { + ps.NewPage(); + signal4(ij, (ij <= 3) ? 3 : 6); + } + // cout<<"8xx "<Divide(4, 2); + c1->cd(1); + totalmuon->Draw("colz"); + c1->cd(2); + totalproj_3->Draw("colz"); + c1->cd(3); + totalproj_4->Draw("colz"); + c1->cd(4); + totalproj_5->Draw("colz"); + c1->cd(5); + total2muon->Draw("colz"); + c1->cd(6); + total2proj_3->Draw("colz"); + c1->cd(7); + total2proj_4->Draw("colz"); + c1->cd(8); + total2proj_5->Draw("colz"); +} + +void signal2() { + TCanvas* c1 = new TCanvas("c1", "c1", 800., 600.); + c1->Divide(4, 2); + c1->cd(1); + totalmuon->Draw("colz"); + c1->cd(2); + totalproj_3->Draw("colz"); + c1->cd(3); + totalproj_4->Draw("colz"); + c1->cd(4); + totalproj_5->Draw("colz"); + + c1->cd(6); + totalprojsig_3->Draw("colz"); + c1->cd(7); + totalprojsig_4->Draw("colz"); + c1->cd(8); + totalprojsig_5->Draw("colz"); +} +void signal3() { + TCanvas* c1 = new TCanvas("c1", "c1", 800., 600.); + c1->Divide(4, 2); + c1->cd(1); + total2muon->Draw("colz"); + c1->cd(2); + total2proj_3->Draw("colz"); + c1->cd(3); + total2proj_4->Draw("colz"); + c1->cd(4); + total2proj_5->Draw("colz"); + + c1->cd(6); + total2projsig_3->Draw("colz"); + c1->cd(7); + total2projsig_4->Draw("colz"); + c1->cd(8); + total2projsig_5->Draw("colz"); +} + +//signal4("totalproj",3); +//signal4("total2proj",3); +//signal4("totalprojsig",3); +//signal4("total2projsig",3); + +//signal4("totalhpd",6); +//signal4("total2hpd",6); +//signal4("totalhpdsig",6); +//signal4("total2hpdsig",6); + +// void signal4(const char* varnam="total2proj", int ndvy=3) { +// gStyle->SetOptStat(0); + +// TCanvas* c1 = new TCanvas("c1", "c1", 1200., 600.); + +// char name[100]; +// TH2F* histx[100]; +// c1->Divide(ndvy, 3); +// for (int ij=0; ij <3*ndvy; ij++) { +// sprintf(name, "%s_%i", varnam, ij); +// histx[ij] = (TH2F*)gDirectory->Get(name); +// c1->cd(ij+1); +// histx[ij]->Draw("colz"); +// } +// } + +void testplotx2(int thmn = 2, int thmx = 6) { + gStyle->SetPadTopMargin(0.11); + gStyle->SetPadBottomMargin(0.04); + gStyle->SetPadLeftMargin(0.06); + gStyle->SetPadRightMargin(0.02); + gStyle->SetOptStat(0); + gStyle->SetOptTitle(); + gStyle->SetPadGridX(1); + gStyle->SetPadGridY(1); + gStyle->SetGridStyle(3); + gStyle->SetGridWidth(1); + gStyle->SetTitleColor(10); + gStyle->SetTitleFontSize(0.09); + gStyle->SetTitleOffset(-0.09); + gStyle->SetTitleBorderSize(1); + gStyle->SetLabelSize(0.095, "XY"); + + // const int nfile=3; + // char* indexx[nfile]={"1_27", "28_122", "123_181"}; + + const int nringmx = 5; + + const int routmx = 36; + const int rout12mx = 24; + + const int rbxmx = 12; // HO readout box in Ring 0 + const int rbx12mx = 6; //HO readout box in Ring+-1/2 + + const int nprojmx = 4; + const int nseltype = 4; //Different crit for muon selection + const int nadmx = 18; + const int shapemx = 10; //checking shape + + char* projname[nprojmx] = {"totalproj", "totalprojsig", "totalhpd", "totalhpdsig"}; + + // TH2F* total2muon; + + TH2F* totalmuon[nseltype]; + TH2F* totalproj[nseltype][nprojmx][nadmx]; + + const int nprojtype = 5; // Varities due to types of muon projection + TH2F* histent[nprojtype + 3]; + TH2F* histen[nprojtype + 3]; + TH2F* histen2[nprojtype + 3]; + TH2F* histerr[nprojtype]; + + const int nhothresh = 10; + TH2F* h_allmucorrel[nhothresh]; + TH2F* hnorm_allmucorrel[nhothresh]; + + TH1F* endigicnt[nprojtype + 1][nhothresh]; + TH1F* endigisig[nprojtype + 1][nhothresh]; + + TH2F* rmdigicnt[nprojtype + 1][nhothresh]; + TH2F* rmdigisig[nprojtype + 1][nhothresh]; + + TH2F* ringdigicnt[nprojtype + 1][nhothresh]; + TH2F* ringdigisig[nprojtype + 1][nhothresh]; + + TH2F* inddigicnt[nprojtype + 1][nhothresh]; + TH2F* inddigisig[nprojtype + 1][nhothresh]; + + TH2F* indrecocnt[nprojtype + 1][nhothresh]; + TH2F* indrecosig[nprojtype + 1][nhothresh]; + + TH1F* rout_mult[nhothresh][nringmx][routmx + 1]; + TH1F* rbx_mult[nhothresh][nringmx][rbxmx + 1]; + + TH1F* rout_ind_energy[nringmx][routmx + 1]; + + TH2F* h_correlht[nhothresh]; + TH2F* h_correlsig[nringmx][nhothresh]; + TH2F* h_rmoccu[nhothresh]; + TH2F* h_rmcorrel[nhothresh]; + + TH2F* h_allcorrelsig[nhothresh]; + + TH2F* rbx_shape[shapemx][nringmx][routmx + 1]; + + char name[100]; + + int ips = 111; + TPostScript ps("allmuho.ps", ips); + ps.Range(20, 28); + + TFile* fx = new TFile("histall_apr14b_cosmic_csa14_cosmic.root", "read"); + // TFile* fx = new TFile("hist_apr14c_cosmic_csa14_cosmic.root", "read"); + // TFile* fx = new TFile("histall_cosmic_csa14_cosmic_set.root", "read"); + // TFile* fx = new TFile("apr14/apr14b/hist_cosmic_csa14_cosmic_set52.root", "read"); + for (int isel = 0; isel < nseltype; isel++) { + sprintf(name, "hoCalibc/totalmuon_%i", isel); + totalmuon[isel] = (TH2F*)fx->Get(name); + } + // total2muon = (TH2F*) fx->Get("hoCalibc/total2muon"); + + TCanvas* c0 = new TCanvas("c0", "mean rms", 600, 800); + c0->Divide(2, 2); + + TCanvas* c3 = new TCanvas("c3", "mean rms", 600, 800); + + TCanvas* c1 = new TCanvas("c1", "c1", 600, 900); + c1->Divide(3, 3); + + TCanvas* c2 = new TCanvas("c2", "c2", 600, 900); + c2->Divide(3, 6); + + TCanvas* c4x = new TCanvas("c4x", "c4x", 600., 800.); + c4x->Divide(2, 6); + + TCanvas* c4 = new TCanvas("c4", "c4", 600., 800.); + c4->Divide(2, 6); + + TCanvas* c5 = new TCanvas("c5", "c5", 600., 800.); + c5->Divide(6, 6); + + TCanvas* c6 = new TCanvas("c6", "c6", 600., 800.); + c6->Divide(2, 5); + + TH2F* h2d_nhocapid[nprojtype]; + TH2F* h2d_hocapidsig[nprojtype]; + TH2F* h2d_hocapidsigwo[nprojtype]; + + for (int ij = 0; ij < nprojtype; ij++) { + sprintf(name, "hoCalibc/nhocapid_%i", ij); + h2d_nhocapid[ij] = (TH2F*)fx->Get(name); + + sprintf(name, "hoCalibc/hocapidsig_%i", ij); + h2d_hocapidsig[ij] = (TH2F*)fx->Get(name); + + sprintf(name, "hoCalibc/hocapidsigwo_%i", ij); + h2d_hocapidsigwo[ij] = (TH2F*)fx->Get(name); + + h2d_hocapidsig[ij]->Divide(h2d_nhocapid[ij]); + h2d_hocapidsigwo[ij]->Divide(h2d_nhocapid[ij]); + + ps.NewPage(); + c3->cd(); + h2d_hocapidsig[ij]->Draw("colz"); + c3->Update(); + + ps.NewPage(); + c3->cd(); + h2d_hocapidsigwo[ij]->Draw("colz"); + c3->Update(); + } + + for (int ij = 0; ij < nprojtype; ij++) { + sprintf(name, "hoCalibc/hbentry_d%i", ij + 3); + cout << "ij " << name << endl; + histent[ij] = (TH2F*)fx->Get(name); + // histent[ij]->Draw(); + sprintf(name, "hoCalibc/hbsig_d%i", ij + 3); + histen[ij] = (TH2F*)fx->Get(name); + sprintf(name, "hoCalibc/hbsig2_d%i", ij + 3); + histen2[ij] = (TH2F*)fx->Get(name); + + int nentry = TMath::Max(1., histent[ij]->GetBinContent(0, 0)); + cout << "ij " << nentry << endl; + + histen[ij]->Divide(histent[ij]); + histen2[ij]->Divide(histent[ij]); + + histent[ij]->Scale(1. / nentry); + + int xbin = histen[ij]->GetNbinsX(); + int ybin = histen[ij]->GetNbinsY(); + sprintf(name, "histerr_%i", ij); //, indexx[ij]); + histerr[ij] = new TH2F(name, + name, + xbin, + histent[ij]->GetXaxis()->GetXmin(), + histent[ij]->GetXaxis()->GetXmax(), + ybin, + histent[ij]->GetYaxis()->GetXmin(), + histent[ij]->GetYaxis()->GetXmax()); + + for (int jk = 1; jk <= xbin; jk++) { + for (int kl = 1; kl <= ybin; kl++) { + double err = sqrt(histen2[ij]->GetBinContent(jk, kl) - + histen[ij]->GetBinContent(jk, kl) * histen[ij]->GetBinContent(jk, kl)); + + histerr[ij]->Fill(histent[ij]->GetXaxis()->GetBinCenter(jk), histent[ij]->GetYaxis()->GetBinCenter(kl), err); + } + } + + ps.NewPage(); + cout << "ij11 " << ij << " " << histent[ij]->GetBinContent(22, 22) << endl; + c0->cd(1); /*histent[ij]->GetXaxis()->SetRangeUser(-15.49,15.49);*/ + histent[ij]->Draw("colz"); + cout << "ij12 " << ij << " " << histen[ij]->GetBinContent(22, 22) << endl; + c0->cd(2); + histen[ij]->GetXaxis()->SetRangeUser(-15.49, 15.49); + histen[ij]->Draw("colz"); + cout << "ij13 " << ij << endl; + c0->cd(3); + histen2[ij]->GetXaxis()->SetRangeUser(-15.49, 15.49); + histen2[ij]->Draw("colz"); + cout << "ij14 " << ij << endl; + c0->cd(4); + histerr[ij]->GetXaxis()->SetRangeUser(-15.49, 15.49); + histerr[ij]->Draw("colz"); + cout << "ij15 " << ij << endl; + c0->Update(); + cout << "ij16 " << ij << endl; + } + + for (int jk = 0; jk < nringmx; jk++) { + for (int kl = 0; kl <= rbxmx; kl++) { + if (jk != 2 && kl > rbx12mx) + continue; + ps.NewPage(); + for (int lm = 0; lm < shapemx; lm++) { + if (kl == 0) { + sprintf(name, "hoCalibc/rbx_shape_%i_r%i_allrbx", lm, jk); + } else { + sprintf(name, "hoCalibc/rbx_shape_%i_r%i_%i", lm, jk, kl); + } + rbx_shape[lm][jk][kl] = (TH2F*)fx->Get(name); + c6->cd(int(lm / 5) + 2 * (lm % 5) + 1); + + rbx_shape[lm][jk][kl]->Draw("colz"); + } + c6->Update(); + } + } + + //Correlations + for (int ij = thmn; ij < thmx; ij++) { + sprintf(name, "hoCalibc/hocorrelht_%i", ij); + h_correlht[ij] = (TH2F*)fx->Get(name); + + h_correlht[ij]->Scale(1. / nentry); + + sprintf(name, "hoCalibc/hormoccu_%i", ij); + h_rmoccu[ij] = (TH2F*)fx->Get(name); + h_rmoccu[ij]->Scale(1. / nentry); + + sprintf(name, "hoCalibc/hormcorrel_%i", ij); + h_rmcorrel[ij] = (TH2F*)fx->Get(name); + h_rmcorrel[ij]->Scale(1. / nentry); + + for (int jk = 0; jk < nringmx; jk++) { + sprintf(name, "hoCalibc/hocorrelsig_%i_%i", jk, ij); + h_correlsig[jk][ij] = (TH2F*)fx->Get(name); + h_correlsig[jk][ij]->Scale(1. / nentry); + } + + cout << "ij2 " << ij << endl; + ps.NewPage(); + + c1->cd(1); + h_correlht[ij]->Draw("colz"); + // c1->cd(2); h_correlhten[ij][ij]->Draw("colz"); + c1->cd(2); + h_rmoccu[ij]->Draw("colz"); + c1->cd(3); + h_rmcorrel[ij]->Draw("colz"); + cout << "ij23 " << ij << endl; + for (int jk = 0; jk < nringmx; jk++) { + cout << "ij22 " << ij << endl; + c1->cd(jk + 4); + h_correlsig[jk][ij]->Draw("colz"); + } + cout << "ij21 " << ij << endl; + c1->Update(); + + sprintf(name, "hoCalibc/hoallcorrelsig_%i", ij); + cout << "ij24 " << ij << " " << name << endl; + h_allcorrelsig[ij] = (TH2F*)fx->Get(name); + h_allcorrelsig[ij]->Scale(1. / nentry); + cout << "ij25 " << ij << endl; + ps.NewPage(); + c3->cd(); + h_allcorrelsig[ij]->Draw("colz"); + c3->Update(); + cout << "ij2 " << ij << endl; + } + + for (int jk = 0; jk < nringmx; jk++) { + ps.NewPage(); + for (int kl = 1; kl <= routmx; kl++) { + if (jk != 2 && kl > rout12mx) + continue; + c5->cd(kl); + gPad->SetLogy(1); + if (kl == 0) { + sprintf(name, "hoCalibc/rout_ind_energy_r%i_allrout", jk); + } else { + sprintf(name, "hoCalibc/rout_ind_energy_r%i_%i", jk, kl); + } + rout_ind_energy[jk][kl] = (TH1F*)fx->Get(name); + rout_ind_energy[jk][kl]->Draw(); + } + c5->Update(); + } + + for (int ij = thmn; ij < thmx; ij++) { + // int klx=0; + for (int jk = 0; jk < nringmx; jk++) { + ps.NewPage(); + for (int kl = 1; kl <= routmx; kl++) { + if (jk != 2 && kl > rout12mx) + continue; + c5->cd(kl); + gPad->SetLogy(1); + if (kl == 0) { + sprintf(name, "hoCalibc/rout_mult_%i_r%i_allrout", ij, jk); + } else { + sprintf(name, "hoCalibc/rout_mult_%i_r%i_%i", ij, jk, kl); + } + rout_mult[ij][jk][kl] = (TH1F*)fx->Get(name); + rout_mult[ij][jk][kl]->Draw(); + } + c5->Update(); + } + } + + for (int ij = thmn; ij < thmx; ij++) { + int klx = 0; + for (int jk = 0; jk < nringmx; jk++) { + if (klx % 12 == 0) + ps.NewPage(); + for (int kl = 1; kl <= rbxmx; kl++) { + if (jk != 2 && kl > rbx12mx) + continue; + c4x->cd(klx % 12 + 1); + klx++; + gPad->SetLogy(1); + if (kl == 0) { + sprintf(name, "hoCalibc/rbx_mult_%i_r%i_allrbx", ij, jk); + } else { + sprintf(name, "hoCalibc/rbx_mult_%i_r%i_%i", ij, jk, kl); + } + rbx_mult[ij][jk][kl] = (TH1F*)fx->Get(name); + rbx_mult[ij][jk][kl]->Draw(); + } + if (klx % 12 == 0) + c4x->Update(); + } + } + + for (int ij = thmn; ij < thmx; ij++) { + for (int jk = 0; jk < nprojtype + 1; jk++) { + sprintf(name, "hoCalibc/endigisig_%i_%i", jk, ij); + cout << "name " << name << endl; + endigisig[jk][ij] = (TH1F*)fx->Get(name); + sprintf(name, "hoCalibc/endigicnt_%i_%i", jk, ij); + endigicnt[jk][ij] = (TH1F*)fx->Get(name); + + sprintf(name, "hoCalibc/rmdigisig_%i_%i", jk, ij); + rmdigisig[jk][ij] = (TH2F*)fx->Get(name); + sprintf(name, "hoCalibc/rmdigicnt_%i_%i", jk, ij); + rmdigicnt[jk][ij] = (TH2F*)fx->Get(name); + + sprintf(name, "hoCalibc/ringdigisig_%i_%i", jk, ij); + ringdigisig[jk][ij] = (TH2F*)fx->Get(name); + sprintf(name, "hoCalibc/ringdigicnt_%i_%i", jk, ij); + ringdigicnt[jk][ij] = (TH2F*)fx->Get(name); + + sprintf(name, "hoCalibc/inddigisig_%i_%i", jk, ij); + inddigisig[jk][ij] = (TH2F*)fx->Get(name); + sprintf(name, "hoCalibc/inddigicnt_%i_%i", jk, ij); + inddigicnt[jk][ij] = (TH2F*)fx->Get(name); + + sprintf(name, "hoCalibc/indrecosig_%i_%i", jk, ij); + indrecosig[jk][ij] = (TH2F*)fx->Get(name); + sprintf(name, "hoCalibc/indrecocnt_%i_%i", jk, ij); + indrecocnt[jk][ij] = (TH2F*)fx->Get(name); + + endigisig[jk][ij]->Divide(endigicnt[jk][ij]); + rmdigisig[jk][ij]->Divide(rmdigicnt[jk][ij]); + ringdigisig[jk][ij]->Divide(ringdigicnt[jk][ij]); + inddigisig[jk][ij]->Divide(inddigicnt[jk][ij]); + indrecosig[jk][ij]->Divide(indrecocnt[jk][ij]); + } + } + + ps.NewPage(); + + for (int ij = thmn; ij < thmx; ij++) { + ps.NewPage(); + for (int jk = 0; jk < nprojtype + 1; jk++) { + c4->cd(2 * jk + 1); + endigicnt[jk][ij]->Draw(); + c4->cd(2 * jk + 2); + endigisig[jk][ij]->Draw(); + } + c4->Update(); + } + + for (int ij = thmn; ij < thmx; ij++) { + ps.NewPage(); + for (int jk = 0; jk < nprojtype + 1; jk++) { + c4->cd(2 * jk + 1); + rmdigicnt[jk][ij]->Draw("colz"); + c4->cd(2 * jk + 2); + rmdigisig[jk][ij]->Draw("colz"); + } + c4->Update(); + } + + for (int ij = thmn; ij < thmx; ij++) { + ps.NewPage(); + for (int jk = 0; jk < nprojtype + 1; jk++) { + c4->cd(2 * jk + 1); + ringdigicnt[jk][ij]->Draw("colz"); + c4->cd(2 * jk + 2); + ringdigisig[jk][ij]->Draw("colz"); + } + c4->Update(); + } + + for (int ij = thmn; ij < thmx; ij++) { + ps.NewPage(); + for (int jk = 0; jk < nprojtype + 1; jk++) { + c4->cd(2 * jk + 1); + inddigicnt[jk][ij]->Draw("colz"); + c4->cd(2 * jk + 2); + inddigisig[jk][ij]->Draw("colz"); + } + c4->Update(); + } + + for (int ij = thmn; ij < thmx; ij++) { + ps.NewPage(); + for (int jk = 0; jk < nprojtype + 1; jk++) { + c4->cd(2 * jk + 1); + indrecocnt[jk][ij]->Draw("colz"); + c4->cd(2 * jk + 2); + indrecosig[jk][ij]->Draw("colz"); + } + c4->Update(); + } + + for (int ij = thmn; ij < thmx; ij++) { + sprintf(name, "hoCalibc/hoallmucorrel_%i", ij); + + double total = 0; + h_allmucorrel[ij] = (TH2F*)fx->Get(name); + hnorm_allmucorrel[ij] = (TH2F*)h_allmucorrel[ij]->Clone(); + for (int ix = 1; ix <= h_allmucorrel[ij]->GetNbinsX(); ix++) { + float anent = h_allmucorrel[ij]->GetBinContent(ix, 0); + total += anent; + cout << "ix " << ij << " " << ix << " " << anent << " " << total << endl; + if (anent < 1.) + anent = 1.; + for (int iy = 1; iy <= h_allmucorrel[ij]->GetNbinsY(); iy++) { + hnorm_allmucorrel[ij]->SetBinContent(ix, iy, h_allmucorrel[ij]->GetBinContent(ix, iy) / anent); + } + } + ps.NewPage(); + c3->cd(); + hnorm_allmucorrel[ij]->Draw("colz"); + c3->Update(); + } + + cout << "ij116 " << endl; + + for (int isel = 0; isel < nseltype; isel++) { + for (int ij = 0; ij < nprojmx / 2; ij++) { + ps.NewPage(); + for (int jk = 0; jk < nadmx / 2; jk++) { + sprintf(name, "hoCalibc/%s_%i_%i", projname[ij], isel, jk); + cout << "name " << name << endl; + totalproj[isel][ij][jk] = (TH2F*)fx->Get(name); + } + } + cout << "1ij116 " << endl; + for (int jk = 0; jk < nadmx / 2; jk++) { + totalproj[isel][1][jk]->Divide(totalproj[isel][0][jk]); + totalproj[isel][0][jk]->Divide(totalmuon[isel]); + } + + for (int ij = 0; ij < nprojmx / 2; ij++) { + ps.NewPage(); + for (int jk = 0; jk < nadmx / 2; jk++) { + c1->cd(jk + 1); + totalproj[isel][ij][jk]->Draw("colz"); + } + c1->Update(); + } + + cout << "2ij116 " << endl; + for (int ij = 2; ij < nprojmx; ij++) { + for (int jk = 0; jk < nadmx; jk++) { + sprintf(name, "hoCalibc/%s_%i_%i", projname[ij], isel, jk); + cout << "ij2 " << ij << " " << jk << " " << name << endl; + totalproj[isel][ij][jk] = (TH2F*)fx->Get(name); + } + } + cout << "3ij116 " << endl; + for (int jk = 0; jk < nadmx / 2; jk++) { + totalproj[isel][3][jk]->Divide(totalproj[isel][2][jk]); + totalproj[isel][2][jk]->Divide(totalmuon[isel]); + } + cout << "4ij116 " << endl; + + for (int ij = 2; ij < nprojmx; ij++) { + ps.NewPage(); + for (int jk = 0; jk < nadmx; jk++) { + c2->cd(jk + 1); + totalproj[isel][ij][jk]->Draw("colz"); + } + c2->Update(); + } + + cout << "5ij116 " << endl; + } + + ps.Close(); +} + +void testxx(int nproj = 1) { + def_setting(); + const int nprojtype = 5; // Varities due to types of muon projection + TH2F* histent[nprojtype + 3]; + TH2F* histen[nprojtype + 3]; + TH2F* histen2[nprojtype + 3]; + TH2F* histerr[nprojtype]; + gStyle->SetOptStat(0); + gStyle->SetPadTopMargin(0.06); + gStyle->SetPadBottomMargin(0.13); + gStyle->SetPadLeftMargin(0.10); + gStyle->SetPadRightMargin(0.12); + gStyle->SetLabelSize(0.065, "XY"); + + TLatex latex; + latex.SetNDC(); + latex.SetTextSize(0.07); + latex.SetTextFont(42); + latex.SetTextAlign(1); //(31); // align right + + cout << "testxxxx1 " << endl; + TCanvas* c1 = new TCanvas("c1", "c1", 800, 550); + cout << "testxxxx2 " << endl; + c1->Divide(2, 2); + // TFile* fx = new TFile("histall_apr14b_cosmic_csa14_cosmic.root", "read"); + char name[100]; + + for (int ij = 0; ij < nproj; ij++) { + sprintf(name, "hoCalibc/hbentry_d%i", ij + 3); + cout << "ij " << name << endl; + histent[ij] = (TH2F*)gDirectory->Get(name); + sprintf(name, "hoCalibc/hbsig_d%i", ij + 3); + histen[ij] = (TH2F*)gDirectory->Get(name); + sprintf(name, "hoCalibc/hbsig2_d%i", ij + 3); + histen2[ij] = (TH2F*)gDirectory->Get(name); + + int nentry = TMath::Max(1., histent[ij]->GetBinContent(0, 0)); + histen[ij]->Divide(histent[ij]); + histen2[ij]->Divide(histent[ij]); + + histent[ij]->Scale(1. / nentry); + + histen[ij]->GetXaxis()->SetLabelSize(0.065); + histen[ij]->GetYaxis()->SetLabelSize(0.065); + histen2[ij]->GetXaxis()->SetLabelSize(0.065); + histen2[ij]->GetYaxis()->SetLabelSize(0.065); + histent[ij]->GetXaxis()->SetLabelSize(0.065); + histent[ij]->GetYaxis()->SetLabelSize(0.065); + + int xbin = histen[ij]->GetNbinsX(); + int ybin = histen[ij]->GetNbinsY(); + sprintf(name, "histerr_%i", ij); //, indexx[ij]); + histerr[ij] = new TH2F(name, + name, + xbin, + histent[ij]->GetXaxis()->GetXmin(), + histent[ij]->GetXaxis()->GetXmax(), + ybin, + histent[ij]->GetYaxis()->GetXmin(), + histent[ij]->GetYaxis()->GetXmax()); + + for (int jk = 1; jk <= xbin; jk++) { + for (int kl = 1; kl <= ybin; kl++) { + double err = sqrt(histen2[ij]->GetBinContent(jk, kl) - + histen[ij]->GetBinContent(jk, kl) * histen[ij]->GetBinContent(jk, kl)); + + histerr[ij]->Fill(histent[ij]->GetXaxis()->GetBinCenter(jk), histent[ij]->GetYaxis()->GetBinCenter(kl), err); + } + } + + cout << "ij11 " << ij << " " << histent[ij]->GetBinContent(22, 22) << endl; + histent[ij]->GetXaxis()->SetTitle("i#eta"); + histent[ij]->GetXaxis()->SetTitleSize(0.075); + histent[ij]->GetXaxis()->SetTitleOffset(0.8); + histent[ij]->GetXaxis()->CenterTitle(); + histent[ij]->GetYaxis()->SetTitle("i#phi"); + histent[ij]->GetYaxis()->SetTitleSize(0.075); + histent[ij]->GetYaxis()->SetTitleOffset(0.6); + histent[ij]->GetYaxis()->CenterTitle(); + + c1->cd(1); + histent[ij]->Draw("colz"); + latex.DrawLatex(0.5, 0.95, "Occupancy"); + cout << "ij12 " << ij << " " << histen[ij]->GetBinContent(22, 22) << endl; + histen[ij]->GetXaxis()->SetTitle("i#eta"); + histen[ij]->GetXaxis()->SetTitleSize(0.075); + histen[ij]->GetXaxis()->SetTitleOffset(0.8); + histen[ij]->GetXaxis()->CenterTitle(); + histen[ij]->GetYaxis()->SetTitle("i#phi"); + histen[ij]->GetYaxis()->SetTitleSize(0.075); + histen[ij]->GetYaxis()->SetTitleOffset(0.6); + histen[ij]->GetYaxis()->CenterTitle(); + + c1->cd(2); + histen[ij]->Draw("colz"); + latex.DrawLatex(0.5, 0.95, "Mean"); + histen2[ij]->GetXaxis()->SetTitle("i#eta"); + histen2[ij]->GetXaxis()->SetTitleSize(0.075); + histen2[ij]->GetXaxis()->SetTitleOffset(0.8); + histen2[ij]->GetXaxis()->CenterTitle(); + histen2[ij]->GetYaxis()->SetTitle("i#phi"); + histen2[ij]->GetYaxis()->SetTitleSize(0.075); + histen2[ij]->GetYaxis()->SetTitleOffset(0.6); + histen2[ij]->GetYaxis()->CenterTitle(); + + c1->cd(3); + histen2[ij]->Draw("colz"); + latex.DrawLatex(0.5, 0.95, "(Mean^{2})"); + cout << "ij14 " << ij << endl; + histerr[ij]->GetXaxis()->SetTitle("i#eta"); + histerr[ij]->GetXaxis()->SetTitleSize(0.075); + histerr[ij]->GetXaxis()->SetTitleOffset(0.8); + histerr[ij]->GetXaxis()->CenterTitle(); + histerr[ij]->GetYaxis()->SetTitle("i#phi"); + histerr[ij]->GetYaxis()->SetTitleSize(0.075); + histerr[ij]->GetYaxis()->SetTitleOffset(0.6); + histerr[ij]->GetYaxis()->CenterTitle(); + + c1->cd(4); + histerr[ij]->Draw("colz"); + latex.DrawLatex(0.5, 0.95, "RMS"); + + cout << "ij15 " << ij << endl; + c1->Update(); + cout << "ij16 " << ij << endl; + + int nentry = TMath::Max(1., histent[ij]->GetBinContent(0, 0)); + cout << "ij " << nentry << endl; + } +} + +// plot000(-1,6,7,5) +// plot000(0,6,7,5) +// plot000(2,12,13,5) +// plot000(2,1,2,5) +// plot000(-1,1,2,5) +// plot000(3) +// plot000(2,5,10,5) + +void plot000(int irng = -1, int isect = 0, int isect2 = 5, int ntype = 1, const char* tag = "", int extcol = 0) { + def_setting(); + gStyle->SetOptLogy(1); + gStyle->SetOptStat(0); + gStyle->SetStatTextColor(3); + gStyle->SetStatY(.99); + gStyle->SetPadLeftMargin(0.12); + gStyle->SetPadRightMargin(0.02); + gStyle->SetPadTopMargin(0.02); + gStyle->SetPadBottomMargin(0.12); + TLatex latex; + latex.SetNDC(); + latex.SetTextSize(0.07); + // latex.SetTextColor(extcol+1); + latex.SetTextFont(42); + latex.SetTextAlign(1); //(31); // align right + /* + char pch1[200]; + cout<<" namec "<GetName()<GetName(); + int len =strstr(namex, "."); + int len1 =strstr(namex, "\\"); + int len2=strlen(namex); + + strncpy (pch1, namex+17, len2-22); + cout <<"name "<< namex<<" "<SetFillColor(10); + tleg->SetBorderSize(0); + tleg->SetTextFont(42); + + char name[100]; + if (!strstr(tag, "same")) { + TCanvas* c1 = new TCanvas("c1", "c1", 1000, 600); + if (irng >= 0 && isect2 - isect < 2) { + c1->Divide(5, 2, 1.e-6, 1.e-6); + tleg->SetTextSize(0.06); + } else { + if (irng < 0) { + c1->Divide(nchnmx, ringmx, 1.e-6, 1.e-6); + } else { + c1->Divide(nchnmx, ringmx + 1, 1.e-6, 1.e-6); + } + tleg->SetTextSize(0.10); + } + } + + TH1F* histx[nprojtype][ringmx][nchnmx]; + TH1F* histy[nprojtype][ringmx][nchnmx]; + + int nloop = (irng < 0) ? ringmx : isect2 - isect + 1; + cout << "nloop " << nloop << endl; + bool iscomb = false; //For combined sect + // for (int kl=0; kl= 5) + icol++; + if (icol >= 10) + icol++; + if (extcol > 0) + latex.SetTextColor(icol); + for (int ij = 0; ij < nloop; ij++) { + for (int jk = 0; jk < nchnmx; jk++) { + if (irng < 0) { + sprintf(name, "hoCalibc/ringavedigi_%i_%i_%i_%i", kl, ij, (ij == 2) ? rbxmx : rbx12mx, jk); + iscomb = true; + } else { + sprintf(name, "hoCalibc/ringavedigi_%i_%i_%i_%i", kl, irng, isect + ij, jk); + if ((irng == 2 && isect + ij == rbxmx) || (irng != 2 && isect + ij == rbx12mx)) + iscomb = true; + } + // cout<<"ij "<Get(name); + histx[kl][ij][jk] = (TH1F*)histy[kl][ij][jk]->Clone(); + histx[kl][ij][jk]->Rebin(3); + histx[kl][ij][jk]->Scale(1. / TMath::Max(1., histx[kl][ij][jk]->Integral())); + c1->cd(++ipad); + histx[kl][ij][jk]->GetXaxis()->SetTitle("HO digi"); + histx[kl][ij][jk]->GetXaxis()->SetTitleSize(0.075); + histx[kl][ij][jk]->GetXaxis()->SetTitleOffset(0.7); //0.85 + histx[kl][ij][jk]->GetXaxis()->CenterTitle(); + histx[kl][ij][jk]->GetXaxis()->SetLabelSize(0.075); + histx[kl][ij][jk]->GetXaxis()->SetLabelOffset(-0.005); + + histx[kl][ij][jk]->GetYaxis()->SetTitle(); + histx[kl][ij][jk]->GetYaxis()->SetTitleSize(0.085); + histx[kl][ij][jk]->GetYaxis()->SetTitleOffset(0.9); + histx[kl][ij][jk]->GetYaxis()->CenterTitle(); + histx[kl][ij][jk]->GetYaxis()->SetLabelSize(0.065); + histx[kl][ij][jk]->GetYaxis()->SetLabelOffset(0.01); + + histx[kl][ij][jk]->GetXaxis()->SetNdivisions(404); + histx[kl][ij][jk]->GetYaxis()->SetNdivisions(404); + + histx[kl][ij][jk]->SetLineColor(icol); + if (kl == 0) { + // histx[kl][ij][jk]->GetXaxis()->SetRangeUser(-1,300); + histx[kl][ij][jk]->Draw(tag); + if (jk == 0) { + if (irng < 0) { + latex.DrawLatex(0.65, 0.62, Form("Ring %i", ij - 2)); + } else { + if (iscomb) { + latex.DrawLatex(0.65, 0.85 - 0.08 * extcol, Form("R %i", irng - 2)); + } else { + latex.DrawLatex(0.65, 0.90 - 0.045 * extcol, Form("R%i Rbx%i", irng - 2, isect + ij)); + } + } + } + if (ij == 0 && (!strstr(tag, "same"))) + latex.DrawLatex(0.45, 0.88, Form("TS %i", jk)); + } else { + histx[kl][ij][jk]->Draw("same"); + } + + if (ij == 0 && jk == 0 && (!strstr(tag, "same"))) { + tleg->AddEntry(histx[kl][ij][jk], projname[kl], "lpfe"); + } + + cout << "kl " << kl << "" << ij << "" << jk << " " << histx[kl][ij][jk]->Integral() << " " + << histx[kl][ij][jk]->GetTitle() << endl; + } + } + } + if (!strstr(tag, "same")) { + tleg->Draw(); + } + if (strstr(tag, "sames")) { + c1->Update(); + } +} + +void plot000r(int irng = -1, int isup = 0, double xup = 200) { + def_setting(); + gStyle->SetOptLogy(1); + gStyle->SetOptStat(0); + gStyle->SetStatTextColor(3); + gStyle->SetStatY(.99); + gStyle->SetPadLeftMargin(0.14); + gStyle->SetPadRightMargin(0.02); + gStyle->SetPadTopMargin(0.02); + gStyle->SetPadBottomMargin(0.12); + TLatex latex; + latex.SetNDC(); + if (irng < 0) { + latex.SetTextSize(0.08); + } else { + latex.SetTextSize(0.075); + } + // latex.SetTextColor(extcol+1); + latex.SetTextFont(42); + latex.SetTextAlign(1); //(31); // align right + + TLegend* tleg = new TLegend(.5, 0.3, 0.8, 0.9, "", "brNDC"); + tleg->SetFillColor(10); + tleg->SetBorderSize(0); + tleg->SetTextFont(42); + + cout << "xx1x " << endl; + char name[100]; + int ysiz = (irng < 0) ? 350 : 450; + TCanvas* c1 = new TCanvas("c1", "c1", 900., ysiz); + tleg->SetTextSize(0.035); + if (irng < 0) { + tleg->SetTextSize(0.045); + c1->Divide(5, 1, 1.e-6, 1.e-6); + } else if (irng == 2) { + c1->Divide(4, 3, 1.e-6, 1.e-6); + } else { + c1->Divide(3, 2, 1.e-6, 1.e-6); + } + + cout << "xxx " << endl; + TH1F* histx[ringmx][routmx + 1]; + TH1F* histy[ringmx][routmx + 1]; + + int nloop11 = (irng < 0) ? 0 : irng; + int nloop12 = (irng < 0) ? ringmx : irng + 1; + int nloop2 = (irng < 0 && isup == 0) ? 1 : ((irng == 2 || isup > 0) ? 36 : 24); //12 : 6); + + bool iscomb = false; //For combined sect + cout << "xxx2 " << nloop11 << " " << nloop12 << " " << nloop2 << endl; + int ipad = 0; + for (int ij = nloop11; ij < nloop12; ij++) { + if (isup > 0) + c1->cd(++ipad); + for (int jk = 0; jk < nloop2; jk++) { + if (ij != 2 && jk >= 24) + continue; + cout << "xxx3 " << ij << " " << jk << endl; + if (irng < 0 && isup == 0) { + sprintf(name, "hoCalibc/rout_ind_energy_r%i_0", ij); + iscomb = true; + } else { + sprintf(name, "hoCalibc/rout_ind_energy_r%i_%i", ij, jk + 1); + } + + cout << "name " << name << endl; + histy[ij][jk] = (TH1F*)gDirectory->Get(name); + histx[ij][jk] = (TH1F*)histy[ij][jk]->Clone(); + // histx[ij][jk]->Rebin(2); + histx[ij][jk]->Scale(1. / TMath::Max(1., histx[ij][jk]->Integral())); + if (isup <= 0) + c1->cd(++ipad); + histx[ij][jk]->GetXaxis()->SetTitle("HO RECO (GeV)"); + histx[ij][jk]->GetXaxis()->SetTitleSize(0.065); + histx[ij][jk]->GetXaxis()->SetTitleOffset(0.85); //0.85 + histx[ij][jk]->GetXaxis()->CenterTitle(); + histx[ij][jk]->GetXaxis()->SetLabelSize(0.07); + histx[ij][jk]->GetXaxis()->SetLabelOffset(-0.003); + + histx[ij][jk]->GetYaxis()->SetTitle(); + histx[ij][jk]->GetYaxis()->SetTitleSize(0.085); + histx[ij][jk]->GetYaxis()->SetTitleOffset(0.9); + histx[ij][jk]->GetYaxis()->CenterTitle(); + histx[ij][jk]->GetYaxis()->SetLabelSize(0.07); + histx[ij][jk]->GetYaxis()->SetLabelOffset(0.01); + + histx[ij][jk]->GetXaxis()->SetNdivisions(404); + histx[ij][jk]->GetYaxis()->SetNdivisions(404); + histx[ij][jk]->GetXaxis()->SetRangeUser(0., xup); + // histx[ij][jk]->SetMinimum(1.e-8); + if (isup > 0) + histx[ij][jk]->SetLineColor(jk + 1); + histx[ij][jk]->Draw((jk > 0 && isup > 0) ? "same" : ""); + + if (isup > 0 && ij == 2) { + cout << "jk " << jk << endl; + tleg->AddEntry(histx[ij][jk], Form("RM %i", jk), "lpfe"); + } + + if (irng < 0) { + latex.DrawLatex(0.55, 0.92, Form("Ring %i", ij - 2)); + } else { + latex.DrawLatex(0.55, 0.92, Form("Ring %i Sec%i", ij - 2, jk)); + } + } + if (isup > 0 && ij == 2) + tleg->Draw(); + } + // if (!strstr(tag,"same")) tleg->Draw(); + c1->Update(); +} + +void plot00(int ityp = 0, int isect = 0) { + def_setting(); + gStyle->SetOptLogy(1); + gStyle->SetOptStat(1100); + gStyle->SetStatTextColor(3); + gStyle->SetStatY(.99); + gStyle->SetPadLeftMargin(0.09); + gStyle->SetPadRightMargin(0.02); + gStyle->SetPadTopMargin(0.02); + gStyle->SetPadBottomMargin(0.07); + TLatex latex; + latex.SetNDC(); + latex.SetTextSize(0.11); + latex.SetTextFont(42); + latex.SetTextAlign(1); //(31); // align right + + char name[100]; + TCanvas* c1 = new TCanvas("c1", "c1", 1000., 600.); + c1->Divide(nchnmx, ringmx, 1.e-6, 1.e-6); + + TH1F* histx[ringmx][nchnmx]; + int icol = 0; + for (int ij = 0; ij < ringmx; ij++) { + for (int jk = 0; jk < nchnmx; jk++) { + // sprintf(name, "hoCalibc/ringavedigi_%i_%i", ij, jk); + sprintf(name, "hoCalibc/ringavedigi_%i_%i_%i_%i", ityp, ij, isect, jk); + // cout<<"ij "<Get(name); + + c1->cd(++icol); + histx[ij][jk]->GetXaxis()->SetTitle("HO digi"); + histx[ij][jk]->GetXaxis()->SetTitleSize(0.095); + histx[ij][jk]->GetXaxis()->SetTitleOffset(0.75); //0.85 + histx[ij][jk]->GetXaxis()->CenterTitle(); + histx[ij][jk]->GetXaxis()->SetLabelSize(0.085); + histx[ij][jk]->GetXaxis()->SetLabelOffset(0.001); + + histx[ij][jk]->GetYaxis()->SetTitle(); + histx[ij][jk]->GetYaxis()->SetTitleSize(0.085); + histx[ij][jk]->GetYaxis()->SetTitleOffset(0.9); + histx[ij][jk]->GetYaxis()->CenterTitle(); + histx[ij][jk]->GetYaxis()->SetLabelSize(0.07); + histx[ij][jk]->GetYaxis()->SetLabelOffset(0.01); + + histx[ij][jk]->SetLineColor(3); + histx[ij][jk]->Draw(); + if (jk == 0) + latex.DrawLatex(0.65, 0.62, Form("Ring %i", ij - 2)); + if (ij == 0) + latex.DrawLatex(0.65, 0.42, Form("TS %i", jk)); + } + } + c1->Update(); +} + +//root hocalib_cosmic_csa14_cosmic_set50_59.root +// root apr14/apr14b/hocalib_apr14b_cosmic_csa14_cosmic.root +// plot01(0) : //signal refion +// plot01(1) : //noise region +// plot01(2) : //total region +void plot01(int ityp = 0, int islocal = 1) { + def_setting(); + gStyle->SetOptLogy(1); + gStyle->SetOptStat(0); + gStyle->SetStatTextColor(3); + gStyle->SetStatY(.99); + gStyle->SetPadRightMargin(0.02); + + gStyle->SetPadTopMargin(0.02); + TLatex latex; + latex.SetNDC(); + latex.SetTextSize(0.08); + latex.SetTextFont(42); + latex.SetTextAlign(1); //(31); // align right + + char name[100]; + TCanvas* c1 = new TCanvas("c1", "c1", 800., 400.); + c1->Divide(5, 1); + + TH1F* histx[ringmx][nprojtype]; + TH1F* histy[ringmx][nprojtype]; + + int nloop = (islocal == 1) ? 1 : nprojtype; + for (int jk = 0; jk < nloop; jk++) { + for (int ij = 0; ij < ringmx; ij++) { + sprintf(name, "hoCalibc/hoindringen_%i_%i", ij, jk); + + cout << "name " << name << endl; + histy[ij][jk] = (TH1F*)gDirectory->Get(name); + histx[ij][jk] = (TH1F*)histy[ij][jk]->Clone(); + histx[ij][jk]->Rebin(4); + histx[ij][jk]->Scale(1. / histx[ij][jk]->Integral()); + } + } + for (int jk = 0; jk < nloop; jk++) { + for (int ij = 0; ij < ringmx; ij++) { + c1->cd(ij + 1); + histx[ij][jk]->GetXaxis()->SetTitle((islocal) ? "Noise (GeV)" : "HO signal/noise (GeV)"); + histx[ij][jk]->GetXaxis()->SetTitleSize(0.075); + histx[ij][jk]->GetXaxis()->SetTitleOffset(0.65); //0.85 + histx[ij][jk]->GetXaxis()->CenterTitle(); + histx[ij][jk]->GetXaxis()->SetLabelSize(0.065); + histx[ij][jk]->GetXaxis()->SetLabelOffset(-0.001); + + histx[ij][jk]->GetYaxis()->SetTitle(); + histx[ij][jk]->GetYaxis()->SetTitleSize(0.075); + histx[ij][jk]->GetYaxis()->SetTitleOffset(0.9); + histx[ij][jk]->GetYaxis()->CenterTitle(); + histx[ij][jk]->GetYaxis()->SetLabelSize(0.05); + histx[ij][jk]->GetYaxis()->SetLabelOffset(0.01); + + histx[ij][jk]->SetLineColor(jk + 1); + if (jk == 0) { + double xmn = histx[ij][jk]->GetXaxis()->GetXmin(); + double xmx = histx[ij][jk]->GetXaxis()->GetXmax(); + if (ityp == 0) { + histx[ij][jk]->GetXaxis()->SetRangeUser(xmn, 5.); + } else if (ityp == 1) { + histx[ij][jk]->GetXaxis()->SetRangeUser(2, xmx); + } else { + histx[ij][jk]->GetXaxis()->SetRangeUser(xmn, xmx); + } + // histx[ij][jk]->Scale(1./histx[ij][jk]->GetEntries()); + histx[ij][jk]->Draw(); + latex.DrawLatex(0.25, 0.82, Form("Ring %i", ij - 2)); + } else { + histx[ij][jk]->Draw("same"); + } + // cout<<"ijjk "<< ij<<" "<GetEntries()<<" " <Integral()<<" "<GetTitle()<Update(); +} + +//root hocalib_cosmic_csa14_cosmic_set50_59.root +// root apr14/apr14b/hocalib_apr14b_cosmic_csa14_cosmic.root +void plot1() { + def_setting(); + gStyle->SetOptStat(1100); + gStyle->SetStatTextColor(3); + gStyle->SetStatY(.99); + gStyle->SetPadRightMargin(0.02); + + gStyle->SetPadTopMargin(0.05); + TLatex latex; + latex.SetNDC(); + latex.SetTextSize(0.08); + latex.SetTextFont(42); + latex.SetTextAlign(1); //(31); // align right + + char name[100]; + TCanvas* c1 = new TCanvas("c1", "c1", 800., 600.); + c1->Divide(2, 2); + + TH1F* histx[8]; + for (int ij = 0; ij < 8; ij++) { + sprintf(name, "signal_%i", ij); + histx[ij] = new TH1F(name, name, 100, -0.2, 5.8); + // histx[1] = new TH1F("noise", "noise", 100, -.2, 5.8); + + // TTree Ttree = gDirectory->Get("T1"); + switch (ij) { + case 0: + T1->Project(name, "hosig[4]", "isect>0&&(int(isect/100)-50)<-10&&abs(hodx)>1&&abs(hody)>1&&ndof>20"); + break; + case 1: + T1->Project(name, + "hosig[4]", + "isect>0&&(int(isect/100)-50)>=-10&&(int(isect/100)-50)<-5&&abs(hodx)>1&&abs(hody)>1&&ndof>20"); + break; + case 2: + T1->Project(name, + "hosig[4]", + "isect>0&&(int(isect/100)-50)>=-4&&(int(isect/100)-50)<5&&abs(hodx)>1&&abs(hody)>1&&ndof>20"); + break; + case 3: + T1->Project(name, + "hosig[4]", + "isect>0&&(int(isect/100)-50)>=4&&(int(isect/100)-50)<11&&abs(hodx)>1&&abs(hody)>1&&ndof>20"); + break; + case 4: + T1->Project(name, "hocro", "isect>0&&(int(isect/100)-50)<-10&&abs(hodx)>1&&abs(hody)>1&&ndof>20"); + break; + case 5: + T1->Project(name, + "hocro", + "isect>0&&(int(isect/100)-50)>=-10&&(int(isect/100)-50)<-5&&abs(hodx)>1&&abs(hody)>1&&ndof>20"); + break; + case 6: + T1->Project(name, + "hocro", + "isect>0&&(int(isect/100)-50)>=-4&&(int(isect/100)-50)<5&&abs(hodx)>1&&abs(hody)>1&&ndof>20"); + break; + case 7: + T1->Project(name, + "hocro", + "isect>0&&(int(isect/100)-50)>=4&&(int(isect/100)-50)<11&&abs(hodx)>1&&abs(hody)>1&&ndof>20"); + break; + } + } + for (int ij = 0; ij < 8; ij++) { + c1->cd(ij % 4 + 1); + histx[ij]->GetXaxis()->SetTitle("HO signal/noise (GeV)"); + histx[ij]->GetXaxis()->SetTitleSize(0.075); + histx[ij]->GetXaxis()->SetTitleOffset(0.75); //0.85 + histx[ij]->GetXaxis()->CenterTitle(); + histx[ij]->GetXaxis()->SetLabelSize(0.065); + histx[ij]->GetXaxis()->SetLabelOffset(0.001); + + histx[ij]->GetYaxis()->SetTitle(); + histx[ij]->GetYaxis()->SetTitleSize(0.075); + histx[ij]->GetYaxis()->SetTitleOffset(0.9); + histx[ij]->GetYaxis()->CenterTitle(); + histx[ij]->GetYaxis()->SetLabelSize(0.05); + histx[ij]->GetYaxis()->SetLabelOffset(0.01); + + if (ij < 4) { + histx[ij]->SetLineColor(3); + histx[ij]->SetMaximum(1.1 * histx[ij + 4]->GetMaximum()); + histx[ij]->Draw(); + latex.DrawLatex(0.25, 0.82, Form("Ring %i", ij - 2)); + } else { + if (ij == 4) { + c1->Update(); + gStyle->SetStatTextColor(2); + gStyle->SetStatY(.79); + } + histx[ij]->SetLineColor(2); + histx[ij]->Draw("sames"); + } + // histx[1]->Draw("sames"); + } + c1->Update(); +} + +//root hocalib_cosmic_csa14_cosmic_set50_59.root +// root apr14/apr14b/hocalib_apr14b_cosmic_csa14_cosmic.root +void plot1a() { + def_setting(); + gStyle->SetOptStat(1100); + gStyle->SetOptLogy(1); + gStyle->SetStatTextColor(3); + gStyle->SetStatY(.99); + gStyle->SetPadRightMargin(0.02); + TLatex latex; + latex.SetNDC(); + latex.SetTextSize(0.08); + latex.SetTextFont(42); + latex.SetTextAlign(1); //(31); // align right + + char name[100]; + TCanvas* c1 = new TCanvas("c1", "c1", 800., 600.); + c1->Divide(2, 2); + + TH1F* histx[8]; + for (int ij = 0; ij < 8; ij++) { + sprintf(name, "signal_%i", ij); + histx[ij] = new TH1F(name, name, 100, 0.5, 19.5); + // histx[1] = new TH1F("noise", "noise", 100, -.2, 5.8); + + // TTree Ttree = gDirectory->Get("Tcor1"); + switch (ij) { + case 0: + Tcor1->Project(name, "hocellen", "hocomu>0&&(int(hocomu/100)-50)<-10&&int(icapid/10.)==4"); + break; + case 1: + Tcor1->Project( + name, "hocellen", "hocomu>0&&(int(hocomu/100)-50)>=-10&&(int(hocomu/100)-50)<-5&&int(icapid/10.)==4"); + break; + case 2: + Tcor1->Project( + name, "hocellen", "hocomu>0&&(int(hocomu/100)-50)>=-4&&(int(hocomu/100)-50)<5&&int(icapid/10.)==4"); + break; + case 3: + Tcor1->Project( + name, "hocellen", "hocomu>0&&(int(hocomu/100)-50)>=4&&(int(hocomu/100)-50)<11&&int(icapid/10.)==4"); + break; + case 4: + Tcor1->Project(name, "hocellen", "hocomu>0&&(int(hocomu/100)-50)<-10&&int(icapid/10.)==0"); + break; + case 5: + Tcor1->Project( + name, "hocellen", "hocomu>0&&(int(hocomu/100)-50)>=-10&&(int(hocomu/100)-50)<-5&&int(icapid/10.)==0"); + break; + case 6: + Tcor1->Project( + name, "hocellen", "hocomu>0&&(int(hocomu/100)-50)>=-4&&(int(hocomu/100)-50)<5&&int(icapid/10.)==0"); + break; + case 7: + Tcor1->Project( + name, "hocellen", "hocomu>0&&(int(hocomu/100)-50)>=4&&(int(hocomu/100)-50)<11&&int(icapid/10.)==0"); + break; + } + + c1->cd(ij % 4 + 1); + histx[ij]->GetXaxis()->SetTitle("HO signal/noise (GeV)"); + histx[ij]->GetXaxis()->SetTitleSize(0.075); + histx[ij]->GetXaxis()->SetTitleOffset(0.75); //0.85 + histx[ij]->GetXaxis()->CenterTitle(); + histx[ij]->GetXaxis()->SetLabelSize(0.065); + histx[ij]->GetXaxis()->SetLabelOffset(0.001); + + histx[ij]->GetYaxis()->SetTitle(); + histx[ij]->GetYaxis()->SetTitleSize(0.075); + histx[ij]->GetYaxis()->SetTitleOffset(0.9); + histx[ij]->GetYaxis()->CenterTitle(); + histx[ij]->GetYaxis()->SetLabelSize(0.055); + histx[ij]->GetYaxis()->SetLabelOffset(0.01); + + if (ij < 4) { + histx[ij]->SetLineColor(3); + + histx[ij]->Draw(); + latex.DrawLatex(0.25, 0.82, Form("Ring %i", ij - 2)); + + } else { + if (ij == 4) { + c1->Update(); + gStyle->SetStatTextColor(2); + gStyle->SetStatY(.79); + } + + histx[ij]->SetLineColor(2); + histx[ij]->Draw("sames"); + } + // histx[1]->Draw("sames"); + } + c1->Update(); +} + +// root histall_apr14b_cosmic_csa14_cosmic.root +//plot2(1,4,0) + +void plot2(int ith1 = 1, int ith2 = 4, int iproj = 0) { + def_setting(); + gStyle->SetOptStat(0); + gStyle->SetPadTopMargin(0.07); + gStyle->SetPadBottomMargin(0.12); + gStyle->SetPadLeftMargin(0.11); + gStyle->SetPadRightMargin(0.14); + + TLatex latex; + latex.SetNDC(); + latex.SetTextSize(0.06); + latex.SetTextFont(42); + latex.SetTextAlign(1); //(31); // align right + + char name[100]; + TH2F* histx[10]; + TH2F* histy[10]; + TCanvas* c1 = new TCanvas("c1", "c1", 800., 600.); + c1->Divide(2, 2); + TH2F* histz = (TH2F*)gDirectory->Get("hoCalibc/hbentry_d3"); + int nentry = histz->GetBinContent(0, 0); + + icnt = 0; + cout << "nentry = " << nentry << endl; + for (int ij = ith1; ij <= ith2; ij++) { + // sprintf(name, "hoCalibc/indrecosig_%i_%i", iproj, ij); + // indrecosig[jk][ij] = (TH2F*)fx->Get(name); + sprintf(name, "hoCalibc/indrecocnt_%i_%i", iproj, ij); + histy[icnt] = (TH2F*)gDirectory->Get(name); + histx[icnt] = (TH2F*)histy[icnt]->Clone(); + + c1->cd(icnt + 1); + cout << "icnt " << icnt << " " << histx[icnt]->GetTitle() << endl; + histx[icnt]->Scale(1. / nentry); + histx[icnt]->GetXaxis()->SetTitle("i#eta"); + histx[icnt]->GetXaxis()->SetTitleSize(0.075); + histx[icnt]->GetXaxis()->SetTitleOffset(0.75); //0.85 + histx[icnt]->GetXaxis()->CenterTitle(); + histx[icnt]->GetXaxis()->SetLabelSize(0.065); + histx[icnt]->GetXaxis()->SetLabelOffset(0.001); + + histx[icnt]->GetYaxis()->SetTitle("i#phi"); + histx[icnt]->GetYaxis()->SetTitleSize(0.075); + histx[icnt]->GetYaxis()->SetTitleOffset(0.7); + histx[icnt]->GetYaxis()->CenterTitle(); + histx[icnt]->GetYaxis()->SetLabelSize(0.065); + histx[icnt]->GetYaxis()->SetLabelOffset(0.01); + + histx[icnt]->GetZaxis()->SetLabelSize(0.048); + histx[icnt]->GetZaxis()->SetLabelOffset(0.01); + histx[icnt]->GetZaxis()->SetNdivisions(406); + + histx[icnt]->Draw("colz"); + latex.DrawLatex(.4, .95, Form("%g Update(); +} +// root histall_apr14b_cosmic_csa14_cosmic.root +//xx plot3(0) +//xx plot3(1) +//xx plot3(2) +//xx plot3(3) + +void plot3(int isel = 0) { + def_setting(); + gStyle->SetOptStat(0); + gStyle->SetPadTopMargin(0.05); + gStyle->SetPadBottomMargin(0.1); + gStyle->SetPadLeftMargin(0.08); + gStyle->SetPadRightMargin(0.14); + char name[100]; + TH2F* histx[9]; + TH2F* histy[9]; + + TLatex latex; + latex.SetNDC(); + latex.SetTextSize(0.08); + latex.SetTextFont(42); + latex.SetTextAlign(1); //(31); // align right + + sprintf(name, "hoCalibc/totalmuon_%i", isel); + TH2F* totalmuon = (TH2F*)gDirectory->Get(name); + + TCanvas* c1 = new TCanvas("c1", "c1", 800., 600.); + c1->Divide(3, 3, 1.e-6, 1.e-6); + for (int ij = 0; ij < 9; ij++) { + sprintf(name, "hoCalibc/totalproj_%i_%i", isel, ij); + histy[ij] = (TH2F*)gDirectory->Get(name); + histx[ij] = (TH2F*)histy[ij]->Clone(); + + histx[ij]->Divide(totalmuon); + + c1->cd(ij + 1); + // histx[ij]->GetXaxis()->SetTitle("i#eta"); + histx[ij]->GetXaxis()->SetTitleSize(0.075); + histx[ij]->GetXaxis()->SetTitleOffset(0.75); //0.85 + histx[ij]->GetXaxis()->CenterTitle(); + histx[ij]->GetXaxis()->SetLabelSize(0.065); + histx[ij]->GetXaxis()->SetLabelOffset(0.001); + + // histx[ij]->GetYaxis()->SetTitle("i#phi"); + histx[ij]->GetYaxis()->SetTitleSize(0.075); + histx[ij]->GetYaxis()->SetTitleOffset(0.7); + histx[ij]->GetYaxis()->CenterTitle(); + histx[ij]->GetYaxis()->SetLabelSize(0.055); + histx[ij]->GetYaxis()->SetLabelOffset(0.01); + + histx[ij]->GetZaxis()->SetLabelSize(0.055); + histx[ij]->GetZaxis()->SetLabelOffset(0.01); + histx[ij]->GetZaxis()->SetNdivisions(406); + histx[ij]->Draw("colz"); + } + c1->Update(); +} +// root histall_apr14b_cosmic_csa14_cosmic.root +// plot4(1,3,0,0) +void plot4(int ith1 = 0, int ith2 = 8, int isel1 = 0, int isel2 = 0) { + def_setting(); + gStyle->SetOptStat(0); + gStyle->SetPadTopMargin(0.02); + gStyle->SetPadBottomMargin(0.15); + gStyle->SetPadLeftMargin(0.15); + gStyle->SetPadRightMargin(0.02); + char name[100]; + TH1F* histx[10][9]; + TH1F* histy[10][9]; + TH1F* histz[10][9]; + + TLatex latex; + latex.SetNDC(); + latex.SetTextSize(0.055); + latex.SetTextFont(42); + latex.SetTextAlign(3); //(31); // align right + + int nydiv = (isel2 == isel1) ? 1 : 2; + // TCanvas* c1 = new TCanvas("c1", "c1", 800., (nydiv==1) ? 350 : 600.); + // c1->Divide(3,nydiv,1.e-6,1.e-6); + TCanvas* c1 = new TCanvas("c1", "c1", 800., 600.); + c1->Divide(3, 3, 1.e-6, 1.e-6); + + const int nbin = 5; + TString labels[nbin] = {"Ring-2", "Ring-1", "Ring0", "Ring+1", "Ring+2"}; + + for (int ij = ith1; ij <= ith2; ij++) { + sprintf(name, "hoCalibc/endigisig_%i_%i", isel1, ij); + histz[0][ij] = (TH1F*)gDirectory->Get(name); + + sprintf(name, "hoCalibc/endigisig_%i_%i", isel2, ij); + histz[1][ij] = (TH1F*)gDirectory->Get(name); + + sprintf(name, "hoCalibc/endigicnt_%i_%i", isel1, ij); + histy[0][ij] = (TH1F*)gDirectory->Get(name); + + sprintf(name, "hoCalibc/endigicnt_%i_%i", isel2, ij); + histy[1][ij] = (TH1F*)gDirectory->Get(name); + } + + int icol = 0; + for (int jk = 0; jk < nydiv; jk++) { + for (int ij = ith1; ij <= ith2; ij++) { + histx[jk][ij] = (TH1F*)histz[jk][ij]->Clone(); + histx[jk][ij]->Divide(histy[jk][ij]); + c1->cd(++icol); + cout << "ij " << icol << " " << ij << " " << jk << " " << histy[jk][ij]->GetTitle() << endl; + + histx[jk][ij]->GetXaxis()->SetLabelSize(0.05); + histx[jk][ij]->GetXaxis()->SetLabelOffset(0.001); + + histx[jk][ij]->GetYaxis()->SetLabelSize(0.045); + histx[jk][ij]->GetYaxis()->SetLabelOffset(0.01); + + histx[jk][ij]->GetXaxis()->SetTitle("Time slice in Five rings"); + histx[jk][ij]->GetXaxis()->SetTitleSize(0.055); + histx[jk][ij]->GetXaxis()->SetTitleOffset(1.2); //0.85 + histx[jk][ij]->GetXaxis()->CenterTitle(); + histx[jk][ij]->GetXaxis()->SetLabelSize(0.075); + histx[jk][ij]->GetXaxis()->SetLabelOffset(0.01); + + histx[jk][ij]->GetYaxis()->SetTitle("Signal (fC/GeV)"); + histx[jk][ij]->GetYaxis()->SetTitleSize(0.055); + histx[jk][ij]->GetYaxis()->SetTitleOffset(1.3); + histx[jk][ij]->GetYaxis()->CenterTitle(); + histx[jk][ij]->GetYaxis()->SetLabelSize(0.065); + histx[jk][ij]->GetYaxis()->SetLabelOffset(0.01); + + histx[jk][ij]->GetXaxis()->SetNdivisions(406); + histx[jk][ij]->GetYaxis()->SetNdivisions(406); + + for (int kl = 0; kl < nbin; kl++) { + histx[jk][ij]->GetXaxis()->SetBinLabel(10 * kl + 6, labels[kl]); + } + histx[jk][ij]->GetXaxis()->LabelsOption("h"); + histx[jk][ij]->Draw(); + + latex.DrawLatex(0.40, 0.93, Form("%g Update(); +} + +// root histall_apr14b_cosmic_csa14_cosmic.root +// plot5(1,3,0,0) +void plot5(int ith1 = 1, int ith2 = 3, int isel1 = 0, int isel2 = 4, double amx = -1.0) { + def_setting(); + gStyle->SetOptStat(0); + gStyle->SetPadTopMargin(0.02); + gStyle->SetPadBottomMargin(0.15); + gStyle->SetPadLeftMargin(0.15); + gStyle->SetPadRightMargin(0.14); + + char name[100]; + TH2F* histx[5][9]; + TH2F* histy[5][9]; + TH2F* histz[5][9]; + + const int nbin = 5; + TString labels[nbin] = {"Ring-2", "Ring-1", "Ring0", "Ring+1", "Ring+2"}; + + int nydiv = (isel1 == isel2) ? 1 : 2; + TCanvas* c1 = new TCanvas("c1", "c1", 800., (nydiv == 1) ? 350 : 600.); + c1->Divide(3, nydiv, 1.e-6, 1.e-6); + + for (int ij = ith1; ij <= ith2; ij++) { + sprintf(name, "hoCalibc/rmdigisig_%i_%i", isel1, ij); + histz[0][ij] = (TH2F*)gDirectory->Get(name); + + sprintf(name, "hoCalibc/rmdigisig_%i_%i", isel2, ij); + histz[1][ij] = (TH2F*)gDirectory->Get(name); + + sprintf(name, "hoCalibc/rmdigicnt_%i_%i", isel1, ij); + histy[0][ij] = (TH2F*)gDirectory->Get(name); + + sprintf(name, "hoCalibc/rmdigicnt_%i_%i", isel2, ij); + histy[1][ij] = (TH2F*)gDirectory->Get(name); + } + + int icol = 0; + for (int jk = 0; jk < nydiv; jk++) { + for (int ij = ith1; ij <= ith2; ij++) { + histx[jk][ij] = (TH2F*)histz[jk][ij]->Clone(); + histx[jk][ij]->Divide(histy[jk][ij]); + c1->cd(++icol); + cout << "ij " << icol << " " << ij << " " << jk << " " << histy[jk][ij]->GetTitle() << endl; + + histx[jk][ij]->GetXaxis()->SetTitle("Time slice in Five rings"); + histx[jk][ij]->GetXaxis()->SetTitleSize(0.055); + histx[jk][ij]->GetXaxis()->SetTitleOffset(1.2); //0.85 + histx[jk][ij]->GetXaxis()->CenterTitle(); + histx[jk][ij]->GetXaxis()->SetLabelSize(0.065); + histx[jk][ij]->GetXaxis()->SetLabelOffset(0.01); + + histx[jk][ij]->GetYaxis()->SetTitle("RM#"); + histx[jk][ij]->GetYaxis()->SetTitleSize(0.055); + histx[jk][ij]->GetYaxis()->SetTitleOffset(1.3); + histx[jk][ij]->GetYaxis()->CenterTitle(); + histx[jk][ij]->GetYaxis()->SetLabelSize(0.065); + histx[jk][ij]->GetYaxis()->SetLabelOffset(0.01); + + histx[jk][ij]->GetZaxis()->SetLabelSize(0.048); + histx[jk][ij]->GetZaxis()->SetLabelOffset(0.01); + + histx[jk][ij]->GetXaxis()->SetNdivisions(202); + // histx[jk][ij]->GetYaxis()->SetNdivisions(406); + // histx[jk][ij]->GetZaxis()->SetNdivisions(406); + if (amx > 0) + histx[jk][ij]->SetMaximum(amx); + // for (int kl=0; klGetXaxis()->SetBinLabel(10*kl+6, labels[kl]); + // } + // histx[jk][ij]->GetXaxis()->LabelsOption("h"); + histx[jk][ij]->GetXaxis()->SetNdivisions(810); + histx[jk][ij]->Draw("colz"); + } + } + c1->Update(); +} + +// root histall_apr14b_cosmic_csa14_cosmic.root +// plot6(-2,3) +void plot6(int iring = -2, int irbx = 3) { + def_setting(); + gStyle->SetOptStat(0); + gStyle->SetPadTopMargin(0.10); + gStyle->SetPadBottomMargin(0.08); + gStyle->SetPadLeftMargin(0.20); + gStyle->SetPadRightMargin(0.20); + char name[100]; + const int shapemx = 10; + TH2F* histx[shapemx]; + // const char* shape_name[shapemx]={"N:T3/T34", "N:T34/Sum2-5", "N:T3/Sum2-5", "N:T4/Sum2-5", "N:Oth/Sum2-5", + // "S:T3/T34", "S:T34/Sum2-5", "S:T3/Sum2-5", "S:T4/Sum2-5", "S:Oth/Sum2-5"}; + + const char* shape_name[shapemx] = { + "T3/T4", "T4/Sum45", "T45/Sum4-7", "T4-7/All", "T0-3/T4-7", "T0-3/All", "T0-3/T4-7", "T67/T45", "xx", "xx"}; + + TCanvas* c1 = new TCanvas("c1", "c1", 800., 500.); + c1->Divide(4, 2, 1.e-6, 1.e-6); + + for (int ij = 0; ij < shapemx - 2; ij++) { + c1->cd(ij + 1); + sprintf(name, "hoCalibc/rbx_shape_%i_r%i_%i", ij, iring + 2, irbx); + histx[ij] = (TH2F*)gDirectory->Get(name); + cout << "ij " << ij << " " << histx[ij]->GetTitle() << endl; + + if (ij == 0 || ij == 5) { + // histx[ij]->GetXaxis()->SetTitle("T2+T3"); + } else { + // histx[ij]->GetXaxis()->SetTitle("Sum T2-5"); + } + histx[ij]->GetXaxis()->SetTitleSize(0.065); + histx[ij]->GetXaxis()->SetTitleOffset(0.65); //0.85 + histx[ij]->GetXaxis()->CenterTitle(); + histx[ij]->GetXaxis()->SetLabelSize(0.065); + histx[ij]->GetXaxis()->SetLabelOffset(-0.01); + + histx[ij]->GetYaxis()->SetTitle(shape_name[ij]); + histx[ij]->GetYaxis()->SetTitleSize(0.065); + histx[ij]->GetYaxis()->SetTitleOffset(1.3); + histx[ij]->GetYaxis()->CenterTitle(); + histx[ij]->GetYaxis()->SetLabelSize(0.065); + histx[ij]->GetYaxis()->SetLabelOffset(0.01); + + histx[ij]->GetZaxis()->SetLabelSize(0.07); + histx[ij]->GetZaxis()->SetLabelOffset(0.01); + + histx[ij]->GetXaxis()->SetNdivisions(406); + histx[ij]->GetYaxis()->SetNdivisions(406); + histx[ij]->GetZaxis()->SetNdivisions(406); + + histx[ij]->Draw("colz"); + } + c1->Update(); +} + +// root histall_apr14b_cosmic_csa14_cosmic.root +// plot7(2,0) +void plot7(int ith = 2, int irbx = 0) { + def_setting(); + + TLatex latex; + latex.SetNDC(); + latex.SetTextSize(0.08); + latex.SetTextFont(42); + latex.SetTextAlign(1); //(31); // align right + + const int nringmx = 5; + gStyle->SetOptLogy(1); + gStyle->SetOptStat(0); + gStyle->SetPadTopMargin(0.02); + gStyle->SetPadBottomMargin(0.13); + gStyle->SetPadLeftMargin(0.14); + gStyle->SetPadRightMargin(0.02); + char name[100]; + TCanvas* c1 = new TCanvas("c1", "c1", 800., 500.); + c1->Divide(5, 2, 1.e-6, 1.e-6); + + TH1F* histx[2][nringmx]; + + int icol = 0; + + for (int ij = 0; ij < 2; ij++) { + for (int jk = 0; jk < nringmx; jk++) { + if (ij == 0) { + sprintf(name, "hoCalibc/rbx_mult_%i_r%i_%i", ith, jk, irbx); + } else { + sprintf(name, "hoCalibc/rout_mult_%i_r%i_%i", ith, jk, irbx); + } + + histx[ij][jk] = (TH1F*)gDirectory->Get(name); + cout << "name " << name << endl; + c1->cd(++icol); + + if (ij == 0) { + histx[ij][jk]->GetXaxis()->SetTitle("# in RBX"); + } else { + histx[ij][jk]->GetXaxis()->SetTitle("# in RM"); + } + histx[ij][jk]->GetXaxis()->SetTitleSize(0.085); + histx[ij][jk]->GetXaxis()->SetTitleOffset(0.7); //0.85 + histx[ij][jk]->GetXaxis()->CenterTitle(); + histx[ij][jk]->GetXaxis()->SetLabelSize(0.085); + histx[ij][jk]->GetXaxis()->SetLabelOffset(-0.01); + + histx[ij][jk]->GetYaxis()->SetTitle(); //shape_name[ij][jk]); + histx[ij][jk]->GetYaxis()->SetTitleSize(0.075); + histx[ij][jk]->GetYaxis()->SetTitleOffset(1.3); + histx[ij][jk]->GetYaxis()->CenterTitle(); + histx[ij][jk]->GetYaxis()->SetLabelSize(0.085); + histx[ij][jk]->GetYaxis()->SetLabelOffset(0.01); + + histx[ij][jk]->GetXaxis()->SetNdivisions(404); + histx[ij][jk]->GetYaxis()->SetNdivisions(404); + + histx[ij][jk]->Draw(); + cout << "ijjk " << ij << " " << jk << " " << histx[ij][jk]->GetTitle() << endl; + latex.DrawLatex(0.35, 0.8, Form("Ring %i", jk - 2)); + } + } + c1->Update(); +} + +void plot7a(int irng = -1, int ith = 2, int isrm = 0) { + def_setting(); + + TLatex latex; + latex.SetNDC(); + latex.SetTextSize(0.08); + latex.SetTextFont(42); + latex.SetTextAlign(1); //(31); // align right + + const int nringmx = 5; + gStyle->SetOptLogy(1); + gStyle->SetOptStat(0); + gStyle->SetPadTopMargin(0.02); + gStyle->SetPadBottomMargin(0.13); + gStyle->SetPadLeftMargin(0.14); + gStyle->SetPadRightMargin(0.02); + char name[100]; + TCanvas* c1 = new TCanvas("c1", "c1", 800., 500.); + if (irng < 0) { + c1->Divide(5, 2, 1.e-6, 1.e-6); + } else if (isrm) { + if (irng == 2) { + c1->Divide(6, 6, 1.e-6, 1.e-6); + } else { + c1->Divide(6, 4, 1.e-6, 1.e-6); + } + } else { + if (irng == 2) { + c1->Divide(4, 3, 1.e-6, 1.e-6); + } else { + c1->Divide(3, 2, 1.e-6, 1.e-6); + } + } + TH1F* histx[routmx + 1][routmx + 1]; + + int icol = 0; + + int nloop1 = 2; + int nloop2 = nringmx; + if (irng >= 0) { + nloop1 = 1; + if (isrm) { + nloop2 = (irng == 2) ? 36 : 24; + } else { + nloop2 = (irng == 2) ? 12 : 6; + } + } + + for (int ij = 0; ij < nloop1; ij++) { //ij<2 + for (int jk = 0; jk < nloop2; jk++) { //ijGet(name); + cout << "name " << name << endl; + c1->cd(++icol); + if (irng < 0) { + if (ij == 0) { + histx[ij][jk]->GetXaxis()->SetTitle("# in RBX"); + } else { + histx[ij][jk]->GetXaxis()->SetTitle("# in RM"); + } + } else if (isrm) { + histx[ij][jk]->GetXaxis()->SetTitle("# in RM"); + } else { + histx[ij][jk]->GetXaxis()->SetTitle("# in RBX"); + } + + histx[ij][jk]->GetXaxis()->SetTitleSize(0.085); + histx[ij][jk]->GetXaxis()->SetTitleOffset(0.7); //0.85 + histx[ij][jk]->GetXaxis()->CenterTitle(); + histx[ij][jk]->GetXaxis()->SetLabelSize(0.085); + histx[ij][jk]->GetXaxis()->SetLabelOffset(-0.01); + + histx[ij][jk]->GetYaxis()->SetTitle(); //shape_name[ij][jk]); + histx[ij][jk]->GetYaxis()->SetTitleSize(0.075); + histx[ij][jk]->GetYaxis()->SetTitleOffset(1.3); + histx[ij][jk]->GetYaxis()->CenterTitle(); + histx[ij][jk]->GetYaxis()->SetLabelSize(0.085); + histx[ij][jk]->GetYaxis()->SetLabelOffset(0.01); + + histx[ij][jk]->GetXaxis()->SetNdivisions(404); + histx[ij][jk]->GetYaxis()->SetNdivisions(404); + + histx[ij][jk]->Draw(); + cout << "ijjk " << ij << " " << jk << " " << histx[ij][jk]->GetTitle() << endl; + if (irng < 0) { + latex.DrawLatex(0.35, 0.8, Form("Ring %i E>%g", jk - 2, hothreshs[ith])); + } else if (isrm) { + latex.DrawLatex(0.35, 0.8, Form("Ring %i RM%i E>%g", irng, jk, hothreshs[ith])); + } else { + latex.DrawLatex(0.35, 0.8, Form("Ring %i RBX%i E>%g", irng, jk, hothreshs[ith])); + } + } + } + c1->Update(); +} + +void plot7b(int irng = -1, int th1 = 2, int th2 = 5, int isrm = 0) { + def_setting(); + + TLatex latex; + latex.SetNDC(); + latex.SetTextSize(0.065); + latex.SetTextFont(42); + latex.SetTextAlign(1); //(31); // align right + + TLegend* tleg = new TLegend(.75, 0.35, 0.95, 0.9, "", "brNDC"); + tleg->SetFillColor(10); + tleg->SetBorderSize(0); + tleg->SetTextFont(42); + tleg->SetTextSize(0.07); + + const int nringmx = 5; + gStyle->SetOptLogy(1); + gStyle->SetOptStat(0); + gStyle->SetPadTopMargin(0.02); + gStyle->SetPadBottomMargin(0.13); + gStyle->SetPadLeftMargin(0.14); + gStyle->SetPadRightMargin(0.02); + char name[100]; + TCanvas* c1 = new TCanvas("c1", "c1", 800., 500.); + if (irng < 0) { + c1->Divide(5, 2, 1.e-6, 1.e-6); + } else if (isrm) { + if (irng == 2) { + c1->Divide(6, 6, 1.e-6, 1.e-6); + } else { + c1->Divide(6, 4, 1.e-6, 1.e-6); + } + } else { + if (irng == 2) { + c1->Divide(4, 3, 1.e-6, 1.e-6); + } else { + c1->Divide(3, 2, 1.e-6, 1.e-6); + } + } + TH1F* histx[routmx + 1][routmx + 1][nhothresh]; + + int icol = 0; + + int nloop1 = 2; + int nloop2 = nringmx; + if (irng >= 0) { + nloop1 = 1; + if (isrm) { + nloop2 = (irng == 2) ? 36 : 24; + } else { + nloop2 = (irng == 2) ? 12 : 6; + } + } + + for (int ij = 0; ij < nloop1; ij++) { //ij<2 + for (int jk = 0; jk < nloop2; jk++) { //ijGet(name); + cout << "name " << name << endl; + if (kl == th1) + c1->cd(++icol); + if (irng < 0) { + if (ij == 0) { + histx[ij][jk][kl]->GetXaxis()->SetTitle("# in RBX"); + } else { + histx[ij][jk][kl]->GetXaxis()->SetTitle("# in RM"); + } + } else if (isrm) { + histx[ij][jk][kl]->GetXaxis()->SetTitle("# in RM"); + } else { + histx[ij][jk][kl]->GetXaxis()->SetTitle("# in RBX"); + } + + histx[ij][jk][kl]->GetXaxis()->SetTitleSize(0.065); + histx[ij][jk][kl]->GetXaxis()->SetTitleOffset(0.75); //0.85 + histx[ij][jk][kl]->GetXaxis()->CenterTitle(); + histx[ij][jk][kl]->GetXaxis()->SetLabelSize(0.075); + histx[ij][jk][kl]->GetXaxis()->SetLabelOffset(-0.01); + + histx[ij][jk][kl]->GetYaxis()->SetTitle(); //shape_name[ij][jk][kl]); + histx[ij][jk][kl]->GetYaxis()->SetTitleSize(0.065); + histx[ij][jk][kl]->GetYaxis()->SetTitleOffset(1.3); + histx[ij][jk][kl]->GetYaxis()->CenterTitle(); + histx[ij][jk][kl]->GetYaxis()->SetLabelSize(0.075); + histx[ij][jk][kl]->GetYaxis()->SetLabelOffset(0.01); + + histx[ij][jk][kl]->GetXaxis()->SetNdivisions(404); + histx[ij][jk][kl]->GetYaxis()->SetNdivisions(404); + + histx[ij][jk][kl]->SetLineColor(kl - th1 + 1); + histx[ij][jk][kl]->Draw((kl == th1) ? "" : "same"); + cout << "ijjk " << ij << " " << jk << " " << kl - th1 + 1 << " " << histx[ij][jk][kl]->GetTitle() << endl; + if (kl == th1) { + if (irng < 0) { + latex.DrawLatex(0.35, 0.85, Form("R%i", jk - 2)); + } else if (isrm) { + latex.DrawLatex(0.35, 0.85, Form("R%i RM%i", irng - 2, jk)); + } else { + latex.DrawLatex(0.35, 0.85, Form("R%i RBX%i", irng - 2, jk)); + } + } + if (ij == 0 && jk == 0) { + tleg->AddEntry(histx[ij][jk][kl], Form("th>%g", hothreshs[kl]), "lpfe"); + } + } + } + } + tleg->Draw(); + c1->Update(); +} + +// root histall_apr14b_cosmic_csa14_cosmic.root +// plot8(0,5,0) +// plot8(0,5,1) +void plot8(int ith1 = 1, int ith2 = 8, int ityp = 1) { + def_setting(); + + gStyle->SetPadGridX(0); + gStyle->SetPadGridY(0); + + TLatex latex; + latex.SetNDC(); + latex.SetTextSize(0.06); + latex.SetTextFont(42); + latex.SetTextAlign(1); //(31); // align right + + const int nringmx = 5; + gStyle->SetOptStat(0); + gStyle->SetPadTopMargin(0.06); + gStyle->SetPadBottomMargin(0.16); + gStyle->SetPadLeftMargin(0.16); + gStyle->SetPadRightMargin(0.16); + + char name[100]; + TCanvas* c1 = new TCanvas("c1", "c1", 800., 500.); + c1->Divide(4, 2, 1.e-6, 1.e-6); + // sprintf(name, "hoCalibc/hbentry_d%i", ij+3); + int nentry = ((TH1F*)gDirectory->Get("hoCalibc/hbentry_d3"))->GetBinContent(0, 0); + TH2F* histx[11]; + TH2F* histy[11]; + + int icol = 0; + for (int ij = ith1; ij <= ith2; ij++) { + // histx[1] = (TH2F*)gDirectory->Get(name); + if (ityp == 0) { + sprintf(name, "hoCalibc/hormoccu_%i", ij); + } else { + sprintf(name, "hoCalibc/hocorrelht_%i", ij); + } + cout << "nentry " << nentry << endl; + histy[ij] = (TH2F*)gDirectory->Get(name); + histx[ij] = (TH2F*)histy[ij]->Clone(); + histx[ij]->Scale(1. / nentry); + histx[ij]->GetXaxis()->SetTitle((ityp == 0) ? "iRing" : "i#eta"); + histx[ij]->GetXaxis()->SetTitleSize(0.075); + histx[ij]->GetXaxis()->SetTitleOffset(0.85); //0.85 + histx[ij]->GetXaxis()->CenterTitle(); + histx[ij]->GetXaxis()->SetLabelSize(0.075); + histx[ij]->GetXaxis()->SetLabelOffset(0.01); + + histx[ij]->GetYaxis()->SetTitle((ityp == 0) ? "RM" : "i#phi"); + histx[ij]->GetYaxis()->SetTitleSize(0.065); + histx[ij]->GetYaxis()->SetTitleOffset(1.1); + histx[ij]->GetYaxis()->CenterTitle(); + histx[ij]->GetYaxis()->SetLabelSize(0.065); + histx[ij]->GetYaxis()->SetLabelOffset(0.01); + + histx[ij]->GetZaxis()->SetLabelSize(0.055); + histx[ij]->GetZaxis()->SetLabelOffset(0.01); + + histx[ij]->GetXaxis()->SetNdivisions(202); + histx[ij]->GetYaxis()->SetNdivisions(202); + histx[ij]->GetZaxis()->SetNdivisions(202); + + c1->cd(++icol); + histx[ij]->Draw("colz"); + latex.DrawLatex(0.58, 0.85, Form("E_{th}=%g GeV", hothreshs[ij])); + } + c1->Update(); +} + +// root histall_apr14b_cosmic_csa14_cosmic.root +// plot9(2,0) +// plot9(2,1) +void plot9(int ith = 2, int ityp = 0) { + def_setting(); + + TLatex latex; + latex.SetNDC(); + latex.SetTextSize(0.075); + latex.SetTextFont(42); + latex.SetTextAlign(1); //(31); // align right + + const int nringmx = 5; + gStyle->SetOptStat(0); + gStyle->SetPadTopMargin(0.07); + gStyle->SetPadBottomMargin(0.13); + gStyle->SetPadLeftMargin(0.20); + gStyle->SetPadRightMargin(0.17); + char name[100]; + TCanvas* c1 = new TCanvas("c1", "c1", 800., 500.); + c1->Divide(3, 2, 1.e-6, 1.e-6); + + int nentry = ((TH2F*)gDirectory->Get("hoCalibc/hbentry_d3"))->GetBinContent(0, 0); + TH2F* histx[6]; + TH2F* histy[6]; + + sprintf(name, "hoCalibc/hormcorrel_%i", ith); + + histy[0] = (TH2F*)gDirectory->Get(name); + for (int jk = 0; jk < nringmx; jk++) { + if (ityp == 0) { + sprintf(name, "hoCalibc/hocorrelsig_%i_%i", jk, ith); + } else { + sprintf(name, "hoCalibc/hocorrel2sig_%i_%i", jk, ith); + } + histy[1 + jk] = (TH2F*)gDirectory->Get(name); + } + + for (int ij = 0; ij < 6; ij++) { + histx[ij] = (TH2F*)histy[ij]->Clone(); + histx[ij]->Scale(1. / nentry); + + if (ij == 0) { + histx[ij]->GetXaxis()->SetTitle("# of RM in Rings"); + histx[ij]->GetYaxis()->SetTitle("# of RM in Rings"); + } else { + if (ityp == 0) { + histx[ij]->GetXaxis()->SetTitle("72 #times i#eta + i#phi"); + histx[ij]->GetYaxis()->SetTitle("72 #times i#eta + i#phi"); + } else { + sprintf(name, "%i #times i#phi + i#eta", (ij == 1 || ij == 5) ? 5 : ((ij == 3) ? 8 : 6)); + histx[ij]->GetXaxis()->SetTitle(name); + histx[ij]->GetYaxis()->SetTitle(name); + } + } + + histx[ij]->GetXaxis()->SetTitleSize(0.065); + histx[ij]->GetXaxis()->SetTitleOffset(0.90); //0.85 + histx[ij]->GetXaxis()->CenterTitle(); + histx[ij]->GetXaxis()->SetLabelSize(0.065); + histx[ij]->GetXaxis()->SetLabelOffset(0.001); + + histx[ij]->GetYaxis()->SetTitleSize(0.065); + histx[ij]->GetYaxis()->SetTitleOffset(1.3); + histx[ij]->GetYaxis()->CenterTitle(); + histx[ij]->GetYaxis()->SetLabelSize(0.065); + histx[ij]->GetYaxis()->SetLabelOffset(0.01); + + histx[ij]->GetZaxis()->SetLabelSize(0.055); + histx[ij]->GetZaxis()->SetLabelOffset(0.01); + + histx[ij]->GetXaxis()->SetNdivisions(404); + histx[ij]->GetYaxis()->SetNdivisions(404); + histx[ij]->GetZaxis()->SetNdivisions(406); + + c1->cd(ij + 1); + histx[ij]->Draw("colz"); + if (ij == 0) + latex.DrawLatex(0.24, 0.85, Form("E_{th}=%g GeV", hothreshs[ith])); + cout << "ij " << ij << " " << histx[ij]->GetTitle() << endl; + } + c1->Update(); +} + +// root histall_apr14b_cosmic_csa14_cosmic.root +// plot10(4,5) +void plot10(int ith1 = 2, int ith2 = 3) { + def_setting(); + TLatex latex; + latex.SetNDC(); + latex.SetTextSize(0.05); + latex.SetTextFont(42); + latex.SetTextAlign(1); //(31); // align right + const int nringmx = 5; + gStyle->SetOptStat(0); + gStyle->SetPadTopMargin(0.06); + gStyle->SetPadBottomMargin(0.10); + gStyle->SetPadLeftMargin(0.16); + gStyle->SetPadRightMargin(0.16); + char name[100]; + TCanvas* c1 = new TCanvas("c1", "c1", 800., 500.); + c1->Divide(2, 1, 1.e-6, 1.e-6); + int nentry = ((TH2F*)gDirectory->Get("hoCalibc/hbentry_d3"))->GetBinContent(0, 0); + TH2F* histx[2]; + TH2F* histy[2]; + + sprintf(name, "hoCalibc/hoallcorrelsig_%i", ith1); + histy[0] = (TH2F*)gDirectory->Get(name); + + sprintf(name, "hoCalibc/hoallcorrelsig_%i", ith2); + histy[1] = (TH2F*)gDirectory->Get(name); + + for (int ij = 0; ij < 2; ij++) { + histx[ij] = (TH2F*)histy[ij]->Clone(); + histx[ij]->Scale(1. / nentry); + + histx[ij]->GetXaxis()->SetTitle("72 #times i#eta+i#phi"); + histx[ij]->GetYaxis()->SetTitle("72 #times i#eta+i#phi"); + + histx[ij]->GetXaxis()->SetTitleSize(0.045); + histx[ij]->GetXaxis()->SetTitleOffset(0.90); //0.85 + histx[ij]->GetXaxis()->CenterTitle(); + histx[ij]->GetXaxis()->SetLabelSize(0.045); + histx[ij]->GetXaxis()->SetLabelOffset(0.001); + + histx[ij]->GetYaxis()->SetTitleSize(0.045); + histx[ij]->GetYaxis()->SetTitleOffset(1.65); + histx[ij]->GetYaxis()->CenterTitle(); + histx[ij]->GetYaxis()->SetLabelSize(0.045); + histx[ij]->GetYaxis()->SetLabelOffset(0.01); + + histx[ij]->GetZaxis()->SetLabelSize(0.045); + histx[ij]->GetZaxis()->SetLabelOffset(0.01); + + histx[ij]->GetXaxis()->SetNdivisions(406); + histx[ij]->GetYaxis()->SetNdivisions(406); + histx[ij]->GetZaxis()->SetNdivisions(406); + if (ij == 0) + histx[ij]->SetMaximum(0.000001); + // if (ij==1) histx[ij]->SetMaximum(0.0000005); + c1->cd(ij + 1); + histx[ij]->Draw("colz"); + latex.DrawLatex(0.28, 0.85, Form("E_{th}=%g GeV", hothreshs[(ij == 0) ? ith1 : ith2])); + + cout << "ij " << histx[ij]->GetTitle() << endl; + } + c1->Update(); +} + +// root histall_apr14b_cosmic_csa14_cosmic.root +//NO plot11(2,3) +void plot11(int ith1 = 2, int ith2 = 3) { + def_setting(); + + TLatex latex; + latex.SetNDC(); + latex.SetTextSize(0.05); + latex.SetTextFont(42); + latex.SetTextAlign(1); //(31); // align right + const int nringmx = 5; + gStyle->SetOptStat(0); + gStyle->SetPadTopMargin(0.06); + gStyle->SetPadBottomMargin(0.10); + gStyle->SetPadLeftMargin(0.16); + gStyle->SetPadRightMargin(0.16); + + char name[100]; + TCanvas* c1 = new TCanvas("c1", "c1", 800., 500.); + c1->Divide(2, 1, 1.e-6, 1.e-6); + int nentry = ((TH2F*)gDirectory->Get("hoCalibc/hbentry_d3"))->GetBinContent(0, 0); + TH2F* histx[2]; + TH2F* histy[2]; + + sprintf(name, "hoCalibc/hoallmucorrel_%i", ith1); + histy[0] = (TH2F*)gDirectory->Get(name); + + sprintf(name, "hoCalibc/hoallmucorrel_%i", ith2); + histy[1] = (TH2F*)gDirectory->Get(name); + + for (int ij = 0; ij < 2; ij++) { + double total = 0; + histx[ij] = (TH2F*)histy[ij]->Clone(); + for (int ix = 1; ix <= histy[ij]->GetNbinsX(); ix++) { + float anent = histy[ij]->GetBinContent(ix, 0); + total += anent; + // cout<<"ix "<< ij<<" "<GetNbinsY(); iy++) { + histx[ij]->SetBinContent(ix, iy, histy[ij]->GetBinContent(ix, iy) / anent); + } + } + + histx[ij]->GetXaxis()->SetTitle("Projected muon (72 #times i#eta+i#phi)"); + histx[ij]->GetYaxis()->SetTitle("Signal in HO tower (72 #times i#eta+i#phi)"); + + histx[ij]->GetXaxis()->SetTitleSize(0.045); + histx[ij]->GetXaxis()->SetTitleOffset(0.90); //0.85 + histx[ij]->GetXaxis()->CenterTitle(); + histx[ij]->GetXaxis()->SetLabelSize(0.04); + histx[ij]->GetXaxis()->SetLabelOffset(0.001); + + histx[ij]->GetYaxis()->SetTitleSize(0.045); + histx[ij]->GetYaxis()->SetTitleOffset(1.65); + histx[ij]->GetYaxis()->CenterTitle(); + histx[ij]->GetYaxis()->SetLabelSize(0.04); + histx[ij]->GetYaxis()->SetLabelOffset(0.01); + + histx[ij]->GetZaxis()->SetLabelSize(0.04); + histx[ij]->GetZaxis()->SetLabelOffset(0.01); + + histx[ij]->GetXaxis()->SetNdivisions(406); + histx[ij]->GetYaxis()->SetNdivisions(406); + histx[ij]->GetZaxis()->SetNdivisions(406); + // if (ij==0) histx[ij]->SetMaximum(0.002); + // if (ij==1) histx[ij]->SetMaximum(0.001); + c1->cd(ij + 1); + histx[ij]->Draw("colz"); + latex.DrawLatex(0.28, 0.85, Form("E_{th}=%g GeV", hothreshs[(ij == 0) ? ith1 : ith2])); + cout << "ij " << histx[ij]->GetTitle() << endl; + } + c1->Update(); +} + +/* + +root ../local/loc2014/hist_local_*_Cosmics.root + .L anal_csa14_pl.C +alllocal(6); +root ../local/loc2014/hist_local_*_40fC.root + .L anal_csa14_pl.C +alllocal(6); +root ../local/loc2014/hist_local_*_50fC.root + .L anal_csa14_pl.C +alllocal(3); +root ../local/loc2014/hist_local_*_60fC.root + .L anal_csa14_pl.C +alllocal(9); +root ../local/loc2014/hist_local_*_peds.root + .L anal_csa14_pl.C +alllocal(3); +*/ + +void alllocal(int nfile = 9) { + char pch1[200]; + for (int ij = 0; ij < nfile; ij++) { + switch (ij) { + case 0: + _file0->cd(); + break; + case 1: + _file1->cd(); + break; + case 2: + _file2->cd(); + break; + case 3: + _file3->cd(); + break; + case 4: + _file4->cd(); + break; + case 5: + _file5->cd(); + break; + case 6: + _file6->cd(); + break; + case 7: + _file7->cd(); + break; + case 8: + _file8->cd(); + break; + case 9: + _file9->cd(); + break; + default: + _file0->cd(); + break; + } + + cout << "xx1 " << endl; + char* namex = gDirectory->GetName(); + int len2 = strlen(namex); + strncpy(pch1, namex + 17, len2 - 22); + pch1[len2 - 22] = '\0'; + sprintf(pch1, "%s.ps", pch1); + TPostScript pss(pch1, 112); + pss.Range(28, 20); //pss.Range(20,28); + cout << "xx2 " << endl; + pss.NewPage(); + pss.NewPage(); + testxx(); + pss.NewPage(); + /* + pss.NewPage(); plot000(-1,6,6,1); + pss.NewPage(); plot000(0,6,6,1); + pss.NewPage(); plot000(1,6,6,1); + pss.NewPage(); plot000(2,12,12,1); + pss.NewPage(); plot000(3,6,6,1); + pss.NewPage(); plot000(4,6,6,1); + */ + + pss.NewPage(); + plot000(0, 6, 6, 1); + plot000(1, 6, 6, 1, "same", 1); + plot000(2, 12, 12, 1, "same", 2); + plot000(3, 6, 6, 1, "same", 3); + plot000(4, 6, 6, 1, "sames", 4); + + for (int jk = 0; jk < 5; jk++) { + pss.NewPage(); + plot000(jk, 0, 0, 1); + for (int kl = 1; kl < 12; kl++) { + if (jk != 2 && kl > 5) + continue; + cout << "jk " << jk << " " << kl << endl; + if ((jk == 2 && kl == 11) || (jk != 2 && kl == 5)) { + plot000(jk, kl, kl, 1, "sames", kl); + } else { + plot000(jk, kl, kl, 1, "same", kl); + } + } + } + + // // pss.NewPage(); plot000(1,0,0,1); + // // plot000(1,1,1,1, "same",1); + // // plot000(1,2,2,1, "same",2); + // // plot000(1,3,3,1, "same",3); + // // plot000(1,4,4,1, "same",4); + // // plot000(1,5,5,1, "sames",5); + + // // /* + // // pss.NewPage(); plot000(0,0,5,1); + // // pss.NewPage(); plot000(1,0,5,1); + // // pss.NewPage(); plot000(2,0,5,1); + // // pss.NewPage(); plot000(2,6,11,1); + // // pss.NewPage(); plot000(3,0,5,1); + // // pss.NewPage(); plot000(4,0,5,1); + // // */ + + pss.NewPage(); + plot000r(-1); + pss.NewPage(); + plot000r(0); + pss.NewPage(); + plot000r(1); + pss.NewPage(); + plot000r(2); + pss.NewPage(); + plot000r(3); + pss.NewPage(); + plot000r(4); + + // // /* + // // pss.NewPage(); plot01(0,1); + // // pss.NewPage(); plot01(1,1); + // // */ + pss.NewPage(); + plot01(2, 1); + + pss.NewPage(); + plot2(0, 4, 0); + pss.NewPage(); + plot2(4, 8, 0); + + // // pss.NewPage(); plot4(0,8,0,0); + // // // pss.NewPage(); plot4(3,5,0,0); + // // // pss.NewPage(); plot4(6,8,0,0); + + // // // pss.NewPage(); plot5(0,2,0,0); + // // // pss.NewPage(); plot5(3,5,0,0); + // // // pss.NewPage(); plot5(6,8,0,0); + + pss.NewPage(); + plot6(-2, 0); + pss.NewPage(); + plot6(-1, 0); + pss.NewPage(); + plot6(0, 0); + pss.NewPage(); + plot6(1, 0); + pss.NewPage(); + plot6(2, 0); + + // // // pss.NewPage(); plot7(0,0); + // // // pss.NewPage(); plot7(1,0); + // // // pss.NewPage(); plot7(2,0); + // // // pss.NewPage(); plot7(3,0); + // // // pss.NewPage(); plot7(4,0); + // // // pss.NewPage(); plot7(2,2); + + pss.NewPage(); + plot7b(-1, 3); + pss.NewPage(); + plot7b(0, 2, 8, 0); + pss.NewPage(); + plot7b(1, 2, 8, 0); + pss.NewPage(); + plot7b(2, 2, 8, 0); + pss.NewPage(); + plot7b(3, 2, 8, 0); + pss.NewPage(); + plot7b(4, 2, 8, 0); + pss.NewPage(); + plot7b(0, 2, 8, 1); + pss.NewPage(); + plot7b(1, 2, 8, 1); + pss.NewPage(); + plot7b(2, 2, 8, 1); + pss.NewPage(); + plot7b(3, 2, 8, 1); + pss.NewPage(); + plot7b(4, 2, 8, 1); + + pss.NewPage(); + plot8(1, 8, 0); + pss.NewPage(); + plot8(1, 8, 1); + + pss.NewPage(); + plot9(2, 0); + pss.NewPage(); + plot9(2, 1); + + // pss.NewPage(); plot10(4,5); + + pss.Close(); + } +} +/* +hadd histall_local_peds.root hist_local_*_peds.root +hadd histall_local_40fc.root hist_local_22*_40fC.root +hadd histall_local_50fc.root hist_local_22*_50fC.root +hadd histall_local_60fc.root hist_local_221848_60fC.root hist_local_221945_60fC.root hist_local_222770_60fC.root +hadd histall_local_cosmics.root hist_local_220619_Cosmics.root hist_local_220620_Cosmics.root hist_local_220625_Cosmics.root +*/ + +void alllocalx(int nfile = 9) { + char pch1[200]; + for (int ij = 0; ij < nfile; ij++) { + switch (ij) { + case 0: + _file0->cd(); + break; + case 1: + _file1->cd(); + break; + case 2: + _file2->cd(); + break; + case 3: + _file3->cd(); + break; + case 4: + _file4->cd(); + break; + case 5: + _file5->cd(); + break; + case 6: + _file6->cd(); + break; + case 7: + _file7->cd(); + break; + case 8: + _file8->cd(); + break; + case 9: + _file9->cd(); + break; + case 10: + _file10->cd(); + break; + case 11: + _file11->cd(); + break; + case 12: + _file12->cd(); + break; + case 13: + _file13->cd(); + break; + case 14: + _file14->cd(); + break; + case 15: + _file15->cd(); + break; + case 16: + _file16->cd(); + break; + case 17: + _file17->cd(); + break; + case 18: + _file18->cd(); + break; + case 19: + _file19->cd(); + break; + case 20: + _file20->cd(); + break; + case 21: + _file21->cd(); + break; + case 22: + _file22->cd(); + break; + case 23: + _file23->cd(); + break; + case 24: + _file24->cd(); + break; + case 25: + _file25->cd(); + break; + case 26: + _file26->cd(); + break; + case 27: + _file27->cd(); + break; + case 28: + _file28->cd(); + break; + case 29: + _file29->cd(); + break; + + default: + _file0->cd(); + break; + } + + char* namex = gDirectory->GetName(); + int len2 = strlen(namex); + strncpy(pch1, namex + 17, len2 - 22); + pch1[len2 - 22] = '\0'; + sprintf(pch1, "xx_%s.ps", pch1); + TPostScript pss(pch1, 112); + pss.Range(28, 20); //pss.Range(20,28); + + pss.NewPage(); + pss.NewPage(); + testxx(); + pss.NewPage(); + testxx(); + + pss.NewPage(); + plot000r(-1, 0, 140); + pss.NewPage(); + plot000r(-1, 1, 140); + + // pss.NewPage(); plot000r(0); + // pss.NewPage(); plot000r(1); + // pss.NewPage(); plot000r(2); + // pss.NewPage(); plot000r(3); + // pss.NewPage(); plot000r(4); + + pss.NewPage(); + plot2(0, 4, 0); + pss.NewPage(); + plot2(4, 8, 0); + + // pss.NewPage(); plot000r(0); + // pss.NewPage(); plot000r(1); + // pss.NewPage(); plot000r(2); + // pss.NewPage(); plot000r(3); + // pss.NewPage(); plot000r(4); + + pss.NewPage(); + plot01(2, 1); + + pss.NewPage(); + plot7b(-1, 2, 8); + pss.NewPage(); + plot7b(0, 2, 8, 0); + pss.NewPage(); + plot7b(1, 2, 8, 0); + pss.NewPage(); + plot7b(2, 2, 8, 0); + pss.NewPage(); + plot7b(3, 2, 8, 0); + pss.NewPage(); + plot7b(4, 2, 8, 0); + pss.NewPage(); + plot7b(0, 2, 8, 1); + pss.NewPage(); + plot7b(1, 2, 8, 1); + pss.NewPage(); + plot7b(2, 2, 8, 1); + pss.NewPage(); + plot7b(3, 2, 8, 1); + pss.NewPage(); + plot7b(4, 2, 8, 1); + + pss.NewPage(); + plot8(1, 8, 0); + pss.NewPage(); + plot8(1, 8, 1); + + pss.NewPage(); + plot9(2, 0); + // pss.NewPage(); plot9(2,1); + + // pss.NewPage(); plot10(4,5); + + pss.NewPage(); + plot4(0, 8, 0, 0); + + // // // pss.NewPage(); plot5(0,2,0,0); + // // // pss.NewPage(); plot5(3,5,0,0); + // // // pss.NewPage(); plot5(6,8,0,0); + + pss.NewPage(); + plot000(0, 6, 6, 1); + plot000(1, 6, 6, 1, "same", 1); + plot000(2, 12, 12, 1, "same", 2); + plot000(3, 6, 6, 1, "same", 3); + plot000(4, 6, 6, 1, "sames", 4); + + for (int jk = 0; jk < 5; jk++) { + pss.NewPage(); + plot000(jk, 0, 0, 1); + for (int kl = 1; kl < 12; kl++) { + if (jk != 2 && kl > 5) + continue; + cout << "jk " << jk << " " << kl << endl; + if ((jk == 2 && kl == 11) || (jk != 2 && kl == 5)) { + plot000(jk, kl, kl, 1, "sames", kl); + } else { + plot000(jk, kl, kl, 1, "same", kl); + } + } + } + + pss.NewPage(); + plot6(-2, 0); + pss.NewPage(); + plot6(-1, 0); + pss.NewPage(); + plot6(0, 0); + pss.NewPage(); + plot6(1, 0); + pss.NewPage(); + plot6(2, 0); + + pss.Close(); + } +} + +// scp hcal_local_*_peds.root hcal_local_*_40fC.root hcal_local_*_50fC.root hcal_local_*_60fC.root hist_local_*_peds.root hist_local_*_40fC.root hist_local_*_50fC.root hist_local_*_60fC.root gobinda@158.144.54.116:/data/gobinda/anal/hcal/local/loc2014/ + +void test1x() { + for (int ij = 1; ij < 14; ij++) { + cout << "INR " << 6200 * ij + 4000 << " (for " << ij << " nights)" << endl; + } +} + +void sigpedrun(int nrn = 100) { + TPostScript ps("testxx.ps", 111); + ps.Range(20, 28); + TCanvas* c0x = new TCanvas("c0x", " Pedestal and signal", 900, 1200); + c0x->Divide(5, 4, 1.e-5, 1.e-5, 0); + + TH1F* signal_run[5][3000]; + char name[100]; + + for (int ix = 0; ix < nrn; ix++) { + int ixxy = ix % 4; + if (ixxy == 0) { + ps.NewPage(); + } + for (int iy = 0; iy < ringmx; iy++) { + sprintf(name, "noise_ring_%i_run%i", iy, ix); + signal_run[iy][ix] = (TH1F*)gDirectory->Get(name); + double mean = signal_run[iy][ix]->GetMean(); + double rms = signal_run[iy][ix]->GetRMS(); + if (iy == 0) + cout << ix << " " << signal_run[iy][ix]->GetTitle() << " "; + // cout <<" "<GetEntries()<<" "<cd(ringmx * ixxy + iy + 1); + signal_run[iy][ix]->SetLineColor(3); + signal_run[iy][ix]->GetXaxis()->SetLabelSize(0.095); + signal_run[iy][ix]->GetXaxis()->SetNdivisions(404); + signal_run[iy][ix]->GetYaxis()->SetLabelSize(0.095); + signal_run[iy][ix]->GetXaxis()->SetLabelOffset(-0.02); + signal_run[iy][ix]->Draw(); + if (ixxy == 3) { + c0x->Update(); + } + } + cout << endl; + } + + ps.Close(); +} +/* + Run # 297180 Evt # 102392070 1 7024424 + +All 94.67 92.49 95.35 92.7 94.71 + +ndof 93.37 92 94.58 92.21 93.3 +chisq 93.34 91.96 94.53 92.16 93.27 +angle 93.33 91.96 94.53 92.16 93.27 +pt 92.13 90.45 92.22 90.63 92.01 +isol 62.28 56 55.51 56.17 62.68 +phi 56.27 50.7 47.38 50.85 56.58 +eta 52.41 46.51 36.64 46.69 52.7 +Time 52.24 46.4 36.63 46.54 52.54 + + +hodx 99.31 97.74 99.62 98.03 99.32 +iso 96.61 94.44 97 94.67 96.68 +pt 96.4 94.17 96.81 94.4 96.48 + + + + 1 Constant 8.56917e+01 2.42013e+00 7.85930e-03 3.06102e-06 + 2 Mean 1.00342e+00 1.07020e-03 4.43892e-06 3.20972e-03 + 3 Sigma 4.79270e-02 8.60831e-04 1.86192e-05 -5.88994e-03 + + 1 Constant 1.92784e+02 5.34817e+00 1.63458e-02 -1.85787e-06 + 2 Mean 9.99574e-01 4.75653e-04 1.82064e-06 2.98504e-02 + 3 Sigma 2.14641e-02 3.63935e-04 1.51944e-05 -3.40005e-03 + + 1 Constant 4.23168e+02 1.23598e+01 3.79784e-02 -4.19190e-05 + 2 Mean 1.01199e+00 2.17199e-04 8.81854e-07 -3.90635e-01 + 3 Sigma 9.80276e-03 1.89893e-04 1.59833e-05 -2.89784e-02 + + 1 Constant 2.73388e+02 7.95311e+00 2.29623e-02 1.00544e-07 + 2 Mean 1.01965e+00 3.34716e-04 1.28072e-06 1.32401e-01 + 3 Sigma 1.52308e-02 2.92214e-04 1.60562e-05 -4.93738e-03 + + 1 Constant 3.33148e+02 9.67580e+00 2.88215e-02 -1.45420e-05 + 2 Mean 1.02102e+00 2.74804e-04 1.08052e-06 -2.43768e+00 + 3 Sigma 1.24753e-02 2.37824e-04 1.60597e-05 3.78574e-02 + + 1 Constant 4.11514e+02 1.19379e+01 3.34777e-02 -1.48396e-07 + 2 Mean 1.02247e+00 2.23653e-04 8.24581e-07 3.21928e-03 + 3 Sigma 1.01355e-02 1.93182e-04 1.45150e-05 -2.31771e-04 + + 1 Constant 4.17155e+02 1.22384e+01 3.67076e-02 -3.41070e-05 + 2 Mean 1.02334e+00 2.19820e-04 8.75434e-07 -4.30174e+00 + 3 Sigma 9.95279e-03 1.94035e-04 1.57779e-05 1.98571e-02 + + 1 Constant 3.99846e+02 1.20076e+01 4.10521e-02 1.64058e-06 + 2 Mean 1.02511e+00 2.34554e-04 1.05387e-06 4.74777e-02 + 3 Sigma 1.02668e-02 2.09319e-04 1.83947e-05 1.76225e-02 + + +CRO_pulse->Draw("c2PeakTime_1[0]","c1PeakTime_1[0]>-100&&c2PeakTime_1[0]>-100&&") + +CRO_pulse->Draw("c4PeakTime_1[1]","c3PeakTime_1[1]>-100&&c4PeakTime_1[1]>-100&&c3PeakTime_1[1]>1.e-6&&c4PeakTime_1[1]>1.e-6") + + +*/ diff --git a/Calibration/HcalCalibAlgos/macros/hocalib_tmpfit.C b/Calibration/HcalCalibAlgos/macros/hocalib_tmpfit.C new file mode 100644 index 0000000000000..25dcfd5ab353c --- /dev/null +++ b/Calibration/HcalCalibAlgos/macros/hocalib_tmpfit.C @@ -0,0 +1,943 @@ +#include "TFile.h" +#include "TH1F.h" +#include "TH2F.h" +#include "TTree.h" +#include "TProfile.h" +#include "TPostScript.h" +#include "TCanvas.h" +#include "TF1.h" +#include "TStyle.h" +#include "TLatex.h" +#include "TLegend.h" +#include "TPaveStats.h" + +#include "TRandom.h" + +#include + +#include +#include +#include +#include +#include "TMinuit.h" +#include "TMath.h" + +const char* prehist = "hoCalibc/"; + +using namespace std; +static unsigned int mypow_2[32]; + +int irunold = 1000; +const int nmxbin = 40000; +float yvalft[nmxbin]; +float xvalft[nmxbin]; +int nvalft = 0; + +float alowx = -1.0; +float ahighx = 29.0; +int auprange = 25; + +double fitchisq; +int fitndof; +double anormglb = -1; +Double_t gausX(Double_t* x, Double_t* par) { return par[0] * (TMath::Gaus(x[0], par[1], par[2], kTRUE)); } + +// Double_t landX(Double_t* x, Double_t* par) { +// return par[0]*(TMath::Landau(x[0], par[1], par[2])); +// } + +// Double_t completefit(Double_t* x, Double_t* par) { +// return gausX(x, par) + landX(x, &par[3]); +// } + +Double_t langaufun(Double_t* x, Double_t* par) { + //Fit parameters: + //par[0]*par[1]=Width (scale) parameter of Landau density + //par[1]=Most Probable (MP, location) parameter of Landau density + //par[2]=Total area (integral -inf to inf, normalization constant) + //par[3]=Width (sigma) of convoluted Gaussian function + // + //In the Landau distribution (represented by the CERNLIB approximation), + //the maximum is located at x=-0.22278298 with the location parameter=0. + //This shift is corrected within this function, so that the actual + //maximum is identical to the MP parameter. + // /* + // Numeric constants + Double_t invsq2pi = 0.3989422804014; // (2 pi)^(-1/2) + Double_t mpshift = -0.22278298; // Landau maximum location + + // Control constants + Double_t np = 100.0; // number of convolution steps + Double_t sc = 5.0; // convolution extends to +-sc Gaussian sigmas + + // Variables + Double_t xx; + Double_t mpc; + Double_t fland; + Double_t sum = 0.0; + Double_t xlow, xupp; + Double_t step; + + // MP shift correction + mpc = par[1] - mpshift * par[0] * par[1]; + double scale = 1; // par[1]; + double scale2 = anormglb; // for notmalisation this is one, otehrwise use the normalisation; + if (scale2 < .1) + scale2 = 0.1; + // double scale=par[1]; + // Range of convolution integral + xlow = x[0] - sc * scale * par[3]; + xupp = x[0] + sc * scale * par[3]; + + step = (xupp - xlow) / np; + + // Convolution integral of Landau and Gaussian by sum + for (double ij = 1.0; ij <= np / 2; ij++) { + xx = xlow + (ij - .5) * step; + fland = TMath::Landau(xx, mpc, par[0] * par[1], kTRUE); // / par[0]; + if (xx > par[1]) { + fland *= exp(-(xx - par[1]) / par[4]); + } + sum += fland * TMath::Gaus(x[0], xx, scale * par[3]); + xx = xupp - (ij - .5) * step; + fland = TMath::Landau(xx, mpc, par[0] * par[1], kTRUE); // / par[0]; + if (xx > par[1]) { + fland *= exp(-(xx - par[1]) / par[4]); + } + sum += fland * TMath::Gaus(x[0], xx, scale * par[3]); + } + return (par[2] * step * sum * invsq2pi / (scale2 * par[3])); +} + +Double_t totalfunc(Double_t* x, Double_t* par) { + return gausX(x, par) + langaufun(x, &par[3]); // /max(.001,anormglb); +} + +const int netamx = 30; +const int nphimx = 72; + +int getHOieta(int ij) { return (ij < netamx / 2) ? -netamx / 2 + ij : -netamx / 2 + ij + 1; } +int invert_HOieta(int ieta) { return (ieta < 0) ? netamx / 2 + ieta : netamx / 2 + ieta - 1; } + +int ietafit; +int iphifit; + +void fcnsg(Int_t& npar, Double_t* gin, Double_t& f, Double_t* par, Int_t flag) { + double xval[2]; + + anormglb = 1; + double tmpnorm = 0; + for (int ij = 0; ij < 600; ij++) { + xval[0] = -5 + (ij + 0.5) * .1; + tmpnorm += 0.1 * langaufun(xval, &par[3]) / par[5]; + } + anormglb = tmpnorm; + + double fval = -(par[0] + par[5]); + for (int ij = 0; ij < nvalft; ij++) { + if (yvalft[ij] < 1 || xvalft[ij] > auprange) + continue; + xval[0] = xvalft[ij]; + fval += yvalft[ij] * log(max(1.e-30, totalfunc(xval, par))); + } + f = -fval; +} + +int main() { + int icol = 0; + int ntotal = 0; + int irebin = 1; + int ifile = 0; + for (int ij = 0; ij < 32; ij++) { + mypow_2[ij] = (int)pow(float(2), ij); + } + + int max_nEvents = 300000000; + int ityp = 1; + bool m_cosmic = false; + bool m_histFill = true; + bool m_treeFill = false; + bool m_zeroField = false; + float pival = acos(-1.); + + int nsize; + char outfile[100]; + char outfilx[100]; + char nametag[100]; + char nametag2[100]; + char infile[200]; + char datafile[100]; + char histname[100]; + char name[100]; + char title[100]; + + cout << "Give the value of rebinning: a nonzero positive integer" << endl; + cin >> irebin; + if (irebin < 1) { + irebin = 1; + } + cout << "Give the upper range of signal for fit [5 - 29]" << endl; + cin >> auprange; + + cout << "Give the histname, e.g., 2017b_v2 2018a_v3a" << endl; + cin >> nametag2; + + int len = strlen(nametag2); + nametag2[len] = '\0'; + + sprintf(outfilx, "hist_hoprompt_%s.root", nametag2); + len = strlen(outfilx); + outfilx[len] = '\0'; + + // TFile* fileIn = new TFile("histalla_hcalcalho_2016bcde_v2a.root", "read"); + + TFile* fileIn = new TFile(outfilx, "read"); + // const char* nametag="2016e_ar1"; + // sprintf(nametag, "2016b_ar%i", irebin); + + unsigned ievt, hoflag; + int irun, ilumi, nprim, isect, isect2, ndof, nmuon; + + float inslumi, trkdr, trkdz, trkvx, trkvy, trkvz, trkmm, trkth, trkph, chisq, therr, pherr, hodx, hody, hoang, htime, + hosig[9], hocorsig[18], hocro, hbhesig[9], caloen[3]; + float momatho, tkpt03, ecal03, hcal03; + float tmphoang; + + TTree* Tin; + if (m_treeFill) { + Tin = (TTree*)fileIn->Get("T1"); + + Tin->SetBranchAddress("irun", &irun); + Tin->SetBranchAddress("ievt", &ievt); + + Tin->SetBranchAddress("isect", &isect); + Tin->SetBranchAddress("isect2", &isect2); + Tin->SetBranchAddress("ndof", &ndof); + Tin->SetBranchAddress("nmuon", &nmuon); + + Tin->SetBranchAddress("ilumi", &ilumi); + if (!m_cosmic) { + Tin->SetBranchAddress("inslumi", &inslumi); + Tin->SetBranchAddress("nprim", &nprim); + Tin->SetBranchAddress("tkpt03", &tkpt03); + Tin->SetBranchAddress("ecal03", &ecal03); + Tin->SetBranchAddress("hcal03", &hcal03); + } + + Tin->SetBranchAddress("trkdr", &trkdr); + Tin->SetBranchAddress("trkdz", &trkdz); + + Tin->SetBranchAddress("trkvx", &trkvx); + Tin->SetBranchAddress("trkvy", &trkvy); + Tin->SetBranchAddress("trkvz", &trkvz); + Tin->SetBranchAddress("trkmm", &trkmm); + Tin->SetBranchAddress("trkth", &trkth); + Tin->SetBranchAddress("trkph", &trkph); + + Tin->SetBranchAddress("chisq", &chisq); + Tin->SetBranchAddress("therr", &therr); + Tin->SetBranchAddress("pherr", &pherr); + Tin->SetBranchAddress("hodx", &hodx); + Tin->SetBranchAddress("hody", &hody); + Tin->SetBranchAddress("hoang", &hoang); + + Tin->SetBranchAddress("momatho", &momatho); + Tin->SetBranchAddress("hoflag", &hoflag); + Tin->SetBranchAddress("htime", &htime); + Tin->SetBranchAddress("hosig", hosig); + Tin->SetBranchAddress("hocro", &hocro); + Tin->SetBranchAddress("hocorsig", hocorsig); + Tin->SetBranchAddress("caloen", caloen); + } + + sprintf(nametag, "%s_ar%i_float_par8_rng%i", nametag2, irebin, auprange); + + TLatex latex; + latex.SetNDC(); + latex.SetTextSize(0.06); + latex.SetTextFont(22); + latex.SetTextAlign(11); // 11 left; // 21 centre, // (31); // align right, 22, 23, shift bottom + + //Related fitting, not for storing + const int nsample = 16; //# of signal plots in the .ps page + TF1* pedfun[nsample] = {0}; + TF1* sigfun[nsample] = {0}; + TF1* signalx[nsample] = {0}; + + TH1F* signall[nsample] = {0}; + + TH1F* signallunb[nsample] = {0}; + + const int nbgpr = 3; + const int nsgpr = 8; + double fitprm[nsgpr][netamx]; + double xmn = -1.0; + double xmx = 29.0; + + sprintf(outfilx, "fit_%s", nametag); + len = strlen(outfilx); + outfilx[len] = '\0'; + + sprintf(outfile, "%s.txt", outfilx); + ofstream file_out(outfile); + + sprintf(outfile, "%s.root", outfilx); + + TFile* fileOut = new TFile(outfile, "recreate"); + + TTree* Tout; + + TH1F* sigrsg[netamx][nphimx]; + + TH1F* fit_chi; + TH1F* sig_evt; + TH1F* fit_sigevt; + TH1F* fit_bkgevt; + TH1F* sig_mean; + TH1F* sig_diff; + TH1F* sig_width; + TH1F* sig_sigma; + TH1F* sig_expo; + TH1F* sig_meanerr; + TH1F* sig_meanerrp; + TH1F* sig_signf; + + TH1F* sig_statmean; + TH1F* sig_rms; + + TH2F* ped2d_evt; + TH2F* ped2d_mean; + TH2F* ped2d_width; + TH2F* fit2d_chi; + TH2F* sig2d_evt; + TH2F* fit2d_sigevt; + TH2F* fit2d_bkgevt; + TH2F* sig2d_mean; + TH2F* sig2d_diff; + TH2F* sig2d_width; + TH2F* sig2d_sigma; + TH2F* sig2d_expo; + TH2F* sig2d_meanerr; + TH2F* sig2d_meanerrp; + TH2F* sig2d_signf; + TH2F* sig2d_rms; + TH2F* sig2d_statmean; + + fit_chi = new TH1F("fit_chi", "fit_chi", netamx * nphimx, -0.5, netamx * nphimx - 0.5); + sig_evt = new TH1F("sig_evt", "sig_evt", netamx * nphimx, -0.5, netamx * nphimx - 0.5); + fit_sigevt = new TH1F("fit_sigevt", "fit_sigevt", netamx * nphimx, -0.5, netamx * nphimx - 0.5); + fit_bkgevt = new TH1F("fit_bkgevt", "fit_bkgevt", netamx * nphimx, -0.5, netamx * nphimx - 0.5); + sig_mean = new TH1F("sig_mean", "sig_mean", netamx * nphimx, -0.5, netamx * nphimx - 0.5); + sig_diff = new TH1F("sig_diff", "sig_diff", netamx * nphimx, -0.5, netamx * nphimx - 0.5); + sig_width = new TH1F("sig_width", "sig_width", netamx * nphimx, -0.5, netamx * nphimx - 0.5); + sig_sigma = new TH1F("sig_sigma", "sig_sigma", netamx * nphimx, -0.5, netamx * nphimx - 0.5); + sig_expo = new TH1F("sig_expo", "sig_expo", netamx * nphimx, -0.5, netamx * nphimx - 0.5); + + sig_meanerr = new TH1F("sig_meanerr", "sig_meanerr", netamx * nphimx, -0.5, netamx * nphimx - 0.5); + sig_meanerrp = new TH1F("sig_meanerrp", "sig_meanerrp", netamx * nphimx, -0.5, netamx * nphimx - 0.5); + sig_signf = new TH1F("sig_signf", "sig_signf", netamx * nphimx, -0.5, netamx * nphimx - 0.5); + + sig_statmean = new TH1F("sig_statmean", "sig_statmean", netamx * nphimx, -0.5, netamx * nphimx - 0.5); + sig_rms = new TH1F("sig_rms", "sig_rms", netamx * nphimx, -0.5, netamx * nphimx - 0.5); + + fit2d_chi = + new TH2F("fit2d_chi", "fit2d_chi", netamx + 1, -netamx / 2. - 0.5, netamx / 2. + 0.5, nphimx, 0.5, nphimx + 0.5); + sig2d_evt = + new TH2F("sig2d_evt", "sig2d_evt", netamx + 1, -netamx / 2. - 0.5, netamx / 2. + 0.5, nphimx, 0.5, nphimx + 0.5); + fit2d_sigevt = new TH2F( + "fit2d_sigevt", "fit2d_sigevt", netamx + 1, -netamx / 2. - 0.5, netamx / 2. + 0.5, nphimx, 0.5, nphimx + 0.5); + fit2d_bkgevt = new TH2F( + "fit2d_bkgevt", "fit2d_bkgevt", netamx + 1, -netamx / 2. - 0.5, netamx / 2. + 0.5, nphimx, 0.5, nphimx + 0.5); + sig2d_mean = new TH2F( + "sig2d_mean", "sig2d_mean", netamx + 1, -netamx / 2. - 0.5, netamx / 2. + 0.5, nphimx, 0.5, nphimx + 0.5); + sig2d_diff = new TH2F( + "sig2d_diff", "sig2d_diff", netamx + 1, -netamx / 2. - 0.5, netamx / 2. + 0.5, nphimx, 0.5, nphimx + 0.5); + sig2d_width = new TH2F( + "sig2d_width", "sig2d_width", netamx + 1, -netamx / 2. - 0.5, netamx / 2. + 0.5, nphimx, 0.5, nphimx + 0.5); + sig2d_sigma = new TH2F( + "sig2d_sigma", "sig2d_sigma", netamx + 1, -netamx / 2. - 0.5, netamx / 2. + 0.5, nphimx, 0.5, nphimx + 0.5); + sig2d_expo = new TH2F( + "sig2d_expo", "sig2d_expo", netamx + 1, -netamx / 2. - 0.5, netamx / 2. + 0.5, nphimx, 0.5, nphimx + 0.5); + + sig2d_statmean = new TH2F( + "sig2d_statmean", "sig2d_statmean", netamx + 1, -netamx / 2. - 0.5, netamx / 2. + 0.5, nphimx, 0.5, nphimx + 0.5); + sig2d_rms = + new TH2F("sig2d_rms", "sig2d_rms", netamx + 1, -netamx / 2. - 0.5, netamx / 2. + 0.5, nphimx, 0.5, nphimx + 0.5); + + sig2d_meanerr = new TH2F( + "sig2d_meanerr", "sig2d_meanerr", netamx + 1, -netamx / 2. - 0.5, netamx / 2. + 0.5, nphimx, 0.5, nphimx + 0.5); + sig2d_meanerrp = new TH2F( + "sig2d_meanerrp", "sig2d_meanerrp", netamx + 1, -netamx / 2. - 0.5, netamx / 2. + 0.5, nphimx, 0.5, nphimx + 0.5); + sig2d_signf = new TH2F( + "sig2d_signf", "sig2d_signf", netamx + 1, -netamx / 2. - 0.5, netamx / 2. + 0.5, nphimx, 0.5, nphimx + 0.5); + + if (m_histFill) { + for (int jk = 0; jk < netamx; jk++) { + for (int ij = 0; ij < nphimx; ij++) { + // sprintf(name, "%sho_indenergy_%i_%i", prehist, jk, ij); + sprintf(name, "%ssig_eta%i_phi%i", prehist, jk, ij); + sigrsg[jk][ij] = (TH1F*)fileIn->Get(name); + cout << "jkij " << jk << " " << ij << " " << name << endl; + } + } + } else if (m_treeFill) { + for (int jk = 0; jk < netamx; jk++) { + int ieta = getHOieta(jk); + for (int ij = 0; ij < nphimx; ij++) { + sprintf(name, "ho_indenergy_%i_%i", jk, ij); + sprintf(title, "signal (i#eta=%i - i#phi=%i", ieta, ij + 1); + sigrsg[jk][ij] = new TH1F(name, name, 120, -1.0, 14.0); //1200, -1.0, 29.0); + } + } + + int nentries = Tin->GetEntries(); + for (int iev = 0; iev < nentries; iev++) { + fileIn->cd(); + Tin->GetEntry(iev); + fileOut->cd(); + int ieta = int((abs(isect) % 10000) / 100.) - 50; + int iphi = abs(isect) % 100; + int tmpxet = invert_HOieta(ieta); + + //event selection + if (hosig[4] > -90) { + sigrsg[tmpxet][iphi - 1]->Fill(hosig[4]); + } + } + } else { + cout << " You must read either histogramme or tree " << endl; + return 1; + } + + gStyle->SetTitleFontSize(0.075); + gStyle->SetTitleBorderSize(1); + gStyle->SetPadTopMargin(0.12); + gStyle->SetPadBottomMargin(0.10); + gStyle->SetPadLeftMargin(0.15); + gStyle->SetPadRightMargin(0.03); + + gStyle->SetOptStat(1110); + gStyle->SetLabelSize(0.095, "XYZ"); + gStyle->SetLabelOffset(-0.01, "XYZ"); + gStyle->SetHistLineColor(1); + gStyle->SetHistLineWidth(2); + gStyle->SetPadGridX(0); + gStyle->SetPadGridY(0); + gStyle->SetGridStyle(0); + gStyle->SetOptLogy(1); + + int ips = 111; + sprintf(outfile, "%s.ps", outfilx); + TPostScript ps(outfile, ips); + ps.Range(20, 28); + gStyle->SetOptLogy(0); + gStyle->SetPadLeftMargin(0.17); + + gStyle->SetPadGridX(3); + gStyle->SetPadGridY(3); + gStyle->SetGridStyle(2); + gStyle->SetPadRightMargin(0.17); + gStyle->SetPadLeftMargin(0.10); + + gStyle->SetTitleFontSize(0.045); + gStyle->SetPadTopMargin(0.10); //.12 + gStyle->SetPadBottomMargin(0.12); //.14 + gStyle->SetPadLeftMargin(0.17); + gStyle->SetPadRightMargin(0.03); + + gStyle->SetOptStat(0); //GMA (1110); + + gStyle->SetOptFit(101); + gStyle->SetCanvasBorderMode(0); + gStyle->SetPadBorderMode(0); + gStyle->SetStatBorderSize(1); + gStyle->SetStatStyle(1001); + gStyle->SetTitleColor(10); + gStyle->SetTitleFontSize(0.09); + gStyle->SetTitleOffset(-0.05); + gStyle->SetTitleFillColor(10); + gStyle->SetTitleBorderSize(1); + + gStyle->SetCanvasColor(10); + gStyle->SetPadColor(10); + gStyle->SetStatColor(10); + // gStyle->SetStatFontSize(.07); + gStyle->SetStatX(0.99); + gStyle->SetStatY(0.99); + gStyle->SetStatW(0.44); + gStyle->SetStatH(0.16); + gStyle->SetTitleSize(0.065, "XYZ"); + gStyle->SetLabelSize(0.075, "XYZ"); + gStyle->SetLabelOffset(0.012, "XYZ"); + gStyle->SetPadGridX(0); //(1) + gStyle->SetPadGridY(0); //(1) + gStyle->SetGridStyle(3); + gStyle->SetNdivisions(101, "XY"); + gStyle->SetOptLogy(1); //0); //GMA 1 + int iiter = 0; + + ps.NewPage(); + + int xsiz = 900; //900; + int ysiz = 1200; //600; + TCanvas* c0 = new TCanvas("c0", " Pedestal vs signal", xsiz, ysiz); + c0->Divide(4, 4); + fileOut->cd(); + for (int ij = 0; ij < nphimx; ij++) { + int iphi = ij + 1; + // for (int jk=0; jkClone("hnew"); + if (irebin > 1) { + signall[izone]->Rebin(irebin); + } + + signallunb[izone] = (TH1F*)signall[izone]->Clone("hnew"); + signall[izone]->Rebin(10 / irebin); + + if (izone == 0) { //iiter%8 ==0) { + ps.NewPage(); + } + c0->cd(izone + 1); + if (signall[izone]->GetEntries() / 2. > 5) { + double binwid = signall[izone]->GetBinWidth(1); + + Double_t parall[nsgpr]; + double parserr[nsgpr]; + double fitres[nsgpr]; + double pedht = 0; + + char temp[20]; + xmn = signall[izone]->GetXaxis()->GetXmin(); + xmx = signall[izone]->GetXaxis()->GetXmax(); + int nbn = signall[izone]->FindBin(0); + + cout << "bincenter ===================================== " << signall[izone]->GetBinCenter(nbn) << endl; + pedht = (signall[izone]->GetBinContent(nbn - 1) + signall[izone]->GetBinContent(nbn) + + signall[izone]->GetBinContent(nbn + 1)) / + 3.; + + parall[0] = max(1.0, 0.9 * pedht); //Pedestal peak + parall[1] = 0.00; //pedestal mean + parall[2] = 0.03; //pedestal width + parall[3] = 0.135; //Gaussian smearing of Landau function + parall[4] = 0.7 * signallunb[izone]->GetMean(); //fitprm[4][jk]; //from 2015 cosmic data + parall[5] = signallunb[izone]->GetEntries() / 2.; + parall[6] = 0.2238; // from 2015 cosmic data + parall[7] = 5.0; + + nvalft = min(nmxbin, signallunb[izone]->GetNbinsX()); + + for (int lm = 0; lm < nvalft; lm++) { + xvalft[lm] = signallunb[izone]->GetBinCenter(lm + 1); + yvalft[lm] = signallunb[izone]->GetBinContent(lm + 1); + } + + TMinuit* gMinuit = new TMinuit(nsgpr); + TString namex[nsgpr] = {"const", "mean", "sigma", "Width", "MP", "Area", "GSigma", "Exp"}; + double strt[nsgpr] = {parall[0], parall[1], parall[2], parall[3], parall[4], parall[5], parall[6], parall[7]}; + double alx = max(0.0, 0.1 * parall[0] - 1.1); + double alowmn[nsgpr] = { + alx, -0.1, -0.1, 0.06, 0.5 * strt[4] - 0.5, 0.1 * strt[5], 0.1 * strt[6], 0.5 * parall[7]}; + double ahighmn[nsgpr] = { + 5.0 * parall[0] + 10.1, 0.1, 0.1, 0.25, 1.5 * strt[4] + 0.5, 1.5 * strt[5], 3.2 * strt[6], 10.0 * parall[7]}; + + double step[nsgpr] = {0.1, 0.01, 0.01, 0.001, 0.001, 1.0, 0.001, 0.01}; + + gMinuit->SetFCN(fcnsg); + + double arglist[10]; + int ierflg = 0; + arglist[0] = 0.5; + gMinuit->mnexcm("SET ERR", arglist, 1, ierflg); + + for (int lm = 0; lm < nsgpr; lm++) { + gMinuit->mnparm(lm, namex[lm], strt[lm], step[lm], alowmn[lm], ahighmn[lm], ierflg); + } + + arglist[0] = 0; + gMinuit->mnexcm("MINIMIZE", arglist, 0, ierflg); + + arglist[0] = 0; + gMinuit->mnexcm("IMPROVE", arglist, 0, ierflg); + + TString chnam; + double parv, err, xlo, xup, plerr, mierr, eparab, gcc; + int iuit; + + for (int lm = 0; lm < nsgpr; lm++) { + gMinuit->mnpout(lm, chnam, parv, err, xlo, xup, iuit); + gMinuit->mnerrs(lm, plerr, mierr, eparab, gcc); + fitres[lm] = fitprm[lm][jk] = parv; + parserr[lm] = err; + } + + fitres[0] *= binwid; + fitres[5] *= binwid; + + double fedm, errdef; + int nparx, istat; + gMinuit->mnstat(fitchisq, fedm, errdef, fitndof, nparx, istat); + + delete gMinuit; + + anormglb = 1; + double tmpnorm = 0; + for (int ix = 0; ix < 600; ix++) { + double xval[2]; + xval[0] = -5 + (ix + 0.5) * .1; + tmpnorm += 0.1 * langaufun(xval, &fitres[3]) / fitres[5]; + } + anormglb = tmpnorm; + + double stp = 30 * fitres[3] * fitres[4] / 1000.; + double str = fitres[4] * (1. - 5. * fitres[3]); + double xx[2]; + double sum1 = 0; + double sum2 = 0; + + for (int lm = 0; lm < 1000; lm++) { + xx[0] = str + (lm + 0.5) * stp; + double landf = langaufun(xx, &fitres[3]); //No need of normalisation + sum1 += landf; + sum2 += xx[0] * landf; + } + + sum2 /= TMath::Max(0.1, sum1); + // signall[izone]->GetXaxis()->SetRangeUser(-0.25, 4.75); + signall[izone]->Draw("hist"); + + sprintf(temp, "pedfun_%i", izone); + pedfun[izone] = new TF1(temp, gausX, xmn, xmx, nbgpr); + pedfun[izone]->SetParameters(fitres); + pedfun[izone]->SetLineColor(3); + pedfun[izone]->SetLineWidth(1); + pedfun[izone]->Draw("same"); + + sprintf(temp, "signalfun_%i", izone); + + sigfun[izone] = new TF1(temp, langaufun, xmn, xmx, nsgpr - nbgpr); + sigfun[izone]->SetParameters(&fitres[3]); + sigfun[izone]->SetLineWidth(1); + sigfun[izone]->SetLineColor(4); + sigfun[izone]->Draw("same"); + + cout << "sum2 " << sum2 << " " << sigfun[izone]->Integral(fitres[4] * (1. - 5. * fitres[3]), str + 1000.5 * stp) + << " " << binwid << endl; + + sprintf(temp, "total_%i", izone); + signalx[izone] = new TF1(temp, totalfunc, xmn, xmx, nsgpr); + signalx[izone]->SetParameters(fitres); + signalx[izone]->SetLineWidth(1); + signalx[izone]->Draw("same"); + + latex.DrawLatex( + 0.60, 0.83, Form("#mu: %g#pm%g", int(1000 * fitres[4]) / 1000., int(1000 * parserr[4]) / 1000.)); + latex.DrawLatex(0.60, + 0.765, + Form("#Gamma: %g#pm%g", + int(1000 * fitres[3] * fitres[4]) / 1000., + int(1000 * (sqrt((fitres[3] * parserr[4]) * (fitres[3] * parserr[4]) + + (fitres[4] * parserr[3]) * (fitres[4] * parserr[3])))) / + 1000.)); + latex.DrawLatex( + 0.60, 0.70, Form("#sigma: %g#pm%g", int(1000 * fitres[6]) / 1000., int(1000 * parserr[6]) / 1000.)); + latex.DrawLatex(0.65, 0.64, Form("A: %g#pm%g", int(1 * fitres[5]) / 1., int(10 * parserr[5]) / 10.)); + latex.DrawLatex(0.67, 0.58, Form("Ex: %g#pm%g", int(10 * fitres[7]) / 10., int(10 * parserr[7]) / 10.)); + + latex.DrawLatex(0.67, 0.52, Form("Mean: %g ", int(100 * sum2) / 100.)); + + cout << "histinfo fit " << std::setw(3) << ieta << " " << std::setw(3) << ij + 1 << " " << std::setw(5) + << signallunb[izone]->GetEntries() / 2. << " " << std::setw(6) << signallunb[izone]->GetMean() << " " + << std::setw(6) << signallunb[izone]->GetRMS() << " " << std::setw(6) << fitchisq << " " << std::setw(3) + << fitndof << endl; + + file_out << "histinfo fit " << std::setw(3) << ieta << " " << std::setw(3) << ij + 1 << " " << std::setw(5) + << signallunb[izone]->GetEntries() / 2. << " " << std::setw(6) << signallunb[izone]->GetMean() << " " + << std::setw(6) << signallunb[izone]->GetRMS() << endl; + + file_out << "fitresx " << ieta << " " << ij + 1 << " " << fitres[0] / binwid << " " << fitres[1] << " " + << fitres[2] << " " << fitres[3] << " " << fitres[4] << " " << fitres[5] / binwid << " " << fitres[6] + << " " << signallunb[izone]->GetEntries() / 2. << " " << fitchisq << " " << fitndof << " " << binwid + << " " << sum2 << " " << fitres[7] << endl; + file_out << "parserr " << ieta << " " << ij + 1 << " " << parserr[0] << " " << parserr[1] << " " << parserr[2] + << " " << parserr[3] << " " << parserr[4] << " " << parserr[5] << " " << parserr[6] << " " + << parserr[7] << endl; + + double diff = fitres[4] - fitres[1]; + if (diff <= 0) + diff = 0.000001; + + int ifl = nphimx * jk + ij; + + fit_chi->Fill(ifl, fitchisq); //signal[izone]->GetChisquare()); + sig_evt->Fill(ifl, signallunb[izone]->GetEntries() / 2.); + fit_sigevt->Fill(ifl, fitres[5] / binwid); + fit_bkgevt->Fill(ifl, fitres[0] / binwid); + + sig_mean->Fill(ifl, fitres[4]); + sig_diff->Fill(ifl, fitres[4] - fitres[1]); + sig_width->Fill(ifl, fitres[3]); + sig_sigma->Fill(ifl, fitres[6]); + sig_expo->Fill(ifl, fitres[7]); + sig_meanerr->Fill(ifl, parserr[4]); + if (fitres[4] - fitres[1] > 1.e-4) + sig_meanerrp->Fill(ifl, 100 * parserr[4] / (fitres[4] - fitres[1])); + if (fitres[2] > 1.e-4) + sig_signf->Fill(ifl, (fitres[4] - fitres[1]) / fitres[2]); + + sig_statmean->Fill(ifl, signallunb[izone]->GetMean()); + sig_rms->Fill(ifl, signallunb[izone]->GetRMS()); + + fit2d_chi->Fill(ieta, iphi, fitchisq); //signal[izone]->GetChisquare()); + sig2d_evt->Fill(ieta, iphi, signallunb[izone]->GetEntries() / 2.); + fit2d_sigevt->Fill(ieta, iphi, fitres[5] / binwid); + fit2d_bkgevt->Fill(ieta, iphi, fitres[0] / binwid); + + sig2d_mean->Fill(ieta, iphi, fitres[4]); + sig2d_diff->Fill(ieta, iphi, fitres[4] - fitres[1]); + sig2d_width->Fill(ieta, iphi, fitres[3]); + sig2d_sigma->Fill(ieta, iphi, fitres[6]); + sig2d_expo->Fill(ieta, iphi, fitres[7]); + + sig2d_meanerr->Fill(ieta, iphi, parserr[4]); + if (fitres[4] - fitres[1] > 1.e-4) + sig2d_meanerrp->Fill(ieta, iphi, 100 * parserr[4] / (fitres[4] - fitres[1])); + if (fitres[2] > 1.e-4) + sig2d_signf->Fill(ieta, iphi, (fitres[4] - fitres[1]) / fitres[2]); + + sig2d_statmean->Fill(ieta, iphi, signallunb[izone]->GetMean()); + sig2d_rms->Fill(ieta, iphi, signallunb[izone]->GetRMS()); + } else { //if (signallunb[izone]->GetEntries()/2. >10) { + signall[izone]->Draw(); + float varx = 0.000; + + file_out << "histinfo nof " << std::setw(3) << ieta << " " << std::setw(3) << ij + 1 << " " << std::setw(5) + << signallunb[izone]->GetEntries() / 2. << " " << std::setw(6) << signallunb[izone]->GetMean() << " " + << std::setw(6) << signallunb[izone]->GetRMS() << endl; + + file_out << "fitresx " << ieta << " " << ij + 1 << " " << varx << " " << varx << " " << varx << " " << varx + << " " << varx << " " << varx << " " << varx << " " << varx << " " << varx << " " << varx << " " + << varx << " " << varx << " " << varx << endl; + file_out << "parserr " << ieta << " " << ij + 1 << " " << varx << " " << varx << " " << varx << " " << varx + << " " << varx << " " << varx << " " << varx << " " << varx << " " << varx << endl; + } + iiter++; + if (iiter % nsample == 0) { + c0->Update(); + + for (int lm = 0; lm < nsample; lm++) { + if (pedfun[lm]) { + delete pedfun[lm]; + pedfun[lm] = 0; + } + if (sigfun[lm]) { + delete sigfun[lm]; + sigfun[lm] = 0; + } + if (signalx[lm]) { + delete signalx[lm]; + signalx[lm] = 0; + } + if (signall[lm]) { + delete signall[lm]; + signall[lm] = 0; + } + if (signallunb[lm]) { + delete signallunb[lm]; + signallunb[lm] = 0; + } + } + } + } //for (int jk=0; jkUpdate(); + for (int lm = 0; lm < nsample; lm++) { + if (pedfun[lm]) { + delete pedfun[lm]; + pedfun[lm] = 0; + } + if (sigfun[lm]) { + delete sigfun[lm]; + sigfun[lm] = 0; + } + if (signalx[lm]) { + delete signalx[lm]; + signalx[lm] = 0; + } + if (signall[lm]) { + delete signall[lm]; + signall[lm] = 0; + } + if (signallunb[lm]) { + delete signallunb[lm]; + signallunb[lm] = 0; + } + } + } + + if (c0) { + delete c0; + c0 = 0; + } + + xsiz = 600; //int xsiz = 600; + ysiz = 800; //int ysiz = 800; + + ps.NewPage(); + gStyle->SetOptLogy(0); + gStyle->SetTitleFontSize(0.05); + gStyle->SetTitleSize(0.025, "XYZ"); + gStyle->SetLabelSize(0.025, "XYZ"); + gStyle->SetStatFontSize(.045); + + gStyle->SetPadGridX(1); //bool input yes/no, must give an input + gStyle->SetPadGridY(1); + gStyle->SetGridStyle(3); + + gStyle->SetOptStat(0); + gStyle->SetPadTopMargin(.07); + gStyle->SetPadLeftMargin(0.07); + + ps.NewPage(); + TCanvas* c1 = new TCanvas("c1", " Pedestal vs signal", xsiz, ysiz); + sig_evt->Draw("hist"); + c1->Update(); + + ps.NewPage(); + sig_statmean->Draw("hist"); + c1->Update(); + + ps.NewPage(); + sig_rms->Draw("hist"); + c1->Update(); + + ps.NewPage(); + fit_chi->Draw("hist"); + c1->Update(); + + ps.NewPage(); + fit_sigevt->Draw("hist"); + c1->Update(); + + ps.NewPage(); + fit_bkgevt->Draw("hist"); + c1->Update(); + + ps.NewPage(); + sig_mean->Draw("hist"); + c1->Update(); + + ps.NewPage(); + sig_width->Draw("hist"); + c1->Update(); + + ps.NewPage(); + sig_sigma->Draw("hist"); + c1->Update(); + + ps.NewPage(); + sig_expo->Draw("hist"); + c1->Update(); + + ps.NewPage(); + sig_meanerr->Draw("hist"); + c1->Update(); + + ps.NewPage(); + sig_meanerrp->Draw("hist"); + c1->Update(); + + ps.NewPage(); + sig_signf->Draw("hist"); + c1->Update(); + + gStyle->SetPadLeftMargin(0.06); + gStyle->SetPadRightMargin(0.15); + + ps.NewPage(); + TCanvas* c2y = new TCanvas("c2y", " Pedestal vs Signal", xsiz, ysiz); + + sig2d_evt->Draw("colz"); + c2y->Update(); + + ps.NewPage(); + sig2d_statmean->SetMaximum(min(3.0, sig2d_statmean->GetMaximum())); + sig2d_statmean->SetMinimum(max(-2.0, sig2d_statmean->GetMinimum())); + sig2d_statmean->Draw("colz"); + c2y->Update(); + + ps.NewPage(); + sig2d_rms->SetMaximum(min(3.0, sig2d_rms->GetMaximum())); + sig2d_rms->SetMinimum(max(0.0, sig2d_rms->GetMinimum())); + sig2d_rms->Draw("colz"); + c2y->Update(); + + ps.NewPage(); + + fit2d_chi->Draw("colz"); + c2y->Update(); + + ps.NewPage(); + fit2d_sigevt->Draw("colz"); + c2y->Update(); + + ps.NewPage(); + fit2d_bkgevt->Draw("colz"); + c2y->Update(); + + ps.NewPage(); + sig2d_mean->SetMaximum(min(2.0, sig2d_mean->GetMaximum())); + sig2d_mean->SetMinimum(max(0.1, sig2d_mean->GetMinimum())); + sig2d_mean->Draw("colz"); + c2y->Update(); + + ps.NewPage(); + sig2d_width->SetMaximum(min(0.5, sig2d_width->GetMaximum())); + sig2d_width->SetMinimum(max(0.01, sig2d_width->GetMinimum())); + sig2d_width->Draw("colz"); + c2y->Update(); + + ps.NewPage(); + sig2d_sigma->SetMaximum(min(0.5, sig2d_sigma->GetMaximum())); + sig2d_sigma->SetMinimum(max(0.01, sig2d_sigma->GetMinimum())); + sig2d_sigma->Draw("colz"); + c2y->Update(); + + ps.NewPage(); + sig2d_expo->SetMaximum(min(20., sig2d_expo->GetMaximum())); + sig2d_expo->SetMinimum(max(2.0, sig2d_expo->GetMinimum())); + sig2d_expo->Draw("colz"); + c2y->Update(); + + ps.NewPage(); + sig2d_meanerr->Draw("colz"); + c2y->Update(); + + ps.NewPage(); + sig2d_meanerrp->Draw("colz"); + c2y->Update(); + + ps.NewPage(); + sig2d_signf->Draw("colz"); + c2y->Update(); + + ps.Close(); + + delete c1; + delete c2y; + + file_out.close(); + + fileOut->cd(); + fileOut->Write(); + fileOut->Close(); + + fileIn->cd(); + fileIn->Close(); +} diff --git a/Calibration/HcalCalibAlgos/plugins/HOCalibAnalyzer.cc b/Calibration/HcalCalibAlgos/plugins/HOCalibAnalyzer.cc index 16b01a3e24890..a96cdc6cfecb2 100644 --- a/Calibration/HcalCalibAlgos/plugins/HOCalibAnalyzer.cc +++ b/Calibration/HcalCalibAlgos/plugins/HOCalibAnalyzer.cc @@ -31,27 +31,20 @@ April 2015 #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/MakerMacros.h" - -#include "FWCore/ParameterSet/interface/ParameterSet.h" -#include "DataFormats/HcalCalibObjects/interface/HOCalibVariables.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" + #include "FWCore/ServiceRegistry/interface/Service.h" #include "FWCore/Utilities/interface/InputTag.h" #include "CommonTools/UtilAlgos/interface/TFileService.h" +#include "DataFormats/HcalCalibObjects/interface/HOCalibVariables.h" #include "DataFormats/HcalRecHit/interface/HcalRecHitCollections.h" -#include "TMath.h" #include "TFile.h" #include "TH1F.h" #include "TH2F.h" #include "TTree.h" #include "TProfile.h" -#include "TPostScript.h" -#include "TCanvas.h" -#include "TF1.h" -#include "TStyle.h" -#include "TMinuit.h" -#include "TMath.h" #include @@ -59,190 +52,50 @@ April 2015 #include #include -// -// Look for nearby pixel through eta, phi informations for pixel cross-talk -// 1. Look PIXEL code from (eta,phi) -// 2. Go to nearby pixel code -// 3. Come back to (eta,phi) from pixel code -// Though it works, it is a very ugly/crude way to get cross talk, need better algorithms -// - -static const int mapx1[6][3] = {{1, 4, 8}, {12, 7, 3}, {5, 9, 13}, {11, 6, 2}, {16, 15, 14}, {19, 18, 17}}; - -static const int mapx2[6][3] = {{1, 4, 8}, {12, 7, 3}, {5, 9, 13}, {11, 6, 2}, {16, 15, 14}, {-1, -1, -1}}; - -static const int mapx0p[9][2] = {{3, 1}, {7, 4}, {6, 5}, {12, 8}, {0, 0}, {11, 9}, {16, 13}, {15, 14}, {19, 17}}; -static const int mapx0m[9][2] = {{17, 19}, {14, 15}, {13, 16}, {9, 11}, {0, 0}, {8, 12}, {5, 6}, {4, 7}, {1, 3}}; - -static const int etamap[4][21] = {{-1, 0, 3, 1, 0, 2, 3, 1, 0, 2, -1, 3, 1, 2, 4, 4, 4, -1, -1, -1, -1}, //etamap2 - {-1, 0, 3, 1, 0, 2, 3, 1, 0, 2, -1, 3, 1, 2, 4, 4, 4, 5, 5, 5, -1}, //etamap1 - {-1, 0, -1, 0, 1, 2, 2, 1, 3, 5, -1, 5, 3, 6, 7, 7, 6, 8, -1, 8, -1}, //etamap0p - {-1, 8, -1, 8, 7, 6, 6, 7, 5, 3, -1, 3, 5, 2, 1, 1, 2, 0, -1, 0, -1}}; //etamap0m - -static const int phimap[4][21] = {{-1, 0, 2, 2, 1, 0, 1, 1, 2, 1, -1, 0, 0, 2, 2, 1, 0, 2, 1, 0, -1}, //phimap2 - {-1, 0, 2, 2, 1, 0, 1, 1, 2, 1, -1, 0, 0, 2, 2, 1, 0, 2, 1, 0, -1}, //phimap1 - {-1, 1, -1, 0, 1, 1, 0, 0, 1, 1, -1, 0, 0, 1, 1, 0, 0, 1, -1, 0, -1}, //phimap0p - {-1, 0, -1, 1, 0, 0, 1, 1, 0, 0, -1, 1, 1, 0, 0, 1, 1, 0, -1, 1, -1}}; //phimap0m -//swapped phi map for R0+/R0- (15/03/07) - -static const int npixleft[21] = {0, 0, 1, 2, 0, 4, 5, 6, 0, 8, 0, 0, 11, 0, 13, 14, 15, 0, 17, 18, 0}; -static const int npixrigh[21] = {0, 2, 3, 0, 5, 6, 7, 0, 9, 0, 0, 12, 0, 14, 15, 16, 0, 18, 19, 0, 0}; -static const int npixlebt[21] = {0, 0, 0, 0, 0, 1, 2, 3, 0, 4, 0, 6, 7, 8, 9, 0, 11, 13, 14, 15, 0}; -static const int npixribt[21] = {0, 0, 0, 0, 1, 2, 3, 0, 4, 5, 0, 7, 0, 9, 0, 11, 12, 14, 15, 16, 0}; -static const int npixleup[21] = {0, 4, 5, 6, 8, 9, 0, 11, 0, 13, 0, 15, 16, 0, 17, 18, 19, 0, 0, 0, 0}; -static const int npixriup[21] = {0, 5, 6, 7, 9, 0, 11, 12, 13, 14, 0, 16, 0, 17, 18, 19, 0, 0, 0, 0, 0}; - -static const int netamx = 30; -static const int nphimx = 72; -static const int nbgpr = 3; -static const int nsgpr = 7; - -int ietafit; -int iphifit; -std::vector sig_reg[netamx][nphimx + 1]; -std::vector cro_ssg[netamx][nphimx + 1]; +using namespace std; +using namespace edm; -//#define CORREL +//#define EDM_ML_DEBUG // // class decleration // -Double_t gausX(Double_t* x, Double_t* par) { return par[0] * (TMath::Gaus(x[0], par[1], par[2], kTRUE)); } - -Double_t langaufun(Double_t* x, Double_t* par) { - //Fit parameters: - //par[0]*par[1]=Width (scale) parameter of Landau density - //par[1]=Most Probable (MP, location) parameter of Landau density - //par[2]=Total area (integral -inf to inf, normalization constant) - //par[3]=Width (sigma) of convoluted Gaussian function - // - //In the Landau distribution (represented by the CERNLIB approximation), - //the maximum is located at x=-0.22278298 with the location parameter=0. - //This shift is corrected within this function, so that the actual - //maximum is identical to the MP parameter. - // /* - // Numeric constants - Double_t invsq2pi = 0.3989422804014; // (2 pi)^(-1/2) - Double_t mpshift = -0.22278298; // Landau maximum location - - // Control constants - Double_t np = 100.0; // number of convolution steps - Double_t sc = 5.0; // convolution extends to +-sc Gaussian sigmas - - // Variables - Double_t xx; - Double_t mpc; - Double_t fland; - Double_t sum = 0.0; - Double_t xlow, xupp; - Double_t step; - - // MP shift correction - mpc = par[1] - mpshift * par[0] * par[1]; - - // Range of convolution integral - xlow = x[0] - sc * par[3]; - xupp = x[0] + sc * par[3]; - - step = (xupp - xlow) / np; - - // Convolution integral of Landau and Gaussian by sum - for (double ij = 1.0; ij <= np / 2; ij++) { - xx = xlow + (ij - .5) * step; - fland = TMath::Landau(xx, mpc, par[0] * par[1], kTRUE); // / par[0]; - sum += fland * TMath::Gaus(x[0], xx, par[3]); - xx = xupp - (ij - .5) * step; - fland = TMath::Landau(xx, mpc, par[0] * par[1], kTRUE); // / par[0]; - sum += fland * TMath::Gaus(x[0], xx, par[3]); - } - - return (par[2] * step * sum * invsq2pi / par[3]); -} - -Double_t totalfunc(Double_t* x, Double_t* par) { return gausX(x, par) + langaufun(x, &par[3]); } - -void fcnbg(Int_t& npar, Double_t* gin, Double_t& f, Double_t* par, Int_t flag) { - double fval = -par[0]; - for (unsigned ij = 0; ij < cro_ssg[ietafit][iphifit].size(); ij++) { - double xval = (double)cro_ssg[ietafit][iphifit][ij]; - fval += std::log(std::max(1.e-30, par[0] * TMath::Gaus(xval, par[1], par[2], true))); - } - f = -fval; -} - -void fcnsg(Int_t& npar, Double_t* gin, Double_t& f, Double_t* par, Int_t flag) { - double xval[2]; - double fval = -(par[0] + par[5]); - for (unsigned ij = 0; ij < sig_reg[ietafit][iphifit].size(); ij++) { - xval[0] = (double)sig_reg[ietafit][iphifit][ij]; - fval += std::log(totalfunc(xval, par)); - } - f = -fval; -} - -void set_mean(double& x, bool mdigi) { - if (mdigi) { - x = std::min(x, 0.5); - x = std::max(x, -0.5); - } else { - x = std::min(x, 0.1); - x = std::max(x, -0.1); - } -} - -void set_sigma(double& x, bool mdigi) { - if (mdigi) { - x = std::min(x, 1.2); - x = std::max(x, -1.2); - } else { - x = std::min(x, 0.24); - x = std::max(x, 0.03); - } -} - class HOCalibAnalyzer : public edm::one::EDAnalyzer { public: explicit HOCalibAnalyzer(const edm::ParameterSet&); ~HOCalibAnalyzer() override; private: - void beginJob() override; + void beginJob() override {} void analyze(const edm::Event&, const edm::EventSetup&) override; - void endJob() override; + void endJob() override {} + + static constexpr int netamx = 30; + static constexpr int nphimx = 72; + static constexpr int ringmx = 5; + static constexpr int ncut = 14; + + const char* varcrit[3] = {"All", "steps", "n-1"}; // or opposite + + const double elosfact = (14.9 + 0.96 * fabs(log(8 * 2.8)) + 0.033 * 8 * (1.0 - pow(8, -0.33))); int getHOieta(int ij) { return (ij < netamx / 2) ? -netamx / 2 + ij : -netamx / 2 + ij + 1; } int invert_HOieta(int ieta) { return (ieta < 0) ? netamx / 2 + ieta : netamx / 2 + ieta - 1; } - TFile* theFile; - std::string theRootFileName; - std::string theoutputtxtFile; - std::string theoutputpsFile; - - bool m_allHOsignal; - bool m_hotime; - bool m_hbtime; - bool m_correl; - bool m_checkmap; - bool m_hbinfo; - bool m_combined; - bool m_constant; - bool m_figure; - bool m_cosmic; - bool m_histfit; - bool m_pedsuppr; - double m_sigma; + int mypow_2[31]; - static const int ncut = 13; - static const int mypow_2_ncut = 8192; // 2^13, should be changed to match ncut + bool m_cosmic; + bool m_zeroField; + int m_bins; + double m_low; + double m_ahigh; + bool m_histFill; //Stored signals of individual HO towers with default selection criteria + bool m_treeFill; //Store rootuple without almost any selection criteria except a quality on muon int ipass; TTree* T1; - TH2F* ho_entry; - TH2F* ho_energy; - TH2F* ho_energy2; - TH2F* ho_rms; TH1F* ho_indenergy[netamx][nphimx]; TH1F* muonnm; @@ -257,138 +110,12 @@ class HOCalibAnalyzer : public edm::one::EDAnalyzer { TH1F* sel_muonph; TH1F* sel_muonch; - TProfile* hotime[netamx][nphimx]; - TProfile* hopedtime[netamx][nphimx]; - TProfile* hbtime[netamx][nphimx]; - - TH1F* corrsglb[netamx][nphimx]; - TH1F* corrsgrb[netamx][nphimx]; - TH1F* corrsglu[netamx][nphimx]; - TH1F* corrsgru[netamx][nphimx]; - TH1F* corrsgall[netamx][nphimx]; - - TH1F* corrsgl[netamx][nphimx]; - TH1F* corrsgr[netamx][nphimx]; - - TH1F* mncorrsglb; - TH1F* mncorrsgrb; - TH1F* mncorrsglu; - TH1F* mncorrsgru; - TH1F* mncorrsgall; - - TH1F* mncorrsgl; - TH1F* mncorrsgr; - - TH1F* rmscorrsglb; - TH1F* rmscorrsgrb; - TH1F* rmscorrsglu; - TH1F* rmscorrsgru; - TH1F* rmscorrsgall; - - TH1F* rmscorrsgl; - TH1F* rmscorrsgr; - - TH1F* nevcorrsglb; - TH1F* nevcorrsgrb; - TH1F* nevcorrsglu; - TH1F* nevcorrsgru; - TH1F* nevcorrsgall; - - TH1F* nevcorrsgl; - TH1F* nevcorrsgr; - - TH1F* corrsgc[netamx][nphimx]; - TH1F* mncorrsgc; - TH1F* rmscorrsgc; - TH1F* nevcorrsgc; - - TH1F* sigrsg[netamx][nphimx + 1]; - TH1F* crossg[netamx][nphimx + 1]; - float invang[netamx][nphimx + 1]; - - TH1F* mnsigrsg; - TH1F* mncrossg; - - TH1F* rmssigrsg; - TH1F* rmscrossg; - - TH1F* nevsigrsg; - TH1F* nevcrossg; - - TH1F* ho_sig2p[9]; - TH1F* ho_sig1p[9]; - TH1F* ho_sig00[9]; - TH1F* ho_sig1m[9]; - TH1F* ho_sig2m[9]; - - TH1F* hbhe_sig[9]; + // TProfile* sigvsevt[15][ncut]; + TH2F* sig_eta_evt[3 * netamx][ncut]; //For individual eta + TH2F* sigvsevt[3 * netamx][ncut]; + TH1F* variab[3 * netamx][ncut]; - static const int ringmx = 5; - static const int sectmx = 12; - static const int routmx = 36; - static const int rout12mx = 24; - static const int neffip = 6; - - TProfile* com_hotime[ringmx][sectmx]; - TProfile* com_hopedtime[ringmx][sectmx]; - - TProfile* com_hbtime[ringmx][sectmx]; - - TH1F* com_corrsglb[ringmx][sectmx]; - TH1F* com_corrsgrb[ringmx][sectmx]; - TH1F* com_corrsglu[ringmx][sectmx]; - TH1F* com_corrsgru[ringmx][sectmx]; - TH1F* com_corrsgall[ringmx][sectmx]; - - TH1F* com_corrsgl[ringmx][sectmx]; - TH1F* com_corrsgr[ringmx][sectmx]; - - TH1F* com_corrsgc[ringmx][sectmx]; - - TH1F* com_sigrsg[ringmx][routmx + 1]; - TH1F* com_crossg[ringmx][routmx + 1]; - float com_invang[ringmx][routmx + 1]; - - TH1F* ped_evt; - TH1F* ped_mean; - TH1F* ped_width; - TH1F* fit_chi; - TH1F* sig_evt; - TH1F* fit_sigevt; - TH1F* fit_bkgevt; - TH1F* sig_mean; - TH1F* sig_diff; - TH1F* sig_width; - TH1F* sig_sigma; - TH1F* sig_meanerr; - TH1F* sig_meanerrp; - TH1F* sig_signf; - - TH1F* ped_statmean; - TH1F* sig_statmean; - TH1F* ped_rms; - TH1F* sig_rms; - - TH2F* const_eta_phi; - - TH1F* const_eta[netamx]; - TH1F* stat_eta[netamx]; - TH1F* statmn_eta[netamx]; - TH1F* peak_eta[netamx]; - - TH1F* const_hpdrm[ringmx]; - TH1F* peak_hpdrm[ringmx]; - - TH1F* mean_eta_ave; - TH1F* mean_phi_ave; - TH1F* mean_phi_hst; - - TH2F* sig_effi[neffip]; - TH2F* mean_energy; - - double fitprm[nsgpr][netamx]; - - TProfile* sigvsevt[15][ncut]; + TH2F* mu_projection[ncut + 1]; unsigned ievt, hoflag; int irun, ilumi, nprim, isect, isect2, ndof, nmuon; @@ -396,13 +123,11 @@ class HOCalibAnalyzer : public edm::one::EDAnalyzer { float inslumi, trkdr, trkdz, trkvx, trkvy, trkvz, trkmm, trkth, trkph, chisq, therr, pherr, hodx, hody, hoang, htime, hosig[9], hocorsig[18], hocro, hbhesig[9], caloen[3]; float momatho, tkpt03, ecal03, hcal03; + float tmphoang; + + int nevents[10]; - int Nevents; - int nbn; - float alow; - float ahigh; - float binwid; - int irunold; + float ncount[ringmx][ncut + 10]; edm::InputTag hoCalibVariableCollectionTag; edm::EDGetTokenT tok_ho_; @@ -410,12 +135,6 @@ class HOCalibAnalyzer : public edm::one::EDAnalyzer { // ----------member data --------------------------- }; -const int HOCalibAnalyzer::ringmx; -const int HOCalibAnalyzer::sectmx; -const int HOCalibAnalyzer::routmx; -const int HOCalibAnalyzer::rout12mx; -const int HOCalibAnalyzer::neffip; - // // constants, enums and typedefs // @@ -431,37 +150,30 @@ const int HOCalibAnalyzer::neffip; HOCalibAnalyzer::HOCalibAnalyzer(const edm::ParameterSet& iConfig) { // It is very likely you want the following in your configuration // hoCalibVariableCollectionTag = cms.InputTag('hoCalibProducer', 'HOCalibVariableCollection') + usesResource(TFileService::kSharedResource); + tok_ho_ = consumes(iConfig.getParameter("hoCalibVariableCollectionTag")); tok_allho_ = consumes(iConfig.getParameter("hoInputTag")); //now do what ever initialization is needed ipass = 0; - Nevents = 0; - - theRootFileName = iConfig.getUntrackedParameter("RootFileName", "test.root"); - theoutputtxtFile = iConfig.getUntrackedParameter("txtFileName", "test.txt"); - theoutputpsFile = iConfig.getUntrackedParameter("psFileName", "test.ps"); - - m_allHOsignal = iConfig.getUntrackedParameter("allsignal", false); - m_hbinfo = iConfig.getUntrackedParameter("hbinfo", false); - m_hbtime = iConfig.getUntrackedParameter("hbtime", false); - m_hotime = iConfig.getUntrackedParameter("hotime", false); - m_correl = iConfig.getUntrackedParameter("correl", false); - m_checkmap = iConfig.getUntrackedParameter("checkmap", false); - m_combined = iConfig.getUntrackedParameter("combined", false); - m_constant = iConfig.getUntrackedParameter("get_constant", false); - m_figure = iConfig.getUntrackedParameter("get_figure", true); - m_histfit = iConfig.getUntrackedParameter("histFit", true); - m_pedsuppr = iConfig.getUntrackedParameter("pedSuppr", true); + for (int ij = 0; ij < 10; ij++) { + nevents[ij] = 0; + } + m_cosmic = iConfig.getUntrackedParameter("cosmic", true); - m_sigma = iConfig.getUntrackedParameter("sigma", 0.05); + m_zeroField = iConfig.getUntrackedParameter("zeroField", false); - edm::Service fs; + m_bins = iConfig.getUntrackedParameter("HOSignalBins", 120); + m_low = iConfig.getUntrackedParameter("lowerRange", -1.0); + m_ahigh = iConfig.getUntrackedParameter("upperRange", 29.0); - theFile = new TFile(theRootFileName.c_str(), "RECREATE"); - theFile->cd(); + m_histFill = iConfig.getUntrackedParameter("histFill", true); + m_treeFill = iConfig.getUntrackedParameter("treeFill", false); + + edm::Service fs; - T1 = fs->make("T1", "DT+CSC+HO"); + T1 = fs->make("T1", "HOSignal"); T1->Branch("irun", &irun, "irun/I"); T1->Branch("ievt", &ievt, "ievt/i"); @@ -505,38 +217,16 @@ HOCalibAnalyzer::HOCalibAnalyzer(const edm::ParameterSet& iConfig) { T1->Branch("hocorsig", hocorsig, "hocorsig[18]/F"); T1->Branch("caloen", caloen, "caloen[3]/F"); - if (m_hbinfo) { - T1->Branch("hbhesig", hbhesig, "hbhesig[9]/F"); - } - char name[200]; char title[200]; - if (m_allHOsignal) { - ho_entry = fs->make( - "ho_entry", "ho entry", netamx + 1, -netamx / 2 - 0.5, netamx / 2 + 0.5, nphimx, 0.5, nphimx + 0.5); - - ho_energy = fs->make( - "ho_energy", "ho energy (GeV)", netamx + 1, -netamx / 2 - 0.5, netamx / 2 + 0.5, nphimx, 0.5, nphimx + 0.5); - - ho_energy2 = fs->make("ho_energy2", - "ho energy2 (GeV*GeV)", - netamx + 1, - -netamx / 2 - 0.5, - netamx / 2 + 0.5, - nphimx, - 0.5, - nphimx + 0.5); - - ho_rms = fs->make( - "ho_rms", "ho rms (GeV)", netamx + 1, -netamx / 2 - 0.5, netamx / 2 + 0.5, nphimx, 0.5, nphimx + 0.5); - + if (m_histFill) { for (int ij = 0; ij < netamx; ij++) { int ieta = getHOieta(ij); for (int jk = 0; jk < nphimx; jk++) { sprintf(name, "ho_indenergy_%i_%i", ij, jk); sprintf(title, "ho IndEnergy (GeV) i#eta=%i i#phi=%i", ieta, jk + 1); - ho_indenergy[ij][jk] = fs->make(name, title, 120, -5., 55.); + ho_indenergy[ij][jk] = fs->make(name, title, 1200, m_low, m_ahigh); } } } @@ -553,359 +243,75 @@ HOCalibAnalyzer::HOCalibAnalyzer(const edm::ParameterSet& iConfig) { sel_muonph = fs->make("sel_muonph", "{Phi}_{mu}(sel)", 180, -180., 180.); sel_muonch = fs->make("sel_muonch", "{chi^2}/ndf(sel)", 100, 0., 1000.); - int nbin = 50; //40;// 45; //50; //55; //60; //55; //45; //40; //50; - alow = -2.0; // -1.85; //-1.90; // -1.95; // -2.0; - ahigh = 8.0; // 8.15; // 8.10; // 8.05; // 8.0; - - float tmpwid = (ahigh - alow) / nbin; - nbn = int(-alow / tmpwid) + 1; - if (nbn < 0) - nbn = 0; - if (nbn > nbin) - nbn = nbin; - - edm::LogVerbatim("HOCalib") << "nbin " << nbin << " " << alow << " " << ahigh << " " << tmpwid << " " << nbn; - - for (int ij = 0; ij < 15; ij++) { - sprintf(title, "sigvsndof_ring%i", ij + 1); - sigvsevt[ij][0] = fs->make(title, title, 50, 0., 50., -9., 20.); - - sprintf(title, "sigvschisq_ring%i", ij + 1); - sigvsevt[ij][1] = fs->make(title, title, 50, 0., 30., -9., 20.); - - sprintf(title, "sigvsth_ring%i", ij + 1); - sigvsevt[ij][2] = fs->make(title, title, 50, .7, 2.4, -9., 20.); - - sprintf(title, "sigvsph_ring%i", ij + 1); - sigvsevt[ij][3] = fs->make(title, title, 50, -2.4, -0.7, -9., 20.); - - sprintf(title, "sigvstherr_ring%i", ij + 1); - sigvsevt[ij][4] = fs->make(title, title, 50, 0., 0.2, -9., 20.); - - sprintf(title, "sigvspherr_ring%i", ij + 1); - sigvsevt[ij][5] = fs->make(title, title, 50, 0., 0.2, -9., 20.); - - sprintf(title, "sigvsdircos_ring%i", ij + 1); - sigvsevt[ij][6] = fs->make(title, title, 50, 0.5, 1., -9., 20.); - - sprintf(title, "sigvstrkmm_ring%i", ij + 1); - sigvsevt[ij][7] = fs->make(title, title, 50, 0., 50., -9., 20.); - - sprintf(title, "sigvsnmuon_ring%i", ij + 1); - sigvsevt[ij][8] = fs->make(title, title, 5, 0.5, 5.5, -9., 20.); - - sprintf(title, "sigvserr_ring%i", ij + 1); - sigvsevt[ij][9] = fs->make(title, title, 50, 0., .3, -9., 20.); - - sprintf(title, "sigvsaccx_ring%i", ij + 1); - sigvsevt[ij][10] = fs->make(title, title, 100, -25., 25., -9., 20.); - - sprintf(title, "sigvsaccy_ring%i", ij + 1); - sigvsevt[ij][11] = fs->make(title, title, 100, -25., 25., -9., 20.); - - sprintf(title, "sigvscalo_ring%i", ij + 1); - sigvsevt[ij][12] = fs->make(title, title, 100, 0., 15., -9., 20.); - } + float pival = acos(-1.); - for (int jk = 0; jk < netamx; jk++) { - int ieta = (jk < 15) ? jk + 1 : 14 - jk; - for (int ij = 0; ij < nphimx + 1; ij++) { - if (ij == nphimx) { - sprintf(title, "sig_eta%i_allphi", ieta); - } else { - sprintf(title, "sig_eta%i_phi%i", ieta, ij + 1); - } - sigrsg[jk][ij] = fs->make(title, title, nbin, alow, ahigh); - if (ij == nphimx) { - sprintf(title, "ped_eta%i_allphi", ieta); - } else { - sprintf(title, "ped_eta%i_phi%i", ieta, ij + 1); + //if change order, change in iselect_wotime also and other efficiency numbers + const char* varnam[ncut] = {"ndof", + "chisq", + "th", + "ph", + "therr", + "pherr", + "dircos", + "trkmm", + "nmuon", + "calo", + "trkiso", + "#phi-dir", + "#eta-dir", + "time"}; + int nbinxx[ncut] = {25, 60, 60, 60, 60, 60, 60, 120, 6, 60, 60, 120, 120, 60}; + double alowxx[ncut] = {5.5, 0., 0., -pival, 0.0, 0.0, 0.0, 0., 0.5, 0.0, 0.0, -20., -32., -45.0}; + double ahghxx[ncut] = {30.5, 40., pival, pival, 0.8, 0.02, 0.5, 300., 6.5, 10.0, 24.0, 20.0, 32.0, 45.0}; + + for (int kl = 0; kl < ncut; kl++) { + for (int jk = 0; jk < 3; jk++) { + for (int ij = 0; ij < netamx; ij++) { + sprintf(name, "sigeta_%i_%i_%i", kl, jk, ij); + sprintf(title, "sigeta %s %s i#eta=%i", varnam[kl], varcrit[jk], getHOieta(ij)); + sig_eta_evt[netamx * jk + ij][kl] = + fs->make(name, title, nbinxx[kl], alowxx[kl], ahghxx[kl], m_bins, m_low, m_ahigh); } - crossg[jk][ij] = fs->make(title, title, nbin, alow, ahigh); - } - - for (int ij = 0; ij < nphimx; ij++) { - if (m_hotime) { - sprintf(title, "hotime_eta%i_phi%i", (jk <= 14) ? jk + 1 : 14 - jk, ij + 1); - hotime[jk][ij] = fs->make(title, title, 10, -0.5, 9.5, -1.0, 30.0); - - sprintf(title, "hopedtime_eta%i_phi%i", (jk <= 14) ? jk + 1 : 14 - jk, ij + 1); - hopedtime[jk][ij] = fs->make(title, title, 10, -0.5, 9.5, -1.0, 30.0); - - } //m_hotime - if (m_hbtime) { // HBTIME - sprintf(title, "hbtime_eta%i_phi%i", (jk <= 15) ? jk + 1 : 15 - jk, ij + 1); - hbtime[jk][ij] = fs->make(title, title, 10, -0.5, 9.5, -1.0, 30.0); - } //m_hbtime - - if (m_correl) { // CORREL - sprintf(title, "corrsg_eta%i_phi%i_leftbottom", ieta, ij + 1); - corrsglb[jk][ij] = fs->make(title, title, nbin, alow, ahigh); - - sprintf(title, "corrsg_eta%i_phi%i_rightbottom", ieta, ij + 1); - corrsgrb[jk][ij] = fs->make(title, title, nbin, alow, ahigh); - - sprintf(title, "corrsg_eta%i_phi%i_leftup", ieta, ij + 1); - corrsglu[jk][ij] = fs->make(title, title, nbin, alow, ahigh); - - sprintf(title, "corrsg_eta%i_phi%i_rightup", ieta, ij + 1); - corrsgru[jk][ij] = fs->make(title, title, nbin, alow, ahigh); - - sprintf(title, "corrsg_eta%i_phi%i_all", ieta, ij + 1); - corrsgall[jk][ij] = fs->make(title, title, nbin, alow, ahigh); - - sprintf(title, "corrsg_eta%i_phi%i_left", ieta, ij + 1); - corrsgl[jk][ij] = fs->make(title, title, nbin, alow, ahigh); - - sprintf(title, "corrsg_eta%i_phi%i_right", ieta, ij + 1); - corrsgr[jk][ij] = fs->make(title, title, nbin, alow, ahigh); - } //m_correl - if (m_checkmap) { // CHECKMAP - sprintf(title, "corrsg_eta%i_phi%i_centrl", ieta, ij + 1); - corrsgc[jk][ij] = fs->make(title, title, nbin, alow, ahigh); - } //m_checkmap } } - mnsigrsg = fs->make( - "mnsigrsg", "mnsigrsg", netamx * nphimx + ringmx * routmx, -0.5, netamx * nphimx + ringmx * routmx - 0.5); - rmssigrsg = fs->make( - "rmssigrsg", "rmssigrsg", netamx * nphimx + ringmx * routmx, -0.5, netamx * nphimx + ringmx * routmx - 0.5); - nevsigrsg = fs->make( - "nevsigrsg", "nevsigrsg", netamx * nphimx + ringmx * routmx, -0.5, netamx * nphimx + ringmx * routmx - 0.5); - - mncrossg = fs->make( - "mncrossg", "mncrossg", netamx * nphimx + ringmx * routmx, -0.5, netamx * nphimx + ringmx * routmx - 0.5); - rmscrossg = fs->make( - "rmscrossg", "rmscrossg", netamx * nphimx + ringmx * routmx, -0.5, netamx * nphimx + ringmx * routmx - 0.5); - nevcrossg = fs->make( - "nevcrossg", "nevcrossg", netamx * nphimx + ringmx * routmx, -0.5, netamx * nphimx + ringmx * routmx - 0.5); - - for (int ij = 0; ij < neffip; ij++) { - if (ij == 0) { - sprintf(title, "Total projected muon in tower"); - sprintf(name, "total_evt"); - } else { - sprintf(title, "Efficiency with sig >%i #sigma", ij); - sprintf(name, "Effi_with_gt%i_sig", ij); + for (int kl = 0; kl < ncut; kl++) { + for (int ij = 0; ij < ringmx * 3; ij++) { + int iring = ij % ringmx - 2; + int iset = ij / ringmx; + sprintf(name, "sigring_%i_%i", kl, ij); + sprintf(title, "Signal %s %s Ring%i", varnam[kl], varcrit[iset], iring); + sigvsevt[ij][kl] = fs->make(name, title, nbinxx[kl], alowxx[kl], ahghxx[kl], m_bins, m_low, m_ahigh); } - sig_effi[ij] = - fs->make(name, title, netamx + 1, -netamx / 2 - 0.5, netamx / 2 + 0.5, nphimx, 0.5, nphimx + 0.5); } - sprintf(title, "Mean Energy of all towers"); - sprintf(name, "mean_energy"); - mean_energy = fs->make(name, title, netamx + 1, -netamx / 2 - 0.5, netamx / 2 + 0.5, nphimx, 0.5, nphimx + 0.5); - - if (m_correl) { // CORREL - mncorrsglb = fs->make("mncorrsglb", "mncorrsglb", netamx * nphimx + 60, -0.5, netamx * nphimx + 59.5); - rmscorrsglb = fs->make("rmscorrsglb", "rmscorrsglb", netamx * nphimx + 60, -0.5, netamx * nphimx + 59.5); - nevcorrsglb = fs->make("nevcorrsglb", "nevcorrsglb", netamx * nphimx + 60, -0.5, netamx * nphimx + 59.5); - - mncorrsgrb = fs->make("mncorrsgrb", "mncorrsgrb", netamx * nphimx + 60, -0.5, netamx * nphimx + 59.5); - rmscorrsgrb = fs->make("rmscorrsgrb", "rmscorrsgrb", netamx * nphimx + 60, -0.5, netamx * nphimx + 59.5); - nevcorrsgrb = fs->make("nevcorrsgrb", "nevcorrsgrb", netamx * nphimx + 60, -0.5, netamx * nphimx + 59.5); - - mncorrsglu = fs->make("mncorrsglu", "mncorrsglu", netamx * nphimx + 60, -0.5, netamx * nphimx + 59.5); - rmscorrsglu = fs->make("rmscorrsglu", "rmscorrsglu", netamx * nphimx + 60, -0.5, netamx * nphimx + 59.5); - nevcorrsglu = fs->make("nevcorrsglu", "nevcorrsglu", netamx * nphimx + 60, -0.5, netamx * nphimx + 59.5); - - mncorrsgru = fs->make("mncorrsgru", "mncorrsgru", netamx * nphimx + 60, -0.5, netamx * nphimx + 59.5); - rmscorrsgru = fs->make("rmscorrsgru", "rmscorrsgru", netamx * nphimx + 60, -0.5, netamx * nphimx + 59.5); - nevcorrsgru = fs->make("nevcorrsgru", "nevcorrsgru", netamx * nphimx + 60, -0.5, netamx * nphimx + 59.5); - - mncorrsgall = fs->make("mncorrsgall", "mncorrsgall", netamx * nphimx + 60, -0.5, netamx * nphimx + 59.5); - rmscorrsgall = fs->make("rmscorrsgall", "rmscorrsgall", netamx * nphimx + 60, -0.5, netamx * nphimx + 59.5); - nevcorrsgall = fs->make("nevcorrsgall", "nevcorrsgall", netamx * nphimx + 60, -0.5, netamx * nphimx + 59.5); - - mncorrsgl = fs->make("mncorrsgl", "mncorrsgl", netamx * nphimx + 60, -0.5, netamx * nphimx + 59.5); - rmscorrsgl = fs->make("rmscorrsgl", "rmscorrsgl", netamx * nphimx + 60, -0.5, netamx * nphimx + 59.5); - nevcorrsgl = fs->make("nevcorrsgl", "nevcorrsgl", netamx * nphimx + 60, -0.5, netamx * nphimx + 59.5); - - mncorrsgr = fs->make("mncorrsgr", "mncorrsgr", netamx * nphimx + 60, -0.5, netamx * nphimx + 59.5); - rmscorrsgr = fs->make("rmscorrsgr", "rmscorrsgr", netamx * nphimx + 60, -0.5, netamx * nphimx + 59.5); - nevcorrsgr = fs->make("nevcorrsgr", "nevcorrsgr", netamx * nphimx + 60, -0.5, netamx * nphimx + 59.5); - } //m_correl - - if (m_checkmap) { // CHECKMAP - mncorrsgc = fs->make("mncorrsgc", "mncorrsgc", netamx * nphimx + 60, -0.5, netamx * nphimx + 59.5); - rmscorrsgc = fs->make("rmscorrsgc", "rmscorrsgc", netamx * nphimx + 60, -0.5, netamx * nphimx + 59.5); - nevcorrsgc = fs->make("nevcorrsgc", "nevcorrsgc", netamx * nphimx + 60, -0.5, netamx * nphimx + 59.5); - } //m_checkmap - - if (m_combined) { // COMBINED - for (int jk = 0; jk < ringmx; jk++) { - for (int ij = 0; ij < routmx + 1; ij++) { - if (jk != 2 && ij > rout12mx) - continue; - int phmn = 3 * ij - 1; - int phmx = 3 * ij + 1; - if (jk == 2) { - phmn = 2 * ij - 1; - phmx = 2 * ij; - } - if (phmn <= 0) - phmn = nphimx + phmn; - if (phmx <= 0) - phmx = nphimx + phmx; - - if ((jk == 2 && ij == routmx) || (jk != 2 && ij == rout12mx)) { - sprintf(title, "sig_ring%i_allrm", jk - 2); - sprintf(name, "sig_ring%i_allrm", jk - 2); - } else { - sprintf(title, "sig_ring%i_phi%i-%i", jk - 2, phmn, phmx); - sprintf(name, "sig_ring%i_rout%i", jk - 2, ij + 1); - } - com_sigrsg[jk][ij] = fs->make(name, title, nbin, alow, ahigh); - if ((jk == 2 && ij == routmx) || (jk != 2 && ij == rout12mx)) { - sprintf(title, "ped_ring%i_allrm", jk - 2); - sprintf(name, "ped_ring%i_allrm", jk - 2); - } else { - sprintf(title, "ped_ring%i_phi%i-%i", jk - 2, phmn, phmx); - sprintf(name, "ped_ring%i_rout%i", jk - 2, ij + 1); - } - com_crossg[jk][ij] = fs->make(name, title, nbin, alow, ahigh); - } - - for (int ij = 0; ij < sectmx; ij++) { - if (m_hotime) { // HOTIME - sprintf(title, "com_hotime_ring%i_sect%i", jk - 2, ij + 1); - com_hotime[jk][ij] = fs->make(title, title, 10, -0.5, 9.5, -1.0, 30.0); - - sprintf(title, "com_hopedtime_ring%i_sect%i", jk - 2, ij + 1); - com_hopedtime[jk][ij] = fs->make(title, title, 10, -0.5, 9.5, -1.0, 30.0); - } //m_hotime - if (m_hbtime) { // HBTIME - sprintf(title, "_com_hbtime_ring%i_serrct%i", jk - 2, ij + 1); - com_hbtime[jk][ij] = fs->make(title, title, 10, -0.5, 9.5, -1.0, 30.0); - } //m_hbtime - - if (m_correl) { // CORREL - sprintf(title, "com_corrsg_ring%i_sect%i_leftbottom", jk - 2, ij + 1); - com_corrsglb[jk][ij] = fs->make(title, title, nbin, alow, ahigh); - - sprintf(title, "com_corrsg_ring%i_sect%i_rightbottom", jk - 2, ij + 1); - com_corrsgrb[jk][ij] = fs->make(title, title, nbin, alow, ahigh); - - sprintf(title, "com_corrsg_ring%i_sect%i_leftup", jk - 2, ij + 1); - com_corrsglu[jk][ij] = fs->make(title, title, nbin, alow, ahigh); - - sprintf(title, "com_corrsg_ring%i_sect%i_rightup", jk - 2, ij + 1); - com_corrsgru[jk][ij] = fs->make(title, title, nbin, alow, ahigh); - - sprintf(title, "com_corrsg_ring%i_sect%i_all", jk - 2, ij + 1); - com_corrsgall[jk][ij] = fs->make(title, title, nbin, alow, ahigh); - - sprintf(title, "com_corrsg_ring%i_sect%i_left", jk - 2, ij + 1); - com_corrsgl[jk][ij] = fs->make(title, title, nbin, alow, ahigh); - - sprintf(title, "com_corrsg_ring%i_sect%i_right", jk - 2, ij + 1); - com_corrsgr[jk][ij] = fs->make(title, title, nbin, alow, ahigh); - } //m_correl - - if (m_checkmap) { // CHECKMAP - sprintf(title, "com_corrsg_ring%i_sect%i_centrl", jk - 2, ij + 1); - com_corrsgc[jk][ij] = fs->make(title, title, nbin, alow, ahigh); - } //m_checkmap - } - } - } //m_combined - - for (int ij = -1; ij <= 1; ij++) { - for (int jk = -1; jk <= 1; jk++) { - int kl = 3 * (ij + 1) + jk + 1; - - sprintf(title, "hosct2p_eta%i_phi%i", ij, jk); - ho_sig2p[kl] = fs->make(title, title, nbin, alow, ahigh); - - sprintf(title, "hosct1p_eta%i_phi%i", ij, jk); - ho_sig1p[kl] = fs->make(title, title, nbin, alow, ahigh); - - sprintf(title, "hosct00_eta%i_phi%i", ij, jk); - ho_sig00[kl] = fs->make(title, title, nbin, alow, ahigh); - - sprintf(title, "hosct1m_eta%i_phi%i", ij, jk); - ho_sig1m[kl] = fs->make(title, title, nbin, alow, ahigh); - - sprintf(title, "hosct2m_eta%i_phi%i", ij, jk); - ho_sig2m[kl] = fs->make(title, title, nbin, alow, ahigh); - - if (m_hbinfo) { // HBINFO - sprintf(title, "hbhesig_eta%i_phi%i", ij, jk); - hbhe_sig[kl] = fs->make(title, title, 51, -10.5, 40.5); - } //m_hbinfo + for (int kl = 0; kl < ncut; kl++) { + for (int ij = 0; ij < ringmx * 3; ij++) { + int iring = ij % ringmx - 2; + int iset = ij / ringmx; + sprintf(name, "varring_%i_%i", kl, ij); + sprintf(title, "%s %s Ring%i", varnam[kl], varcrit[iset], iring); + variab[ij][kl] = fs->make(name, title, nbinxx[kl], alowxx[kl], ahghxx[kl]); } } - if (m_constant) { - ped_evt = fs->make("ped_evt", "ped_evt", netamx * nphimx, -0.5, netamx * nphimx - 0.5); - ped_mean = fs->make("ped_mean", "ped_mean", netamx * nphimx, -0.5, netamx * nphimx - 0.5); - ped_width = fs->make("ped_width", "ped_width", netamx * nphimx, -0.5, netamx * nphimx - 0.5); - - fit_chi = fs->make("fit_chi", "fit_chi", netamx * nphimx, -0.5, netamx * nphimx - 0.5); - sig_evt = fs->make("sig_evt", "sig_evt", netamx * nphimx, -0.5, netamx * nphimx - 0.5); - fit_sigevt = fs->make("fit_sigevt", "fit_sigevt", netamx * nphimx, -0.5, netamx * nphimx - 0.5); - fit_bkgevt = fs->make("fit_bkgevt", "fit_bkgevt", netamx * nphimx, -0.5, netamx * nphimx - 0.5); - sig_mean = fs->make("sig_mean", "sig_mean", netamx * nphimx, -0.5, netamx * nphimx - 0.5); - sig_diff = fs->make("sig_diff", "sig_diff", netamx * nphimx, -0.5, netamx * nphimx - 0.5); - sig_width = fs->make("sig_width", "sig_width", netamx * nphimx, -0.5, netamx * nphimx - 0.5); - sig_sigma = fs->make("sig_sigma", "sig_sigma", netamx * nphimx, -0.5, netamx * nphimx - 0.5); - sig_meanerr = fs->make("sig_meanerr", "sig_meanerr", netamx * nphimx, -0.5, netamx * nphimx - 0.5); - sig_meanerrp = fs->make("sig_meanerrp", "sig_meanerrp", netamx * nphimx, -0.5, netamx * nphimx - 0.5); - sig_signf = fs->make("sig_signf", "sig_signf", netamx * nphimx, -0.5, netamx * nphimx - 0.5); - - ped_statmean = fs->make("ped_statmean", "ped_statmean", netamx * nphimx, -0.5, netamx * nphimx - 0.5); - sig_statmean = fs->make("sig_statmean", "sig_statmean", netamx * nphimx, -0.5, netamx * nphimx - 0.5); - ped_rms = fs->make("ped_rms", "ped_rms", netamx * nphimx, -0.5, netamx * nphimx - 0.5); - sig_rms = fs->make("sig_rms", "sig_rms", netamx * nphimx, -0.5, netamx * nphimx - 0.5); - - const_eta_phi = fs->make( - "const_eta_phi", "const_eta_phi", netamx + 1, -(netamx + 1) / 2., (netamx + 1) / 2., nphimx, 0.5, nphimx + 0.5); - - for (int ij = 0; ij < netamx; ij++) { - int ieta = (ij < 15) ? ij + 1 : 14 - ij; - sprintf(title, "Cont_Eta_%i", ieta); - const_eta[ij] = fs->make(title, title, nphimx, 0.5, nphimx + 0.5); - - sprintf(title, "Peak_Eta_%i", ieta); - peak_eta[ij] = fs->make(title, title, nphimx, 0.5, nphimx + 0.5); - } - - for (int ij = 0; ij < ringmx; ij++) { - int iring = ij - 2; - int iread = (ij == 2) ? routmx : rout12mx; - sprintf(title, "Cont_hpdrm_%i", iring); - const_hpdrm[ij] = fs->make(title, title, iread, 0.5, iread + 0.5); - - sprintf(title, "Peak_hpdrm_%i", iring); - peak_hpdrm[ij] = fs->make(title, title, iread, 0.5, iread + 0.5); + for (int ij = 0; ij <= ncut; ij++) { + sprintf(name, "mu_projection_%i", ij); + if (ij == 0) { + sprintf(title, "All projected muon"); + } else { + sprintf(title, "Projected muon with selection %s", varnam[ij - 1]); } - - mean_phi_hst = fs->make("mean_phi_hst", "mean_phi_hst", netamx + 1, -(netamx + 1) / 2., (netamx + 1) / 2.); - mean_phi_ave = fs->make("mean_phi_ave", "mean_phi_ave", netamx + 1, -(netamx + 1) / 2., (netamx + 1) / 2.); - - mean_eta_ave = fs->make("mean_eta_ave", "mean_eta_ave", nphimx, 0.5, nphimx + 0.5); - - } // m_constant - - for (int ij = 0; ij < netamx; ij++) { - int ieta = (ij < 15) ? ij + 1 : 14 - ij; - - sprintf(title, "Stat_Eta_%i", ieta); - stat_eta[ij] = fs->make(title, title, nphimx, 0.5, nphimx + 0.5); - - sprintf(title, "#mu(stat)_Eta_%i", ieta); - statmn_eta[ij] = fs->make(title, title, nphimx, 0.5, nphimx + 0.5); + mu_projection[ij] = + fs->make(name, title, netamx + 1, -netamx / 2 - 0.5, netamx / 2 + 0.5, nphimx, 0.5, nphimx + 0.5); } - for (int jk = 0; jk < netamx; jk++) { - for (int ij = 0; ij < nphimx; ij++) { - invang[jk][ij] = 0.0; - } + for (int ij = 0; ij < 31; ij++) { + mypow_2[ij] = pow(2, ij); } - for (int jk = 0; jk < ringmx; jk++) { - for (int ij = 0; ij < routmx + 1; ij++) { - com_invang[jk][ij] = 0.0; + for (int ij = 0; ij < ringmx; ij++) { + for (int jk = 0; jk < ncut + 10; jk++) { + ncount[ij][jk] = 0.0; } } } @@ -914,10 +320,9 @@ HOCalibAnalyzer::~HOCalibAnalyzer() { // do anything here that needs to be done at desctruction time // (e.g. close files, deallocate resources etc.) - theFile->cd(); - theFile->Write(); - theFile->Close(); - edm::LogVerbatim("HOCalib") << " Ttoal events = " << Nevents << " Selected events # is " << ipass; + edm::LogVerbatim("HOCalib") << " Total events = " << setw(7) << nevents[0] << " " << setw(7) << nevents[1] << " " + << setw(7) << nevents[2] << " " << setw(7) << nevents[3] << " " << setw(7) << nevents[4] + << " " << setw(7) << nevents[5] << " Selected events # is " << ipass; } // @@ -926,66 +331,31 @@ HOCalibAnalyzer::~HOCalibAnalyzer() { // ------------ method called to for each event ------------ void HOCalibAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) { - // calcualte these once (and avoid the pow(int,int) ambiguities for c++) - int mypow_2_0 = 1; // 2^0 - int mypow_2_1 = 2; // 2^1 - int mypow_2_2 = 4; // 2^2 - - int mypow_2_3 = 8; // 2^3 - int mypow_2_4 = 16; // 2^4 - int mypow_2_5 = 32; // 2^5 - int mypow_2_6 = 64; // 2^6 - int mypow_2_7 = 128; // 2^7 - int mypow_2_8 = 256; // 2^8 - int mypow_2_9 = 512; // 2^9 - int mypow_2_10 = 1024; // 2^10 - int mypow_2_11 = 2048; // 2^11 - int mypow_2_12 = 4096; // 2^12 - - int iaxxx = 0; - int ibxxx = 0; - - Nevents++; + nevents[0]++; + + using namespace edm; float pival = acos(-1.); - irunold = irun = iEvent.id().run(); + ievt = iEvent.id().event(); ilumi = iEvent.luminosityBlock(); - if (m_allHOsignal) { - edm::Handle hoht; - iEvent.getByToken(tok_allho_, hoht); - if (hoht.isValid() && !(*hoht).empty()) { - ho_entry->Fill(-1., -1.); //Count of total number of entries - for (HORecHitCollection::const_iterator ij = (*hoht).begin(); ij != (*hoht).end(); ij++) { - HcalDetId id = (*ij).id(); - int tmpeta = id.ieta(); - int tmpphi = id.iphi(); - float signal = (*ij).energy(); - ho_entry->Fill(tmpeta, tmpphi); - ho_energy->Fill(tmpeta, tmpphi, signal); - ho_energy2->Fill(tmpeta, tmpphi, signal * signal); - - int inveta = invert_HOieta(tmpeta); - ho_indenergy[inveta][tmpphi - 1]->Fill(signal); - } - } - } - edm::Handle HOCalib; - bool isCosMu = true; - try { - iEvent.getByToken(tok_ho_, HOCalib); - } catch (cms::Exception& iEvent) { - isCosMu = false; + iEvent.getByToken(tok_ho_, HOCalib); + + if (nevents[0] % 20000 == 1) { + edm::LogVerbatim("HOCalib") << "nmuon event # " << setw(7) << nevents[0] << " " << setw(7) << nevents[1] << " " + << setw(7) << nevents[2] << " " << setw(7) << nevents[3] << " " << setw(7) << nevents[4] + << " " << setw(7) << nevents[5]; + edm::LogVerbatim("HOCalib") << " Run # " << iEvent.id().run() << " Evt # " << iEvent.id().event() << " " + << int(HOCalib.isValid()) << " " << ipass; } - if (Nevents % 5000 == 1) - edm::LogVerbatim("HOCalib") << "nmuon event # " << Nevents << " Run # " << iEvent.id().run() << " Evt # " - << iEvent.id().event() << " " << ipass; - if (isCosMu && !(*HOCalib).empty()) { + if (HOCalib.isValid()) { + nevents[1]++; nmuon = (*HOCalib).size(); + for (HOCalibVariableCollection::const_iterator hoC = (*HOCalib).begin(); hoC != (*HOCalib).end(); hoC++) { trkdr = (*hoC).trkdr; trkdz = (*hoC).trkdz; @@ -1019,27 +389,28 @@ void HOCalibAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSetup& i hodx = (*hoC).hodx; hody = (*hoC).hody; hoang = (*hoC).hoang; + + tmphoang = sin(trkth) - hoang; + htime = (*hoC).htime; hoflag = (*hoC).hoflag; for (int ij = 0; ij < 9; ij++) { hosig[ij] = (*hoC).hosig[ij]; +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("HOCalib") << "hosig " << ij << " " << hosig[ij]; +#endif } for (int ij = 0; ij < 18; ij++) { hocorsig[ij] = (*hoC).hocorsig[ij]; +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("HOCalib") << "hocorsig " << ij << " " << hocorsig[ij]; +#endif } hocro = (*hoC).hocro; for (int ij = 0; ij < 3; ij++) { caloen[ij] = (*hoC).caloen[ij]; } - if (m_hbinfo) { - for (int ij = 0; ij < 9; ij++) { - hbhesig[ij] = (*hoC).hbhesig[ij]; - } - } - - T1->Fill(); - int ipsall = 0; int ips0 = 0; int ips1 = 0; @@ -1054,15 +425,23 @@ void HOCalibAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSetup& i int ips10 = 0; int ips11 = 0; int ips12 = 0; + int ips13 = 0; + + nevents[2]++; + bool isZSps = (hosig[4] < -99.0) ? false : true; - if (isect < 0) - continue; //FIXGM Is it proper place ? + if ((!m_cosmic) && fabs(trkmm) < momatho) + continue; + + nevents[3]++; if (fabs(trkth - pival / 2) < 0.000001) continue; //22OCT07 + nevents[4]++; int ieta = int((abs(isect) % 10000) / 100.) - 50; //an offset to acodate -ve eta values if (abs(ieta) >= 16) continue; + nevents[5]++; int iphi = abs(isect) % 100; int tmpsect = int((iphi + 1) / 6.) + 1; @@ -1070,227 +449,475 @@ void HOCalibAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSetup& i tmpsect = 1; int iring = 0; - int tmpeta = ieta + 4; //For pixel mapping - if (ieta >= -15 && ieta <= -11) { - iring = -2; - tmpeta = -11 - ieta; - } //abs(ieta)-11;} - if (ieta >= -10 && ieta <= -5) { - iring = -1; - tmpeta = -5 - ieta; - } // abs(ieta)-5;} - if (ieta >= 5 && ieta <= 10) { - iring = 1; - tmpeta = ieta - 5; - } - if (ieta >= 11 && ieta <= 15) { - iring = 2; - tmpeta = ieta - 11; - } int iring2 = iring + 2; - int tmprout = (iring == 0) ? int((iphi + 1) / 2.) + 1 : int((iphi + 1) / 3.) + 1; - int tmproutmx = (iring == 0) ? routmx : rout12mx; - if (tmprout > tmproutmx) - tmprout = 1; + double abshoang = (m_cosmic) ? fabs(hoang) : hoang; + + double elos = 1.0 / TMath::Max(0.1, abs(1.0 * hoang)); + + if (!m_zeroField) + elos *= ((14.9 + 0.96 * fabs(log(momatho * 2.8)) + 0.033 * momatho * (1.0 - pow(momatho, -0.33))) / elosfact); - // CRUZET1 if (m_cosmic) { - /* GMA temoparily change to increase event size at 3 & 9 O'clock position */ - if (abs(ndof) >= 20 && abs(ndof) < 40) { - ips0 = (int)mypow_2_0; + if (abs(ndof) >= 20 && abs(ndof) < 55) { + ips0 = mypow_2[0]; ipsall += ips0; } - if (chisq > 0 && chisq < 15) { - ips1 = (int)mypow_2_1; + if (chisq > 0 && chisq < 12) { + ips1 = mypow_2[1]; ipsall += ips1; } //18Jan2008 - if (fabs(trkth - pival / 2) < 21.5) { - ips2 = (int)mypow_2_2; + + if (trkth > 0.3 && trkth < pival - 0.3) { + ips2 = mypow_2[2]; ipsall += ips2; } //No nead for pp evt - if (fabs(trkph + pival / 2) < 21.5) { - ips3 = (int)mypow_2_3; + if (trkph > -pival + 0.1 && trkph < -0.1) { + ips3 = mypow_2[3]; ipsall += ips3; } //No nead for pp evt if (therr < 0.02) { - ips4 = (int)mypow_2_4; + ips4 = mypow_2[4]; ipsall += ips4; } if (pherr < 0.0002) { - ips5 = (int)mypow_2_5; + ips5 = mypow_2[5]; ipsall += ips5; } - if (fabs(hoang) > 0.30) { - ips6 = (int)mypow_2_6; + if (abshoang > 0.60 && abshoang < 1.0) { + ips6 = mypow_2[6]; ipsall += ips6; } - if (fabs(trkmm) > 0.100) { - ips7 = (int)mypow_2_7; + + if (m_zeroField || (fabs(momatho) > 5.0 && fabs(momatho) < 2000.0)) { + ips7 = mypow_2[7]; ipsall += ips7; } - if (nmuon >= 1 && nmuon <= 4) { - ips8 = (int)mypow_2_8; + + if (nmuon >= 1 && nmuon <= 3) { + ips8 = mypow_2[8]; ipsall += ips8; } + // if (hodx>0 && hody>0) { } + ips9 = mypow_2[9]; + ipsall += ips9; + + ips10 = mypow_2[10]; + ipsall += ips10; + if (iring2 == 2) { if (fabs(hodx) < 100 && fabs(hodx) > 2 && fabs(hocorsig[8]) < 40 && fabs(hocorsig[8]) > 2) { - ips10 = (int)mypow_2_10; - ipsall += ips10; + ips11 = mypow_2[11]; + ipsall += ips11; } if (fabs(hody) < 100 && fabs(hody) > 2 && fabs(hocorsig[9]) < 40 && fabs(hocorsig[9]) > 2) { - ips11 = (int)mypow_2_11; - ipsall += ips11; + ips12 = mypow_2[12]; + ipsall += ips12; } } else { if (fabs(hodx) < 100 && fabs(hodx) > 2) { - ips10 = (int)mypow_2_10; - ipsall += ips10; + ips11 = mypow_2[11]; + ipsall += ips11; } if (fabs(hody) < 100 && fabs(hody) > 2) { - ips11 = (int)mypow_2_11; - ipsall += ips11; + ips12 = mypow_2[12]; + ipsall += ips12; } } - if (caloen[0] == 0) { - ips12 = (int)mypow_2_12; - ipsall += ips12; + + if (m_zeroField) { + if (iring2 == 0) { + if (htime > -60 && htime < 60) { + ips13 = mypow_2[13]; + ipsall += ips13; + } + } + if (iring2 == 1) { + if (htime > -60 && htime < 60) { + ips13 = mypow_2[13]; + ipsall += ips13; + } + } + if (iring2 == 2) { + if (htime > -60 && htime < 60) { + ips13 = mypow_2[13]; + ipsall += ips13; + } + } + if (iring2 == 3) { + if (htime > -60 && htime < 60) { + ips13 = mypow_2[13]; + ipsall += ips13; + } + } + if (iring2 == 4) { + if (htime > -60 && htime < 60) { + ips13 = mypow_2[13]; + ipsall += ips13; + } + } + } else { + if (htime > -100 && htime < 100) { + ips13 = mypow_2[13]; + ipsall += ips13; + } } } else { - //csa08 - if (abs(ndof) >= 20 && abs(ndof) < 40) { - ips0 = (int)mypow_2_0; + if (abs(ndof) >= 10 && abs(ndof) < 25) { + ips0 = mypow_2[0]; ipsall += ips0; } - if (chisq > 0 && chisq < 15) { - ips1 = (int)mypow_2_1; + if (chisq > 0 && chisq < 10) { + ips1 = mypow_2[1]; ipsall += ips1; } //18Jan2008 + if (fabs(trkth - pival / 2) < 21.5) { - ips2 = (int)mypow_2_2; + ips2 = mypow_2[2]; ipsall += ips2; } //No nead for pp evt if (fabs(trkph + pival / 2) < 21.5) { - ips3 = (int)mypow_2_3; + ips3 = mypow_2[3]; ipsall += ips3; } //No nead for pp evt - if (therr < 0.02) { - ips4 = (int)mypow_2_4; + if (therr < 0.00002) { + ips4 = mypow_2[4]; ipsall += ips4; } - if (pherr < 0.0002) { - ips5 = (int)mypow_2_5; + if (pherr < 0.000002) { + ips5 = mypow_2[5]; ipsall += ips5; } - if (fabs(hoang) > 0.30) { - ips6 = (int)mypow_2_6; + // if (abshoang >0.40 && abshoang <1.0) {ips6 = mypow_2[6]; ipsall +=ips6;} + if (tmphoang < 0.065) { + ips6 = mypow_2[6]; ipsall += ips6; } - if (fabs(trkmm) > 4.0) { - ips7 = (int)mypow_2_7; - ipsall += ips7; + + if (fabs(momatho) < 250.0 && fabs(momatho) > 15.0) { + if (iring2 == 2) { + ips7 = mypow_2[7]; + ipsall += ips7; + } + if ((iring2 == 1 || iring2 == 3) && fabs(momatho) > 17.0) { + ips7 = mypow_2[7]; + ipsall += ips7; + } + if ((iring2 == 0 || iring2 == 4) && fabs(momatho) > 20.0) { + ips7 = mypow_2[7]; + ipsall += ips7; + } } - if (nmuon >= 1 && nmuon <= 2) { - ips8 = (int)mypow_2_8; + + if (nmuon >= 1 && nmuon <= 3) { + ips8 = mypow_2[8]; ipsall += ips8; } + if (ndof > 0 && caloen[0] < 15.0) { + ips9 = mypow_2[9]; + ipsall += ips9; + } //5.0 + if (tkpt03 < 5.0) { + ips10 = mypow_2[10]; + ipsall += ips10; + } //4.0 + if (iring2 == 2) { if (fabs(hodx) < 100 && fabs(hodx) > 2 && fabs(hocorsig[8]) < 40 && fabs(hocorsig[8]) > 2) { - ips10 = (int)mypow_2_10; - ipsall += ips10; + ips11 = mypow_2[11]; + ipsall += ips11; } if (fabs(hody) < 100 && fabs(hody) > 2 && fabs(hocorsig[9]) < 40 && fabs(hocorsig[9]) > 2) { - ips11 = (int)mypow_2_11; - ipsall += ips11; + ips12 = mypow_2[12]; + ipsall += ips12; } } else { if (fabs(hodx) < 100 && fabs(hodx) > 2) { - ips10 = (int)mypow_2_10; - ipsall += ips10; + ips11 = mypow_2[11]; + ipsall += ips11; } if (fabs(hody) < 100 && fabs(hody) > 2) { - ips11 = (int)mypow_2_11; - ipsall += ips11; + ips12 = mypow_2[12]; + ipsall += ips12; + } + } + + if (iring2 == 0) { + if (htime > -20 && htime < 20) { + ips13 = mypow_2[13]; + ipsall += ips13; } } - if (ndof > 0 && caloen[0] < 5.0) { - ips12 = (int)mypow_2_12; - ipsall += ips12; + if (iring2 == 1) { + if (htime > -20 && htime < 20) { + ips13 = mypow_2[13]; + ipsall += ips13; + } + } + if (iring2 == 2) { + if (htime > -30 && htime < 20) { + ips13 = mypow_2[13]; + ipsall += ips13; + } + } + if (iring2 == 3) { + if (htime > -20 && htime < 20) { + ips13 = mypow_2[13]; + ipsall += ips13; + } + } + if (iring2 == 4) { + if (htime > -20 && htime < 20) { + ips13 = mypow_2[13]; + ipsall += ips13; + } } - /* */ } + int tmpxet = invert_HOieta(ieta); + double nomHOSig = hosig[4] / elos; - if (htime > -40 && htime < 60) { - ips9 = (int)mypow_2_9; - ipsall += ips9; + if (ipsall - ips0 == mypow_2[ncut] - mypow_2[0] - 1) { + if (isZSps) { + sigvsevt[iring2][0]->Fill(abs(ndof), nomHOSig); + sig_eta_evt[tmpxet][0]->Fill(abs(ndof), nomHOSig); + } + variab[iring2][0]->Fill(abs(ndof)); + } + if (ipsall - ips1 == mypow_2[ncut] - mypow_2[1] - 1) { + if (isZSps) { + sigvsevt[iring2][1]->Fill(chisq, nomHOSig); + sig_eta_evt[tmpxet][1]->Fill(chisq, nomHOSig); + } + variab[iring2][1]->Fill(chisq); + } + if (ipsall - ips2 == mypow_2[ncut] - mypow_2[2] - 1) { + if (isZSps) { + sigvsevt[iring2][2]->Fill(trkth, nomHOSig); + sig_eta_evt[tmpxet][2]->Fill(trkth, nomHOSig); + } + variab[iring2][2]->Fill(trkth); + } + if (ipsall - ips3 == mypow_2[ncut] - mypow_2[3] - 1) { + if (isZSps) { + sigvsevt[iring2][3]->Fill(trkph, nomHOSig); + sig_eta_evt[tmpxet][3]->Fill(trkph, nomHOSig); + } + variab[iring2][3]->Fill(trkph); + } + if (ipsall - ips4 == mypow_2[ncut] - mypow_2[4] - 1) { + if (isZSps) { + sigvsevt[iring2][4]->Fill(1000 * therr, nomHOSig); + sig_eta_evt[tmpxet][4]->Fill(1000 * therr, nomHOSig); + } + variab[iring2][4]->Fill(1000 * therr); + } + if (ipsall - ips5 == mypow_2[ncut] - mypow_2[5] - 1) { + if (isZSps) { + sigvsevt[iring2][5]->Fill(1000 * pherr, nomHOSig); + sig_eta_evt[tmpxet][5]->Fill(1000 * pherr, nomHOSig); + } + variab[iring2][5]->Fill(1000 * pherr); + } + if (ipsall - ips6 == mypow_2[ncut] - mypow_2[6] - 1) { + if (isZSps) { + sigvsevt[iring2][6]->Fill(tmphoang, (nomHOSig)*abshoang); + sig_eta_evt[tmpxet][6]->Fill(tmphoang, (nomHOSig)*abshoang); + } + variab[iring2][6]->Fill(tmphoang); + } + if (ipsall - ips7 == mypow_2[ncut] - mypow_2[7] - 1) { + if (isZSps) { + sigvsevt[iring2][7]->Fill(fabs(trkmm), nomHOSig); + sig_eta_evt[tmpxet][7]->Fill(fabs(trkmm), nomHOSig); + } + variab[iring2][7]->Fill(fabs(trkmm)); + } + if (ipsall - ips8 == mypow_2[ncut] - mypow_2[8] - 1) { + if (isZSps) { + sigvsevt[iring2][8]->Fill(nmuon, nomHOSig); + sig_eta_evt[tmpxet][8]->Fill(nmuon, nomHOSig); + } + variab[iring2][8]->Fill(nmuon); } - - if (ipsall - ips0 == mypow_2_ncut - mypow_2_0 - 1) - sigvsevt[iring2][0]->Fill(abs(ndof), hosig[4]); - if (ipsall - ips1 == mypow_2_ncut - mypow_2_1 - 1) - sigvsevt[iring2][1]->Fill(chisq, hosig[4]); - if (ipsall - ips2 == mypow_2_ncut - mypow_2_2 - 1) - sigvsevt[iring2][2]->Fill(trkth, hosig[4]); - if (ipsall - ips3 == mypow_2_ncut - mypow_2_3 - 1) - sigvsevt[iring2][3]->Fill(trkph, hosig[4]); - if (ipsall - ips4 == mypow_2_ncut - mypow_2_4 - 1) - sigvsevt[iring2][4]->Fill(therr, hosig[4]); - if (ipsall - ips5 == mypow_2_ncut - mypow_2_5 - 1) - sigvsevt[iring2][5]->Fill(pherr, hosig[4]); - if (ipsall - ips6 == mypow_2_ncut - mypow_2_6 - 1) - sigvsevt[iring2][6]->Fill(hoang, hosig[4]); - if (ipsall - ips7 == mypow_2_ncut - mypow_2_7 - 1) - sigvsevt[iring2][7]->Fill(fabs(trkmm), hosig[4]); - if (ipsall - ips8 == mypow_2_ncut - mypow_2_8 - 1) - sigvsevt[iring2][8]->Fill(nmuon, hosig[4]); - if (ipsall - ips9 == mypow_2_ncut - mypow_2_9 - 1) - sigvsevt[iring2][9]->Fill(htime, hosig[4]); - if (ipsall - ips10 == mypow_2_ncut - mypow_2_10 - 1) - sigvsevt[iring2][10]->Fill(hodx, hosig[4]); - if (ipsall - ips11 == mypow_2_ncut - mypow_2_11 - 1) - sigvsevt[iring2][11]->Fill(hody, hosig[4]); if (!m_cosmic) { - if (ipsall - ips12 == mypow_2_ncut - mypow_2_12 - 1) - sigvsevt[iring2][12]->Fill(caloen[0], hosig[4]); + if (ipsall - ips9 == mypow_2[ncut] - mypow_2[9] - 1) { + if (isZSps) { + sigvsevt[iring2][9]->Fill(caloen[0], nomHOSig); + sig_eta_evt[tmpxet][9]->Fill(caloen[0], nomHOSig); + } + variab[iring2][9]->Fill(caloen[0]); + } + } + if (ipsall - ips10 == mypow_2[ncut] - mypow_2[10] - 1) { + if (isZSps) { + sigvsevt[iring2][10]->Fill(tkpt03, nomHOSig); + sig_eta_evt[tmpxet][10]->Fill(tkpt03, nomHOSig); + } + variab[iring2][10]->Fill(tkpt03); + } + if (ipsall - ips11 == mypow_2[ncut] - mypow_2[11] - 1) { + if (isZSps) { + sigvsevt[iring2][11]->Fill(hodx, nomHOSig); + sig_eta_evt[tmpxet][11]->Fill(hodx, nomHOSig); + } + variab[iring2][11]->Fill(hodx); + } + if (ipsall - ips12 == mypow_2[ncut] - mypow_2[12] - 1) { + if (isZSps) { + sigvsevt[iring2][12]->Fill(hody, nomHOSig); + sig_eta_evt[tmpxet][12]->Fill(hody, nomHOSig); + } + variab[iring2][12]->Fill(hody); + } + + if (ipsall - ips13 == mypow_2[ncut] - mypow_2[13] - 1) { + if (isZSps) { + sigvsevt[iring2][13]->Fill(htime, nomHOSig); + sig_eta_evt[tmpxet][13]->Fill(htime, nomHOSig); + } + variab[iring2][13]->Fill(htime); } - sigvsevt[iring2 + 5][0]->Fill(abs(ndof), hosig[4]); + if (isZSps) { + sigvsevt[iring2 + ringmx][0]->Fill(abs(ndof), nomHOSig); + sig_eta_evt[netamx + tmpxet][0]->Fill(abs(ndof), nomHOSig); + } + variab[iring2 + 5][0]->Fill(abs(ndof)); + + ncount[iring2][0]++; + if (isZSps) { + ncount[iring2][1]++; + } if (ips0 > 0) { - sigvsevt[iring2 + 5][1]->Fill(chisq, hosig[4]); + if (isZSps) { + ncount[iring2][10]++; + sigvsevt[iring2 + ringmx][1]->Fill(chisq, nomHOSig); + sig_eta_evt[netamx + tmpxet][1]->Fill(chisq, nomHOSig); + } + variab[iring2 + ringmx][1]->Fill(chisq); + mu_projection[1]->Fill(ieta, iphi); if (ips1 > 0) { - sigvsevt[iring2 + 5][2]->Fill(trkth, hosig[4]); + if (isZSps) { + ncount[iring2][11]++; + sigvsevt[iring2 + ringmx][2]->Fill(trkth, nomHOSig); + sig_eta_evt[netamx + tmpxet][2]->Fill(trkth, nomHOSig); + } + variab[iring2 + ringmx][2]->Fill(trkth); + mu_projection[2]->Fill(ieta, iphi); if (ips2 > 0) { - sigvsevt[iring2 + 5][3]->Fill(trkph, hosig[4]); + if (isZSps) { + ncount[iring2][12]++; + sigvsevt[iring2 + ringmx][3]->Fill(trkph, nomHOSig); + sig_eta_evt[netamx + tmpxet][3]->Fill(trkph, nomHOSig); + } + variab[iring2 + ringmx][3]->Fill(trkph); + mu_projection[3]->Fill(ieta, iphi); if (ips3 > 0) { - sigvsevt[iring2 + 5][4]->Fill(therr, hosig[4]); + if (isZSps) { + ncount[iring2][13]++; + sigvsevt[iring2 + ringmx][4]->Fill(1000 * therr, nomHOSig); + sig_eta_evt[netamx + tmpxet][4]->Fill(1000 * therr, nomHOSig); + } + variab[iring2 + ringmx][4]->Fill(1000 * therr); + mu_projection[4]->Fill(ieta, iphi); if (ips4 > 0) { - sigvsevt[iring2 + 5][5]->Fill(pherr, hosig[4]); + if (isZSps) { + ncount[iring2][14]++; + sigvsevt[iring2 + ringmx][5]->Fill(1000 * pherr, nomHOSig); + sig_eta_evt[netamx + tmpxet][5]->Fill(1000 * pherr, nomHOSig); + } + variab[iring2 + ringmx][5]->Fill(1000 * pherr); + mu_projection[5]->Fill(ieta, iphi); if (ips5 > 0) { - sigvsevt[iring2 + 5][6]->Fill(hoang, hosig[4]); + if (isZSps) { + ncount[iring2][15]++; + sigvsevt[iring2 + ringmx][6]->Fill(tmphoang, (nomHOSig)*abshoang); + sig_eta_evt[netamx + tmpxet][6]->Fill(tmphoang, (nomHOSig)*abshoang); + } + variab[iring2 + ringmx][6]->Fill(tmphoang); + mu_projection[6]->Fill(ieta, iphi); if (ips6 > 0) { - sigvsevt[iring2 + 5][7]->Fill(fabs(trkmm), hosig[4]); + if (isZSps) { + ncount[iring2][16]++; + sigvsevt[iring2 + ringmx][7]->Fill(fabs(trkmm), nomHOSig); + sig_eta_evt[netamx + tmpxet][7]->Fill(fabs(trkmm), nomHOSig); + } + variab[iring2 + ringmx][7]->Fill(fabs(trkmm)); + mu_projection[7]->Fill(ieta, iphi); if (ips7 > 0) { - sigvsevt[iring2 + 5][8]->Fill(nmuon, hosig[4]); + ncount[iring2][4]++; //Efficiency of Muon detection + if (isZSps) { + ncount[iring2][17]++; + sigvsevt[iring2 + ringmx][8]->Fill(nmuon, nomHOSig); + sig_eta_evt[netamx + tmpxet][8]->Fill(nmuon, nomHOSig); + } + variab[iring2 + ringmx][8]->Fill(nmuon); + mu_projection[8]->Fill(ieta, iphi); if (ips8 > 0) { - sigvsevt[iring2 + 5][9]->Fill(htime, hosig[4]); + if (!m_cosmic) { + if (isZSps) { + ncount[iring2][18]++; + sigvsevt[iring2 + ringmx][9]->Fill(caloen[0], nomHOSig); + sig_eta_evt[netamx + tmpxet][9]->Fill(caloen[0], nomHOSig); + } + variab[iring2 + ringmx][9]->Fill(caloen[0]); + mu_projection[9]->Fill(ieta, iphi); + } if (ips9 > 0) { - sigvsevt[iring2 + 5][10]->Fill(hodx, hosig[4]); + if (isZSps) { + ncount[iring2][19]++; + sigvsevt[iring2 + ringmx][10]->Fill(tkpt03, nomHOSig); + sig_eta_evt[netamx + tmpxet][10]->Fill(tkpt03, nomHOSig); + } + variab[iring2 + ringmx][10]->Fill(tkpt03); + mu_projection[10]->Fill(ieta, iphi); if (ips10 > 0) { - sigvsevt[iring2 + 5][11]->Fill(hody, hosig[4]); + ncount[iring2][3]++; //Efficiency of Muon detection + if (isZSps) { + ncount[iring2][20]++; + sigvsevt[iring2 + ringmx][11]->Fill(hodx, nomHOSig); + sig_eta_evt[netamx + tmpxet][11]->Fill(hodx, nomHOSig); + } + variab[iring2 + ringmx][11]->Fill(hodx); + mu_projection[11]->Fill(ieta, iphi); + if (ips11 > 0) { - if (!m_cosmic) - sigvsevt[iring2 + 5][12]->Fill(caloen[0], hosig[4]); + if (isZSps) { + ncount[iring2][21]++; + sigvsevt[iring2 + ringmx][12]->Fill(hody, nomHOSig); + sig_eta_evt[netamx + tmpxet][12]->Fill(hody, nomHOSig); + } + variab[iring2 + ringmx][12]->Fill(hody); + mu_projection[12]->Fill(ieta, iphi); + + if (ips12 > 0) { + ncount[iring2][2]++; //Efficiency of Muon detection + if (isZSps) { + ncount[iring2][22]++; + sigvsevt[iring2 + ringmx][13]->Fill(htime, nomHOSig); + sig_eta_evt[tmpxet + ringmx][13]->Fill(htime, nomHOSig); + } + variab[iring2 + ringmx][13]->Fill(htime); + mu_projection[13]->Fill(ieta, iphi); + + if (ips13 > 0) { + if (isZSps) { + ncount[iring2][23]++; + mu_projection[14]->Fill(ieta, iphi); + } + } + } } } } @@ -1303,26 +930,59 @@ void HOCalibAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSetup& i } } } - - sigvsevt[iring2 + 10][0]->Fill(abs(ndof), hosig[4]); - sigvsevt[iring2 + 10][1]->Fill(chisq, hosig[4]); - sigvsevt[iring2 + 10][2]->Fill(trkth, hosig[4]); - sigvsevt[iring2 + 10][3]->Fill(trkph, hosig[4]); - sigvsevt[iring2 + 10][4]->Fill(therr, hosig[4]); - sigvsevt[iring2 + 10][5]->Fill(pherr, hosig[4]); - sigvsevt[iring2 + 10][6]->Fill(hoang, hosig[4]); - sigvsevt[iring2 + 10][7]->Fill(fabs(trkmm), hosig[4]); - sigvsevt[iring2 + 10][8]->Fill(nmuon, hosig[4]); - sigvsevt[iring2 + 10][9]->Fill(htime, hosig[4]); - sigvsevt[iring2 + 10][10]->Fill(hodx, hosig[4]); - sigvsevt[iring2 + 10][11]->Fill(hody, hosig[4]); + if (isZSps) { + sigvsevt[iring2 + 2 * ringmx][0]->Fill(abs(ndof), nomHOSig); + sigvsevt[iring2 + 2 * ringmx][1]->Fill(chisq, nomHOSig); + sigvsevt[iring2 + 2 * ringmx][2]->Fill(trkth, nomHOSig); + sigvsevt[iring2 + 2 * ringmx][3]->Fill(trkph, nomHOSig); + sigvsevt[iring2 + 2 * ringmx][4]->Fill(1000 * therr, nomHOSig); + sigvsevt[iring2 + 2 * ringmx][5]->Fill(1000 * pherr, nomHOSig); + if (abshoang > 0.01) { + sigvsevt[iring2 + 2 * ringmx][6]->Fill(tmphoang, (nomHOSig)*abshoang); + } + sigvsevt[iring2 + 2 * ringmx][7]->Fill(fabs(trkmm), nomHOSig); + sigvsevt[iring2 + 2 * ringmx][8]->Fill(nmuon, nomHOSig); + if (!m_cosmic) + sigvsevt[iring2 + 2 * ringmx][9]->Fill(caloen[0], nomHOSig); + sigvsevt[iring2 + 2 * ringmx][10]->Fill(tkpt03, nomHOSig); + sigvsevt[iring2 + 2 * ringmx][11]->Fill(hodx, nomHOSig); + sigvsevt[iring2 + 2 * ringmx][12]->Fill(hody, nomHOSig); + sigvsevt[iring2 + 2 * ringmx][13]->Fill(htime, nomHOSig); + + sig_eta_evt[2 * netamx + tmpxet][0]->Fill(abs(ndof), nomHOSig); + sig_eta_evt[2 * netamx + tmpxet][1]->Fill(chisq, nomHOSig); + sig_eta_evt[2 * netamx + tmpxet][2]->Fill(trkth, nomHOSig); + sig_eta_evt[2 * netamx + tmpxet][3]->Fill(trkph, nomHOSig); + sig_eta_evt[2 * netamx + tmpxet][4]->Fill(1000 * therr, nomHOSig); + sig_eta_evt[2 * netamx + tmpxet][5]->Fill(1000 * pherr, nomHOSig); + if (abshoang > 0.01) { + sig_eta_evt[2 * netamx + tmpxet][6]->Fill(tmphoang, (nomHOSig)*abshoang); + } + sig_eta_evt[2 * netamx + tmpxet][7]->Fill(fabs(trkmm), nomHOSig); + sig_eta_evt[2 * netamx + tmpxet][8]->Fill(nmuon, nomHOSig); + if (!m_cosmic) + sig_eta_evt[2 * netamx + tmpxet][9]->Fill(caloen[0], nomHOSig); + sig_eta_evt[2 * netamx + tmpxet][10]->Fill(tkpt03, nomHOSig); + sig_eta_evt[2 * netamx + tmpxet][11]->Fill(hodx, nomHOSig); + sig_eta_evt[2 * netamx + tmpxet][12]->Fill(hody, nomHOSig); + sig_eta_evt[2 * netamx + tmpxet][13]->Fill(htime, nomHOSig); + } + + variab[iring2 + 2 * ringmx][0]->Fill(abs(ndof)); + variab[iring2 + 2 * ringmx][1]->Fill(chisq); + variab[iring2 + 2 * ringmx][2]->Fill(trkth); + variab[iring2 + 2 * ringmx][3]->Fill(trkph); + variab[iring2 + 2 * ringmx][4]->Fill(1000 * therr); + variab[iring2 + 2 * ringmx][5]->Fill(1000 * pherr); + variab[iring2 + 2 * ringmx][6]->Fill(tmphoang); + variab[iring2 + 2 * ringmx][7]->Fill(fabs(trkmm)); + variab[iring2 + 2 * ringmx][8]->Fill(nmuon); if (!m_cosmic) - sigvsevt[iring2 + 10][12]->Fill(caloen[0], hosig[4]); - - int iselect = (ipsall == mypow_2_ncut - 1) ? 1 : 0; - - if (hocro != -100.0 && hocro < -50.0) - hocro += 100.; + variab[iring2 + 2 * ringmx][9]->Fill(caloen[0]); + variab[iring2 + 2 * ringmx][10]->Fill(tkpt03); + variab[iring2 + 2 * ringmx][11]->Fill(hodx); + variab[iring2 + 2 * ringmx][12]->Fill(hody); + variab[iring2 + 2 * ringmx][13]->Fill(htime); muonnm->Fill(nmuon); muonmm->Fill(trkmm); @@ -1330,6 +990,8 @@ void HOCalibAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSetup& i muonph->Fill(trkph * 180 / pival); muonch->Fill(chisq); + int iselect = (ipsall == mypow_2[ncut] - 1) ? 1 : 0; + if (iselect == 1) { ipass++; sel_muonnm->Fill(nmuon); @@ -1337,1622 +999,15 @@ void HOCalibAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSetup& i sel_muonth->Fill(trkth * 180 / pival); sel_muonph->Fill(trkph * 180 / pival); sel_muonch->Fill(chisq); - } - - int tmpphi = (iphi + 1) % 3; //pixel mapping - int npixel = 0; - int itag = -1; - int iflip = 0; - int fact = 2; - - if (iring == 0) { - tmpphi = (iphi + 1) % 2; - if (tmpsect == 2 || tmpsect == 3 || tmpsect == 6 || tmpsect == 7 || tmpsect == 10 || tmpsect == 11) { - npixel = mapx0p[tmpeta][tmpphi]; - itag = 2; - } else { - npixel = mapx0m[tmpeta][tmpphi]; - itag = 3; + if (m_histFill && tmpxet >= 0 && tmpxet < netamx && iphi >= 0 && iphi < nphimx) { + ho_indenergy[tmpxet][iphi - 1]->Fill(nomHOSig); } - } else { - fact = 3; - if (tmpsect % 2 == 1) - iflip = 1; - if (abs(iring) == 1) { - npixel = mapx1[tmpeta][(iflip == 0) ? tmpphi : abs(tmpphi - 2)]; - itag = 1; - } else { - npixel = mapx2[tmpeta][(iflip == 0) ? tmpphi : abs(tmpphi - 2)]; - itag = 0; - } - } - - int tmpeta1 = (ieta > 0) ? ieta - 1 : -ieta + 14; - - int iselect2 = 0; - if (hosig[4] != -100) { - if (m_cosmic) { - if (caloen[2] <= 0.0) - iselect2 = 1; - } else { - if (caloen[2] <= 3.0) - iselect2 = 1; - } - } - - if (iselect2 == 1) { - int tmpphi2 = (iphi + 6 <= nphimx) ? iphi + 5 : iphi + 5 - nphimx; - - int tmprout2 = (iring == 0) ? int((tmpphi2 + 2) / 2.) + 1 : int((tmpphi2 + 2) / 3.) + 1; - if (tmprout2 > tmproutmx) - tmprout2 = 1; - - if (cro_ssg[tmpeta1][tmpphi2].size() < 4000) { - if (hocro > alow && hocro < ahigh) { - if (!m_histfit) - cro_ssg[tmpeta1][tmpphi2].push_back(hocro); - crossg[tmpeta1][tmpphi2]->Fill(hocro); - } - } - - if (tmpphi2 >= 0 && tmpphi2 < nphimx) { - crossg[tmpeta1][nphimx]->Fill(hocro); - } - if (m_combined) { - com_crossg[iring2][tmprout2 - 1]->Fill(hocro); - com_crossg[iring2][tmproutmx]->Fill(hocro); + if (m_treeFill) { + T1->Fill(); } } - - if (iselect == 1) { - for (int ij = 0; ij < neffip; ij++) { - if (ij == 0) { - sig_effi[ij]->Fill(ieta, iphi, 1.); - } else { - if (hosig[4] > ij * m_sigma) { - sig_effi[ij]->Fill(ieta, iphi, 1.); - } - } - } - - //Histogram filling for noise study: phi shift according to DTChamberAnalysis - int tmpphi1 = iphi - 1; - - if (sig_reg[tmpeta1][tmpphi1].size() < 4000) { - if (hosig[4] > -50 && hosig[4] < 15) { - sigrsg[tmpeta1][tmpphi1]->Fill(hosig[4]); - if (!m_histfit && hosig[4] <= ahigh / 2.) - sig_reg[tmpeta1][tmpphi1].push_back(hosig[4]); - invang[tmpeta1][tmpphi1] += 1. / fabs(hoang); - } - } - - if (tmpphi1 >= 0 && tmpphi1 < nphimx) { //GREN - sigrsg[tmpeta1][nphimx]->Fill(hosig[4]); - invang[tmpeta1][nphimx] += 1. / fabs(hoang); - } - - if (m_combined) { // COMBINED - com_sigrsg[iring2][tmprout - 1]->Fill(hosig[4]); - com_invang[iring2][tmprout - 1] += 1. / fabs(hoang); - - com_sigrsg[iring2][tmproutmx]->Fill(hosig[4]); - com_invang[iring2][tmproutmx] += 1. / fabs(hoang); - } //m_combined - - if (m_checkmap || m_correl) { // CHECKMAP - tmpeta = etamap[itag][npixel]; - tmpphi = phimap[itag][npixel]; - if (tmpeta >= 0 && tmpphi >= 0) { - if (iflip != 0) - tmpphi = abs(tmpphi - 2); - if (int((hocorsig[fact * tmpeta + tmpphi] - hosig[4]) * 10000) / 10000. != 0) { - iaxxx++; - edm::LogVerbatim("HOCalib") - << "iring2xxx " << irun << " " << ievt << " " << isect << " " << iring << " " << tmpsect << " " - << ieta << " " << iphi << " " << npixel << " " << tmpeta << " " << tmpphi << " " << tmpeta1 << " " - << tmpphi1 << " itag " << itag << " " << iflip << " " << fact << " " - << hocorsig[fact * tmpeta + tmpphi] << " " << fact * tmpeta + tmpphi << " " << hosig[4] << " " << hodx - << " " << hody; - - for (int ij = 0; ij < 18; ij++) { - edm::LogVerbatim("HOCalib") << " " << ij << " " << hocorsig[ij]; - } - edm::LogVerbatim("HOCalib") << " ix " << iaxxx << " " << ibxxx; - } else { - ibxxx++; - } - - corrsgc[tmpeta1][tmpphi1]->Fill(hocorsig[fact * tmpeta + tmpphi]); - if (m_combined) { // COMBINED - com_corrsgc[iring2][tmpsect - 1]->Fill(hocorsig[fact * tmpeta + tmpphi]); - } //m_combined - } - } //m_checkmap - - if (m_correl) { // CORREL - float allcorsig = 0.0; - - tmpeta = etamap[itag][npixleft[npixel]]; - tmpphi = phimap[itag][npixleft[npixel]]; - - if (tmpeta >= 0 && tmpphi >= 0) { - if (iflip != 0) - tmpphi = abs(tmpphi - 2); - corrsgl[tmpeta1][tmpphi1]->Fill(hocorsig[fact * tmpeta + tmpphi]); - allcorsig += hocorsig[fact * tmpeta + tmpphi]; - if (m_combined) { // COMBINED - com_corrsgl[iring2][tmpsect - 1]->Fill(hocorsig[fact * tmpeta + tmpphi]); - } //m_combined - } - - tmpeta = etamap[itag][npixrigh[npixel]]; - tmpphi = phimap[itag][npixrigh[npixel]]; - if (tmpeta >= 0 && tmpphi >= 0) { - if (iflip != 0) - tmpphi = abs(tmpphi - 2); - corrsgr[tmpeta1][tmpphi1]->Fill(hocorsig[fact * tmpeta + tmpphi]); - allcorsig += hocorsig[fact * tmpeta + tmpphi]; - if (m_combined) { // #ifdef COMBINED - com_corrsgr[iring2][tmpsect - 1]->Fill(hocorsig[fact * tmpeta + tmpphi]); - } //m_combined #endif - } - - tmpeta = etamap[itag][npixlebt[npixel]]; - tmpphi = phimap[itag][npixlebt[npixel]]; - if (tmpeta >= 0 && tmpphi >= 0) { - if (iflip != 0) - tmpphi = abs(tmpphi - 2); - corrsglb[tmpeta1][tmpphi1]->Fill(hocorsig[fact * tmpeta + tmpphi]); - allcorsig += hocorsig[fact * tmpeta + tmpphi]; - if (m_combined) { // COMBINED - com_corrsglb[iring2][tmpsect - 1]->Fill(hocorsig[fact * tmpeta + tmpphi]); - } //m_combined - } - - tmpeta = etamap[itag][npixribt[npixel]]; - tmpphi = phimap[itag][npixribt[npixel]]; - if (tmpeta >= 0 && tmpphi >= 0) { - if (iflip != 0) - tmpphi = abs(tmpphi - 2); - corrsgrb[tmpeta1][tmpphi1]->Fill(hocorsig[fact * tmpeta + tmpphi]); - allcorsig += hocorsig[fact * tmpeta + tmpphi]; - if (m_combined) { // COMBINED - com_corrsgrb[iring2][tmpsect - 1]->Fill(hocorsig[fact * tmpeta + tmpphi]); - } //m_combined - } - - tmpeta = etamap[itag][npixleup[npixel]]; - tmpphi = phimap[itag][npixleup[npixel]]; - if (tmpeta >= 0 && tmpphi >= 0) { - if (iflip != 0) - tmpphi = abs(tmpphi - 2); - corrsglu[tmpeta1][tmpphi1]->Fill(hocorsig[fact * tmpeta + tmpphi]); - allcorsig += hocorsig[fact * tmpeta + tmpphi]; - if (m_combined) { // COMBINED - com_corrsglu[iring2][tmpsect - 1]->Fill(hocorsig[fact * tmpeta + tmpphi]); - } //m_combined - } - - tmpeta = etamap[itag][npixriup[npixel]]; - tmpphi = phimap[itag][npixriup[npixel]]; - if (tmpeta >= 0 && tmpphi >= 0) { - if (iflip != 0) - tmpphi = abs(tmpphi - 2); - corrsgru[tmpeta1][tmpphi1]->Fill(hocorsig[fact * tmpeta + tmpphi]); - allcorsig += hocorsig[fact * tmpeta + tmpphi]; - if (m_combined) { // COMBINED - com_corrsgru[iring2][tmpsect - 1]->Fill(hocorsig[fact * tmpeta + tmpphi]); - } //m_combined - } - corrsgall[tmpeta1][tmpphi1]->Fill(allcorsig); - if (m_combined) { // COMBINED - com_corrsgall[iring2][tmpsect - 1]->Fill(allcorsig); - } //m_combined - - } //m_correl - for (int k = 0; k < 9; k++) { - switch (iring) { - case 2: - ho_sig2p[k]->Fill(hosig[k]); - break; - case 1: - ho_sig1p[k]->Fill(hosig[k]); - break; - case 0: - ho_sig00[k]->Fill(hosig[k]); - break; - case -1: - ho_sig1m[k]->Fill(hosig[k]); - break; - case -2: - ho_sig2m[k]->Fill(hosig[k]); - break; - } - if (m_hbinfo) { // HBINFO - hbhe_sig[k]->Fill(hbhesig[k]); - } //m_hbinfo - } - } //if (iselect==1) - } //for (HOCalibVariableCollection::const_iterator hoC=(*HOCalib).begin(); hoC!=(*HOCalib).end(); hoC++){ - - } //if (isCosMu) -} - -// ------------ method called once each job just before starting event loop ------------ -void HOCalibAnalyzer::beginJob() {} - -// ------------ method called once each job just after ending the event loop ------------ -void HOCalibAnalyzer::endJob() { - theFile->cd(); - - if (m_allHOsignal) { - for (int jk = 0; jk < ho_energy->GetNbinsX(); jk++) { - for (int kl = 0; kl < ho_energy->GetNbinsY(); kl++) { - double entry = ho_entry->GetBinContent(jk + 1, kl + 1); - if (entry < 1.) - entry = 1.; - - double energy = ho_energy->GetBinContent(jk + 1, kl + 1) / entry; - double energy2 = ho_energy2->GetBinContent(jk + 1, kl + 1) / entry; - double rms = sqrt(energy2 - energy * energy); - - double xval = ho_energy->GetXaxis()->GetBinCenter(jk + 1); - double yval = ho_energy->GetYaxis()->GetBinCenter(kl + 1); - - ho_rms->Fill(xval, yval, rms); - } - } - } - - for (int ij = 0; ij < nphimx; ij++) { - for (int jk = 0; jk < netamx; jk++) { - nevsigrsg->Fill(netamx * ij + jk, sigrsg[jk][ij]->GetEntries()); - mnsigrsg->Fill(netamx * ij + jk, sigrsg[jk][ij]->GetMean()); - rmssigrsg->Fill(netamx * ij + jk, sigrsg[jk][ij]->GetRMS()); - - nevcrossg->Fill(netamx * ij + jk, crossg[jk][ij]->GetEntries()); - mncrossg->Fill(netamx * ij + jk, crossg[jk][ij]->GetMean()); - rmscrossg->Fill(netamx * ij + jk, crossg[jk][ij]->GetRMS()); - - if (m_correl) { // CORREL - - nevcorrsglb->Fill(netamx * ij + jk, corrsglb[jk][ij]->GetEntries()); - mncorrsglb->Fill(netamx * ij + jk, corrsglb[jk][ij]->GetMean()); - rmscorrsglb->Fill(netamx * ij + jk, corrsglb[jk][ij]->GetRMS()); - - nevcorrsgrb->Fill(netamx * ij + jk, corrsgrb[jk][ij]->GetEntries()); - mncorrsgrb->Fill(netamx * ij + jk, corrsgrb[jk][ij]->GetMean()); - rmscorrsgrb->Fill(netamx * ij + jk, corrsgrb[jk][ij]->GetRMS()); - - nevcorrsglu->Fill(netamx * ij + jk, corrsglu[jk][ij]->GetEntries()); - mncorrsglu->Fill(netamx * ij + jk, corrsglu[jk][ij]->GetMean()); - rmscorrsglu->Fill(netamx * ij + jk, corrsglu[jk][ij]->GetRMS()); - - nevcorrsgru->Fill(netamx * ij + jk, corrsgru[jk][ij]->GetEntries()); - mncorrsgru->Fill(netamx * ij + jk, corrsgru[jk][ij]->GetMean()); - rmscorrsgru->Fill(netamx * ij + jk, corrsgru[jk][ij]->GetRMS()); - - nevcorrsgall->Fill(netamx * ij + jk, corrsgall[jk][ij]->GetEntries()); - mncorrsgall->Fill(netamx * ij + jk, corrsgall[jk][ij]->GetMean()); - rmscorrsgall->Fill(netamx * ij + jk, corrsgall[jk][ij]->GetRMS()); - - nevcorrsgl->Fill(netamx * ij + jk, corrsgl[jk][ij]->GetEntries()); - mncorrsgl->Fill(netamx * ij + jk, corrsgl[jk][ij]->GetMean()); - rmscorrsgl->Fill(netamx * ij + jk, corrsgl[jk][ij]->GetRMS()); - - nevcorrsgr->Fill(netamx * ij + jk, corrsgr[jk][ij]->GetEntries()); - mncorrsgr->Fill(netamx * ij + jk, corrsgr[jk][ij]->GetMean()); - rmscorrsgr->Fill(netamx * ij + jk, corrsgr[jk][ij]->GetRMS()); - } //m_correl - if (m_checkmap) { // CHECKMAP - nevcorrsgc->Fill(netamx * ij + jk, corrsgc[jk][ij]->GetEntries()); - mncorrsgc->Fill(netamx * ij + jk, corrsgc[jk][ij]->GetMean()); - rmscorrsgc->Fill(netamx * ij + jk, corrsgc[jk][ij]->GetRMS()); - } //m_checkmap - } - } - - if (m_combined) { // COMBINED - for (int jk = 0; jk < ringmx; jk++) { - for (int ij = 0; ij < routmx; ij++) { - if (jk != 2 && ij >= rout12mx) - continue; - nevsigrsg->Fill(netamx * nphimx + ringmx * ij + jk, com_sigrsg[jk][ij]->GetEntries()); - mnsigrsg->Fill(netamx * nphimx + ringmx * ij + jk, com_sigrsg[jk][ij]->GetMean()); - rmssigrsg->Fill(netamx * nphimx + ringmx * ij + jk, com_sigrsg[jk][ij]->GetRMS()); - - nevcrossg->Fill(netamx * nphimx + ringmx * ij + jk, com_crossg[jk][ij]->GetEntries()); - mncrossg->Fill(netamx * nphimx + ringmx * ij + jk, com_crossg[jk][ij]->GetMean()); - rmscrossg->Fill(netamx * nphimx + ringmx * ij + jk, com_crossg[jk][ij]->GetRMS()); - } - } - - for (int ij = 0; ij < sectmx; ij++) { - for (int jk = 0; jk < ringmx; jk++) { - if (m_correl) { // CORREL - nevcorrsglb->Fill(netamx * nphimx + ringmx * ij + jk, com_corrsglb[jk][ij]->GetEntries()); - mncorrsglb->Fill(netamx * nphimx + ringmx * ij + jk, com_corrsglb[jk][ij]->GetMean()); - rmscorrsglb->Fill(netamx * nphimx + ringmx * ij + jk, com_corrsglb[jk][ij]->GetRMS()); - - nevcorrsgrb->Fill(netamx * nphimx + ringmx * ij + jk, com_corrsgrb[jk][ij]->GetEntries()); - mncorrsgrb->Fill(netamx * nphimx + ringmx * ij + jk, com_corrsgrb[jk][ij]->GetMean()); - rmscorrsgrb->Fill(netamx * nphimx + ringmx * ij + jk, com_corrsgrb[jk][ij]->GetRMS()); - - nevcorrsglu->Fill(netamx * nphimx + ringmx * ij + jk, com_corrsglu[jk][ij]->GetEntries()); - mncorrsglu->Fill(netamx * nphimx + ringmx * ij + jk, com_corrsglu[jk][ij]->GetMean()); - rmscorrsglu->Fill(netamx * nphimx + ringmx * ij + jk, com_corrsglu[jk][ij]->GetRMS()); - - nevcorrsgru->Fill(netamx * nphimx + ringmx * ij + jk, com_corrsgru[jk][ij]->GetEntries()); - mncorrsgru->Fill(netamx * nphimx + ringmx * ij + jk, com_corrsgru[jk][ij]->GetMean()); - rmscorrsgru->Fill(netamx * nphimx + ringmx * ij + jk, com_corrsgru[jk][ij]->GetRMS()); - - nevcorrsgall->Fill(netamx * nphimx + ringmx * ij + jk, com_corrsgall[jk][ij]->GetEntries()); - mncorrsgall->Fill(netamx * nphimx + ringmx * ij + jk, com_corrsgall[jk][ij]->GetMean()); - rmscorrsgall->Fill(netamx * nphimx + ringmx * ij + jk, com_corrsgall[jk][ij]->GetRMS()); - - nevcorrsgl->Fill(netamx * nphimx + ringmx * ij + jk, com_corrsgl[jk][ij]->GetEntries()); - mncorrsgl->Fill(netamx * nphimx + ringmx * ij + jk, com_corrsgl[jk][ij]->GetMean()); - rmscorrsgl->Fill(netamx * nphimx + ringmx * ij + jk, com_corrsgl[jk][ij]->GetRMS()); - - nevcorrsgr->Fill(netamx * nphimx + ringmx * ij + jk, com_corrsgr[jk][ij]->GetEntries()); - mncorrsgr->Fill(netamx * nphimx + ringmx * ij + jk, com_corrsgr[jk][ij]->GetMean()); - rmscorrsgr->Fill(netamx * nphimx + ringmx * ij + jk, com_corrsgr[jk][ij]->GetRMS()); - } //m_correl - if (m_checkmap) { // CHECKMAP - nevcorrsgc->Fill(netamx * nphimx + ringmx * ij + jk, com_corrsgc[jk][ij]->GetEntries()); - mncorrsgc->Fill(netamx * nphimx + ringmx * ij + jk, com_corrsgc[jk][ij]->GetMean()); - rmscorrsgc->Fill(netamx * nphimx + ringmx * ij + jk, com_corrsgc[jk][ij]->GetRMS()); - } //m_checkmap - } - } - } //m_combined - - for (int ij = 1; ij < neffip; ij++) { - sig_effi[ij]->Divide(sig_effi[0]); - } - for (int ij = 0; ij < netamx; ij++) { - for (int jk = 0; jk < nphimx; jk++) { - int ieta = (ij < 15) ? ij + 1 : 14 - ij; - int iphi = jk + 1; - double signal = sigrsg[ij][jk]->GetMean(); - mean_energy->Fill(ieta, iphi, signal); - } - } - - int irunold = irun; - - gStyle->SetOptLogy(0); - gStyle->SetTitleFillColor(10); - gStyle->SetStatColor(10); - - gStyle->SetCanvasColor(10); - gStyle->SetOptStat(0); //1110); - gStyle->SetOptTitle(1); - - gStyle->SetTitleColor(10); - gStyle->SetTitleFontSize(0.09); - gStyle->SetTitleOffset(-0.05); - gStyle->SetTitleBorderSize(1); - - gStyle->SetPadColor(10); - gStyle->SetPadBorderMode(0); - gStyle->SetStatColor(10); - gStyle->SetPadBorderMode(0); - gStyle->SetStatBorderSize(1); - gStyle->SetStatFontSize(.07); - - gStyle->SetStatStyle(1001); - gStyle->SetOptFit(101); - gStyle->SetCanvasColor(10); - gStyle->SetCanvasBorderMode(0); - - gStyle->SetStatX(.99); - gStyle->SetStatY(.99); - gStyle->SetStatW(.45); - gStyle->SetStatH(.16); - gStyle->SetLabelSize(0.075, "XY"); - gStyle->SetLabelOffset(0.21, "XYZ"); - gStyle->SetTitleSize(0.065, "XY"); - gStyle->SetTitleOffset(0.06, "XYZ"); - gStyle->SetPadTopMargin(.09); - gStyle->SetPadBottomMargin(0.11); - gStyle->SetPadLeftMargin(0.12); - gStyle->SetPadRightMargin(0.15); - gStyle->SetPadGridX(true); - gStyle->SetPadGridY(true); - gStyle->SetGridStyle(2); - gStyle->SetNdivisions(303, "XY"); - - gStyle->SetMarkerSize(0.60); - gStyle->SetMarkerColor(2); - gStyle->SetMarkerStyle(20); - gStyle->SetTitleFontSize(0.07); - - char out_file[200]; - int xsiz = 700; - int ysiz = 500; - - gStyle->SetPadBottomMargin(0.14); - gStyle->SetPadLeftMargin(0.17); - gStyle->SetPadRightMargin(0.03); - - gStyle->SetOptStat(1110); - - const int nsample = 8; - TF1* gx0[nsample] = {nullptr}; - TF1* ped0fun[nsample] = {nullptr}; - TF1* signal[nsample] = {nullptr}; - TF1* pedfun[nsample] = {nullptr}; - TF1* sigfun[nsample] = {nullptr}; - TF1* signalx[nsample] = {nullptr}; - - TH1F* signall[nsample] = {nullptr}; - TH1F* pedstll[nsample] = {nullptr}; - - if (m_constant) { - gStyle->SetOptFit(101); - gStyle->SetCanvasBorderMode(0); - gStyle->SetPadBorderMode(0); - gStyle->SetStatBorderSize(1); - gStyle->SetStatStyle(1001); - gStyle->SetTitleColor(10); - gStyle->SetTitleFontSize(0.09); - gStyle->SetTitleOffset(-0.05); - gStyle->SetTitleBorderSize(1); - - gStyle->SetCanvasColor(10); - gStyle->SetPadColor(10); - gStyle->SetStatColor(10); - gStyle->SetStatFontSize(.07); - gStyle->SetStatX(0.99); - gStyle->SetStatY(0.99); - gStyle->SetStatW(0.30); - gStyle->SetStatH(0.10); - gStyle->SetTitleSize(0.065, "XYZ"); - gStyle->SetLabelSize(0.075, "XYZ"); - gStyle->SetLabelOffset(0.012, "XYZ"); - gStyle->SetPadGridX(true); - gStyle->SetPadGridY(true); - gStyle->SetGridStyle(3); - gStyle->SetNdivisions(101, "XY"); - gStyle->SetOptLogy(0); - int iiter = 0; - - std::ofstream file_out(theoutputtxtFile.c_str()); - // TPostScript* ps=0; - int ips = 111; - TPostScript ps(theoutputpsFile.c_str(), ips); - ps.Range(20, 28); - - xsiz = 900; //900; - ysiz = 1200; //600; - TCanvas* c0 = new TCanvas("c0", " Pedestal vs signal", xsiz, ysiz); - - // Fix is done for eta-phi - - float mean_eta[netamx]; - float mean_phi[nphimx]; - float rms_eta[netamx]; - float rms_phi[nphimx]; - - for (int ij = 0; ij < nphimx; ++ij) { - mean_phi[ij] = 0; - rms_phi[ij] = 0; - } - for (int ij = 0; ij < netamx; ++ij) { - mean_eta[ij] = 0; - rms_eta[ij] = 0; - } - - int mxeta = 0; - int mxphi = 0; - int mneta = 0; - int mnphi = 0; - - //iijj = 0 : Merging all ring - // = 1 : Individual HPD - //iijj = 2 : merging all phi - // = 3 : Individual tower - - for (int iijj = 0; iijj < 4; iijj++) { - // if ((!mx_combined) && iijj==1) continue; //Use this only for combined data - if (iijj == 0) { - mxeta = ringmx; - mxphi = 1; - mneta = 0; - mnphi = 0; - } else if (iijj == 1) { - mxeta = ringmx; - mxphi = routmx; - mneta = 0; - mnphi = 0; - } else if (iijj == 2) { - mxeta = netamx; - mxphi = 1; - mneta = 0; - mnphi = 0; - } else if (iijj == 3) { - mxeta = netamx; - mxphi = nphimx; - mneta = 0; - mnphi = 0; - } - - for (int jk = mneta; jk < mxeta; jk++) { - for (int ij = mnphi; ij < mxphi; ij++) { - if (iijj == 1) - continue; - if ((iijj == 0 || iijj == 1) && jk != 2 && ij >= rout12mx) - continue; - int izone = iiter % nsample; - - if (iijj == 0) { - int iread = (jk == 2) ? routmx : rout12mx; - signall[izone] = (TH1F*)com_sigrsg[jk][iread]->Clone("hnew"); - pedstll[izone] = (TH1F*)com_crossg[jk][iread]->Clone("hnew"); - } else if (iijj == 1) { - signall[izone] = (TH1F*)com_sigrsg[jk][ij]->Clone("hnew"); - pedstll[izone] = (TH1F*)com_crossg[jk][ij]->Clone("hnew"); - } else if (iijj == 2) { - signall[izone] = (TH1F*)sigrsg[jk][nphimx]->Clone("hnew"); - pedstll[izone] = (TH1F*)crossg[jk][nphimx]->Clone("hnew"); - } else if (iijj == 3) { - signall[izone] = (TH1F*)sigrsg[jk][ij]->Clone("hnew"); - pedstll[izone] = (TH1F*)crossg[jk][ij]->Clone("hnew"); - } - - pedstll[izone]->SetLineWidth(2); - signall[izone]->SetLineWidth(2); - pedstll[izone]->SetLineColor(2); - signall[izone]->SetLineColor(4); - pedstll[izone]->SetNdivisions(506, "XY"); - signall[izone]->SetNdivisions(506, "XY"); - - signall[izone]->GetXaxis()->SetLabelSize(.065); - signall[izone]->GetYaxis()->SetLabelSize(.06); - signall[izone]->GetXaxis()->SetTitle("Signal (GeV)"); - - signall[izone]->GetXaxis()->SetTitleSize(.065); - signall[izone]->GetXaxis()->CenterTitle(); - - if (izone == 0) { //iiter%8 ==0) { - ps.NewPage(); - c0->Divide(4, 4); //c0->Divide(2,4); // c0->Divide(1,2); - } - c0->cd(2 * izone + 1); // (iiter%8)+1); //c0->cd(iiter%8+1); - - float mean = pedstll[izone]->GetMean(); - float rms = pedstll[izone]->GetRMS(); - - if (rms < 0.10) - rms = 0.10; - if (rms > 0.15) - rms = 0.15; - if (mean > 0.20) - mean = 0.20; - if (mean < -0.20) - mean = -0.20; - - float xmn = mean - 6. * rms; - float xmx = mean + 6. * rms; - - binwid = pedstll[izone]->GetBinWidth(1); - if (xmx > pedstll[izone]->GetXaxis()->GetXmax()) - xmx = pedstll[izone]->GetXaxis()->GetXmax() - 0.5 * binwid; - if (xmn < pedstll[izone]->GetXaxis()->GetXmin()) - xmn = pedstll[izone]->GetXaxis()->GetXmin() + 0.5 * binwid; - - float height = pedstll[izone]->GetEntries(); - - double par[nbgpr] = {height, mean, 0.75 * rms}; - - double gaupr[nbgpr]; - double parer[nbgpr]; - - ietafit = jk; - iphifit = ij; - pedstll[izone]->GetXaxis()->SetLabelSize(.065); - pedstll[izone]->GetYaxis()->SetLabelSize(.06); - - pedstll[izone]->GetXaxis()->SetRangeUser(xmn, xmx); - - if (iijj == 0) { - pedstll[izone]->GetXaxis()->SetTitle("Pedestal/Signal (GeV)"); - } else { - pedstll[izone]->GetXaxis()->SetTitle("Pedestal (GeV)"); - } - pedstll[izone]->GetXaxis()->SetTitleSize(.065); - pedstll[izone]->GetXaxis()->CenterTitle(); - - pedstll[izone]->Draw(); - if (m_pedsuppr) { - gaupr[0] = 0; - gaupr[1] = 0.0; // pedmean[ietafit][iphifit]; - gaupr[2] = 0.15; //GMA need from database - parer[0] = parer[1] = parer[2] = 0; - } else { - if (pedstll[izone]->GetEntries() > 5) { - if ((iijj != 3) || m_histfit) { - char temp[20]; - sprintf(temp, "gx0_%i", izone); - gx0[izone] = new TF1(temp, gausX, xmn, xmx, nbgpr); - gx0[izone]->SetParameters(par); - gx0[izone]->SetLineWidth(1); - pedstll[izone]->Fit(gx0[izone], "R+"); - - for (int k = 0; k < nbgpr; k++) { - parer[k] = gx0[izone]->GetParError(k); - gaupr[k] = gx0[izone]->GetParameter(k); - } - } else { - double strt[nbgpr] = {height, mean, 0.75 * rms}; - double step[nbgpr] = {1.0, 0.001, 0.001}; - double alowmn[nbgpr] = {0.5 * height, mean - rms, 0.3 * rms}; - double ahighmn[nbgpr] = {1.5 * height, mean + rms, 1.5 * rms}; - - TMinuit* gMinuit = new TMinuit(nbgpr); - gMinuit->SetFCN(fcnbg); - - double arglist[10]; - int ierflg = 0; - arglist[0] = 0.5; - gMinuit->mnexcm("SET ERR", arglist, 1, ierflg); - char name[100]; - for (int k = 0; k < nbgpr; k++) { - sprintf(name, "pedpar%i", k); - gMinuit->mnparm(k, name, strt[k], step[k], alowmn[k], ahighmn[k], ierflg); - } - - arglist[0] = 0; - gMinuit->mnexcm("SIMPLEX", arglist, 0, ierflg); - - arglist[0] = 0; - gMinuit->mnexcm("IMPROVE", arglist, 0, ierflg); - - TString chnam; - double parv, err, xlo, xup, plerr, mierr, eparab, gcc; - int iuit; - - for (int k = 0; k < nbgpr; k++) { - if (step[k] > -10) { - gMinuit->mnpout(k, chnam, parv, err, xlo, xup, iuit); - gMinuit->mnerrs(k, plerr, mierr, eparab, gcc); - if (k == 0) { - gaupr[k] = parv * binwid; - parer[k] = err * binwid; - } else { - gaupr[k] = parv; - parer[k] = err; - } - } - } - - char temp[20]; - sprintf(temp, "ped0fun_%i", izone); - ped0fun[izone] = new TF1(temp, gausX, xmn, xmx, nbgpr); - ped0fun[izone]->SetParameters(gaupr); - ped0fun[izone]->SetLineColor(3); - ped0fun[izone]->SetLineWidth(1); - ped0fun[izone]->Draw("same"); - - delete gMinuit; - } - } else { - for (int k = 0; k < nbgpr; k++) { - gaupr[k] = par[k]; - } - gaupr[2] = 0.15; - } - } - - c0->cd(2 * izone + 2); - if (signall[izone]->GetEntries() > 5) { - Double_t parall[nsgpr]; - double parserr[nsgpr]; - double fitres[nsgpr]; - double pedht = 0; - - char temp[20]; - sprintf(temp, "signal_%i", izone); - xmn = signall[izone]->GetXaxis()->GetXmin(); - xmx = 0.5 * signall[izone]->GetXaxis()->GetXmax(); - signal[izone] = new TF1(temp, totalfunc, xmn, xmx, nsgpr); - xmx *= 2.0; - if ((iijj != 3) || m_histfit) { - pedht = (signall[izone]->GetBinContent(nbn - 1) + signall[izone]->GetBinContent(nbn) + - signall[izone]->GetBinContent(nbn + 1)) / - 3.; - - if (m_pedsuppr) { - parall[1] = 0.0; // pedmean[ietafit][iphifit]; - parall[2] = 0.15; - } else { - for (int lm = 0; lm < nbgpr; lm++) { - parall[lm] = gaupr[lm]; - } - } - - set_mean(parall[1], false); - set_sigma(parall[2], false); - - parall[0] = 0.9 * pedht; //GM for Z-mumu, there is almost no pedestal - parall[3] = 0.14; - double area = binwid * signall[izone]->GetEntries(); - parall[5] = area; - - if (iijj == 3) { - parall[4] = fitprm[4][jk]; - parall[6] = fitprm[6][jk]; - } else { - parall[4] = signall[izone]->GetMean(); - parall[6] = parall[2]; - } - - signal[izone]->SetParameters(parall); - signal[izone]->FixParameter(1, parall[1]); - signal[izone]->FixParameter(2, parall[2]); - signal[izone]->SetParLimits(0, 0.00, 2.0 * pedht + 0.1); - signal[izone]->FixParameter(3, 0.14); - - signal[izone]->SetParLimits(5, 0.40 * area, 1.15 * area); - if (iijj == 3) { - signal[izone]->SetParLimits(4, 0.2 * fitprm[4][jk], 2.0 * fitprm[4][jk]); - signal[izone]->SetParLimits(6, 0.2 * fitprm[6][jk], 2.0 * fitprm[6][jk]); - } else { - signal[izone]->SetParLimits(4, 0.1, 1.0); - signal[izone]->SetParLimits(6, 0.035, 0.3); - } - signal[izone]->SetParNames("const", "mean", "sigma", "Width", "MP", "Area", "GSigma"); - signall[izone]->Fit(signal[izone], "0R+"); - - signall[izone]->GetXaxis()->SetRangeUser(xmn, xmx); - for (int k = 0; k < nsgpr; k++) { - fitres[k] = fitprm[k][jk] = signal[izone]->GetParameter(k); - parserr[k] = signal[izone]->GetParError(k); - } - - } else { - double pedhtx = 0; - for (unsigned i = 0; i < sig_reg[ietafit][iphifit].size(); i++) { - if (sig_reg[ietafit][iphifit][ij] > gaupr[1] - 3 * gaupr[2] && - sig_reg[ietafit][iphifit][ij] < gaupr[1] + gaupr[2]) - pedhtx++; - } - - set_mean(gaupr[1], false); - set_sigma(gaupr[2], false); - - TString name[nsgpr] = {"const", "mean", "sigma", "Width", "MP", "Area", "GSigma"}; - double strt[nsgpr] = {0.9 * pedhtx, - gaupr[1], - gaupr[2], - fitprm[3][jk], - fitprm[4][jk], - signall[izone]->GetEntries(), - fitprm[6][jk]}; - double alowmn[nsgpr] = { - 0.1 * pedhtx - 0.1, gaupr[1] - 0.1, gaupr[2] - 0.1, 0.07, 0.2 * strt[4], 0.1 * strt[5], 0.2 * strt[6]}; - double ahighmn[nsgpr] = { - 1.2 * pedhtx + 0.1, gaupr[1] + 0.1, gaupr[2] + 0.1, 0.20, 2.5 * strt[4], 1.5 * strt[5], 2.2 * strt[6]}; - double step[nsgpr] = {1.0, 0.0, 0.0, 0.0, 0.001, 1.0, 0.002}; - - TMinuit* gMinuit = new TMinuit(nsgpr); - gMinuit->SetFCN(fcnsg); - - double arglist[10]; - int ierflg = 0; - arglist[0] = 0.5; - gMinuit->mnexcm("SET ERR", arglist, 1, ierflg); - - for (int k = 0; k < nsgpr; k++) { - gMinuit->mnparm(k, name[k], strt[k], step[k], alowmn[k], ahighmn[k], ierflg); - } - - arglist[0] = 0; - gMinuit->mnexcm("SIMPLEX", arglist, 0, ierflg); - - arglist[0] = 0; - gMinuit->mnexcm("IMPROVE", arglist, 0, ierflg); - - TString chnam; - double parv, err, xlo, xup, plerr, mierr, eparab, gcc; - int iuit; - - for (int k = 0; k < nsgpr; k++) { - if (step[k] > -10) { - gMinuit->mnpout(k, chnam, parv, err, xlo, xup, iuit); - gMinuit->mnerrs(k, plerr, mierr, eparab, gcc); - if (k == 0 || k == 5) { - fitres[k] = parv * binwid; - parserr[k] = err * binwid; - } else { - fitres[k] = parv; - parserr[k] = err; - } - } - } - - delete gMinuit; - } - - signall[izone]->Draw(); - - sprintf(temp, "pedfun_%i", izone); - pedfun[izone] = new TF1(temp, gausX, xmn, xmx, nbgpr); - pedfun[izone]->SetParameters(fitres); - pedfun[izone]->SetLineColor(3); - pedfun[izone]->SetLineWidth(1); - pedfun[izone]->Draw("same"); - - sprintf(temp, "signalfun_%i", izone); - sigfun[izone] = new TF1(temp, langaufun, xmn, xmx, nsgpr - nbgpr); - sigfun[izone]->SetParameters(&fitres[3]); - sigfun[izone]->SetLineWidth(1); - sigfun[izone]->SetLineColor(4); - sigfun[izone]->Draw("same"); - - sprintf(temp, "total_%i", izone); - signalx[izone] = new TF1(temp, totalfunc, xmn, xmx, nsgpr); - signalx[izone]->SetParameters(fitres); - signalx[izone]->SetLineWidth(1); - signalx[izone]->Draw("same"); - - int kl = (jk < 15) ? jk + 1 : 14 - jk; - - edm::LogVerbatim("HOCalib") << "histinfo" << iijj << " fit " << std::setw(3) << kl << " " << std::setw(3) - << ij + 1 << " " << std::setw(5) << pedstll[izone]->GetEntries() << " " - << std::setw(6) << pedstll[izone]->GetMean() << " " << std::setw(6) - << pedstll[izone]->GetRMS() << " " << std::setw(5) - << signall[izone]->GetEntries() << " " << std::setw(6) - << signall[izone]->GetMean() << " " << std::setw(6) << signall[izone]->GetRMS() - << " " << std::setw(6) << signal[izone]->GetChisquare() << " " << std::setw(3) - << signal[izone]->GetNDF(); - - file_out << "histinfo" << iijj << " fit " << std::setw(3) << kl << " " << std::setw(3) << ij + 1 << " " - << std::setw(5) << pedstll[izone]->GetEntries() << " " << std::setw(6) << pedstll[izone]->GetMean() - << " " << std::setw(6) << pedstll[izone]->GetRMS() << " " << std::setw(5) - << signall[izone]->GetEntries() << " " << std::setw(6) << signall[izone]->GetMean() << " " - << std::setw(6) << signall[izone]->GetRMS() << " " << std::setw(6) << signal[izone]->GetChisquare() - << " " << std::setw(3) << signal[izone]->GetNDF() << std::endl; - - file_out << "fitres x" << iijj << " " << kl << " " << ij + 1 << " " << fitres[0] << " " << fitres[1] << " " - << fitres[2] << " " << fitres[3] << " " << fitres[4] << " " << fitres[5] << " " << fitres[6] - << std::endl; - file_out << "parserr" << iijj << " " << kl << " " << ij + 1 << " " << parserr[0] << " " << parserr[1] << " " - << parserr[2] << " " << parserr[3] << " " << parserr[4] << " " << parserr[5] << " " << parserr[6] - << std::endl; - - int ieta = (jk < 15) ? (15 + jk) : (29 - jk); - int ifl = nphimx * ieta + ij; - - if (iijj == 3) { - ped_evt->Fill(ifl, pedstll[izone]->GetEntries()); - ped_mean->Fill(ifl, gaupr[1]); - ped_width->Fill(ifl, gaupr[2]); - fit_chi->Fill(ifl, signal[izone]->GetChisquare()); - sig_evt->Fill(ifl, signall[izone]->GetEntries()); - fit_sigevt->Fill(ifl, fitres[5]); - fit_bkgevt->Fill(ifl, fitres[0] * sqrt(2 * acos(-1.)) * gaupr[2]); - sig_mean->Fill(ifl, fitres[4]); - sig_diff->Fill(ifl, fitres[4] - fitres[1]); - sig_width->Fill(ifl, fitres[3]); - sig_sigma->Fill(ifl, fitres[6]); - sig_meanerr->Fill(ifl, parserr[4]); - if (fitres[4] - fitres[1] != 0) - sig_meanerrp->Fill(ifl, 100 * parserr[4] / (fitres[4] - fitres[1])); - if (gaupr[2] != 0) - sig_signf->Fill(ifl, (fitres[4] - fitres[1]) / gaupr[2]); - - ped_statmean->Fill(ifl, pedstll[izone]->GetMean()); - sig_statmean->Fill(ifl, signall[izone]->GetMean()); - ped_rms->Fill(ifl, pedstll[izone]->GetRMS()); - sig_rms->Fill(ifl, signall[izone]->GetRMS()); - } - - if ((iijj == 2) || (iijj == 3) || (iijj == 1)) { - if (signall[izone]->GetEntries() > 5 && fitres[4] > 0.1) { - //GMA need to put this==1 in future - float fact = 0.812; - if (abs(kl) <= 4) - fact = 0.895; - fact *= 0.19; //conversion factor for GeV/fC - - float fact2 = 0; - if (iijj == 2) - fact2 = invang[jk][nphimx]; - if (iijj == 3) - fact2 = invang[jk][ij]; - if (iijj == 1) - fact2 = com_invang[jk][ij]; - - float calibc = fact * fact2 / (fitres[4] * signall[izone]->GetEntries()); - float caliberr = TMath::Abs(calibc * parserr[4] / std::max(0.001, fitres[4])); - - if (iijj == 2) { - int ieta = (jk < 15) ? jk + 1 : 14 - jk; - mean_phi_hst->Fill(ieta, calibc); - mean_phi_hst->SetBinError(mean_phi_hst->FindBin(ieta), caliberr); - file_out << "intieta " << jk << " " << ij << " " << ieta << " " << mean_phi_hst->FindBin(double(ieta)) - << " " << calibc << " " << caliberr << std::endl; - } else if (iijj == 3) { - const_eta[jk]->Fill(ij + 1, calibc); - const_eta[jk]->SetBinError(const_eta[jk]->FindBin(ij + 1), caliberr); - - peak_eta[jk]->Fill(ij + 1, fitres[4]); - peak_eta[jk]->SetBinError(peak_eta[jk]->FindBin(ij + 1), parserr[4]); - - int ieta = (jk < 15) ? jk + 1 : 14 - jk; - const_eta_phi->Fill(ieta, ij + 1, calibc); - file_out << "intietax " << jk << " " << ij << " " << ieta << " " - << const_eta_phi->FindBin(ieta, ij + 1) << std::endl; - if (caliberr > 0) { - const_eta_phi->SetBinError(const_eta_phi->FindBin(ieta, ij + 1), caliberr); - - mean_eta[ij] += calibc / (caliberr * caliberr); - mean_phi[jk] += calibc / (caliberr * caliberr); - - rms_eta[ij] += 1. / (caliberr * caliberr); - rms_phi[jk] += 1. / (caliberr * caliberr); - - } else { - const_eta_phi->SetBinError(const_eta_phi->FindBin(ieta, ij + 1), 0.0); - } - } else if (iijj == 1) { - const_hpdrm[jk]->Fill(ij + 1, calibc); - const_hpdrm[jk]->SetBinError(const_hpdrm[jk]->FindBin(ij + 1), caliberr); - - peak_hpdrm[jk]->Fill(ij + 1, fitres[4]); - peak_hpdrm[jk]->SetBinError(peak_hpdrm[jk]->FindBin(ij + 1), parserr[4]); - } - - file_out << "HO 4 " << iijj << " " << std::setw(3) << kl << " " << std::setw(3) << ij + 1 << " " - << std::setw(7) << calibc << " " << std::setw(7) << caliberr << std::endl; - } - } - - } else { //if (signall[izone]->GetEntries() >10) { - signall[izone]->Draw(); - float varx = 0.000; - int kl = (jk < 15) ? jk + 1 : 14 - jk; - file_out << "histinfo" << iijj << " nof " << std::setw(3) << kl << " " << std::setw(3) << ij + 1 << " " - << std::setw(5) << pedstll[izone]->GetEntries() << " " << std::setw(6) << pedstll[izone]->GetMean() - << " " << std::setw(6) << pedstll[izone]->GetRMS() << " " << std::setw(5) - << signall[izone]->GetEntries() << " " << std::setw(6) << signall[izone]->GetMean() << " " - << std::setw(6) << signall[izone]->GetRMS() << " " << std::setw(6) << varx << " " << std::setw(3) - << varx << std::endl; - - file_out << "fitres x" << iijj << " " << kl << " " << ij + 1 << " " << varx << " " << varx << " " << varx - << " " << varx << " " << varx << " " << varx << " " << varx << std::endl; - file_out << "parserr" << iijj << " " << kl << " " << ij + 1 << " " << varx << " " << varx << " " << varx - << " " << varx << " " << varx << " " << varx << " " << varx << std::endl; - } - iiter++; - if (iiter % nsample == 0) { - c0->Update(); - - for (int kl = 0; kl < nsample; kl++) { - if (gx0[kl]) { - delete gx0[kl]; - gx0[kl] = nullptr; - } - if (ped0fun[kl]) { - delete ped0fun[kl]; - ped0fun[kl] = nullptr; - } - if (signal[kl]) { - delete signal[kl]; - signal[kl] = nullptr; - } - if (pedfun[kl]) { - delete pedfun[kl]; - pedfun[kl] = nullptr; - } - if (sigfun[kl]) { - delete sigfun[kl]; - sigfun[kl] = nullptr; - } - if (signalx[kl]) { - delete signalx[kl]; - signalx[kl] = nullptr; - } - if (signall[kl]) { - delete signall[kl]; - signall[kl] = nullptr; - } - if (pedstll[kl]) { - delete pedstll[kl]; - pedstll[kl] = nullptr; - } - } - } - } //for (int jk=0; jkUpdate(); - for (int kl = 0; kl < nsample; kl++) { - if (gx0[kl]) { - delete gx0[kl]; - gx0[kl] = nullptr; - } - if (ped0fun[kl]) { - delete ped0fun[kl]; - ped0fun[kl] = nullptr; - } - if (signal[kl]) { - delete signal[kl]; - signal[kl] = nullptr; - } - if (pedfun[kl]) { - delete pedfun[kl]; - pedfun[kl] = nullptr; - } - if (sigfun[kl]) { - delete sigfun[kl]; - sigfun[kl] = nullptr; - } - if (signalx[kl]) { - delete signalx[kl]; - signalx[kl] = nullptr; - } - if (signall[kl]) { - delete signall[kl]; - signall[kl] = nullptr; - } - if (pedstll[kl]) { - delete pedstll[kl]; - pedstll[kl] = nullptr; - } - } - } - - delete c0; - - xsiz = 600; //int xsiz = 600; - ysiz = 800; //int ysiz = 800; - - gStyle->SetTitleFontSize(0.05); - gStyle->SetTitleSize(0.025, "XYZ"); - gStyle->SetLabelSize(0.025, "XYZ"); - gStyle->SetStatFontSize(.045); - - gStyle->SetOptStat(0); - ps.NewPage(); - TCanvas* c1 = new TCanvas("c1", " Pedestal vs signal", xsiz, ysiz); - ped_evt->Draw(); - c1->Update(); - - ps.NewPage(); - ped_statmean->Draw(); - c1->Update(); - - ps.NewPage(); - ped_rms->Draw(); - c1->Update(); - - ps.NewPage(); - ped_mean->Draw(); - c1->Update(); - - ps.NewPage(); - ped_width->Draw(); - c1->Update(); - - ps.NewPage(); - sig_evt->Draw(); - c1->Update(); - - ps.NewPage(); - sig_statmean->Draw(); - c1->Update(); - - ps.NewPage(); - sig_rms->Draw(); - c1->Update(); - - ps.NewPage(); - fit_chi->Draw(); - c1->Update(); - - ps.NewPage(); - fit_sigevt->Draw(); - c1->Update(); - - ps.NewPage(); - fit_bkgevt->Draw(); - c1->Update(); - - ps.NewPage(); - sig_mean->Draw(); - c1->Update(); - - ps.NewPage(); - sig_width->Draw(); - c1->Update(); - - ps.NewPage(); - sig_sigma->Draw(); - c1->Update(); - - ps.NewPage(); - sig_meanerr->Draw(); - c1->Update(); - - ps.NewPage(); - sig_meanerrp->Draw(); - c1->Update(); - - ps.NewPage(); - sig_signf->Draw(); - c1->Update(); - - ps.Close(); - delete c1; - - file_out.close(); - - if (m_figure) { - xsiz = 700; - ysiz = 450; - - gStyle->SetTitleFontSize(0.09); - gStyle->SetPadBottomMargin(0.17); - gStyle->SetPadLeftMargin(0.18); - gStyle->SetPadRightMargin(0.01); - gStyle->SetOptLogy(0); - gStyle->SetOptStat(0); - - TCanvas* c2 = new TCanvas("c2", "runfile", xsiz, ysiz); - c2->Divide(5, 3); - - for (int side = 0; side < 2; side++) { - gStyle->SetNdivisions(303, "XY"); - gStyle->SetPadRightMargin(0.01); - int nmn = 0; - int nmx = netamx / 2; - if (side == 1) { - nmn = netamx / 2; - nmx = netamx; - } - - int nzone = 0; - - for (int ij = nmn; ij < nmx; ij++) { - c2->cd(nzone + 1); - const_eta[ij]->GetXaxis()->SetTitle("#phi index"); - const_eta[ij]->GetXaxis()->SetTitleSize(.08); - const_eta[ij]->GetXaxis()->CenterTitle(); - const_eta[ij]->GetXaxis()->SetTitleOffset(0.9); - const_eta[ij]->GetXaxis()->SetLabelSize(.085); - const_eta[ij]->GetXaxis()->SetLabelOffset(.01); - - const_eta[ij]->GetYaxis()->SetLabelSize(.08); - const_eta[ij]->GetYaxis()->SetLabelOffset(.01); - const_eta[ij]->GetYaxis()->SetTitle("GeV/MIP-GeV!!"); - - const_eta[ij]->GetYaxis()->SetTitleSize(.085); - const_eta[ij]->GetYaxis()->CenterTitle(); - const_eta[ij]->GetYaxis()->SetTitleOffset(1.3); - const_eta[ij]->SetMarkerSize(0.60); - const_eta[ij]->SetMarkerColor(2); - const_eta[ij]->SetMarkerStyle(20); - - const_eta[ij]->Draw(); - nzone++; - } - - sprintf(out_file, "calibho_%i_side%i.eps", irunold, side); - c2->SaveAs(out_file); - - sprintf(out_file, "calibho_%i_side%i.jpg", irunold, side); - c2->SaveAs(out_file); - - nzone = 0; - for (int ij = nmn; ij < nmx; ij++) { - c2->cd(nzone + 1); - peak_eta[ij]->GetXaxis()->SetTitle("#phi index"); - peak_eta[ij]->GetXaxis()->SetTitleSize(.08); - peak_eta[ij]->GetXaxis()->CenterTitle(); - peak_eta[ij]->GetXaxis()->SetTitleOffset(0.90); - peak_eta[ij]->GetXaxis()->SetLabelSize(.08); - peak_eta[ij]->GetXaxis()->SetLabelOffset(.01); - - peak_eta[ij]->GetYaxis()->SetLabelSize(.08); - peak_eta[ij]->GetYaxis()->SetLabelOffset(.01); - peak_eta[ij]->GetYaxis()->SetTitle("GeV"); - - peak_eta[ij]->GetYaxis()->SetTitleSize(.085); - peak_eta[ij]->GetYaxis()->CenterTitle(); - peak_eta[ij]->GetYaxis()->SetTitleOffset(1.3); - - peak_eta[ij]->SetMarkerSize(0.60); - peak_eta[ij]->SetMarkerColor(2); - peak_eta[ij]->SetMarkerStyle(20); - - peak_eta[ij]->Draw(); - nzone++; - } - - sprintf(out_file, "peakho_%i_side%i.eps", irunold, side); - c2->SaveAs(out_file); - - sprintf(out_file, "peakho_%i_side%i.jpg", irunold, side); - c2->SaveAs(out_file); - } - delete c2; - - // if (m_combined) { - gStyle->SetTitleFontSize(0.045); - gStyle->SetPadRightMargin(0.13); - gStyle->SetPadBottomMargin(0.15); - gStyle->SetPadLeftMargin(0.1); - gStyle->SetOptStat(0); - xsiz = 700; - ysiz = 600; - TCanvas* c1 = new TCanvas("c1", "Fitted const in each tower", xsiz, ysiz); - const_eta_phi->GetXaxis()->SetTitle("#eta"); - const_eta_phi->GetXaxis()->SetTitleSize(0.065); - const_eta_phi->GetXaxis()->SetTitleOffset(0.85); //6); - const_eta_phi->GetXaxis()->CenterTitle(); - const_eta_phi->GetXaxis()->SetLabelSize(0.045); - const_eta_phi->GetXaxis()->SetLabelOffset(0.01); - - const_eta_phi->GetYaxis()->SetTitle("#phi"); - const_eta_phi->GetYaxis()->SetTitleSize(0.075); - const_eta_phi->GetYaxis()->SetTitleOffset(0.5); - const_eta_phi->GetYaxis()->CenterTitle(); - const_eta_phi->GetYaxis()->SetLabelSize(0.045); - const_eta_phi->GetYaxis()->SetLabelOffset(0.01); - - const_eta_phi->Draw("colz"); - sprintf(out_file, "high_hoconst_eta_phi_%i.jpg", irunold); - c1->SaveAs(out_file); - - delete c1; - - for (int jk = 0; jk < netamx; jk++) { - int ieta = (jk < 15) ? jk + 1 : 14 - jk; - if (rms_phi[jk] > 0) { - mean_phi_ave->Fill(ieta, mean_phi[jk] / rms_phi[jk]); - mean_phi_ave->SetBinError(mean_phi_ave->FindBin(ieta), pow(double(rms_phi[jk]), -0.5)); - } - } - - for (int ij = 0; ij < nphimx; ij++) { - if (rms_eta[ij] > 0) { - mean_eta_ave->Fill(ij + 1, mean_eta[ij] / rms_eta[ij]); - mean_eta_ave->SetBinError(mean_eta_ave->FindBin(ij + 1), pow(double(rms_eta[ij]), -0.5)); - } - } - - ysiz = 450; - gStyle->SetPadLeftMargin(0.13); - gStyle->SetPadRightMargin(0.03); - - TCanvas* c2y = new TCanvas("c2", "Avearge signal in eta and phi", xsiz, ysiz); - c2y->Divide(2, 1); - mean_eta_ave->GetXaxis()->SetTitle("#phi"); - mean_eta_ave->GetXaxis()->SetTitleSize(0.085); - mean_eta_ave->GetXaxis()->SetTitleOffset(0.65); - mean_eta_ave->GetXaxis()->CenterTitle(); - mean_eta_ave->GetXaxis()->SetLabelSize(0.05); - mean_eta_ave->GetXaxis()->SetLabelOffset(0.001); - - mean_eta_ave->GetYaxis()->SetTitle("Signal (GeV)/MIP"); - mean_eta_ave->GetYaxis()->SetTitleSize(0.055); - mean_eta_ave->GetYaxis()->SetTitleOffset(1.3); - mean_eta_ave->GetYaxis()->CenterTitle(); - mean_eta_ave->GetYaxis()->SetLabelSize(0.045); - mean_eta_ave->GetYaxis()->SetLabelOffset(0.01); - mean_eta_ave->SetMarkerSize(0.60); - mean_eta_ave->SetMarkerColor(2); - mean_eta_ave->SetMarkerStyle(20); - - c2y->cd(1); - mean_eta_ave->Draw(); - - mean_phi_ave->GetXaxis()->SetTitle("#eta"); - mean_phi_ave->GetXaxis()->SetTitleSize(0.085); - mean_phi_ave->GetXaxis()->SetTitleOffset(0.65); //55); - mean_phi_ave->GetXaxis()->CenterTitle(); - mean_phi_ave->GetXaxis()->SetLabelSize(0.05); - mean_phi_ave->GetXaxis()->SetLabelOffset(0.001); - - mean_phi_ave->GetYaxis()->SetTitle("Signal (GeV)/MIP"); - mean_phi_ave->GetYaxis()->SetTitleSize(0.055); - mean_phi_ave->GetYaxis()->SetTitleOffset(1.3); - mean_phi_ave->GetYaxis()->CenterTitle(); - mean_phi_ave->GetYaxis()->SetLabelSize(0.045); - mean_phi_ave->GetYaxis()->SetLabelOffset(0.01); - mean_phi_ave->SetMarkerSize(0.60); - mean_phi_ave->SetMarkerColor(2); - mean_phi_ave->SetMarkerStyle(20); - - c2y->cd(2); - mean_phi_ave->Draw(); - - sprintf(out_file, "high_hoaverage_eta_phi_%i.jpg", irunold); - c2y->SaveAs(out_file); - - delete c2y; - // } else { //m_combined - - xsiz = 800; - ysiz = 450; - TCanvas* c3 = new TCanvas("c3", "Avearge signal in eta and phi", xsiz, ysiz); - c3->Divide(2, 1); - mean_phi_hst->GetXaxis()->SetTitle("#eta"); - mean_phi_hst->GetXaxis()->SetTitleSize(0.065); - mean_phi_hst->GetXaxis()->SetTitleOffset(0.9); - mean_phi_hst->GetXaxis()->CenterTitle(); - mean_phi_hst->GetXaxis()->SetLabelSize(0.065); - mean_phi_hst->GetXaxis()->SetLabelOffset(0.001); - - mean_phi_hst->GetYaxis()->SetTitle("GeV/MIP"); - mean_phi_hst->GetYaxis()->SetTitleSize(0.055); - mean_phi_hst->GetYaxis()->SetTitleOffset(0.9); - mean_phi_hst->GetYaxis()->CenterTitle(); - mean_phi_hst->GetYaxis()->SetLabelSize(0.065); - mean_phi_hst->GetYaxis()->SetLabelOffset(0.01); - - mean_phi_hst->SetMarkerColor(4); - mean_phi_hst->SetMarkerSize(0.8); - mean_phi_hst->SetMarkerStyle(20); - mean_phi_hst->Draw(); - - sprintf(out_file, "low_mean_phi_hst_%i.jpg", irunold); - c3->SaveAs(out_file); - - delete c3; - - // } //m_combined - - gStyle->SetOptLogy(1); - gStyle->SetPadTopMargin(.1); - gStyle->SetPadLeftMargin(.15); - xsiz = 800; - ysiz = 500; - TCanvas* c0x = new TCanvas("c0x", "Signal in each ring", xsiz, ysiz); - - c0x->Divide(3, 2); - for (int ij = 0; ij < ringmx; ij++) { - int iread = (ij == 2) ? routmx : rout12mx; - com_sigrsg[ij][iread]->GetXaxis()->SetTitle("Signal/ped (GeV)"); - - com_sigrsg[ij][iread]->GetXaxis()->SetTitleSize(0.060); - com_sigrsg[ij][iread]->GetXaxis()->SetTitleOffset(1.05); - com_sigrsg[ij][iread]->GetXaxis()->CenterTitle(); - com_sigrsg[ij][iread]->GetXaxis()->SetLabelSize(0.065); - com_sigrsg[ij][iread]->GetXaxis()->SetLabelOffset(0.01); - - com_sigrsg[ij][iread]->GetYaxis()->SetLabelSize(0.065); - com_sigrsg[ij][iread]->GetYaxis()->SetLabelOffset(0.01); - - com_sigrsg[ij][iread]->SetLineWidth(3); - com_sigrsg[ij][iread]->SetLineColor(4); - - c0x->cd(ij + 1); - com_sigrsg[ij][iread]->Draw(); - - com_crossg[ij][iread]->SetLineWidth(2); - com_crossg[ij][iread]->SetLineColor(2); - com_crossg[ij][iread]->Draw("same"); - } - sprintf(out_file, "hosig_ring_%i.jpg", irunold); - c0x->SaveAs(out_file); - delete c0x; - - gStyle->SetTitleFontSize(0.06); - gStyle->SetOptStat(0); - gStyle->SetOptLogy(0); - - TCanvas* c0 = new TCanvas("c0", "Signal in each ring", xsiz, ysiz); - - c0->Divide(3, 2); - for (int jk = 0; jk < ringmx; jk++) { - peak_hpdrm[jk]->GetXaxis()->SetTitle("RM #"); - peak_hpdrm[jk]->GetXaxis()->SetTitleSize(0.070); - peak_hpdrm[jk]->GetXaxis()->SetTitleOffset(1.0); - peak_hpdrm[jk]->GetXaxis()->CenterTitle(); - peak_hpdrm[jk]->GetXaxis()->SetLabelSize(0.065); - peak_hpdrm[jk]->GetXaxis()->SetLabelOffset(0.01); - - peak_hpdrm[jk]->GetYaxis()->SetTitle("Peak(GeV)/MIP"); - - peak_hpdrm[jk]->GetYaxis()->SetTitleSize(0.07); - peak_hpdrm[jk]->GetYaxis()->SetTitleOffset(1.3); - peak_hpdrm[jk]->GetYaxis()->CenterTitle(); - peak_hpdrm[jk]->GetYaxis()->SetLabelSize(0.065); - peak_hpdrm[jk]->GetYaxis()->SetLabelOffset(0.01); - peak_hpdrm[jk]->SetMarkerSize(0.60); - peak_hpdrm[jk]->SetMarkerColor(2); - peak_hpdrm[jk]->SetMarkerStyle(20); - - c0->cd(jk + 1); - peak_hpdrm[jk]->Draw(); - } - sprintf(out_file, "comb_peak_hpdrm_%i.jpg", irunold); - c0->SaveAs(out_file); - - delete c0; - - TCanvas* c1y = new TCanvas("c1y", "Signal in each ring", xsiz, ysiz); - - c1y->Divide(3, 2); - for (int jk = 0; jk < ringmx; jk++) { - const_hpdrm[jk]->GetXaxis()->SetTitle("RM #"); - const_hpdrm[jk]->GetXaxis()->SetTitleSize(0.070); - const_hpdrm[jk]->GetXaxis()->SetTitleOffset(1.3); - const_hpdrm[jk]->GetXaxis()->CenterTitle(); - const_hpdrm[jk]->GetXaxis()->SetLabelSize(0.065); - const_hpdrm[jk]->GetXaxis()->SetLabelOffset(0.01); - - const_hpdrm[jk]->GetYaxis()->SetTitle("Peak(GeV)"); - const_hpdrm[jk]->GetYaxis()->SetTitleSize(0.065); - const_hpdrm[jk]->GetYaxis()->SetTitleOffset(1.0); - const_hpdrm[jk]->GetYaxis()->CenterTitle(); - const_hpdrm[jk]->GetYaxis()->SetLabelSize(0.065); - const_hpdrm[jk]->GetYaxis()->SetLabelOffset(0.01); - const_hpdrm[jk]->SetMarkerSize(0.60); - const_hpdrm[jk]->SetMarkerColor(2); - const_hpdrm[jk]->SetMarkerStyle(20); - - c1y->cd(jk + 1); - const_hpdrm[jk]->Draw(); - } - - sprintf(out_file, "comb_const_hpdrm_%i.jpg", irunold); - c1y->SaveAs(out_file); - - delete c1y; - } - - } // if (m_constant){ - - if (m_figure) { - for (int ij = 0; ij < nphimx; ij++) { - for (int jk = 0; jk < netamx; jk++) { - stat_eta[jk]->Fill(ij + 1, sigrsg[jk][ij]->GetEntries()); - statmn_eta[jk]->Fill(ij + 1, sigrsg[jk][ij]->GetMean()); - } - } - - xsiz = 700; - ysiz = 450; - gStyle->SetTitleFontSize(0.09); - gStyle->SetPadBottomMargin(0.14); - gStyle->SetPadLeftMargin(0.17); - gStyle->SetPadRightMargin(0.01); - gStyle->SetNdivisions(303, "XY"); - gStyle->SetOptLogy(1); - - TCanvas* c2x = new TCanvas("c2x", "runfile", xsiz, ysiz); - c2x->Divide(5, 3); - for (int side = 0; side < 2; side++) { - int nmn = 0; - int nmx = netamx / 2; - if (side == 1) { - nmn = netamx / 2; - nmx = netamx; - } - int nzone = 0; - char name[200]; - - for (int ij = nmn; ij < nmx; ij++) { - int ieta = (ij < 15) ? ij + 1 : 14 - ij; - c2x->cd(nzone + 1); - sprintf(name, "GeV(#eta=%i)", ieta); - sigrsg[ij][nphimx]->GetXaxis()->SetTitle(name); - sigrsg[ij][nphimx]->GetXaxis()->SetTitleSize(.08); - sigrsg[ij][nphimx]->GetXaxis()->CenterTitle(); - sigrsg[ij][nphimx]->GetXaxis()->SetTitleOffset(0.90); - sigrsg[ij][nphimx]->GetXaxis()->SetLabelSize(.08); - sigrsg[ij][nphimx]->GetXaxis()->SetLabelOffset(.01); - - sigrsg[ij][nphimx]->GetYaxis()->SetLabelSize(.08); - sigrsg[ij][nphimx]->GetYaxis()->SetLabelOffset(.01); - sigrsg[ij][nphimx]->SetLineWidth(2); - sigrsg[ij][nphimx]->SetLineColor(4); - sigrsg[ij][nphimx]->Draw(); - crossg[ij][nphimx]->SetLineWidth(2); - crossg[ij][nphimx]->SetLineColor(2); - crossg[ij][nphimx]->Draw("same"); - nzone++; - } - - sprintf(out_file, "sig_ho_%i_side%i.eps", irunold, side); - c2x->SaveAs(out_file); - - sprintf(out_file, "sig_ho_%i_side%i.jpg", irunold, side); - c2x->SaveAs(out_file); - } - - gStyle->SetOptLogy(0); - c2x = new TCanvas("c2x", "runfile", xsiz, ysiz); - c2x->Divide(5, 3); - for (int side = 0; side < 2; side++) { - int nmn = 0; - int nmx = netamx / 2; - if (side == 1) { - nmn = netamx / 2; - nmx = netamx; - } - int nzone = 0; - - nzone = 0; - for (int ij = nmn; ij < nmx; ij++) { - c2x->cd(nzone + 1); - statmn_eta[ij]->SetLineWidth(2); - statmn_eta[ij]->SetLineColor(4); - statmn_eta[ij]->GetXaxis()->SetTitle("#phi index"); - statmn_eta[ij]->GetXaxis()->SetTitleSize(.08); - statmn_eta[ij]->GetXaxis()->CenterTitle(); - statmn_eta[ij]->GetXaxis()->SetTitleOffset(0.9); - statmn_eta[ij]->GetYaxis()->SetLabelSize(.08); - statmn_eta[ij]->GetYaxis()->SetLabelOffset(.01); - statmn_eta[ij]->GetXaxis()->SetLabelSize(.08); - statmn_eta[ij]->GetXaxis()->SetLabelOffset(.01); - statmn_eta[ij]->GetYaxis()->SetTitle("GeV"); - statmn_eta[ij]->GetYaxis()->SetTitleSize(.075); - statmn_eta[ij]->GetYaxis()->CenterTitle(); - statmn_eta[ij]->GetYaxis()->SetTitleOffset(1.30); - - statmn_eta[ij]->Draw(); - nzone++; - } - - sprintf(out_file, "statmnho_%i_side%i.eps", irunold, side); - c2x->SaveAs(out_file); - - sprintf(out_file, "statmnho_%i_side%i.jpg", irunold, side); - c2x->SaveAs(out_file); - - gStyle->SetOptLogy(1); - gStyle->SetNdivisions(203, "XY"); - - nzone = 0; - for (int ij = nmn; ij < nmx; ij++) { - c2x->cd(nzone + 1); - stat_eta[ij]->SetLineWidth(2); - stat_eta[ij]->SetLineColor(4); - stat_eta[ij]->GetXaxis()->SetTitle("#phi index"); - stat_eta[ij]->GetXaxis()->SetTitleSize(.08); - stat_eta[ij]->GetXaxis()->CenterTitle(); - stat_eta[ij]->GetXaxis()->SetTitleOffset(0.80); - stat_eta[ij]->GetXaxis()->SetLabelSize(.08); - stat_eta[ij]->GetXaxis()->SetLabelOffset(.01); - stat_eta[ij]->GetYaxis()->SetLabelSize(.08); - stat_eta[ij]->GetYaxis()->SetLabelOffset(.01); - - stat_eta[ij]->Draw(); - nzone++; - } - - sprintf(out_file, "statho_%i_side%i.eps", irunold, side); - c2x->SaveAs(out_file); - - sprintf(out_file, "statho_%i_side%i.jpg", irunold, side); - c2x->SaveAs(out_file); - } - delete c2x; - - } //if (m_figure) { - - if (!m_constant) { //m_constant - for (int jk = 0; jk < netamx; jk++) { - for (int ij = 0; ij < nphimx; ij++) { - if (crossg[jk][ij]) { - delete crossg[jk][ij]; - } - if (sigrsg[jk][ij]) { - delete sigrsg[jk][ij]; - } - } - } - } + } //if (isCosMu) } //define this as a plug-in diff --git a/Calibration/HcalCalibAlgos/plugins/HcalCalibrator.cc b/Calibration/HcalCalibAlgos/plugins/HcalCalibrator.cc index fe1556c135f89..70775cffe4496 100644 --- a/Calibration/HcalCalibAlgos/plugins/HcalCalibrator.cc +++ b/Calibration/HcalCalibAlgos/plugins/HcalCalibrator.cc @@ -27,30 +27,85 @@ to the actual calibration code in "endJob()". #include #include #include +#include // user include files -#include "Calibration/HcalCalibAlgos/plugins/HcalCalibrator.h" #include "Calibration/HcalCalibAlgos/interface/hcalCalib.h" +#include "DataFormats/Common/interface/Handle.h" -#include "FWCore/Framework/interface/Frameworkfwd.h" +#include "FWCore/Framework/interface/one/EDAnalyzer.h" #include "FWCore/Framework/interface/Event.h" - -#include "FWCore/Framework/interface/MakerMacros.h" -#include "FWCore/MessageLogger/interface/MessageLogger.h" -#include "FWCore/ParameterSet/interface/ParameterSet.h" - -//-------------- #include "FWCore/Framework/interface/EventSetup.h" - +#include "FWCore/Framework/interface/Frameworkfwd.h" #include "FWCore/Framework/interface/MakerMacros.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "FWCore/ServiceRegistry/interface/Service.h" -#include "DataFormats/Common/interface/Handle.h" - -#include "TFile.h" +#include "Geometry/CaloTopology/interface/HcalTopology.h" +#include "Geometry/CaloGeometry/interface/CaloGeometry.h" +#include "Geometry/Records/interface/CaloGeometryRecord.h" +#include "Geometry/Records/interface/HcalRecNumberingRecord.h" + +class HcalCalibrator : public edm::one::EDAnalyzer<> { +public: + explicit HcalCalibrator(const edm::ParameterSet&); + ~HcalCalibrator() override; + + // Added for running the CaloTower creation algorithm + +private: + void beginJob() override; + void analyze(const edm::Event&, const edm::EventSetup&) override; + void endJob() override; + + std::string mOutputFile; + std::string mInputFileList; + + std::string mCalibType; + std::string mCalibMethod; + double mMinTargetE; + double mMaxTargetE; + double mMinCellE; + double mMinEOverP; + double mMaxEOverP; + double mMaxTrkEmE; + + double mMaxEtThirdJet; + double mMinDPhiDiJets; + bool mSumDepths; + bool mSumSmallDepths; + bool mCombinePhi; + int mHbClusterSize; + int mHeClusterSize; + + bool mUseConeClustering; + double mMaxConeDist; + + int mCalibAbsIEtaMax; + int mCalibAbsIEtaMin; + + double mMaxProbeJetEmFrac; + double mMaxTagJetEmFrac; + double mMaxTagJetAbsEta; + double mMinTagJetEt; + double mMinProbeJetAbsEta; + + std::string mPhiSymCorFileName; + bool mApplyPhiSymCorFlag; + + std::string mOutputCorCoefFileName; + std::string mHistoFileName; + + edm::ESGetToken tok_geom_; + edm::ESGetToken tok_htopo_; + + const CaloGeometry* mTheCaloGeometry; + const HcalTopology* mTheHcalTopology; + + bool allowMissingInputs_; +}; // constructor diff --git a/Calibration/HcalCalibAlgos/plugins/HcalCalibrator.h b/Calibration/HcalCalibAlgos/plugins/HcalCalibrator.h deleted file mode 100644 index 103ced9f6174a..0000000000000 --- a/Calibration/HcalCalibAlgos/plugins/HcalCalibrator.h +++ /dev/null @@ -1,83 +0,0 @@ -#ifndef HCALCALIBRATOR_H -#define HCALCALIBRATOR_H - -#include - -#include "FWCore/Framework/interface/EDAnalyzer.h" -#include "Geometry/CaloTopology/interface/HcalTopology.h" - -//------------------- -#include "TString.h" -#include "TFile.h" -#include "TTree.h" -#include "TObject.h" -#include "TObjArray.h" -#include "TClonesArray.h" -#include "TRefArray.h" -#include "TLorentzVector.h" -//--------------------- - -#include "Geometry/CaloGeometry/interface/CaloGeometry.h" -#include "Geometry/Records/interface/CaloGeometryRecord.h" -#include "Geometry/Records/interface/HcalRecNumberingRecord.h" - -class HcalCalibrator : public edm::EDAnalyzer { -public: - explicit HcalCalibrator(const edm::ParameterSet&); - ~HcalCalibrator() override; - - // Added for running the CaloTower creation algorithm - -private: - void beginJob() override; - void analyze(const edm::Event&, const edm::EventSetup&) override; - void endJob() override; - - std::string mOutputFile; - std::string mInputFileList; - - std::string mCalibType; - std::string mCalibMethod; - double mMinTargetE; - double mMaxTargetE; - double mMinCellE; - double mMinEOverP; - double mMaxEOverP; - double mMaxTrkEmE; - - double mMaxEtThirdJet; - double mMinDPhiDiJets; - bool mSumDepths; - bool mSumSmallDepths; - bool mCombinePhi; - int mHbClusterSize; - int mHeClusterSize; - - bool mUseConeClustering; - double mMaxConeDist; - - int mCalibAbsIEtaMax; - int mCalibAbsIEtaMin; - - double mMaxProbeJetEmFrac; - double mMaxTagJetEmFrac; - double mMaxTagJetAbsEta; - double mMinTagJetEt; - double mMinProbeJetAbsEta; - - std::string mPhiSymCorFileName; - bool mApplyPhiSymCorFlag; - - std::string mOutputCorCoefFileName; - std::string mHistoFileName; - - edm::ESGetToken tok_geom_; - edm::ESGetToken tok_htopo_; - - const CaloGeometry* mTheCaloGeometry; - const HcalTopology* mTheHcalTopology; - - bool allowMissingInputs_; -}; - -#endif diff --git a/Calibration/HcalCalibAlgos/plugins/HcalHBHEMuonAnalyzer.cc b/Calibration/HcalCalibAlgos/plugins/HcalHBHEMuonAnalyzer.cc index 28cc1e077cc72..6c16fb5dd00b8 100644 --- a/Calibration/HcalCalibAlgos/plugins/HcalHBHEMuonAnalyzer.cc +++ b/Calibration/HcalCalibAlgos/plugins/HcalHBHEMuonAnalyzer.cc @@ -130,37 +130,37 @@ class HcalHBHEMuonAnalyzer : public edm::one::EDAnalyzer muon_is_good_, muon_global_, muon_tracker_; - std::vector muon_is_tight_, muon_is_medium_; - std::vector ptGlob_, etaGlob_, phiGlob_, energyMuon_, pMuon_; - std::vector muon_trkKink, muon_chi2LocalPosition, muon_segComp; - std::vector trackerLayer_, numPixelLayers_, tight_PixelHits_; - std::vector innerTrack_, outerTrack_, globalTrack_; - std::vector chiTracker_, dxyTracker_, dzTracker_; - std::vector innerTrackpt_, innerTracketa_, innerTrackphi_; - std::vector tight_validFraction_, outerTrackChi_; - std::vector outerTrackPt_, outerTrackEta_, outerTrackPhi_; - std::vector outerTrackHits_, outerTrackRHits_; - std::vector globalTrckPt_, globalTrckEta_, globalTrckPhi_; - std::vector globalMuonHits_, matchedStat_; - std::vector chiGlobal_, tight_LongPara_, tight_TransImpara_; - std::vector isolationR04_, isolationR03_; - std::vector ecalEnergy_, hcalEnergy_, hoEnergy_; - std::vector matchedId_, hcalHot_; - std::vector ecal3x3Energy_, hcal1x1Energy_; - std::vector ecalDetId_, hcalDetId_, ehcalDetId_; - std::vector hcal_ieta_, hcal_iphi_; - std::vector hcalDepthEnergy_[depthMax_]; - std::vector hcalDepthActiveLength_[depthMax_]; - std::vector hcalDepthEnergyHot_[depthMax_]; - std::vector hcalDepthActiveLengthHot_[depthMax_]; - std::vector hcalDepthChargeHot_[depthMax_]; - std::vector hcalDepthChargeHotBG_[depthMax_]; - std::vector hcalDepthEnergyCorr_[depthMax_]; - std::vector hcalDepthEnergyHotCorr_[depthMax_]; - std::vector hcalDepthMatch_[depthMax_]; - std::vector hcalDepthMatchHot_[depthMax_]; - std::vector hcalActiveLength_, hcalActiveLengthHot_; + bool muon_is_good_, muon_global_, muon_tracker_; + bool muon_is_tight_, muon_is_medium_; + double ptGlob_, etaGlob_, phiGlob_, energyMuon_, pMuon_; + float muon_trkKink_, muon_chi2LocalPosition_, muon_segComp_; + int trackerLayer_, numPixelLayers_, tight_PixelHits_; + bool innerTrack_, outerTrack_, globalTrack_; + double chiTracker_, dxyTracker_, dzTracker_; + double innerTrackpt_, innerTracketa_, innerTrackphi_; + double tight_validFraction_, outerTrackChi_; + double outerTrackPt_, outerTrackEta_, outerTrackPhi_; + int outerTrackHits_, outerTrackRHits_; + double globalTrckPt_, globalTrckEta_, globalTrckPhi_; + int globalMuonHits_, matchedStat_; + double chiGlobal_, tight_LongPara_, tight_TransImpara_; + double isolationR04_, isolationR03_; + double ecalEnergy_, hcalEnergy_, hoEnergy_; + bool matchedId_, hcalHot_; + double ecal3x3Energy_, hcal1x1Energy_; + unsigned int ecalDetId_, hcalDetId_, ehcalDetId_; + int hcal_ieta_, hcal_iphi_; + double hcalDepthEnergy_[depthMax_]; + double hcalDepthActiveLength_[depthMax_]; + double hcalDepthEnergyHot_[depthMax_]; + double hcalDepthActiveLengthHot_[depthMax_]; + double hcalDepthChargeHot_[depthMax_]; + double hcalDepthChargeHotBG_[depthMax_]; + double hcalDepthEnergyCorr_[depthMax_]; + double hcalDepthEnergyHotCorr_[depthMax_]; + bool hcalDepthMatch_[depthMax_]; + bool hcalDepthMatchHot_[depthMax_]; + double hcalActiveLength_, hcalActiveLengthHot_; std::vector all_triggers_; std::vector hltresults_; @@ -260,6 +260,37 @@ HcalHBHEMuonAnalyzer::HcalHBHEMuonAnalyzer(const edm::ParameterSet& iConfig) void HcalHBHEMuonAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) { ++kount_; clearVectors(); + std::vector muon_is_good, muon_global, muon_tracker; + std::vector muon_is_tight, muon_is_medium; + std::vector ptGlob, etaGlob, phiGlob, energyMuon, pMuon; + std::vector muon_trkKink, muon_chi2LocalPosition, muon_segComp; + std::vector trackerLayer, numPixelLayers, tight_PixelHits; + std::vector innerTrack, outerTrack, globalTrack; + std::vector chiTracker, dxyTracker, dzTracker; + std::vector innerTrackpt, innerTracketa, innerTrackphi; + std::vector tight_validFraction, outerTrackChi; + std::vector outerTrackPt, outerTrackEta, outerTrackPhi; + std::vector outerTrackHits, outerTrackRHits; + std::vector globalTrckPt, globalTrckEta, globalTrckPhi; + std::vector globalMuonHits, matchedStat; + std::vector chiGlobal, tight_LongPara, tight_TransImpara; + std::vector isolationR04, isolationR03; + std::vector ecalEnergy, hcalEnergy, hoEnergy; + std::vector matchedId, hcalHot; + std::vector ecal3x3Energy, hcal1x1Energy; + std::vector ecalDetId, hcalDetId, ehcalDetId; + std::vector hcal_ieta, hcal_iphi; + std::vector hcalDepthEnergy[depthMax_]; + std::vector hcalDepthActiveLength[depthMax_]; + std::vector hcalDepthEnergyHot[depthMax_]; + std::vector hcalDepthActiveLengthHot[depthMax_]; + std::vector hcalDepthChargeHot[depthMax_]; + std::vector hcalDepthChargeHotBG[depthMax_]; + std::vector hcalDepthEnergyCorr[depthMax_]; + std::vector hcalDepthEnergyHotCorr[depthMax_]; + std::vector hcalDepthMatch[depthMax_]; + std::vector hcalDepthMatchHot[depthMax_]; + std::vector hcalActiveLength, hcalActiveLengthHot; runNumber_ = iEvent.id().run(); eventNumber_ = iEvent.id().event(); lumiNumber_ = iEvent.id().luminosityBlock(); @@ -272,12 +303,12 @@ void HcalHBHEMuonAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSet iEvent.getByToken(tok_trigRes_, _Triggers); #ifdef EDM_ML_DEBUG if ((verbosity_ / 10000) % 10 > 0) - edm::LogVerbatim("HBHEMuon") << "Size of all triggers " << all_triggers_.size() << std::endl; + edm::LogVerbatim("HBHEMuon") << "Size of all triggers " << all_triggers_.size(); #endif int Ntriggers = all_triggers_.size(); #ifdef EDM_ML_DEBUG if ((verbosity_ / 10000) % 10 > 0) - edm::LogVerbatim("HBHEMuon") << "Size of HLT MENU: " << _Triggers->size() << std::endl; + edm::LogVerbatim("HBHEMuon") << "Size of HLT MENU: " << _Triggers->size(); #endif if (_Triggers.isValid()) { const edm::TriggerNames& triggerNames_ = iEvent.triggerNames(*_Triggers); @@ -287,19 +318,19 @@ void HcalHBHEMuonAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSet int triggerSize = int(_Triggers->size()); #ifdef EDM_ML_DEBUG if ((verbosity_ / 10000) % 10 > 0) - edm::LogVerbatim("HBHEMuon") << "outside loop " << index[i] << "\ntriggerSize " << triggerSize << std::endl; + edm::LogVerbatim("HBHEMuon") << "outside loop " << index[i] << "\ntriggerSize " << triggerSize; #endif if (index[i] < triggerSize) { hltresults_.push_back(_Triggers->accept(index[i])); #ifdef EDM_ML_DEBUG if ((verbosity_ / 10000) % 10 > 0) edm::LogVerbatim("HBHEMuon") << "Trigger_info " << triggerSize << " triggerSize " << index[i] - << " trigger_index " << hltresults_.at(i) << " hltresult" << std::endl; + << " trigger_index " << hltresults_.at(i) << " hltresult"; #endif } else { if ((verbosity_ / 10000) % 10 > 0) edm::LogVerbatim("HBHEMuon") << "Requested HLT path \"" - << "\" does not exist\n"; + << "\" does not exist"; } } } @@ -331,7 +362,7 @@ void HcalHBHEMuonAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSet goodVertex_ = 0; if (!vtx.isValid()) { #ifdef EDM_ML_DEBUG - edm::LogVerbatim("HBHEMuon") << "No Good Vertex found == Reject\n"; + edm::LogVerbatim("HBHEMuon") << "No Good Vertex found == Reject"; #endif return; } @@ -349,109 +380,109 @@ void HcalHBHEMuonAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSet bool accept(false); if (_Muon.isValid() && barrelRecHitsHandle.isValid() && endcapRecHitsHandle.isValid() && hbhe.isValid()) { for (reco::MuonCollection::const_iterator RecMuon = _Muon->begin(); RecMuon != _Muon->end(); ++RecMuon) { - muon_is_good_.push_back(RecMuon->isPFMuon()); - muon_global_.push_back(RecMuon->isGlobalMuon()); - muon_tracker_.push_back(RecMuon->isTrackerMuon()); - ptGlob_.push_back((RecMuon)->pt()); - etaGlob_.push_back(RecMuon->eta()); - phiGlob_.push_back(RecMuon->phi()); - energyMuon_.push_back(RecMuon->energy()); - pMuon_.push_back(RecMuon->p()); + muon_is_good.push_back(RecMuon->isPFMuon()); + muon_global.push_back(RecMuon->isGlobalMuon()); + muon_tracker.push_back(RecMuon->isTrackerMuon()); + ptGlob.push_back((RecMuon)->pt()); + etaGlob.push_back(RecMuon->eta()); + phiGlob.push_back(RecMuon->phi()); + energyMuon.push_back(RecMuon->energy()); + pMuon.push_back(RecMuon->p()); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("HBHEMuon") << "Energy:" << RecMuon->energy() << " P:" << RecMuon->p() << std::endl; + edm::LogVerbatim("HBHEMuon") << "Energy:" << RecMuon->energy() << " P:" << RecMuon->p(); #endif - muon_is_tight_.push_back(muon::isTightMuon(*RecMuon, *firstGoodVertex)); - muon_is_medium_.push_back(muon::isMediumMuon(*RecMuon)); + muon_is_tight.push_back(muon::isTightMuon(*RecMuon, *firstGoodVertex)); + muon_is_medium.push_back(muon::isMediumMuon(*RecMuon)); muon_trkKink.push_back(RecMuon->combinedQuality().trkKink); muon_chi2LocalPosition.push_back(RecMuon->combinedQuality().chi2LocalPosition); muon_segComp.push_back(muon::segmentCompatibility(*RecMuon)); // acessing tracker hits info if (RecMuon->track().isNonnull()) { - trackerLayer_.push_back(RecMuon->track()->hitPattern().trackerLayersWithMeasurement()); + trackerLayer.push_back(RecMuon->track()->hitPattern().trackerLayersWithMeasurement()); } else { - trackerLayer_.push_back(-1); + trackerLayer.push_back(-1); } if (RecMuon->innerTrack().isNonnull()) { - innerTrack_.push_back(true); - numPixelLayers_.push_back(RecMuon->innerTrack()->hitPattern().pixelLayersWithMeasurement()); - chiTracker_.push_back(RecMuon->innerTrack()->normalizedChi2()); - dxyTracker_.push_back(fabs(RecMuon->innerTrack()->dxy(pvx))); - dzTracker_.push_back(fabs(RecMuon->innerTrack()->dz(pvx))); - innerTrackpt_.push_back(RecMuon->innerTrack()->pt()); - innerTracketa_.push_back(RecMuon->innerTrack()->eta()); - innerTrackphi_.push_back(RecMuon->innerTrack()->phi()); - tight_PixelHits_.push_back(RecMuon->innerTrack()->hitPattern().numberOfValidPixelHits()); - tight_validFraction_.push_back(RecMuon->innerTrack()->validFraction()); + innerTrack.push_back(true); + numPixelLayers.push_back(RecMuon->innerTrack()->hitPattern().pixelLayersWithMeasurement()); + chiTracker.push_back(RecMuon->innerTrack()->normalizedChi2()); + dxyTracker.push_back(fabs(RecMuon->innerTrack()->dxy(pvx))); + dzTracker.push_back(fabs(RecMuon->innerTrack()->dz(pvx))); + innerTrackpt.push_back(RecMuon->innerTrack()->pt()); + innerTracketa.push_back(RecMuon->innerTrack()->eta()); + innerTrackphi.push_back(RecMuon->innerTrack()->phi()); + tight_PixelHits.push_back(RecMuon->innerTrack()->hitPattern().numberOfValidPixelHits()); + tight_validFraction.push_back(RecMuon->innerTrack()->validFraction()); } else { - innerTrack_.push_back(false); - numPixelLayers_.push_back(0); - chiTracker_.push_back(0); - dxyTracker_.push_back(0); - dzTracker_.push_back(0); - innerTrackpt_.push_back(0); - innerTracketa_.push_back(0); - innerTrackphi_.push_back(0); - tight_PixelHits_.push_back(0); - tight_validFraction_.push_back(-99); + innerTrack.push_back(false); + numPixelLayers.push_back(0); + chiTracker.push_back(0); + dxyTracker.push_back(0); + dzTracker.push_back(0); + innerTrackpt.push_back(0); + innerTracketa.push_back(0); + innerTrackphi.push_back(0); + tight_PixelHits.push_back(0); + tight_validFraction.push_back(-99); } // outer track info if (RecMuon->outerTrack().isNonnull()) { - outerTrack_.push_back(true); - outerTrackPt_.push_back(RecMuon->outerTrack()->pt()); - outerTrackEta_.push_back(RecMuon->outerTrack()->eta()); - outerTrackPhi_.push_back(RecMuon->outerTrack()->phi()); - outerTrackChi_.push_back(RecMuon->outerTrack()->normalizedChi2()); - outerTrackHits_.push_back(RecMuon->outerTrack()->numberOfValidHits()); - outerTrackRHits_.push_back(RecMuon->outerTrack()->recHitsSize()); + outerTrack.push_back(true); + outerTrackPt.push_back(RecMuon->outerTrack()->pt()); + outerTrackEta.push_back(RecMuon->outerTrack()->eta()); + outerTrackPhi.push_back(RecMuon->outerTrack()->phi()); + outerTrackChi.push_back(RecMuon->outerTrack()->normalizedChi2()); + outerTrackHits.push_back(RecMuon->outerTrack()->numberOfValidHits()); + outerTrackRHits.push_back(RecMuon->outerTrack()->recHitsSize()); } else { - outerTrack_.push_back(false); - outerTrackPt_.push_back(0); - outerTrackEta_.push_back(0); - outerTrackPhi_.push_back(0); - outerTrackChi_.push_back(0); - outerTrackHits_.push_back(0); - outerTrackRHits_.push_back(0); + outerTrack.push_back(false); + outerTrackPt.push_back(0); + outerTrackEta.push_back(0); + outerTrackPhi.push_back(0); + outerTrackChi.push_back(0); + outerTrackHits.push_back(0); + outerTrackRHits.push_back(0); } // Tight Muon cuts if (RecMuon->globalTrack().isNonnull()) { - globalTrack_.push_back(true); - chiGlobal_.push_back(RecMuon->globalTrack()->normalizedChi2()); - globalMuonHits_.push_back(RecMuon->globalTrack()->hitPattern().numberOfValidMuonHits()); - matchedStat_.push_back(RecMuon->numberOfMatchedStations()); - globalTrckPt_.push_back(RecMuon->globalTrack()->pt()); - globalTrckEta_.push_back(RecMuon->globalTrack()->eta()); - globalTrckPhi_.push_back(RecMuon->globalTrack()->phi()); - tight_TransImpara_.push_back(fabs(RecMuon->muonBestTrack()->dxy(pvx))); - tight_LongPara_.push_back(fabs(RecMuon->muonBestTrack()->dz(pvx))); + globalTrack.push_back(true); + chiGlobal.push_back(RecMuon->globalTrack()->normalizedChi2()); + globalMuonHits.push_back(RecMuon->globalTrack()->hitPattern().numberOfValidMuonHits()); + matchedStat.push_back(RecMuon->numberOfMatchedStations()); + globalTrckPt.push_back(RecMuon->globalTrack()->pt()); + globalTrckEta.push_back(RecMuon->globalTrack()->eta()); + globalTrckPhi.push_back(RecMuon->globalTrack()->phi()); + tight_TransImpara.push_back(fabs(RecMuon->muonBestTrack()->dxy(pvx))); + tight_LongPara.push_back(fabs(RecMuon->muonBestTrack()->dz(pvx))); } else { - globalTrack_.push_back(false); - chiGlobal_.push_back(0); - globalMuonHits_.push_back(0); - matchedStat_.push_back(0); - globalTrckPt_.push_back(0); - globalTrckEta_.push_back(0); - globalTrckPhi_.push_back(0); - tight_TransImpara_.push_back(0); - tight_LongPara_.push_back(0); + globalTrack.push_back(false); + chiGlobal.push_back(0); + globalMuonHits.push_back(0); + matchedStat.push_back(0); + globalTrckPt.push_back(0); + globalTrckEta.push_back(0); + globalTrckPhi.push_back(0); + tight_TransImpara.push_back(0); + tight_LongPara.push_back(0); } - isolationR04_.push_back( + isolationR04.push_back( ((RecMuon->pfIsolationR04().sumChargedHadronPt + std::max(0., RecMuon->pfIsolationR04().sumNeutralHadronEt + RecMuon->pfIsolationR04().sumPhotonEt - (0.5 * RecMuon->pfIsolationR04().sumPUPt))) / RecMuon->pt())); - isolationR03_.push_back( + isolationR03.push_back( ((RecMuon->pfIsolationR03().sumChargedHadronPt + std::max(0., RecMuon->pfIsolationR03().sumNeutralHadronEt + RecMuon->pfIsolationR03().sumPhotonEt - (0.5 * RecMuon->pfIsolationR03().sumPUPt))) / RecMuon->pt())); - ecalEnergy_.push_back(RecMuon->calEnergy().emS9); - hcalEnergy_.push_back(RecMuon->calEnergy().hadS9); - hoEnergy_.push_back(RecMuon->calEnergy().hoS9); + ecalEnergy.push_back(RecMuon->calEnergy().emS9); + hcalEnergy.push_back(RecMuon->calEnergy().hadS9); + hoEnergy.push_back(RecMuon->calEnergy().hoS9); double eEcal(0), eHcal(0), activeLengthTot(0), activeLengthHotTot(0); double eHcalDepth[depthMax_], eHcalDepthHot[depthMax_]; @@ -476,9 +507,9 @@ void HcalHBHEMuonAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSet if ((RecMuon->p() > 10.0) && (trackID.okHCAL)) accept = true; - ecalDetId_.push_back((trackID.detIdECAL)()); - hcalDetId_.push_back((trackID.detIdHCAL)()); - ehcalDetId_.push_back((trackID.detIdEHCAL)()); + ecalDetId.push_back((trackID.detIdECAL)()); + hcalDetId.push_back((trackID.detIdHCAL)()); + ehcalDetId.push_back((trackID.detIdEHCAL)()); HcalDetId check; std::pair info = spr::propagateHCALBack(pTrack, geo_, bField, (((verbosity_ / 100) % 10 > 0))); @@ -750,40 +781,110 @@ void HcalHBHEMuonAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSet #endif } else { - ecalDetId_.push_back(0); - hcalDetId_.push_back(0); - ehcalDetId_.push_back(0); + ecalDetId.push_back(0); + hcalDetId.push_back(0); + ehcalDetId.push_back(0); } - matchedId_.push_back(tmpmatch); - ecal3x3Energy_.push_back(eEcal); - hcal1x1Energy_.push_back(eHcal); - hcal_ieta_.push_back(ieta); - hcal_iphi_.push_back(iphi); + matchedId.push_back(tmpmatch); + ecal3x3Energy.push_back(eEcal); + hcal1x1Energy.push_back(eHcal); + hcal_ieta.push_back(ieta); + hcal_iphi.push_back(iphi); for (int i = 0; i < depthMax_; ++i) { - hcalDepthEnergy_[i].push_back(eHcalDepth[i]); - hcalDepthActiveLength_[i].push_back(activeL[i]); - hcalDepthEnergyHot_[i].push_back(eHcalDepthHot[i]); - hcalDepthActiveLengthHot_[i].push_back(activeHotL[i]); - hcalDepthEnergyCorr_[i].push_back(eHcalDepthC[i]); - hcalDepthEnergyHotCorr_[i].push_back(eHcalDepthHotC[i]); - hcalDepthChargeHot_[i].push_back(cHcalDepthHot[i]); - hcalDepthChargeHotBG_[i].push_back(cHcalDepthHotBG[i]); - hcalDepthMatch_[i].push_back(matchDepth[i]); - hcalDepthMatchHot_[i].push_back(matchDepthHot[i]); + hcalDepthEnergy[i].push_back(eHcalDepth[i]); + hcalDepthActiveLength[i].push_back(activeL[i]); + hcalDepthEnergyHot[i].push_back(eHcalDepthHot[i]); + hcalDepthActiveLengthHot[i].push_back(activeHotL[i]); + hcalDepthEnergyCorr[i].push_back(eHcalDepthC[i]); + hcalDepthEnergyHotCorr[i].push_back(eHcalDepthHotC[i]); + hcalDepthChargeHot[i].push_back(cHcalDepthHot[i]); + hcalDepthChargeHotBG[i].push_back(cHcalDepthHotBG[i]); + hcalDepthMatch[i].push_back(matchDepth[i]); + hcalDepthMatchHot[i].push_back(matchDepthHot[i]); } - hcalActiveLength_.push_back(activeLengthTot); - hcalHot_.push_back(isHot); - hcalActiveLengthHot_.push_back(activeLengthHotTot); + hcalActiveLength.push_back(activeLengthTot); + hcalHot.push_back(isHot); + hcalActiveLengthHot.push_back(activeLengthHotTot); } } if (accept) { #ifdef EDM_ML_DEBUG - for (unsigned int i = 0; i < hcal_ieta_.size(); ++i) + for (unsigned int i = 0; i < hcal_ieta.size(); ++i) edm::LogVerbatim("HBHEMuon") << "[" << i << "] ieta/iphi for entry to " - << "HCAL has value of " << hcal_ieta_[i] << ":" << hcal_iphi_[i]; + << "HCAL has value of " << hcal_ieta[i] << ":" << hcal_iphi[i]; #endif - tree_->Fill(); + for (unsigned int k = 0; k < muon_is_good.size(); ++k) { + muon_is_good_ = muon_is_good[k]; + muon_global_ = muon_global[k]; + muon_tracker_ = muon_tracker[k]; + muon_is_tight_ = muon_is_tight[k]; + muon_is_medium_ = muon_is_medium[k]; + ptGlob_ = ptGlob[k]; + etaGlob_ = etaGlob[k]; + phiGlob_ = phiGlob[k]; + energyMuon_ = energyMuon[k]; + pMuon_ = pMuon[k]; + muon_trkKink_ = muon_trkKink[k]; + muon_chi2LocalPosition_ = muon_chi2LocalPosition[k]; + muon_segComp_ = muon_segComp[k]; + trackerLayer_ = trackerLayer[k]; + numPixelLayers_ = numPixelLayers[k]; + tight_PixelHits_ = tight_PixelHits[k]; + innerTrack_ = innerTrack[k]; + outerTrack_ = outerTrack[k]; + globalTrack_ = globalTrack[k]; + chiTracker_ = chiTracker[k]; + dxyTracker_ = dxyTracker[k]; + dzTracker_ = dzTracker[k]; + innerTrackpt_ = innerTrackpt[k]; + innerTracketa_ = innerTracketa[k]; + innerTrackphi_ = innerTrackphi[k]; + tight_validFraction_ = tight_validFraction[k]; + outerTrackChi_ = outerTrackChi[k]; + outerTrackPt_ = outerTrackPt[k]; + outerTrackEta_ = outerTrackEta[k]; + outerTrackPhi_ = outerTrackPhi[k]; + outerTrackHits_ = outerTrackHits[k]; + outerTrackRHits_ = outerTrackRHits[k]; + globalTrckPt_ = globalTrckPt[k]; + globalTrckEta_ = globalTrckEta[k]; + globalTrckPhi_ = globalTrckPhi[k]; + globalMuonHits_ = globalMuonHits[k]; + matchedStat_ = matchedStat[k]; + chiGlobal_ = chiGlobal[k]; + tight_LongPara_ = tight_LongPara[k]; + tight_TransImpara_ = tight_TransImpara[k]; + isolationR04_ = isolationR04[k]; + isolationR03_ = isolationR03[k]; + ecalEnergy_ = ecalEnergy[k]; + hcalEnergy_ = hcalEnergy[k]; + hoEnergy_ = hoEnergy[k]; + matchedId_ = matchedId[k]; + hcalHot_ = hcalHot[k]; + ecal3x3Energy_ = ecal3x3Energy[k]; + hcal1x1Energy_ = hcal1x1Energy[k]; + ecalDetId_ = ecalDetId[k]; + hcalDetId_ = hcalDetId[k]; + ehcalDetId_ = ehcalDetId[k]; + hcal_ieta_ = hcal_ieta[k]; + hcal_iphi_ = hcal_iphi[k]; + for (int i = 0; i < depthMax_; ++i) { + hcalDepthEnergy_[i] = hcalDepthEnergy[i][k]; + hcalDepthActiveLength_[i] = hcalDepthActiveLength[i][k]; + hcalDepthEnergyHot_[i] = hcalDepthEnergyHot[i][k]; + hcalDepthActiveLengthHot_[i] = hcalDepthActiveLengthHot[i][k]; + hcalDepthChargeHot_[i] = hcalDepthChargeHot[i][k]; + hcalDepthChargeHotBG_[i] = hcalDepthChargeHotBG[i][k]; + hcalDepthEnergyCorr_[i] = hcalDepthEnergyCorr[i][k]; + hcalDepthEnergyHotCorr_[i] = hcalDepthEnergyHotCorr[i][k]; + hcalDepthMatch_[i] = hcalDepthMatch[i][k]; + hcalDepthMatchHot_[i] = hcalDepthMatchHot[i][k]; + } + hcalActiveLength_ = hcalActiveLength[k]; + hcalActiveLengthHot_ = hcalActiveLengthHot[k]; + tree_->Fill(); + } } } @@ -805,9 +906,9 @@ void HcalHBHEMuonAnalyzer::beginJob() { tree_->Branch("phi_of_muon", &phiGlob_); tree_->Branch("energy_of_muon", &energyMuon_); tree_->Branch("p_of_muon", &pMuon_); - tree_->Branch("muon_trkKink", &muon_trkKink); - tree_->Branch("muon_chi2LocalPosition", &muon_chi2LocalPosition); - tree_->Branch("muon_segComp", &muon_segComp); + tree_->Branch("muon_trkKink", &muon_trkKink_); + tree_->Branch("muon_chi2LocalPosition", &muon_chi2LocalPosition_); + tree_->Branch("muon_segComp", &muon_segComp_); tree_->Branch("TrackerLayer", &trackerLayer_); tree_->Branch("NumPixelLayers", &numPixelLayers_); @@ -998,78 +1099,78 @@ void HcalHBHEMuonAnalyzer::clearVectors() { bxNumber_ = -99999; goodVertex_ = -99999; - muon_is_good_.clear(); - muon_global_.clear(); - muon_tracker_.clear(); - ptGlob_.clear(); - etaGlob_.clear(); - phiGlob_.clear(); - energyMuon_.clear(); - pMuon_.clear(); - muon_trkKink.clear(); - muon_chi2LocalPosition.clear(); - muon_segComp.clear(); - muon_is_tight_.clear(); - muon_is_medium_.clear(); - - trackerLayer_.clear(); - numPixelLayers_.clear(); - tight_PixelHits_.clear(); - innerTrack_.clear(); - chiTracker_.clear(); - dxyTracker_.clear(); - dzTracker_.clear(); - innerTrackpt_.clear(); - innerTracketa_.clear(); - innerTrackphi_.clear(); - tight_validFraction_.clear(); - - outerTrack_.clear(); - outerTrackPt_.clear(); - outerTrackEta_.clear(); - outerTrackPhi_.clear(); - outerTrackHits_.clear(); - outerTrackRHits_.clear(); - outerTrackChi_.clear(); - - globalTrack_.clear(); - globalTrckPt_.clear(); - globalTrckEta_.clear(); - globalTrckPhi_.clear(); - globalMuonHits_.clear(); - matchedStat_.clear(); - chiGlobal_.clear(); - tight_LongPara_.clear(); - tight_TransImpara_.clear(); - - isolationR04_.clear(); - isolationR03_.clear(); - ecalEnergy_.clear(); - hcalEnergy_.clear(); - hoEnergy_.clear(); - matchedId_.clear(); - hcalHot_.clear(); - ecal3x3Energy_.clear(); - hcal1x1Energy_.clear(); - ecalDetId_.clear(); - hcalDetId_.clear(); - ehcalDetId_.clear(); - hcal_ieta_.clear(); - hcal_iphi_.clear(); + muon_is_good_ = false; + muon_global_ = false; + muon_tracker_ = false; + ptGlob_ = 0; + etaGlob_ = 0; + phiGlob_ = 0; + energyMuon_ = 0; + pMuon_ = 0; + muon_trkKink_ = 0; + muon_chi2LocalPosition_ = 0; + muon_segComp_ = 0; + muon_is_tight_ = false; + muon_is_medium_ = false; + + trackerLayer_ = 0; + numPixelLayers_ = 0; + tight_PixelHits_ = 0; + innerTrack_ = false; + chiTracker_ = 0; + dxyTracker_ = 0; + dzTracker_ = 0; + innerTrackpt_ = 0; + innerTracketa_ = 0; + innerTrackphi_ = 0; + tight_validFraction_ = 0; + + outerTrack_ = false; + outerTrackPt_ = 0; + outerTrackEta_ = 0; + outerTrackPhi_ = 0; + outerTrackHits_ = 0; + outerTrackRHits_ = 0; + outerTrackChi_ = 0; + + globalTrack_ = false; + globalTrckPt_ = 0; + globalTrckEta_ = 0; + globalTrckPhi_ = 0; + globalMuonHits_ = 0; + matchedStat_ = 0; + chiGlobal_ = 0; + tight_LongPara_ = 0; + tight_TransImpara_ = 0; + + isolationR04_ = 0; + isolationR03_ = 0; + ecalEnergy_ = 0; + hcalEnergy_ = 0; + hoEnergy_ = 0; + matchedId_ = false; + hcalHot_ = false; + ecal3x3Energy_ = 0; + hcal1x1Energy_ = 0; + ecalDetId_ = 0; + hcalDetId_ = 0; + ehcalDetId_ = 0; + hcal_ieta_ = 0; + hcal_iphi_ = 0; for (int i = 0; i < maxDepth_; ++i) { - hcalDepthEnergy_[i].clear(); - hcalDepthActiveLength_[i].clear(); - hcalDepthEnergyHot_[i].clear(); - hcalDepthActiveLengthHot_[i].clear(); - hcalDepthChargeHot_[i].clear(); - hcalDepthChargeHotBG_[i].clear(); - hcalDepthEnergyCorr_[i].clear(); - hcalDepthEnergyHotCorr_[i].clear(); - hcalDepthMatch_[i].clear(); - hcalDepthMatchHot_[i].clear(); + hcalDepthEnergy_[i] = 0; + hcalDepthActiveLength_[i] = 0; + hcalDepthEnergyHot_[i] = 0; + hcalDepthActiveLengthHot_[i] = 0; + hcalDepthChargeHot_[i] = 0; + hcalDepthChargeHotBG_[i] = 0; + hcalDepthEnergyCorr_[i] = 0; + hcalDepthEnergyHotCorr_[i] = 0; + hcalDepthMatch_[i] = false; + hcalDepthMatchHot_[i] = false; } - hcalActiveLength_.clear(); - hcalActiveLengthHot_.clear(); + hcalActiveLength_ = 0; + hcalActiveLengthHot_ = 0; hltresults_.clear(); } diff --git a/Calibration/HcalCalibAlgos/plugins/HcalIsoTrackAnalyzer.cc b/Calibration/HcalCalibAlgos/plugins/HcalIsoTrackAnalyzer.cc new file mode 100644 index 0000000000000..3a8256c648cd3 --- /dev/null +++ b/Calibration/HcalCalibAlgos/plugins/HcalIsoTrackAnalyzer.cc @@ -0,0 +1,297 @@ +// system include files +#include +#include +#include +#include +#include + +// Root objects +#include "TROOT.h" +#include "TSystem.h" +#include "TFile.h" +#include "TProfile.h" +#include "TDirectory.h" +#include "TTree.h" +#include "TLorentzVector.h" +#include "TInterpreter.h" + +#include "DataFormats/HcalCalibObjects/interface/HcalIsoTrkCalibVariables.h" +#include "DataFormats/HcalCalibObjects/interface/HcalIsoTrkEventVariables.h" + +#include "FWCore/Framework/interface/Frameworkfwd.h" +#include "FWCore/Framework/interface/one/EDAnalyzer.h" + +#include "FWCore/Framework/interface/Event.h" +#include "FWCore/Framework/interface/MakerMacros.h" +#include "FWCore/ServiceRegistry/interface/Service.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "CommonTools/UtilAlgos/interface/TFileService.h" + +//#define EDM_ML_DEBUG + +class HcalIsoTrackAnalyzer : public edm::one::EDAnalyzer { +public: + explicit HcalIsoTrackAnalyzer(edm::ParameterSet const&); + ~HcalIsoTrackAnalyzer() override {} + + static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); + +private: + void analyze(edm::Event const&, edm::EventSetup const&) override; + void beginJob() override; + void beginRun(edm::Run const&, edm::EventSetup const&) override {} + void endRun(edm::Run const&, edm::EventSetup const&) override; + + edm::Service fs; + const double pTrackLow_, pTrackHigh_; + const int useRaw_, dataType_; + const edm::InputTag labelIsoTkVar_, labelIsoTkEvt_; + edm::EDGetTokenT tokIsoTrkVar_; + edm::EDGetTokenT tokIsoTrkEvt_; + unsigned int nRun_, nRange_, nLow_, nHigh_; + + TTree *tree, *tree2; + int t_Run, t_Event, t_DataType, t_ieta, t_iphi; + int t_goodPV, t_nVtx, t_nTrk; + double t_EventWeight, t_p, t_pt, t_phi; + double t_l1pt, t_l1eta, t_l1phi; + double t_l3pt, t_l3eta, t_l3phi; + double t_mindR1, t_mindR2; + double t_eMipDR, t_eMipDR2, t_eMipDR3, t_eMipDR4; + double t_eMipDR5, t_hmaxNearP, t_gentrackP; + double t_emaxNearP, t_eAnnular, t_hAnnular; + double t_eHcal, t_eHcal10, t_eHcal30, t_rhoh; + bool t_selectTk, t_qltyFlag, t_qltyMissFlag, t_qltyPVFlag; + std::vector t_DetIds, t_DetIds1, t_DetIds3; + std::vector t_HitEnergies, t_HitEnergies1, t_HitEnergies3; + std::vector t_trgbits; + + unsigned int t_RunNo, t_EventNo; + bool t_TrigPass, t_TrigPassSel, t_L1Bit; + int t_Tracks, t_TracksProp, t_TracksSaved; + int t_TracksLoose, t_TracksTight, t_allvertex; + std::vector t_ietaAll, t_ietaGood, t_trackType; + std::vector t_hltbits; +}; + +HcalIsoTrackAnalyzer::HcalIsoTrackAnalyzer(const edm::ParameterSet& iConfig) + : pTrackLow_(iConfig.getParameter("momentumLow")), + pTrackHigh_(iConfig.getParameter("momentumHigh")), + useRaw_(iConfig.getUntrackedParameter("useRaw", 0)), + dataType_(iConfig.getUntrackedParameter("dataType", 0)), + labelIsoTkVar_(iConfig.getParameter("isoTrackVarLabel")), + labelIsoTkEvt_(iConfig.getParameter("isoTrackEvtLabel")), + tokIsoTrkVar_(consumes(labelIsoTkVar_)), + tokIsoTrkEvt_(consumes(labelIsoTkEvt_)), + nRun_(0), + nRange_(0), + nLow_(0), + nHigh_(0) { + usesResource(TFileService::kSharedResource); + + //now do whatever initialization is needed + edm::LogVerbatim("HcalIsoTrack") << "Labels used " << labelIsoTkVar_ << " " << labelIsoTkEvt_; + + edm::LogVerbatim("HcalIsoTrack") << "Parameters read from config file \n\t momentumLow_ " << pTrackLow_ + << "\t momentumHigh_ " << pTrackHigh_ << "\t useRaw_ " << useRaw_ + << "\t dataType_ " << dataType_; +} + +void HcalIsoTrackAnalyzer::analyze(edm::Event const& iEvent, edm::EventSetup const& iSetup) { + t_Run = iEvent.id().run(); + t_Event = iEvent.id().event(); + t_DataType = dataType_; +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("HcalIsoTrack") << "Run " << t_Run << " Event " << t_Event << " type " << t_DataType + << " Luminosity " << iEvent.luminosityBlock() << " Bunch " << iEvent.bunchCrossing(); +#endif + + // Fill from IsoTrkCalibVariables collection + auto const& isotrkCalibColl = iEvent.getHandle(tokIsoTrkVar_); + if (isotrkCalibColl.isValid()) { + auto isotrkCalib = isotrkCalibColl.product(); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("HcalIsoTrack") << "Finds HcalIsoTrkCalibVariablesCollection with " << isotrkCalib->size() + << " entries"; +#endif + for (auto itr = isotrkCalib->begin(); itr != isotrkCalib->end(); ++itr) { + t_ieta = itr->ieta_; + t_iphi = itr->iphi_; + t_goodPV = itr->goodPV_; + t_nVtx = itr->nVtx_; + t_nTrk = itr->nTrk_; + t_EventWeight = itr->eventWeight_; + t_p = itr->p_; + t_pt = itr->pt_; + t_phi = itr->phi_; + t_l1pt = itr->l1pt_; + t_l1eta = itr->l1eta_; + t_l1phi = itr->l1phi_; + t_l3pt = itr->l3pt_; + t_l3eta = itr->l3eta_; + t_l3phi = itr->l3phi_; + t_mindR1 = itr->mindR1_; + t_mindR2 = itr->mindR2_; + t_eMipDR = itr->eMipDR_[0]; + t_eMipDR2 = itr->eMipDR_[1]; + t_eMipDR3 = itr->eMipDR_[2]; + t_eMipDR4 = itr->eMipDR_[3]; + t_eMipDR5 = itr->eMipDR_[4]; + t_hmaxNearP = itr->hmaxNearP_; + t_gentrackP = itr->gentrackP_; + t_emaxNearP = itr->emaxNearP_; + t_eAnnular = itr->eAnnular_; + t_hAnnular = itr->hAnnular_; + t_rhoh = itr->rhoh_; + t_selectTk = itr->selectTk_; + t_qltyFlag = itr->qltyFlag_; + t_qltyMissFlag = itr->qltyMissFlag_; + t_qltyPVFlag = itr->qltyPVFlag_; + t_trgbits = itr->trgbits_; + t_eHcal = itr->eHcal_; + t_eHcal10 = itr->eHcal10_; + t_eHcal30 = itr->eHcal30_; + t_DetIds = itr->detIds_; + t_DetIds1 = itr->detIds1_; + t_DetIds3 = itr->detIds3_; + t_HitEnergies = itr->hitEnergies_; + t_HitEnergies1 = itr->hitEnergies1_; + t_HitEnergies3 = itr->hitEnergies3_; + tree->Fill(); + + if (t_p < pTrackLow_) { + ++nLow_; + } else if (t_p < pTrackHigh_) { + ++nHigh_; + } else { + ++nRange_; + } + } + } else { + edm::LogVerbatim("HcalIsoTrack") << "Cannot find HcalIsoTrkCalibVariablesCollection"; + } + + // Fill from IsoTrkEventVariables collection + auto const& isotrkEventColl = iEvent.getHandle(tokIsoTrkEvt_); + if (isotrkEventColl.isValid()) { + auto isotrkEvent = isotrkEventColl.product(); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("HcalIsoTrack") << "Finds HcalIsoTrkEventVariablesCollection with " << isotrkEvent->size() + << " entries"; +#endif + auto itr = isotrkEvent->begin(); + if (itr != isotrkEvent->end()) { + t_RunNo = iEvent.id().run(); + t_EventNo = iEvent.id().event(); + t_TrigPass = itr->trigPass_; + t_TrigPassSel = itr->trigPassSel_; + t_L1Bit = itr->l1Bit_; + t_Tracks = itr->tracks_; + t_TracksProp = itr->tracksProp_; + t_TracksSaved = itr->tracksSaved_; + t_TracksLoose = itr->tracksLoose_; + t_TracksTight = itr->tracksTight_; + t_allvertex = itr->allvertex_; + t_ietaAll = itr->ietaAll_; + t_ietaGood = itr->ietaGood_; + t_trackType = itr->trackType_; + t_hltbits = itr->hltbits_; + tree2->Fill(); + } + } else { + edm::LogVerbatim("HcalIsoTrack") << "Cannot find HcalIsoTrkEventVariablesCollections"; + } +} + +void HcalIsoTrackAnalyzer::beginJob() { + tree = fs->make("CalibTree", "CalibTree"); + + tree->Branch("t_Run", &t_Run, "t_Run/I"); + tree->Branch("t_Event", &t_Event, "t_Event/I"); + tree->Branch("t_DataType", &t_DataType, "t_DataType/I"); + tree->Branch("t_ieta", &t_ieta, "t_ieta/I"); + tree->Branch("t_iphi", &t_iphi, "t_iphi/I"); + tree->Branch("t_EventWeight", &t_EventWeight, "t_EventWeight/D"); + tree->Branch("t_nVtx", &t_nVtx, "t_nVtx/I"); + tree->Branch("t_nTrk", &t_nTrk, "t_nTrk/I"); + tree->Branch("t_goodPV", &t_goodPV, "t_goodPV/I"); + tree->Branch("t_l1pt", &t_l1pt, "t_l1pt/D"); + tree->Branch("t_l1eta", &t_l1eta, "t_l1eta/D"); + tree->Branch("t_l1phi", &t_l1phi, "t_l1phi/D"); + tree->Branch("t_l3pt", &t_l3pt, "t_l3pt/D"); + tree->Branch("t_l3eta", &t_l3eta, "t_l3eta/D"); + tree->Branch("t_l3phi", &t_l3phi, "t_l3phi/D"); + tree->Branch("t_p", &t_p, "t_p/D"); + tree->Branch("t_pt", &t_pt, "t_pt/D"); + tree->Branch("t_phi", &t_phi, "t_phi/D"); + tree->Branch("t_mindR1", &t_mindR1, "t_mindR1/D"); + tree->Branch("t_mindR2", &t_mindR2, "t_mindR2/D"); + tree->Branch("t_eMipDR", &t_eMipDR, "t_eMipDR/D"); + tree->Branch("t_eMipDR2", &t_eMipDR2, "t_eMipDR2/D"); + tree->Branch("t_eMipDR3", &t_eMipDR3, "t_eMipDR3/D"); + tree->Branch("t_eMipDR4", &t_eMipDR4, "t_eMipDR4/D"); + tree->Branch("t_eMipDR5", &t_eMipDR5, "t_eMipDR5/D"); + tree->Branch("t_eHcal", &t_eHcal, "t_eHcal/D"); + tree->Branch("t_eHcal10", &t_eHcal10, "t_eHcal10/D"); + tree->Branch("t_eHcal30", &t_eHcal30, "t_eHcal30/D"); + tree->Branch("t_hmaxNearP", &t_hmaxNearP, "t_hmaxNearP/D"); + tree->Branch("t_emaxNearP", &t_emaxNearP, "t_emaxNearP/D"); + tree->Branch("t_eAnnular", &t_eAnnular, "t_eAnnular/D"); + tree->Branch("t_hAnnular", &t_hAnnular, "t_hAnnular/D"); + tree->Branch("t_rhoh", &t_rhoh, "t_rhoh/D"); + tree->Branch("t_selectTk", &t_selectTk, "t_selectTk/O"); + tree->Branch("t_qltyFlag", &t_qltyFlag, "t_qltyFlag/O"); + tree->Branch("t_qltyMissFlag", &t_qltyMissFlag, "t_qltyMissFlag/O"); + tree->Branch("t_qltyPVFlag", &t_qltyPVFlag, "t_qltyPVFlag/O"); + tree->Branch("t_gentrackP", &t_gentrackP, "t_gentrackP/D"); + + tree->Branch("t_DetIds", &t_DetIds); + tree->Branch("t_HitEnergies", &t_HitEnergies); + tree->Branch("t_trgbits", &t_trgbits); + tree->Branch("t_DetIds1", &t_DetIds1); + tree->Branch("t_DetIds3", &t_DetIds3); + tree->Branch("t_HitEnergies1", &t_HitEnergies1); + tree->Branch("t_HitEnergies3", &t_HitEnergies3); + + tree2 = fs->make("EventInfo", "Event Information"); + + tree2->Branch("t_RunNo", &t_RunNo, "t_RunNo/i"); + tree2->Branch("t_EventNo", &t_EventNo, "t_EventNo/i"); + tree2->Branch("t_Tracks", &t_Tracks, "t_Tracks/I"); + tree2->Branch("t_TracksProp", &t_TracksProp, "t_TracksProp/I"); + tree2->Branch("t_TracksSaved", &t_TracksSaved, "t_TracksSaved/I"); + tree2->Branch("t_TracksLoose", &t_TracksLoose, "t_TracksLoose/I"); + tree2->Branch("t_TracksTight", &t_TracksTight, "t_TracksTight/I"); + tree2->Branch("t_TrigPass", &t_TrigPass, "t_TrigPass/O"); + tree2->Branch("t_TrigPassSel", &t_TrigPassSel, "t_TrigPassSel/O"); + tree2->Branch("t_L1Bit", &t_L1Bit, "t_L1Bit/O"); + tree2->Branch("t_allvertex", &t_allvertex, "t_allvertex/I"); + tree2->Branch("t_ietaAll", &t_ietaAll); + tree2->Branch("t_ietaGood", &t_ietaGood); + tree2->Branch("t_trackType", &t_trackType); + tree2->Branch("t_hltbits", &t_hltbits); +} + +// ------------ method called when starting to processes a run ------------ + +// ------------ method called when ending the processing of a run ------------ +void HcalIsoTrackAnalyzer::endRun(edm::Run const& iRun, edm::EventSetup const&) { + nRun_++; + edm::LogVerbatim("HcalIsoTrack") << "endRun[" << nRun_ << "] " << iRun.run() << " with " << nLow_ + << " events with p < " << pTrackLow_ << ", " << nHigh_ << " events with p > " + << pTrackHigh_ << ", and " << nRange_ << " events in the right momentum range"; +} + +void HcalIsoTrackAnalyzer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { + edm::ParameterSetDescription desc; + desc.add("momentumLow", 40.0); + desc.add("momentumHigh", 60.0); + desc.addUntracked("useRaw", 0); + desc.addUntracked("dataType", 0); + desc.add("isoTrackVarLabel", edm::InputTag("alcaHcalIsotrkProducer", "HcalIsoTrack")); + desc.add("isoTrackEvtLabel", edm::InputTag("alcaHcalIsotrkProducer", "HcalIsoTrackEvent")); + descriptions.add("hcalIsoTrackAnalyzer", desc); +} + +//define this as a plug-in +DEFINE_FWK_MODULE(HcalIsoTrackAnalyzer); diff --git a/Calibration/HcalCalibAlgos/plugins/HcalIsoTrkAnalyzer.cc b/Calibration/HcalCalibAlgos/plugins/HcalIsoTrkAnalyzer.cc index 8bbed91e23e8d..7c7912a00a3e4 100644 --- a/Calibration/HcalCalibAlgos/plugins/HcalIsoTrkAnalyzer.cc +++ b/Calibration/HcalCalibAlgos/plugins/HcalIsoTrkAnalyzer.cc @@ -411,9 +411,7 @@ void HcalIsoTrkAnalyzer::analyze(edm::Event const& iEvent, edm::EventSetup const const CaloGeometry* geo = &iSetup.getData(tok_geom_); const CaloTopology* caloTopology = &iSetup.getData(tok_caloTopology_); const HcalTopology* theHBHETopology = &iSetup.getData(tok_htopo_); - const HcalRespCorrs* resp = &iSetup.getData(tok_resp_); - HcalRespCorrs* respCorrs = new HcalRespCorrs(*resp); - respCorrs->setTopo(theHBHETopology); + const HcalRespCorrs* respCorrs = &iSetup.getData(tok_resp_); //=== genParticle information edm::Handle genParticles; @@ -939,9 +937,13 @@ std::array HcalIsoTrkAnalyzer::fillTree(std::vectortrkItr)); math::XYZTLorentzVector v4(pTrack->px(), pTrack->py(), pTrack->pz(), pTrack->p()); + t_p = pTrack->p(); + t_pt = pTrack->pt(); + t_phi = pTrack->phi(); + #ifdef EDM_ML_DEBUG - edm::LogVerbatim("HcalIsoTrack") << "This track : " << nTracks << " (pt|eta|phi|p) :" << pTrack->pt() << "|" - << pTrack->eta() << "|" << pTrack->phi() << "|" << pTrack->p(); + edm::LogVerbatim("HcalIsoTrack") << "This track : " << nTracks << " (pt|eta|phi|p) :" << t_pt << "|" + << pTrack->eta() << "|" << t_phi << "|" << t_p; #endif t_mindR2 = 999; for (unsigned int k = 0; k < vecL3.size(); ++k) { @@ -954,6 +956,7 @@ std::array HcalIsoTrkAnalyzer::fillTree(std::vectorokHCAL) { HcalDetId detId = (HcalDetId)(trkDetItr->detIdHCAL); @@ -1209,10 +1212,6 @@ std::array HcalIsoTrkAnalyzer::fillTree(std::vectorp(); - t_pt = pTrack->pt(); - t_phi = pTrack->phi(); - #ifdef EDM_ML_DEBUG edm::LogVerbatim("HcalIsoTrack") << "This track : " << nTracks << " (pt|eta|phi|p) :" << t_pt << "|" << pTrack->eta() << "|" << t_phi << "|" << t_p << " Generator Level p " diff --git a/Calibration/HcalCalibAlgos/plugins/HitReCalibrator.cc b/Calibration/HcalCalibAlgos/plugins/HitReCalibrator.cc index 04de1ebaf9861..325aeb5905076 100644 --- a/Calibration/HcalCalibAlgos/plugins/HitReCalibrator.cc +++ b/Calibration/HcalCalibAlgos/plugins/HitReCalibrator.cc @@ -1,13 +1,59 @@ -#include "Calibration/HcalCalibAlgos/plugins/HitReCalibrator.h" -#include "FWCore/MessageLogger/interface/MessageLogger.h" -#include "DataFormats/GeometryVector/interface/GlobalPoint.h" +// system include files +#include +#include + +// user include files +#include "DataFormats/Common/interface/Ref.h" +#include "DataFormats/CaloTowers/interface/CaloTowerCollection.h" #include "DataFormats/CaloTowers/interface/CaloTowerDetId.h" #include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h" +#include "DataFormats/HcalRecHit/interface/HcalRecHitCollections.h" +#include "DataFormats/DetId/interface/DetId.h" +#include "DataFormats/GeometryVector/interface/GlobalPoint.h" + +#include "CondFormats/HcalObjects/interface/HcalRespCorrs.h" +#include "CondFormats/DataRecord/interface/HcalRespCorrsRcd.h" + +#include "FWCore/Framework/interface/Frameworkfwd.h" +#include "FWCore/Framework/interface/one/EDProducer.h" +#include "FWCore/Framework/interface/Event.h" +#include "FWCore/Framework/interface/MakerMacros.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/Framework/interface/EventSetup.h" +#include "FWCore/MessageLogger/interface/MessageLogger.h" #include "RecoTracker/TrackProducer/interface/TrackProducerBase.h" #include "TrackingTools/TransientTrack/interface/TransientTrack.h" #include "DataFormats/JetReco/interface/CaloJetCollection.h" #include "FWCore/Utilities/interface/Exception.h" +// +// class declaration +// + +namespace cms { + + class HitReCalibrator : public edm::one::EDProducer<> { + public: + explicit HitReCalibrator(const edm::ParameterSet&); + ~HitReCalibrator() override; + + void beginJob() override; + + void produce(edm::Event&, const edm::EventSetup&) override; + + private: + // ----------member data --------------------------- + + bool allowMissingInputs_; + + edm::EDGetTokenT tok_hbhe_; + edm::EDGetTokenT tok_ho_; + edm::EDGetTokenT tok_hf_; + + edm::ESGetToken tok_resp_; + }; +} // end namespace cms + namespace cms { HitReCalibrator::HitReCalibrator(const edm::ParameterSet& iConfig) { diff --git a/Calibration/HcalCalibAlgos/plugins/HitReCalibrator.h b/Calibration/HcalCalibAlgos/plugins/HitReCalibrator.h deleted file mode 100644 index e7781f71811d1..0000000000000 --- a/Calibration/HcalCalibAlgos/plugins/HitReCalibrator.h +++ /dev/null @@ -1,57 +0,0 @@ -#ifndef HitReCalibrator_h -#define HitReCalibrator_h - -// -*- C++ -*- - -// system include files -#include -#include -// user include files -#include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/EDProducer.h" -#include "FWCore/Framework/interface/Event.h" -#include "FWCore/Framework/interface/MakerMacros.h" -#include "FWCore/ParameterSet/interface/ParameterSet.h" -#include "FWCore/Framework/interface/EventSetup.h" - -#include "DataFormats/Common/interface/Ref.h" -#include "DataFormats/CaloTowers/interface/CaloTowerCollection.h" -#include "DataFormats/DetId/interface/DetId.h" - -#include "DataFormats/HcalRecHit/interface/HcalRecHitCollections.h" -#include "CondFormats/HcalObjects/interface/HcalRespCorrs.h" -#include "CondFormats/DataRecord/interface/HcalRespCorrsRcd.h" - -// -// class declaration -// -namespace edm { - class ParameterSet; - class Event; - class EventSetup; -} // namespace edm - -namespace cms { - - class HitReCalibrator : public edm::EDProducer { - public: - explicit HitReCalibrator(const edm::ParameterSet &); - ~HitReCalibrator() override; - - void beginJob() override; - - void produce(edm::Event &, const edm::EventSetup &) override; - - private: - // ----------member data --------------------------- - - bool allowMissingInputs_; - - edm::EDGetTokenT tok_hbhe_; - edm::EDGetTokenT tok_ho_; - edm::EDGetTokenT tok_hf_; - - edm::ESGetToken tok_resp_; - }; -} // end namespace cms -#endif diff --git a/Calibration/HcalCalibAlgos/src/classes.h b/Calibration/HcalCalibAlgos/src/classes.h index 8a8c57566aad9..a073736f97380 100644 --- a/Calibration/HcalCalibAlgos/src/classes.h +++ b/Calibration/HcalCalibAlgos/src/classes.h @@ -1,4 +1,4 @@ -#include "Calibration/HcalCalibAlgos/src/TCell.h" +#include "Calibration/HcalCalibAlgos/interface/TCell.h" namespace Calibration_HcalCalibAlgos { struct dictionary {}; diff --git a/Calibration/HcalCalibAlgos/src/hcalCalib.cc b/Calibration/HcalCalibAlgos/src/hcalCalib.cc index 1e7d1eaa08bff..8300138eeef0c 100644 --- a/Calibration/HcalCalibAlgos/src/hcalCalib.cc +++ b/Calibration/HcalCalibAlgos/src/hcalCalib.cc @@ -1,5 +1,3 @@ -#define hcalCalib_cxx - // TSelector-based code for getting the HCAL resp. correction // from physics events. Works for DiJet and IsoTrack calibration. // @@ -12,13 +10,8 @@ #include "Calibration/HcalCalibAlgos/interface/hcalCalibUtils.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" -#include -#include -#include "TFile.h" - #include #include - #include #include @@ -29,40 +22,9 @@ #include "Calibration/Tools/interface/MinL3AlgoUniv.h" -#include "TMatrixF.h" -#include "TMatrixD.h" -#include "TDecompSVD.h" -#include "TDecompQRH.h" - #include "DataFormats/DetId/interface/DetId.h" #include "DataFormats/HcalDetId/interface/HcalDetId.h" -UInt_t nEvents; - -TFile* histoFile; - -// sanity check histograms -TH1F* h1_trkP; -TH1F* h1_allTrkP; - -TH1F* h1_selTrkP_iEta10; - -TH1F* h1_rawSumE; -TH1F* h1_rawResp; -TH1F* h1_corResp; -TH1F* h1_rawRespBarrel; -TH1F* h1_corRespBarrel; -TH1F* h1_rawRespEndcap; -TH1F* h1_corRespEndcap; -TH1F* h1_numEventsTwrIEta; - -TH2F* h2_dHitRefBarrel; -TH2F* h2_dHitRefEndcap; - -// histograms based on iEta, iPhi of refPosition forthe cluster (at the moment: hottest tower) -// expect range |iEta|<=24 (to do: add flexibility for arbitrary range) -TH1F* h1_corRespIEta[48]; - void hcalCalib::Begin(TTree* /*tree*/) { TString option = GetOption(); @@ -731,3 +693,57 @@ void hcalCalib::makeTextFile() { return; } + +inline void hcalCalib::Init(TTree* tree) { + // The Init() function is called when the selector needs to initialize + // a new tree or chain. Typically here the branch addresses and branch + // pointers of the tree will be set. + // It is normaly not necessary to make changes to the generated + // code, but the routine can be extended by the user if needed. + // Init() will be called many times when running on PROOF + // (once per file to be processed). + + // Set object pointer + cells = nullptr; + tagJetP4 = nullptr; + probeJetP4 = nullptr; + + // Set branch addresses and branch pointers + if (!tree) + return; + fChain = tree; + + // fChain->SetMakeClass(1); + + fChain->SetBranchAddress("eventNumber", &eventNumber, &b_eventNumber); + fChain->SetBranchAddress("runNumber", &runNumber, &b_runNumber); + fChain->SetBranchAddress("iEtaHit", &iEtaHit, &b_iEtaHit); + fChain->SetBranchAddress("iPhiHit", &iPhiHit, &b_iPhiHit); + fChain->SetBranchAddress("cells", &cells, &b_cells); + fChain->SetBranchAddress("emEnergy", &emEnergy, &b_emEnergy); + fChain->SetBranchAddress("targetE", &targetE, &b_targetE); + fChain->SetBranchAddress("etVetoJet", &etVetoJet, &b_etVetoJet); + + fChain->SetBranchAddress("xTrkHcal", &xTrkHcal, &b_xTrkHcal); + fChain->SetBranchAddress("yTrkHcal", &yTrkHcal, &b_yTrkHcal); + fChain->SetBranchAddress("zTrkHcal", &zTrkHcal, &b_zTrkHcal); + fChain->SetBranchAddress("xTrkEcal", &xTrkEcal, &b_xTrkEcal); + fChain->SetBranchAddress("yTrkEcal", &yTrkEcal, &b_yTrkEcal); + fChain->SetBranchAddress("zTrkEcal", &zTrkEcal, &b_zTrkEcal); + + fChain->SetBranchAddress("tagJetEmFrac", &tagJetEmFrac, &b_tagJetEmFrac); + fChain->SetBranchAddress("probeJetEmFrac", &probeJetEmFrac, &b_probeJetEmFrac); + + fChain->SetBranchAddress("tagJetP4", &tagJetP4, &b_tagJetP4); + fChain->SetBranchAddress("probeJetP4", &probeJetP4, &b_probeJetP4); +} + +inline Bool_t hcalCalib::Notify() { + // The Notify() function is called when a new file is opened. This + // can be either for a new TTree in a TChain or when when a new TTree + // is started when using PROOF. It is normaly not necessary to make changes + // to the generated code, but the routine can be extended by the + // user if needed. The return value is currently not used. + + return kTRUE; +} diff --git a/Calibration/HcalCalibAlgos/test/GammaJetAnalysis.cc b/Calibration/HcalCalibAlgos/test/GammaJetAnalysis.cc index 8a8829ce293ca..809c249e53167 100644 --- a/Calibration/HcalCalibAlgos/test/GammaJetAnalysis.cc +++ b/Calibration/HcalCalibAlgos/test/GammaJetAnalysis.cc @@ -591,10 +591,6 @@ void GammaJetAnalysis::analyze(const edm::Event& iEvent, const edm::EventSetup& edm::Ref photonRef(photons, photon_tag.idx()); HERE(Form("got photon ref, photon_tag.idx()=%d", photon_tag.idx())); -#ifdef EDM_ML_DEBUG - edm::LogVerbatim("GammaJetAnalysis") - << "loosePhotonQual->at(photon_tag.idx())=" << loosePhotonQual->at(photon_tag.idx()); -#endif tagPho_idLoose_ = (loosePhotonQual.isValid()) ? (*loosePhotonQual)[photonRef] : -1; tagPho_idTight_ = (tightPhotonQual.isValid()) ? (*tightPhotonQual)[photonRef] : -1; } else { diff --git a/Calibration/HcalCalibAlgos/test/HcalHBHEMuonSimAnalyzer.cc b/Calibration/HcalCalibAlgos/test/HcalHBHEMuonSimAnalyzer.cc index dd01494dd59cc..f80acf41fb231 100644 --- a/Calibration/HcalCalibAlgos/test/HcalHBHEMuonSimAnalyzer.cc +++ b/Calibration/HcalCalibAlgos/test/HcalHBHEMuonSimAnalyzer.cc @@ -83,15 +83,15 @@ class HcalHBHEMuonSimAnalyzer : public edm::one::EDAnalyzer ptGlob_, etaGlob_, phiGlob_, pMuon_; - std::vector ecal3x3Energy_, hcal1x1Energy_; - std::vector ecalDetId_, hcalDetId_, hcalHot_; - std::vector matchedId_; - std::vector hcalDepthEnergy_[depthMax_]; - std::vector hcalDepthActiveLength_[depthMax_]; - std::vector hcalDepthEnergyHot_[depthMax_]; - std::vector hcalDepthActiveLengthHot_[depthMax_]; - std::vector hcalActiveLength_, hcalActiveLengthHot_; + double ptGlob_, etaGlob_, phiGlob_, pMuon_; + double ecal3x3Energy_, hcal1x1Energy_; + unsigned int ecalDetId_, hcalDetId_, hcalHot_; + double matchedId_; + double hcalDepthEnergy_[depthMax_]; + double hcalDepthActiveLength_[depthMax_]; + double hcalDepthEnergyHot_[depthMax_]; + double hcalDepthActiveLengthHot_[depthMax_]; + double hcalActiveLength_, hcalActiveLengthHot_; }; HcalHBHEMuonSimAnalyzer::HcalHBHEMuonSimAnalyzer(const edm::ParameterSet& iConfig) { @@ -188,6 +188,16 @@ void HcalHBHEMuonSimAnalyzer::analyze(const edm::Event& iEvent, const edm::Event const CaloTopology* caloTopology = &iSetup.getData(tok_caloTopology_); const HcalTopology* theHBHETopology = &iSetup.getData(tok_topo_); + std::vector ptGlob, etaGlob, phiGlob, pMuon; + std::vector ecal3x3Energy, hcal1x1Energy; + std::vector ecalDetId, hcalDetId, hcalHot; + std::vector matchedId; + std::vector hcalDepthEnergy[depthMax_]; + std::vector hcalDepthActiveLength[depthMax_]; + std::vector hcalDepthEnergyHot[depthMax_]; + std::vector hcalDepthActiveLengthHot[depthMax_]; + std::vector hcalActiveLength, hcalActiveLengthHot; + // Loop over all SimTracks for (edm::SimTrackContainer::const_iterator simTrkItr = SimTk->begin(); simTrkItr != SimTk->end(); simTrkItr++) { if ((std::abs(simTrkItr->type()) == idMuon_) && (simTrkItr->vertIndex() == 0) && @@ -223,10 +233,10 @@ void HcalHBHEMuonSimAnalyzer::analyze(const edm::Event& iEvent, const edm::Event if (trkD.okHCAL) { // Muon properties spr::trackAtOrigin tkvx = spr::simTrackAtOrigin(thisTrk, SimTk, SimVtx, debug); - ptGlob_.push_back(tkvx.momentum.perp()); - etaGlob_.push_back(tkvx.momentum.eta()); - phiGlob_.push_back(tkvx.momentum.phi()); - pMuon_.push_back(tkvx.momentum.mag()); + ptGlob.push_back(tkvx.momentum.perp()); + etaGlob.push_back(tkvx.momentum.eta()); + phiGlob.push_back(tkvx.momentum.phi()); + pMuon.push_back(tkvx.momentum.mag()); #ifdef EDM_ML_DEBUG if ((verbosity_ % 10) > 0) edm::LogVerbatim("HBHEMuon") << "Track at vertex " << tkvx.ok << " position " << tkvx.position << " Momentum " @@ -320,24 +330,43 @@ void HcalHBHEMuonSimAnalyzer::analyze(const edm::Event& iEvent, const edm::Event edm::LogVerbatim("HBHEMuon") << "Depth " << k << " E " << eHcalDepth[k] << ":" << eHcalDepthHot[k]; } #endif - matchedId_.push_back(tmpmatch); - ecal3x3Energy_.push_back(eEcal); - ecalDetId_.push_back(isoCell.rawId()); - hcal1x1Energy_.push_back(eHcal); - hcalDetId_.push_back(closestCell.rawId()); + matchedId.push_back(tmpmatch); + ecal3x3Energy.push_back(eEcal); + ecalDetId.push_back(isoCell.rawId()); + hcal1x1Energy.push_back(eHcal); + hcalDetId.push_back(closestCell.rawId()); for (int k = 0; k < depthMax_; ++k) { - hcalDepthEnergy_[k].push_back(eHcalDepth[k]); - hcalDepthActiveLength_[k].push_back(activeL[k]); - hcalDepthEnergyHot_[k].push_back(eHcalDepthHot[k]); - hcalDepthActiveLengthHot_[k].push_back(activeHotL[k]); + hcalDepthEnergy[k].push_back(eHcalDepth[k]); + hcalDepthActiveLength[k].push_back(activeL[k]); + hcalDepthEnergyHot[k].push_back(eHcalDepthHot[k]); + hcalDepthActiveLengthHot[k].push_back(activeHotL[k]); } - hcalHot_.push_back(isHot); - hcalActiveLengthHot_.push_back(activeLengthHotTot); + hcalHot.push_back(isHot); + hcalActiveLengthHot.push_back(activeLengthHotTot); } } } - if (!hcalHot_.empty()) + for (unsigned int k = 0; k < hcalHot.size(); ++k) { + ptGlob_ = ptGlob[k]; + etaGlob_ = etaGlob[k]; + phiGlob_ = phiGlob[k]; + pMuon_ = pMuon[k]; + ecal3x3Energy_ = ecal3x3Energy[k]; + hcal1x1Energy_ = hcal1x1Energy[k]; + ecalDetId_ = ecalDetId[k]; + hcalDetId_ = hcalDetId[k]; + hcalHot_ = hcalHot[k]; + matchedId_ = matchedId[k]; + for (int i = 0; i < depthMax_; ++i) { + hcalDepthEnergy_[i] = hcalDepthEnergy[k][i]; + hcalDepthActiveLength_[i] = hcalDepthActiveLength[k][i]; + hcalDepthEnergyHot_[i] = hcalDepthEnergyHot[k][i]; + hcalDepthActiveLengthHot_[i] = hcalDepthActiveLengthHot[k][i]; + } + hcalActiveLength_ = hcalActiveLength[k]; + hcalActiveLengthHot_ = hcalActiveLengthHot[k]; tree_->Fill(); + } } void HcalHBHEMuonSimAnalyzer::beginJob() { @@ -402,25 +431,6 @@ void HcalHBHEMuonSimAnalyzer::clearVectors() { eventNumber_ = -99999; lumiNumber_ = -99999; bxNumber_ = -99999; - - ptGlob_.clear(); - etaGlob_.clear(); - phiGlob_.clear(); - pMuon_.clear(); - matchedId_.clear(); - ecal3x3Energy_.clear(); - ecalDetId_.clear(); - hcal1x1Energy_.clear(); - hcalDetId_.clear(); - hcalHot_.clear(); - hcalActiveLength_.clear(); - hcalActiveLengthHot_.clear(); - for (int k = 0; k < depthMax_; ++k) { - hcalDepthEnergy_[k].clear(); - hcalDepthActiveLength_[k].clear(); - hcalDepthEnergyHot_[k].clear(); - hcalDepthActiveLengthHot_[k].clear(); - } } unsigned int HcalHBHEMuonSimAnalyzer::matchId(const HcalDetId& id1, const HcalDetId& id2) { diff --git a/Calibration/HcalCalibAlgos/test/HcalIsoTrackStudy.cc b/Calibration/HcalCalibAlgos/test/HcalIsoTrackStudy.cc index 46186a5a906b2..466378445aee8 100644 --- a/Calibration/HcalCalibAlgos/test/HcalIsoTrackStudy.cc +++ b/Calibration/HcalCalibAlgos/test/HcalIsoTrackStudy.cc @@ -186,6 +186,15 @@ class HcalIsoTrackStudy : public edm::one::EDAnalyzer tok_ew_; edm::EDGetTokenT> tok_alg_; + edm::ESGetToken tok_ddrec_; + edm::ESGetToken tok_bFieldH_; + edm::ESGetToken tok_ecalChStatus_; + edm::ESGetToken tok_sevlv_; + edm::ESGetToken tok_geom_; + edm::ESGetToken tok_caloTopology_; + edm::ESGetToken tok_htopo_; + edm::ESGetToken tok_resp_; + TTree *tree, *tree2; unsigned int t_RunNo, t_EventNo; int t_Run, t_Event, t_DataType, t_ieta, t_iphi; @@ -352,6 +361,15 @@ HcalIsoTrackStudy::HcalIsoTrackStudy(const edm::ParameterSet& iConfig) edm::LogVerbatim("HcalIsoTrack") << "Trigger[" << k << "] " << trigNames_[k]; } + tok_ddrec_ = esConsumes(); + tok_bFieldH_ = esConsumes(); + tok_ecalChStatus_ = esConsumes(); + tok_sevlv_ = esConsumes(); + tok_geom_ = esConsumes(); + tok_caloTopology_ = esConsumes(); + tok_htopo_ = esConsumes(); + tok_resp_ = esConsumes(); + for (int i = 0; i < 10; i++) phibins_.push_back(-M_PI + 0.1 * (2 * i + 1) * M_PI); for (int i = 0; i < 8; ++i) @@ -382,35 +400,15 @@ void HcalIsoTrackStudy::analyze(edm::Event const& iEvent, edm::EventSetup const& << " Luminosity " << iEvent.luminosityBlock() << " Bunch " << iEvent.bunchCrossing(); #endif //Get magnetic field and ECAL channel status - edm::ESHandle bFieldH; - iSetup.get().get(bFieldH); - const MagneticField* bField = bFieldH.product(); - - edm::ESHandle ecalChStatus; - iSetup.get().get(ecalChStatus); - const EcalChannelStatus* theEcalChStatus = ecalChStatus.product(); - - edm::ESHandle sevlv; - iSetup.get().get(sevlv); - const EcalSeverityLevelAlgo* theEcalSevlv = sevlv.product(); + const MagneticField* bField = &iSetup.getData(tok_bFieldH_); + const EcalChannelStatus* theEcalChStatus = &iSetup.getData(tok_ecalChStatus_); + const EcalSeverityLevelAlgo* theEcalSevlv = &iSetup.getData(tok_sevlv_); // get handles to calogeometry and calotopology - edm::ESHandle pG; - iSetup.get().get(pG); - const CaloGeometry* geo = pG.product(); - - edm::ESHandle theCaloTopology; - iSetup.get().get(theCaloTopology); - const CaloTopology* caloTopology = theCaloTopology.product(); - - edm::ESHandle htopo; - iSetup.get().get(htopo); - const HcalTopology* theHBHETopology = htopo.product(); - - edm::ESHandle resp; - iSetup.get().get(resp); - HcalRespCorrs* respCorrs = new HcalRespCorrs(*resp.product()); - respCorrs->setTopo(theHBHETopology); + const CaloGeometry* geo = &iSetup.getData(tok_geom_); + const CaloTopology* caloTopology = &iSetup.getData(tok_caloTopology_); + const HcalTopology* theHBHETopology = &iSetup.getData(tok_htopo_); + const HcalRespCorrs* respCorrs = &iSetup.getData(tok_resp_); //=== genParticle information edm::Handle genParticles; @@ -803,9 +801,7 @@ void HcalIsoTrackStudy::beginJob() { // ------------ method called when starting to processes a run ------------ void HcalIsoTrackStudy::beginRun(edm::Run const& iRun, edm::EventSetup const& iSetup) { - edm::ESHandle pHRNDC; - iSetup.get().get(pHRNDC); - hdc_ = pHRNDC.product(); + hdc_ = &iSetup.getData(tok_ddrec_); bool changed_(true); bool flag = hltConfig_.init(iRun, iSetup, processName_, changed_); diff --git a/Calibration/HcalCalibAlgos/test/batchjob_analisotrk.csh b/Calibration/HcalCalibAlgos/test/batchjob_analisotrk.csh index 57493a4edd130..5327c61bab855 100755 --- a/Calibration/HcalCalibAlgos/test/batchjob_analisotrk.csh +++ b/Calibration/HcalCalibAlgos/test/batchjob_analisotrk.csh @@ -24,7 +24,7 @@ process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff") process.GlobalTag.globaltag = 'MC_31X_V5::All' process.load("Configuration.StandardSequences.Reconstruction_cff") -process.load("Configuration.StandardSequences.Geometry_cff") +process.load("Configuration.StandardSequences.GeometryDB_cff") process.load("Configuration.StandardSequences.MagneticField_cff") process.load("Configuration.StandardSequences.VtxSmearedBetafuncEarlyCollision_cff") diff --git a/Calibration/HcalCalibAlgos/test/batchjob_calib_valid.csh b/Calibration/HcalCalibAlgos/test/batchjob_calib_valid.csh index 7e827ca8c006b..c3fac8d3949b2 100755 --- a/Calibration/HcalCalibAlgos/test/batchjob_calib_valid.csh +++ b/Calibration/HcalCalibAlgos/test/batchjob_calib_valid.csh @@ -33,7 +33,7 @@ process.prefer("GlobalTag") process.load("Configuration.StandardSequences.VtxSmearedBetafuncEarlyCollision_cff") process.load("Configuration.StandardSequences.Generator_cff") -process.load("Configuration.StandardSequences.Geometry_cff") +process.load("Configuration.StandardSequences.GeometryDB_cff") process.load("Configuration.StandardSequences.MagneticField_cff") process.load("Calibration.HcalAlCaRecoProducers.ALCARECOHcalCalIsoTrk_cff") process.load("Calibration.HcalAlCaRecoProducers.ALCARECOHcalCalIsoTrkNoHLT_cff") diff --git a/Calibration/HcalCalibAlgos/test/batchjob_pf_corrs.csh b/Calibration/HcalCalibAlgos/test/batchjob_pf_corrs.csh index ee0eb1d1953e4..5e718237d889d 100755 --- a/Calibration/HcalCalibAlgos/test/batchjob_pf_corrs.csh +++ b/Calibration/HcalCalibAlgos/test/batchjob_pf_corrs.csh @@ -23,7 +23,7 @@ import FWCore.ParameterSet.Config as cms process = cms.Process("HcalPFCorrsCulculation") process.load("Configuration.StandardSequences.MagneticField_cff") -process.load("Configuration.StandardSequences.Geometry_cff") +process.load("Configuration.StandardSequences.GeometryDB_cff") process.load("Configuration.StandardSequences.Services_cff") process.load("Configuration.StandardSequences.Reconstruction_cff") diff --git a/Calibration/HcalCalibAlgos/test/python/isoTrackAlCaRecoAnalysis_cfg.py b/Calibration/HcalCalibAlgos/test/python/isoTrackAlCaRecoAnalysis_cfg.py index 882f4211b8a46..d5da71a52ddc9 100644 --- a/Calibration/HcalCalibAlgos/test/python/isoTrackAlCaRecoAnalysis_cfg.py +++ b/Calibration/HcalCalibAlgos/test/python/isoTrackAlCaRecoAnalysis_cfg.py @@ -1,12 +1,13 @@ import FWCore.ParameterSet.Config as cms -from Configuration.Eras.Era_Run2_2017_cff import Run2_2017 -process = cms.Process("ANALYSIS",Run2_2017) +from Configuration.Eras.Era_Run2_2018_cff import Run2_2018 +process = cms.Process("ANALYSIS",Run2_2018) process.load("FWCore.MessageService.MessageLogger_cfi") process.load('Configuration.StandardSequences.Services_cff') process.load("Configuration.StandardSequences.GeometryRecoDB_cff") process.load("Configuration.StandardSequences.MagneticField_cff") +process.load("RecoLocalCalo.EcalRecAlgos.EcalSeverityLevelESProducer_cfi") process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') from Configuration.AlCa.autoCond import autoCond process.GlobalTag.globaltag=autoCond['run2_mc'] @@ -27,13 +28,16 @@ process.towerMakerAll.AllowMissingInputs = True process.load('Calibration.HcalCalibAlgos.HcalIsoTrkAnalyzer_cff') +process.HcalIsoTrkAnalyzer.triggers = [] +process.HcalIsoTrkAnalyzer.useRaw = 0 # 2 for Raw +process.HcalIsoTrkAnalyzer.ignoreTriggers = True process.HcalIsoTrkAnalyzer.processName = 'HLTNew1' process.HcalIsoTrkAnalyzer.producerName = 'ALCAISOTRACK' process.HcalIsoTrkAnalyzer.moduleName = 'IsoProd' process.source = cms.Source("PoolSource", fileNames = cms.untracked.vstring( - 'file:/afs/cern.ch/work/g/gwalia/calib/dqm/test_29_04/CMSSW_7_5_0_pre2/src/Calibration/HcalCalibAlgos/test/PoolOutput.root' + 'file:/afs/cern.ch/user/h/huwang/work/public/for_Sunanda/ALCARECO_MC.root' ) ) diff --git a/Calibration/HcalCalibAlgos/test/python/isoTrackAnalysis_cfg.py b/Calibration/HcalCalibAlgos/test/python/isoTrackAnalysis_cfg.py new file mode 100644 index 0000000000000..19f36ac3d41da --- /dev/null +++ b/Calibration/HcalCalibAlgos/test/python/isoTrackAnalysis_cfg.py @@ -0,0 +1,36 @@ +import FWCore.ParameterSet.Config as cms + +from Configuration.Eras.Era_Run2_2018_cff import Run2_2018 +process = cms.Process("ANALYSIS",Run2_2018) + +process.load("FWCore.MessageService.MessageLogger_cfi") +process.load('Configuration.StandardSequences.Services_cff') +process.load("Configuration.StandardSequences.GeometryRecoDB_cff") +process.load("Configuration.StandardSequences.MagneticField_cff") +process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') + +from Configuration.AlCa.GlobalTag import GlobalTag +process.GlobalTag = GlobalTag(process.GlobalTag,'auto:run2_data','') + +if 'MessageLogger' in process.__dict__: + process.MessageLogger.HcalIsoTrack=dict() +process.MessageLogger.cerr.FwkReport.reportEvery = 1 +process.options = cms.untracked.PSet( wantSummary = cms.untracked.bool(True) ) + +process.load('Calibration.HcalCalibAlgos.hcalIsoTrackAnalyzer_cfi') +process.source = cms.Source("PoolSource", + fileNames = cms.untracked.vstring( + 'file:PoolOutput.root', + ) +) + +process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(-1) ) + +process.TFileService = cms.Service("TFileService", + fileName = cms.string('output.root') +) + +process.hcalIsoTrackAnalyzer.useRaw = 0 # 2 for Raw + +process.p = cms.Path(process.hcalIsoTrackAnalyzer) + diff --git a/Calibration/HcalIsolatedTrackReco/interface/ECALRegFEDSelector.h b/Calibration/HcalIsolatedTrackReco/interface/ECALRegFEDSelector.h deleted file mode 100644 index 1fc7d9c814723..0000000000000 --- a/Calibration/HcalIsolatedTrackReco/interface/ECALRegFEDSelector.h +++ /dev/null @@ -1,47 +0,0 @@ -#ifndef Calibration_ECALRegFEDSelector_h -#define Calibration_ECALRegFEDSelector_h - -// system include files -#include - -// user include files -#include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/EDProducer.h" - -#include "FWCore/Framework/interface/Event.h" -#include "FWCore/Framework/interface/MakerMacros.h" - -#include "FWCore/ParameterSet/interface/ParameterSet.h" - -#include "DataFormats/FEDRawData/interface/FEDRawDataCollection.h" -#include "DataFormats/FEDRawData/interface/FEDRawData.h" -#include "DataFormats/FEDRawData/interface/FEDNumbering.h" - -#include "DataFormats/EcalDetId/interface/EcalDetIdCollections.h" - -#include "DataFormats/HLTReco/interface/TriggerFilterObjectWithRefs.h" - -#include "Geometry/EcalMapping/interface/EcalElectronicsMapping.h" -#include "Geometry/EcalMapping/interface/EcalMappingRcd.h" - -#include "DataFormats/EcalRawData/interface/EcalListOfFEDS.h" - -class ECALRegFEDSelector : public edm::EDProducer { -public: - ECALRegFEDSelector(const edm::ParameterSet&); - ~ECALRegFEDSelector() override; - std::unique_ptr ec_mapping; - - double delta_; - bool fedSaved[1200]; - - edm::EDGetTokenT tok_raw_; - edm::EDGetTokenT tok_seed_; - -private: - void beginJob() override; - void produce(edm::Event&, const edm::EventSetup&) override; - void endJob() override; -}; - -#endif diff --git a/Calibration/HcalIsolatedTrackReco/interface/EcalIsolatedParticleCandidateProducer.h b/Calibration/HcalIsolatedTrackReco/interface/EcalIsolatedParticleCandidateProducer.h deleted file mode 100644 index b198b840e9cb5..0000000000000 --- a/Calibration/HcalIsolatedTrackReco/interface/EcalIsolatedParticleCandidateProducer.h +++ /dev/null @@ -1,47 +0,0 @@ -#ifndef Calibration_EcalIsolatedParticleCandidateProducer_h -#define Calibration_EcalIsolatedParticleCandidateProducer_h - -#include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/global/EDProducer.h" - -#include "FWCore/Framework/interface/Event.h" -#include "FWCore/Framework/interface/MakerMacros.h" - -#include "FWCore/ParameterSet/interface/ParameterSet.h" - -#include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h" -#include "DataFormats/HLTReco/interface/TriggerFilterObjectWithRefs.h" -#include "DataFormats/HcalIsolatedTrack/interface/IsolatedPixelTrackCandidate.h" - -#include "Geometry/CaloGeometry/interface/CaloGeometry.h" -#include "Geometry/Records/interface/CaloGeometryRecord.h" -// -// class decleration -// - -class EcalIsolatedParticleCandidateProducer : public edm::global::EDProducer<> { -public: - explicit EcalIsolatedParticleCandidateProducer(const edm::ParameterSet&); - ~EcalIsolatedParticleCandidateProducer() override; - -private: - void produce(edm::StreamID, edm::Event&, const edm::EventSetup&) const override; - void beginJob() override; - void endJob() override; - - double InConeSize_; - double OutConeSize_; - double hitCountEthr_; - double hitEthr_; - - edm::EDGetTokenT tok_l1tau_; - edm::EDGetTokenT tok_hlt_; - edm::EDGetTokenT tok_EB_; - edm::EDGetTokenT tok_EE_; - - edm::ESGetToken tok_geom_; - - // ----------member data --------------------------- -}; - -#endif diff --git a/Calibration/HcalIsolatedTrackReco/interface/IPTCorrector.h b/Calibration/HcalIsolatedTrackReco/interface/IPTCorrector.h deleted file mode 100644 index 085724281d47d..0000000000000 --- a/Calibration/HcalIsolatedTrackReco/interface/IPTCorrector.h +++ /dev/null @@ -1,34 +0,0 @@ -#ifndef Calibration_IPTCorrector_h -#define Calibration_IPTCorrector_h - -/* \class IsolatedPixelTrackCandidateProducer - * - * - */ - -#include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/global/EDProducer.h" -#include "FWCore/Framework/interface/Event.h" -#include "FWCore/Framework/interface/EventSetup.h" -#include "FWCore/ParameterSet/interface/ParameterSet.h" -#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" -#include "DataFormats/Common/interface/Ref.h" -#include "DataFormats/TrackReco/interface/Track.h" -#include "DataFormats/HcalIsolatedTrack/interface/IsolatedPixelTrackCandidate.h" -#include "DataFormats/HLTReco/interface/TriggerFilterObjectWithRefs.h" - -class IPTCorrector : public edm::global::EDProducer<> { -public: - IPTCorrector(const edm::ParameterSet& ps); - - static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); - - void produce(edm::StreamID, edm::Event&, edm::EventSetup const&) const override; - -private: - const edm::EDGetTokenT tok_cor_; - const edm::EDGetTokenT tok_uncor_; - const double assocCone_; -}; - -#endif diff --git a/Calibration/HcalIsolatedTrackReco/interface/IsolatedEcalPixelTrackCandidateProducer.h b/Calibration/HcalIsolatedTrackReco/interface/IsolatedEcalPixelTrackCandidateProducer.h deleted file mode 100644 index 1a0a0068f02ad..0000000000000 --- a/Calibration/HcalIsolatedTrackReco/interface/IsolatedEcalPixelTrackCandidateProducer.h +++ /dev/null @@ -1,48 +0,0 @@ -#ifndef Calibration_IsolatedEcalPixelTrackCandidateProducer_h -#define Calibration_IsolatedEcalPixelTrackCandidateProducer_h - -#include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/global/EDProducer.h" - -#include "FWCore/Framework/interface/Event.h" -#include "FWCore/Framework/interface/MakerMacros.h" - -#include "FWCore/ParameterSet/interface/ParameterSet.h" - -#include "DataFormats/HcalIsolatedTrack/interface/IsolatedPixelTrackCandidate.h" -#include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h" -#include "DataFormats/HLTReco/interface/TriggerFilterObjectWithRefs.h" - -#include "Geometry/CaloGeometry/interface/CaloGeometry.h" -#include "Geometry/Records/interface/CaloGeometryRecord.h" - -// -// class decleration -// - -class IsolatedEcalPixelTrackCandidateProducer : public edm::global::EDProducer<> { -public: - explicit IsolatedEcalPixelTrackCandidateProducer(const edm::ParameterSet&); - ~IsolatedEcalPixelTrackCandidateProducer() override; - - static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); - -private: - void produce(edm::StreamID, edm::Event&, const edm::EventSetup&) const override; - - const edm::EDGetTokenT tok_ee; - const edm::EDGetTokenT tok_eb; - const edm::EDGetTokenT tok_trigcand; - const edm::ESGetToken tok_geom_; - const double coneSizeEta0_; - const double coneSizeEta1_; - const double hitCountEthrEB_; - const double hitEthrEB_; - const double fachitCountEE_; - const double hitEthrEE0_; - const double hitEthrEE1_; - const double hitEthrEE2_; - const double hitEthrEE3_; -}; - -#endif diff --git a/Calibration/HcalIsolatedTrackReco/interface/IsolatedPixelTrackCandidateL1TProducer.h b/Calibration/HcalIsolatedTrackReco/interface/IsolatedPixelTrackCandidateL1TProducer.h deleted file mode 100644 index b2903ea6db1f9..0000000000000 --- a/Calibration/HcalIsolatedTrackReco/interface/IsolatedPixelTrackCandidateL1TProducer.h +++ /dev/null @@ -1,95 +0,0 @@ -#ifndef Calibration_IsolatedPixelTrackCandidateL1TProducer_h -#define Calibration_IsolatedPixelTrackCandidateL1TProducer_h - -/* \class IsolatedPixelTrackCandidateL1TProducer - * - * - */ - -#include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/stream/EDProducer.h" -#include "FWCore/ParameterSet/interface/ParameterSet.h" -#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" -#include "FWCore/Framework/interface/Event.h" -#include "FWCore/Framework/interface/EventSetup.h" - -#include "DataFormats/Common/interface/Ref.h" -#include "DataFormats/DetId/interface/DetId.h" - -//#include "DataFormats/Common/interface/Provenance.h" - -#include "DataFormats/TrackReco/interface/Track.h" -#include "DataFormats/L1Trigger/interface/L1JetParticle.h" -#include "DataFormats/HcalIsolatedTrack/interface/IsolatedPixelTrackCandidate.h" -#include "DataFormats/Common/interface/TriggerResults.h" -// L1Extra -#include "DataFormats/L1Trigger/interface/L1EmParticle.h" -#include "DataFormats/L1Trigger/interface/L1JetParticleFwd.h" -// l1t -#include "DataFormats/L1Trigger/interface/Jet.h" -#include "DataFormats/L1Trigger/interface/Tau.h" -/// -//vertices -#include "DataFormats/VertexReco/interface/Vertex.h" -#include "DataFormats/VertexReco/interface/VertexFwd.h" -#include "DataFormats/HLTReco/interface/TriggerFilterObjectWithRefs.h" - -#include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerReadoutSetupFwd.h" -#include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerReadoutRecord.h" -#include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerObjectMapRecord.h" -//#include "DataFormats/L1GlobalTrigger/interface/L1GtLogicParser.h" - -#include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerObjectMapFwd.h" -#include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerObjectMap.h" - -#include "MagneticField/Engine/interface/MagneticField.h" -#include "MagneticField/Records/interface/IdealMagneticFieldRecord.h" -#include "Geometry/CaloGeometry/interface/CaloGeometry.h" -#include "Geometry/Records/interface/CaloGeometryRecord.h" - -class IsolatedPixelTrackCandidateL1TProducer : public edm::stream::EDProducer<> { -public: - IsolatedPixelTrackCandidateL1TProducer(const edm::ParameterSet& ps); - ~IsolatedPixelTrackCandidateL1TProducer() override; - - static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); - - void beginRun(const edm::Run&, const edm::EventSetup&) override; - void produce(edm::Event& evt, const edm::EventSetup& es) override; - - double getDistInCM(double eta1, double phi1, double eta2, double phi2); - std::pair GetEtaPhiAtEcal(double etaIP, double phiIP, double pT, int charge, double vtxZ); - -private: - struct seedAtEC { - seedAtEC(unsigned int i, bool f, double et, double fi) : index(i), ok(f), eta(et), phi(fi) {} - unsigned int index; - bool ok; - double eta, phi; - }; - - const edm::EDGetTokenT tok_hlt_; - const edm::EDGetTokenT tok_l1_; - const edm::EDGetTokenT tok_vert_; - const std::vector > toks_pix_; - const edm::ESGetToken tok_bFieldH_; - const edm::ESGetToken tok_geom_; - - const std::string bfield_; - const double prelimCone_; - const double pixelIsolationConeSizeAtEC_; - const double vtxCutSeed_; - const double vtxCutIsol_; - const double tauAssocCone_; - const double tauUnbiasCone_; - const double minPTrackValue_; - const double maxPForIsolationValue_; - const double ebEtaBoundary_; - - // these are read from the EventSetup, cannot be const - double rEB_; - double zEE_; - double bfVal_; -}; - -#endif diff --git a/Calibration/HcalIsolatedTrackReco/interface/IsolatedPixelTrackCandidateProducer.h b/Calibration/HcalIsolatedTrackReco/interface/IsolatedPixelTrackCandidateProducer.h deleted file mode 100644 index 905e1daf16c80..0000000000000 --- a/Calibration/HcalIsolatedTrackReco/interface/IsolatedPixelTrackCandidateProducer.h +++ /dev/null @@ -1,92 +0,0 @@ -#ifndef Calibration_IsolatedPixelTrackCandidateProducer_h -#define Calibration_IsolatedPixelTrackCandidateProducer_h - -/* \class IsolatedPixelTrackCandidateProducer - * - * - */ - -#include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/stream/EDProducer.h" -#include "FWCore/ParameterSet/interface/ParameterSet.h" -#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" -#include "FWCore/Framework/interface/Event.h" -#include "FWCore/Framework/interface/EventSetup.h" - -#include "DataFormats/Common/interface/Ref.h" -#include "DataFormats/DetId/interface/DetId.h" - -//#include "DataFormats/Common/interface/Provenance.h" - -#include "DataFormats/TrackReco/interface/Track.h" -#include "DataFormats/L1Trigger/interface/L1JetParticle.h" -#include "DataFormats/HcalIsolatedTrack/interface/IsolatedPixelTrackCandidate.h" -#include "DataFormats/Common/interface/TriggerResults.h" -// L1Extra -#include "DataFormats/L1Trigger/interface/L1EmParticle.h" -#include "DataFormats/L1Trigger/interface/L1JetParticleFwd.h" -/// -//vertices -#include "DataFormats/VertexReco/interface/Vertex.h" -#include "DataFormats/VertexReco/interface/VertexFwd.h" -#include "DataFormats/HLTReco/interface/TriggerFilterObjectWithRefs.h" - -#include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerReadoutSetupFwd.h" -#include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerReadoutRecord.h" -#include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerObjectMapRecord.h" -//#include "DataFormats/L1GlobalTrigger/interface/L1GtLogicParser.h" - -#include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerObjectMapFwd.h" -#include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerObjectMap.h" - -#include "MagneticField/Engine/interface/MagneticField.h" -#include "MagneticField/Records/interface/IdealMagneticFieldRecord.h" -#include "Geometry/CaloGeometry/interface/CaloGeometry.h" -#include "Geometry/Records/interface/CaloGeometryRecord.h" - -class IsolatedPixelTrackCandidateProducer : public edm::stream::EDProducer<> { -public: - IsolatedPixelTrackCandidateProducer(const edm::ParameterSet& ps); - ~IsolatedPixelTrackCandidateProducer() override; - - static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); - - void beginRun(const edm::Run&, const edm::EventSetup&) override; - void produce(edm::Event& evt, const edm::EventSetup& es) override; - - double getDistInCM(double eta1, double phi1, double eta2, double phi2); - std::pair GetEtaPhiAtEcal(double etaIP, double phiIP, double pT, int charge, double vtxZ); - -private: - struct seedAtEC { - seedAtEC(unsigned int i, bool f, double et, double fi) : index(i), ok(f), eta(et), phi(fi) {} - unsigned int index; - bool ok; - double eta, phi; - }; - - const edm::EDGetTokenT tok_hlt_; - const edm::EDGetTokenT tok_l1_; - const edm::EDGetTokenT tok_vert_; - const std::vector > toks_pix_; - const edm::ESGetToken tok_bFieldH_; - const edm::ESGetToken tok_geom_; - - const std::string bfield_; - const double prelimCone_; - const double pixelIsolationConeSizeAtEC_; - const double vtxCutSeed_; - const double vtxCutIsol_; - const double tauAssocCone_; - const double tauUnbiasCone_; - const double minPTrackValue_; - const double maxPForIsolationValue_; - const double ebEtaBoundary_; - - // these are read from the EventSetup, cannot be const - double rEB_; - double zEE_; - double bfVal_; -}; - -#endif diff --git a/Calibration/HcalIsolatedTrackReco/interface/SiStripRegFEDSelector.h b/Calibration/HcalIsolatedTrackReco/interface/SiStripRegFEDSelector.h deleted file mode 100644 index c8073dc5888b8..0000000000000 --- a/Calibration/HcalIsolatedTrackReco/interface/SiStripRegFEDSelector.h +++ /dev/null @@ -1,40 +0,0 @@ -#ifndef Calibration_SiStripRegFEDSelector_h -#define Calibration_SiStripRegFEDSelector_h - -// system include files -#include - -// user include files -#include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/EDProducer.h" - -#include "FWCore/Framework/interface/Event.h" -#include "FWCore/Framework/interface/MakerMacros.h" - -#include "FWCore/ParameterSet/interface/ParameterSet.h" - -#include "DataFormats/HLTReco/interface/TriggerFilterObjectWithRefs.h" -#include "DataFormats/FEDRawData/interface/FEDRawDataCollection.h" -#include "DataFormats/FEDRawData/interface/FEDRawData.h" -#include "DataFormats/FEDRawData/interface/FEDNumbering.h" - -#include "CalibFormats/SiStripObjects/interface/SiStripRegionCabling.h" -#include "CalibTracker/Records/interface/SiStripRegionCablingRcd.h" - -class SiStripRegFEDSelector : public edm::EDProducer { -public: - SiStripRegFEDSelector(const edm::ParameterSet&); - ~SiStripRegFEDSelector() override; - -private: - void beginJob() override; - void produce(edm::Event&, const edm::EventSetup&) override; - void endJob() override; - - const edm::EDGetTokenT tok_seed_; - const edm::EDGetTokenT tok_raw_; - const edm::ESGetToken tok_strip_; - const double delta_; -}; - -#endif diff --git a/Calibration/HcalIsolatedTrackReco/interface/SubdetFEDSelector.h b/Calibration/HcalIsolatedTrackReco/interface/SubdetFEDSelector.h deleted file mode 100644 index 5e817320eed3b..0000000000000 --- a/Calibration/HcalIsolatedTrackReco/interface/SubdetFEDSelector.h +++ /dev/null @@ -1,41 +0,0 @@ -#ifndef Calibration_SubdetFEDSelector_h -#define Calibration_SubdetFEDSelector_h - -// user include files -#include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/EDProducer.h" - -#include "FWCore/Framework/interface/Event.h" -#include "FWCore/Framework/interface/MakerMacros.h" - -#include "FWCore/ParameterSet/interface/ParameterSet.h" - -#include "DataFormats/FEDRawData/interface/FEDRawDataCollection.h" -#include "DataFormats/FEDRawData/interface/FEDRawData.h" -#include "DataFormats/FEDRawData/interface/FEDNumbering.h" - -#include "EventFilter/RawDataCollector/interface/RawDataFEDSelector.h" - -class SubdetFEDSelector : public edm::EDProducer { -public: - SubdetFEDSelector(const edm::ParameterSet&); - ~SubdetFEDSelector() override; - - bool getEcal_; - bool getHcal_; - bool getStrip_; - bool getPixel_; - bool getMuon_; - bool getTrigger_; - - edm::EDGetTokenT tok_raw_; - -private: - void beginJob() override; - void produce(edm::Event&, const edm::EventSetup&) override; - void endJob() override; - - // ----------member data --------------------------- -}; - -#endif diff --git a/Calibration/HcalIsolatedTrackReco/BuildFile.xml b/Calibration/HcalIsolatedTrackReco/plugins/BuildFile.xml similarity index 89% rename from Calibration/HcalIsolatedTrackReco/BuildFile.xml rename to Calibration/HcalIsolatedTrackReco/plugins/BuildFile.xml index cb6fa4600d9ba..5721f4ebf639a 100644 --- a/Calibration/HcalIsolatedTrackReco/BuildFile.xml +++ b/Calibration/HcalIsolatedTrackReco/plugins/BuildFile.xml @@ -22,4 +22,6 @@ - + + + diff --git a/Calibration/HcalIsolatedTrackReco/src/ECALRegFEDSelector.cc b/Calibration/HcalIsolatedTrackReco/plugins/ECALRegFEDSelector.cc similarity index 62% rename from Calibration/HcalIsolatedTrackReco/src/ECALRegFEDSelector.cc rename to Calibration/HcalIsolatedTrackReco/plugins/ECALRegFEDSelector.cc index 4960d213d7c22..52d120d5547d5 100644 --- a/Calibration/HcalIsolatedTrackReco/src/ECALRegFEDSelector.cc +++ b/Calibration/HcalIsolatedTrackReco/plugins/ECALRegFEDSelector.cc @@ -1,10 +1,48 @@ - -#include "Calibration/HcalIsolatedTrackReco/interface/ECALRegFEDSelector.h" -#include "EventFilter/EcalRawToDigi/interface/EcalRegionCabling.h" +// system include files +#include + +// user include files +#include "FWCore/Framework/interface/Frameworkfwd.h" +#include "FWCore/Framework/interface/one/EDProducer.h" +#include "FWCore/Framework/interface/Event.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" + +#include "DataFormats/FEDRawData/interface/FEDRawDataCollection.h" +#include "DataFormats/FEDRawData/interface/FEDRawData.h" +#include "DataFormats/FEDRawData/interface/FEDNumbering.h" +#include "DataFormats/EcalDetId/interface/EcalDetIdCollections.h" +#include "DataFormats/EcalRawData/interface/EcalListOfFEDS.h" #include "DataFormats/HcalIsolatedTrack/interface/IsolatedPixelTrackCandidateFwd.h" #include "DataFormats/HcalIsolatedTrack/interface/IsolatedPixelTrackCandidate.h" +#include "DataFormats/HLTReco/interface/TriggerFilterObjectWithRefs.h" #include "DataFormats/Math/interface/RectangularEtaPhiRegion.h" +#include "EventFilter/EcalRawToDigi/interface/EcalRegionCabling.h" +#include "Geometry/EcalMapping/interface/EcalElectronicsMapping.h" +#include "Geometry/EcalMapping/interface/EcalMappingRcd.h" + +class ECALRegFEDSelector : public edm::one::EDProducer<> { +public: + ECALRegFEDSelector(const edm::ParameterSet&); + ~ECALRegFEDSelector() override; + + static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); + +private: + void beginJob() override {} + void produce(edm::Event&, const edm::EventSetup&) override; + void endJob() override {} + + std::unique_ptr ec_mapping; + + double delta_; + bool fedSaved[1200]; + + edm::EDGetTokenT tok_raw_; + edm::EDGetTokenT tok_seed_; +}; + ECALRegFEDSelector::ECALRegFEDSelector(const edm::ParameterSet& iConfig) { tok_seed_ = consumes(iConfig.getParameter("regSeedLabel")); delta_ = iConfig.getParameter("delta"); @@ -95,6 +133,15 @@ void ECALRegFEDSelector::produce(edm::Event& iEvent, const edm::EventSetup& iSet iEvent.put(std::move(fedList)); } -void ECALRegFEDSelector::beginJob() {} +void ECALRegFEDSelector::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { + edm::ParameterSetDescription desc; + desc.add("regSeedLabel", edm::InputTag("hltPixelIsolTrackFilter")); + desc.add("rawInputLabel", edm::InputTag("rawDataCollector")); + desc.add("delta", 1.0); + descriptions.add("ecalFED", desc); +} + +#include "FWCore/PluginManager/interface/ModuleDef.h" +#include "FWCore/Framework/interface/MakerMacros.h" -void ECALRegFEDSelector::endJob() {} +DEFINE_FWK_MODULE(ECALRegFEDSelector); diff --git a/Calibration/HcalIsolatedTrackReco/src/EcalIsolatedParticleCandidateProducer.cc b/Calibration/HcalIsolatedTrackReco/plugins/EcalIsolatedParticleCandidateProducer.cc similarity index 73% rename from Calibration/HcalIsolatedTrackReco/src/EcalIsolatedParticleCandidateProducer.cc rename to Calibration/HcalIsolatedTrackReco/plugins/EcalIsolatedParticleCandidateProducer.cc index f0d8fbad689d5..3496de76ed56f 100644 --- a/Calibration/HcalIsolatedTrackReco/src/EcalIsolatedParticleCandidateProducer.cc +++ b/Calibration/HcalIsolatedTrackReco/plugins/EcalIsolatedParticleCandidateProducer.cc @@ -22,17 +22,57 @@ // user include files +#include "FWCore/Framework/interface/Frameworkfwd.h" +#include "FWCore/Framework/interface/global/EDProducer.h" +#include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/EventSetup.h" +#include "FWCore/MessageLogger/interface/MessageLogger.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" #include "DataFormats/Common/interface/Ref.h" #include "DataFormats/DetId/interface/DetId.h" -#include "FWCore/MessageLogger/interface/MessageLogger.h" +#include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h" +#include "DataFormats/HLTReco/interface/TriggerFilterObjectWithRefs.h" +#include "DataFormats/HcalIsolatedTrack/interface/IsolatedPixelTrackCandidate.h" #include "Geometry/CaloTopology/interface/EcalBarrelTopology.h" -#include "Calibration/HcalIsolatedTrackReco/interface/EcalIsolatedParticleCandidateProducer.h" +#include "Geometry/CaloGeometry/interface/CaloGeometry.h" +#include "Geometry/Records/interface/CaloGeometryRecord.h" //#define EDM_ML_DEBUG +// +// class decleration +// + +class EcalIsolatedParticleCandidateProducer : public edm::global::EDProducer<> { +public: + explicit EcalIsolatedParticleCandidateProducer(const edm::ParameterSet&); + ~EcalIsolatedParticleCandidateProducer() override; + + static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); + +private: + void produce(edm::StreamID, edm::Event&, const edm::EventSetup&) const override; + void beginJob() override {} + void endJob() override {} + + double InConeSize_; + double OutConeSize_; + double hitCountEthr_; + double hitEthr_; + + edm::EDGetTokenT tok_l1tau_; + edm::EDGetTokenT tok_hlt_; + edm::EDGetTokenT tok_EB_; + edm::EDGetTokenT tok_EE_; + + edm::ESGetToken tok_geom_; + + // ----------member data --------------------------- +}; + EcalIsolatedParticleCandidateProducer::EcalIsolatedParticleCandidateProducer(const edm::ParameterSet& conf) { InConeSize_ = conf.getParameter("EcalInnerConeSize"); OutConeSize_ = conf.getParameter("EcalOuterConeSize"); @@ -199,8 +239,21 @@ void EcalIsolatedParticleCandidateProducer::produce(edm::StreamID, #endif iEvent.put(std::move(iptcCollection)); } -// ------------ method called once each job just before starting event loop ------------ -void EcalIsolatedParticleCandidateProducer::beginJob() {} -// ------------ method called once each job just after ending the event loop ------------ -void EcalIsolatedParticleCandidateProducer::endJob() {} +void EcalIsolatedParticleCandidateProducer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { + edm::ParameterSetDescription desc; + desc.add("ECHitEnergyThreshold", 0.05); + desc.add("L1eTauJetsSource", edm::InputTag("l1extraParticles", "Tau")); + desc.add("L1GTSeedLabel", edm::InputTag("l1sIsolTrack")); + desc.add("EBrecHitCollectionLabel", edm::InputTag("ecalRecHit", "EcalRecHitsEB")); + desc.add("EErecHitCollectionLabel", edm::InputTag("ecalRecHit", "EcalRecHitsEE")); + desc.add("ECHitCountEnergyThreshold", 0.5); + desc.add("EcalInnerConeSize", 0.3); + desc.add("EcalOuterConeSize", 0.7); + descriptions.add("ecalIsolPartProd", desc); +} + +#include "FWCore/PluginManager/interface/ModuleDef.h" +#include "FWCore/Framework/interface/MakerMacros.h" + +DEFINE_FWK_MODULE(EcalIsolatedParticleCandidateProducer); diff --git a/Calibration/HcalIsolatedTrackReco/src/HITRegionalPixelSeedGenerator.h b/Calibration/HcalIsolatedTrackReco/plugins/HITRegionalPixelSeedGenerator.cc similarity index 94% rename from Calibration/HcalIsolatedTrackReco/src/HITRegionalPixelSeedGenerator.h rename to Calibration/HcalIsolatedTrackReco/plugins/HITRegionalPixelSeedGenerator.cc index b5ac83018ab28..663795d2470d7 100644 --- a/Calibration/HcalIsolatedTrackReco/src/HITRegionalPixelSeedGenerator.h +++ b/Calibration/HcalIsolatedTrackReco/plugins/HITRegionalPixelSeedGenerator.cc @@ -1,6 +1,3 @@ -#ifndef HITRegionalPixelSeedGenerator_h -#define HITRegionalPixelSeedGenerator_h - // // Class: HITRegionalPixelSeedGenerator @@ -170,9 +167,9 @@ class HITRegionalPixelSeedGenerator : public TrackingRegionProducer { edm::Handle vertices; e.getByToken(token_vertex, vertices); const reco::VertexCollection vertCollection = *(vertices.product()); - reco::VertexCollection::const_iterator ci = vertCollection.begin(); if (!vertCollection.empty()) { - originz = ci->z(); + // reco::VertexCollection::const_iterator ci = vertCollection.begin(); + // originz = ci->z(); } else { deltaZVertex = 15.; } @@ -206,4 +203,9 @@ class HITRegionalPixelSeedGenerator : public TrackingRegionProducer { edm::EDGetTokenT token_l1jet; }; -#endif +#include "FWCore/PluginManager/interface/ModuleDef.h" +#include "FWCore/Framework/interface/MakerMacros.h" +#include "RecoTracker/TkTrackingRegions/interface/TrackingRegionProducerFactory.h" +#include "RecoTracker/TkTrackingRegions/interface/TrackingRegionProducer.h" +# +DEFINE_EDM_PLUGIN(TrackingRegionProducerFactory, HITRegionalPixelSeedGenerator, "HITRegionalPixelSeedGenerator"); diff --git a/Calibration/HcalIsolatedTrackReco/src/IPTCorrector.cc b/Calibration/HcalIsolatedTrackReco/plugins/IPTCorrector.cc similarity index 74% rename from Calibration/HcalIsolatedTrackReco/src/IPTCorrector.cc rename to Calibration/HcalIsolatedTrackReco/plugins/IPTCorrector.cc index 662815bb4ea80..9634fd860c38e 100644 --- a/Calibration/HcalIsolatedTrackReco/src/IPTCorrector.cc +++ b/Calibration/HcalIsolatedTrackReco/plugins/IPTCorrector.cc @@ -1,22 +1,50 @@ +/* \class IsolatedPixelTrackCorrector + * + * + */ + #include #include #include -// Class header file -#include "Calibration/HcalIsolatedTrackReco/interface/IPTCorrector.h" +#include "DataFormats/Common/interface/Handle.h" +#include "DataFormats/Common/interface/Ref.h" +#include "DataFormats/Common/interface/TriggerResults.h" +#include "DataFormats/HcalIsolatedTrack/interface/IsolatedPixelTrackCandidate.h" #include "DataFormats/HcalIsolatedTrack/interface/IsolatedPixelTrackCandidateFwd.h" +#include "DataFormats/HLTReco/interface/TriggerFilterObjectWithRefs.h" +#include "DataFormats/Math/interface/deltaR.h" +#include "DataFormats/TrackReco/interface/Track.h" + // Framework -#include "DataFormats/Common/interface/Handle.h" +#include "FWCore/Framework/interface/Frameworkfwd.h" +#include "FWCore/Framework/interface/global/EDProducer.h" +#include "FWCore/Framework/interface/Event.h" +#include "FWCore/Framework/interface/EventSetup.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" #include "FWCore/ParameterSet/interface/ParameterSetDescription.h" #include "FWCore/Utilities/interface/Exception.h" // -#include "DataFormats/Common/interface/TriggerResults.h" /// // Math #include "Math/GenVector/VectorUtil.h" #include "Math/GenVector/PxPyPzE4D.h" -#include "DataFormats/Math/interface/deltaR.h" + +class IPTCorrector : public edm::global::EDProducer<> { +public: + IPTCorrector(const edm::ParameterSet& ps); + + static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); + + void produce(edm::StreamID, edm::Event&, edm::EventSetup const&) const override; + +private: + const edm::EDGetTokenT tok_cor_; + const edm::EDGetTokenT tok_uncor_; + const double assocCone_; +}; IPTCorrector::IPTCorrector(const edm::ParameterSet& config) : tok_cor_(consumes(config.getParameter("corTracksLabel"))), @@ -88,3 +116,8 @@ void IPTCorrector::produce(edm::StreamID, edm::Event& theEvent, edm::EventSetup // put the product in the event theEvent.put(std::move(trackCollection)); } + +#include "FWCore/PluginManager/interface/ModuleDef.h" +#include "FWCore/Framework/interface/MakerMacros.h" + +DEFINE_FWK_MODULE(IPTCorrector); diff --git a/Calibration/HcalIsolatedTrackReco/src/IsolatedEcalPixelTrackCandidateProducer.cc b/Calibration/HcalIsolatedTrackReco/plugins/IsolatedEcalPixelTrackCandidateProducer.cc similarity index 82% rename from Calibration/HcalIsolatedTrackReco/src/IsolatedEcalPixelTrackCandidateProducer.cc rename to Calibration/HcalIsolatedTrackReco/plugins/IsolatedEcalPixelTrackCandidateProducer.cc index c2268e29c5d7e..ec7389e62cef7 100644 --- a/Calibration/HcalIsolatedTrackReco/src/IsolatedEcalPixelTrackCandidateProducer.cc +++ b/Calibration/HcalIsolatedTrackReco/plugins/IsolatedEcalPixelTrackCandidateProducer.cc @@ -22,17 +22,55 @@ #include // user include files - -#include "FWCore/Framework/interface/EventSetup.h" -#include "FWCore/MessageLogger/interface/MessageLogger.h" #include "DataFormats/Common/interface/Ref.h" #include "DataFormats/DetId/interface/DetId.h" #include "DataFormats/Math/interface/deltaR.h" +#include "DataFormats/HcalIsolatedTrack/interface/IsolatedPixelTrackCandidate.h" +#include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h" +#include "DataFormats/HLTReco/interface/TriggerFilterObjectWithRefs.h" + +#include "FWCore/Framework/interface/Frameworkfwd.h" +#include "FWCore/Framework/interface/global/EDProducer.h" +#include "FWCore/Framework/interface/EventSetup.h" +#include "FWCore/Framework/interface/Event.h" +#include "FWCore/MessageLogger/interface/MessageLogger.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" -#include "Calibration/HcalIsolatedTrackReco/interface/IsolatedEcalPixelTrackCandidateProducer.h" +#include "Geometry/CaloGeometry/interface/CaloGeometry.h" +#include "Geometry/Records/interface/CaloGeometryRecord.h" //#define EDM_ML_DEBUG +// +// class decleration +// + +class IsolatedEcalPixelTrackCandidateProducer : public edm::global::EDProducer<> { +public: + explicit IsolatedEcalPixelTrackCandidateProducer(const edm::ParameterSet&); + ~IsolatedEcalPixelTrackCandidateProducer() override; + + static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); + +private: + void produce(edm::StreamID, edm::Event&, const edm::EventSetup&) const override; + + const edm::EDGetTokenT tok_ee; + const edm::EDGetTokenT tok_eb; + const edm::EDGetTokenT tok_trigcand; + const edm::ESGetToken tok_geom_; + const double coneSizeEta0_; + const double coneSizeEta1_; + const double hitCountEthrEB_; + const double hitEthrEB_; + const double fachitCountEE_; + const double hitEthrEE0_; + const double hitEthrEE1_; + const double hitEthrEE2_; + const double hitEthrEE3_; +}; + IsolatedEcalPixelTrackCandidateProducer::IsolatedEcalPixelTrackCandidateProducer(const edm::ParameterSet& conf) : tok_ee(consumes(conf.getParameter("EERecHitSource"))), tok_eb(consumes(conf.getParameter("EBRecHitSource"))), @@ -180,3 +218,8 @@ void IsolatedEcalPixelTrackCandidateProducer::produce(edm::StreamID, #endif iEvent.put(std::move(iptcCollection)); } + +#include "FWCore/PluginManager/interface/ModuleDef.h" +#include "FWCore/Framework/interface/MakerMacros.h" + +DEFINE_FWK_MODULE(IsolatedEcalPixelTrackCandidateProducer); diff --git a/Calibration/HcalIsolatedTrackReco/src/IsolatedPixelTrackCandidateL1TProducer.cc b/Calibration/HcalIsolatedTrackReco/plugins/IsolatedPixelTrackCandidateL1TProducer.cc similarity index 81% rename from Calibration/HcalIsolatedTrackReco/src/IsolatedPixelTrackCandidateL1TProducer.cc rename to Calibration/HcalIsolatedTrackReco/plugins/IsolatedPixelTrackCandidateL1TProducer.cc index bd265461722ef..e8d05998c2c80 100644 --- a/Calibration/HcalIsolatedTrackReco/src/IsolatedPixelTrackCandidateL1TProducer.cc +++ b/Calibration/HcalIsolatedTrackReco/plugins/IsolatedPixelTrackCandidateL1TProducer.cc @@ -1,14 +1,43 @@ +/* \class IsolatedPixelTrackCandidateL1TProducer + * + * + */ + #include #include #include #include -// Class header file -#include "Calibration/HcalIsolatedTrackReco/interface/IsolatedPixelTrackCandidateL1TProducer.h" -#include "DataFormats/HcalIsolatedTrack/interface/IsolatedPixelTrackCandidateFwd.h" -// Framework #include "DataFormats/Common/interface/Handle.h" +#include "DataFormats/Common/interface/Ref.h" +#include "DataFormats/DetId/interface/DetId.h" +#include "DataFormats/TrackReco/interface/Track.h" +#include "DataFormats/HcalIsolatedTrack/interface/IsolatedPixelTrackCandidate.h" +#include "DataFormats/Common/interface/TriggerResults.h" +// L1Extra +#include "DataFormats/L1Trigger/interface/L1EmParticle.h" +#include "DataFormats/L1Trigger/interface/L1JetParticle.h" +// l1t +#include "DataFormats/L1Trigger/interface/Jet.h" +#include "DataFormats/L1Trigger/interface/Tau.h" +#include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerReadoutSetupFwd.h" +#include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerReadoutRecord.h" +#include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerObjectMapRecord.h" +#include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerObjectMapFwd.h" +#include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerObjectMap.h" +#include "DataFormats/HLTReco/interface/TriggerFilterObjectWithRefs.h" +//vertices +#include "DataFormats/VertexReco/interface/Vertex.h" +#include "DataFormats/VertexReco/interface/VertexFwd.h" + +// Framework +#include "FWCore/Framework/interface/Frameworkfwd.h" +#include "FWCore/Framework/interface/stream/EDProducer.h" +#include "FWCore/Framework/interface/Event.h" +#include "FWCore/Framework/interface/EventSetup.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" #include "FWCore/ParameterSet/interface/ParameterSetDescription.h" #include "FWCore/Utilities/interface/Exception.h" #include "FWCore/Utilities/interface/transform.h" @@ -20,14 +49,63 @@ //magF #include "MagneticField/VolumeBasedEngine/interface/VolumeBasedMagneticField.h" +#include "MagneticField/Engine/interface/MagneticField.h" +#include "MagneticField/Records/interface/IdealMagneticFieldRecord.h" //for ECAL geometry +#include "Geometry/CaloGeometry/interface/CaloGeometry.h" +#include "Geometry/Records/interface/CaloGeometryRecord.h" #include "Geometry/EcalAlgo/interface/EcalBarrelGeometry.h" #include "Geometry/EcalAlgo/interface/EcalEndcapGeometry.h" #include "Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h" //#define EDM_ML_DEBUG +class IsolatedPixelTrackCandidateL1TProducer : public edm::stream::EDProducer<> { +public: + IsolatedPixelTrackCandidateL1TProducer(const edm::ParameterSet& ps); + ~IsolatedPixelTrackCandidateL1TProducer() override; + + static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); + + void beginRun(const edm::Run&, const edm::EventSetup&) override; + void produce(edm::Event& evt, const edm::EventSetup& es) override; + + double getDistInCM(double eta1, double phi1, double eta2, double phi2); + std::pair GetEtaPhiAtEcal(double etaIP, double phiIP, double pT, int charge, double vtxZ); + +private: + struct seedAtEC { + seedAtEC(unsigned int i, bool f, double et, double fi) : index(i), ok(f), eta(et), phi(fi) {} + unsigned int index; + bool ok; + double eta, phi; + }; + + const edm::EDGetTokenT tok_hlt_; + const edm::EDGetTokenT tok_l1_; + const edm::EDGetTokenT tok_vert_; + const std::vector > toks_pix_; + const edm::ESGetToken tok_bFieldH_; + const edm::ESGetToken tok_geom_; + + const std::string bfield_; + const double prelimCone_; + const double pixelIsolationConeSizeAtEC_; + const double vtxCutSeed_; + const double vtxCutIsol_; + const double tauAssocCone_; + const double tauUnbiasCone_; + const double minPTrackValue_; + const double maxPForIsolationValue_; + const double ebEtaBoundary_; + + // these are read from the EventSetup, cannot be const + double rEB_; + double zEE_; + double bfVal_; +}; + IsolatedPixelTrackCandidateL1TProducer::IsolatedPixelTrackCandidateL1TProducer(const edm::ParameterSet& config) : tok_hlt_(consumes(config.getParameter("L1GTSeedLabel"))), tok_l1_(consumes(config.getParameter("L1eTauJetsSource"))), @@ -368,3 +446,7 @@ std::pair IsolatedPixelTrackCandidateL1TProducer::GetEtaPhiAtEca std::pair retVal(etaEC, phiEC); return retVal; } +#include "FWCore/PluginManager/interface/ModuleDef.h" +#include "FWCore/Framework/interface/MakerMacros.h" + +DEFINE_FWK_MODULE(IsolatedPixelTrackCandidateL1TProducer); diff --git a/Calibration/HcalIsolatedTrackReco/src/IsolatedPixelTrackCandidateProducer.cc b/Calibration/HcalIsolatedTrackReco/plugins/IsolatedPixelTrackCandidateProducer.cc similarity index 79% rename from Calibration/HcalIsolatedTrackReco/src/IsolatedPixelTrackCandidateProducer.cc rename to Calibration/HcalIsolatedTrackReco/plugins/IsolatedPixelTrackCandidateProducer.cc index b160c03ccf954..d5daf4b19a099 100644 --- a/Calibration/HcalIsolatedTrackReco/src/IsolatedPixelTrackCandidateProducer.cc +++ b/Calibration/HcalIsolatedTrackReco/plugins/IsolatedPixelTrackCandidateProducer.cc @@ -1,14 +1,42 @@ +/* \class IsolatedPixelTrackCandidateProducer + * + * + */ + #include #include #include #include -// Class header file -#include "Calibration/HcalIsolatedTrackReco/interface/IsolatedPixelTrackCandidateProducer.h" +#include "DataFormats/Common/interface/Handle.h" +#include "DataFormats/Common/interface/Ref.h" +#include "DataFormats/DetId/interface/DetId.h" #include "DataFormats/HcalIsolatedTrack/interface/IsolatedPixelTrackCandidateFwd.h" +#include "DataFormats/TrackReco/interface/Track.h" +#include "DataFormats/L1Trigger/interface/L1JetParticle.h" +#include "DataFormats/HcalIsolatedTrack/interface/IsolatedPixelTrackCandidate.h" +#include "DataFormats/Common/interface/TriggerResults.h" +// L1Extra +#include "DataFormats/L1Trigger/interface/L1EmParticle.h" +#include "DataFormats/L1Trigger/interface/L1JetParticleFwd.h" +#include "DataFormats/HLTReco/interface/TriggerFilterObjectWithRefs.h" + +#include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerReadoutSetupFwd.h" +#include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerReadoutRecord.h" +#include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerObjectMapRecord.h" +#include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerObjectMapFwd.h" +#include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerObjectMap.h" +//vertices +#include "DataFormats/VertexReco/interface/Vertex.h" +#include "DataFormats/VertexReco/interface/VertexFwd.h" // Framework -#include "DataFormats/Common/interface/Handle.h" +#include "FWCore/Framework/interface/Frameworkfwd.h" +#include "FWCore/Framework/interface/stream/EDProducer.h" +#include "FWCore/Framework/interface/Event.h" +#include "FWCore/Framework/interface/EventSetup.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" #include "FWCore/ParameterSet/interface/ParameterSetDescription.h" #include "FWCore/Utilities/interface/Exception.h" #include "FWCore/Utilities/interface/transform.h" @@ -20,14 +48,63 @@ //magF #include "MagneticField/VolumeBasedEngine/interface/VolumeBasedMagneticField.h" +#include "MagneticField/Engine/interface/MagneticField.h" +#include "MagneticField/Records/interface/IdealMagneticFieldRecord.h" //for ECAL geometry #include "Geometry/EcalAlgo/interface/EcalBarrelGeometry.h" #include "Geometry/EcalAlgo/interface/EcalEndcapGeometry.h" #include "Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h" +#include "Geometry/CaloGeometry/interface/CaloGeometry.h" +#include "Geometry/Records/interface/CaloGeometryRecord.h" //#define EDM_ML_DEBUG +class IsolatedPixelTrackCandidateProducer : public edm::stream::EDProducer<> { +public: + IsolatedPixelTrackCandidateProducer(const edm::ParameterSet& ps); + ~IsolatedPixelTrackCandidateProducer() override; + + static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); + + void beginRun(const edm::Run&, const edm::EventSetup&) override; + void produce(edm::Event& evt, const edm::EventSetup& es) override; + + double getDistInCM(double eta1, double phi1, double eta2, double phi2); + std::pair GetEtaPhiAtEcal(double etaIP, double phiIP, double pT, int charge, double vtxZ); + +private: + struct seedAtEC { + seedAtEC(unsigned int i, bool f, double et, double fi) : index(i), ok(f), eta(et), phi(fi) {} + unsigned int index; + bool ok; + double eta, phi; + }; + + const edm::EDGetTokenT tok_hlt_; + const edm::EDGetTokenT tok_l1_; + const edm::EDGetTokenT tok_vert_; + const std::vector > toks_pix_; + const edm::ESGetToken tok_bFieldH_; + const edm::ESGetToken tok_geom_; + + const std::string bfield_; + const double prelimCone_; + const double pixelIsolationConeSizeAtEC_; + const double vtxCutSeed_; + const double vtxCutIsol_; + const double tauAssocCone_; + const double tauUnbiasCone_; + const double minPTrackValue_; + const double maxPForIsolationValue_; + const double ebEtaBoundary_; + + // these are read from the EventSetup, cannot be const + double rEB_; + double zEE_; + double bfVal_; +}; + IsolatedPixelTrackCandidateProducer::IsolatedPixelTrackCandidateProducer(const edm::ParameterSet& config) : tok_hlt_(consumes(config.getParameter("L1GTSeedLabel"))), tok_l1_(consumes(config.getParameter("L1eTauJetsSource"))), @@ -325,3 +402,8 @@ std::pair IsolatedPixelTrackCandidateProducer::GetEtaPhiAtEcal( std::pair retVal(etaEC, phiEC); return retVal; } + +#include "FWCore/PluginManager/interface/ModuleDef.h" +#include "FWCore/Framework/interface/MakerMacros.h" + +DEFINE_FWK_MODULE(IsolatedPixelTrackCandidateProducer); diff --git a/Calibration/HcalIsolatedTrackReco/src/SiStripRegFEDSelector.cc b/Calibration/HcalIsolatedTrackReco/plugins/SiStripRegFEDSelector.cc similarity index 69% rename from Calibration/HcalIsolatedTrackReco/src/SiStripRegFEDSelector.cc rename to Calibration/HcalIsolatedTrackReco/plugins/SiStripRegFEDSelector.cc index 55f915c08637f..bfe6f0905e202 100644 --- a/Calibration/HcalIsolatedTrackReco/src/SiStripRegFEDSelector.cc +++ b/Calibration/HcalIsolatedTrackReco/plugins/SiStripRegFEDSelector.cc @@ -1,9 +1,41 @@ +// system include files +#include -#include "Calibration/HcalIsolatedTrackReco/interface/SiStripRegFEDSelector.h" +// user include files +#include "CalibFormats/SiStripObjects/interface/SiStripRegionCabling.h" +#include "CalibTracker/Records/interface/SiStripRegionCablingRcd.h" #include "CondFormats/SiStripObjects/interface/FedChannelConnection.h" +#include "DataFormats/FEDRawData/interface/FEDRawDataCollection.h" +#include "DataFormats/FEDRawData/interface/FEDRawData.h" +#include "DataFormats/FEDRawData/interface/FEDNumbering.h" #include "DataFormats/HcalIsolatedTrack/interface/IsolatedPixelTrackCandidate.h" #include "DataFormats/HcalIsolatedTrack/interface/IsolatedPixelTrackCandidateFwd.h" +#include "DataFormats/HLTReco/interface/TriggerFilterObjectWithRefs.h" + +#include "FWCore/Framework/interface/Frameworkfwd.h" +#include "FWCore/Framework/interface/global/EDProducer.h" +#include "FWCore/Framework/interface/Event.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" + +class SiStripRegFEDSelector : public edm::global::EDProducer<> { +public: + SiStripRegFEDSelector(const edm::ParameterSet&); + ~SiStripRegFEDSelector() override; + + static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); + +private: + void beginJob() override {} + void produce(edm::StreamID, edm::Event&, const edm::EventSetup&) const override; + void endJob() override {} + + const edm::EDGetTokenT tok_seed_; + const edm::EDGetTokenT tok_raw_; + const edm::ESGetToken tok_strip_; + const double delta_; +}; SiStripRegFEDSelector::SiStripRegFEDSelector(const edm::ParameterSet& iConfig) : tok_seed_(consumes(iConfig.getParameter("regSeedLabel"))), @@ -15,7 +47,7 @@ SiStripRegFEDSelector::SiStripRegFEDSelector(const edm::ParameterSet& iConfig) SiStripRegFEDSelector::~SiStripRegFEDSelector() {} -void SiStripRegFEDSelector::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) { +void SiStripRegFEDSelector::produce(edm::StreamID, edm::Event& iEvent, const edm::EventSetup& iSetup) const { auto producedData = std::make_unique(); edm::Handle trigSeedTrks; @@ -120,6 +152,15 @@ void SiStripRegFEDSelector::produce(edm::Event& iEvent, const edm::EventSetup& i iEvent.put(std::move(producedData)); } -void SiStripRegFEDSelector::beginJob() {} +void SiStripRegFEDSelector::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { + edm::ParameterSetDescription desc; + desc.add("regSeedLabel", edm::InputTag("hltIsolPixelTrackFilter")); + desc.add("rawInputLabel", edm::InputTag("rawDataCollector")); + desc.add("delta", 1.0); + descriptions.add("stripFED", desc); +} + +#include "FWCore/PluginManager/interface/ModuleDef.h" +#include "FWCore/Framework/interface/MakerMacros.h" -void SiStripRegFEDSelector::endJob() {} +DEFINE_FWK_MODULE(SiStripRegFEDSelector); diff --git a/Calibration/HcalIsolatedTrackReco/src/SubdetFEDSelector.cc b/Calibration/HcalIsolatedTrackReco/plugins/SubdetFEDSelector.cc similarity index 75% rename from Calibration/HcalIsolatedTrackReco/src/SubdetFEDSelector.cc rename to Calibration/HcalIsolatedTrackReco/plugins/SubdetFEDSelector.cc index 2c297312d6945..6765186ffec15 100644 --- a/Calibration/HcalIsolatedTrackReco/src/SubdetFEDSelector.cc +++ b/Calibration/HcalIsolatedTrackReco/plugins/SubdetFEDSelector.cc @@ -1,5 +1,37 @@ - -#include "Calibration/HcalIsolatedTrackReco/interface/SubdetFEDSelector.h" +// user include files +#include "FWCore/Framework/interface/Frameworkfwd.h" +#include "FWCore/Framework/interface/global/EDProducer.h" +#include "FWCore/Framework/interface/Event.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" + +#include "DataFormats/FEDRawData/interface/FEDRawDataCollection.h" +#include "DataFormats/FEDRawData/interface/FEDRawData.h" +#include "DataFormats/FEDRawData/interface/FEDNumbering.h" + +#include "EventFilter/RawDataCollector/interface/RawDataFEDSelector.h" + +class SubdetFEDSelector : public edm::global::EDProducer<> { +public: + SubdetFEDSelector(const edm::ParameterSet&); + ~SubdetFEDSelector() override; + static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); + +private: + void beginJob() override {} + void produce(edm::StreamID, edm::Event&, const edm::EventSetup&) const override; + void endJob() override {} + + // ----------member data --------------------------- + bool getEcal_; + bool getHcal_; + bool getStrip_; + bool getPixel_; + bool getMuon_; + bool getTrigger_; + + edm::EDGetTokenT tok_raw_; +}; SubdetFEDSelector::SubdetFEDSelector(const edm::ParameterSet& iConfig) { getEcal_ = iConfig.getParameter("getECAL"); @@ -16,7 +48,7 @@ SubdetFEDSelector::SubdetFEDSelector(const edm::ParameterSet& iConfig) { SubdetFEDSelector::~SubdetFEDSelector() {} -void SubdetFEDSelector::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) { +void SubdetFEDSelector::produce(edm::StreamID, edm::Event& iEvent, const edm::EventSetup& iSetup) const { auto producedData = std::make_unique(); edm::Handle rawIn; @@ -171,8 +203,19 @@ void SubdetFEDSelector::produce(edm::Event& iEvent, const edm::EventSetup& iSetu iEvent.put(std::move(producedData)); } -// ------------ method called once each job just before starting event loop ------------ -void SubdetFEDSelector::beginJob() {} +void SubdetFEDSelector::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { + edm::ParameterSetDescription desc; + desc.add("rawInputLabel", edm::InputTag("rawDataCollector")); + desc.add("getSiPixel", true); + desc.add("getHCAL", true); + desc.add("getECAL", false); + desc.add("getMuon", false); + desc.add("getTrigger", true); + desc.add("getSiStrip", false); + descriptions.add("subdetFED", desc); +} + +#include "FWCore/PluginManager/interface/ModuleDef.h" +#include "FWCore/Framework/interface/MakerMacros.h" -// ------------ method called once each job just after ending the event loop ------------ -void SubdetFEDSelector::endJob() {} +DEFINE_FWK_MODULE(SubdetFEDSelector); diff --git a/Calibration/HcalIsolatedTrackReco/python/ecalFED_cfi.py b/Calibration/HcalIsolatedTrackReco/python/ecalFED_cfi.py deleted file mode 100644 index 0ab6f02a26f33..0000000000000 --- a/Calibration/HcalIsolatedTrackReco/python/ecalFED_cfi.py +++ /dev/null @@ -1,9 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -ecalFED = cms.EDProducer("ECALRegFEDSelector", - regSeedLabel = cms.InputTag("hltPixelIsolTrackFilter"), - rawInputLabel = cms.InputTag("rawDataCollector"), - delta = cms.double(1.0) -) - - diff --git a/Calibration/HcalIsolatedTrackReco/python/ecalIsolPartProd_cfi.py b/Calibration/HcalIsolatedTrackReco/python/ecalIsolPartProd_cfi.py deleted file mode 100644 index e218cb7f8d245..0000000000000 --- a/Calibration/HcalIsolatedTrackReco/python/ecalIsolPartProd_cfi.py +++ /dev/null @@ -1,14 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -ecalIsolPartProd = cms.EDProducer("EcalIsolatedParticleCandidateProducer", - ECHitEnergyThreshold = cms.double(0.05), - L1eTauJetsSource = cms.InputTag("l1extraParticles","Tau"), - L1GTSeedLabel = cms.InputTag("l1sIsolTrack"), - EBrecHitCollectionLabel = cms.InputTag("ecalRecHit","EcalRecHitsEB"), - ECHitCountEnergyThreshold = cms.double(0.5), - EcalInnerConeSize = cms.double(0.3), - EcalOuterConeSize = cms.double(0.7), - EErecHitCollectionLabel = cms.InputTag("ecalRecHit","EcalRecHitsEE") -) - - diff --git a/Calibration/HcalIsolatedTrackReco/python/stripFED_cfi.py b/Calibration/HcalIsolatedTrackReco/python/stripFED_cfi.py deleted file mode 100644 index 4ae59c5a924bb..0000000000000 --- a/Calibration/HcalIsolatedTrackReco/python/stripFED_cfi.py +++ /dev/null @@ -1,9 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -stripFED = cms.EDProducer("SiStripRegFEDSelector", - regSeedLabel = cms.InputTag("hltIsolPixelTrackFilter"), - rawInputLabel = cms.InputTag("rawDataCollector"), - delta = cms.double(1.0) -) - - diff --git a/Calibration/HcalIsolatedTrackReco/python/subdetFED_cfi.py b/Calibration/HcalIsolatedTrackReco/python/subdetFED_cfi.py deleted file mode 100644 index c88c735118fb5..0000000000000 --- a/Calibration/HcalIsolatedTrackReco/python/subdetFED_cfi.py +++ /dev/null @@ -1,13 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -subdetFED = cms.EDProducer("SubdetFEDSelector", - rawInputLabel = cms.InputTag("rawDataCollector"), - getSiPixel = cms.bool(True), - getHCAL = cms.bool(True), - getECAL = cms.bool(False), - getMuon = cms.bool(False), - getTrigger = cms.bool(True), - getSiStrip = cms.bool(False) -) - - diff --git a/Calibration/HcalIsolatedTrackReco/src/SealModule.cc b/Calibration/HcalIsolatedTrackReco/src/SealModule.cc deleted file mode 100644 index cc0f9cb28b225..0000000000000 --- a/Calibration/HcalIsolatedTrackReco/src/SealModule.cc +++ /dev/null @@ -1,24 +0,0 @@ -#include "FWCore/PluginManager/interface/ModuleDef.h" -#include "FWCore/Framework/interface/MakerMacros.h" -#include "Calibration/HcalIsolatedTrackReco/interface/IsolatedPixelTrackCandidateProducer.h" -#include "Calibration/HcalIsolatedTrackReco/interface/IsolatedPixelTrackCandidateL1TProducer.h" -#include "Calibration/HcalIsolatedTrackReco/interface/IsolatedEcalPixelTrackCandidateProducer.h" -#include "Calibration/HcalIsolatedTrackReco/interface/EcalIsolatedParticleCandidateProducer.h" -#include "RecoTracker/TkTrackingRegions/interface/TrackingRegionProducerFactory.h" -#include "RecoTracker/TkTrackingRegions/interface/TrackingRegionProducer.h" -#include "Calibration/HcalIsolatedTrackReco/interface/SiStripRegFEDSelector.h" -#include "Calibration/HcalIsolatedTrackReco/interface/ECALRegFEDSelector.h" -#include "Calibration/HcalIsolatedTrackReco/interface/SubdetFEDSelector.h" -#include "HITRegionalPixelSeedGenerator.h" -#include "Calibration/HcalIsolatedTrackReco/interface/IPTCorrector.h" - -DEFINE_EDM_PLUGIN(TrackingRegionProducerFactory, HITRegionalPixelSeedGenerator, "HITRegionalPixelSeedGenerator"); -// -DEFINE_FWK_MODULE(IsolatedPixelTrackCandidateProducer); -DEFINE_FWK_MODULE(IsolatedPixelTrackCandidateL1TProducer); -DEFINE_FWK_MODULE(IsolatedEcalPixelTrackCandidateProducer); -DEFINE_FWK_MODULE(EcalIsolatedParticleCandidateProducer); -DEFINE_FWK_MODULE(SiStripRegFEDSelector); -DEFINE_FWK_MODULE(ECALRegFEDSelector); -DEFINE_FWK_MODULE(SubdetFEDSelector); -DEFINE_FWK_MODULE(IPTCorrector); diff --git a/Calibration/IsolatedParticles/interface/MatchingSimTrack.h b/Calibration/IsolatedParticles/interface/MatchingSimTrack.h index bf1c84d67b76b..65651476041e6 100644 --- a/Calibration/IsolatedParticles/interface/MatchingSimTrack.h +++ b/Calibration/IsolatedParticles/interface/MatchingSimTrack.h @@ -22,7 +22,6 @@ #include "SimDataFormats/Vertex/interface/SimVertexContainer.h" #include "SimTracker/TrackerHitAssociation/interface/TrackerHitAssociator.h" -#include "SimTracker/Records/interface/TrackAssociatorRecord.h" namespace spr { diff --git a/Calibration/IsolatedParticles/plugins/IsolatedGenParticles.cc b/Calibration/IsolatedParticles/plugins/IsolatedGenParticles.cc index 7ec5dc03c3392..9363fde7f1ca7 100644 --- a/Calibration/IsolatedParticles/plugins/IsolatedGenParticles.cc +++ b/Calibration/IsolatedParticles/plugins/IsolatedGenParticles.cc @@ -71,7 +71,6 @@ #include "SimDataFormats/GeneratorProducts/interface/HepMCProduct.h" #include "SimGeneral/HepPDTRecord/interface/ParticleDataTable.h" -#include "SimTracker/Records/interface/TrackAssociatorRecord.h" // track associator #include "TrackingTools/TrajectoryState/interface/FreeTrajectoryState.h" diff --git a/Calibration/IsolatedParticles/plugins/IsolatedTracksCone.cc b/Calibration/IsolatedParticles/plugins/IsolatedTracksCone.cc index b11c09ba028e5..4d9a6fc653808 100644 --- a/Calibration/IsolatedParticles/plugins/IsolatedTracksCone.cc +++ b/Calibration/IsolatedParticles/plugins/IsolatedTracksCone.cc @@ -101,7 +101,6 @@ #include "TrackingTools/TrackAssociator/interface/TrackDetectorAssociator.h" // tracker hit associator -#include "SimTracker/Records/interface/TrackAssociatorRecord.h" #include "SimTracker/TrackerHitAssociation/interface/TrackerHitAssociator.h" #include "RecoCaloTools/Navigation/interface/CaloNavigator.h" diff --git a/Calibration/IsolatedParticles/plugins/IsolatedTracksHcalScale.cc b/Calibration/IsolatedParticles/plugins/IsolatedTracksHcalScale.cc index e3670218df38b..446b3ea5c36e8 100644 --- a/Calibration/IsolatedParticles/plugins/IsolatedTracksHcalScale.cc +++ b/Calibration/IsolatedParticles/plugins/IsolatedTracksHcalScale.cc @@ -92,7 +92,6 @@ #include "SimDataFormats/Vertex/interface/SimVertexContainer.h" // track associator -#include "SimTracker/Records/interface/TrackAssociatorRecord.h" #include "SimTracker/TrackerHitAssociation/interface/TrackerHitAssociator.h" #include "TrackingTools/TrajectoryState/interface/FreeTrajectoryState.h" #include "TrackingTools/TrackAssociator/interface/TrackDetectorAssociator.h" diff --git a/Calibration/IsolatedParticles/plugins/IsolatedTracksNxN.cc b/Calibration/IsolatedParticles/plugins/IsolatedTracksNxN.cc index 259a05b66da96..72967463cfc1a 100644 --- a/Calibration/IsolatedParticles/plugins/IsolatedTracksNxN.cc +++ b/Calibration/IsolatedParticles/plugins/IsolatedTracksNxN.cc @@ -134,7 +134,6 @@ #include "SimDataFormats/Vertex/interface/SimVertexContainer.h" // track associator -#include "SimTracker/Records/interface/TrackAssociatorRecord.h" #include "SimTracker/TrackerHitAssociation/interface/TrackerHitAssociator.h" #include "TrackingTools/TrajectoryState/interface/FreeTrajectoryState.h" #include "TrackingTools/TrackAssociator/interface/TrackDetectorAssociator.h" diff --git a/Calibration/IsolatedParticles/plugins/StudyCaloGen.cc b/Calibration/IsolatedParticles/plugins/StudyCaloGen.cc index e15be0e8a046d..5ae0ae1fb3e00 100644 --- a/Calibration/IsolatedParticles/plugins/StudyCaloGen.cc +++ b/Calibration/IsolatedParticles/plugins/StudyCaloGen.cc @@ -35,7 +35,6 @@ #include "SimDataFormats/GeneratorProducts/interface/HepMCProduct.h" #include "SimGeneral/HepPDTRecord/interface/ParticleDataTable.h" -#include "SimTracker/Records/interface/TrackAssociatorRecord.h" // track associator #include "TrackingTools/TrajectoryState/interface/FreeTrajectoryState.h" diff --git a/Calibration/LumiAlCaRecoProducers/plugins/CorrPCCProducer.cc b/Calibration/LumiAlCaRecoProducers/plugins/CorrPCCProducer.cc index 771cf1b647fd9..7295d4ef88af8 100644 --- a/Calibration/LumiAlCaRecoProducers/plugins/CorrPCCProducer.cc +++ b/Calibration/LumiAlCaRecoProducers/plugins/CorrPCCProducer.cc @@ -580,8 +580,6 @@ void CorrPCCProducer::dqmEndRunProduce(edm::Run const& runSeg, const edm::EventS throw std::runtime_error("PoolDBService required."); } - delete pccCorrections; - histoFile->cd(); corrlumiAvg_h->Write(); scaleFactorAvg_h->Write(); diff --git a/Calibration/TkAlCaRecoProducers/python/ALCARECOSiPixelCalCosmics_cff.py b/Calibration/TkAlCaRecoProducers/python/ALCARECOSiPixelCalCosmics_cff.py index 75f14f74e1483..145de98bb95d1 100644 --- a/Calibration/TkAlCaRecoProducers/python/ALCARECOSiPixelCalCosmics_cff.py +++ b/Calibration/TkAlCaRecoProducers/python/ALCARECOSiPixelCalCosmics_cff.py @@ -9,7 +9,7 @@ ALCARECOSiPixelCalCosmicsDCSFilter = DPGAnalysis.Skims.skim_detstatus_cfi.dcsstatus.clone( DetectorType = cms.vstring('BPIX','FPIX'), ApplyFilter = cms.bool(True), - AndOr = cms.bool(True), + AndOr = cms.bool(False), # if True put partitions in AND, otherwise in OR DebugOn = cms.untracked.bool(False) ) @@ -38,4 +38,6 @@ ALCARECOSiPixelCalCosmics.minHitsPerSubDet.inPIXEL = 1 # Sequence # -seqALCARECOSiPixelCalCosmics = cms.Sequence(ALCARECOSiPixelCalCosmicsDCSFilter+ALCARECOSiPixelCalCosmicsHLTFilter*ALCARECOSiPixelCalCosmics) +seqALCARECOSiPixelCalCosmics = cms.Sequence(ALCARECOSiPixelCalCosmicsDCSFilter* + ALCARECOSiPixelCalCosmicsHLTFilter* + ALCARECOSiPixelCalCosmics) diff --git a/Calibration/TkAlCaRecoProducers/python/ALCARECOSiStripCalCosmicsNano_Output_cff.py b/Calibration/TkAlCaRecoProducers/python/ALCARECOSiStripCalCosmicsNano_Output_cff.py new file mode 100644 index 0000000000000..fb9691c6feb08 --- /dev/null +++ b/Calibration/TkAlCaRecoProducers/python/ALCARECOSiStripCalCosmicsNano_Output_cff.py @@ -0,0 +1,17 @@ +import FWCore.ParameterSet.Config as cms + +# AlCaNano for track based calibration using Cosmics events +from PhysicsTools.NanoAOD.NanoAODEDMEventContent_cff import NANOAODEventContent +OutALCARECOSiStripCalCosmicsNano_noDrop = cms.PSet( + SelectEvents = cms.untracked.PSet( + SelectEvents = cms.vstring('pathALCARECOSiStripCalCosmicsNano') + ), + outputCommands=cms.untracked.vstring( + 'keep nanoaodFlatTable_*Table_*_*', + 'keep nanoaodMergeableCounterTable_*Table_*_*', + 'keep nanoaodUniqueString_nanoMetadata_*_*', + ) + ) +import copy +OutALCARECOSiStripCalCosmicsNano = copy.deepcopy(OutALCARECOSiStripCalCosmicsNano_noDrop) +OutALCARECOSiStripCalCosmicsNano.outputCommands.insert(0, "drop *") diff --git a/Calibration/TkAlCaRecoProducers/python/ALCARECOSiStripCalCosmicsNano_cff.py b/Calibration/TkAlCaRecoProducers/python/ALCARECOSiStripCalCosmicsNano_cff.py new file mode 100644 index 0000000000000..59cb4c8ac3789 --- /dev/null +++ b/Calibration/TkAlCaRecoProducers/python/ALCARECOSiStripCalCosmicsNano_cff.py @@ -0,0 +1,63 @@ +import FWCore.ParameterSet.Config as cms + +from Calibration.TkAlCaRecoProducers.ALCARECOSiStripCalCosmics_cff import ALCARECOSiStripCalCosmics +from CalibTracker.SiStripCommon.prescaleEvent_cfi import prescaleEvent +from HLTrigger.HLTfilters.triggerResultsFilter_cfi import triggerResultsFilter + +ALCARECOSiStripCalCosmicsNanoPrescale = prescaleEvent.clone(prescale=1) + +ALCARECOSiStripCalCosmicsNanoHLT = triggerResultsFilter.clone( + triggerConditions=cms.vstring("HLT_L1SingleMuCosmics_v*"), + hltResults=cms.InputTag("TriggerResults", "", "HLT"), + l1tResults=cms.InputTag(""), + throw=cms.bool(False) + ) + +from CalibTracker.Configuration.Filter_Refit_cff import CalibrationTracks, CalibrationTracksRefit, MeasurementTrackerEvent, offlineBeamSpot + +ALCARECOSiStripCalCosmicsNanoCalibTracks = CalibrationTracks.clone(src=cms.InputTag("ALCARECOSiStripCalCosmics")) +ALCARECOSiStripCalCosmicsNanoCalibTracksRefit = CalibrationTracksRefit.clone( + src=cms.InputTag("ALCARECOSiStripCalCosmicsNanoCalibTracks") + ) + +ALCARECOSiStripCalCosmicsNanoTkCalSeq = cms.Sequence( + ALCARECOSiStripCalCosmicsNanoPrescale* + ALCARECOSiStripCalCosmicsNanoHLT* + ALCARECOSiStripCalCosmicsNanoCalibTracks, + cms.Task(MeasurementTrackerEvent), + cms.Task(offlineBeamSpot), + cms.Task(ALCARECOSiStripCalCosmicsNanoCalibTracksRefit) + ) + +from PhysicsTools.NanoAOD.common_cff import * +from PhysicsTools.NanoAOD.nano_cff import nanoMetadata +from CalibTracker.SiStripCommon.siStripPositionCorrectionsTable_cfi import siStripPositionCorrectionsTable +from CalibTracker.SiStripCommon.siStripLorentzAngleRunInfoTable_cfi import siStripLorentzAngleRunInfoTable + +ALCARECOSiStripCalCosmicsNanoTracksTable = cms.EDProducer("SimpleTrackFlatTableProducer", + src=cms.InputTag("ALCARECOSiStripCalCosmicsNanoCalibTracksRefit"), + cut=cms.string(""), + name=cms.string("track"), + doc=cms.string("SiStripCalCosmics ALCARECO tracks"), + singleton=cms.bool(False), + extension=cms.bool(False), + variables=cms.PSet( + chi2ndof=Var("chi2()/ndof", float), + pt=Var("pt()", float), + hitsvalid=Var("numberOfValidHits()", int), ## unsigned? + phi=Var("phi()", float), + eta=Var("eta()", float), + ) + ) + +ALCARECOSiStripCalCosmicsNanoMeasTable = siStripPositionCorrectionsTable.clone( + Tracks=cms.InputTag("ALCARECOSiStripCalCosmicsNanoCalibTracksRefit")) + +ALCARECOSiStripCalCosmicsNanoTables = cms.Task( + nanoMetadata, + ALCARECOSiStripCalCosmicsNanoTracksTable, + ALCARECOSiStripCalCosmicsNanoMeasTable, + siStripLorentzAngleRunInfoTable + ) + +seqALCARECOSiStripCalCosmicsNano = cms.Sequence(ALCARECOSiStripCalCosmicsNanoTkCalSeq, ALCARECOSiStripCalCosmicsNanoTables) diff --git a/Calibration/TkAlCaRecoProducers/test/Alca_BeamFit_Workflow.py b/Calibration/TkAlCaRecoProducers/test/Alca_BeamFit_Workflow.py index 37c18def6cccf..f8c5d1b9b3ff0 100644 --- a/Calibration/TkAlCaRecoProducers/test/Alca_BeamFit_Workflow.py +++ b/Calibration/TkAlCaRecoProducers/test/Alca_BeamFit_Workflow.py @@ -52,7 +52,7 @@ process.load("Configuration.StandardSequences.MagneticField_cff") process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff") process.GlobalTag.globaltag = 'GR_R_38X_V9::All' #'GR_R_35X_V8::All' -process.load("Configuration.StandardSequences.Geometry_cff") +process.load("Configuration.StandardSequences.GeometryDB_cff") ## reco PV diff --git a/CaloOnlineTools/EcalTools/plugins/EcalCosmicsHists.cc b/CaloOnlineTools/EcalTools/plugins/EcalCosmicsHists.cc index 0ca644721df5d..6a32a881142ee 100644 --- a/CaloOnlineTools/EcalTools/plugins/EcalCosmicsHists.cc +++ b/CaloOnlineTools/EcalTools/plugins/EcalCosmicsHists.cc @@ -15,28 +15,16 @@ #include "DataFormats/DetId/interface/DetId.h" #include "Geometry/CaloTopology/interface/CaloTopology.h" #include "Geometry/Records/interface/CaloTopologyRecord.h" -#include "Geometry/EcalMapping/interface/EcalElectronicsMapping.h" -#include "Geometry/EcalMapping/interface/EcalMappingRcd.h" #include "DataFormats/EgammaReco/interface/BasicCluster.h" #include "DataFormats/EgammaReco/interface/BasicClusterFwd.h" -#include "DataFormats/EgammaReco/interface/SuperCluster.h" -#include "DataFormats/EgammaReco/interface/SuperClusterFwd.h" #include "DataFormats/CaloRecHit/interface/CaloClusterFwd.h" #include "DataFormats/HcalRecHit/interface/HcalRecHitCollections.h" #include "DataFormats/HcalDetId/interface/HcalSubdetector.h" -#include "CondFormats/EcalObjects/interface/EcalADCToGeVConstant.h" -#include "CondFormats/L1TObjects/interface/L1GtTriggerMenu.h" -#include "CondFormats/DataRecord/interface/L1GtTriggerMenuRcd.h" #include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerReadoutSetupFwd.h" #include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerReadoutSetup.h" -#include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerReadoutRecord.h" -#include "CondFormats/DataRecord/interface/EcalADCToGeVConstantRcd.h" - -#include -#include "TLine.h" using namespace cms; using namespace edm; @@ -61,6 +49,22 @@ EcalCosmicsHists::EcalCosmicsHists(const edm::ParameterSet& iConfig) endcapClusterCollection_(iConfig.getParameter("endcapClusterCollection")), l1GTReadoutRecTag_(iConfig.getUntrackedParameter("L1GlobalReadoutRecord", "gtDigis")), l1GMTReadoutRecTag_(iConfig.getUntrackedParameter("L1GlobalMuonReadoutRecord", "gtDigis")), + barrelClusterToken_(consumes(barrelClusterCollection_)), + endcapClusterToken_(consumes(endcapClusterCollection_)), + ebRecHitToken_(consumes(ecalRecHitCollectionEB_)), + eeRecHitToken_(consumes(ecalRecHitCollectionEE_)), + ecalRawDataToken_(consumes(ecalRawDataColl_)), + tracksToken_(consumes(edm::InputTag("cosmicMuons"))), + tracksBarrelToken_(consumes(edm::InputTag("cosmicMuonsBarrelOnly"))), + hbheRecHitToken_(consumes(edm::InputTag("hbhereco"))), + hfRecHitToken_(consumes(edm::InputTag("hfreco"))), + hoRecHitToken_(consumes(edm::InputTag("horeco"))), + l1MuGMTToken_(consumes(l1GMTReadoutRecTag_)), + l1GTReadoutToken_(consumes(l1GTReadoutRecTag_)), + gtRecordToken_(consumes(edm::InputTag("gtDigis"))), + ecalADCToGeVConstantToken_(esConsumes()), + l1MenuToken_(esConsumes()), + ecalMappingToken_(esConsumes()), runNum_(-1), histRangeMax_(iConfig.getUntrackedParameter("histogramMaxRange", 1.8)), histRangeMin_(iConfig.getUntrackedParameter("histogramMinRange", 0.0)), @@ -115,17 +119,11 @@ void EcalCosmicsHists::analyze(edm::Event const& iEvent, edm::EventSetup const& //LogDebug("EcalCosmicsHists")<< "Timestamp: " << iEvent.id().run() << " " << iEvent.id().event() << " " << iEvent.time().value(); // check DB payload - edm::ESHandle pAgc; - iSetup.get().get(pAgc); - const EcalADCToGeVConstant* agc = pAgc.product(); + const auto& agc = iSetup.getData(ecalADCToGeVConstantToken_); if (naiveEvtNum_ <= 1) { - LogWarning("EcalCosmicsHists") << "Global EB ADC->GeV scale: " << agc->getEBValue() << " GeV/ADC count"; - LogWarning("EcalCosmicsHists") << "Global EE ADC->GeV scale: " << agc->getEEValue() << " GeV/ADC count"; + LogWarning("EcalCosmicsHists") << "Global EB ADC->GeV scale: " << agc.getEBValue() << " GeV/ADC count"; + LogWarning("EcalCosmicsHists") << "Global EE ADC->GeV scale: " << agc.getEEValue() << " GeV/ADC count"; } - //float adcEBconst = agc->getEBValue(); - //float adcEEconst = agc->getEEValue(); - - // //===================TIMESTAMP INFORMTION================================= // Code added to get the time in seconds @@ -136,14 +134,14 @@ void EcalCosmicsHists::analyze(edm::Event const& iEvent, edm::EventSetup const& //std::cout << "Event Time " << eventTime << " High " < hits; - iEvent.getByLabel(ecalRecHitCollectionEB_, hits); + iEvent.getByToken(ebRecHitToken_, hits); if (!(hits.isValid())) { LogWarning("EcalCosmicsHists") << ecalRecHitCollectionEB_ << " not available"; return; } Handle hitsEE; - iEvent.getByLabel(ecalRecHitCollectionEE_, hitsEE); + iEvent.getByToken(eeRecHitToken_, hitsEE); if (!(hitsEE.isValid())) { LogWarning("EcalCosmicsHists") << ecalRecHitCollectionEE_ << " not available"; return; } Handle DCCHeaders; - iEvent.getByLabel(ecalRawDataColl_, DCCHeaders); + iEvent.getByToken(ecalRawDataToken_, DCCHeaders); if (!DCCHeaders.isValid()) LogWarning("EcalCosmicsHists") << "DCC headers not available"; @@ -662,7 +660,7 @@ void EcalCosmicsHists::analyze(edm::Event const& iEvent, edm::EventSetup const& // << " ) " << std::endl; if (!EEDetId::validDetId(ix, iy, iz)) { - LogWarning("EcalCosmicsHists") << "INVALID EE DetId !!!" << endl; + LogWarning("EcalCosmicsHists") << "INVALID EE DetId !!!"; return; } @@ -1007,10 +1005,9 @@ void EcalCosmicsHists::analyze(edm::Event const& iEvent, edm::EventSetup const& // get reco tracks edm::Handle recoTracks; - iEvent.getByLabel("cosmicMuons", recoTracks); + iEvent.getByToken(tracksToken_, recoTracks); if (recoTracks.isValid()) { - // LogWarning("EcalCosmicsHists") << "... Valid TrackAssociator recoTracks !!! " << recoTracks.product()->size(); std::map > trackDetIdMap; int tracks = 0; for (reco::TrackCollection::const_iterator recoTrack = recoTracks->begin(); recoTrack != recoTracks->end(); @@ -1171,16 +1168,15 @@ void EcalCosmicsHists::analyze(edm::Event const& iEvent, edm::EventSetup const& numberofCosmicsWTrackHist_->Fill(numSeeds); } } else { - // LogWarning("EcalCosmicsHists") << "!!! No TrackAssociator recoTracks !!!"; + LogWarning("EcalCosmicsHists") << "!!! No TrackAssociator recoTracks !!!"; } // Study on Tracks for High Energy events edm::Handle recoTracksBarrel; - iEvent.getByLabel("cosmicMuonsBarrelOnly", recoTracksBarrel); + iEvent.getByToken(tracksBarrelToken_, recoTracksBarrel); if (!recoTracksBarrel.isValid()) { - //edm::LogWarning("EcalCosmicsHists") << "RecoTracksBarrel not valid!! " ; + edm::LogWarning("EcalCosmicsHists") << "RecoTracksBarrel not valid!! "; } else { - //edm::LogWarning("EcalCosmicsHists") << "Number of barrel reco tracks found in the event: " << recoTracksBarrel->size() ; HighEnergy_numRecoTrackBarrel->Fill(recoTracksBarrel->size()); for (reco::TrackCollection::const_iterator recoTrack = recoTracksBarrel->begin(); recoTrack != recoTracksBarrel->end(); @@ -1259,16 +1255,15 @@ void EcalCosmicsHists::analyze(edm::Event const& iEvent, edm::EventSetup const& //hcal rechits edm::Handle hbhe; - iEvent.getByLabel("hbhereco", hbhe); + iEvent.getByToken(hbheRecHitToken_, hbhe); edm::Handle hfrh; - iEvent.getByLabel("hfreco", hfrh); + iEvent.getByToken(hfRecHitToken_, hfrh); edm::Handle horh; - iEvent.getByLabel("horeco", horh); + iEvent.getByToken(hoRecHitToken_, horh); if (hbhe.isValid()) { - // LogInfo("EcalCosmicHists") << "event " << ievt << " HBHE RecHits collection size " << hbhe->size(); const HBHERecHitCollection hbheHit = *(hbhe.product()); for (HBHERecHitCollection::const_iterator hhit = hbheHit.begin(); hhit != hbheHit.end(); hhit++) { // if (hhit->energy() > 0.6){ @@ -1276,21 +1271,19 @@ void EcalCosmicsHists::analyze(edm::Event const& iEvent, edm::EventSetup const& // } } } else { - // LogWarning("EcalCosmicHists") << " HBHE RecHits **NOT** VALID!! " << endl; + LogWarning("EcalCosmicHists") << " HBHE RecHits **NOT** VALID!! "; } if (hfrh.isValid()) { - // LogInfo("EcalCosmicHists") << "event " << ievt << " HF RecHits collection size " << hfrh->size(); const HFRecHitCollection hfHit = *(hfrh.product()); for (HFRecHitCollection::const_iterator hhit = hfHit.begin(); hhit != hfHit.end(); hhit++) { hcalEnergy_HF_->Fill(hhit->energy()); } } else { - // LogWarning("EcalCosmicHists") << " HF RecHits **NOT** VALID!! " << endl; + LogWarning("EcalCosmicHists") << " HF RecHits **NOT** VALID!! "; } if (horh.isValid()) { - // LogInfo("EcalCosmicHists") << "event " << ievt << " HO RecHits collection size " << horh->size(); const HORecHitCollection hoHit = *(horh.product()); for (HORecHitCollection::const_iterator hhit = hoHit.begin(); hhit != hoHit.end(); hhit++) { // if (hhit->energy() > 0.6){ @@ -1298,7 +1291,7 @@ void EcalCosmicsHists::analyze(edm::Event const& iEvent, edm::EventSetup const& // } } } else { - // LogWarning("EcalCosmicHists") << " HO RecHits **NOT** VALID!! " << endl; + LogWarning("EcalCosmicHists") << " HO RecHits **NOT** VALID!! "; } // *** end of HCAL code *** // @@ -1313,7 +1306,7 @@ std::vector EcalCosmicsHists::determineTriggers(const edm::Event& iEvent, // get the GMTReadoutCollection Handle gmtrc_handle; - iEvent.getByLabel(l1GMTReadoutRecTag_, gmtrc_handle); + iEvent.getByToken(l1MuGMTToken_, gmtrc_handle); L1MuGMTReadoutCollection const* gmtrc = gmtrc_handle.product(); if (!(gmtrc_handle.isValid())) { LogWarning("EcalCosmicsHists") << "l1MuGMTReadoutCollection" @@ -1322,31 +1315,29 @@ std::vector EcalCosmicsHists::determineTriggers(const edm::Event& iEvent, } // get hold of L1GlobalReadoutRecord Handle L1GTRR; - iEvent.getByLabel(l1GTReadoutRecTag_, L1GTRR); + iEvent.getByToken(l1GTReadoutToken_, L1GTRR); //Ecal - edm::ESHandle menuRcd; - eventSetup.get().get(menuRcd); - const L1GtTriggerMenu* menu = menuRcd.product(); + const auto& menu = eventSetup.getData(l1MenuToken_); edm::Handle gtRecord; - iEvent.getByLabel(edm::InputTag("gtDigis"), gtRecord); + iEvent.getByToken(gtRecordToken_, gtRecord); // Get dWord after masking disabled bits const DecisionWord dWord = gtRecord->decisionWord(); - bool l1SingleEG1 = menu->gtAlgorithmResult("L1_SingleEG1", dWord); - bool l1SingleEG5 = menu->gtAlgorithmResult("L1_SingleEG5", dWord); - bool l1SingleEG8 = menu->gtAlgorithmResult("L1_SingleEG8", dWord); - bool l1SingleEG10 = menu->gtAlgorithmResult("L1_SingleEG10", dWord); - bool l1SingleEG12 = menu->gtAlgorithmResult("L1_SingleEG12", dWord); - bool l1SingleEG15 = menu->gtAlgorithmResult("L1_SingleEG15", dWord); - bool l1SingleEG20 = menu->gtAlgorithmResult("L1_SingleEG20", dWord); - bool l1SingleEG25 = menu->gtAlgorithmResult("L1_SingleEG25", dWord); - bool l1DoubleNoIsoEGBTBtight = menu->gtAlgorithmResult("L1_DoubleNoIsoEG_BTB_tight", dWord); - bool l1DoubleNoIsoEGBTBloose = menu->gtAlgorithmResult("L1_DoubleNoIsoEG_BTB_loose ", dWord); - bool l1DoubleNoIsoEGTopBottom = menu->gtAlgorithmResult("L1_DoubleNoIsoEGTopBottom", dWord); - bool l1DoubleNoIsoEGTopBottomCen = menu->gtAlgorithmResult("L1_DoubleNoIsoEGTopBottomCen", dWord); - bool l1DoubleNoIsoEGTopBottomCen2 = menu->gtAlgorithmResult("L1_DoubleNoIsoEGTopBottomCen2", dWord); - bool l1DoubleNoIsoEGTopBottomCenVert = menu->gtAlgorithmResult("L1_DoubleNoIsoEGTopBottomCenVert", dWord); + bool l1SingleEG1 = menu.gtAlgorithmResult("L1_SingleEG1", dWord); + bool l1SingleEG5 = menu.gtAlgorithmResult("L1_SingleEG5", dWord); + bool l1SingleEG8 = menu.gtAlgorithmResult("L1_SingleEG8", dWord); + bool l1SingleEG10 = menu.gtAlgorithmResult("L1_SingleEG10", dWord); + bool l1SingleEG12 = menu.gtAlgorithmResult("L1_SingleEG12", dWord); + bool l1SingleEG15 = menu.gtAlgorithmResult("L1_SingleEG15", dWord); + bool l1SingleEG20 = menu.gtAlgorithmResult("L1_SingleEG20", dWord); + bool l1SingleEG25 = menu.gtAlgorithmResult("L1_SingleEG25", dWord); + bool l1DoubleNoIsoEGBTBtight = menu.gtAlgorithmResult("L1_DoubleNoIsoEG_BTB_tight", dWord); + bool l1DoubleNoIsoEGBTBloose = menu.gtAlgorithmResult("L1_DoubleNoIsoEG_BTB_loose ", dWord); + bool l1DoubleNoIsoEGTopBottom = menu.gtAlgorithmResult("L1_DoubleNoIsoEGTopBottom", dWord); + bool l1DoubleNoIsoEGTopBottomCen = menu.gtAlgorithmResult("L1_DoubleNoIsoEGTopBottomCen", dWord); + bool l1DoubleNoIsoEGTopBottomCen2 = menu.gtAlgorithmResult("L1_DoubleNoIsoEGTopBottomCen2", dWord); + bool l1DoubleNoIsoEGTopBottomCenVert = menu.gtAlgorithmResult("L1_DoubleNoIsoEGTopBottomCenVert", dWord); l1Triggers[4] = l1SingleEG1 || l1SingleEG5 || l1SingleEG8 || l1SingleEG10 || l1SingleEG12 || l1SingleEG15 || l1SingleEG20 || l1SingleEG25 || l1DoubleNoIsoEGBTBtight || l1DoubleNoIsoEGBTBloose || @@ -1568,9 +1559,7 @@ void EcalCosmicsHists::initHists(int FED) { // ------------ method called once each job just before starting event loop ------------ void EcalCosmicsHists::beginRun(edm::Run const&, edm::EventSetup const& eventSetup) { - edm::ESHandle handle; - eventSetup.get().get(handle); - ecalElectronicsMap_ = handle.product(); + ecalElectronicsMap_ = &eventSetup.getData(ecalMappingToken_); //Here I will init some of the specific histograms int numBins = 200; //(int)round(histRangeMax_-histRangeMin_)+1; @@ -2755,6 +2744,8 @@ void EcalCosmicsHists::beginRun(edm::Run const&, edm::EventSetup const& eventSet new TH1F("NumActiveXtalsInClusterAllHist", "Number of active Xtals in Cluster EEP;NumXtals", 100, 0, 100); } +void EcalCosmicsHists::endRun(edm::Run const&, edm::EventSetup const& eventSetup) {} + // ------------ method called once each job just after ending the event loop ------------ void EcalCosmicsHists::endJob() { using namespace std; diff --git a/CaloOnlineTools/EcalTools/plugins/EcalCosmicsHists.h b/CaloOnlineTools/EcalTools/plugins/EcalCosmicsHists.h index 08873493370a3..9fb9762eda4ee 100644 --- a/CaloOnlineTools/EcalTools/plugins/EcalCosmicsHists.h +++ b/CaloOnlineTools/EcalTools/plugins/EcalCosmicsHists.h @@ -20,19 +20,24 @@ #include #include #include -#include // user include files #include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/EDAnalyzer.h" +#include "FWCore/Framework/interface/one/EDAnalyzer.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/MakerMacros.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" -#include "FWCore/Framework/interface/ESHandle.h" + +#include "CondFormats/DataRecord/interface/EcalADCToGeVConstantRcd.h" +#include "CondFormats/EcalObjects/interface/EcalADCToGeVConstant.h" +#include "CondFormats/L1TObjects/interface/L1GtTriggerMenu.h" +#include "CondFormats/DataRecord/interface/L1GtTriggerMenuRcd.h" #include "DataFormats/EcalDigi/interface/EcalDigiCollections.h" #include "DataFormats/EcalRecHit/interface/EcalUncalibratedRecHit.h" #include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h" +#include "DataFormats/EgammaReco/interface/SuperCluster.h" +#include "DataFormats/EgammaReco/interface/SuperClusterFwd.h" #include "DataFormats/DetId/interface/DetId.h" #include "DataFormats/EcalRawData/interface/EcalRawDataCollections.h" #include "DataFormats/L1GlobalMuonTrigger/interface/L1MuRegionalCand.h" @@ -41,6 +46,7 @@ #include "DataFormats/L1GlobalTrigger/interface/L1GtPsbWord.h" #include "Geometry/EcalMapping/interface/EcalElectronicsMapping.h" +#include "Geometry/EcalMapping/interface/EcalMappingRcd.h" #include "CaloOnlineTools/EcalTools/interface/EcalFedMap.h" @@ -65,13 +71,14 @@ // class declaration // -class EcalCosmicsHists : public edm::EDAnalyzer { +class EcalCosmicsHists : public edm::one::EDAnalyzer { public: explicit EcalCosmicsHists(const edm::ParameterSet&); ~EcalCosmicsHists() override; private: void beginRun(edm::Run const&, edm::EventSetup const&) override; + void endRun(edm::Run const&, edm::EventSetup const&) override; void analyze(edm::Event const&, edm::EventSetup const&) override; void endJob() override; std::string intToString(int num); @@ -88,21 +95,39 @@ class EcalCosmicsHists : public edm::EDAnalyzer { edm::InputTag l1GTReadoutRecTag_; edm::InputTag l1GMTReadoutRecTag_; + const edm::EDGetTokenT barrelClusterToken_; + const edm::EDGetTokenT endcapClusterToken_; + const edm::EDGetTokenT ebRecHitToken_; + const edm::EDGetTokenT eeRecHitToken_; + const edm::EDGetTokenT ecalRawDataToken_; + const edm::EDGetTokenT tracksToken_; + const edm::EDGetTokenT tracksBarrelToken_; + const edm::EDGetTokenT hbheRecHitToken_; + const edm::EDGetTokenT hfRecHitToken_; + const edm::EDGetTokenT hoRecHitToken_; + const edm::EDGetTokenT l1MuGMTToken_; + const edm::EDGetTokenT l1GTReadoutToken_; + const edm::EDGetTokenT gtRecordToken_; + + const edm::ESGetToken ecalADCToGeVConstantToken_; + const edm::ESGetToken l1MenuToken_; + const edm::ESGetToken ecalMappingToken_; + int runNum_; - double histRangeMax_, histRangeMin_; - double minTimingAmpEB_; - double minTimingAmpEE_; - double minRecHitAmpEB_; - double minRecHitAmpEE_; - double minHighEnergy_; + const double histRangeMax_, histRangeMin_; + const double minTimingAmpEB_; + const double minTimingAmpEE_; + const double minRecHitAmpEB_; + const double minRecHitAmpEE_; + const double minHighEnergy_; double* ttEtaBins; double* modEtaBins; std::string fileName_; - bool runInFileName_; + const bool runInFileName_; - double startTime_, runTimeLength_; - int numTimingBins_; + const double startTime_, runTimeLength_; + const int numTimingBins_; std::map FEDsAndHists_; std::map FEDsAndE2Hists_; diff --git a/CaloOnlineTools/EcalTools/plugins/EcalDigiDisplay.cc b/CaloOnlineTools/EcalTools/plugins/EcalDigiDisplay.cc index d9ba84b8ba0ef..b8f5edb30ee1c 100644 --- a/CaloOnlineTools/EcalTools/plugins/EcalDigiDisplay.cc +++ b/CaloOnlineTools/EcalTools/plugins/EcalDigiDisplay.cc @@ -8,17 +8,11 @@ * */ -#include -#include -#include -#include #include #include "CaloOnlineTools/EcalTools/plugins/EcalDigiDisplay.h" #include "CaloOnlineTools/EcalTools/interface/EcalFedMap.h" -#include "DataFormats/EcalDigi/interface/EcalDigiCollections.h" #include "DataFormats/EcalDetId/interface/EcalDetIdCollections.h" -#include "DataFormats/EcalRawData/interface/EcalRawDataCollections.h" #include "DataFormats/EcalRawData/interface/EcalDCCHeaderBlock.h" #include "DataFormats/EcalDigi/interface/EcalTriggerPrimitiveDigi.h" @@ -26,17 +20,18 @@ #include #include -#include -#include //========================================================================== -EcalDigiDisplay::EcalDigiDisplay(const edm::ParameterSet& ps) { +EcalDigiDisplay::EcalDigiDisplay(const edm::ParameterSet& ps) + : ebDigiCollection_(ps.getParameter("ebDigiCollection")), + eeDigiCollection_(ps.getParameter("eeDigiCollection")), + digiProducer_(ps.getParameter("digiProducer")), + rawDataToken_(consumes(edm::InputTag(digiProducer_))), + ebDigiToken_(consumes(edm::InputTag(digiProducer_, ebDigiCollection_))), + eeDigiToken_(consumes(edm::InputTag(digiProducer_, eeDigiCollection_))), + pnDiodeDigiToken_(consumes(edm::InputTag(digiProducer_))), + ecalMappingToken_(esConsumes()) { //========================================================================= - - ebDigiCollection_ = ps.getParameter("ebDigiCollection"); - eeDigiCollection_ = ps.getParameter("eeDigiCollection"); - digiProducer_ = ps.getParameter("digiProducer"); - requestedFeds_ = ps.getUntrackedParameter >("requestedFeds"); requestedEbs_ = ps.getUntrackedParameter >("requestedEbs"); @@ -175,11 +170,13 @@ void EcalDigiDisplay::beginRun(edm::Run const&, edm::EventSetup const& c) { //======================================================================== edm::LogInfo("EcalDigiDisplay") << "entering beginRun! "; - edm::ESHandle elecHandle; - c.get().get(elecHandle); - ecalElectronicsMap_ = elecHandle.product(); + ecalElectronicsMap_ = &c.getData(ecalMappingToken_); } +//======================================================================== +void EcalDigiDisplay::endRun(edm::Run const&, edm::EventSetup const& c) {} +//======================================================================== + //======================================================================== void EcalDigiDisplay::analyze(edm::Event const& e, edm::EventSetup const& c) { //======================================================================== @@ -189,9 +186,8 @@ void EcalDigiDisplay::analyze(edm::Event const& e, edm::EventSetup const& c) { //Get DCC headers edm::Handle dccHeader; - try { - e.getByLabel(digiProducer_, dccHeader); - } catch (cms::Exception& ex) { + e.getByToken(rawDataToken_, dccHeader); + if (!dccHeader.isValid()) { edm::LogError("EcalDigiUnpackerModule") << "Can't get DCC Headers!"; } @@ -201,33 +197,30 @@ void EcalDigiDisplay::analyze(edm::Event const& e, edm::EventSetup const& c) { bool pnDigisFound = false; // retrieving crystal data from Event edm::Handle eb_digis; - try { - e.getByLabel(digiProducer_, ebDigiCollection_, eb_digis); - if (!eb_digis->empty()) - ebDigisFound = true; - } catch (cms::Exception& ex) { + e.getByToken(ebDigiToken_, eb_digis); + if (!eb_digis.isValid()) { edm::LogError("EcalDigiUnpackerModule") << "EB Digis were not found!"; } + if (!eb_digis->empty()) + ebDigisFound = true; // edm::Handle ee_digis; - try { - e.getByLabel(digiProducer_, eeDigiCollection_, ee_digis); - if (!ee_digis->empty()) - eeDigisFound = true; - } catch (cms::Exception& ex) { + e.getByToken(eeDigiToken_, ee_digis); + if (!ee_digis.isValid()) { edm::LogError("EcalDigiUnpackerModule") << "EE Digis were not found!"; } + if (!ee_digis->empty()) + eeDigisFound = true; // retrieving crystal PN diodes from Event edm::Handle pn_digis; - try { - e.getByLabel(digiProducer_, pn_digis); - if (!pn_digis->empty()) - pnDigisFound = true; - } catch (cms::Exception& ex) { + e.getByToken(pnDiodeDigiToken_, pn_digis); + if (!pn_digis.isValid()) { edm::LogError("EcalDigiUnpackerModule") << "PNs were not found!"; } + if (!pn_digis->empty()) + pnDigisFound = true; //============================= //Call for funcitons diff --git a/CaloOnlineTools/EcalTools/plugins/EcalDigiDisplay.h b/CaloOnlineTools/EcalTools/plugins/EcalDigiDisplay.h index a7c98140496d2..d57eac7031873 100644 --- a/CaloOnlineTools/EcalTools/plugins/EcalDigiDisplay.h +++ b/CaloOnlineTools/EcalTools/plugins/EcalDigiDisplay.h @@ -5,19 +5,19 @@ #include #include -#include +#include #include #include -#include #include #include "DataFormats/EcalDigi/interface/EcalDigiCollections.h" +#include "DataFormats/EcalRawData/interface/EcalRawDataCollections.h" #include "CaloOnlineTools/EcalTools/interface/EcalFedMap.h" #include "Geometry/EcalMapping/interface/EcalMappingRcd.h" #include "Geometry/EcalMapping/interface/EcalElectronicsMapping.h" // class declaration -class EcalDigiDisplay : public edm::EDAnalyzer { +class EcalDigiDisplay : public edm::one::EDAnalyzer { public: //Constractor EcalDigiDisplay(const edm::ParameterSet& ps); @@ -27,6 +27,7 @@ class EcalDigiDisplay : public edm::EDAnalyzer { private: void analyze(edm::Event const& e, edm::EventSetup const& c) override; void beginRun(edm::Run const&, edm::EventSetup const& c) override; + void endRun(edm::Run const&, edm::EventSetup const& c) override; void endJob() override; protected: @@ -36,9 +37,15 @@ class EcalDigiDisplay : public edm::EDAnalyzer { EcalFedMap* fedMap; - std::string ebDigiCollection_; - std::string eeDigiCollection_; - std::string digiProducer_; + const std::string ebDigiCollection_; + const std::string eeDigiCollection_; + const std::string digiProducer_; + + const edm::EDGetTokenT rawDataToken_; + const edm::EDGetTokenT ebDigiToken_; + const edm::EDGetTokenT eeDigiToken_; + const edm::EDGetTokenT pnDiodeDigiToken_; + const edm::ESGetToken ecalMappingToken_; std::vector requestedFeds_; std::vector requestedEbs_; diff --git a/CaloOnlineTools/EcalTools/plugins/EcalDisplaysByEvent.cc b/CaloOnlineTools/EcalTools/plugins/EcalDisplaysByEvent.cc index 589521f9b2ab4..2cf5b72351e2b 100644 --- a/CaloOnlineTools/EcalTools/plugins/EcalDisplaysByEvent.cc +++ b/CaloOnlineTools/EcalTools/plugins/EcalDisplaysByEvent.cc @@ -22,8 +22,6 @@ #include "TLine.h" #include "TProfile2D.h" #include -#include -#include using namespace edm; using namespace std; @@ -46,6 +44,13 @@ EcalDisplaysByEvent::EcalDisplaysByEvent(const edm::ParameterSet& iConfig) EBDigis_(iConfig.getParameter("EBDigiCollection")), EEDigis_(iConfig.getParameter("EEDigiCollection")), headerProducer_(iConfig.getParameter("headerProducer")), + rawDataToken_(consumes(headerProducer_)), + ebRecHitToken_(consumes(EBRecHitCollection_)), + eeRecHitToken_(consumes(EERecHitCollection_)), + ebDigiToken_(consumes(EBDigis_)), + eeDigiToken_(consumes(EEDigis_)), + ecalMappingToken_(esConsumes()), + topologyToken_(esConsumes()), runNum_(-1), side_(iConfig.getUntrackedParameter("side", 3)), threshold_(iConfig.getUntrackedParameter("amplitudeThreshold", 0.5)), @@ -102,17 +107,17 @@ EcalDisplaysByEvent::~EcalDisplaysByEvent() {} // ------------ method called once each job just before starting event loop ------------ void EcalDisplaysByEvent::beginRun(edm::Run const&, edm::EventSetup const& c) { - edm::ESHandle handle; - c.get().get(handle); - ecalElectronicsMap_ = handle.product(); + ecalElectronicsMap_ = &c.getData(ecalMappingToken_); } +void EcalDisplaysByEvent::endRun(edm::Run const&, edm::EventSetup const& c) {} + // ------------ method called to for each event ------------ void EcalDisplaysByEvent::analyze(edm::Event const& iEvent, edm::EventSetup const& iSetup) { // get the headers // (one header for each supermodule) edm::Handle DCCHeaders; - iEvent.getByLabel(headerProducer_, DCCHeaders); + iEvent.getByToken(rawDataToken_, DCCHeaders); for (EcalRawDataCollection::const_iterator headerItr = DCCHeaders->begin(); headerItr != DCCHeaders->end(); ++headerItr) { @@ -138,14 +143,14 @@ void EcalDisplaysByEvent::analyze(edm::Event const& iEvent, edm::EventSetup cons listEEChannels.clear(); //Get hits, digis, caloTopology from event/eventSetup + caloTopo_ = &iSetup.getData(topologyToken_); + Handle EBhits; Handle EEhits; - ESHandle caloTopo; - iSetup.get().get(caloTopo); - iEvent.getByLabel(EBRecHitCollection_, EBhits); - iEvent.getByLabel(EERecHitCollection_, EEhits); - iEvent.getByLabel(EBDigis_, EBdigisHandle); - iEvent.getByLabel(EEDigis_, EEdigisHandle); + iEvent.getByToken(ebRecHitToken_, EBhits); + iEvent.getByToken(eeRecHitToken_, EEhits); + iEvent.getByToken(ebDigiToken_, EBdigisHandle); + iEvent.getByToken(eeDigiToken_, EEdigisHandle); // Initialize histos for this event initEvtByEvtHists(naiveEvtNum_, ievt); @@ -160,9 +165,9 @@ void EcalDisplaysByEvent::analyze(edm::Event const& iEvent, edm::EventSetup cons // Produce the digi graphs if (makeDigiGraphs_) { if (hasEBdigis) //if event has digis, it should have hits - selectHits(EBhits, ievt, caloTopo); + selectHits(EBhits, ievt); if (hasEEdigis) - selectHits(EEhits, ievt, caloTopo); + selectHits(EEhits, ievt); } // Produce the histos @@ -181,7 +186,7 @@ void EcalDisplaysByEvent::analyze(edm::Event const& iEvent, edm::EventSetup cons deleteEvtByEvtHists(); } -void EcalDisplaysByEvent::selectHits(Handle hits, int ievt, ESHandle caloTopo) { +void EcalDisplaysByEvent::selectHits(Handle hits, int ievt) { for (EcalRecHitCollection::const_iterator hitItr = hits->begin(); hitItr != hits->end(); ++hitItr) { EcalRecHit hit = (*hitItr); DetId det = hit.id(); @@ -230,7 +235,7 @@ void EcalDisplaysByEvent::selectHits(Handle hits, int ievt can.Divide(side_, side_); TGraph* myGraph; - CaloNavigator cursor = CaloNavigator(det, caloTopo->getSubdetectorTopology(det)); + CaloNavigator cursor = CaloNavigator(det, caloTopo_->getSubdetectorTopology(det)); //Now put each graph in one by one for (int j = side_ / 2; j >= -side_ / 2; --j) { for (int i = -side_ / 2; i <= side_ / 2; ++i) { diff --git a/CaloOnlineTools/EcalTools/plugins/EcalDisplaysByEvent.h b/CaloOnlineTools/EcalTools/plugins/EcalDisplaysByEvent.h index 6a1d576461622..f74effe3915ad 100644 --- a/CaloOnlineTools/EcalTools/plugins/EcalDisplaysByEvent.h +++ b/CaloOnlineTools/EcalTools/plugins/EcalDisplaysByEvent.h @@ -21,15 +21,15 @@ #include #include #include +#include // user include files #include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/EDAnalyzer.h" +#include "FWCore/Framework/interface/one/EDAnalyzer.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/EventSetup.h" #include "FWCore/Framework/interface/MakerMacros.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" -#include "FWCore/Framework/interface/ESHandle.h" #include "FWCore/ServiceRegistry/interface/Service.h" #include "CommonTools/UtilAlgos/interface/TFileService.h" #include "Geometry/EcalMapping/interface/EcalMappingRcd.h" @@ -59,13 +59,14 @@ // class declaration // -class EcalDisplaysByEvent : public edm::EDAnalyzer { +class EcalDisplaysByEvent : public edm::one::EDAnalyzer { public: explicit EcalDisplaysByEvent(const edm::ParameterSet&); ~EcalDisplaysByEvent() override; private: void beginRun(edm::Run const&, edm::EventSetup const&) override; + void endRun(edm::Run const&, edm::EventSetup const&) override; void analyze(edm::Event const&, edm::EventSetup const&) override; void endJob() override; std::string intToString(int num); @@ -78,7 +79,7 @@ class EcalDisplaysByEvent : public edm::EDAnalyzer { TH2F* init2DEcalHist(std::string histTypeName, int subDet); TH3F* init3DEcalHist(std::string histTypeName, int dubDet); TCanvas* init2DEcalCanvas(std::string canvasName); - void selectHits(edm::Handle hits, int ievt, edm::ESHandle caloTopo); + void selectHits(edm::Handle hits, int ievt); TGraph* selectDigi(DetId det, int ievt); int getEEIndex(EcalElectronicsId elecId); void makeHistos(edm::Handle ebDigis); @@ -93,27 +94,36 @@ class EcalDisplaysByEvent : public edm::EDAnalyzer { // ----------member data --------------------------- - edm::InputTag EBRecHitCollection_; - edm::InputTag EERecHitCollection_; - edm::InputTag EBDigis_; - edm::InputTag EEDigis_; - edm::InputTag headerProducer_; + const edm::InputTag EBRecHitCollection_; + const edm::InputTag EERecHitCollection_; + const edm::InputTag EBDigis_; + const edm::InputTag EEDigis_; + const edm::InputTag headerProducer_; edm::Handle EBdigisHandle; edm::Handle EEdigisHandle; + const edm::EDGetTokenT rawDataToken_; + const edm::EDGetTokenT ebRecHitToken_; + const edm::EDGetTokenT eeRecHitToken_; + const edm::EDGetTokenT ebDigiToken_; + const edm::EDGetTokenT eeDigiToken_; + + const edm::ESGetToken ecalMappingToken_; + const edm::ESGetToken topologyToken_; + int runNum_; - int side_; - double threshold_; - double minTimingAmp_; - bool makeDigiGraphs_; - bool makeTimingHistos_; - bool makeEnergyHistos_; - bool makeOccupancyHistos_; - double histRangeMin_; - double histRangeMax_; - double minTimingEnergyEB_; - double minTimingEnergyEE_; + const int side_; + const double threshold_; + const double minTimingAmp_; + const bool makeDigiGraphs_; + const bool makeTimingHistos_; + const bool makeEnergyHistos_; + const bool makeOccupancyHistos_; + const double histRangeMin_; + const double histRangeMax_; + const double minTimingEnergyEB_; + const double minTimingEnergyEE_; std::set listEBChannels; std::set listEEChannels; @@ -224,6 +234,7 @@ class EcalDisplaysByEvent : public edm::EDAnalyzer { TTree* histoCanvasNames_; EcalFedMap* fedMap_; const EcalElectronicsMapping* ecalElectronicsMap_; + const CaloTopology* caloTopo_; int naiveEvtNum_; }; diff --git a/CaloOnlineTools/EcalTools/plugins/EcalMipGraphs.cc b/CaloOnlineTools/EcalTools/plugins/EcalMipGraphs.cc index 2ea7ddf32a69f..c44c811496e2c 100644 --- a/CaloOnlineTools/EcalTools/plugins/EcalMipGraphs.cc +++ b/CaloOnlineTools/EcalTools/plugins/EcalMipGraphs.cc @@ -20,8 +20,6 @@ #include "RecoCaloTools/Navigation/interface/CaloNavigator.h" #include "TCanvas.h" #include -#include -#include using namespace edm; using namespace std; @@ -45,6 +43,13 @@ EcalMipGraphs::EcalMipGraphs(const edm::ParameterSet& iConfig) EBDigis_(iConfig.getParameter("EBDigiCollection")), EEDigis_(iConfig.getParameter("EEDigiCollection")), headerProducer_(iConfig.getParameter("headerProducer")), + rawDataToken_(consumes(headerProducer_)), + ebRecHitToken_(consumes(EBRecHitCollection_)), + eeRecHitToken_(consumes(EERecHitCollection_)), + ebDigiToken_(consumes(EBDigis_)), + eeDigiToken_(consumes(EEDigis_)), + ecalMappingToken_(esConsumes()), + topologyToken_(esConsumes()), runNum_(-1), side_(iConfig.getUntrackedParameter("side", 3)), threshold_(iConfig.getUntrackedParameter("amplitudeThreshold", 12.0)), @@ -94,7 +99,7 @@ void EcalMipGraphs::analyze(edm::Event const& iEvent, edm::EventSetup const& iSe // get the headers // (one header for each supermodule) edm::Handle DCCHeaders; - iEvent.getByLabel(headerProducer_, DCCHeaders); + iEvent.getByToken(rawDataToken_, DCCHeaders); for (EcalRawDataCollection::const_iterator headerItr = DCCHeaders->begin(); headerItr != DCCHeaders->end(); ++headerItr) { @@ -114,21 +119,18 @@ void EcalMipGraphs::analyze(edm::Event const& iEvent, edm::EventSetup const& iSe //We only want the 3x3's for this event... listEBChannels.clear(); listEEChannels.clear(); + caloTopo_ = &iSetup.getData(topologyToken_); + Handle EBhits; Handle EEhits; - ESHandle caloTopo; - iSetup.get().get(caloTopo); - iEvent.getByLabel(EBRecHitCollection_, EBhits); - iEvent.getByLabel(EERecHitCollection_, EEhits); + iEvent.getByToken(ebRecHitToken_, EBhits); + iEvent.getByToken(eeRecHitToken_, EEhits); // Now, retrieve the crystal digi from the event - iEvent.getByLabel(EBDigis_, EBdigisHandle); - iEvent.getByLabel(EEDigis_, EEdigisHandle); - //debug - //LogWarning("EcalMipGraphs") << "event " << ievt << " EBhits collection size " << EBhits->size(); - //LogWarning("EcalMipGraphs") << "event " << ievt << " EEhits collection size " << EEhits->size(); - - selectHits(EBhits, ievt, caloTopo); - selectHits(EEhits, ievt, caloTopo); + iEvent.getByToken(ebDigiToken_, EBdigisHandle); + iEvent.getByToken(eeDigiToken_, EEdigisHandle); + + selectHits(EBhits, ievt); + selectHits(EEhits, ievt); } TGraph* EcalMipGraphs::selectDigi(DetId thisDet, int ievt) { @@ -232,7 +234,7 @@ TGraph* EcalMipGraphs::selectDigi(DetId thisDet, int ievt) { return oneGraph; } -void EcalMipGraphs::selectHits(Handle hits, int ievt, ESHandle caloTopo) { +void EcalMipGraphs::selectHits(Handle hits, int ievt) { for (EcalRecHitCollection::const_iterator hitItr = hits->begin(); hitItr != hits->end(); ++hitItr) { EcalRecHit hit = (*hitItr); DetId det = hit.id(); @@ -281,7 +283,7 @@ void EcalMipGraphs::selectHits(Handle hits, int ievt, ESHa TGraph* myGraph; int canvasNum = 1; - CaloNavigator cursor = CaloNavigator(det, caloTopo->getSubdetectorTopology(det)); + CaloNavigator cursor = CaloNavigator(det, caloTopo_->getSubdetectorTopology(det)); //Now put each graph in one by one for (int j = side_ / 2; j >= -side_ / 2; --j) { for (int i = -side_ / 2; i <= side_ / 2; ++i) { @@ -328,11 +330,11 @@ void EcalMipGraphs::initHists(int FED) { // ------------ method called once each job just before starting event loop ------------ void EcalMipGraphs::beginRun(edm::Run const&, edm::EventSetup const& c) { - edm::ESHandle handle; - c.get().get(handle); - ecalElectronicsMap_ = handle.product(); + ecalElectronicsMap_ = &c.getData(ecalMappingToken_); } +void EcalMipGraphs::endRun(edm::Run const&, edm::EventSetup const& c) {} + // ------------ method called once each job just after ending the event loop ------------ void EcalMipGraphs::endJob() { canvasNames_->Fill(); diff --git a/CaloOnlineTools/EcalTools/plugins/EcalMipGraphs.h b/CaloOnlineTools/EcalTools/plugins/EcalMipGraphs.h index 52817c0bbc1e5..db0b049a629a5 100644 --- a/CaloOnlineTools/EcalTools/plugins/EcalMipGraphs.h +++ b/CaloOnlineTools/EcalTools/plugins/EcalMipGraphs.h @@ -21,15 +21,15 @@ #include #include #include +#include // user include files #include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/EDAnalyzer.h" +#include "FWCore/Framework/interface/one/EDAnalyzer.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/EventSetup.h" #include "FWCore/Framework/interface/MakerMacros.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" -#include "FWCore/Framework/interface/ESHandle.h" #include "FWCore/ServiceRegistry/interface/Service.h" #include "CommonTools/UtilAlgos/interface/TFileService.h" #include "Geometry/EcalMapping/interface/EcalMappingRcd.h" @@ -56,38 +56,48 @@ // class declaration // -class EcalMipGraphs : public edm::EDAnalyzer { +class EcalMipGraphs : public edm::one::EDAnalyzer { public: explicit EcalMipGraphs(const edm::ParameterSet&); ~EcalMipGraphs() override; private: void beginRun(edm::Run const&, edm::EventSetup const&) override; + void endRun(edm::Run const&, edm::EventSetup const&) override; void analyze(edm::Event const&, edm::EventSetup const&) override; void endJob() override; std::string intToString(int num); std::string floatToString(float num); void writeGraphs(); void initHists(int); - void selectHits(edm::Handle hits, int ievt, edm::ESHandle caloTopo); + void selectHits(edm::Handle hits, int ievt); TGraph* selectDigi(DetId det, int ievt); int getEEIndex(EcalElectronicsId elecId); // ----------member data --------------------------- - edm::InputTag EBRecHitCollection_; - edm::InputTag EERecHitCollection_; - edm::InputTag EBDigis_; - edm::InputTag EEDigis_; - edm::InputTag headerProducer_; + const edm::InputTag EBRecHitCollection_; + const edm::InputTag EERecHitCollection_; + const edm::InputTag EBDigis_; + const edm::InputTag EEDigis_; + const edm::InputTag headerProducer_; edm::Handle EBdigisHandle; edm::Handle EEdigisHandle; + const edm::EDGetTokenT rawDataToken_; + const edm::EDGetTokenT ebRecHitToken_; + const edm::EDGetTokenT eeRecHitToken_; + const edm::EDGetTokenT ebDigiToken_; + const edm::EDGetTokenT eeDigiToken_; + + const edm::ESGetToken ecalMappingToken_; + const edm::ESGetToken topologyToken_; + int runNum_; - int side_; - double threshold_; - double minTimingAmp_; + const int side_; + const double threshold_; + const double minTimingAmp_; std::set listEBChannels; std::set listEEChannels; @@ -114,6 +124,7 @@ class EcalMipGraphs : public edm::EDAnalyzer { TTree* canvasNames_; EcalFedMap* fedMap_; const EcalElectronicsMapping* ecalElectronicsMap_; + const CaloTopology* caloTopo_; int naiveEvtNum_; }; diff --git a/CaloOnlineTools/EcalTools/plugins/EcalPedHists.cc b/CaloOnlineTools/EcalTools/plugins/EcalPedHists.cc index eed22b89f5238..3e4f075287a5b 100644 --- a/CaloOnlineTools/EcalTools/plugins/EcalPedHists.cc +++ b/CaloOnlineTools/EcalTools/plugins/EcalPedHists.cc @@ -15,7 +15,11 @@ EcalPedHists::EcalPedHists(const edm::ParameterSet& ps) fileName_(ps.getUntrackedParameter("fileName", std::string("ecalPedDigiDump"))), barrelDigiCollection_(ps.getParameter("EBdigiCollection")), endcapDigiCollection_(ps.getParameter("EEdigiCollection")), - headerProducer_(ps.getParameter("headerProducer")) { + headerProducer_(ps.getParameter("headerProducer")), + rawDataToken_(consumes(headerProducer_)), + ebDigiToken_(consumes(barrelDigiCollection_)), + eeDigiToken_(consumes(endcapDigiCollection_)), + ecalMappingToken_(esConsumes()) { using namespace std; fedMap_ = new EcalFedMap(); @@ -103,11 +107,11 @@ EcalPedHists::EcalPedHists(const edm::ParameterSet& ps) EcalPedHists::~EcalPedHists() {} void EcalPedHists::beginRun(edm::Run const&, edm::EventSetup const& c) { - edm::ESHandle elecHandle; - c.get().get(elecHandle); - ecalElectronicsMap_ = elecHandle.product(); + ecalElectronicsMap_ = &c.getData(ecalMappingToken_); } +void EcalPedHists::endRun(edm::Run const&, edm::EventSetup const& c) {} + void EcalPedHists::endJob(void) { using namespace std; if (inputIsOk_) { @@ -177,9 +181,8 @@ void EcalPedHists::analyze(const edm::Event& e, const edm::EventSetup& c) { // loop over the headers, this is to detect missing FEDs if all are selected if (allFEDsSelected_) { edm::Handle DCCHeaders; - try { - e.getByLabel(headerProducer_, DCCHeaders); - } catch (std::exception& ex) { + e.getByToken(rawDataToken_, DCCHeaders); + if (!DCCHeaders.isValid()) { edm::LogError("EcalPedHists") << "Error! can't get the product " << headerProducer_; return; } @@ -206,9 +209,8 @@ void EcalPedHists::analyze(const edm::Event& e, const edm::EventSetup& c) { // (one digi for each crystal) // TODO; SIC: fix this behavior Handle barrelDigis; - try { - e.getByLabel(barrelDigiCollection_, barrelDigis); - } catch (std::exception& ex) { + e.getByToken(ebDigiToken_, barrelDigis); + if (!barrelDigis.isValid()) { edm::LogError("EcalPedOffset") << "Error! can't get the product " << barrelDigiCollection_; barrelDigisFound = false; } @@ -216,9 +218,8 @@ void EcalPedHists::analyze(const edm::Event& e, const edm::EventSetup& c) { // (one digi for each crystal) // TODO; SIC: fix this behavior Handle endcapDigis; - try { - e.getByLabel(endcapDigiCollection_, endcapDigis); - } catch (std::exception& ex) { + e.getByToken(eeDigiToken_, endcapDigis); + if (!endcapDigis.isValid()) { edm::LogError("EcalPedOffset") << "Error! can't get the product " << endcapDigiCollection_; endcapDigisFound = false; } diff --git a/CaloOnlineTools/EcalTools/plugins/EcalPedHists.h b/CaloOnlineTools/EcalTools/plugins/EcalPedHists.h index dc1ee2a45f4c0..7b2dac77ec0cf 100644 --- a/CaloOnlineTools/EcalTools/plugins/EcalPedHists.h +++ b/CaloOnlineTools/EcalTools/plugins/EcalPedHists.h @@ -1,3 +1,5 @@ +#ifndef CaloOnlineTools_EcalTools_EcalPedHists_h +#define CaloOnlineTools_EcalTools_EcalPedHists_h /** * Module which outputs a root file of ADC counts (all three gains) * of user-selected channels (defaults to channel 1) for @@ -8,11 +10,10 @@ * */ -#include "FWCore/Framework/interface/EDAnalyzer.h" +#include "FWCore/Framework/interface/one/EDAnalyzer.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/EventSetup.h" #include "FWCore/Framework/interface/MakerMacros.h" -#include "FWCore/Framework/interface/ESHandle.h" #include "DataFormats/EcalDigi/interface/EcalDigiCollections.h" #include "DataFormats/EcalDetId/interface/EcalDetIdCollections.h" #include "DataFormats/EcalDigi/interface/EcalTriggerPrimitiveDigi.h" @@ -31,7 +32,7 @@ typedef std::map stringHistMap; -class EcalPedHists : public edm::EDAnalyzer { +class EcalPedHists : public edm::one::EDAnalyzer { public: EcalPedHists(const edm::ParameterSet& ps); ~EcalPedHists() override; @@ -39,6 +40,7 @@ class EcalPedHists : public edm::EDAnalyzer { protected: void analyze(const edm::Event& e, const edm::EventSetup& c) override; void beginRun(edm::Run const&, edm::EventSetup const& c) override; + void endRun(edm::Run const&, edm::EventSetup const& c) override; void endJob(void) override; private: @@ -52,9 +54,9 @@ class EcalPedHists : public edm::EDAnalyzer { bool allFEDsSelected_; bool histsFilled_; std::string fileName_; - edm::InputTag barrelDigiCollection_; - edm::InputTag endcapDigiCollection_; - edm::InputTag headerProducer_; + const edm::InputTag barrelDigiCollection_; + const edm::InputTag endcapDigiCollection_; + const edm::InputTag headerProducer_; std::vector listChannels_; std::vector listSamples_; std::vector listFEDs_; @@ -63,5 +65,13 @@ class EcalPedHists : public edm::EDAnalyzer { std::set theRealFedSet_; EcalFedMap* fedMap_; TFile* root_file_; + + const edm::EDGetTokenT rawDataToken_; + const edm::EDGetTokenT ebDigiToken_; + const edm::EDGetTokenT eeDigiToken_; + const edm::ESGetToken ecalMappingToken_; + const EcalElectronicsMapping* ecalElectronicsMap_; }; + +#endif diff --git a/CaloOnlineTools/EcalTools/plugins/EcalTPGAnalyzer.cc b/CaloOnlineTools/EcalTools/plugins/EcalTPGAnalyzer.cc index 680c25371e7b5..cd8082f0cbee7 100644 --- a/CaloOnlineTools/EcalTools/plugins/EcalTPGAnalyzer.cc +++ b/CaloOnlineTools/EcalTools/plugins/EcalTPGAnalyzer.cc @@ -12,32 +12,9 @@ #include // user include files -#include "FWCore/Framework/interface/EDAnalyzer.h" -#include "FWCore/Framework/interface/Event.h" -#include "FWCore/Framework/interface/MakerMacros.h" - #include "FWCore/Framework/interface/EventSetup.h" -#include "FWCore/Framework/interface/ESHandle.h" -#include "FWCore/ParameterSet/interface/ParameterSet.h" - -#include "DataFormats/EcalDigi/interface/EcalDigiCollections.h" -#include "DataFormats/EcalDigi/interface/EcalTriggerPrimitiveDigi.h" -#include "Geometry/CaloTopology/interface/EcalTrigTowerConstituentsMap.h" -#include "Geometry/CaloGeometry/interface/CaloGeometry.h" -#include "Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h" #include "Geometry/CaloGeometry/interface/CaloCellGeometry.h" -#include "Geometry/Records/interface/CaloGeometryRecord.h" - -#include "CondFormats/L1TObjects/interface/L1GtTriggerMenu.h" -#include "CondFormats/DataRecord/interface/L1GtTriggerMenuRcd.h" -#include "CondFormats/L1TObjects/interface/L1GtTriggerMask.h" -#include "CondFormats/DataRecord/interface/L1GtTriggerMaskAlgoTrigRcd.h" -#include "CondFormats/DataRecord/interface/L1GtTriggerMaskTechTrigRcd.h" -#include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerReadoutSetupFwd.h" -#include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerReadoutSetup.h" -#include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerReadoutRecord.h" -#include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerRecord.h" #include "EcalTPGAnalyzer.h" @@ -47,17 +24,24 @@ using namespace edm; class CaloSubdetectorGeometry; -EcalTPGAnalyzer::EcalTPGAnalyzer(const edm::ParameterSet& iConfig) { - tpCollection_ = iConfig.getParameter("TPCollection"); - tpEmulatorCollection_ = iConfig.getParameter("TPEmulatorCollection"); - digiCollectionEB_ = iConfig.getParameter("DigiCollectionEB"); - digiCollectionEE_ = iConfig.getParameter("DigiCollectionEE"); - gtRecordCollectionTag_ = iConfig.getParameter("GTRecordCollection"); - - allowTP_ = iConfig.getParameter("ReadTriggerPrimitives"); - useEE_ = iConfig.getParameter("UseEndCap"); - print_ = iConfig.getParameter("Print"); - +EcalTPGAnalyzer::EcalTPGAnalyzer(const edm::ParameterSet& iConfig) + : tpCollection_(iConfig.getParameter("TPCollection")), + tpEmulatorCollection_(iConfig.getParameter("TPEmulatorCollection")), + digiCollectionEB_(iConfig.getParameter("DigiCollectionEB")), + digiCollectionEE_(iConfig.getParameter("DigiCollectionEE")), + gtRecordCollectionTag_(iConfig.getParameter("GTRecordCollection")), + l1GtReadoutRecordToken_(consumes(edm::InputTag(gtRecordCollectionTag_))), + tpToken_(consumes(tpCollection_)), + tpEmulToken_(consumes(tpEmulatorCollection_)), + ebDigiToken_(consumes(digiCollectionEB_)), + eeDigiToken_(consumes(digiCollectionEE_)), + eTTMapToken_(esConsumes()), + ebGeometryToken_(esConsumes(edm::ESInputTag("", "EcalBarrel"))), + eeGeometryToken_(esConsumes(edm::ESInputTag("", "EcalEndcap"))), + l1GtMaskToken_(esConsumes()), + allowTP_(iConfig.getParameter("ReadTriggerPrimitives")), + useEE_(iConfig.getParameter("UseEndCap")), + print_(iConfig.getParameter("Print")) { // file file_ = new TFile("ECALTPGtree.root", "RECREATE"); file_->cd(); @@ -93,18 +77,13 @@ EcalTPGAnalyzer::~EcalTPGAnalyzer() { void EcalTPGAnalyzer::beginRun(edm::Run const&, edm::EventSetup const& evtSetup) { // geometry - ESHandle theGeometry; - ESHandle theEndcapGeometry_handle, theBarrelGeometry_handle; - - evtSetup.get().get(theGeometry); - evtSetup.get().get("EcalEndcap", theEndcapGeometry_handle); - evtSetup.get().get("EcalBarrel", theBarrelGeometry_handle); - - evtSetup.get().get(eTTmap_); - theEndcapGeometry_ = &(*theEndcapGeometry_handle); - theBarrelGeometry_ = &(*theBarrelGeometry_handle); + eTTmap_ = &evtSetup.getData(eTTMapToken_); + theBarrelGeometry_ = &evtSetup.getData(ebGeometryToken_); + theEndcapGeometry_ = &evtSetup.getData(eeGeometryToken_); } +void EcalTPGAnalyzer::endRun(edm::Run const&, edm::EventSetup const& evtSetup) {} + void EcalTPGAnalyzer::analyze(edm::Event const& iEvent, edm::EventSetup const& iSetup) { using namespace edm; using namespace std; @@ -129,12 +108,11 @@ void EcalTPGAnalyzer::analyze(edm::Event const& iEvent, edm::EventSetup const& i /////////////////////////// edm::Handle gtRecord; - iEvent.getByLabel(edm::InputTag(gtRecordCollectionTag_), gtRecord); + iEvent.getByToken(l1GtReadoutRecordToken_, gtRecord); DecisionWord dWord = gtRecord->decisionWord(); // this will get the decision word *before* masking disabled bits - edm::ESHandle l1GtTmAlgo; - iSetup.get().get(l1GtTmAlgo); - std::vector triggerMaskAlgoTrig = l1GtTmAlgo.product()->gtTriggerMask(); + const auto& l1GtTmAlgo = iSetup.getData(l1GtMaskToken_); + std::vector triggerMaskAlgoTrig = l1GtTmAlgo.gtTriggerMask(); // apply masks on algo int iDaq = 0; @@ -156,7 +134,7 @@ void EcalTPGAnalyzer::analyze(edm::Event const& iEvent, edm::EventSetup const& i /////////////////////////// edm::Handle tp; - iEvent.getByLabel(tpCollection_, tp); + iEvent.getByToken(tpToken_, tp); if (print_) std::cout << "TP collection size=" << tp.product()->size() << std::endl; @@ -175,7 +153,7 @@ void EcalTPGAnalyzer::analyze(edm::Event const& iEvent, edm::EventSetup const& i /////////////////////////// edm::Handle tpEmul; - iEvent.getByLabel(tpEmulatorCollection_, tpEmul); + iEvent.getByToken(tpEmulToken_, tpEmul); if (print_) std::cout << "TPEmulator collection size=" << tpEmul.product()->size() << std::endl; @@ -194,7 +172,7 @@ void EcalTPGAnalyzer::analyze(edm::Event const& iEvent, edm::EventSetup const& i // Get EB xtal digi inputs edm::Handle digiEB; - iEvent.getByLabel(digiCollectionEB_, digiEB); + iEvent.getByToken(ebDigiToken_, digiEB); for (unsigned int i = 0; i < digiEB.product()->size(); i++) { const EBDataFrame& df = (*(digiEB.product()))[i]; @@ -208,11 +186,11 @@ void EcalTPGAnalyzer::analyze(edm::Event const& iEvent, edm::EventSetup const& i if (useEE_) { // Get EE xtal digi inputs edm::Handle digiEE; - iEvent.getByLabel(digiCollectionEE_, digiEE); + iEvent.getByToken(eeDigiToken_, digiEE); for (unsigned int i = 0; i < digiEE.product()->size(); i++) { const EEDataFrame& df = (*(digiEE.product()))[i]; const EEDetId& id = df.id(); - const EcalTrigTowerDetId towid = (*eTTmap_).towerOf(id); + const EcalTrigTowerDetId towid = eTTmap_->towerOf(id); itTT = mapTower.find(towid); if (itTT != mapTower.end()) (itTT->second).nbXtal_++; diff --git a/CaloOnlineTools/EcalTools/plugins/EcalTPGAnalyzer.h b/CaloOnlineTools/EcalTools/plugins/EcalTPGAnalyzer.h index 1944085121448..642046b318a9f 100644 --- a/CaloOnlineTools/EcalTools/plugins/EcalTPGAnalyzer.h +++ b/CaloOnlineTools/EcalTools/plugins/EcalTPGAnalyzer.h @@ -1,3 +1,5 @@ +#ifndef CaloOnlineTools_EcalTools_EcalTPGAnalyzer_h +#define CaloOnlineTools_EcalTools_EcalTPGAnalyzer_h // -*- C++ -*- // // Class: EcalTPGAnalyzer @@ -5,13 +7,18 @@ // // Original Author: Pascal Paganini // -#include "FWCore/Framework/interface/ESHandle.h" -#include "FWCore/Framework/interface/EDAnalyzer.h" +#include "FWCore/Framework/interface/one/EDAnalyzer.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/MakerMacros.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "CondFormats/L1TObjects/interface/L1GtTriggerMask.h" +#include "CondFormats/DataRecord/interface/L1GtTriggerMaskAlgoTrigRcd.h" +#include "DataFormats/EcalDigi/interface/EcalDigiCollections.h" +#include "DataFormats/EcalDigi/interface/EcalTriggerPrimitiveDigi.h" +#include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerReadoutRecord.h" #include "Geometry/CaloTopology/interface/EcalTrigTowerConstituentsMap.h" #include "Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h" +#include "Geometry/Records/interface/CaloGeometryRecord.h" #include #include #include @@ -32,12 +39,13 @@ class towerEner { } }; -class EcalTPGAnalyzer : public edm::EDAnalyzer { +class EcalTPGAnalyzer : public edm::one::EDAnalyzer { public: explicit EcalTPGAnalyzer(const edm::ParameterSet &); ~EcalTPGAnalyzer() override; void analyze(edm::Event const &, edm::EventSetup const &) override; void beginRun(edm::Run const &, edm::EventSetup const &) override; + void endRun(edm::Run const &, edm::EventSetup const &) override; private: struct EcalTPGVariables { @@ -68,17 +76,30 @@ class EcalTPGAnalyzer : public edm::EDAnalyzer { TTree *tree_; EcalTPGVariables treeVariables_; - edm::InputTag tpCollection_; - edm::InputTag tpEmulatorCollection_; - edm::InputTag digiCollectionEB_; - edm::InputTag digiCollectionEE_; - std::string gtRecordCollectionTag_; + const edm::InputTag tpCollection_; + const edm::InputTag tpEmulatorCollection_; + const edm::InputTag digiCollectionEB_; + const edm::InputTag digiCollectionEE_; + const std::string gtRecordCollectionTag_; - bool allowTP_; - bool useEE_; - bool print_; + const edm::EDGetTokenT l1GtReadoutRecordToken_; + const edm::EDGetTokenT tpToken_; + const edm::EDGetTokenT tpEmulToken_; + const edm::EDGetTokenT ebDigiToken_; + const edm::EDGetTokenT eeDigiToken_; + + const edm::ESGetToken eTTMapToken_; + const edm::ESGetToken ebGeometryToken_; + const edm::ESGetToken eeGeometryToken_; + const edm::ESGetToken l1GtMaskToken_; + + const bool allowTP_; + const bool useEE_; + const bool print_; - const CaloSubdetectorGeometry *theEndcapGeometry_; const CaloSubdetectorGeometry *theBarrelGeometry_; - edm::ESHandle eTTmap_; + const CaloSubdetectorGeometry *theEndcapGeometry_; + const EcalTrigTowerConstituentsMap *eTTmap_; }; + +#endif diff --git a/CaloOnlineTools/EcalTools/plugins/EcalURecHitHists.cc b/CaloOnlineTools/EcalTools/plugins/EcalURecHitHists.cc index 77c847ec7eb72..333d6b260cfd3 100644 --- a/CaloOnlineTools/EcalTools/plugins/EcalURecHitHists.cc +++ b/CaloOnlineTools/EcalTools/plugins/EcalURecHitHists.cc @@ -34,8 +34,11 @@ using namespace std; // constructors and destructor // EcalURecHitHists::EcalURecHitHists(const edm::ParameterSet& iConfig) - : EBUncalibratedRecHitCollection_(iConfig.getParameter("EBUncalibratedRecHitCollection")), - EEUncalibratedRecHitCollection_(iConfig.getParameter("EEUncalibratedRecHitCollection")), + : ebUncalibratedRecHitCollection_(iConfig.getParameter("EBUncalibratedRecHitCollection")), + eeUncalibratedRecHitCollection_(iConfig.getParameter("EEUncalibratedRecHitCollection")), + ebUncalibRecHitsToken_(consumes(ebUncalibratedRecHitCollection_)), + eeUncalibRecHitsToken_(consumes(eeUncalibratedRecHitCollection_)), + ecalMappingToken_(esConsumes()), runNum_(-1), histRangeMax_(iConfig.getUntrackedParameter("histogramMaxRange", 200.0)), histRangeMin_(iConfig.getUntrackedParameter("histogramMinRange", -10.0)), @@ -83,10 +86,10 @@ void EcalURecHitHists::analyze(edm::Event const& iEvent, edm::EventSetup const& Handle EBhits; Handle EEhits; - iEvent.getByLabel(EBUncalibratedRecHitCollection_, EBhits); + iEvent.getByToken(ebUncalibRecHitsToken_, EBhits); LogDebug("EcalURecHitHists") << "event " << ievt << " hits collection size " << EBhits->size(); - iEvent.getByLabel(EEUncalibratedRecHitCollection_, EEhits); + iEvent.getByToken(eeUncalibRecHitsToken_, EEhits); LogDebug("EcalURecHitHists") << "event " << ievt << " hits collection size " << EEhits->size(); for (EcalUncalibratedRecHitCollection::const_iterator hitItr = EBhits->begin(); hitItr != EBhits->end(); ++hitItr) { @@ -194,11 +197,11 @@ void EcalURecHitHists::initHists(int FED) { // ------------ method called once each job just before starting event loop ------------ void EcalURecHitHists::beginRun(edm::Run const&, edm::EventSetup const& c) { - edm::ESHandle elecHandle; - c.get().get(elecHandle); - ecalElectronicsMap_ = elecHandle.product(); + ecalElectronicsMap_ = &c.getData(ecalMappingToken_); } +void EcalURecHitHists::endRun(edm::Run const&, edm::EventSetup const& c) {} + // ------------ method called once each job just after ending the event loop ------------ void EcalURecHitHists::endJob() { using namespace std; diff --git a/CaloOnlineTools/EcalTools/plugins/EcalURecHitHists.h b/CaloOnlineTools/EcalTools/plugins/EcalURecHitHists.h index 48707e4c99df9..db3286f9b5bd5 100644 --- a/CaloOnlineTools/EcalTools/plugins/EcalURecHitHists.h +++ b/CaloOnlineTools/EcalTools/plugins/EcalURecHitHists.h @@ -1,3 +1,5 @@ +#ifndef CaloOnlineTools_EcalTools_EcalURecHitHists_h +#define CaloOnlineTools_EcalTools_EcalURecHitHists_h // -*- C++ -*- // // Package: EcalURecHitHists @@ -24,20 +26,19 @@ // user include files #include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/EDAnalyzer.h" +#include "FWCore/Framework/interface/one/EDAnalyzer.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/MakerMacros.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" -#include "FWCore/Framework/interface/ESHandle.h" #include "FWCore/Framework/interface/EventSetup.h" -#include "DataFormats/EcalDigi/interface/EcalDigiCollections.h" #include "DataFormats/EcalRecHit/interface/EcalUncalibratedRecHit.h" #include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h" #include "DataFormats/DetId/interface/DetId.h" #include "DataFormats/EcalRawData/interface/EcalRawDataCollections.h" #include "Geometry/EcalMapping/interface/EcalElectronicsMapping.h" +#include "Geometry/EcalMapping/interface/EcalMappingRcd.h" #include "CaloOnlineTools/EcalTools/interface/EcalFedMap.h" @@ -45,19 +46,19 @@ #include "TH1F.h" #include "TGraph.h" #include "TNtuple.h" -#include "Geometry/EcalMapping/interface/EcalMappingRcd.h" // // class declaration // -class EcalURecHitHists : public edm::EDAnalyzer { +class EcalURecHitHists : public edm::one::EDAnalyzer { public: explicit EcalURecHitHists(const edm::ParameterSet&); ~EcalURecHitHists() override; private: void beginRun(edm::Run const&, edm::EventSetup const&) override; + void endRun(edm::Run const&, edm::EventSetup const&) override; void analyze(edm::Event const&, edm::EventSetup const&) override; void endJob() override; std::string intToString(int num); @@ -65,10 +66,15 @@ class EcalURecHitHists : public edm::EDAnalyzer { // ----------member data --------------------------- - edm::InputTag EBUncalibratedRecHitCollection_; - edm::InputTag EEUncalibratedRecHitCollection_; + const edm::InputTag ebUncalibratedRecHitCollection_; + const edm::InputTag eeUncalibratedRecHitCollection_; + + const edm::EDGetTokenT ebUncalibRecHitsToken_; + const edm::EDGetTokenT eeUncalibRecHitsToken_; + const edm::ESGetToken ecalMappingToken_; + int runNum_; - double histRangeMax_, histRangeMin_; + const double histRangeMax_, histRangeMin_; std::string fileName_; std::vector maskedChannels_; @@ -84,3 +90,5 @@ class EcalURecHitHists : public edm::EDAnalyzer { EcalFedMap* fedMap_; const EcalElectronicsMapping* ecalElectronicsMap_; }; + +#endif diff --git a/CaloOnlineTools/HcalOnlineDb/interface/HcalLutManager.h b/CaloOnlineTools/HcalOnlineDb/interface/HcalLutManager.h index cacab5ae0e10d..fb14974b5981e 100644 --- a/CaloOnlineTools/HcalOnlineDb/interface/HcalLutManager.h +++ b/CaloOnlineTools/HcalOnlineDb/interface/HcalLutManager.h @@ -21,7 +21,7 @@ #include "CaloOnlineTools/HcalOnlineDb/interface/HCALConfigDB.h" #include "CaloOnlineTools/HcalOnlineDb/interface/LMap.h" #include "CalibFormats/HcalObjects/interface/HcalTPGCoder.h" -#include "CalibCalorimetry/CaloTPG/src/CaloTPGTranscoderULUT.h" +#include "CalibCalorimetry/CaloTPG/interface/CaloTPGTranscoderULUT.h" #include "CaloOnlineTools/HcalOnlineDb/interface/HcalAssistant.h" #include "CaloOnlineTools/HcalOnlineDb/interface/HcalChannelIterator.h" #include "SimCalorimetry/HcalTrigPrimAlgos/interface/HcalFinegrainBit.h" diff --git a/CommonTools/CandAlgos/interface/CandMatcher.h b/CommonTools/CandAlgos/interface/CandMatcher.h index 9b1186c3ce691..26e5ca56a9e12 100644 --- a/CommonTools/CandAlgos/interface/CandMatcher.h +++ b/CommonTools/CandAlgos/interface/CandMatcher.h @@ -9,17 +9,8 @@ #include "DataFormats/Candidate/interface/Candidate.h" #include "CommonTools/CandUtils/interface/CandMapTrait.h" -namespace reco { - namespace modules { - template > - class CandMatcher - : public Matcher::type> { - public: - CandMatcher(const edm::ParameterSet& cfg) - : Matcher::type>(cfg) {} - ~CandMatcher() override {} - }; - - } // namespace modules -} // namespace reco +namespace reco::modules { + template > + using CandMatcher = Matcher::type>; +} // namespace reco::modules #endif diff --git a/CommonTools/CandAlgos/interface/CloneProducer.h b/CommonTools/CandAlgos/interface/CloneProducer.h deleted file mode 100644 index 4405c92d80ae4..0000000000000 --- a/CommonTools/CandAlgos/interface/CloneProducer.h +++ /dev/null @@ -1,59 +0,0 @@ -#ifndef CandAlgos_CloneProducer_h -#define CandAlgos_CloneProducer_h -/** \class CloneProducer - * - * Clones a concrete Candidate collection - * to a CandidateCollection (i.e.: OwnVector) filled - * with clones of the original candidate collection - * - * \author: Francesco Fabozzi, INFN - * modified by Luca Lista, INFN - * - * Template parameters: - * - C : Concrete candidate collection type - * - */ -#include "FWCore/Framework/interface/EDProducer.h" -#include "FWCore/Framework/interface/Event.h" -#include "FWCore/ParameterSet/interface/ParameterSet.h" -#include "FWCore/Utilities/interface/InputTag.h" -#include "DataFormats/Candidate/interface/Candidate.h" - -template -class CloneProducer : public edm::EDProducer { -public: - /// constructor from parameter set - explicit CloneProducer( const edm::ParameterSet& ); - /// destructor - ~CloneProducer(); - -private: - /// process an event - virtual void produce( edm::Event&, const edm::EventSetup& ); - /// labels of the collection to be converted - edm::EDGetTokenT srcToken_; -}; - -template -CloneProducer::CloneProducer( const edm::ParameterSet& par ) : - srcToken_( consumes( par.template getParameter( "src" ) ) ) { - produces(); -} - -template -CloneProducer::~CloneProducer() { -} - -template -void CloneProducer::produce( edm::Event& evt, const edm::EventSetup& ) { - std::unique_ptr coll( new reco::CandidateCollection ); - edm::Handle masterCollection; - evt.getByToken( srcToken_, masterCollection ); - for( size_t i = 0; i < masterCollection->size(); ++i ) { - reco::CandidateBaseRef masterClone( edm::Ref( masterCollection, i ) ); - coll->push_back( masterClone->clone() ); - } - evt.put( std::move( coll ) ); -} - -#endif diff --git a/CommonTools/CandAlgos/interface/NewCandMatcher.h b/CommonTools/CandAlgos/interface/NewCandMatcher.h index c087de01c1add..d709d1458dc28 100644 --- a/CommonTools/CandAlgos/interface/NewCandMatcher.h +++ b/CommonTools/CandAlgos/interface/NewCandMatcher.h @@ -8,15 +8,8 @@ #include "CommonTools/UtilAlgos/interface/NewMatcher.h" #include "DataFormats/Candidate/interface/Candidate.h" -namespace reco { - namespace modulesNew { - template > - class CandMatcher : public Matcher { - public: - CandMatcher(const edm::ParameterSet& cfg) : Matcher(cfg) {} - ~CandMatcher() override {} - }; - - } // namespace modulesNew -} // namespace reco +namespace reco::modulesNew { + template > + using CandMatcher = Matcher; +} // namespace reco::modulesNew #endif diff --git a/CommonTools/CandAlgos/plugins/BuildFile.xml b/CommonTools/CandAlgos/plugins/BuildFile.xml index 6ffafad1a1bf3..003f0e0b1d21e 100644 --- a/CommonTools/CandAlgos/plugins/BuildFile.xml +++ b/CommonTools/CandAlgos/plugins/BuildFile.xml @@ -8,5 +8,4 @@ - diff --git a/CommonTools/CandUtils/interface/CandMatcher.h b/CommonTools/CandUtils/interface/CandMatcher.h deleted file mode 100755 index 9a0c2c1fdcbf6..0000000000000 --- a/CommonTools/CandUtils/interface/CandMatcher.h +++ /dev/null @@ -1,239 +0,0 @@ -#ifndef CandUtils_CandMatcher_h -#define CandUtils_CandMatcher_h -/* class CandMatcher - * - * \author Luca Lista, INFN - * - */ -#include -#include "DataFormats/Candidate/interface/Candidate.h" -#include "DataFormats/Common/interface/AssociationMap.h" -#include "DataFormats/Common/interface/OneToOne.h" -#include "FWCore/Utilities/interface/EDMException.h" -#include "CommonTools/CandUtils/interface/CandMapTrait.h" - -template -class CandMatcherBase { -public: - /// map type - typedef typename reco::helper::CandMapTrait::type map_type; - /// ref type - typedef typename reco::helper::CandRefTrait::ref_type ref_type; - /// refProd type - typedef typename reco::helper::CandRefTrait::refProd_type refProd_type; - /// map vector - typedef std::vector map_vector; - /// concrete candidate reference type - typedef typename map_type::key_type reference_type; - /// concrete candidate reference type - typedef typename reference_type::value_type value_type; - /// constructor - explicit CandMatcherBase( const map_vector & maps ); - /// constructor - explicit CandMatcherBase( const map_type & map ); - /// destructor - virtual ~CandMatcherBase(); - /// get match from transient reference - ref_type operator()( const reco::Candidate & ) const; - -protected: - /// get ultimate daughter (can skip status = 3 in MC) - virtual std::vector getDaughters( const reco::Candidate * ) const = 0; - /// composite candidate preselection - virtual bool compositePreselect( const reco::Candidate & c, const reco::Candidate & m ) const = 0; - /// init maps - void initMaps(); - -protected: - const std::vector & maps() const { return maps_; } -private: - /// pointers to stored maps - std::vector maps_; - /// reference to matched collectino - refProd_type matched_; - /// pointer map type - typedef std::map CandRefMap; - /// pointer map type - typedef std::map MatchedRefMap; - /// pointer map of candidates (e.g.: reco) - CandRefMap candRefs_; - /// pointer map of matched candidates (e.g.: MC truth) - MatchedRefMap matchedRefs_; - /// mother + n.daughters indices from matched - std::vector > matchedMothers_; - /// init at constructor - void init(); -}; - -template -class CandMatcher : public CandMatcherBase { -public: - /// constructor - explicit CandMatcher( const typename CandMatcherBase::map_vector & maps ); - /// constructor - explicit CandMatcher( const typename CandMatcherBase::map_type & map ); - /// destructor - virtual ~CandMatcher(); - -protected: - /// get ultimate daughter (get all in the general case) - virtual std::vector getDaughters( const reco::Candidate * ) const; - /// composite candidate preselection - virtual bool compositePreselect( const reco::Candidate & c, const reco::Candidate & m ) const; -}; - -#include -#include - -template -void CandMatcherBase::init() { - matched_ = maps_.front()->refProd().val; - for( typename map_vector::const_iterator m = maps_.begin() + 1; - m != maps_.end(); ++ m ) { - if( (*m)->refProd().val != matched_ ) - throw edm::Exception( edm::errors::InvalidReference ) - << "Multiple match maps specified matching different MC truth collections.\n" - << "Please, specify maps all matching to the same MC truth collection.\n" - << "In most of the cases you may want to match to genParticleCandidate."; - } -} - -template -CandMatcherBase::CandMatcherBase( const typename CandMatcherBase::map_vector & maps ): - maps_( maps ) { - init(); -} - -template -CandMatcherBase::CandMatcherBase( const typename CandMatcherBase::map_type & map ): - maps_( 1, & map ) { - init(); -} - -template -void CandMatcherBase::initMaps() { - using namespace reco; - using namespace std; - for( typename map_vector::const_iterator m = maps_.begin(); - m != maps_.end(); ++ m ) { - typename CandMatcherBase::map_type::ref_type::key_type cands = (*m)->refProd().key; - for( size_t i = 0; i < cands->size(); ++ i ) { - candRefs_[ & (*cands)[ i ] ] = reference_type( cands, i ); - } - const C2 & matched = * matched_; - size_t matchedSize = matched.size(); - for( size_t i = 0; i < matchedSize; ++ i ) - matchedRefs_[ & matched[ i ] ] = ref_type( matched_, i ); - matchedMothers_.resize( matchedSize ); - for( size_t i = 0; i < matchedSize; ++ i ) { - const Candidate & c = matched[ i ]; - for( Candidate::const_iterator d = c.begin(); d != c.end(); ++ d ) { - vector daus = getDaughters( & * d ); - for( size_t j = 0; j < daus.size(); ++ j ) { - const Candidate * daughter = daus[ j ]; - typename MatchedRefMap::const_iterator f = matchedRefs_.find( daughter ); - if ( f == matchedRefs_.end() ) continue; - size_t k = f->second.key(); - assert( k < matchedMothers_.size() ); - matchedMothers_[ k ].insert( i ); - } - } - } - } -} - -template -CandMatcherBase::~CandMatcherBase() { -} - -template -typename CandMatcherBase::ref_type CandMatcherBase::operator()( const reco::Candidate & c ) const { - using namespace reco; - using namespace std; - if ( c.hasMasterClone() ) - return (*this)( * c.masterClone() ); - unsigned int nDau = c.numberOfDaughters(); - const C2 & matched = * matched_; - if ( nDau > 0 ) { - // check for composite candidate c - // navigate to daughters and find parent matches - set momsIntersection, momDaughters, tmp; - for( Candidate::const_iterator d = c.begin(); d != c.end(); ++ d ) { - // check here generically if status == 3, then descend down to one more level - ref_type m = (*this)( * d ); - // if a daughter does not match, return a null ref. - if ( m.isNull() ) return ref_type(); - // get matched mother indices (fetched previously) - const set & allMomDaughters = matchedMothers_[ m.key() ]; - momDaughters.clear(); - for( set::const_iterator k = allMomDaughters.begin(); - k != allMomDaughters.end(); ++ k ) { - size_t m = * k; - if( compositePreselect( c, matched[ m ] ) ) - momDaughters.insert( m ); - } - // if no mother was found return null reference - if ( momDaughters.size() == 0 ) return ref_type(); - // the first time, momsIntersection is set to momDaughters - if ( momsIntersection.size() == 0 ) momsIntersection = momDaughters; - else { - tmp.clear(); - set_intersection( momsIntersection.begin(), momsIntersection.end(), - momDaughters.begin(), momDaughters.end(), - inserter( tmp, tmp.begin() ) ); - swap( momsIntersection, tmp ); - } - if ( momsIntersection.size() == 0 ) return ref_type(); - } - // if multiple mothers are found, return a null reference - if ( momsIntersection.size() > 1 ) return ref_type(); - // return a reference to the unique mother - return ref_type( matched_, * momsIntersection.begin() ); - } else { - // check for non-composite (leaf) candidate - // if one of the maps contains the candidate c - for( typename std::vector::const_iterator m = maps_.begin(); - m != maps_.end(); ++ m ) { - typename CandRefMap::const_iterator f = candRefs_.find( & c ); - if ( f != candRefs_.end() ) { - reference_type ref = f->second; - typename map_type::const_iterator f = (*m)->find( ref ); - if ( f != (*m)->end() ) { - return f->val; - } - } - } - return ref_type(); - } -} - -template -CandMatcher::CandMatcher( const typename CandMatcherBase::map_vector & maps ) : - CandMatcherBase( maps ) { - CandMatcherBase::initMaps(); -} - -template -CandMatcher::CandMatcher( const typename CandMatcherBase::map_type & map ) : - CandMatcherBase( map ) { - CandMatcherBase::initMaps(); -} - -template -CandMatcher::~CandMatcher() { -} - -template -std::vector CandMatcher::getDaughters( const reco::Candidate * c ) const { - std::vector v; - v.push_back( c ); - return v; -} - -template -bool CandMatcher::compositePreselect( const reco::Candidate & c, const reco::Candidate & m ) const { - // By default, check that the number of daughters is identical - return( c.numberOfDaughters() == m.numberOfDaughters() ); -} - -#endif diff --git a/CommonTools/CandUtils/interface/FastCandMatcher.h b/CommonTools/CandUtils/interface/FastCandMatcher.h deleted file mode 100755 index aad0f64bf0243..0000000000000 --- a/CommonTools/CandUtils/interface/FastCandMatcher.h +++ /dev/null @@ -1,103 +0,0 @@ -#ifndef CandUtils_FastCandMatcher_h -#define CandUtils_FastCandMatcher_h -/* class CandMatcher - * - * \author Luca Lista, INFN - * - */ -#include -#include "DataFormats/Candidate/interface/Candidate.h" -#include "DataFormats/Common/interface/AssociationMap.h" -#include "DataFormats/Common/interface/OneToOne.h" -#include "FWCore/Utilities/interface/EDMException.h" - -template -class FastCandMatcher { -public: - /// map type - typedef edm::AssociationMap > map_type; - /// map vector - typedef std::vector map_vector; - /// constructor - explicit FastCandMatcher( const map_vector & maps ); - /// constructor - explicit FastCandMatcher( const map_type & map ); - /// get match from transient reference - const reco::Candidate * operator()( const reco::Candidate & ) const; - -protected: - const std::vector & maps() const { return maps_; } -private: - /// pointers to stored maps - std::vector maps_; -}; - -template -FastCandMatcher::FastCandMatcher( const typename FastCandMatcher::map_vector & maps ): - maps_( maps ) { -} - -template -FastCandMatcher::FastCandMatcher( const typename FastCandMatcher::map_type & map ): - maps_( 1, & map ) { -} - -template -const reco::Candidate * FastCandMatcher::operator()( const reco::Candidate & c ) const { - using namespace reco; - using namespace std; - if ( c.hasMasterClone() ) - return (*this)( * c.masterClone() ); - unsigned int nDau = c.numberOfDaughters(); - if ( nDau > 0 ) { - // check for composite candidate c - // navigate to daughters and find parent matches - set momsIntersection, momDaughters, tmp; - for( Candidate::const_iterator dau = c.begin(); dau != c.end(); ++ dau ) { - // check here generically if status == 3, then descend down to one more level - const Candidate * dauMatch = (*this)( * dau ); - // if a daughter does not match, return a null ref. - if ( dauMatch == 0 ) return 0; - // get matched mothers - size_t mothers = dauMatch->numberOfMothers(); - for( size_t i = 0; i < mothers; ++ i ) { - const reco::Candidate * mom = dauMatch->mother( i ); - if ( mom != 0 && mom->pdgId() == dauMatch->pdgId() && - mom->status() == 3 && dauMatch->status() == 1 ) { - // assume a single mother at this point... - mom = mom->mother( 0 ); - } - momDaughters.insert( mom ); - } - // if no mother was found return null reference - if ( momDaughters.size() == 0 ) return 0; - // the first time, momsIntersection is set to momDaughters - if ( momsIntersection.size() == 0 ) momsIntersection = momDaughters; - else { - tmp.clear(); - set_intersection( momsIntersection.begin(), momsIntersection.end(), - momDaughters.begin(), momDaughters.end(), - inserter( tmp, tmp.begin() ) ); - swap( momsIntersection, tmp ); - } - if ( momsIntersection.size() == 0 ) return 0; - } - // if multiple mothers are found, return a null reference - if ( momsIntersection.size() > 1 ) return 0; - // return a reference to the unique mother - return * momsIntersection.begin(); - } else { - // check for non-composite (leaf) candidate - // if one of the maps contains the candidate c - for( typename std::vector::const_iterator m = maps_.begin(); - m != maps_.end(); ++ m ) { - for( typename map_type::const_iterator i = (*m)->begin(); i != (*m)->end(); ++ i ) { - if ( & * i->key == & c ) - return & * i->val; - } - } - return 0; - } -} - -#endif diff --git a/CommonTools/CandUtils/interface/NamedCandCombiner.h b/CommonTools/CandUtils/interface/NamedCandCombiner.h deleted file mode 100755 index 6f1633fc6c77f..0000000000000 --- a/CommonTools/CandUtils/interface/NamedCandCombiner.h +++ /dev/null @@ -1,150 +0,0 @@ -#ifndef CandUtils_NamedCandCombiner_h -#define CandUtils_NamedCandCombiner_h -/** \class NamedCandCombiner - * - * \author Luca Lista, INFN - * - */ -#include "CommonTools/CandUtils/interface/NamedCandCombinerBase.h" -#include "CommonTools/CandUtils/interface/AddFourMomenta.h" -#include "CommonTools/CandUtils/interface/CandSelector.h" -#include "CommonTools/UtilAlgos/interface/AnyPairSelector.h" -#include "DataFormats/Candidate/interface/NamedCompositeCandidate.h" -#include "DataFormats/Candidate/interface/ShallowClonePtrCandidate.h" -#include - -namespace combiner { - namespace helpers { - struct NormalClone { - template - static void addDaughter(CMP & cmp, const Ptr & c, std::string name) { - cmp.addDaughter(*c, name); - } - }; - - struct ShallowClone { - template - static void addDaughter(CMP & cmp, const reco::CandidatePtr & c, std::string name) { - if(c->numberOfDaughters()==0) - cmp.addDaughter(reco::ShallowClonePtrCandidate(c), name); - else - cmp.addDaughter(*c, name); - } - }; - } -} - -template -class NamedCandCombiner : public NamedCandCombinerBase { -public: - /// default constructor - NamedCandCombiner(std::string name) : - NamedCandCombinerBase(name), - select_(), selectPair_(), setup_(), name_(name) { } - /// constructor from a selector and two charges - NamedCandCombiner(std::string name, int q1, int q2) : - NamedCandCombinerBase(name, q1, q2), - select_(), selectPair_(), setup_(), name_(name) { } - /// constructor from a selector and three charges - NamedCandCombiner(std::string name, int q1, int q2, int q3 ) : - NamedCandCombinerBase(name, q1, q2, q3), - select_(), selectPair_(), setup_(), name_(name) { } - /// constructor from a selector and four charges - NamedCandCombiner(std::string name, int q1, int q2, int q3, int q4) : - NamedCandCombinerBase(name, q1, q2, q3, q4), - select_(), selectPair_(), setup_(), name_(name) { } - /// default constructor - NamedCandCombiner(std::string name, const Selector & select) : - NamedCandCombinerBase(name), - select_(select), selectPair_(), setup_(), name_(name) { } - /// constructor from a selector and two charges - NamedCandCombiner(std::string name, const Selector & select, int q1, int q2 ) : - NamedCandCombinerBase(name, q1, q2), - select_(select), selectPair_(), setup_(), name_(name) { } - /// constructor from a selector and three charges - NamedCandCombiner(std::string name, const Selector & select, int q1, int q2, int q3 ) : - NamedCandCombinerBase(name, q1, q2, q3), - select_(select), selectPair_(), setup_(), name_(name) { } - /// constructor from a selector and four charges - NamedCandCombiner(std::string name, const Selector & select, int q1, int q2, int q3, int q4 ) : - NamedCandCombinerBase(name, q1, q2, q3, q4), - select_(select), selectPair_(), setup_(), name_(name) { } - /// constructor from selector - NamedCandCombiner(std::string name, const Selector & select, const PairSelector & selectPair) : - NamedCandCombinerBase(name), - select_(select), selectPair_(selectPair), setup_(), name_(name) { } - /// constructor from a selector and two charges - NamedCandCombiner(std::string name, const Selector & select, const PairSelector & selectPair, int q1, int q2) : - NamedCandCombinerBase(name, q1, q2), - select_(select), selectPair_(selectPair), setup_(), name_(name) { } - /// constructor from a selector and three charges - NamedCandCombiner(std::string name, const Selector & select, const PairSelector & selectPair, int q1, int q2, int q3) : - NamedCandCombinerBase(name, q1, q2, q3), - select_(select), selectPair_(selectPair), setup_(), name_(name) { } - /// constructor from a selector and four charges - NamedCandCombiner(std::string name, const Selector & select, const PairSelector & selectPair, int q1, int q2, int q3, int q4) : - NamedCandCombinerBase(name, q1, q2, q3, q4), - select_(select), selectPair_(selectPair), setup_(), name_(name) { } - NamedCandCombiner(std::string name, const Selector & select, const PairSelector & selectPair, const Setup & setup) : - NamedCandCombinerBase(name), - select_(select), selectPair_(selectPair), setup_(setup), name_(name) { } - /// constructor from a selector and two charges - NamedCandCombiner(std::string name, const Selector & select, const PairSelector & selectPair, const Setup & setup, int q1, int q2) : - NamedCandCombinerBase(name, q1, q2), - select_(select), selectPair_(selectPair), setup_(setup), name_(name) { } - /// constructor from a selector and three charges - NamedCandCombiner(std::string name, const Selector & select, const PairSelector & selectPair, const Setup & setup, int q1, int q2, int q3) : - NamedCandCombinerBase(name, q1, q2, q3), - select_(select), selectPair_(selectPair), setup_(setup), name_(name) { } - /// constructor from a selector and four charges - NamedCandCombiner(std::string name, const Selector & select, const PairSelector & selectPair, const Setup & setup, int q1, int q2, int q3, int q4) : - NamedCandCombinerBase(name, q1, q2, q3, q4), - select_(select), selectPair_(selectPair), setup_(setup), name_(name) { } - /// constructor from a selector, specifying to check for charge - NamedCandCombiner(std::string name, const Selector & select, const PairSelector & selectPair, const Setup & setup,const std::vector & dauCharge) : - NamedCandCombinerBase(name, true, dauCharge), select_(select), selectPair_(selectPair), setup_(setup), name_(name) { } - /// constructor from a selector, specifying to check for charge - NamedCandCombiner( std::string name, const Selector & select, const PairSelector & selectPair, const std::vector & dauCharge ) : - NamedCandCombinerBase(name, true, dauCharge), select_(select), selectPair_(selectPair), setup_(), name_(name) { } - /// constructor from a selector, specifying to check for charge - NamedCandCombiner(std::string name, const std::vector & dauCharge) : - NamedCandCombinerBase(name, true, dauCharge), select_(), selectPair_(), setup_(), name_(name) { } - /// constructor from a selector, specifying optionally to check for charge - NamedCandCombiner(std::string name, const Selector & select, const PairSelector & selectPair, const Setup & setup, - bool checkCharge, bool checkOverlap, const std::vector & dauCharge) : - NamedCandCombinerBase(name, checkCharge, checkOverlap, dauCharge), - select_(select), selectPair_(selectPair), setup_(setup), name_(name) { } - /// return reference to setup object to allow its initialization - Setup & setup() { return setup_; } - -private: - /// select a candidate - virtual bool select(const reco::Candidate & c) const { - return select_(c); - } - /// select a candidate - virtual bool selectPair(const reco::Candidate & c1, const reco::Candidate & c2) const { - return selectPair_(c1, c2); - } - /// set kinematics to reconstructed composite - virtual void setup(reco::NamedCompositeCandidate & c) const { - setup_.set(c); - } - /// add candidate daughter - virtual void addDaughter(reco::NamedCompositeCandidate & cmp, const reco::CandidatePtr & c, std::string n) const { - Cloner::addDaughter(cmp, c, n); - } - /// candidate selector - Selector select_; - /// candidate pair selector - PairSelector selectPair_; - /// utility to setup composite candidate kinematics from daughters - Setup setup_; - /// name - std::string name_; -}; - -#endif diff --git a/CommonTools/ConditionDBWriter/interface/ConditionDBWriter.h b/CommonTools/ConditionDBWriter/interface/ConditionDBWriter.h index 01900addce52d..139a7ae3b74c6 100644 --- a/CommonTools/ConditionDBWriter/interface/ConditionDBWriter.h +++ b/CommonTools/ConditionDBWriter/interface/ConditionDBWriter.h @@ -332,8 +332,7 @@ class ConditionDBWriter : public edm::EDAnalyzer { edm::LogInfo("ConditionDBWriter") << "appending a new object to tag " << Record_ << " in since mode " << std::endl; - // The Framework will take control over the DB object now, therefore the release. - mydbservice->writeOne(objPointer.release(), since, Record_); + mydbservice->writeOne(*objPointer, since, Record_); } void setTime() { diff --git a/CommonTools/ParticleFlow/interface/ObjectSelector.h b/CommonTools/ParticleFlow/interface/ObjectSelector.h deleted file mode 100644 index 49d7280d68d7e..0000000000000 --- a/CommonTools/ParticleFlow/interface/ObjectSelector.h +++ /dev/null @@ -1,43 +0,0 @@ -#ifndef CommonTools_ParticleFlow_ObjectSelector -#define CommonTools_ParticleFlow_ObjectSelector - -#include "FWCore/ParameterSet/interface/ParameterSet.h" -#include "DataFormats/Common/interface/Handle.h" -#include "FWCore/Framework/interface/Event.h" -#include "FWCore/Framework/interface/EventSetup.h" - - -namespace edm { - class EventSetup; -} - -namespace ipf2pat { - - template< typename Selector, typename CollectionType > - class ObjectSelector { - public: - ObjectSelector(const edm::ParameterSet& ps) : - eventSetupPtr_(0), - selector_(ps) {} - - - const CollectionType& select( const edm::Handle& handleToCollection, - const edm::EventBase& event ) { - /* static edm::Event e; */ - selector_.select( handleToCollection, event, *eventSetupPtr_ ); - return selector_.selected(); - } - - - private: - const edm::EventSetup* eventSetupPtr_; - - Selector selector_; - }; - - -} - - - -#endif diff --git a/CommonTools/ParticleFlow/interface/ObjectSelectors.h b/CommonTools/ParticleFlow/interface/ObjectSelectors.h deleted file mode 100644 index a4a6a207899c3..0000000000000 --- a/CommonTools/ParticleFlow/interface/ObjectSelectors.h +++ /dev/null @@ -1,17 +0,0 @@ -#ifndef CommonTools_ParticleFlow_ObjectSelectors -#define CommonTools_ParticleFlow_ObjectSelectors - -#include "CommonTools/ParticleFlow/interface/ObjectSelector.h" -#include "CommonTools/ParticleFlow/interface/PtMinPFCandidateSelectorDefinition.h" -#include "CommonTools/ParticleFlow/interface/PdgIdPFCandidateSelectorDefinition.h" -#include "CommonTools/ParticleFlow/interface/IsolatedPFCandidateSelectorDefinition.h" -#include "DataFormats/ParticleFlowCandidate/interface/PFCandidateFwd.h" - - -namespace ipf2pat { - typedef ObjectSelector< pf2pat::PtMinPFCandidateSelectorDefinition, reco::PFCandidateCollection > PtMinPFCandidateSelector; - typedef ObjectSelector< pf2pat::PdgIdPFCandidateSelectorDefinition, reco::PFCandidateCollection > PdgIdPFCandidateSelector; - typedef ObjectSelector< pf2pat::IsolatedPFCandidateSelectorDefinition, reco::PFCandidateCollection > IsolatedPFCandidateSelector; -} - -#endif diff --git a/CommonTools/ParticleFlow/plugins/DeltaBetaWeights.cc b/CommonTools/ParticleFlow/plugins/DeltaBetaWeights.cc index b6f8165d64213..f95b194d050c1 100644 --- a/CommonTools/ParticleFlow/plugins/DeltaBetaWeights.cc +++ b/CommonTools/ParticleFlow/plugins/DeltaBetaWeights.cc @@ -1,5 +1,37 @@ -#include "CommonTools/ParticleFlow/plugins/DeltaBetaWeights.h" +// Weight for neutral particles based on distance with charged +// +// Original Author: Michail Bachtis,40 1-B08,+41227678176, +// Created: Mon Dec 9 13:18:05 CET 2013 +// +// edited by Pavel Jez +// + +#include "DataFormats/Math/interface/deltaR.h" +#include "DataFormats/ParticleFlowCandidate/interface/PFCandidate.h" +#include "DataFormats/ParticleFlowCandidate/interface/PFCandidateFwd.h" +#include "FWCore/Framework/interface/EDProducer.h" +#include "FWCore/Framework/interface/Event.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" + +#include + +class DeltaBetaWeights : public edm::EDProducer { +public: + explicit DeltaBetaWeights(const edm::ParameterSet&); + ~DeltaBetaWeights() override; + +private: + void produce(edm::Event&, const edm::EventSetup&) override; + // ----------member data --------------------------- + edm::InputTag src_; + edm::InputTag pfCharged_; + edm::InputTag pfPU_; + + edm::EDGetTokenT > pfCharged_token; + edm::EDGetTokenT > pfPU_token; + edm::EDGetTokenT > src_token; +}; DeltaBetaWeights::DeltaBetaWeights(const edm::ParameterSet& iConfig) : src_(iConfig.getParameter("src")), @@ -21,9 +53,8 @@ DeltaBetaWeights::~DeltaBetaWeights() { // (e.g. close files, deallocate resources etc.) } -// -// member functions -// +#include "FWCore/Framework/interface/MakerMacros.h" +DEFINE_FWK_MODULE(DeltaBetaWeights); // ------------ method called to produce the data ------------ void DeltaBetaWeights::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) { diff --git a/CommonTools/ParticleFlow/plugins/DeltaBetaWeights.h b/CommonTools/ParticleFlow/plugins/DeltaBetaWeights.h deleted file mode 100644 index 0c92f4b9cfe9d..0000000000000 --- a/CommonTools/ParticleFlow/plugins/DeltaBetaWeights.h +++ /dev/null @@ -1,41 +0,0 @@ - -// Weight for neutral particles based on distance with charged -// -// Original Author: Michail Bachtis,40 1-B08,+41227678176, -// Created: Mon Dec 9 13:18:05 CET 2013 -// -// edited by Pavel Jez -// - -// system include files -#include - -// user include files -#include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/EDProducer.h" -#include "FWCore/Framework/interface/Event.h" -#include "FWCore/ParameterSet/interface/ParameterSet.h" -#include "DataFormats/Math/interface/deltaR.h" -#include "DataFormats/ParticleFlowCandidate/interface/PFCandidate.h" -#include "DataFormats/ParticleFlowCandidate/interface/PFCandidateFwd.h" - -// -// class declaration -// - -class DeltaBetaWeights : public edm::EDProducer { -public: - explicit DeltaBetaWeights(const edm::ParameterSet&); - ~DeltaBetaWeights() override; - -private: - void produce(edm::Event&, const edm::EventSetup&) override; - // ----------member data --------------------------- - edm::InputTag src_; - edm::InputTag pfCharged_; - edm::InputTag pfPU_; - - edm::EDGetTokenT > pfCharged_token; - edm::EDGetTokenT > pfPU_token; - edm::EDGetTokenT > src_token; -}; diff --git a/CommonTools/ParticleFlow/plugins/PFCandIsolatorFromDeposit.cc b/CommonTools/ParticleFlow/plugins/PFCandIsolatorFromDeposit.cc index 4de7cd12c73c5..9851b3ff68c14 100644 --- a/CommonTools/ParticleFlow/plugins/PFCandIsolatorFromDeposit.cc +++ b/CommonTools/ParticleFlow/plugins/PFCandIsolatorFromDeposit.cc @@ -1,17 +1,11 @@ -#include "CommonTools/ParticleFlow/plugins/PFCandIsolatorFromDeposit.h" - -// Framework -#include "FWCore/Framework/interface/EDProducer.h" -#include "FWCore/Framework/interface/Event.h" -#include "FWCore/Framework/interface/EventSetup.h" -#include "DataFormats/Common/interface/Handle.h" -#include "FWCore/Framework/interface/MakerMacros.h" - -#include "FWCore/Framework/interface/ESHandle.h" - +#include "CommonTools/Utils/interface/StringObjectFunction.h" #include "DataFormats/Candidate/interface/CandAssociation.h" +#include "DataFormats/Candidate/interface/Candidate.h" +#include "DataFormats/Common/interface/Handle.h" +#include "DataFormats/Common/interface/OwnVector.h" #include "DataFormats/EcalDetId/interface/EcalSubdetector.h" #include "DataFormats/MuonReco/interface/Muon.h" +#include "DataFormats/MuonReco/interface/MuonFwd.h" #include "DataFormats/ParticleFlowCandidate/interface/PFCandidate.h" #include "DataFormats/RecoCandidate/interface/IsoDeposit.h" #include "DataFormats/RecoCandidate/interface/IsoDepositDirection.h" @@ -19,13 +13,64 @@ #include "DataFormats/RecoCandidate/interface/IsoDepositVetos.h" #include "DataFormats/RecoCandidate/interface/RecoCandidate.h" #include "DataFormats/TrackReco/interface/Track.h" +#include "DataFormats/TrackReco/interface/TrackFwd.h" +#include "FWCore/Framework/interface/ConsumesCollector.h" +#include "FWCore/Framework/interface/EDProducer.h" +#include "FWCore/Framework/interface/ESHandle.h" +#include "FWCore/Framework/interface/Event.h" +#include "FWCore/Framework/interface/EventSetup.h" +#include "FWCore/Framework/interface/MakerMacros.h" +#include "FWCore/Framework/interface/stream/EDProducer.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" -#include +#include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "PhysicsTools/IsolationAlgos/interface/EventDependentAbsVeto.h" +#include "PhysicsTools/IsolationAlgos/interface/IsoDepositVetoFactory.h" +#include #include #include -#include "PhysicsTools/IsolationAlgos/interface/IsoDepositVetoFactory.h" +class PFCandIsolatorFromDeposits : public edm::stream::EDProducer<> { +public: + typedef edm::ValueMap CandDoubleMap; + + enum Mode { Sum, SumRelative, Sum2, Sum2Relative, Max, MaxRelative, Count, NearestDR }; + PFCandIsolatorFromDeposits(const edm::ParameterSet &); + + ~PFCandIsolatorFromDeposits() override; + + void produce(edm::Event &, const edm::EventSetup &) override; + +private: + class SingleDeposit { + public: + SingleDeposit(const edm::ParameterSet &, edm::ConsumesCollector &&iC); + void cleanup(); + void open(const edm::Event &iEvent, const edm::EventSetup &iSetup); + double compute(const reco::CandidateBaseRef &cand); + const reco::IsoDepositMap &map() { return *hDeps_; } + + private: + Mode mode_; + edm::EDGetTokenT srcToken_; + double deltaR_; + bool usesFunction_; + double weight_; + + StringObjectFunction weightExpr_; + reco::isodeposit::AbsVetos barrelVetos_; + reco::isodeposit::AbsVetos endcapVetos_; + reco::isodeposit::EventDependentAbsVetos evdepVetos_; // note: these are a subset of the above. Don't delete twice! + bool skipDefaultVeto_; + bool usePivotForBarrelEndcaps_; + edm::Handle hDeps_; // transient + + bool isNumber(const std::string &str) const; + double toNumber(const std::string &str) const; + }; + // datamembers + std::vector sources_; +}; using namespace edm; using namespace reco; diff --git a/CommonTools/ParticleFlow/plugins/PFCandIsolatorFromDeposit.h b/CommonTools/ParticleFlow/plugins/PFCandIsolatorFromDeposit.h deleted file mode 100644 index 77bbc20bde3de..0000000000000 --- a/CommonTools/ParticleFlow/plugins/PFCandIsolatorFromDeposit.h +++ /dev/null @@ -1,68 +0,0 @@ -#ifndef PFCandIsolatorFromDeposits_H -#define PFCandIsolatorFromDeposits_H - -#include "FWCore/Framework/interface/stream/EDProducer.h" -#include "FWCore/ParameterSet/interface/ParameterSet.h" -#include "FWCore/Framework/interface/ConsumesCollector.h" - -#include "DataFormats/TrackReco/interface/TrackFwd.h" -#include "DataFormats/MuonReco/interface/MuonFwd.h" -#include "DataFormats/RecoCandidate/interface/IsoDepositFwd.h" -#include "DataFormats/RecoCandidate/interface/IsoDeposit.h" -#include "PhysicsTools/IsolationAlgos/interface/EventDependentAbsVeto.h" - -#include "DataFormats/Candidate/interface/Candidate.h" -#include "CommonTools/Utils/interface/StringObjectFunction.h" -#include "DataFormats/Common/interface/OwnVector.h" - -#include - -namespace edm { - class Event; -} -namespace edm { - class EventSetup; -} - -class PFCandIsolatorFromDeposits : public edm::stream::EDProducer<> { -public: - typedef edm::ValueMap CandDoubleMap; - - enum Mode { Sum, SumRelative, Sum2, Sum2Relative, Max, MaxRelative, Count, NearestDR }; - PFCandIsolatorFromDeposits(const edm::ParameterSet &); - - ~PFCandIsolatorFromDeposits() override; - - void produce(edm::Event &, const edm::EventSetup &) override; - -private: - class SingleDeposit { - public: - SingleDeposit(const edm::ParameterSet &, edm::ConsumesCollector &&iC); - void cleanup(); - void open(const edm::Event &iEvent, const edm::EventSetup &iSetup); - double compute(const reco::CandidateBaseRef &cand); - const reco::IsoDepositMap &map() { return *hDeps_; } - - private: - Mode mode_; - edm::EDGetTokenT srcToken_; - double deltaR_; - bool usesFunction_; - double weight_; - - StringObjectFunction weightExpr_; - reco::isodeposit::AbsVetos barrelVetos_; - reco::isodeposit::AbsVetos endcapVetos_; - reco::isodeposit::EventDependentAbsVetos evdepVetos_; // note: these are a subset of the above. Don't delete twice! - bool skipDefaultVeto_; - bool usePivotForBarrelEndcaps_; - edm::Handle hDeps_; // transient - - bool isNumber(const std::string &str) const; - double toNumber(const std::string &str) const; - }; - // datamembers - std::vector sources_; -}; -#endif diff --git a/CommonTools/ParticleFlow/plugins/PFCandidateFromFwdPtrProducer.h b/CommonTools/ParticleFlow/plugins/PFCandidateFromFwdPtrProducer.cc similarity index 60% rename from CommonTools/ParticleFlow/plugins/PFCandidateFromFwdPtrProducer.h rename to CommonTools/ParticleFlow/plugins/PFCandidateFromFwdPtrProducer.cc index bf00abfe5c274..2dd5cbb653f16 100644 --- a/CommonTools/ParticleFlow/plugins/PFCandidateFromFwdPtrProducer.h +++ b/CommonTools/ParticleFlow/plugins/PFCandidateFromFwdPtrProducer.cc @@ -1,7 +1,13 @@ #include "CommonTools/UtilAlgos/interface/ProductFromFwdPtrProducer.h" +#include "DataFormats/JetReco/interface/PFJet.h" #include "DataFormats/ParticleFlowCandidate/interface/PFCandidate.h" #include "DataFormats/ParticleFlowCandidate/interface/PFCandidateFwd.h" #include "CommonTools/ParticleFlow/interface/PFCandidateWithSrcPtrFactory.h" typedef edm::ProductFromFwdPtrProducer PFCandidateFromFwdPtrProducer; +typedef edm::ProductFromFwdPtrProducer PFJetFromFwdPtrProducer; + +#include "FWCore/Framework/interface/MakerMacros.h" +DEFINE_FWK_MODULE(PFCandidateFromFwdPtrProducer); +DEFINE_FWK_MODULE(PFJetFromFwdPtrProducer); diff --git a/CommonTools/ParticleFlow/plugins/PFCandidateFwdPtrCollectionFilter.h b/CommonTools/ParticleFlow/plugins/PFCandidateFwdPtrCollectionFilter.cc similarity index 83% rename from CommonTools/ParticleFlow/plugins/PFCandidateFwdPtrCollectionFilter.h rename to CommonTools/ParticleFlow/plugins/PFCandidateFwdPtrCollectionFilter.cc index 59180562e777f..23d388f1eb890 100644 --- a/CommonTools/ParticleFlow/plugins/PFCandidateFwdPtrCollectionFilter.h +++ b/CommonTools/ParticleFlow/plugins/PFCandidateFwdPtrCollectionFilter.cc @@ -11,3 +11,7 @@ typedef edm::FwdPtrCollectionFilter PFCandidateFwdPtrCollectionPdgIdFilter; + +#include "FWCore/Framework/interface/MakerMacros.h" +DEFINE_FWK_MODULE(PFCandidateFwdPtrCollectionStringFilter); +DEFINE_FWK_MODULE(PFCandidateFwdPtrCollectionPdgIdFilter); diff --git a/CommonTools/ParticleFlow/plugins/PFJetFwdPtrProducer.h b/CommonTools/ParticleFlow/plugins/PFJetFwdPtrProducer.cc similarity index 71% rename from CommonTools/ParticleFlow/plugins/PFJetFwdPtrProducer.h rename to CommonTools/ParticleFlow/plugins/PFJetFwdPtrProducer.cc index baa72c343b8ef..9aa6ea159b46d 100644 --- a/CommonTools/ParticleFlow/plugins/PFJetFwdPtrProducer.h +++ b/CommonTools/ParticleFlow/plugins/PFJetFwdPtrProducer.cc @@ -3,3 +3,6 @@ #include "DataFormats/JetReco/interface/PFJetCollection.h" typedef edm::FwdPtrProducer PFJetFwdPtrProducer; + +#include "FWCore/Framework/interface/MakerMacros.h" +DEFINE_FWK_MODULE(PFJetFwdPtrProducer); diff --git a/CommonTools/ParticleFlow/plugins/PFMET.cc b/CommonTools/ParticleFlow/plugins/PFMET.cc index cc17a52f91b19..7810cc771598f 100644 --- a/CommonTools/ParticleFlow/plugins/PFMET.cc +++ b/CommonTools/ParticleFlow/plugins/PFMET.cc @@ -1,16 +1,45 @@ -#include "CommonTools/ParticleFlow/plugins/PFMET.h" +/**\class PFMET +\brief Computes the MET from a collection of PFCandidates. HF missing! -#include "DataFormats/ParticleFlowCandidate/interface/PFCandidate.h" +\todo Add HF energy to the MET calculation (access HF towers) + +\author Colin Bernet +\date february 2008 +*/ +#include "CommonTools/ParticleFlow/interface/PFMETAlgo.h" #include "DataFormats/METReco/interface/MET.h" #include "DataFormats/METReco/interface/METFwd.h" #include "DataFormats/Math/interface/LorentzVector.h" - +#include "DataFormats/ParticleFlowCandidate/interface/PFCandidate.h" +#include "FWCore/Framework/interface/EDProducer.h" #include "FWCore/Framework/interface/ESHandle.h" - +#include "FWCore/Framework/interface/Event.h" +#include "FWCore/Framework/interface/EventSetup.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" #include "FWCore/Utilities/interface/Exception.h" -#include "FWCore/Framework/interface/EventSetup.h" + +#include +#include + +class PFMET : public edm::EDProducer { +public: + explicit PFMET(const edm::ParameterSet&); + + ~PFMET() override; + + void produce(edm::Event&, const edm::EventSetup&) override; + + void beginJob() override; + +private: + /// Input PFCandidates + edm::InputTag inputTagPFCandidates_; + edm::EDGetTokenT tokenPFCandidates_; + + pf2pat::PFMETAlgo pfMETAlgo_; +}; using namespace std; using namespace edm; @@ -26,6 +55,9 @@ PFMET::PFMET(const edm::ParameterSet& iConfig) : pfMETAlgo_(iConfig) { LogDebug("PFMET") << " input collection : " << inputTagPFCandidates_; } +#include "FWCore/Framework/interface/MakerMacros.h" +DEFINE_FWK_MODULE(PFMET); + PFMET::~PFMET() {} void PFMET::beginJob() {} diff --git a/CommonTools/ParticleFlow/plugins/PFMET.h b/CommonTools/ParticleFlow/plugins/PFMET.h deleted file mode 100644 index 5b7f253a61826..0000000000000 --- a/CommonTools/ParticleFlow/plugins/PFMET.h +++ /dev/null @@ -1,45 +0,0 @@ -#ifndef PhysicsTools_PFCandProducer_PFMET_ -#define PhysicsTools_PFCandProducer_PFMET_ - -// system include files -#include -#include - -// user include files -#include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/EDProducer.h" -#include "FWCore/ParameterSet/interface/ParameterSet.h" - -#include "FWCore/Framework/interface/Event.h" -#include "FWCore/Framework/interface/MakerMacros.h" - -#include "CommonTools/ParticleFlow/interface/PFMETAlgo.h" - -/**\class PFMET -\brief Computes the MET from a collection of PFCandidates. HF missing! - -\todo Add HF energy to the MET calculation (access HF towers) - -\author Colin Bernet -\date february 2008 -*/ - -class PFMET : public edm::EDProducer { -public: - explicit PFMET(const edm::ParameterSet&); - - ~PFMET() override; - - void produce(edm::Event&, const edm::EventSetup&) override; - - void beginJob() override; - -private: - /// Input PFCandidates - edm::InputTag inputTagPFCandidates_; - edm::EDGetTokenT tokenPFCandidates_; - - pf2pat::PFMETAlgo pfMETAlgo_; -}; - -#endif diff --git a/CommonTools/ParticleFlow/plugins/PFNoPileUpPacked.cc b/CommonTools/ParticleFlow/plugins/PFNoPileUpPacked.cc new file mode 100644 index 0000000000000..5a94c6cd3bb0b --- /dev/null +++ b/CommonTools/ParticleFlow/plugins/PFNoPileUpPacked.cc @@ -0,0 +1,91 @@ +// system include files +#include +#include + +// user include files +#include "FWCore/Framework/interface/Frameworkfwd.h" +#include "FWCore/Framework/interface/stream/EDProducer.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" + +#include "FWCore/Framework/interface/Event.h" +#include "FWCore/Framework/interface/MakerMacros.h" + +#include "DataFormats/Candidate/interface/Candidate.h" +#include "DataFormats/VertexReco/interface/VertexFwd.h" +#include "DataFormats/Common/interface/Association.h" + +#include "DataFormats/VertexReco/interface/Vertex.h" + +#include "FWCore/Utilities/interface/Exception.h" +#include "FWCore/Framework/interface/EventSetup.h" + +#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" +#include "FWCore/ParameterSet/interface/ParameterSetDescription.h" + +using namespace std; +using namespace edm; +using namespace reco; + +/**\class PFNoPileUpPacked +\brief Identifies pile-up candidates from a collection of Candidates, and +produces the corresponding collection of NoPileUpCandidates. + +\author Andreas Hinzmann +\date May 2021 + +*/ + +class PFNoPileUpPacked : public edm::stream::EDProducer<> { +public: + typedef edm::View CandidateView; + typedef edm::Association CandToVertex; + + explicit PFNoPileUpPacked(const edm::ParameterSet&); + + ~PFNoPileUpPacked() override = default; + + void produce(edm::Event&, const edm::EventSetup&) override; + + static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); + +private: + edm::EDGetTokenT tokenCandidatesView_; + edm::EDGetTokenT tokenVertices_; + edm::EDGetTokenT tokenVertexAssociation_; + edm::EDGetTokenT> tokenVertexAssociationQuality_; + int vertexAssociationQuality_; +}; + +PFNoPileUpPacked::PFNoPileUpPacked(const edm::ParameterSet& iConfig) { + tokenCandidatesView_ = consumes(iConfig.getParameter("candidates")); + vertexAssociationQuality_ = iConfig.getParameter("vertexAssociationQuality"); + tokenVertexAssociation_ = consumes(iConfig.getParameter("vertexAssociation")); + tokenVertexAssociationQuality_ = + consumes>(iConfig.getParameter("vertexAssociation")); + produces>(); +} + +void PFNoPileUpPacked::produce(Event& iEvent, const EventSetup& iSetup) { + unique_ptr> pOutput(new edm::PtrVector); + Handle candidateView; + iEvent.getByToken(tokenCandidatesView_, candidateView); + const edm::Association& associatedPV = iEvent.get(tokenVertexAssociation_); + const edm::ValueMap& associationQuality = iEvent.get(tokenVertexAssociationQuality_); + for (const auto& p : candidateView->ptrs()) { + const reco::VertexRef& PVOrig = associatedPV[p]; + int quality = associationQuality[p]; + if (!(PVOrig.isNonnull() && (PVOrig.key() > 0) && (quality >= vertexAssociationQuality_))) + pOutput->push_back(p); + } + iEvent.put(std::move(pOutput)); +} + +void PFNoPileUpPacked::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { + edm::ParameterSetDescription desc; + desc.add("candidates", edm::InputTag("packedPFCandidates")); + desc.add("vertexAssociationQuality", 7); + desc.add("vertexAssociation", edm::InputTag("packedPrimaryVertexAssociationJME", "original")); + descriptions.addWithDefaultLabel(desc); +} + +DEFINE_FWK_MODULE(PFNoPileUpPacked); \ No newline at end of file diff --git a/CommonTools/ParticleFlow/plugins/PFPileUp.cc b/CommonTools/ParticleFlow/plugins/PFPileUp.cc index e3681db53e9c4..35b328035eda6 100644 --- a/CommonTools/ParticleFlow/plugins/PFPileUp.cc +++ b/CommonTools/ParticleFlow/plugins/PFPileUp.cc @@ -1,4 +1,20 @@ -#include "CommonTools/ParticleFlow/plugins/PFPileUp.h" +// system include files +#include +#include + +// user include files +#include "FWCore/Framework/interface/Frameworkfwd.h" +#include "FWCore/Framework/interface/stream/EDProducer.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" + +#include "FWCore/Framework/interface/Event.h" +#include "FWCore/Framework/interface/MakerMacros.h" + +#include "DataFormats/ParticleFlowCandidate/interface/PFCandidateFwd.h" +#include "DataFormats/VertexReco/interface/VertexFwd.h" +#include "DataFormats/Common/interface/Association.h" + +#include "CommonTools/ParticleFlow/interface/PFPileUpAlgo.h" #include "DataFormats/ParticleFlowCandidate/interface/PileUpPFCandidate.h" #include "DataFormats/ParticleFlowCandidate/interface/PileUpPFCandidateFwd.h" @@ -6,7 +22,6 @@ #include "FWCore/Framework/interface/ESHandle.h" -// #include "FWCore/MessageLogger/interface/MessageLogger.h" #include "FWCore/Utilities/interface/Exception.h" #include "FWCore/Framework/interface/EventSetup.h" @@ -14,12 +29,69 @@ using namespace std; using namespace edm; using namespace reco; +/**\class PFPileUp +\brief Identifies pile-up candidates from a collection of PFCandidates, and +produces the corresponding collection of PileUpCandidates. + +\author Colin Bernet +\date february 2008 +\updated Florian Beaudette 30/03/2012 + +*/ + +class PFPileUp : public edm::stream::EDProducer<> { +public: + typedef std::vector> PFCollection; + typedef edm::View PFView; + typedef std::vector PFCollectionByValue; + typedef edm::Association CandToVertex; + + explicit PFPileUp(const edm::ParameterSet&); + + ~PFPileUp() override; + + void produce(edm::Event&, const edm::EventSetup&) override; + +private: + PFPileUpAlgo pileUpAlgo_; + + /// PFCandidates to be analyzed + edm::EDGetTokenT tokenPFCandidates_; + /// fall-back token + edm::EDGetTokenT tokenPFCandidatesView_; + + /// vertices + edm::EDGetTokenT tokenVertices_; + + /// enable PFPileUp selection + bool enable_; + + /// verbose ? + bool verbose_; + + /// use the closest z vertex if a track is not in a vertex + bool checkClosestZVertex_; + + edm::EDGetTokenT tokenVertexAssociation_; + edm::EDGetTokenT> tokenVertexAssociationQuality_; + bool fUseVertexAssociation; + int vertexAssociationQuality_; +}; + PFPileUp::PFPileUp(const edm::ParameterSet& iConfig) { tokenPFCandidates_ = consumes(iConfig.getParameter("PFCandidates")); tokenPFCandidatesView_ = mayConsume(iConfig.getParameter("PFCandidates")); tokenVertices_ = consumes(iConfig.getParameter("Vertices")); + fUseVertexAssociation = iConfig.getParameter("useVertexAssociation"); + vertexAssociationQuality_ = iConfig.getParameter("vertexAssociationQuality"); + if (fUseVertexAssociation) { + tokenVertexAssociation_ = consumes(iConfig.getParameter("vertexAssociation")); + tokenVertexAssociationQuality_ = + consumes>(iConfig.getParameter("vertexAssociation")); + } + enable_ = iConfig.getParameter("Enable"); verbose_ = iConfig.getUntrackedParameter("verbose", false); @@ -93,10 +165,22 @@ void PFPileUp::produce(Event& iEvent, const EventSetup& iSetup) { "error."); } - pileUpAlgo_.process(*pfCandidatesRef, *vertices); - pOutput->insert( - pOutput->end(), pileUpAlgo_.getPFCandidatesFromPU().begin(), pileUpAlgo_.getPFCandidatesFromPU().end()); - + if (fUseVertexAssociation) { + const edm::Association& associatedPV = iEvent.get(tokenVertexAssociation_); + const edm::ValueMap& associationQuality = iEvent.get(tokenVertexAssociationQuality_); + PFCollection pfCandidatesFromPU; + for (auto& p : (*pfCandidatesRef)) { + const reco::VertexRef& PVOrig = associatedPV[p]; + int quality = associationQuality[p]; + if (PVOrig.isNonnull() && (PVOrig.key() > 0) && (quality >= vertexAssociationQuality_)) + pfCandidatesFromPU.push_back(p); + } + pOutput->insert(pOutput->end(), pfCandidatesFromPU.begin(), pfCandidatesFromPU.end()); + } else { + pileUpAlgo_.process(*pfCandidatesRef, *vertices); + pOutput->insert( + pOutput->end(), pileUpAlgo_.getPFCandidatesFromPU().begin(), pileUpAlgo_.getPFCandidatesFromPU().end()); + } // for ( PFCollection::const_iterator byValueBegin = pileUpAlgo_.getPFCandidatesFromPU().begin(), // byValueEnd = pileUpAlgo_.getPFCandidatesFromPU().end(), ibyValue = byValueBegin; // ibyValue != byValueEnd; ++ibyValue ) { @@ -108,3 +192,4 @@ void PFPileUp::produce(Event& iEvent, const EventSetup& iSetup) { iEvent.put(std::move(pOutput)); // iEvent.put(std::move(pOutputByValue)); } +DEFINE_FWK_MODULE(PFPileUp); diff --git a/CommonTools/ParticleFlow/plugins/PFPileUp.h b/CommonTools/ParticleFlow/plugins/PFPileUp.h deleted file mode 100644 index 6016386986150..0000000000000 --- a/CommonTools/ParticleFlow/plugins/PFPileUp.h +++ /dev/null @@ -1,64 +0,0 @@ -#ifndef PhysicsTools_PFCandProducer_PFPileUp_ -#define PhysicsTools_PFCandProducer_PFPileUp_ - -// system include files -#include -#include - -// user include files -#include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/stream/EDProducer.h" -#include "FWCore/ParameterSet/interface/ParameterSet.h" - -#include "FWCore/Framework/interface/Event.h" -#include "FWCore/Framework/interface/MakerMacros.h" - -#include "DataFormats/ParticleFlowCandidate/interface/PFCandidateFwd.h" -#include "DataFormats/VertexReco/interface/VertexFwd.h" - -#include "CommonTools/ParticleFlow/interface/PFPileUpAlgo.h" - -/**\class PFPileUp -\brief Identifies pile-up candidates from a collection of PFCandidates, and -produces the corresponding collection of PileUpCandidates. - -\author Colin Bernet -\date february 2008 -\updated Florian Beaudette 30/03/2012 - -*/ - -class PFPileUp : public edm::stream::EDProducer<> { -public: - typedef std::vector > PFCollection; - typedef edm::View PFView; - typedef std::vector PFCollectionByValue; - - explicit PFPileUp(const edm::ParameterSet&); - - ~PFPileUp() override; - - void produce(edm::Event&, const edm::EventSetup&) override; - -private: - PFPileUpAlgo pileUpAlgo_; - - /// PFCandidates to be analyzed - edm::EDGetTokenT tokenPFCandidates_; - /// fall-back token - edm::EDGetTokenT tokenPFCandidatesView_; - - /// vertices - edm::EDGetTokenT tokenVertices_; - - /// enable PFPileUp selection - bool enable_; - - /// verbose ? - bool verbose_; - - /// use the closest z vertex if a track is not in a vertex - bool checkClosestZVertex_; -}; - -#endif diff --git a/CommonTools/ParticleFlow/plugins/PFTauFwdPtrProducer.h b/CommonTools/ParticleFlow/plugins/PFTauFwdPtrProducer.cc similarity index 70% rename from CommonTools/ParticleFlow/plugins/PFTauFwdPtrProducer.h rename to CommonTools/ParticleFlow/plugins/PFTauFwdPtrProducer.cc index b6bf2053c90b4..920402228451a 100644 --- a/CommonTools/ParticleFlow/plugins/PFTauFwdPtrProducer.h +++ b/CommonTools/ParticleFlow/plugins/PFTauFwdPtrProducer.cc @@ -3,3 +3,6 @@ #include "DataFormats/TauReco/interface/PFTauFwd.h" typedef edm::FwdPtrProducer PFTauFwdPtrProducer; + +#include "FWCore/Framework/interface/MakerMacros.h" +DEFINE_FWK_MODULE(PFTauFwdPtrProducer); diff --git a/CommonTools/ParticleFlow/plugins/SealModule.cc b/CommonTools/ParticleFlow/plugins/SealModule.cc deleted file mode 100644 index eb561b1381c31..0000000000000 --- a/CommonTools/ParticleFlow/plugins/SealModule.cc +++ /dev/null @@ -1,23 +0,0 @@ -#include "FWCore/Framework/interface/MakerMacros.h" - -#include "CommonTools/ParticleFlow/plugins/PFMET.h" -#include "CommonTools/ParticleFlow/plugins/PFPileUp.h" -#include "CommonTools/ParticleFlow/plugins/PFCandidateFwdPtrCollectionFilter.h" -#include "CommonTools/ParticleFlow/plugins/PFJetFwdPtrProducer.h" -#include "CommonTools/ParticleFlow/plugins/PFTauFwdPtrProducer.h" -#include "CommonTools/ParticleFlow/plugins/PFCandidateFromFwdPtrProducer.h" -#include "CommonTools/ParticleFlow/plugins/DeltaBetaWeights.h" - -DEFINE_FWK_MODULE(PFMET); -DEFINE_FWK_MODULE(PFPileUp); - -DEFINE_FWK_MODULE(PFCandidateFwdPtrCollectionStringFilter); -DEFINE_FWK_MODULE(PFCandidateFwdPtrCollectionPdgIdFilter); -DEFINE_FWK_MODULE(PFJetFwdPtrProducer); -DEFINE_FWK_MODULE(PFTauFwdPtrProducer); -DEFINE_FWK_MODULE(PFCandidateFromFwdPtrProducer); - -typedef edm::ProductFromFwdPtrProducer PFJetFromFwdPtrProducer; -DEFINE_FWK_MODULE(PFJetFromFwdPtrProducer); - -DEFINE_FWK_MODULE(DeltaBetaWeights); diff --git a/CommonTools/ParticleFlow/plugins/TopProjector.cc b/CommonTools/ParticleFlow/plugins/TopProjector.cc index 40cba4ecfb171..6b30fd6e4dc1b 100644 --- a/CommonTools/ParticleFlow/plugins/TopProjector.cc +++ b/CommonTools/ParticleFlow/plugins/TopProjector.cc @@ -1,26 +1,250 @@ -#include "CommonTools/ParticleFlow/plugins/TopProjector.h" +/**\class TopProjector +\brief -#include "DataFormats/ParticleFlowCandidate/interface/PileUpPFCandidate.h" -#include "DataFormats/ParticleFlowCandidate/interface/PileUpPFCandidateFwd.h" -#include "DataFormats/ParticleFlowCandidate/interface/IsolatedPFCandidate.h" -#include "DataFormats/ParticleFlowCandidate/interface/IsolatedPFCandidateFwd.h" +\author Colin Bernet +\date february 2008 +*/ + +#include "DataFormats/Candidate/interface/CandidateFwd.h" +#include "DataFormats/Candidate/interface/OverlapChecker.h" #include "DataFormats/JetReco/interface/PFJet.h" #include "DataFormats/JetReco/interface/PFJetCollection.h" +#include "DataFormats/Math/interface/deltaR.h" +#include "DataFormats/ParticleFlowCandidate/interface/IsolatedPFCandidate.h" +#include "DataFormats/ParticleFlowCandidate/interface/IsolatedPFCandidateFwd.h" +#include "DataFormats/ParticleFlowCandidate/interface/PFCandidateFwd.h" +#include "DataFormats/ParticleFlowCandidate/interface/PileUpPFCandidate.h" +#include "DataFormats/ParticleFlowCandidate/interface/PileUpPFCandidateFwd.h" +#include "DataFormats/Provenance/interface/ProductID.h" #include "DataFormats/TauReco/interface/PFTau.h" #include "DataFormats/TauReco/interface/PFTauFwd.h" - -//TODO just for testing, remove this #include "DataFormats/TrackReco/interface/Track.h" - #include "FWCore/Framework/interface/ESHandle.h" - -// #include "FWCore/MessageLogger/interface/MessageLogger.h" -#include "FWCore/Utilities/interface/Exception.h" +#include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/EventSetup.h" +#include "FWCore/Framework/interface/stream/EDProducer.h" +#include "FWCore/MessageLogger/interface/MessageLogger.h" +#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/ParameterSet/interface/ParameterSetDescription.h" +#include "FWCore/Utilities/interface/Exception.h" -#include "DataFormats/Math/interface/deltaR.h" +#include +#include +#include -#include "FWCore/Framework/interface/MakerMacros.h" +/// This checks a slew of possible overlaps for FwdPtr and derivatives. +template +class TopProjectorFwdPtrOverlap { +public: + typedef edm::FwdPtr TopFwdPtr; + typedef edm::FwdPtr BottomFwdPtr; + + explicit TopProjectorFwdPtrOverlap() { bottom_ = 0; } + + explicit TopProjectorFwdPtrOverlap(edm::ParameterSet const& iConfig) + : bottom_(nullptr), matchByPtrDirect_(iConfig.getParameter("matchByPtrDirect")) {} + + inline void setBottom(BottomFwdPtr const& bottom) { bottom_ = ⊥ } + + bool operator()(TopFwdPtr const& top) const { + if (std::is_same::value && matchByPtrDirect_) + return top.ptr().refCore() == bottom_->ptr().refCore() && top.ptr().key() == bottom_->ptr().key(); + bool topFwdGood = top.ptr().isNonnull() && top.ptr().isAvailable(); + bool topBckGood = top.backPtr().isNonnull() && top.backPtr().isAvailable(); + bool bottomFwdGood = bottom_->ptr().isNonnull() && bottom_->ptr().isAvailable(); + bool bottomBckGood = bottom_->backPtr().isNonnull() && bottom_->backPtr().isAvailable(); + + bool matched = (topFwdGood && bottomFwdGood && top.ptr().refCore() == bottom_->ptr().refCore() && + top.ptr().key() == bottom_->ptr().key()) || + (topFwdGood && bottomBckGood && top.ptr().refCore() == bottom_->backPtr().refCore() && + top.ptr().key() == bottom_->backPtr().key()) || + (topBckGood && bottomFwdGood && top.backPtr().refCore() == bottom_->ptr().refCore() && + top.backPtr().key() == bottom_->ptr().key()) || + (topBckGood && bottomBckGood && top.backPtr().refCore() == bottom_->backPtr().refCore() && + top.backPtr().key() == bottom_->backPtr().key()); + if (!matched) { + for (unsigned isource = 0; isource < top->numberOfSourceCandidatePtrs(); ++isource) { + reco::CandidatePtr const& topSrcPtr = top->sourceCandidatePtr(isource); + bool topSrcGood = topSrcPtr.isNonnull() && topSrcPtr.isAvailable(); + if ((topSrcGood && bottomFwdGood && topSrcPtr.refCore() == bottom_->ptr().refCore() && + topSrcPtr.key() == bottom_->ptr().key()) || + (topSrcGood && bottomBckGood && topSrcPtr.refCore() == bottom_->backPtr().refCore() && + topSrcPtr.key() == bottom_->backPtr().key())) { + matched = true; + break; + } + } + } + if (!matched) { + for (unsigned isource = 0; isource < (*bottom_)->numberOfSourceCandidatePtrs(); ++isource) { + reco::CandidatePtr const& bottomSrcPtr = (*bottom_)->sourceCandidatePtr(isource); + bool bottomSrcGood = bottomSrcPtr.isNonnull() && bottomSrcPtr.isAvailable(); + if ((topFwdGood && bottomSrcGood && bottomSrcPtr.refCore() == top.ptr().refCore() && + bottomSrcPtr.key() == top.ptr().key()) || + (topBckGood && bottomSrcGood && bottomSrcPtr.refCore() == top.backPtr().refCore() && + bottomSrcPtr.key() == top.backPtr().key())) { + matched = true; + break; + } + } + } + + return matched; + } + +protected: + BottomFwdPtr const* bottom_; + const bool matchByPtrDirect_ = false; +}; + +/// This checks matching based on delta R +template +class TopProjectorDeltaROverlap { +public: + typedef edm::FwdPtr TopFwdPtr; + typedef edm::FwdPtr BottomFwdPtr; + + explicit TopProjectorDeltaROverlap() { bottom_ = 0; } + explicit TopProjectorDeltaROverlap(edm::ParameterSet const& config) + : deltaR2_(config.getParameter("deltaR")), + bottom_(nullptr), + bottomCPtr_(nullptr), + botEta_(-999.f), + botPhi_(0.f) { + deltaR2_ *= deltaR2_; + } + + inline void setBottom(BottomFwdPtr const& bottom) { + bottom_ = ⊥ + bottomCPtr_ = &**bottom_; + botEta_ = bottomCPtr_->eta(); + botPhi_ = bottomCPtr_->phi(); + } + + bool operator()(TopFwdPtr const& top) const { + const Top& oTop = *top; + float topEta = oTop.eta(); + float topPhi = oTop.phi(); + bool matched = reco::deltaR2(topEta, topPhi, botEta_, botPhi_) < deltaR2_; + return matched; + } + +protected: + double deltaR2_; + BottomFwdPtr const* bottom_; + const Bottom* bottomCPtr_; + float botEta_, botPhi_; +}; + +template > +class TopProjector : public edm::stream::EDProducer<> { +public: + typedef std::vector TopCollection; + typedef edm::FwdPtr TopFwdPtr; + typedef std::vector TopFwdPtrCollection; + + typedef std::vector BottomCollection; + typedef edm::FwdPtr BottomFwdPtr; + typedef std::vector BottomFwdPtrCollection; + + TopProjector(const edm::ParameterSet&); + + ~TopProjector() override = default; + + static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); + + void produce(edm::Event&, const edm::EventSetup&) override; + +private: + /// Matching method. + Matcher match_; + + /// enable? if not, all candidates in the bottom collection are copied to the output collection + const bool enable_; + + /// name of the top projection + const std::string name_; + + /// input tag for the top (masking) collection + const edm::EDGetTokenT tokenTop_; + + /// input tag for the masked collection. + const edm::EDGetTokenT tokenBottom_; +}; + +template +TopProjector::TopProjector(const edm::ParameterSet& iConfig) + : match_(iConfig), + enable_(iConfig.getParameter("enable")), + name_(iConfig.getUntrackedParameter("name", "No Name")), + tokenTop_(consumes(iConfig.getParameter("topCollection"))), + tokenBottom_(consumes(iConfig.getParameter("bottomCollection"))) { + // will produce a collection of the unmasked candidates in the + // bottom collection + produces(); +} + +template +void TopProjector::fillDescriptions(edm::ConfigurationDescriptions& desc) { + edm::ParameterSetDescription psD; + psD.add("enable"); + if (std::is_same>::value) + psD.add("deltaR"); + psD.addUntracked("name", "No Name"); + psD.add("topCollection"); + psD.add("bottomCollection"); + if (std::is_same>::value) + psD.add("matchByPtrDirect", false)->setComment("fast check by ptr() only"); + desc.addWithDefaultLabel(psD); +} + +template +void TopProjector::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) { + // get the various collections + + // Access the masking collection + auto const& tops = iEvent.get(tokenTop_); + std::list topsList; + + for (auto const& top : tops) { + topsList.push_back(top); + } + + // Access the collection to + // be masked by the other ones + auto const& bottoms = iEvent.get(tokenBottom_); + + // output collection of FwdPtrs to objects, + // selected from the Bottom collection + std::unique_ptr pBottomFwdPtrOutput(new BottomFwdPtrCollection); + + LogDebug("TopProjection") << " Remaining candidates in the bottom collection ------ "; + + int iB = -1; + for (auto const& bottom : bottoms) { + iB++; + match_.setBottom(bottom); + auto found = topsList.end(); + if (enable_) { + found = std::find_if(topsList.begin(), topsList.end(), match_); + } + + // If this is masked in the top projection, we remove it. + if (found != topsList.end()) { + LogDebug("TopProjection") << "X " << iB << *bottom; + topsList.erase(found); + continue; + } + // otherwise, we keep it. + else { + LogDebug("TopProjection") << "O " << iB << *bottom; + pBottomFwdPtrOutput->push_back(bottom); + } + } + + iEvent.put(std::move(pBottomFwdPtrOutput)); +} using namespace std; using namespace edm; @@ -33,8 +257,9 @@ typedef TopProjector TPIsolatedPFCandidatesOnP typedef TopProjector TPPFCandidatesOnPileUpPFCandidates; typedef TopProjector TPPFTausOnPFJets; -typedef TopProjector > TPPFTausOnPFJetsDeltaR; +typedef TopProjector> TPPFTausOnPFJetsDeltaR; +#include "FWCore/Framework/interface/MakerMacros.h" DEFINE_FWK_MODULE(TPPFJetsOnPFCandidates); DEFINE_FWK_MODULE(TPPFCandidatesOnPFCandidates); DEFINE_FWK_MODULE(TPPileUpPFCandidatesOnPFCandidates); diff --git a/CommonTools/ParticleFlow/plugins/TopProjector.h b/CommonTools/ParticleFlow/plugins/TopProjector.h deleted file mode 100644 index 7b4015c2b97cc..0000000000000 --- a/CommonTools/ParticleFlow/plugins/TopProjector.h +++ /dev/null @@ -1,252 +0,0 @@ -#ifndef CommonTools_ParticleFlow_TopProjector_ -#define CommonTools_ParticleFlow_TopProjector_ - -// system include files -#include -#include -#include - -// user include files -#include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/stream/EDProducer.h" -#include "FWCore/ParameterSet/interface/ParameterSet.h" - -#include "FWCore/Framework/interface/Event.h" -#include "FWCore/Framework/interface/MakerMacros.h" - -#include "DataFormats/Provenance/interface/ProductID.h" - -#include "DataFormats/ParticleFlowCandidate/interface/PFCandidateFwd.h" -#include "DataFormats/TauReco/interface/PFTau.h" -#include "DataFormats/JetReco/interface/PFJet.h" - -#include "DataFormats/Candidate/interface/CandidateFwd.h" -#include "DataFormats/Candidate/interface/OverlapChecker.h" - -#include "DataFormats/Math/interface/deltaR.h" - -#include "FWCore/MessageLogger/interface/MessageLogger.h" - -/**\class TopProjector -\brief - -\author Colin Bernet -\date february 2008 -*/ - -#include - -/// This checks a slew of possible overlaps for FwdPtr and derivatives. -template -class TopProjectorFwdPtrOverlap { -public: - typedef edm::FwdPtr TopFwdPtr; - typedef edm::FwdPtr BottomFwdPtr; - - explicit TopProjectorFwdPtrOverlap() { bottom_ = 0; } - - explicit TopProjectorFwdPtrOverlap(edm::ParameterSet const& iConfig) - : bottom_(nullptr), matchByPtrDirect_(iConfig.getParameter("matchByPtrDirect")) {} - - inline void setBottom(BottomFwdPtr const& bottom) { bottom_ = ⊥ } - - bool operator()(TopFwdPtr const& top) const { - if (std::is_same::value && matchByPtrDirect_) - return top.ptr().refCore() == bottom_->ptr().refCore() && top.ptr().key() == bottom_->ptr().key(); - bool topFwdGood = top.ptr().isNonnull() && top.ptr().isAvailable(); - bool topBckGood = top.backPtr().isNonnull() && top.backPtr().isAvailable(); - bool bottomFwdGood = bottom_->ptr().isNonnull() && bottom_->ptr().isAvailable(); - bool bottomBckGood = bottom_->backPtr().isNonnull() && bottom_->backPtr().isAvailable(); - - bool matched = (topFwdGood && bottomFwdGood && top.ptr().refCore() == bottom_->ptr().refCore() && - top.ptr().key() == bottom_->ptr().key()) || - (topFwdGood && bottomBckGood && top.ptr().refCore() == bottom_->backPtr().refCore() && - top.ptr().key() == bottom_->backPtr().key()) || - (topBckGood && bottomFwdGood && top.backPtr().refCore() == bottom_->ptr().refCore() && - top.backPtr().key() == bottom_->ptr().key()) || - (topBckGood && bottomBckGood && top.backPtr().refCore() == bottom_->backPtr().refCore() && - top.backPtr().key() == bottom_->backPtr().key()); - if (!matched) { - for (unsigned isource = 0; isource < top->numberOfSourceCandidatePtrs(); ++isource) { - reco::CandidatePtr const& topSrcPtr = top->sourceCandidatePtr(isource); - bool topSrcGood = topSrcPtr.isNonnull() && topSrcPtr.isAvailable(); - if ((topSrcGood && bottomFwdGood && topSrcPtr.refCore() == bottom_->ptr().refCore() && - topSrcPtr.key() == bottom_->ptr().key()) || - (topSrcGood && bottomBckGood && topSrcPtr.refCore() == bottom_->backPtr().refCore() && - topSrcPtr.key() == bottom_->backPtr().key())) { - matched = true; - break; - } - } - } - if (!matched) { - for (unsigned isource = 0; isource < (*bottom_)->numberOfSourceCandidatePtrs(); ++isource) { - reco::CandidatePtr const& bottomSrcPtr = (*bottom_)->sourceCandidatePtr(isource); - bool bottomSrcGood = bottomSrcPtr.isNonnull() && bottomSrcPtr.isAvailable(); - if ((topFwdGood && bottomSrcGood && bottomSrcPtr.refCore() == top.ptr().refCore() && - bottomSrcPtr.key() == top.ptr().key()) || - (topBckGood && bottomSrcGood && bottomSrcPtr.refCore() == top.backPtr().refCore() && - bottomSrcPtr.key() == top.backPtr().key())) { - matched = true; - break; - } - } - } - - return matched; - } - -protected: - BottomFwdPtr const* bottom_; - const bool matchByPtrDirect_ = false; -}; - -/// This checks matching based on delta R -template -class TopProjectorDeltaROverlap { -public: - typedef edm::FwdPtr TopFwdPtr; - typedef edm::FwdPtr BottomFwdPtr; - - explicit TopProjectorDeltaROverlap() { bottom_ = 0; } - explicit TopProjectorDeltaROverlap(edm::ParameterSet const& config) - : deltaR2_(config.getParameter("deltaR")), - bottom_(nullptr), - bottomCPtr_(nullptr), - botEta_(-999.f), - botPhi_(0.f) { - deltaR2_ *= deltaR2_; - } - - inline void setBottom(BottomFwdPtr const& bottom) { - bottom_ = ⊥ - bottomCPtr_ = &**bottom_; - botEta_ = bottomCPtr_->eta(); - botPhi_ = bottomCPtr_->phi(); - } - - bool operator()(TopFwdPtr const& top) const { - const Top& oTop = *top; - float topEta = oTop.eta(); - float topPhi = oTop.phi(); - bool matched = reco::deltaR2(topEta, topPhi, botEta_, botPhi_) < deltaR2_; - return matched; - } - -protected: - double deltaR2_; - BottomFwdPtr const* bottom_; - const Bottom* bottomCPtr_; - float botEta_, botPhi_; -}; - -template > -class TopProjector : public edm::stream::EDProducer<> { -public: - typedef std::vector TopCollection; - typedef edm::FwdPtr TopFwdPtr; - typedef std::vector TopFwdPtrCollection; - - typedef std::vector BottomCollection; - typedef edm::FwdPtr BottomFwdPtr; - typedef std::vector BottomFwdPtrCollection; - - TopProjector(const edm::ParameterSet&); - - ~TopProjector() override = default; - - static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); - - void produce(edm::Event&, const edm::EventSetup&) override; - -private: - /// Matching method. - Matcher match_; - - /// enable? if not, all candidates in the bottom collection are copied to the output collection - const bool enable_; - - /// name of the top projection - const std::string name_; - - /// input tag for the top (masking) collection - const edm::EDGetTokenT tokenTop_; - - /// input tag for the masked collection. - const edm::EDGetTokenT tokenBottom_; -}; - -template -TopProjector::TopProjector(const edm::ParameterSet& iConfig) - : match_(iConfig), - enable_(iConfig.getParameter("enable")), - name_(iConfig.getUntrackedParameter("name", "No Name")), - tokenTop_(consumes(iConfig.getParameter("topCollection"))), - tokenBottom_(consumes(iConfig.getParameter("bottomCollection"))) { - // will produce a collection of the unmasked candidates in the - // bottom collection - produces(); -} - -template -void TopProjector::fillDescriptions(edm::ConfigurationDescriptions& desc) { - edm::ParameterSetDescription psD; - psD.add("enable"); - if (std::is_same>::value) - psD.add("deltaR"); - psD.addUntracked("name", "No Name"); - psD.add("topCollection"); - psD.add("bottomCollection"); - if (std::is_same>::value) - psD.add("matchByPtrDirect", false)->setComment("fast check by ptr() only"); - desc.addWithDefaultLabel(psD); -} - -template -void TopProjector::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) { - // get the various collections - - // Access the masking collection - auto const& tops = iEvent.get(tokenTop_); - std::list topsList; - - for (auto const& top : tops) { - topsList.push_back(top); - } - - // Access the collection to - // be masked by the other ones - auto const& bottoms = iEvent.get(tokenBottom_); - - // output collection of FwdPtrs to objects, - // selected from the Bottom collection - std::unique_ptr pBottomFwdPtrOutput(new BottomFwdPtrCollection); - - LogDebug("TopProjection") << " Remaining candidates in the bottom collection ------ "; - - int iB = -1; - for (auto const& bottom : bottoms) { - iB++; - match_.setBottom(bottom); - auto found = topsList.end(); - if (enable_) { - found = std::find_if(topsList.begin(), topsList.end(), match_); - } - - // If this is masked in the top projection, we remove it. - if (found != topsList.end()) { - LogDebug("TopProjection") << "X " << iB << *bottom; - topsList.erase(found); - continue; - } - // otherwise, we keep it. - else { - LogDebug("TopProjection") << "O " << iB << *bottom; - pBottomFwdPtrOutput->push_back(bottom); - } - } - - iEvent.put(std::move(pBottomFwdPtrOutput)); -} - -#endif diff --git a/CommonTools/ParticleFlow/python/pfCHS_cff.py b/CommonTools/ParticleFlow/python/pfCHS_cff.py new file mode 100644 index 0000000000000..23dba83b7fa79 --- /dev/null +++ b/CommonTools/ParticleFlow/python/pfCHS_cff.py @@ -0,0 +1,15 @@ +import FWCore.ParameterSet.Config as cms +from CommonTools.ParticleFlow.pfNoPileUpJME_cff import adapt, pfPileUpJME +from CommonTools.RecoAlgos.sortedPackedPrimaryVertices_cfi import sortedPackedPrimaryVertices + +packedPrimaryVertexAssociationJME = sortedPackedPrimaryVertices.clone( + produceSortedVertices = False, + producePileUpCollection = False, + produceNoPileUpCollection = False +) +adapt(packedPrimaryVertexAssociationJME) + +from CommonTools.ParticleFlow.pfNoPileUpPacked_cfi import pfNoPileUpPacked as _pfNoPileUpPacked +pfCHS = _pfNoPileUpPacked.clone( + vertexAssociationQuality=pfPileUpJME.vertexAssociationQuality +) diff --git a/CommonTools/ParticleFlow/python/pfNoPileUpJME_cff.py b/CommonTools/ParticleFlow/python/pfNoPileUpJME_cff.py index 0907848fe1db6..caad529298bd3 100644 --- a/CommonTools/ParticleFlow/python/pfNoPileUpJME_cff.py +++ b/CommonTools/ParticleFlow/python/pfNoPileUpJME_cff.py @@ -2,16 +2,38 @@ from CommonTools.ParticleFlow.pfPileUp_cfi import pfPileUp as _pfPileUp from CommonTools.ParticleFlow.TopProjectors.pfNoPileUp_cfi import pfNoPileUp as _pfNoPileUp -from CommonTools.ParticleFlow.goodOfflinePrimaryVertices_cfi import * +from CommonTools.ParticleFlow.goodOfflinePrimaryVertices_cfi import goodOfflinePrimaryVertices +from CommonTools.RecoAlgos.primaryVertexAssociation_cfi import primaryVertexAssociation + +def adapt(primaryVertexAssociationJME): + # options for quality PrimaryDz = 6 (used in PUPPI) + primaryVertexAssociationJME.assignment.maxDzSigForPrimaryAssignment = 1e10 + primaryVertexAssociationJME.assignment.maxDzForPrimaryAssignment = 0.3 + primaryVertexAssociationJME.assignment.maxDzErrorForPrimaryAssignment = 1e10 + primaryVertexAssociationJME.assignment.NumOfPUVtxsForCharged = 2 + primaryVertexAssociationJME.assignment.PtMaxCharged = 20. + primaryVertexAssociationJME.assignment.EtaMinUseDz = 2.4 + primaryVertexAssociationJME.assignment.OnlyUseFirstDz = True + from Configuration.Eras.Modifier_phase2_common_cff import phase2_common + phase2_common.toModify( + primaryVertexAssociationJME.assignment, + maxDzForPrimaryAssignment=0.1, + EtaMinUseDz = 4.0 + ) +primaryVertexAssociationJME = primaryVertexAssociation.clone(vertices = 'goodOfflinePrimaryVertices') +adapt(primaryVertexAssociationJME) pfPileUpJME = _pfPileUp.clone(PFCandidates='particleFlowPtrs', - Vertices = 'goodOfflinePrimaryVertices', - checkClosestZVertex = False ) + useVertexAssociation = True, + vertexAssociationQuality = 7, + vertexAssociation = ('primaryVertexAssociationJME','original'), + ) pfNoPileUpJME = _pfNoPileUp.clone(topCollection = 'pfPileUpJME', bottomCollection = 'particleFlowPtrs' ) pfNoPileUpJMETask = cms.Task( goodOfflinePrimaryVertices, + primaryVertexAssociationJME, pfPileUpJME, pfNoPileUpJME ) diff --git a/CommonTools/ParticleFlow/python/pfPileUp_cfi.py b/CommonTools/ParticleFlow/python/pfPileUp_cfi.py index 4696123d18f91..025d6479ad2eb 100644 --- a/CommonTools/ParticleFlow/python/pfPileUp_cfi.py +++ b/CommonTools/ParticleFlow/python/pfPileUp_cfi.py @@ -8,5 +8,8 @@ # pile-up identification now enabled by default. To be studied for jets Enable = cms.bool(True), verbose = cms.untracked.bool(False), - checkClosestZVertex = cms.bool(True) + checkClosestZVertex = cms.bool(True), + useVertexAssociation = cms.bool(False), + vertexAssociationQuality = cms.int32(0), + vertexAssociation = cms.InputTag(''), ) diff --git a/CommonTools/PileupAlgos/plugins/PuppiPhoton.cc b/CommonTools/PileupAlgos/plugins/PuppiPhoton.cc index 5b9ed019b1b64..d69f0d722d681 100644 --- a/CommonTools/PileupAlgos/plugins/PuppiPhoton.cc +++ b/CommonTools/PileupAlgos/plugins/PuppiPhoton.cc @@ -1,27 +1,63 @@ -// system include files -#include - -// user include files -#include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/EDProducer.h" -#include "FWCore/Framework/interface/Event.h" -#include "FWCore/Framework/interface/MakerMacros.h" -#include "FWCore/Framework/interface/ESHandle.h" -#include "FWCore/Framework/interface/EventSetup.h" -#include "FWCore/ParameterSet/interface/ParameterSet.h" -#include "DataFormats/Common/interface/View.h" +#include "DataFormats/Candidate/interface/Candidate.h" #include "DataFormats/Candidate/interface/CandidateFwd.h" -#include "DataFormats/PatCandidates/interface/PackedCandidate.h" -#include "DataFormats/PatCandidates/interface/Photon.h" -#include "DataFormats/PatCandidates/interface/Electron.h" -#include "DataFormats/VertexReco/interface/VertexFwd.h" -#include "DataFormats/VertexReco/interface/Vertex.h" +#include "DataFormats/Common/interface/Association.h" +#include "DataFormats/Common/interface/ValueMap.h" +#include "DataFormats/Common/interface/View.h" #include "DataFormats/GsfTrackReco/interface/GsfTrack.h" #include "DataFormats/GsfTrackReco/interface/GsfTrackFwd.h" -#include "DataFormats/Common/interface/Association.h" +#include "DataFormats/Math/interface/PtEtaPhiMass.h" #include "DataFormats/Math/interface/deltaR.h" -//Main File -#include "CommonTools/PileupAlgos/plugins/PuppiPhoton.h" +#include "DataFormats/ParticleFlowCandidate/interface/PFCandidate.h" +#include "DataFormats/PatCandidates/interface/Electron.h" +#include "DataFormats/PatCandidates/interface/PackedCandidate.h" +#include "DataFormats/PatCandidates/interface/Photon.h" +#include "DataFormats/VertexReco/interface/Vertex.h" +#include "DataFormats/VertexReco/interface/VertexFwd.h" +#include "FWCore/Framework/interface/EDProducer.h" +#include "FWCore/Framework/interface/ESHandle.h" +#include "FWCore/Framework/interface/Event.h" +#include "FWCore/Framework/interface/EventSetup.h" +#include "FWCore/Framework/interface/Frameworkfwd.h" +#include "FWCore/Framework/interface/MakerMacros.h" +#include "FWCore/Framework/interface/stream/EDProducer.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" + +#include + +// ------------------------------------------------------------------------------------------ +class PuppiPhoton : public edm::stream::EDProducer<> { +public: + explicit PuppiPhoton(const edm::ParameterSet &); + ~PuppiPhoton() override; + + static void fillDescriptions(edm::ConfigurationDescriptions &descriptions); + typedef math::XYZTLorentzVector LorentzVector; + typedef std::vector LorentzVectorCollection; + typedef edm::View CandidateView; + typedef std::vector PFOutputCollection; + typedef edm::View PFView; + +private: + void produce(edm::Event &, const edm::EventSetup &) override; + bool matchPFCandidate(const reco::Candidate *iPF, const reco::Candidate *iPho); + edm::EDGetTokenT tokenPFCandidates_; + edm::EDGetTokenT tokenPuppiCandidates_; + edm::EDGetTokenT tokenPhotonCandidates_; + edm::EDGetTokenT>> reco2pf_; + edm::EDGetTokenT> tokenWeights_; + edm::EDGetTokenT> tokenPhotonId_; + double pt_; + double eta_; + bool usePFRef_; + bool usePFphotons_; + bool runOnMiniAOD_; + bool usePhotonId_; + std::vector dRMatch_; + std::vector pdgIds_; + std::unique_ptr corrCandidates_; + double weight_; + bool useValueMap_; +}; // ------------------------------------------------------------------------------------------ PuppiPhoton::PuppiPhoton(const edm::ParameterSet &iConfig) { diff --git a/CommonTools/PileupAlgos/plugins/PuppiPhoton.h b/CommonTools/PileupAlgos/plugins/PuppiPhoton.h deleted file mode 100644 index 194cc3001fe05..0000000000000 --- a/CommonTools/PileupAlgos/plugins/PuppiPhoton.h +++ /dev/null @@ -1,53 +0,0 @@ -#ifndef CommonTools_Puppi_PuppiPhoton_h_ -#define CommonTools_Puppi_PuppiPhoton_h_ -// system include files -#include - -// user include files -#include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/stream/EDProducer.h" -#include "FWCore/Framework/interface/Event.h" -#include "FWCore/Framework/interface/MakerMacros.h" -#include "FWCore/Framework/interface/ESHandle.h" -#include "FWCore/Framework/interface/EventSetup.h" -#include "FWCore/ParameterSet/interface/ParameterSet.h" -#include "DataFormats/Math/interface/PtEtaPhiMass.h" -#include "DataFormats/Candidate/interface/Candidate.h" -#include "DataFormats/ParticleFlowCandidate/interface/PFCandidate.h" -#include "DataFormats/Common/interface/ValueMap.h" - -// ------------------------------------------------------------------------------------------ -class PuppiPhoton : public edm::stream::EDProducer<> { -public: - explicit PuppiPhoton(const edm::ParameterSet &); - ~PuppiPhoton() override; - - static void fillDescriptions(edm::ConfigurationDescriptions &descriptions); - typedef math::XYZTLorentzVector LorentzVector; - typedef std::vector LorentzVectorCollection; - typedef edm::View CandidateView; - typedef std::vector PFOutputCollection; - typedef edm::View PFView; - -private: - void produce(edm::Event &, const edm::EventSetup &) override; - bool matchPFCandidate(const reco::Candidate *iPF, const reco::Candidate *iPho); - edm::EDGetTokenT tokenPFCandidates_; - edm::EDGetTokenT tokenPuppiCandidates_; - edm::EDGetTokenT tokenPhotonCandidates_; - edm::EDGetTokenT > > reco2pf_; - edm::EDGetTokenT > tokenWeights_; - edm::EDGetTokenT > tokenPhotonId_; - double pt_; - double eta_; - bool usePFRef_; - bool usePFphotons_; - bool runOnMiniAOD_; - bool usePhotonId_; - std::vector dRMatch_; - std::vector pdgIds_; - std::unique_ptr corrCandidates_; - double weight_; - bool useValueMap_; -}; -#endif diff --git a/CommonTools/PileupAlgos/plugins/PuppiProducer.cc b/CommonTools/PileupAlgos/plugins/PuppiProducer.cc index cfbeb0cc02ff9..0d6c3bdfda83b 100644 --- a/CommonTools/PileupAlgos/plugins/PuppiProducer.cc +++ b/CommonTools/PileupAlgos/plugins/PuppiProducer.cc @@ -1,23 +1,93 @@ -// system include files -#include - -// user include files -#include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/EDProducer.h" -#include "FWCore/Framework/interface/Event.h" -#include "FWCore/Framework/interface/MakerMacros.h" -#include "DataFormats/Common/interface/ValueMap.h" -#include "FWCore/Framework/interface/ESHandle.h" -#include "FWCore/Framework/interface/EventSetup.h" -#include "FWCore/ParameterSet/interface/ParameterSet.h" -#include "DataFormats/Common/interface/View.h" +#include "CommonTools/PileupAlgos/interface/PuppiAlgo.h" +#include "CommonTools/PileupAlgos/interface/PuppiContainer.h" #include "DataFormats/Candidate/interface/Candidate.h" #include "DataFormats/Candidate/interface/CandidateFwd.h" +#include "DataFormats/Common/interface/Association.h" +#include "DataFormats/Common/interface/ValueMap.h" +#include "DataFormats/Common/interface/View.h" #include "DataFormats/GsfTrackReco/interface/GsfTrack.h" #include "DataFormats/GsfTrackReco/interface/GsfTrackFwd.h" -#include "DataFormats/Common/interface/Association.h" -//Main File -#include "CommonTools/PileupAlgos/plugins/PuppiProducer.h" +#include "DataFormats/Math/interface/LorentzVector.h" +#include "DataFormats/Math/interface/PtEtaPhiMass.h" +#include "DataFormats/ParticleFlowCandidate/interface/PFCandidate.h" +#include "DataFormats/PatCandidates/interface/PackedCandidate.h" +#include "DataFormats/VertexReco/interface/VertexFwd.h" +#include "FWCore/Framework/interface/EDProducer.h" +#include "FWCore/Framework/interface/ESHandle.h" +#include "FWCore/Framework/interface/Event.h" +#include "FWCore/Framework/interface/EventSetup.h" +#include "FWCore/Framework/interface/Frameworkfwd.h" +#include "FWCore/Framework/interface/MakerMacros.h" +#include "FWCore/Framework/interface/stream/EDProducer.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" + +#include + +// ------------------------------------------------------------------------------------------ +class PuppiProducer : public edm::stream::EDProducer<> { +public: + explicit PuppiProducer(const edm::ParameterSet&); + ~PuppiProducer() override; + + static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); + typedef math::XYZTLorentzVector LorentzVector; + typedef std::vector LorentzVectorCollection; + typedef reco::VertexCollection VertexCollection; + typedef edm::View CandidateView; + typedef std::vector PFInputCollection; + typedef std::vector PFOutputCollection; + typedef std::vector PackedOutputCollection; + typedef edm::View PFView; + typedef edm::Association CandToVertex; + +private: + virtual void beginJob(); + void produce(edm::Event&, const edm::EventSetup&) override; + virtual void endJob(); + + edm::EDGetTokenT tokenPFCandidates_; + edm::EDGetTokenT tokenVertices_; + edm::EDGetTokenT tokenVertexAssociation_; + edm::EDGetTokenT> tokenVertexAssociationQuality_; + edm::EDGetTokenT tokenPuppiContainer_; + edm::EDGetTokenT tokenPuppiCandidates_; + edm::EDGetTokenT tokenPackedPuppiCandidates_; + edm::EDGetTokenT puProxyValueToken_; + edm::EDPutTokenT> ptokenPupOut_; + edm::EDPutTokenT> ptokenP4PupOut_; + edm::EDPutTokenT> ptokenValues_; + edm::EDPutTokenT ptokenPackedPuppiCandidates_; + edm::EDPutTokenT ptokenPuppiCandidates_; + edm::EDPutTokenT ptokenNalgos_; + edm::EDPutTokenT> ptokenRawAlphas_; + edm::EDPutTokenT> ptokenAlphas_; + edm::EDPutTokenT> ptokenAlphasMed_; + edm::EDPutTokenT> ptokenAlphasRms_; + std::string fPuppiName; + std::string fPFName; + std::string fPVName; + bool fUseVertexAssociation; + int vertexAssociationQuality_; + bool fPuppiDiagnostics; + bool fPuppiNoLep; + bool fUseFromPVLooseTight; + bool fUseDZ; + double fDZCut; + double fEtaMinUseDZ; + double fPtMaxCharged; + double fEtaMaxCharged; + double fPtMaxPhotons; + double fEtaMaxPhotons; + uint fNumOfPUVtxsForCharged; + double fDZCutForChargedFromPUVtxs; + bool fUseExistingWeights; + bool fClonePackedCands; + int fVtxNdofCut; + double fVtxZCut; + bool fUsePUProxyValue; + std::unique_ptr fPuppiContainer; + std::vector fRecoObjCollection; +}; // ------------------------------------------------------------------------------------------ PuppiProducer::PuppiProducer(const edm::ParameterSet& iConfig) { @@ -41,6 +111,13 @@ PuppiProducer::PuppiProducer(const edm::ParameterSet& iConfig) { tokenPFCandidates_ = consumes(iConfig.getParameter("candName")); tokenVertices_ = consumes(iConfig.getParameter("vertexName")); + fUseVertexAssociation = iConfig.getParameter("useVertexAssociation"); + vertexAssociationQuality_ = iConfig.getParameter("vertexAssociationQuality"); + if (fUseVertexAssociation) { + tokenVertexAssociation_ = consumes(iConfig.getParameter("vertexAssociation")); + tokenVertexAssociationQuality_ = + consumes>(iConfig.getParameter("vertexAssociation")); + } fUsePUProxyValue = iConfig.getParameter("usePUProxyValue"); @@ -80,6 +157,13 @@ void PuppiProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) { iEvent.getByToken(tokenVertices_, hVertexProduct); const reco::VertexCollection* pvCol = hVertexProduct.product(); + edm::Association associatedPV; + edm::ValueMap associationQuality; + if ((fUseVertexAssociation) && (!fUseExistingWeights)) { + associatedPV = iEvent.get(tokenVertexAssociation_); + associationQuality = iEvent.get(tokenVertexAssociationQuality_); + } + double puProxyValue = 0.; if (fUsePUProxyValue) { puProxyValue = iEvent.get(puProxyValueToken_); @@ -95,6 +179,7 @@ void PuppiProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) { //Fill the reco objects fRecoObjCollection.clear(); fRecoObjCollection.reserve(pfCol->size()); + int iCand = 0; for (auto const& aPF : *pfCol) { RecoObj pReco; pReco.pt = aPF.pt(); @@ -110,7 +195,25 @@ void PuppiProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) { uint pVtxId = 0; bool isLepton = ((std::abs(pReco.pdgId) == 11) || (std::abs(pReco.pdgId) == 13)); const pat::PackedCandidate* lPack = dynamic_cast(&aPF); - if (lPack == nullptr) { + + if (fUseVertexAssociation) { + const reco::VertexRef& PVOrig = associatedPV[reco::CandidatePtr(hPFProduct, iCand)]; + int quality = associationQuality[reco::CandidatePtr(hPFProduct, iCand)]; + if (PVOrig.isNonnull() && (quality >= vertexAssociationQuality_)) { + closestVtx = PVOrig.get(); + pVtxId = PVOrig.key(); + } + if (std::abs(pReco.charge) == 0) + pReco.id = 0; + else if (fPuppiNoLep && isLepton) + pReco.id = 3; + else if (closestVtx != nullptr && pVtxId == 0) + pReco.id = 1; // Associated to main vertex + else if (closestVtx != nullptr && pVtxId > 0) + pReco.id = 2; // Associated to PU + else + pReco.id = 0; // Unassociated + } else if (lPack == nullptr) { const reco::PFCandidate* pPF = dynamic_cast(&aPF); double curdz = 9999; int closestVtxForUnassociateds = -9999; @@ -230,6 +333,7 @@ void PuppiProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) { } fRecoObjCollection.push_back(pReco); + iCand++; } fPuppiContainer->initialize(fRecoObjCollection); @@ -401,6 +505,9 @@ void PuppiProducer::fillDescriptions(edm::ConfigurationDescriptions& description desc.add("vtxZCut", 24); desc.add("candName", edm::InputTag("particleFlow")); desc.add("vertexName", edm::InputTag("offlinePrimaryVertices")); + desc.add("useVertexAssociation", false); + desc.add("vertexAssociationQuality", 0); + desc.add("vertexAssociation", edm::InputTag("")); desc.add("applyCHS", true); desc.add("invertPuppi", false); desc.add("useExp", false); diff --git a/CommonTools/PileupAlgos/plugins/PuppiProducer.h b/CommonTools/PileupAlgos/plugins/PuppiProducer.h deleted file mode 100644 index befcf4c6a7f0a..0000000000000 --- a/CommonTools/PileupAlgos/plugins/PuppiProducer.h +++ /dev/null @@ -1,82 +0,0 @@ -#ifndef CommonTools_Puppi_PuppiProducer_h_ -#define CommonTools_Puppi_PuppiProducer_h_ -// system include files -#include - -// user include files -#include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/stream/EDProducer.h" -#include "FWCore/Framework/interface/Event.h" -#include "FWCore/Framework/interface/MakerMacros.h" -#include "FWCore/Framework/interface/ESHandle.h" -#include "FWCore/Framework/interface/EventSetup.h" -#include "FWCore/ParameterSet/interface/ParameterSet.h" -#include "DataFormats/Math/interface/PtEtaPhiMass.h" -#include "DataFormats/Math/interface/LorentzVector.h" -#include "DataFormats/VertexReco/interface/VertexFwd.h" -#include "DataFormats/ParticleFlowCandidate/interface/PFCandidate.h" -#include "DataFormats/PatCandidates/interface/PackedCandidate.h" -#include "CommonTools/PileupAlgos/interface/PuppiContainer.h" -#include "CommonTools/PileupAlgos/interface/PuppiAlgo.h" - -// ------------------------------------------------------------------------------------------ -class PuppiProducer : public edm::stream::EDProducer<> { -public: - explicit PuppiProducer(const edm::ParameterSet&); - ~PuppiProducer() override; - - static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); - typedef math::XYZTLorentzVector LorentzVector; - typedef std::vector LorentzVectorCollection; - typedef reco::VertexCollection VertexCollection; - typedef edm::View CandidateView; - typedef std::vector PFInputCollection; - typedef std::vector PFOutputCollection; - typedef std::vector PackedOutputCollection; - typedef edm::View PFView; - -private: - virtual void beginJob(); - void produce(edm::Event&, const edm::EventSetup&) override; - virtual void endJob(); - - edm::EDGetTokenT tokenPFCandidates_; - edm::EDGetTokenT tokenVertices_; - edm::EDGetTokenT tokenPuppiContainer_; - edm::EDGetTokenT tokenPuppiCandidates_; - edm::EDGetTokenT tokenPackedPuppiCandidates_; - edm::EDGetTokenT puProxyValueToken_; - edm::EDPutTokenT> ptokenPupOut_; - edm::EDPutTokenT> ptokenP4PupOut_; - edm::EDPutTokenT> ptokenValues_; - edm::EDPutTokenT ptokenPackedPuppiCandidates_; - edm::EDPutTokenT ptokenPuppiCandidates_; - edm::EDPutTokenT ptokenNalgos_; - edm::EDPutTokenT> ptokenRawAlphas_; - edm::EDPutTokenT> ptokenAlphas_; - edm::EDPutTokenT> ptokenAlphasMed_; - edm::EDPutTokenT> ptokenAlphasRms_; - std::string fPuppiName; - std::string fPFName; - std::string fPVName; - bool fPuppiDiagnostics; - bool fPuppiNoLep; - bool fUseFromPVLooseTight; - bool fUseDZ; - double fDZCut; - double fEtaMinUseDZ; - double fPtMaxCharged; - double fEtaMaxCharged; - double fPtMaxPhotons; - double fEtaMaxPhotons; - uint fNumOfPUVtxsForCharged; - double fDZCutForChargedFromPUVtxs; - bool fUseExistingWeights; - bool fClonePackedCands; - int fVtxNdofCut; - double fVtxZCut; - bool fUsePUProxyValue; - std::unique_ptr fPuppiContainer; - std::vector fRecoObjCollection; -}; -#endif diff --git a/CommonTools/PileupAlgos/python/Puppi_cff.py b/CommonTools/PileupAlgos/python/Puppi_cff.py index 107aea9a49cab..9943d59afe49b 100644 --- a/CommonTools/PileupAlgos/python/Puppi_cff.py +++ b/CommonTools/PileupAlgos/python/Puppi_cff.py @@ -31,8 +31,9 @@ NumOfPUVtxsForCharged = 2, PtMaxCharged = 20., PtMaxNeutralsStartSlope = 20., - #candName = cms.string('packedPFCandidates'), - #vertexName = cms.string('offlineSlimmedPrimaryVertices'), + useVertexAssociation = True, + vertexAssociationQuality = 6, + vertexAssociation = ('primaryVertexAssociationJME','original'), clonePackedCands = False, # should only be set to True for MiniAOD algos = { 0: dict( @@ -96,10 +97,12 @@ ) ) +from Configuration.ProcessModifiers.pp_on_AA_cff import pp_on_AA +pp_on_AA.toModify(puppi, algos = []) +from Configuration.ProcessModifiers.run2_miniAOD_pp_on_AA_103X_cff import run2_miniAOD_pp_on_AA_103X +run2_miniAOD_pp_on_AA_103X.toModify(puppi,useVertexAssociation = False) # because the association is only run on cleanedParticleFlow + puppiNoLep = puppi.clone( puppiNoLep = True, PtMaxPhotons = 20. ) - -from Configuration.ProcessModifiers.pp_on_AA_cff import pp_on_AA -pp_on_AA.toModify(puppi, algos = []) diff --git a/CommonTools/PileupAlgos/test/recomputePuppiOnMiniAOD.py b/CommonTools/PileupAlgos/test/recomputePuppiOnMiniAOD.py new file mode 100644 index 0000000000000..8825604bf18c1 --- /dev/null +++ b/CommonTools/PileupAlgos/test/recomputePuppiOnMiniAOD.py @@ -0,0 +1,141 @@ +# Auto generated configuration file +# using: +# Revision: 1.19 +# Source: /local/reps/CMSSW/CMSSW/Configuration/Applications/python/ConfigBuilder.py,v +# with command line options: step5 --conditions auto:run2_mc --nThreads 2 -n 10 --era Run2_2016 --eventcontent MINIAODSIM --filein file:step3_inMINIAODSIM.root -s NANO --datatier NANOAODSIM --mc --fileout file:step5.root +import FWCore.ParameterSet.Config as cms + +from Configuration.Eras.Era_Run2_2016_cff import Run2_2016 + +process = cms.Process('NANO',Run2_2016) + +# import of standard configurations +process.load('Configuration.StandardSequences.Services_cff') +process.load('SimGeneral.HepPDTESSource.pythiapdt_cfi') +process.load('FWCore.MessageService.MessageLogger_cfi') +process.load('Configuration.EventContent.EventContent_cff') +process.load('SimGeneral.MixingModule.mixNoPU_cfi') +process.load('Configuration.StandardSequences.GeometryRecoDB_cff') +process.load('Configuration.StandardSequences.MagneticField_cff') +process.load('Configuration.StandardSequences.EndOfProcess_cff') +process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') + +process.maxEvents = cms.untracked.PSet( + input = cms.untracked.int32(10), + output = cms.optional.untracked.allowed(cms.int32,cms.PSet) +) + +# Input source +process.source = cms.Source("PoolSource", + fileNames = cms.untracked.vstring('file:/afs/cern.ch/user/h/hinzmann/stable_13TeV/jetmet/mtd/CMSSW_12_0_0_pre3/src/25202.0_TTbar_13+TTbar_13+DIGIUP15_PU25+RECOUP15_PU25+HARVESTUP15_PU25+NANOUP15_PU25/step3_inMINIAODSIM.root'), + secondaryFileNames = cms.untracked.vstring() +) + +process.options = cms.untracked.PSet( + FailPath = cms.untracked.vstring(), + IgnoreCompletely = cms.untracked.vstring(), + Rethrow = cms.untracked.vstring(), + SkipEvent = cms.untracked.vstring(), + allowUnscheduled = cms.obsolete.untracked.bool, + canDeleteEarly = cms.untracked.vstring(), + emptyRunLumiMode = cms.obsolete.untracked.string, + eventSetup = cms.untracked.PSet( + forceNumberOfConcurrentIOVs = cms.untracked.PSet( + + ), + numberOfConcurrentIOVs = cms.untracked.uint32(1) + ), + fileMode = cms.untracked.string('FULLMERGE'), + forceEventSetupCacheClearOnNewRun = cms.untracked.bool(False), + makeTriggerResults = cms.obsolete.untracked.bool, + numberOfConcurrentLuminosityBlocks = cms.untracked.uint32(1), + numberOfConcurrentRuns = cms.untracked.uint32(1), + numberOfStreams = cms.untracked.uint32(0), + numberOfThreads = cms.untracked.uint32(1), + printDependencies = cms.untracked.bool(False), + sizeOfStackForThreadsInKB = cms.optional.untracked.uint32, + throwIfIllegalParameter = cms.untracked.bool(True), + wantSummary = cms.untracked.bool(False) +) + +# Production Info +process.configurationMetadata = cms.untracked.PSet( + annotation = cms.untracked.string('step5 nevts:10'), + name = cms.untracked.string('Applications'), + version = cms.untracked.string('$Revision: 1.19 $') +) + +# Output definition + +process.MINIAODSIMoutput = cms.OutputModule("PoolOutputModule", + compressionAlgorithm = cms.untracked.string('LZMA'), + compressionLevel = cms.untracked.int32(9), + dataset = cms.untracked.PSet( + dataTier = cms.untracked.string('MINIAODSIM'), + filterName = cms.untracked.string('') + ), + fileName = cms.untracked.string('file:updatedMINIAODSIM.root'), + outputCommands = process.MINIAODSIMEventContent.outputCommands +) + +# Additional output definition + +# Other statements +from Configuration.AlCa.GlobalTag import GlobalTag +process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:run2_mc', '') + +# Rerun PUPPI MET and ak4 jets (but not ak8) +from PhysicsTools.PatAlgos.tools.helpers import getPatAlgosToolsTask, addToProcessAndTask +task = getPatAlgosToolsTask(process) +from PhysicsTools.PatAlgos.slimming.puppiForMET_cff import makePuppiesFromMiniAOD +makePuppiesFromMiniAOD(process,True) +process.puppi.useExistingWeights = False +process.puppiNoLep.useExistingWeights = False +from PhysicsTools.PatUtils.tools.runMETCorrectionsAndUncertainties import runMetCorAndUncFromMiniAOD +runMetCorAndUncFromMiniAOD(process,isData=False,metType="Puppi",postfix="Puppi",jetFlavor="AK4PFPuppi",recoMetFromPFCs=True) +from PhysicsTools.PatAlgos.patPuppiJetSpecificProducer_cfi import patPuppiJetSpecificProducer +addToProcessAndTask('patPuppiJetSpecificProducer', patPuppiJetSpecificProducer.clone(src=cms.InputTag("patJetsPuppi")), process, task) +from PhysicsTools.PatAlgos.tools.jetTools import updateJetCollection +updateJetCollection( + process, + labelName = 'PuppiJetSpecific', + jetSource = cms.InputTag('patJetsPuppi'), +) +process.updatedPatJetsPuppiJetSpecific.userData.userFloats.src = ['patPuppiJetSpecificProducer:puppiMultiplicity', 'patPuppiJetSpecificProducer:neutralPuppiMultiplicity', 'patPuppiJetSpecificProducer:neutralHadronPuppiMultiplicity', 'patPuppiJetSpecificProducer:photonPuppiMultiplicity', 'patPuppiJetSpecificProducer:HFHadronPuppiMultiplicity', 'patPuppiJetSpecificProducer:HFEMPuppiMultiplicity' ] +addToProcessAndTask('slimmedJetsPuppi', process.updatedPatJetsPuppiJetSpecific.clone(), process, task) +del process.updatedPatJetsPuppiJetSpecific +process.puppiSequence = cms.Sequence(process.puppiMETSequence+process.fullPatMetSequencePuppi+process.patPuppiJetSpecificProducer+process.slimmedJetsPuppi) + +# Example how to not use vertex fit for track-vertex-association, but only dz +#process.packedPrimaryVertexAssociationJME.assignment.useVertexFit = False +#process.packedPrimaryVertexAssociationJME.assignment.maxDzSigForPrimaryAssignment = 5.0 +#process.packedPrimaryVertexAssociationJME.assignment.maxDzForPrimaryAssignment = 0.1 +#process.packedPrimaryVertexAssociationJME.assignment.maxDzErrorForPrimaryAssignment = 0.05 +#process.packedPrimaryVertexAssociationJME.assignment.OnlyUseFirstDz = False +#process.pfCHS.vertexAssociationQuality = 6 + +# Path and EndPath definitions +process.puppi_step = cms.Path(process.puppiSequence) +process.endjob_step = cms.EndPath(process.endOfProcess) +process.MINIAODSIMoutput_step = cms.EndPath(process.MINIAODSIMoutput) + +# Schedule definition +process.schedule = cms.Schedule(process.puppi_step,process.endjob_step,process.MINIAODSIMoutput_step) +from PhysicsTools.PatAlgos.tools.helpers import associatePatAlgosToolsTask +associatePatAlgosToolsTask(process) + +#Setup FWK for multithreaded +process.options.numberOfThreads=cms.untracked.uint32(2) +process.options.numberOfStreams=cms.untracked.uint32(0) +process.options.numberOfConcurrentLuminosityBlocks=cms.untracked.uint32(1) + +# customisation of the process. + +# End of customisation functions + +# Customisation from command line + +# Add early deletion of temporary data products to reduce peak memory need +from Configuration.StandardSequences.earlyDeleteSettings_cff import customiseEarlyDelete +process = customiseEarlyDelete(process) +# End adding early deletion diff --git a/CommonTools/RecoAlgos/src/CandidateProducer.h b/CommonTools/RecoAlgos/interface/CandidateProducer.h similarity index 100% rename from CommonTools/RecoAlgos/src/CandidateProducer.h rename to CommonTools/RecoAlgos/interface/CandidateProducer.h diff --git a/CommonTools/RecoAlgos/src/MassiveCandidateConverter.h b/CommonTools/RecoAlgos/interface/MassiveCandidateConverter.h similarity index 100% rename from CommonTools/RecoAlgos/src/MassiveCandidateConverter.h rename to CommonTools/RecoAlgos/interface/MassiveCandidateConverter.h diff --git a/CommonTools/RecoAlgos/interface/PrimaryVertexAssignment.h b/CommonTools/RecoAlgos/interface/PrimaryVertexAssignment.h index da7626850313e..011ee2ecee2d2 100644 --- a/CommonTools/RecoAlgos/interface/PrimaryVertexAssignment.h +++ b/CommonTools/RecoAlgos/interface/PrimaryVertexAssignment.h @@ -12,6 +12,7 @@ #include "DataFormats/Candidate/interface/Candidate.h" #include "DataFormats/ParticleFlowCandidate/interface/PFCandidateFwd.h" #include "DataFormats/ParticleFlowCandidate/interface/PFCandidate.h" +#include "DataFormats/PatCandidates/interface/PackedCandidate.h" #include "DataFormats/VertexReco/interface/VertexFwd.h" #include "TrackingTools/TransientTrack/interface/TransientTrackBuilder.h" @@ -41,7 +42,13 @@ class PrimaryVertexAssignment { maxDxySigForNotReconstructedPrimary_(iConfig.getParameter("maxDxySigForNotReconstructedPrimary")), maxDxyForNotReconstructedPrimary_(iConfig.getParameter("maxDxyForNotReconstructedPrimary")), useTiming_(iConfig.getParameter("useTiming")), - preferHighRanked_(iConfig.getParameter("preferHighRanked")) {} + useVertexFit_(iConfig.getParameter("useVertexFit")), + preferHighRanked_(iConfig.getParameter("preferHighRanked")), + fNumOfPUVtxsForCharged_(iConfig.getParameter("NumOfPUVtxsForCharged")), + fDzCutForChargedFromPUVtxs_(iConfig.getParameter("DzCutForChargedFromPUVtxs")), + fPtMaxCharged_(iConfig.getParameter("PtMaxCharged")), + fEtaMinUseDz_(iConfig.getParameter("EtaMinUseDz")), + fOnlyUseFirstDz_(iConfig.getParameter("OnlyUseFirstDz")) {} ~PrimaryVertexAssignment() {} @@ -54,6 +61,15 @@ class PrimaryVertexAssignment { const edm::View& jets, const TransientTrackBuilder& builder) const; + std::pair chargedHadronVertex( + const reco::VertexCollection& vertices, + int iVertex, + const reco::Track* track, + float trackTime, + float trackTimeResolution, // <0 if timing not available for this object + const edm::View& jets, + const TransientTrackBuilder& builder) const; + std::pair chargedHadronVertex( const reco::VertexCollection& vertices, const reco::TrackRef& trackRef, @@ -75,13 +91,38 @@ class PrimaryVertexAssignment { } if (pfcand.gsfTrackRef().isNull()) { if (pfcand.trackRef().isNull()) - return std::pair(-1, PrimaryVertexAssignment::Unassigned); + return {-1, PrimaryVertexAssignment::Unassigned}; else return chargedHadronVertex(vertices, pfcand.trackRef(), time, timeResolution, jets, builder); } return chargedHadronVertex( vertices, reco::TrackRef(), &(*pfcand.gsfTrackRef()), time, timeResolution, jets, builder); } + + std::pair chargedHadronVertex(const reco::VertexCollection& vertices, + const pat::PackedCandidate& pfcand, + const edm::View& jets, + const TransientTrackBuilder& builder) const { + float time = 0, timeResolution = -1; + if (useTiming_ && pfcand.timeError() > 0) { + time = pfcand.time(); + timeResolution = pfcand.timeError(); + } + if (!pfcand.hasTrackDetails()) + return {-1, PrimaryVertexAssignment::Unassigned}; + else + return chargedHadronVertex( + vertices, + (useVertexFit_ && (pfcand.pvAssociationQuality() >= pat::PackedCandidate::UsedInFitLoose)) + ? pfcand.vertexRef().key() + : -1, + &pfcand.pseudoTrack(), + time, + timeResolution, + jets, + builder); + } + std::pair chargedHadronVertex(const reco::VertexCollection& vertices, const reco::RecoChargedRefCandidate& chcand, const edm::ValueMap* trackTimeTag, @@ -94,7 +135,7 @@ class PrimaryVertexAssignment { timeResolution = (*trackTimeResoTag)[chcand.track()]; } if (chcand.track().isNull()) - return std::pair(-1, PrimaryVertexAssignment::Unassigned); + return {-1, PrimaryVertexAssignment::Unassigned}; return chargedHadronVertex(vertices, chcand.track(), time, timeResolution, jets, builder); } @@ -111,7 +152,13 @@ class PrimaryVertexAssignment { double maxDxySigForNotReconstructedPrimary_; double maxDxyForNotReconstructedPrimary_; bool useTiming_; + bool useVertexFit_; bool preferHighRanked_; + int fNumOfPUVtxsForCharged_; + double fDzCutForChargedFromPUVtxs_; + double fPtMaxCharged_; + double fEtaMinUseDz_; + bool fOnlyUseFirstDz_; }; #endif diff --git a/CommonTools/RecoAlgos/interface/TrackToRefCandidate.h b/CommonTools/RecoAlgos/interface/TrackToRefCandidate.h index 394f9aae48cf6..224c9ec603cf1 100644 --- a/CommonTools/RecoAlgos/interface/TrackToRefCandidate.h +++ b/CommonTools/RecoAlgos/interface/TrackToRefCandidate.h @@ -1,7 +1,7 @@ #ifndef RecoAlgos_TrackToRefCandidate_h #define RecoAlgos_TrackToRefCandidate_h -#include "CommonTools/RecoAlgos/src/MassiveCandidateConverter.h" -#include "CommonTools/RecoAlgos/src/CandidateProducer.h" +#include "CommonTools/RecoAlgos/interface/MassiveCandidateConverter.h" +#include "CommonTools/RecoAlgos/interface/CandidateProducer.h" #include "DataFormats/TrackReco/interface/Track.h" #include "DataFormats/RecoCandidate/interface/RecoChargedRefCandidate.h" #include "DataFormats/RecoCandidate/interface/RecoChargedRefCandidateFwd.h" diff --git a/CommonTools/RecoAlgos/plugins/CaloJetShallowCloneProducer.cc b/CommonTools/RecoAlgos/plugins/CaloJetShallowCloneProducer.cc deleted file mode 100644 index a6fa0206970cc..0000000000000 --- a/CommonTools/RecoAlgos/plugins/CaloJetShallowCloneProducer.cc +++ /dev/null @@ -1,8 +0,0 @@ -#include "DataFormats/JetReco/interface/CaloJet.h" -#include "CommonTools/CandAlgos/interface/ShallowCloneProducer.h" - -typedef ShallowCloneProducer CaloJetShallowCloneProducer; - -#include "FWCore/Framework/interface/MakerMacros.h" - -DEFINE_FWK_MODULE(CaloJetShallowCloneProducer); diff --git a/CommonTools/RecoAlgos/plugins/CaloMETShallowCloneProducer.cc b/CommonTools/RecoAlgos/plugins/CaloMETShallowCloneProducer.cc deleted file mode 100644 index 2be9da4048dff..0000000000000 --- a/CommonTools/RecoAlgos/plugins/CaloMETShallowCloneProducer.cc +++ /dev/null @@ -1,10 +0,0 @@ -#include "DataFormats/EgammaCandidates/interface/ElectronFwd.h" -#include "DataFormats/METReco/interface/CaloMET.h" -#include "DataFormats/METReco/interface/CaloMETCollection.h" -#include "CommonTools/CandAlgos/interface/ShallowCloneProducer.h" - -typedef ShallowCloneProducer CaloMETShallowCloneProducer; - -#include "FWCore/Framework/interface/MakerMacros.h" - -DEFINE_FWK_MODULE(CaloMETShallowCloneProducer); diff --git a/CommonTools/RecoAlgos/plugins/ElectronShallowCloneProducer.cc b/CommonTools/RecoAlgos/plugins/ElectronShallowCloneProducer.cc deleted file mode 100644 index 8a37e780985f3..0000000000000 --- a/CommonTools/RecoAlgos/plugins/ElectronShallowCloneProducer.cc +++ /dev/null @@ -1,9 +0,0 @@ -#include "DataFormats/EgammaCandidates/interface/Electron.h" -#include "DataFormats/EgammaCandidates/interface/ElectronFwd.h" -#include "CommonTools/CandAlgos/interface/ShallowCloneProducer.h" - -typedef ShallowCloneProducer ElectronShallowCloneProducer; - -#include "FWCore/Framework/interface/MakerMacros.h" - -DEFINE_FWK_MODULE(ElectronShallowCloneProducer); diff --git a/CommonTools/RecoAlgos/plugins/GenJetShallowCloneProducer.cc b/CommonTools/RecoAlgos/plugins/GenJetShallowCloneProducer.cc deleted file mode 100644 index 94e50ddc9b3c2..0000000000000 --- a/CommonTools/RecoAlgos/plugins/GenJetShallowCloneProducer.cc +++ /dev/null @@ -1,8 +0,0 @@ -#include "DataFormats/JetReco/interface/GenJet.h" -#include "CommonTools/CandAlgos/interface/ShallowCloneProducer.h" - -typedef ShallowCloneProducer GenJetShallowCloneProducer; - -#include "FWCore/Framework/interface/MakerMacros.h" - -DEFINE_FWK_MODULE(GenJetShallowCloneProducer); diff --git a/CommonTools/RecoAlgos/plugins/GenMETShallowCloneProducer.cc b/CommonTools/RecoAlgos/plugins/GenMETShallowCloneProducer.cc deleted file mode 100644 index 1186417dc670b..0000000000000 --- a/CommonTools/RecoAlgos/plugins/GenMETShallowCloneProducer.cc +++ /dev/null @@ -1,9 +0,0 @@ -#include "DataFormats/METReco/interface/GenMET.h" -#include "DataFormats/METReco/interface/GenMETCollection.h" -#include "CommonTools/CandAlgos/interface/ShallowCloneProducer.h" - -typedef ShallowCloneProducer GenMETShallowCloneProducer; - -#include "FWCore/Framework/interface/MakerMacros.h" - -DEFINE_FWK_MODULE(GenMETShallowCloneProducer); diff --git a/CommonTools/RecoAlgos/plugins/GsfElectronShallowCloneProducer.cc b/CommonTools/RecoAlgos/plugins/GsfElectronShallowCloneProducer.cc deleted file mode 100644 index e1dcc23e0c8e0..0000000000000 --- a/CommonTools/RecoAlgos/plugins/GsfElectronShallowCloneProducer.cc +++ /dev/null @@ -1,9 +0,0 @@ -#include "DataFormats/EgammaCandidates/interface/GsfElectron.h" -#include "DataFormats/EgammaCandidates/interface/GsfElectronFwd.h" -#include "CommonTools/CandAlgos/interface/ShallowCloneProducer.h" - -typedef ShallowCloneProducer PixelMatchGsfElectronShallowCloneProducer; - -#include "FWCore/Framework/interface/MakerMacros.h" - -DEFINE_FWK_MODULE(PixelMatchGsfElectronShallowCloneProducer); diff --git a/CommonTools/RecoAlgos/plugins/MuonShallowCloneProducer.cc b/CommonTools/RecoAlgos/plugins/MuonShallowCloneProducer.cc deleted file mode 100644 index 0f4c2456415c9..0000000000000 --- a/CommonTools/RecoAlgos/plugins/MuonShallowCloneProducer.cc +++ /dev/null @@ -1,9 +0,0 @@ -#include "DataFormats/MuonReco/interface/Muon.h" -#include "DataFormats/MuonReco/interface/MuonFwd.h" -#include "CommonTools/CandAlgos/interface/ShallowCloneProducer.h" - -typedef ShallowCloneProducer MuonShallowCloneProducer; - -#include "FWCore/Framework/interface/MakerMacros.h" - -DEFINE_FWK_MODULE(MuonShallowCloneProducer); diff --git a/CommonTools/RecoAlgos/plugins/PrimaryVertexSorter.cc b/CommonTools/RecoAlgos/plugins/PrimaryVertexSorter.cc index c9dad79418207..b019100fa3e3b 100644 --- a/CommonTools/RecoAlgos/plugins/PrimaryVertexSorter.cc +++ b/CommonTools/RecoAlgos/plugins/PrimaryVertexSorter.cc @@ -6,3 +6,5 @@ typedef PrimaryVertexSorter > RecoCha DEFINE_FWK_MODULE(RecoChargedRefCandidatePrimaryVertexSorter); typedef PrimaryVertexSorter > PFCandidatePrimaryVertexSorter; DEFINE_FWK_MODULE(PFCandidatePrimaryVertexSorter); +typedef PrimaryVertexSorter > PackedCandidatePrimaryVertexSorter; +DEFINE_FWK_MODULE(PackedCandidatePrimaryVertexSorter); diff --git a/CommonTools/RecoAlgos/plugins/PrimaryVertexSorter.h b/CommonTools/RecoAlgos/plugins/PrimaryVertexSorter.h index 300ce6cb2c14b..e4e8e5b98cc4e 100644 --- a/CommonTools/RecoAlgos/plugins/PrimaryVertexSorter.h +++ b/CommonTools/RecoAlgos/plugins/PrimaryVertexSorter.h @@ -20,6 +20,7 @@ #include "CommonTools/RecoAlgos/interface/PrimaryVertexAssignment.h" #include "CommonTools/RecoAlgos/interface/PrimaryVertexSorting.h" +#include "DataFormats/PatCandidates/interface/PackedCandidate.h" /**\class PrimaryVertexSorter * \author Andrea Rizzi @@ -311,6 +312,10 @@ template <> inline void PrimaryVertexSorter>::doConsumesForTiming(const edm::ParameterSet& iConfig) { } +template <> +inline void PrimaryVertexSorter>::doConsumesForTiming( + const edm::ParameterSet& iConfig) {} + template <> inline bool PrimaryVertexSorter>::needsProductsForTiming() { return true; @@ -321,6 +326,11 @@ inline bool PrimaryVertexSorter>::needsProductsFo return false; } +template <> +inline bool PrimaryVertexSorter>::needsProductsForTiming() { + return false; +} + template <> inline std::pair PrimaryVertexSorter>::runAlgo(const reco::VertexCollection& vertices, @@ -343,4 +353,15 @@ inline std::pair PrimaryVertexSorter +inline std::pair PrimaryVertexSorter>::runAlgo( + const reco::VertexCollection& vertices, + const pat::PackedCandidate& pf, + const edm::ValueMap* trackTimeTag, + const edm::ValueMap* trackTimeResoTag, + const edm::View& jets, + const TransientTrackBuilder& builder) { + return assignmentAlgo_.chargedHadronVertex(vertices, pf, jets, builder); +} + #endif diff --git a/CommonTools/RecoAlgos/plugins/RecoChargedRefCandidateToTrackRefProducer.cc b/CommonTools/RecoAlgos/plugins/RecoChargedRefCandidateToTrackRefProducer.cc index 35ed449396ee0..12018c6de5d0f 100644 --- a/CommonTools/RecoAlgos/plugins/RecoChargedRefCandidateToTrackRefProducer.cc +++ b/CommonTools/RecoAlgos/plugins/RecoChargedRefCandidateToTrackRefProducer.cc @@ -1,5 +1,5 @@ #include "CommonTools/RecoAlgos/src/RecoChargedRefCandidateToTrackRef.h" -#include "CommonTools/RecoAlgos/src/CandidateProducer.h" +#include "CommonTools/RecoAlgos/interface/CandidateProducer.h" #include "FWCore/Framework/interface/MakerMacros.h" diff --git a/CommonTools/CandAlgos/interface/ShallowCloneProducer.h b/CommonTools/RecoAlgos/plugins/ShallowCloneProducer.cc similarity index 51% rename from CommonTools/CandAlgos/interface/ShallowCloneProducer.h rename to CommonTools/RecoAlgos/plugins/ShallowCloneProducer.cc index 7deaaf9e38365..900e143d56843 100644 --- a/CommonTools/CandAlgos/interface/ShallowCloneProducer.h +++ b/CommonTools/RecoAlgos/plugins/ShallowCloneProducer.cc @@ -1,5 +1,3 @@ -#ifndef CandAlgos_ShallowCloneProducer_h -#define CandAlgos_ShallowCloneProducer_h /** \class ShallowCloneProducer * * Clones a concrete Candidate collection @@ -13,11 +11,12 @@ * - C : Concrete candidate collection type * */ + +#include "DataFormats/Candidate/interface/ShallowCloneCandidate.h" #include "FWCore/Framework/interface/EDProducer.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "FWCore/Utilities/interface/InputTag.h" -#include "DataFormats/Candidate/interface/ShallowCloneCandidate.h" template class ShallowCloneProducer : public edm::EDProducer { @@ -55,4 +54,33 @@ void ShallowCloneProducer::produce(edm::Event& evt, const edm::EventSetup&) { evt.put(std::move(coll)); } -#endif +#include "DataFormats/EgammaCandidates/interface/Electron.h" +#include "DataFormats/EgammaCandidates/interface/ElectronFwd.h" +#include "DataFormats/EgammaCandidates/interface/GsfElectron.h" +#include "DataFormats/EgammaCandidates/interface/GsfElectronFwd.h" +#include "DataFormats/JetReco/interface/CaloJet.h" +#include "DataFormats/JetReco/interface/GenJet.h" +#include "DataFormats/METReco/interface/CaloMET.h" +#include "DataFormats/METReco/interface/CaloMETCollection.h" +#include "DataFormats/METReco/interface/GenMET.h" +#include "DataFormats/METReco/interface/GenMETCollection.h" +#include "DataFormats/MuonReco/interface/Muon.h" +#include "DataFormats/MuonReco/interface/MuonFwd.h" + +typedef ShallowCloneProducer GenMETShallowCloneProducer; +typedef ShallowCloneProducer PixelMatchGsfElectronShallowCloneProducer; +typedef ShallowCloneProducer MuonShallowCloneProducer; +typedef ShallowCloneProducer CaloMETShallowCloneProducer; +typedef ShallowCloneProducer ElectronShallowCloneProducer; +typedef ShallowCloneProducer GenJetShallowCloneProducer; +typedef ShallowCloneProducer CaloJetShallowCloneProducer; + +#include "FWCore/Framework/interface/MakerMacros.h" + +DEFINE_FWK_MODULE(GenMETShallowCloneProducer); +DEFINE_FWK_MODULE(PixelMatchGsfElectronShallowCloneProducer); +DEFINE_FWK_MODULE(MuonShallowCloneProducer); +DEFINE_FWK_MODULE(CaloMETShallowCloneProducer); +DEFINE_FWK_MODULE(ElectronShallowCloneProducer); +DEFINE_FWK_MODULE(GenJetShallowCloneProducer); +DEFINE_FWK_MODULE(CaloJetShallowCloneProducer); diff --git a/PhysicsTools/PatAlgos/python/slimming/primaryVertexAssociation_cfi.py b/CommonTools/RecoAlgos/python/primaryVertexAssociation_cfi.py similarity index 100% rename from PhysicsTools/PatAlgos/python/slimming/primaryVertexAssociation_cfi.py rename to CommonTools/RecoAlgos/python/primaryVertexAssociation_cfi.py diff --git a/CommonTools/RecoAlgos/python/sortedPFPrimaryVertices_cfi.py b/CommonTools/RecoAlgos/python/sortedPFPrimaryVertices_cfi.py index ef8876b177ebf..1e446422fb1e1 100644 --- a/CommonTools/RecoAlgos/python/sortedPFPrimaryVertices_cfi.py +++ b/CommonTools/RecoAlgos/python/sortedPFPrimaryVertices_cfi.py @@ -18,7 +18,15 @@ maxDxySigForNotReconstructedPrimary = cms.double(2), #in AND with next maxDxyForNotReconstructedPrimary = cms.double(0.01), #in AND with prev useTiming = cms.bool(False), - preferHighRanked = cms.bool(False) + useVertexFit = cms.bool(True), + preferHighRanked = cms.bool(False), + + #options used in PUPPI + NumOfPUVtxsForCharged = cms.int32(-1), + DzCutForChargedFromPUVtxs = cms.double(0.2), + PtMaxCharged = cms.double(-1), + EtaMinUseDz = cms.double(-1), + OnlyUseFirstDz = cms.bool(False), ), particles = cms.InputTag("particleFlow"), vertices= cms.InputTag("offlinePrimaryVertices"), @@ -31,4 +39,3 @@ produceNoPileUpCollection = cms.bool(True), ) - diff --git a/CommonTools/RecoAlgos/python/sortedPackedPrimaryVertices_cfi.py b/CommonTools/RecoAlgos/python/sortedPackedPrimaryVertices_cfi.py new file mode 100644 index 0000000000000..9a9b171db5bf4 --- /dev/null +++ b/CommonTools/RecoAlgos/python/sortedPackedPrimaryVertices_cfi.py @@ -0,0 +1,15 @@ +import FWCore.ParameterSet.Config as cms +from CommonTools.RecoAlgos.sortedPFPrimaryVertices_cfi import sortedPFPrimaryVertices +sortedPackedPrimaryVertices = cms.EDProducer("PackedCandidatePrimaryVertexSorter", + sorting = cms.PSet(), + assignment = sortedPFPrimaryVertices.assignment, + particles = cms.InputTag("packedPFCandidates"), + vertices= cms.InputTag("offlineSlimmedPrimaryVertices"), + jets= cms.InputTag("slimmedJets"), + qualityForPrimary = cms.int32(3), + usePVMET = cms.bool(True), + produceAssociationToOriginalVertices = cms.bool(True), + produceSortedVertices = cms.bool(True), + producePileUpCollection = cms.bool(True), + produceNoPileUpCollection = cms.bool(True), +) diff --git a/CommonTools/RecoAlgos/python/sortedPrimaryVertices_cfi.py b/CommonTools/RecoAlgos/python/sortedPrimaryVertices_cfi.py index e2d877bf93292..57be0713ca862 100644 --- a/CommonTools/RecoAlgos/python/sortedPrimaryVertices_cfi.py +++ b/CommonTools/RecoAlgos/python/sortedPrimaryVertices_cfi.py @@ -18,7 +18,15 @@ maxDxySigForNotReconstructedPrimary = cms.double(2), #in AND with next maxDxyForNotReconstructedPrimary = cms.double(0.01), #in AND with prev useTiming = cms.bool(False), + useVertexFit = cms.bool(True), preferHighRanked = cms.bool(False), + + #options used in PUPPI + NumOfPUVtxsForCharged = cms.int32(-1), + DzCutForChargedFromPUVtxs = cms.double(0.2), + PtMaxCharged = cms.double(-1), + EtaMinUseDz = cms.double(-1), + OnlyUseFirstDz = cms.bool(False), ), particles = cms.InputTag("trackRefsForJets"), trackTimeTag = cms.InputTag(""), diff --git a/CommonTools/RecoAlgos/src/MassiveCandidateConverter.cc b/CommonTools/RecoAlgos/src/MassiveCandidateConverter.cc index fdbbdb645c852..9f2733b32d829 100644 --- a/CommonTools/RecoAlgos/src/MassiveCandidateConverter.cc +++ b/CommonTools/RecoAlgos/src/MassiveCandidateConverter.cc @@ -1,4 +1,4 @@ -#include "CommonTools/RecoAlgos/src/MassiveCandidateConverter.h" +#include "CommonTools/RecoAlgos/interface/MassiveCandidateConverter.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "HepPDT/ParticleData.hh" #include "FWCore/Framework/interface/ESHandle.h" diff --git a/CommonTools/RecoAlgos/src/PFClusterToRefCandidate.h b/CommonTools/RecoAlgos/src/PFClusterToRefCandidate.h index e4d69d8d750a2..e8c99a1287aef 100644 --- a/CommonTools/RecoAlgos/src/PFClusterToRefCandidate.h +++ b/CommonTools/RecoAlgos/src/PFClusterToRefCandidate.h @@ -1,7 +1,7 @@ #ifndef RecoAlgos_PFClusterToRefCandidate_h #define RecoAlgos_PFClusterToRefCandidate_h -#include "CommonTools/RecoAlgos/src/MassiveCandidateConverter.h" -#include "CommonTools/RecoAlgos/src/CandidateProducer.h" +#include "CommonTools/RecoAlgos/interface/MassiveCandidateConverter.h" +#include "CommonTools/RecoAlgos/interface/CandidateProducer.h" #include "DataFormats/ParticleFlowReco/interface/PFCluster.h" #include "DataFormats/ParticleFlowReco/interface/RecoPFClusterRefCandidate.h" #include "DataFormats/ParticleFlowReco/interface/RecoPFClusterRefCandidateFwd.h" diff --git a/CommonTools/RecoAlgos/src/PrimaryVertexAssignment.cc b/CommonTools/RecoAlgos/src/PrimaryVertexAssignment.cc index 83ca81b2679fe..230a336d4d4e3 100644 --- a/CommonTools/RecoAlgos/src/PrimaryVertexAssignment.cc +++ b/CommonTools/RecoAlgos/src/PrimaryVertexAssignment.cc @@ -28,6 +28,19 @@ std::pair PrimaryVertexAssignment::charge } index++; } + return chargedHadronVertex(vertices, iVertex, track, time, timeReso, jets, builder); +} + +std::pair PrimaryVertexAssignment::chargedHadronVertex( + const reco::VertexCollection& vertices, + int iVertex, + const reco::Track* track, + float time, + float timeReso, // <0 if timing not available for this object + const edm::View& jets, + const TransientTrackBuilder& builder) const { + typedef reco::VertexCollection::const_iterator IV; + typedef reco::Vertex::trackRef_iterator IT; bool useTime = useTiming_; if (edm::isNotFinite(time) || timeReso < 1e-6) { @@ -39,8 +52,8 @@ std::pair PrimaryVertexAssignment::charge if (preferHighRanked_) { for (IV iv = vertices.begin(); iv != vertices.end(); ++iv) { int ivtx = iv - vertices.begin(); - if (iVertex == ivtx) - return std::pair(ivtx, PrimaryVertexAssignment::UsedInFit); + if (useVertexFit_ && (iVertex == ivtx)) + return {ivtx, PrimaryVertexAssignment::UsedInFit}; double dz = std::abs(track->dz(iv->position())); double dt = std::abs(time - iv->t()); @@ -49,13 +62,21 @@ std::pair PrimaryVertexAssignment::charge if ((dz < maxDzForPrimaryAssignment_ or dz / track->dzError() < maxDzSigForPrimaryAssignment_) and (!useTimeVtx or dt / timeReso < maxDtSigForPrimaryAssignment_)) { - return std::pair(ivtx, PrimaryVertexAssignment::PrimaryDz); + return {ivtx, PrimaryVertexAssignment::PrimaryDz}; } } } - if (iVertex >= 0) - return std::pair(iVertex, PrimaryVertexAssignment::UsedInFit); + double firstVertexDz = std::numeric_limits::max(); + if (!vertices.empty()) + firstVertexDz = std::abs(track->dz(vertices.at(0).position())); + // recover cases where the primary vertex is split + if (useVertexFit_ && (iVertex > 0) && (iVertex <= fNumOfPUVtxsForCharged_) && + firstVertexDz < fDzCutForChargedFromPUVtxs_) + return {0, PrimaryVertexAssignment::PrimaryDz}; + + if (useVertexFit_ && (iVertex >= 0)) + return {iVertex, PrimaryVertexAssignment::UsedInFit}; double distmin = std::numeric_limits::max(); double dzmin = std::numeric_limits::max(); @@ -86,30 +107,45 @@ std::pair PrimaryVertexAssignment::charge } } - // first use "closest in Z" with tight cuts (targetting primary particles) - const float add_cov = vtxIdMinSignif >= 0 ? vertices[vtxIdMinSignif].covariance(2, 2) : 0.f; - const float dzE = sqrt(track->dzError() * track->dzError() + add_cov); - if (vtxIdMinSignif >= 0 and - (dzmin < maxDzForPrimaryAssignment_ and dzmin / dzE < maxDzSigForPrimaryAssignment_ and - track->dzError() < maxDzErrorForPrimaryAssignment_) and - (!useTime or dtmin / timeReso < maxDtSigForPrimaryAssignment_)) { - iVertex = vtxIdMinSignif; + // protect high pT particles from association to pileup vertices and assign them to the first vertex + if ((fPtMaxCharged_ > 0) && (vtxIdMinSignif >= 0) && (track->pt() > fPtMaxCharged_)) { + iVertex = 0; + } else { + // first use "closest in Z" with tight cuts (targetting primary particles) + const float add_cov = vtxIdMinSignif >= 0 ? vertices[vtxIdMinSignif].covariance(2, 2) : 0.f; + const float dzE = sqrt(track->dzError() * track->dzError() + add_cov); + if (!fOnlyUseFirstDz_) { + if (vtxIdMinSignif >= 0 and + (dzmin < maxDzForPrimaryAssignment_ and dzmin / dzE < maxDzSigForPrimaryAssignment_ and + track->dzError() < maxDzErrorForPrimaryAssignment_) and + (!useTime or dtmin / timeReso < maxDtSigForPrimaryAssignment_)) + iVertex = vtxIdMinSignif; + } else { + // consider only distances to first vertex for association of pileup vertices (originally used in PUPPI) + if ((vtxIdMinSignif >= 0) && (std::abs(track->eta()) > fEtaMinUseDz_)) + iVertex = + ((firstVertexDz < maxDzForPrimaryAssignment_ and firstVertexDz / dzE < maxDzSigForPrimaryAssignment_ and + track->dzError() < maxDzErrorForPrimaryAssignment_) and + (!useTime or std::abs(time - vertices.at(0).t()) / timeReso < maxDtSigForPrimaryAssignment_)) + ? 0 + : vtxIdMinSignif; + } } if (iVertex >= 0) - return std::pair(iVertex, PrimaryVertexAssignment::PrimaryDz); + return {iVertex, PrimaryVertexAssignment::PrimaryDz}; // if track not assigned yet, it could be a b-decay secondary , use jet axis dist criterion // first find the closest jet within maxJetDeltaR_ int jetIdx = -1; - double minDeltaR = maxJetDeltaR_; + double minDeltaR2 = maxJetDeltaR_ * maxJetDeltaR_; for (edm::View::const_iterator ij = jets.begin(); ij != jets.end(); ++ij) { if (ij->pt() < minJetPt_) continue; // skip jets below the jet Pt threshold - double deltaR = reco::deltaR(*ij, *track); - if (deltaR < minDeltaR and track->dzError() < maxDzErrorForPrimaryAssignment_) { - minDeltaR = deltaR; + double deltaR2 = reco::deltaR2(*ij, *track); + if (deltaR2 < minDeltaR2 and track->dzError() < maxDzErrorForPrimaryAssignment_) { + minDeltaR2 = deltaR2; jetIdx = std::distance(jets.begin(), ij); } } @@ -137,20 +173,19 @@ std::pair PrimaryVertexAssignment::charge } } if (iVertex >= 0) - return std::pair(iVertex, PrimaryVertexAssignment::BTrack); + return {iVertex, PrimaryVertexAssignment::BTrack}; // if the track is not compatible with other PVs but is compatible with the BeamSpot, we may simply have not reco'ed the PV! // we still point it to the closest in Z, but flag it as possible orphan-primary if (!vertices.empty() && std::abs(track->dxy(vertices[0].position())) < maxDxyForNotReconstructedPrimary_ && std::abs(track->dxy(vertices[0].position()) / track->dxyError()) < maxDxySigForNotReconstructedPrimary_) - return std::pair(vtxIdMinSignif, - PrimaryVertexAssignment::NotReconstructedPrimary); + return {vtxIdMinSignif, PrimaryVertexAssignment::NotReconstructedPrimary}; //FIXME: here we could better handle V0s and NucInt // all other tracks could be non-B secondaries and we just attach them with closest Z if (vtxIdMinSignif >= 0) - return std::pair(vtxIdMinSignif, PrimaryVertexAssignment::OtherDz); + return {vtxIdMinSignif, PrimaryVertexAssignment::OtherDz}; //If for some reason even the dz failed (when?) we consider the track not assigned - return std::pair(-1, PrimaryVertexAssignment::Unassigned); + return {-1, PrimaryVertexAssignment::Unassigned}; } diff --git a/CommonTools/RecoAlgos/src/StandAloneMuonTrackToCandidate.h b/CommonTools/RecoAlgos/src/StandAloneMuonTrackToCandidate.h index dc33670a700d2..0a00f7f809f7f 100644 --- a/CommonTools/RecoAlgos/src/StandAloneMuonTrackToCandidate.h +++ b/CommonTools/RecoAlgos/src/StandAloneMuonTrackToCandidate.h @@ -1,7 +1,7 @@ #ifndef RecoAlgos_StandAloneMuonTrackToCandidate_h #define RecoAlgos_StandAloneMuonTrackToCandidate_h -#include "CommonTools/RecoAlgos/src/MassiveCandidateConverter.h" -#include "CommonTools/RecoAlgos/src/CandidateProducer.h" +#include "CommonTools/RecoAlgos/interface/MassiveCandidateConverter.h" +#include "CommonTools/RecoAlgos/interface/CandidateProducer.h" #include "DataFormats/TrackReco/interface/Track.h" #include "DataFormats/RecoCandidate/interface/RecoStandAloneMuonCandidate.h" #include "DataFormats/RecoCandidate/interface/RecoStandAloneMuonCandidateFwd.h" diff --git a/CommonTools/RecoAlgos/src/SuperClusterToCandidate.h b/CommonTools/RecoAlgos/src/SuperClusterToCandidate.h index 5f473303cc282..54bc8652ec80d 100644 --- a/CommonTools/RecoAlgos/src/SuperClusterToCandidate.h +++ b/CommonTools/RecoAlgos/src/SuperClusterToCandidate.h @@ -1,7 +1,7 @@ #ifndef RecoAlgos_SuperClusterToCandidate_h #define RecoAlgos_SuperClusterToCandidate_h -#include "CommonTools/RecoAlgos/src/MassiveCandidateConverter.h" -#include "CommonTools/RecoAlgos/src/CandidateProducer.h" +#include "CommonTools/RecoAlgos/interface/MassiveCandidateConverter.h" +#include "CommonTools/RecoAlgos/interface/CandidateProducer.h" #include "DataFormats/EgammaReco/interface/SuperCluster.h" #include "DataFormats/RecoCandidate/interface/RecoEcalCandidate.h" #include "DataFormats/RecoCandidate/interface/RecoEcalCandidateFwd.h" diff --git a/CommonTools/RecoAlgos/src/TrackToCandidate.h b/CommonTools/RecoAlgos/src/TrackToCandidate.h index 4764c0d8c6b2a..593772ef97157 100644 --- a/CommonTools/RecoAlgos/src/TrackToCandidate.h +++ b/CommonTools/RecoAlgos/src/TrackToCandidate.h @@ -1,7 +1,7 @@ #ifndef RecoAlgos_TrackToCandidate_h #define RecoAlgos_TrackToCandidate_h -#include "CommonTools/RecoAlgos/src/MassiveCandidateConverter.h" -#include "CommonTools/RecoAlgos/src/CandidateProducer.h" +#include "CommonTools/RecoAlgos/interface/MassiveCandidateConverter.h" +#include "CommonTools/RecoAlgos/interface/CandidateProducer.h" #include "DataFormats/TrackReco/interface/Track.h" #include "DataFormats/RecoCandidate/interface/RecoChargedCandidate.h" #include "DataFormats/RecoCandidate/interface/RecoChargedCandidateFwd.h" diff --git a/CommonTools/Statistics/interface/BinomialProbability.h b/CommonTools/Statistics/interface/BinomialProbability.h deleted file mode 100644 index 70cc211076dd8..0000000000000 --- a/CommonTools/Statistics/interface/BinomialProbability.h +++ /dev/null @@ -1,49 +0,0 @@ -#ifndef BinomialProbability_H -#define BinomialProbability_H - -#include - -/** A simple class for accumulating binomial "events", - * i.e. events that have a yes/no outcome, - * and for computing the binomial error on the - * fraction of positive hits. - */ - -class BinomialProbability { -public: - - BinomialProbability() : theHits(0), theTotal(0) {} - - BinomialProbability(int hits, int entries) : - theHits(hits), theTotal(entries) {} - - float value() const { - return theTotal == 0 ? 0 :float(theHits) / float(theTotal); - } - - float error() const { - float p = value(); - return theTotal <= 1 ? 0 : sqrt( p*(1.f - p)/(theTotal-1)); - } - - int entries() const { return theTotal;} - - int hits() const { return theHits;} - - void hit() { theHits++; theTotal++;} - - void miss() { theTotal++;} - - void update( bool hit) { - if ( hit) theHits++; - theTotal++; - } - -private: - - int theHits; - int theTotal; - -}; - -#endif diff --git a/CommonTools/UtilAlgos/interface/DummyMatchSelector.h b/CommonTools/UtilAlgos/interface/DummyMatchSelector.h deleted file mode 100644 index 8d0d99aab14d8..0000000000000 --- a/CommonTools/UtilAlgos/interface/DummyMatchSelector.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef DummyMatchSelector_h -#define DummyMatchSelector_h - -/** - Dummy class for preselection of object matches. -*/ - -#include "FWCore/ParameterSet/interface/ParameterSet.h" - -namespace reco { - - template - class DummyMatchSelector { - - public: - - DummyMatchSelector(const edm::ParameterSet& cfg) { } - - bool operator()( const T1 & c, const T2 & hlt ) const { return true; } - - }; - -} - - -#endif diff --git a/CommonTools/UtilAlgos/interface/MassMinSelector.h b/CommonTools/UtilAlgos/interface/MassMinSelector.h deleted file mode 100755 index 73f37fc036aa6..0000000000000 --- a/CommonTools/UtilAlgos/interface/MassMinSelector.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef UtilAlgos_MassMinSelector_h -#define UtilAlgos_MassMinSelector_h -#include "CommonTools/UtilAlgos/interface/ParameterAdapter.h" -#include "CommonTools/Utils/interface/MassMinSelector.h" - -namespace reco { - namespace modules { - - template<> - struct ParameterAdapter { - static MassMinSelector make( const edm::ParameterSet & cfg ) { - return - MassMinSelector( cfg.getParameter( "massMin" ) ); - } - }; - - } -} - -#endif - diff --git a/CommonTools/UtilAlgos/interface/MassRangeSelector.h b/CommonTools/UtilAlgos/interface/MassRangeSelector.h deleted file mode 100755 index 62019baf4e5b3..0000000000000 --- a/CommonTools/UtilAlgos/interface/MassRangeSelector.h +++ /dev/null @@ -1,22 +0,0 @@ -#ifndef UtilAlgos_MassRangeSelector_h -#define UtilAlgos_MassRangeSelector_h -#include "CommonTools/UtilAlgos/interface/ParameterAdapter.h" -#include "CommonTools/Utils/interface/MassRangeSelector.h" - -namespace reco { - namespace modules { - - template<> - struct ParameterAdapter { - static MassRangeSelector make( const edm::ParameterSet & cfg ) { - return - MassRangeSelector( cfg.getParameter( "massMin" ), - cfg.getParameter( "massMax" ) ); - } - }; - - } -} - -#endif - diff --git a/CommonTools/UtilAlgos/interface/MinSelector.h b/CommonTools/UtilAlgos/interface/MinSelector.h old mode 100755 new mode 100644 index efa3d22ccca5d..c92b27faa991c --- a/CommonTools/UtilAlgos/interface/MinSelector.h +++ b/CommonTools/UtilAlgos/interface/MinSelector.h @@ -5,16 +5,15 @@ namespace reco { namespace modules { - - template + + template struct ParameterAdapter > { - static MinSelector make( const edm::ParameterSet & cfg ) { - return MinSelector( cfg.template getParameter( "min" ) ); + static MinSelector make(const edm::ParameterSet& cfg) { + return MinSelector(cfg.template getParameter("min")); } }; - } -} + } // namespace modules +} // namespace reco #endif - diff --git a/CommonTools/UtilAlgos/interface/ObjectPairFilter.h b/CommonTools/UtilAlgos/interface/ObjectPairFilter.h deleted file mode 100755 index 18a66ca61d081..0000000000000 --- a/CommonTools/UtilAlgos/interface/ObjectPairFilter.h +++ /dev/null @@ -1,60 +0,0 @@ -#ifndef RecoAlgos_ObjectPairFilter_h -#define RecoAlgos_ObjectPairFilter_h -/** \class ObjectPairFilter - * - * Filters an event if one or more pairs of objects passes a given selection - * - * \author Luca Lista, INFN - * - * \version $Revision: 1.3 $ - * - * $Id: ObjectPairFilter.h,v 1.3 2010/02/20 20:55:26 wmtan Exp $ - * - */ - -#include "FWCore/Framework/interface/EDFilter.h" -#include "FWCore/Framework/interface/Event.h" -#include "FWCore/ParameterSet/interface/ParameterSet.h" -#include "FWCore/Utilities/interface/InputTag.h" -#include "CommonTools/UtilAlgos/interface/ParameterAdapter.h" -#include -#include - -template -class ObjectPairFilter : public edm::EDFilter { -public: - /// constructor - explicit ObjectPairFilter( const edm::ParameterSet & cfg ) : - select_( reco::modules::make( cfg ) ), - srcToken_( consumes( cfg.template getParameter( "src" ) ) ), - minNumber_( 1 ) { - std::vector ints = cfg.template getParameterNamesForType(); - const std::string minNumber( "minNumber" ); - bool foundMinNumber = std::find( ints.begin(), ints.end(), minNumber ) != ints.end(); - if ( foundMinNumber ) - minNumber_ = cfg.template getParameter( minNumber ); - } - -private: - /// process one event - bool filter( edm::Event& evt, const edm::EventSetup&) override { - edm::Handle source; - evt.getByToken( srcToken_, source ); - size_t n = 0; - for( typename C::const_iterator i = source->begin(); i != source->end(); ++ i ) - for( typename C::const_iterator j = i + 1; j != source->end(); ++ j ) { - if ( select_( * i, * j ) ) n ++; - if ( n >= minNumber_ ) return true; - } - return false; - } - /// object filter - S select_; - /// source collection label - edm::EDGetTokenT srcToken_; - /// minimum number of entries in a collection - unsigned int minNumber_; -}; - -#endif - diff --git a/CommonTools/UtilAlgos/interface/ObjectRefVectorSelector.h b/CommonTools/UtilAlgos/interface/ObjectRefVectorSelector.h deleted file mode 100755 index 0537972897fcc..0000000000000 --- a/CommonTools/UtilAlgos/interface/ObjectRefVectorSelector.h +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef CandAlgos_ObjectRefVectorSelector_h -#define CandAlgos_ObjectRefVectorSelector_h -/* \class RefVectorRefVectorStoreMananger - * - * \author Luca Lista, INFN - * - */ -#include "CommonTools/UtilAlgos/interface/ObjectSelector.h" -#include "DataFormats/Common/interface/RefVector.h" - -template, - typename SizeSelector = NonNullNumberSelector, - typename PostProcessor = helper::NullPostProcessor > -class ObjectRefVectorSelector : - public ObjectSelector { -public: - explicit ObjectRefVectorSelector( const edm::ParameterSet & cfg ) : - ObjectSelector( cfg ) { } -}; - -#endif - diff --git a/CommonTools/UtilAlgos/interface/OrPairSelector.h b/CommonTools/UtilAlgos/interface/OrPairSelector.h old mode 100755 new mode 100644 index afea4fecf1847..8b87a4ccdabf1 --- a/CommonTools/UtilAlgos/interface/OrPairSelector.h +++ b/CommonTools/UtilAlgos/interface/OrPairSelector.h @@ -5,17 +5,16 @@ namespace reco { namespace modules { - - template + + template struct ParameterAdapter > { - static OrPairSelector make(const edm::ParameterSet & cfg) { - return OrPairSelector(modules::make(cfg.getParameter("cut1")), - modules::make(cfg.getParameter("cut2"))); + static OrPairSelector make(const edm::ParameterSet& cfg) { + return OrPairSelector(modules::make(cfg.getParameter("cut1")), + modules::make(cfg.getParameter("cut2"))); } }; - } -} + } // namespace modules +} // namespace reco #endif - diff --git a/CommonTools/Utils/interface/Angle.h b/CommonTools/Utils/interface/Angle.h deleted file mode 100644 index baf9889550e9a..0000000000000 --- a/CommonTools/Utils/interface/Angle.h +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef CommonTools_Utils_Angle_h -#define CommonTools_Utils_Angle_h - -/* \class Angle - * - * returns three-dimensional Angle between two objects; - * defined via scalar product: - * angle = acos((v1 * v2)/(|v1| * |v2|)) - * - * \author Christian Veelken, UC Davis - */ - -#include "DataFormats/Math/interface/LorentzVector.h" -#include "DataFormats/Math/interface/angle.h" - -template -struct Angle { - double operator()( const T1 & t1, const T2 & t2 ) const { - return angle( t1, t2 ); - } -}; - -#endif diff --git a/CommonTools/Utils/src/AnyMethodArgument.h b/CommonTools/Utils/interface/AnyMethodArgument.h similarity index 100% rename from CommonTools/Utils/src/AnyMethodArgument.h rename to CommonTools/Utils/interface/AnyMethodArgument.h diff --git a/CommonTools/Utils/src/BinaryCutSetter.h b/CommonTools/Utils/interface/BinaryCutSetter.h similarity index 86% rename from CommonTools/Utils/src/BinaryCutSetter.h rename to CommonTools/Utils/interface/BinaryCutSetter.h index 98a3881561e9b..b0ddcc8e785d5 100644 --- a/CommonTools/Utils/src/BinaryCutSetter.h +++ b/CommonTools/Utils/interface/BinaryCutSetter.h @@ -10,8 +10,8 @@ * \version $Revision: 1.2 $ * */ -#include "CommonTools/Utils/src/SelectorStack.h" -#include "CommonTools/Utils/src/LogicalBinaryOperator.h" +#include "CommonTools/Utils/interface/SelectorStack.h" +#include "CommonTools/Utils/interface/LogicalBinaryOperator.h" namespace reco { namespace parser { diff --git a/CommonTools/Utils/src/BinarySelector.h b/CommonTools/Utils/interface/BinarySelector.h similarity index 94% rename from CommonTools/Utils/src/BinarySelector.h rename to CommonTools/Utils/interface/BinarySelector.h index acfe31fdf62fe..08e789945c626 100644 --- a/CommonTools/Utils/src/BinarySelector.h +++ b/CommonTools/Utils/interface/BinarySelector.h @@ -12,7 +12,7 @@ */ #include "CommonTools/Utils/interface/SelectorBase.h" #include "CommonTools/Utils/interface/ExpressionBase.h" -#include "CommonTools/Utils/src/ComparisonBase.h" +#include "CommonTools/Utils/interface/ComparisonBase.h" namespace reco { namespace parser { diff --git a/CommonTools/Utils/src/BinarySelectorSetter.h b/CommonTools/Utils/interface/BinarySelectorSetter.h similarity index 87% rename from CommonTools/Utils/src/BinarySelectorSetter.h rename to CommonTools/Utils/interface/BinarySelectorSetter.h index 60602ea43a23f..13dc51209c0c4 100644 --- a/CommonTools/Utils/src/BinarySelectorSetter.h +++ b/CommonTools/Utils/interface/BinarySelectorSetter.h @@ -10,10 +10,10 @@ * \version $Revision: 1.2 $ * */ -#include "CommonTools/Utils/src/SelectorStack.h" -#include "CommonTools/Utils/src/ComparisonStack.h" -#include "CommonTools/Utils/src/ExpressionStack.h" -#include "CommonTools/Utils/src/BinarySelector.h" +#include "CommonTools/Utils/interface/SelectorStack.h" +#include "CommonTools/Utils/interface/ComparisonStack.h" +#include "CommonTools/Utils/interface/ExpressionStack.h" +#include "CommonTools/Utils/interface/BinarySelector.h" #include "CommonTools/Utils/interface/Exception.h" namespace reco { diff --git a/CommonTools/Utils/src/Comparison.h b/CommonTools/Utils/interface/Comparison.h similarity index 90% rename from CommonTools/Utils/src/Comparison.h rename to CommonTools/Utils/interface/Comparison.h index 36b93d10600a6..c9e551f133d86 100644 --- a/CommonTools/Utils/src/Comparison.h +++ b/CommonTools/Utils/interface/Comparison.h @@ -10,7 +10,7 @@ * \version $Revision: 1.2 $ * */ -#include "CommonTools/Utils/src/ComparisonBase.h" +#include "CommonTools/Utils/interface/ComparisonBase.h" namespace reco { namespace parser { diff --git a/CommonTools/Utils/src/ComparisonBase.h b/CommonTools/Utils/interface/ComparisonBase.h similarity index 100% rename from CommonTools/Utils/src/ComparisonBase.h rename to CommonTools/Utils/interface/ComparisonBase.h diff --git a/CommonTools/Utils/src/ComparisonSetter.h b/CommonTools/Utils/interface/ComparisonSetter.h similarity index 90% rename from CommonTools/Utils/src/ComparisonSetter.h rename to CommonTools/Utils/interface/ComparisonSetter.h index d939b5af68671..37359abed80fc 100644 --- a/CommonTools/Utils/src/ComparisonSetter.h +++ b/CommonTools/Utils/interface/ComparisonSetter.h @@ -10,8 +10,8 @@ * \version $Revision: 1.2 $ * */ -#include "CommonTools/Utils/src/ComparisonStack.h" -#include "CommonTools/Utils/src/Comparison.h" +#include "CommonTools/Utils/interface/ComparisonStack.h" +#include "CommonTools/Utils/interface/Comparison.h" #ifdef BOOST_SPIRIT_DEBUG #include #include diff --git a/CommonTools/Utils/src/ComparisonStack.h b/CommonTools/Utils/interface/ComparisonStack.h similarity index 100% rename from CommonTools/Utils/src/ComparisonStack.h rename to CommonTools/Utils/interface/ComparisonStack.h diff --git a/CommonTools/Utils/src/CutSetter.h b/CommonTools/Utils/interface/CutSetter.h similarity index 93% rename from CommonTools/Utils/src/CutSetter.h rename to CommonTools/Utils/interface/CutSetter.h index 5c4f37a85fc5f..43c5a67ec9d94 100644 --- a/CommonTools/Utils/src/CutSetter.h +++ b/CommonTools/Utils/interface/CutSetter.h @@ -11,7 +11,7 @@ * */ #include "CommonTools/Utils/interface/SelectorPtr.h" -#include "CommonTools/Utils/src/SelectorStack.h" +#include "CommonTools/Utils/interface/SelectorStack.h" #include namespace reco { diff --git a/CommonTools/Utils/src/ExpressionBinaryOperator.h b/CommonTools/Utils/interface/ExpressionBinaryOperator.h similarity index 94% rename from CommonTools/Utils/src/ExpressionBinaryOperator.h rename to CommonTools/Utils/interface/ExpressionBinaryOperator.h index aaa7c479881db..1bff443ea24be 100644 --- a/CommonTools/Utils/src/ExpressionBinaryOperator.h +++ b/CommonTools/Utils/interface/ExpressionBinaryOperator.h @@ -11,7 +11,7 @@ * */ #include "CommonTools/Utils/interface/ExpressionBase.h" -#include "CommonTools/Utils/src/ExpressionStack.h" +#include "CommonTools/Utils/interface/ExpressionStack.h" namespace reco { namespace parser { diff --git a/CommonTools/Utils/src/ExpressionBinaryOperatorSetter.h b/CommonTools/Utils/interface/ExpressionBinaryOperatorSetter.h similarity index 88% rename from CommonTools/Utils/src/ExpressionBinaryOperatorSetter.h rename to CommonTools/Utils/interface/ExpressionBinaryOperatorSetter.h index 0e85de62b2f70..d695a9eeed6a6 100644 --- a/CommonTools/Utils/src/ExpressionBinaryOperatorSetter.h +++ b/CommonTools/Utils/interface/ExpressionBinaryOperatorSetter.h @@ -10,8 +10,8 @@ * \version $Revision: 1.2 $ * */ -#include "CommonTools/Utils/src/ExpressionBinaryOperator.h" -#include "CommonTools/Utils/src/ExpressionStack.h" +#include "CommonTools/Utils/interface/ExpressionBinaryOperator.h" +#include "CommonTools/Utils/interface/ExpressionStack.h" #include namespace reco { diff --git a/CommonTools/Utils/src/ExpressionConditionSetter.h b/CommonTools/Utils/interface/ExpressionConditionSetter.h similarity index 85% rename from CommonTools/Utils/src/ExpressionConditionSetter.h rename to CommonTools/Utils/interface/ExpressionConditionSetter.h index d62a4a2bfc8fe..e72435f507b2c 100644 --- a/CommonTools/Utils/src/ExpressionConditionSetter.h +++ b/CommonTools/Utils/interface/ExpressionConditionSetter.h @@ -9,8 +9,8 @@ * \version $Revision: 1.1 $ * */ -#include "CommonTools/Utils/src/ExpressionStack.h" -#include "CommonTools/Utils/src/SelectorStack.h" +#include "CommonTools/Utils/interface/ExpressionStack.h" +#include "CommonTools/Utils/interface/SelectorStack.h" namespace reco { namespace parser { diff --git a/CommonTools/Utils/src/ExpressionFunctionSetter.h b/CommonTools/Utils/interface/ExpressionFunctionSetter.h similarity index 85% rename from CommonTools/Utils/src/ExpressionFunctionSetter.h rename to CommonTools/Utils/interface/ExpressionFunctionSetter.h index 8a6c2b02d051c..00fddcb5793e5 100644 --- a/CommonTools/Utils/src/ExpressionFunctionSetter.h +++ b/CommonTools/Utils/interface/ExpressionFunctionSetter.h @@ -9,8 +9,8 @@ * \version $Revision: 1.1 $ * */ -#include "CommonTools/Utils/src/ExpressionStack.h" -#include "CommonTools/Utils/src/FunctionStack.h" +#include "CommonTools/Utils/interface/ExpressionStack.h" +#include "CommonTools/Utils/interface/FunctionStack.h" namespace reco { namespace parser { diff --git a/CommonTools/Utils/src/ExpressionNumber.h b/CommonTools/Utils/interface/ExpressionNumber.h similarity index 100% rename from CommonTools/Utils/src/ExpressionNumber.h rename to CommonTools/Utils/interface/ExpressionNumber.h diff --git a/CommonTools/Utils/src/ExpressionNumberSetter.h b/CommonTools/Utils/interface/ExpressionNumberSetter.h similarity index 85% rename from CommonTools/Utils/src/ExpressionNumberSetter.h rename to CommonTools/Utils/interface/ExpressionNumberSetter.h index 87f5a8d752886..bc78f6629b50b 100644 --- a/CommonTools/Utils/src/ExpressionNumberSetter.h +++ b/CommonTools/Utils/interface/ExpressionNumberSetter.h @@ -10,8 +10,8 @@ * \version $Revision: 1.3 $ * */ -#include "CommonTools/Utils/src/ExpressionNumber.h" -#include "CommonTools/Utils/src/ExpressionStack.h" +#include "CommonTools/Utils/interface/ExpressionNumber.h" +#include "CommonTools/Utils/interface/ExpressionStack.h" namespace reco { namespace parser { diff --git a/CommonTools/Utils/src/ExpressionSelectorSetter.h b/CommonTools/Utils/interface/ExpressionSelectorSetter.h similarity index 84% rename from CommonTools/Utils/src/ExpressionSelectorSetter.h rename to CommonTools/Utils/interface/ExpressionSelectorSetter.h index 0383ea68a8198..72de53f5c4938 100644 --- a/CommonTools/Utils/src/ExpressionSelectorSetter.h +++ b/CommonTools/Utils/interface/ExpressionSelectorSetter.h @@ -10,11 +10,11 @@ * \version $Revision: 1.2 $ * */ -#include "CommonTools/Utils/src/SelectorStack.h" -#include "CommonTools/Utils/src/ExpressionStack.h" -#include "CommonTools/Utils/src/BinarySelector.h" -#include "CommonTools/Utils/src/ExpressionNumber.h" -#include "CommonTools/Utils/src/Comparison.h" +#include "CommonTools/Utils/interface/SelectorStack.h" +#include "CommonTools/Utils/interface/ExpressionStack.h" +#include "CommonTools/Utils/interface/BinarySelector.h" +#include "CommonTools/Utils/interface/ExpressionNumber.h" +#include "CommonTools/Utils/interface/Comparison.h" #include "CommonTools/Utils/interface/Exception.h" #include diff --git a/CommonTools/Utils/src/ExpressionSetter.h b/CommonTools/Utils/interface/ExpressionSetter.h similarity index 92% rename from CommonTools/Utils/src/ExpressionSetter.h rename to CommonTools/Utils/interface/ExpressionSetter.h index b1538e0a304e2..41d035b5628ad 100644 --- a/CommonTools/Utils/src/ExpressionSetter.h +++ b/CommonTools/Utils/interface/ExpressionSetter.h @@ -11,7 +11,7 @@ * */ #include "CommonTools/Utils/interface/ExpressionPtr.h" -#include "CommonTools/Utils/src/ExpressionStack.h" +#include "CommonTools/Utils/interface/ExpressionStack.h" namespace reco { namespace parser { diff --git a/CommonTools/Utils/src/ExpressionStack.h b/CommonTools/Utils/interface/ExpressionStack.h similarity index 100% rename from CommonTools/Utils/src/ExpressionStack.h rename to CommonTools/Utils/interface/ExpressionStack.h diff --git a/CommonTools/Utils/src/ExpressionUnaryOperator.h b/CommonTools/Utils/interface/ExpressionUnaryOperator.h similarity index 93% rename from CommonTools/Utils/src/ExpressionUnaryOperator.h rename to CommonTools/Utils/interface/ExpressionUnaryOperator.h index 8657673931dab..6126c03655141 100644 --- a/CommonTools/Utils/src/ExpressionUnaryOperator.h +++ b/CommonTools/Utils/interface/ExpressionUnaryOperator.h @@ -11,7 +11,7 @@ * */ #include "CommonTools/Utils/interface/ExpressionBase.h" -#include "CommonTools/Utils/src/ExpressionStack.h" +#include "CommonTools/Utils/interface/ExpressionStack.h" namespace reco { namespace parser { diff --git a/CommonTools/Utils/src/ExpressionUnaryOperatorSetter.h b/CommonTools/Utils/interface/ExpressionUnaryOperatorSetter.h similarity index 90% rename from CommonTools/Utils/src/ExpressionUnaryOperatorSetter.h rename to CommonTools/Utils/interface/ExpressionUnaryOperatorSetter.h index 8f0cfc1c61ca7..19463fa92ffde 100644 --- a/CommonTools/Utils/src/ExpressionUnaryOperatorSetter.h +++ b/CommonTools/Utils/interface/ExpressionUnaryOperatorSetter.h @@ -10,8 +10,8 @@ * \version $Revision: 1.2 $ * */ -#include "CommonTools/Utils/src/ExpressionUnaryOperator.h" -#include "CommonTools/Utils/src/ExpressionStack.h" +#include "CommonTools/Utils/interface/ExpressionUnaryOperator.h" +#include "CommonTools/Utils/interface/ExpressionStack.h" #ifdef BOOST_SPIRIT_DEBUG #include #include diff --git a/CommonTools/Utils/src/ExpressionVarSetter.h b/CommonTools/Utils/interface/ExpressionVarSetter.h similarity index 86% rename from CommonTools/Utils/src/ExpressionVarSetter.h rename to CommonTools/Utils/interface/ExpressionVarSetter.h index bbcaab3007a31..f101e195a1bd0 100644 --- a/CommonTools/Utils/src/ExpressionVarSetter.h +++ b/CommonTools/Utils/interface/ExpressionVarSetter.h @@ -10,9 +10,9 @@ * \version $Revision: 1.3 $ * */ -#include "CommonTools/Utils/src/ExpressionStack.h" -#include "CommonTools/Utils/src/MethodStack.h" -#include "CommonTools/Utils/src/TypeStack.h" +#include "CommonTools/Utils/interface/ExpressionStack.h" +#include "CommonTools/Utils/interface/MethodStack.h" +#include "CommonTools/Utils/interface/TypeStack.h" namespace reco { namespace parser { diff --git a/CommonTools/Utils/src/Function.h b/CommonTools/Utils/interface/Function.h similarity index 100% rename from CommonTools/Utils/src/Function.h rename to CommonTools/Utils/interface/Function.h diff --git a/CommonTools/Utils/src/FunctionSetter.h b/CommonTools/Utils/interface/FunctionSetter.h similarity index 90% rename from CommonTools/Utils/src/FunctionSetter.h rename to CommonTools/Utils/interface/FunctionSetter.h index d64aad5163c88..69995e32db702 100644 --- a/CommonTools/Utils/src/FunctionSetter.h +++ b/CommonTools/Utils/interface/FunctionSetter.h @@ -9,8 +9,8 @@ * \version $Revision: 1.2 $ * */ -#include "CommonTools/Utils/src/Function.h" -#include "CommonTools/Utils/src/FunctionStack.h" +#include "CommonTools/Utils/interface/Function.h" +#include "CommonTools/Utils/interface/FunctionStack.h" namespace reco { namespace parser { diff --git a/CommonTools/Utils/src/FunctionStack.h b/CommonTools/Utils/interface/FunctionStack.h similarity index 87% rename from CommonTools/Utils/src/FunctionStack.h rename to CommonTools/Utils/interface/FunctionStack.h index addad24d49ba9..0583e62d18cb8 100644 --- a/CommonTools/Utils/src/FunctionStack.h +++ b/CommonTools/Utils/interface/FunctionStack.h @@ -9,7 +9,7 @@ * \version $Revision: 1.1 $ * */ -#include "CommonTools/Utils/src/Function.h" +#include "CommonTools/Utils/interface/Function.h" #include namespace reco { diff --git a/CommonTools/Utils/interface/Grammar.h b/CommonTools/Utils/interface/Grammar.h index b4e729053a5d0..4fbcd546b0d51 100644 --- a/CommonTools/Utils/interface/Grammar.h +++ b/CommonTools/Utils/interface/Grammar.h @@ -14,31 +14,30 @@ #include "boost/spirit/include/classic_grammar_def.hpp" #include "boost/spirit/include/classic_chset.hpp" #include -#include "CommonTools/Utils/src/ExpressionNumberSetter.h" -#include "CommonTools/Utils/src/ExpressionVarSetter.h" -#include "CommonTools/Utils/src/ExpressionFunctionSetter.h" -#include "CommonTools/Utils/src/ExpressionConditionSetter.h" -#include "CommonTools/Utils/src/ComparisonSetter.h" -#include "CommonTools/Utils/src/BinarySelectorSetter.h" -#include "CommonTools/Utils/src/TrinarySelectorSetter.h" -#include "CommonTools/Utils/src/IntSetter.h" -#include "CommonTools/Utils/src/MethodStack.h" -#include "CommonTools/Utils/src/MethodArgumentStack.h" -#include "CommonTools/Utils/src/TypeStack.h" -#include "CommonTools/Utils/src/IntStack.h" -#include "CommonTools/Utils/src/FunctionSetter.h" -#include "CommonTools/Utils/src/CutSetter.h" -#include "CommonTools/Utils/src/BinaryCutSetter.h" -#include "CommonTools/Utils/src/UnaryCutSetter.h" -#include "CommonTools/Utils/src/ExpressionSetter.h" -#include "CommonTools/Utils/src/ExpressionBinaryOperatorSetter.h" -#include "CommonTools/Utils/src/ExpressionUnaryOperatorSetter.h" -#include "CommonTools/Utils/src/ExpressionSelectorSetter.h" -#include "CommonTools/Utils/src/MethodSetter.h" -#include "CommonTools/Utils/src/MethodArgumentSetter.h" +#include "CommonTools/Utils/interface/ExpressionNumberSetter.h" +#include "CommonTools/Utils/interface/ExpressionVarSetter.h" +#include "CommonTools/Utils/interface/ExpressionFunctionSetter.h" +#include "CommonTools/Utils/interface/ExpressionConditionSetter.h" +#include "CommonTools/Utils/interface/ComparisonSetter.h" +#include "CommonTools/Utils/interface/BinarySelectorSetter.h" +#include "CommonTools/Utils/interface/TrinarySelectorSetter.h" +#include "CommonTools/Utils/interface/IntSetter.h" +#include "CommonTools/Utils/interface/MethodStack.h" +#include "CommonTools/Utils/interface/MethodArgumentStack.h" +#include "CommonTools/Utils/interface/TypeStack.h" +#include "CommonTools/Utils/interface/IntStack.h" +#include "CommonTools/Utils/interface/FunctionSetter.h" +#include "CommonTools/Utils/interface/CutSetter.h" +#include "CommonTools/Utils/interface/BinaryCutSetter.h" +#include "CommonTools/Utils/interface/UnaryCutSetter.h" +#include "CommonTools/Utils/interface/ExpressionSetter.h" +#include "CommonTools/Utils/interface/ExpressionBinaryOperatorSetter.h" +#include "CommonTools/Utils/interface/ExpressionUnaryOperatorSetter.h" +#include "CommonTools/Utils/interface/ExpressionSelectorSetter.h" +#include "CommonTools/Utils/interface/MethodSetter.h" +#include "CommonTools/Utils/interface/MethodArgumentSetter.h" #include "CommonTools/Utils/interface/Exception.h" #include "FWCore/Reflection/interface/TypeWithDict.h" -// #include "CommonTools/Utils/src/Abort.h" namespace reco { namespace parser { diff --git a/CommonTools/Utils/src/IntSetter.h b/CommonTools/Utils/interface/IntSetter.h similarity index 90% rename from CommonTools/Utils/src/IntSetter.h rename to CommonTools/Utils/interface/IntSetter.h index ffe76828f6579..e0bd74c71a6ea 100644 --- a/CommonTools/Utils/src/IntSetter.h +++ b/CommonTools/Utils/interface/IntSetter.h @@ -9,7 +9,7 @@ * \version $Revision: 1.1 $ * */ -#include "CommonTools/Utils/src/IntStack.h" +#include "CommonTools/Utils/interface/IntStack.h" namespace reco { namespace parser { diff --git a/CommonTools/Utils/src/IntStack.h b/CommonTools/Utils/interface/IntStack.h similarity index 100% rename from CommonTools/Utils/src/IntStack.h rename to CommonTools/Utils/interface/IntStack.h diff --git a/CommonTools/Utils/interface/InvariantMass.h b/CommonTools/Utils/interface/InvariantMass.h deleted file mode 100755 index 52b1c3500c095..0000000000000 --- a/CommonTools/Utils/interface/InvariantMass.h +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef CommonTools_Utils_InvariantMass_h -#define CommonTools_Utils_InvariantMass_h -#include "DataFormats/Math/interface/LorentzVector.h" - -template -struct InvariantMass { - double operator()( const T1 & t1, const T2 & t2 ) const { - return ( t1.momentum() + t2.momentum() ).mass(); - } -}; - -#endif diff --git a/CommonTools/Utils/src/LogicalBinaryOperator.h b/CommonTools/Utils/interface/LogicalBinaryOperator.h similarity index 95% rename from CommonTools/Utils/src/LogicalBinaryOperator.h rename to CommonTools/Utils/interface/LogicalBinaryOperator.h index 0f2cfadd3da49..8dc6112e25caa 100644 --- a/CommonTools/Utils/src/LogicalBinaryOperator.h +++ b/CommonTools/Utils/interface/LogicalBinaryOperator.h @@ -11,7 +11,7 @@ * */ #include "CommonTools/Utils/interface/SelectorBase.h" -#include "CommonTools/Utils/src/SelectorStack.h" +#include "CommonTools/Utils/interface/SelectorStack.h" namespace reco { namespace parser { diff --git a/CommonTools/Utils/src/LogicalUnaryOperator.h b/CommonTools/Utils/interface/LogicalUnaryOperator.h similarity index 93% rename from CommonTools/Utils/src/LogicalUnaryOperator.h rename to CommonTools/Utils/interface/LogicalUnaryOperator.h index d24d64ffe3469..5a60d9c057d58 100644 --- a/CommonTools/Utils/src/LogicalUnaryOperator.h +++ b/CommonTools/Utils/interface/LogicalUnaryOperator.h @@ -11,7 +11,7 @@ * */ #include "CommonTools/Utils/interface/SelectorBase.h" -#include "CommonTools/Utils/src/SelectorStack.h" +#include "CommonTools/Utils/interface/SelectorStack.h" namespace reco { namespace parser { diff --git a/CommonTools/Utils/interface/MassMinSelector.h b/CommonTools/Utils/interface/MassMinSelector.h deleted file mode 100755 index 8a8bdc2099199..0000000000000 --- a/CommonTools/Utils/interface/MassMinSelector.h +++ /dev/null @@ -1,22 +0,0 @@ -#ifndef RecoAlgos_MassMinSelector_h -#define RecoAlgos_MassMinSelector_h -/* \class MassMinSelector - * - * \author Luca Lista, INFN - * - * $Id: MassMinSelector.h,v 1.1 2007/07/12 08:30:40 llista Exp $ - */ - -struct MassMinSelector { - MassMinSelector( double massMin ) : - massMin_( massMin ) { } - template - bool operator()( const T & t ) const { - return t.mass() >= massMin_; - } - -private: - double massMin_; -}; - -#endif diff --git a/CommonTools/Utils/interface/MassRangeSelector.h b/CommonTools/Utils/interface/MassRangeSelector.h deleted file mode 100755 index c4b68f3342690..0000000000000 --- a/CommonTools/Utils/interface/MassRangeSelector.h +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef RecoAlgos_MassRangeSelector_h -#define RecoAlgos_MassRangeSelector_h -/* \class MassRangeSelector - * - * \author Luca Lista, INFN - * - * $Id: MassRangeSelector.h,v 1.3 2007/06/18 18:33:53 llista Exp $ - */ - -struct MassRangeSelector { - MassRangeSelector( double massMin, double massMax ) : - massMin_( massMin ), massMax_( massMax ) { } - template - bool operator()( const T & t ) const { - double mass = t.mass(); - return ( mass >= massMin_ && mass <= massMax_ ); - } - -private: - double massMin_, massMax_; -}; - -#endif diff --git a/CommonTools/Utils/src/MethodArgumentSetter.h b/CommonTools/Utils/interface/MethodArgumentSetter.h similarity index 94% rename from CommonTools/Utils/src/MethodArgumentSetter.h rename to CommonTools/Utils/interface/MethodArgumentSetter.h index e6dbc6ce011ca..4f8542e065eaf 100644 --- a/CommonTools/Utils/src/MethodArgumentSetter.h +++ b/CommonTools/Utils/interface/MethodArgumentSetter.h @@ -9,7 +9,7 @@ * \version $Revision: 1.1 $ * */ -#include "CommonTools/Utils/src/MethodArgumentStack.h" +#include "CommonTools/Utils/interface/MethodArgumentStack.h" #include namespace reco { diff --git a/CommonTools/Utils/src/MethodArgumentStack.h b/CommonTools/Utils/interface/MethodArgumentStack.h similarity index 88% rename from CommonTools/Utils/src/MethodArgumentStack.h rename to CommonTools/Utils/interface/MethodArgumentStack.h index f0427b0ca5220..21cec691679b9 100644 --- a/CommonTools/Utils/src/MethodArgumentStack.h +++ b/CommonTools/Utils/interface/MethodArgumentStack.h @@ -9,7 +9,7 @@ * */ -#include "CommonTools/Utils/src/MethodInvoker.h" +#include "CommonTools/Utils/interface/MethodInvoker.h" #include namespace reco { diff --git a/CommonTools/Utils/src/MethodInvoker.h b/CommonTools/Utils/interface/MethodInvoker.h similarity index 97% rename from CommonTools/Utils/src/MethodInvoker.h rename to CommonTools/Utils/interface/MethodInvoker.h index ff133b17a8ac9..dde8be30764ab 100644 --- a/CommonTools/Utils/src/MethodInvoker.h +++ b/CommonTools/Utils/interface/MethodInvoker.h @@ -1,8 +1,8 @@ #ifndef CommonTools_Utils_MethodInvoker_h #define CommonTools_Utils_MethodInvoker_h -#include "CommonTools/Utils/src/AnyMethodArgument.h" -#include "CommonTools/Utils/src/TypeCode.h" +#include "CommonTools/Utils/interface/AnyMethodArgument.h" +#include "CommonTools/Utils/interface/TypeCode.h" #include "FWCore/Reflection/interface/FunctionWithDict.h" #include "FWCore/Reflection/interface/MemberWithDict.h" #include "FWCore/Reflection/interface/ObjectWithDict.h" diff --git a/CommonTools/Utils/src/MethodSetter.h b/CommonTools/Utils/interface/MethodSetter.h similarity index 93% rename from CommonTools/Utils/src/MethodSetter.h rename to CommonTools/Utils/interface/MethodSetter.h index beab8a579c478..28120cab06119 100644 --- a/CommonTools/Utils/src/MethodSetter.h +++ b/CommonTools/Utils/interface/MethodSetter.h @@ -7,9 +7,9 @@ * */ -#include "CommonTools/Utils/src/MethodStack.h" -#include "CommonTools/Utils/src/TypeStack.h" -#include "CommonTools/Utils/src/MethodArgumentStack.h" +#include "CommonTools/Utils/interface/MethodStack.h" +#include "CommonTools/Utils/interface/TypeStack.h" +#include "CommonTools/Utils/interface/MethodArgumentStack.h" namespace reco { namespace parser { diff --git a/CommonTools/Utils/src/MethodStack.h b/CommonTools/Utils/interface/MethodStack.h similarity index 88% rename from CommonTools/Utils/src/MethodStack.h rename to CommonTools/Utils/interface/MethodStack.h index 4cec5795c426c..bcd11a0b31323 100644 --- a/CommonTools/Utils/src/MethodStack.h +++ b/CommonTools/Utils/interface/MethodStack.h @@ -9,7 +9,7 @@ * */ -#include "CommonTools/Utils/src/MethodInvoker.h" +#include "CommonTools/Utils/interface/MethodInvoker.h" #include namespace reco { diff --git a/CommonTools/Utils/interface/MinSelector.h b/CommonTools/Utils/interface/MinSelector.h old mode 100755 new mode 100644 index 14e2fa5b23c3d..810932963e388 --- a/CommonTools/Utils/interface/MinSelector.h +++ b/CommonTools/Utils/interface/MinSelector.h @@ -7,10 +7,10 @@ * $Id: MinSelector.h,v 1.1 2009/02/24 14:40:26 llista Exp $ */ -template +template struct MinSelector { - MinSelector( T min ) : min_( min ) { } - bool operator()( T t ) const { return t >= min_; } + MinSelector(T min) : min_(min) {} + bool operator()(T t) const { return t >= min_; } private: T min_; diff --git a/CommonTools/Utils/interface/OrPairSelector.h b/CommonTools/Utils/interface/OrPairSelector.h old mode 100755 new mode 100644 index 2619ee3378a2c..afdd6da046a0f --- a/CommonTools/Utils/interface/OrPairSelector.h +++ b/CommonTools/Utils/interface/OrPairSelector.h @@ -7,13 +7,14 @@ * $Id: OrPairSelector.h,v 1.1 2009/02/24 14:40:26 llista Exp $ */ -template +template struct OrPairSelector { - OrPairSelector(const S1 & s1, const S2 & s2) : s1_(s1), s2_(s2) { } - template - bool operator()(const T1 & t1, const T2 & t2) const { + OrPairSelector(const S1& s1, const S2& s2) : s1_(s1), s2_(s2) {} + template + bool operator()(const T1& t1, const T2& t2) const { return s1_(t1) || s2_(t2); } + private: S1 s1_; S2 s2_; diff --git a/CommonTools/Utils/src/SelectorStack.h b/CommonTools/Utils/interface/SelectorStack.h similarity index 100% rename from CommonTools/Utils/src/SelectorStack.h rename to CommonTools/Utils/interface/SelectorStack.h diff --git a/CommonTools/Utils/src/TrinarySelector.h b/CommonTools/Utils/interface/TrinarySelector.h similarity index 95% rename from CommonTools/Utils/src/TrinarySelector.h rename to CommonTools/Utils/interface/TrinarySelector.h index 56af002d5783b..c3f1696cc3c1d 100644 --- a/CommonTools/Utils/src/TrinarySelector.h +++ b/CommonTools/Utils/interface/TrinarySelector.h @@ -12,7 +12,7 @@ */ #include "CommonTools/Utils/interface/SelectorBase.h" #include "CommonTools/Utils/interface/ExpressionBase.h" -#include "CommonTools/Utils/src/ComparisonBase.h" +#include "CommonTools/Utils/interface/ComparisonBase.h" namespace reco { namespace parser { diff --git a/CommonTools/Utils/src/TrinarySelectorSetter.h b/CommonTools/Utils/interface/TrinarySelectorSetter.h similarity index 86% rename from CommonTools/Utils/src/TrinarySelectorSetter.h rename to CommonTools/Utils/interface/TrinarySelectorSetter.h index 8ce5277ada70e..1019e90a51e4c 100644 --- a/CommonTools/Utils/src/TrinarySelectorSetter.h +++ b/CommonTools/Utils/interface/TrinarySelectorSetter.h @@ -10,10 +10,10 @@ * \version $Revision: 1.2 $ * */ -#include "CommonTools/Utils/src/SelectorStack.h" -#include "CommonTools/Utils/src/ComparisonStack.h" -#include "CommonTools/Utils/src/ExpressionStack.h" -#include "CommonTools/Utils/src/TrinarySelector.h" +#include "CommonTools/Utils/interface/SelectorStack.h" +#include "CommonTools/Utils/interface/ComparisonStack.h" +#include "CommonTools/Utils/interface/ExpressionStack.h" +#include "CommonTools/Utils/interface/TrinarySelector.h" namespace reco { namespace parser { diff --git a/CommonTools/Utils/src/TypeCode.h b/CommonTools/Utils/interface/TypeCode.h similarity index 100% rename from CommonTools/Utils/src/TypeCode.h rename to CommonTools/Utils/interface/TypeCode.h diff --git a/CommonTools/Utils/src/TypeStack.h b/CommonTools/Utils/interface/TypeStack.h similarity index 100% rename from CommonTools/Utils/src/TypeStack.h rename to CommonTools/Utils/interface/TypeStack.h diff --git a/CommonTools/Utils/src/UnaryCutSetter.h b/CommonTools/Utils/interface/UnaryCutSetter.h similarity index 86% rename from CommonTools/Utils/src/UnaryCutSetter.h rename to CommonTools/Utils/interface/UnaryCutSetter.h index 7c94daeffc8cb..9c4d8c88918b8 100644 --- a/CommonTools/Utils/src/UnaryCutSetter.h +++ b/CommonTools/Utils/interface/UnaryCutSetter.h @@ -10,8 +10,8 @@ * \version $Revision: 1.2 $ * */ -#include "CommonTools/Utils/src/SelectorStack.h" -#include "CommonTools/Utils/src/LogicalUnaryOperator.h" +#include "CommonTools/Utils/interface/SelectorStack.h" +#include "CommonTools/Utils/interface/LogicalUnaryOperator.h" namespace reco { namespace parser { diff --git a/CommonTools/Utils/interface/returnType.h b/CommonTools/Utils/interface/returnType.h index 23dd7d7370735..0b506fcf4a645 100644 --- a/CommonTools/Utils/interface/returnType.h +++ b/CommonTools/Utils/interface/returnType.h @@ -7,7 +7,7 @@ * */ -#include "CommonTools/Utils/src/TypeCode.h" +#include "CommonTools/Utils/interface/TypeCode.h" #include "FWCore/Reflection/interface/TypeWithDict.h" namespace edm { diff --git a/CommonTools/Utils/src/ComparisonSetter.cc b/CommonTools/Utils/src/ComparisonSetter.cc index c04bd0f4d0149..c4ddb5c96b8bc 100644 --- a/CommonTools/Utils/src/ComparisonSetter.cc +++ b/CommonTools/Utils/src/ComparisonSetter.cc @@ -1,4 +1,4 @@ -#include "CommonTools/Utils/src/ComparisonSetter.h" +#include "CommonTools/Utils/interface/ComparisonSetter.h" #ifdef BOOST_SPIRIT_DEBUG namespace reco { diff --git a/CommonTools/Utils/src/ExpressionCondition.h b/CommonTools/Utils/src/ExpressionCondition.h index 5a59facbd527b..06d8b0d48ac9b 100644 --- a/CommonTools/Utils/src/ExpressionCondition.h +++ b/CommonTools/Utils/src/ExpressionCondition.h @@ -12,8 +12,8 @@ */ #include "CommonTools/Utils/interface/ExpressionBase.h" #include "CommonTools/Utils/interface/SelectorBase.h" -#include "CommonTools/Utils/src/SelectorStack.h" -#include "CommonTools/Utils/src/ExpressionStack.h" +#include "CommonTools/Utils/interface/SelectorStack.h" +#include "CommonTools/Utils/interface/ExpressionStack.h" namespace reco { namespace parser { diff --git a/CommonTools/Utils/src/ExpressionConditionSetter.cc b/CommonTools/Utils/src/ExpressionConditionSetter.cc index 2dd869078913f..de3e1f1ee8769 100644 --- a/CommonTools/Utils/src/ExpressionConditionSetter.cc +++ b/CommonTools/Utils/src/ExpressionConditionSetter.cc @@ -1,4 +1,4 @@ -#include "CommonTools/Utils/src/ExpressionConditionSetter.h" +#include "CommonTools/Utils/interface/ExpressionConditionSetter.h" #include "CommonTools/Utils/src/ExpressionCondition.h" using namespace reco::parser; diff --git a/CommonTools/Utils/src/ExpressionFunctionSetter.cc b/CommonTools/Utils/src/ExpressionFunctionSetter.cc index bbddeb2206e68..7d118c3a6ef6a 100644 --- a/CommonTools/Utils/src/ExpressionFunctionSetter.cc +++ b/CommonTools/Utils/src/ExpressionFunctionSetter.cc @@ -1,6 +1,6 @@ -#include "CommonTools/Utils/src/ExpressionFunctionSetter.h" -#include "CommonTools/Utils/src/ExpressionUnaryOperator.h" -#include "CommonTools/Utils/src/ExpressionBinaryOperator.h" +#include "CommonTools/Utils/interface/ExpressionFunctionSetter.h" +#include "CommonTools/Utils/interface/ExpressionUnaryOperator.h" +#include "CommonTools/Utils/interface/ExpressionBinaryOperator.h" #include "CommonTools/Utils/src/ExpressionQuaterOperator.h" #include #include diff --git a/CommonTools/Utils/src/ExpressionQuaterOperator.h b/CommonTools/Utils/src/ExpressionQuaterOperator.h index e3c856f184340..d79bc4ec5d275 100644 --- a/CommonTools/Utils/src/ExpressionQuaterOperator.h +++ b/CommonTools/Utils/src/ExpressionQuaterOperator.h @@ -11,7 +11,7 @@ * */ #include "CommonTools/Utils/interface/ExpressionBase.h" -#include "CommonTools/Utils/src/ExpressionStack.h" +#include "CommonTools/Utils/interface/ExpressionStack.h" namespace reco { namespace parser { diff --git a/CommonTools/Utils/src/ExpressionSetter.cc b/CommonTools/Utils/src/ExpressionSetter.cc index 6738c0851eb7c..775983bea771e 100644 --- a/CommonTools/Utils/src/ExpressionSetter.cc +++ b/CommonTools/Utils/src/ExpressionSetter.cc @@ -1,4 +1,4 @@ -#include "CommonTools/Utils/src/ExpressionSetter.h" +#include "CommonTools/Utils/interface/ExpressionSetter.h" #include "CommonTools/Utils/src/AndCombiner.h" #include "CommonTools/Utils/src/OrCombiner.h" #include "CommonTools/Utils/src/NotCombiner.h" diff --git a/CommonTools/Utils/src/ExpressionUnaryOperatorSetter.cc b/CommonTools/Utils/src/ExpressionUnaryOperatorSetter.cc index d73c97318d7a8..3bc728b198ad9 100644 --- a/CommonTools/Utils/src/ExpressionUnaryOperatorSetter.cc +++ b/CommonTools/Utils/src/ExpressionUnaryOperatorSetter.cc @@ -1,4 +1,4 @@ -#include "CommonTools/Utils/src/ExpressionUnaryOperatorSetter.h" +#include "CommonTools/Utils/interface/ExpressionUnaryOperatorSetter.h" using namespace reco::parser; diff --git a/CommonTools/Utils/src/ExpressionVar.cc b/CommonTools/Utils/src/ExpressionVar.cc index dd374c5eaef17..8d47b7629a597 100644 --- a/CommonTools/Utils/src/ExpressionVar.cc +++ b/CommonTools/Utils/src/ExpressionVar.cc @@ -1,5 +1,5 @@ #include "CommonTools/Utils/src/ExpressionVar.h" -#include "CommonTools/Utils/src/MethodInvoker.h" +#include "CommonTools/Utils/interface/MethodInvoker.h" #include "FWCore/Reflection/interface/ObjectWithDict.h" #include "FWCore/Reflection/interface/FunctionWithDict.h" diff --git a/CommonTools/Utils/src/ExpressionVar.h b/CommonTools/Utils/src/ExpressionVar.h index f79f897b70a21..41e17e2b84614 100644 --- a/CommonTools/Utils/src/ExpressionVar.h +++ b/CommonTools/Utils/src/ExpressionVar.h @@ -11,8 +11,8 @@ */ #include "CommonTools/Utils/interface/ExpressionBase.h" -#include "CommonTools/Utils/src/MethodInvoker.h" -#include "CommonTools/Utils/src/TypeCode.h" +#include "CommonTools/Utils/interface/MethodInvoker.h" +#include "CommonTools/Utils/interface/TypeCode.h" #include diff --git a/CommonTools/Utils/src/ExpressionVarSetter.cc b/CommonTools/Utils/src/ExpressionVarSetter.cc index 4942868b400d7..1ad0cdd0d9fc4 100644 --- a/CommonTools/Utils/src/ExpressionVarSetter.cc +++ b/CommonTools/Utils/src/ExpressionVarSetter.cc @@ -1,4 +1,4 @@ -#include "CommonTools/Utils/src/ExpressionVarSetter.h" +#include "CommonTools/Utils/interface/ExpressionVarSetter.h" #include "CommonTools/Utils/src/ExpressionVar.h" #include "CommonTools/Utils/interface/returnType.h" #include "CommonTools/Utils/interface/Exception.h" diff --git a/CommonTools/Utils/src/LogicalBinaryOperator.cc b/CommonTools/Utils/src/LogicalBinaryOperator.cc index e0c150e2da86c..537bea87c35f6 100644 --- a/CommonTools/Utils/src/LogicalBinaryOperator.cc +++ b/CommonTools/Utils/src/LogicalBinaryOperator.cc @@ -1,4 +1,4 @@ -#include "CommonTools/Utils/src/LogicalBinaryOperator.h" +#include "CommonTools/Utils/interface/LogicalBinaryOperator.h" using namespace reco::parser; template <> diff --git a/CommonTools/Utils/src/MethodInvoker.cc b/CommonTools/Utils/src/MethodInvoker.cc index 787a94ce81362..2370c22428970 100644 --- a/CommonTools/Utils/src/MethodInvoker.cc +++ b/CommonTools/Utils/src/MethodInvoker.cc @@ -1,7 +1,7 @@ -#include "CommonTools/Utils/src/MethodInvoker.h" +#include "CommonTools/Utils/interface/MethodInvoker.h" #include "CommonTools/Utils/src/ExpressionVar.h" -#include "CommonTools/Utils/src/MethodSetter.h" +#include "CommonTools/Utils/interface/MethodSetter.h" #include "CommonTools/Utils/src/findMethod.h" #include "CommonTools/Utils/interface/returnType.h" #include "FWCore/Utilities/interface/EDMException.h" diff --git a/CommonTools/Utils/src/MethodSetter.cc b/CommonTools/Utils/src/MethodSetter.cc index 36457fbda939d..9fadeaf248579 100644 --- a/CommonTools/Utils/src/MethodSetter.cc +++ b/CommonTools/Utils/src/MethodSetter.cc @@ -1,8 +1,8 @@ -#include "CommonTools/Utils/src/MethodSetter.h" +#include "CommonTools/Utils/interface/MethodSetter.h" #include "CommonTools/Utils/interface/Exception.h" #include "CommonTools/Utils/src/ErrorCodes.h" -#include "CommonTools/Utils/src/MethodInvoker.h" +#include "CommonTools/Utils/interface/MethodInvoker.h" #include "CommonTools/Utils/src/findDataMember.h" #include "CommonTools/Utils/src/findMethod.h" #include "CommonTools/Utils/interface/returnType.h" diff --git a/CommonTools/Utils/src/findMethod.h b/CommonTools/Utils/src/findMethod.h index 4d18410aeefee..367d539f3fb2a 100644 --- a/CommonTools/Utils/src/findMethod.h +++ b/CommonTools/Utils/src/findMethod.h @@ -3,7 +3,7 @@ #include "FWCore/Reflection/interface/FunctionWithDict.h" #include "FWCore/Reflection/interface/TypeWithDict.h" #include -#include "CommonTools/Utils/src/AnyMethodArgument.h" +#include "CommonTools/Utils/interface/AnyMethodArgument.h" namespace reco { // second pair member is true if a reference is found diff --git a/CommonTools/Utils/test/testDynArray.cpp b/CommonTools/Utils/test/testDynArray.cpp index 25d415933a2ef..a5cac2d427c82 100644 --- a/CommonTools/Utils/test/testDynArray.cpp +++ b/CommonTools/Utils/test/testDynArray.cpp @@ -16,7 +16,9 @@ struct A { int main(int s, char **) { using T = A; - unsigned n = 4 * s; + unsigned n = 4; + if (s > 1) + n = 4 * s; // alignas(alignof(T)) unsigned char a_storage[sizeof(T)*n]; // DynArray a(a_storage,n); diff --git a/CondCore/AlignmentPlugins/plugins/TrackerAlignment_PayloadInspector.cc b/CondCore/AlignmentPlugins/plugins/TrackerAlignment_PayloadInspector.cc index 0bee612603bf5..1633380424575 100644 --- a/CondCore/AlignmentPlugins/plugins/TrackerAlignment_PayloadInspector.cc +++ b/CondCore/AlignmentPlugins/plugins/TrackerAlignment_PayloadInspector.cc @@ -995,10 +995,10 @@ namespace { final->SetMarkerSize(2.5); t1.SetTextColor(kRed); initial->Draw(); - t1.DrawLatex(x0i, y0i - 0.5, Form("(%.2f,%.2f)", x0i, y0i)); + t1.DrawLatex(x0i, y0i + (y0i > y0f ? 0.3 : -0.5), Form("(%.2f,%.2f)", x0i, y0i)); final->Draw("same"); t1.SetTextColor(kBlue); - t1.DrawLatex(x0f, y0f + 0.3, Form("(%.2f,%.2f)", x0f, y0f)); + t1.DrawLatex(x0f, y0f + (y0i > y0f ? -0.5 : 0.3), Form("(%.2f,%.2f)", x0f, y0f)); } // fourth pad is a special case for the z coordinate @@ -1032,10 +1032,10 @@ namespace { final->SetMarkerSize(2.5); initial->Draw(); t1.SetTextColor(kRed); - t1.DrawLatex(c - 1, z0i - 1.5, Form("(%.2f)", z0i)); + t1.DrawLatex(c - 1, z0i + (z0i > z0f ? 1. : -1.5), Form("(%.2f)", z0i)); final->Draw("same"); t1.SetTextColor(kBlue); - t1.DrawLatex(c - 1, z0f + 1., Form("(%.2f)", z0f)); + t1.DrawLatex(c - 1, z0f + (z0i > z0f ? -1.5 : 1), Form("(%.2f)", z0f)); } std::string fileName(this->m_imageFileName); diff --git a/CondCore/AlignmentPlugins/test/testTrackerAlignmentPayloadInspector.cpp b/CondCore/AlignmentPlugins/test/testTrackerAlignmentPayloadInspector.cpp index 486c5d7d2824d..7124f3ff69990 100644 --- a/CondCore/AlignmentPlugins/test/testTrackerAlignmentPayloadInspector.cpp +++ b/CondCore/AlignmentPlugins/test/testTrackerAlignmentPayloadInspector.cpp @@ -22,8 +22,8 @@ int main(int argc, char** argv) { std::string connectionString("frontier://FrontierProd/CMS_CONDITIONS"); std::string tag = "TrackerAlignment_v21_offline"; - cond::Time_t start = boost::lexical_cast(294034); - cond::Time_t end = boost::lexical_cast(305898); + cond::Time_t start = static_cast(294034); + cond::Time_t end = static_cast(305898); std::cout << "## Alignment Histos" << std::endl; diff --git a/CondCore/BeamSpotPlugins/test/testBeamSpotPayloadInspector.cpp b/CondCore/BeamSpotPlugins/test/testBeamSpotPayloadInspector.cpp index 6fc591f7a4be5..4a0741a2a7b3f 100644 --- a/CondCore/BeamSpotPlugins/test/testBeamSpotPayloadInspector.cpp +++ b/CondCore/BeamSpotPlugins/test/testBeamSpotPayloadInspector.cpp @@ -27,8 +27,8 @@ int main(int argc, char** argv) { // BeamSpot std::string tag = "BeamSpotObjects_PCL_byLumi_v0_prompt"; - cond::Time_t start = boost::lexical_cast(1406876667347162); - //cond::Time_t end = boost::lexical_cast(1406876667347162); + cond::Time_t start = static_cast(1406876667347162); + //cond::Time_t end = static_cast(1406876667347162); edm::LogPrint("testBeamSpotPayloadInspector") << "## Exercising BeamSpot plots " << std::endl; @@ -37,7 +37,7 @@ int main(int argc, char** argv) { edm::LogPrint("testBeamSpotPayloadInspector") << histoParameters.data() << std::endl; tag = "BeamSpotOnlineTestLegacy"; - start = boost::lexical_cast(1443392479297557); + start = static_cast(1443392479297557); edm::LogPrint("testBeamSpotPayloadInspector") << "## Exercising BeamSpotOnline plots " << std::endl; diff --git a/CondCore/CTPPSPlugins/src/plugin.cc b/CondCore/CTPPSPlugins/src/plugin.cc index 28eab28ee1ade..1c8892df4218e 100644 --- a/CondCore/CTPPSPlugins/src/plugin.cc +++ b/CondCore/CTPPSPlugins/src/plugin.cc @@ -19,6 +19,12 @@ #include "CondFormats/DataRecord/interface/PPSDirectSimulationDataRcd.h" #include "CondFormats/PPSObjects/interface/PPSPixelTopology.h" #include "CondFormats/DataRecord/interface/PPSPixelTopologyRcd.h" +#include "CondFormats/PPSObjects/interface/PPSAlignmentConfig.h" +#include "CondFormats/DataRecord/interface/PPSAlignmentConfigRcd.h" +#include "CondFormats/PPSObjects/interface/PPSAlignmentConfiguration.h" +#include "CondFormats/DataRecord/interface/PPSAlignmentConfigurationRcd.h" +#include "CondFormats/PPSObjects/interface/PPSAssociationCuts.h" +#include "CondFormats/DataRecord/interface/PPSAssociationCutsRcd.h" REGISTER_PLUGIN(CTPPSBeamParametersRcd, CTPPSBeamParameters); REGISTER_PLUGIN(CTPPSPixelDAQMappingRcd, CTPPSPixelDAQMapping); @@ -31,3 +37,6 @@ REGISTER_PLUGIN(PPSTimingCalibrationRcd, PPSTimingCalibration); REGISTER_PLUGIN(CTPPSOpticsRcd, LHCOpticalFunctionsSetCollection); REGISTER_PLUGIN(PPSDirectSimulationDataRcd, PPSDirectSimulationData); REGISTER_PLUGIN(PPSPixelTopologyRcd, PPSPixelTopology); +REGISTER_PLUGIN(PPSAlignmentConfigRcd, PPSAlignmentConfig); +REGISTER_PLUGIN(PPSAlignmentConfigurationRcd, PPSAlignmentConfiguration); +REGISTER_PLUGIN(PPSAssociationCutsRcd, PPSAssociationCuts); diff --git a/CondCore/CondDB/interface/Utils.h b/CondCore/CondDB/interface/Utils.h index aa40dd3622944..321f80940ce83 100644 --- a/CondCore/CondDB/interface/Utils.h +++ b/CondCore/CondDB/interface/Utils.h @@ -12,8 +12,7 @@ #include #include #include -// -#include +#include namespace cond { @@ -123,10 +122,10 @@ namespace cond { if (input.find("sqlite") == 0 || input.find("oracle") == 0) return input; - //static const boost::regex trivial("oracle://(cms_orcon_adg|cms_orcoff_prep)/([_[:alnum:]]+?)"); - static const boost::regex short_frontier("frontier://([[:alnum:]]+?)/([_[:alnum:]]+?)"); - static const boost::regex long_frontier("frontier://((\\([-[:alnum:]]+?=[^\\)]+?\\))+)/([_[:alnum:]]+?)"); - static const boost::regex long_frontier_serverurl("\\(serverurl=[^\\)]+?/([[:alnum:]]+?)\\)"); + //static const std::regex trivial("oracle://(cms_orcon_adg|cms_orcoff_prep)/([_[:alnum:]]+?)"); + static const std::regex short_frontier("frontier://([[:alnum:]]+?)/([_[:alnum:]]+?)"); + static const std::regex long_frontier("frontier://((\\([-[:alnum:]]+?=[^\\)]+?\\))+)/([_[:alnum:]]+?)"); + static const std::regex long_frontier_serverurl("\\(serverurl=[^\\)]+?/([[:alnum:]]+?)\\)"); static const std::map frontierMap = { {"PromptProd", "cms_orcon_adg"}, @@ -136,23 +135,21 @@ namespace cond { {"FrontierPrep", "cms_orcoff_prep"}, }; - boost::smatch matches; + std::smatch matches; static const std::string technology("oracle://"); std::string service(""); std::string account(""); bool match = false; - if (boost::regex_match(input, matches, short_frontier)) { + if (std::regex_match(input, matches, short_frontier)) { service = matches[1]; account = matches[2]; match = true; - } - - if (boost::regex_match(input, matches, long_frontier)) { + } else if (std::regex_match(input, matches, long_frontier)) { std::string frontier_config(matches[1]); - boost::smatch matches2; - if (not boost::regex_search(frontier_config, matches2, long_frontier_serverurl)) + std::smatch matches2; + if (not std::regex_search(frontier_config, matches2, long_frontier_serverurl)) throwException("No serverurl in matched long frontier", "convertoToOracleConnection"); service = matches2[1]; account = matches[3]; diff --git a/CondCore/DBOutputService/interface/OnlineDBOutputService.h b/CondCore/DBOutputService/interface/OnlineDBOutputService.h index b65829cd42685..5577699b60755 100644 --- a/CondCore/DBOutputService/interface/OnlineDBOutputService.h +++ b/CondCore/DBOutputService/interface/OnlineDBOutputService.h @@ -37,7 +37,7 @@ namespace cond { // template - bool writeForNextLumisection(const PayloadType* payload, const std::string& recordName) { + bool writeForNextLumisection(const PayloadType& payload, const std::string& recordName) { cond::Time_t targetTime = getLastLumiProcessed() + m_latencyInLumisections; auto t0 = std::chrono::high_resolution_clock::now(); logger().logInfo() << "Updating lumisection " << targetTime; @@ -73,6 +73,15 @@ namespace cond { return ret; } + // + template + bool writeForNextLumisection(const PayloadType* payloadPtr, const std::string& recordName) { + if (!payloadPtr) + throwException("Provided payload pointer is invalid.", "OnlineDBOutputService::writeForNextLumisection"); + std::unique_ptr payload(payloadPtr); + return writeForNextLumisection(*payload, recordName); + } + private: cond::Time_t getLastLumiProcessed(); diff --git a/CondCore/DBOutputService/interface/PoolDBOutputService.h b/CondCore/DBOutputService/interface/PoolDBOutputService.h index f87e8b0c20a09..b6f56157b29c6 100644 --- a/CondCore/DBOutputService/interface/PoolDBOutputService.h +++ b/CondCore/DBOutputService/interface/PoolDBOutputService.h @@ -58,11 +58,8 @@ namespace cond { std::string tag(const std::string& recordName); bool isNewTagRequest(const std::string& recordName); - // template - Hash writeOne(const T* payload, Time_t time, const std::string& recordName) { - if (!payload) - throwException("Provided payload pointer is invalid.", "PoolDBOutputService::writeOne"); + Hash writeOne(const T& payload, Time_t time, const std::string& recordName) { std::lock_guard lock(m_mutex); doStartTransaction(); cond::persistency::TransactionScope scope(m_session.transaction()); @@ -87,7 +84,7 @@ namespace cond { return thePayloadHash; } } - thePayloadHash = m_session.storePayload(*payload); + thePayloadHash = m_session.storePayload(payload); std::string payloadType = cond::demangledName(typeid(T)); if (newTag) { createNewIOV(thePayloadHash, payloadType, time, myrecord); @@ -108,18 +105,76 @@ namespace cond { return thePayloadHash; } + // warning: takes over the ownership of pointer "payload". Deprecated. Please move to the above referece-based function + template + Hash writeOne(const T* payloadPtr, Time_t time, const std::string& recordName) { + if (!payloadPtr) + throwException("Provided payload pointer is invalid.", "PoolDBOutputService::writeOne"); + std::unique_ptr payload(payloadPtr); + std::lock_guard lock(m_mutex); + return writeOne(*payload, time, recordName); + } + + template + void writeMany(const std::map >& iovAndPayloads, const std::string& recordName) { + if (iovAndPayloads.empty()) + return; + std::lock_guard lock(m_mutex); + doStartTransaction(); + cond::persistency::TransactionScope scope(m_session.transaction()); + try { + this->initDB(); + Record& myrecord = this->lookUpRecord(recordName); + m_logger.logInfo() << "Tag mapped to record " << recordName << ": " << myrecord.m_tag; + bool newTag = isNewTagRequest(recordName); + cond::Time_t lastSince; + cond::persistency::IOVEditor editor; + if (newTag) { + std::string payloadType = cond::demangledName(typeid(T)); + editor = m_session.createIov(payloadType, myrecord.m_tag, myrecord.m_timetype, cond::SYNCH_ANY); + editor.setDescription("New Tag"); + } else { + editor = m_session.editIov(myrecord.m_tag); + if (myrecord.m_onlyAppendUpdatePolicy) { + cond::TagInfo_t tInfo; + this->getTagInfo(myrecord.m_idName, tInfo); + lastSince = tInfo.lastInterval.since; + if (lastSince == cond::time::MAX_VAL) + lastSince = 0; + } + } + for (auto& iovEntry : iovAndPayloads) { + Time_t time = iovEntry.first; + auto payload = iovEntry.second; + if (myrecord.m_onlyAppendUpdatePolicy && !newTag) { + if (time <= lastSince) { + m_logger.logInfo() << "Won't append iov with since " << std::to_string(time) + << ", because is less or equal to last available since = " << lastSince; + continue; + } + } + auto payloadHash = m_session.storePayload(*payload); + editor.insert(time, payloadHash); + } + cond::UserLogInfo a = this->lookUpUserLogInfo(myrecord.m_idName); + editor.flush(a.usertext); + if (m_autoCommit) { + doCommitTransaction(); + } + } catch (const std::exception& er) { + cond::throwException(std::string(er.what()), "PoolDBOutputService::writeMany"); + } + scope.close(); + return; + } + // close the IOVSequence setting lastTill void closeIOV(Time_t lastTill, const std::string& recordName); - // this one we need to avoid to adapt client code around... to be removed in the long term! template - void createNewIOV(const T* firstPayloadObj, - cond::Time_t firstSinceTime, - cond::Time_t, - const std::string& recordName) { - if (!firstPayloadObj) - throwException("Provided payload pointer is invalid.", "PoolDBOutputService::createNewIOV"); + void createNewIOV(const T& payload, cond::Time_t firstSinceTime, const std::string& recordName) { std::lock_guard lock(m_mutex); + Record& myrecord = this->lookUpRecord(recordName); if (!myrecord.m_isNewTag) { cond::throwException(myrecord.m_tag + " is not a new tag", "PoolDBOutputService::createNewIOV"); @@ -128,7 +183,7 @@ namespace cond { cond::persistency::TransactionScope scope(m_session.transaction()); try { this->initDB(); - Hash payloadId = m_session.storePayload(*firstPayloadObj); + Hash payloadId = m_session.storePayload(payload); createNewIOV(payloadId, cond::demangledName(typeid(T)), firstSinceTime, myrecord); } catch (const std::exception& er) { cond::throwException(std::string(er.what()), "PoolDBOutputService::createNewIov"); @@ -136,11 +191,17 @@ namespace cond { scope.close(); } - // + // warning: takes over the ownership of pointer "payload" - deprecated. Please move to the above reference-based function template - void appendSinceTime(const T* payloadObj, cond::Time_t sinceTime, const std::string& recordName) { - if (!payloadObj) - throwException("Provided payload pointer is invalid.", "PoolDBOutputService::appendSinceTime"); + void createNewIOV(const T* payloadPtr, cond::Time_t firstSinceTime, cond::Time_t, const std::string& recordName) { + if (!payloadPtr) + throwException("Provided payload pointer is invalid.", "PoolDBOutputService::createNewIOV"); + std::unique_ptr payload(payloadPtr); + this->createNewIOV(*payload, firstSinceTime, recordName); + } + + template + void appendSinceTime(const T& payload, cond::Time_t sinceTime, const std::string& recordName) { std::lock_guard lock(m_mutex); Record& myrecord = this->lookUpRecord(recordName); if (myrecord.m_isNewTag) { @@ -150,13 +211,22 @@ namespace cond { doStartTransaction(); cond::persistency::TransactionScope scope(m_session.transaction()); try { - appendSinceTime(m_session.storePayload(*payloadObj), sinceTime, myrecord); + appendSinceTime(m_session.storePayload(payload), sinceTime, myrecord); } catch (const std::exception& er) { cond::throwException(std::string(er.what()), "PoolDBOutputService::appendSinceTime"); } scope.close(); } + // warning: takes over the ownership of pointer "payload" - deprecated. Please move to the above reference-based function + template + void appendSinceTime(const T* payloadPtr, cond::Time_t sinceTime, const std::string& recordName) { + if (!payloadPtr) + throwException("Provided payload pointer is invalid.", "PoolDBOutputService::appendSinceTime"); + std::unique_ptr payload(payloadPtr); + this->appendSinceTime(*payload, sinceTime, recordName); + } + void createNewIOV(const std::string& firstPayloadId, cond::Time_t firstSinceTime, const std::string& recordName); bool appendSinceTime(const std::string& payloadId, cond::Time_t sinceTime, const std::string& recordName); diff --git a/CondCore/DBOutputService/src/OnlineDBOutputService.cc b/CondCore/DBOutputService/src/OnlineDBOutputService.cc index 3896bfc7e8aa0..20d53634e9950 100644 --- a/CondCore/DBOutputService/src/OnlineDBOutputService.cc +++ b/CondCore/DBOutputService/src/OnlineDBOutputService.cc @@ -69,8 +69,8 @@ namespace cond { if (!std::getline(sinfo, slumi, ',')) { throw Exception("Can't get lumi id from OMS Service."); } - unsigned int run = boost::lexical_cast(srun); - unsigned int lumi = boost::lexical_cast(slumi); + unsigned int run = std::stoul(srun); + unsigned int lumi = std::stoul(slumi); lastLumiProcessed = cond::time::lumiTime(run, lumi); return lastLumiProcessed; } diff --git a/CondCore/DBOutputService/src/PoolDBOutputService.cc b/CondCore/DBOutputService/src/PoolDBOutputService.cc index 3f156f23f34f1..af8e999ddcdde 100644 --- a/CondCore/DBOutputService/src/PoolDBOutputService.cc +++ b/CondCore/DBOutputService/src/PoolDBOutputService.cc @@ -287,10 +287,8 @@ bool cond::service::PoolDBOutputService::appendSinceTime(const std::string& payl cond::Time_t time, Record& myrecord) { m_logger.logInfo() << "Updating existing tag " << myrecord.m_tag << ", adding iov with since " << time; - std::string payloadType(""); try { cond::persistency::IOVEditor editor = m_session.editIov(myrecord.m_tag); - payloadType = editor.payloadType(); editor.insert(time, payloadId); cond::UserLogInfo a = this->lookUpUserLogInfo(myrecord.m_idName); editor.flush(a.usertext); diff --git a/CondCore/DTPlugins/interface/DTCompactMapPluginHandler.h b/CondCore/DTPlugins/interface/DTCompactMapPluginHandler.h deleted file mode 100644 index c6ea5fb08b964..0000000000000 --- a/CondCore/DTPlugins/interface/DTCompactMapPluginHandler.h +++ /dev/null @@ -1 +0,0 @@ -#error obsolete header diff --git a/CondCore/DTPlugins/interface/DTConfigPluginHandler.h b/CondCore/DTPlugins/interface/DTConfigPluginHandler.h deleted file mode 100644 index c6ea5fb08b964..0000000000000 --- a/CondCore/DTPlugins/interface/DTConfigPluginHandler.h +++ /dev/null @@ -1 +0,0 @@ -#error obsolete header diff --git a/CondCore/EcalPlugins/plugins/EcalIntercalibConstantsMC_PayloadInspector.cc b/CondCore/EcalPlugins/plugins/EcalIntercalibConstantsMC_PayloadInspector.cc index 9705da5a95933..45947d0e84666 100644 --- a/CondCore/EcalPlugins/plugins/EcalIntercalibConstantsMC_PayloadInspector.cc +++ b/CondCore/EcalPlugins/plugins/EcalIntercalibConstantsMC_PayloadInspector.cc @@ -16,6 +16,7 @@ #include #include +#include namespace { enum { kEBChannels = 61200, kEEChannels = 14648 }; @@ -194,9 +195,9 @@ namespace { float xmi[3] = {0.0, 0.24, 0.76}; float xma[3] = {0.24, 0.76, 1.00}; - TPad** pad = new TPad*; + std::array, 3> pad; for (int obj = 0; obj < 3; obj++) { - pad[obj] = new TPad(Form("p_%i", obj), Form("p_%i", obj), xmi[obj], 0.0, xma[obj], 0.94); + pad[obj] = std::make_unique(Form("p_%i", obj), Form("p_%i", obj), xmi[obj], 0.0, xma[obj], 0.94); pad[obj]->Draw(); } // EcalDrawMaps ICMap; @@ -305,10 +306,10 @@ namespace { float xmi[3] = {0.0, 0.24, 0.76}; float xma[3] = {0.24, 0.76, 1.00}; - TPad** pad = new TPad*; + std::array, 3> pad; for (int obj = 0; obj < 3; obj++) { - pad[obj] = new TPad(Form("p_%i", obj), Form("p_%i", obj), xmi[obj], 0.0, xma[obj], 0.94); + pad[obj] = std::make_unique(Form("p_%i", obj), Form("p_%i", obj), xmi[obj], 0.0, xma[obj], 0.94); pad[obj]->Draw(); } @@ -376,9 +377,9 @@ namespace { t1.SetTextColor(2); t1.DrawLatex(0.5, 0.96, Form("Ecal Intercalib Constants MC Summary, IOV %i", run)); - TPad* pad = new TPad("pad", "pad", 0.0, 0.0, 1.0, 0.94); - pad->Draw(); - pad->cd(); + TPad pad("pad", "pad", 0.0, 0.0, 1.0, 0.94); + pad.Draw(); + pad.cd(); align->Draw("TEXT"); drawTable(NbRows, 4); diff --git a/CondCore/EcalPlugins/plugins/EcalIntercalibConstants_PayloadInspector.cc b/CondCore/EcalPlugins/plugins/EcalIntercalibConstants_PayloadInspector.cc index 8f7603f320efa..21d76a5d39cb1 100644 --- a/CondCore/EcalPlugins/plugins/EcalIntercalibConstants_PayloadInspector.cc +++ b/CondCore/EcalPlugins/plugins/EcalIntercalibConstants_PayloadInspector.cc @@ -16,6 +16,7 @@ #include #include +#include namespace { enum { kEBChannels = 61200, kEEChannels = 14648 }; @@ -180,9 +181,9 @@ namespace { float xmi[3] = {0.0, 0.24, 0.76}; float xma[3] = {0.24, 0.76, 1.00}; - TPad** pad = new TPad*; + std::array, 3> pad; for (int obj = 0; obj < 3; obj++) { - pad[obj] = new TPad(Form("p_%i", obj), Form("p_%i", obj), xmi[obj], 0.0, xma[obj], 0.94); + pad[obj] = std::make_unique(Form("p_%i", obj), Form("p_%i", obj), xmi[obj], 0.0, xma[obj], 0.94); pad[obj]->Draw(); } // EcalDrawMaps ICMap; @@ -286,9 +287,9 @@ namespace { } float xmi[3] = {0.0, 0.24, 0.76}; float xma[3] = {0.24, 0.76, 1.00}; - TPad** pad = new TPad*; + std::array, 3> pad; for (int obj = 0; obj < 3; obj++) { - pad[obj] = new TPad(Form("p_%i", obj), Form("p_%i", obj), xmi[obj], 0.0, xma[obj], 0.94); + pad[obj] = std::make_unique(Form("p_%i", obj), Form("p_%i", obj), xmi[obj], 0.0, xma[obj], 0.94); pad[obj]->Draw(); } pad[0]->cd(); @@ -354,9 +355,9 @@ namespace { t1.SetTextColor(2); t1.DrawLatex(0.5, 0.96, Form("Ecal Intercalib Constants Summary, IOV %i", run)); - TPad* pad = new TPad("pad", "pad", 0.0, 0.0, 1.0, 0.94); - pad->Draw(); - pad->cd(); + TPad pad("pad", "pad", 0.0, 0.0, 1.0, 0.94); + pad.Draw(); + pad.cd(); align->Draw("TEXT"); TLine* l = new TLine; l->SetLineWidth(1); diff --git a/CondCore/EcalPlugins/plugins/EcalIntercalibErrors_PayloadInspector.cc b/CondCore/EcalPlugins/plugins/EcalIntercalibErrors_PayloadInspector.cc index 612a6e86fb1d5..eebc9dbfa79a0 100644 --- a/CondCore/EcalPlugins/plugins/EcalIntercalibErrors_PayloadInspector.cc +++ b/CondCore/EcalPlugins/plugins/EcalIntercalibErrors_PayloadInspector.cc @@ -16,6 +16,7 @@ #include #include +#include namespace { @@ -190,9 +191,9 @@ namespace { float xmi[3] = {0.0, 0.24, 0.76}; float xma[3] = {0.24, 0.76, 1.00}; - TPad** pad = new TPad*; + std::array, 3> pad; for (int obj = 0; obj < 3; obj++) { - pad[obj] = new TPad(Form("p_%i", obj), Form("p_%i", obj), xmi[obj], 0.0, xma[obj], 0.94); + pad[obj] = std::make_unique(Form("p_%i", obj), Form("p_%i", obj), xmi[obj], 0.0, xma[obj], 0.94); pad[obj]->Draw(); } // EcalDrawMaps ICMap; @@ -295,10 +296,10 @@ namespace { float xmi[3] = {0.0, 0.24, 0.76}; float xma[3] = {0.24, 0.76, 1.00}; - TPad** pad = new TPad*; + std::array, 3> pad; for (int obj = 0; obj < 3; obj++) { - pad[obj] = new TPad(Form("p_%i", obj), Form("p_%i", obj), xmi[obj], 0.0, xma[obj], 0.94); + pad[obj] = std::make_unique(Form("p_%i", obj), Form("p_%i", obj), xmi[obj], 0.0, xma[obj], 0.94); pad[obj]->Draw(); } @@ -365,9 +366,9 @@ namespace { t1.SetTextColor(2); t1.DrawLatex(0.5, 0.96, Form("Ecal Intercalib Errors Summary, IOV %i", run)); - TPad* pad = new TPad("pad", "pad", 0.0, 0.0, 1.0, 0.94); - pad->Draw(); - pad->cd(); + TPad pad("pad", "pad", 0.0, 0.0, 1.0, 0.94); + pad.Draw(); + pad.cd(); align->Draw("TEXT"); drawTable(NbRows, 4); diff --git a/CondCore/EcalPlugins/plugins/EcalLaserAPDPNRatiosRef_PayloadInspector.cc b/CondCore/EcalPlugins/plugins/EcalLaserAPDPNRatiosRef_PayloadInspector.cc index 9ae8a5cb993d3..82768a7ff135e 100644 --- a/CondCore/EcalPlugins/plugins/EcalLaserAPDPNRatiosRef_PayloadInspector.cc +++ b/CondCore/EcalPlugins/plugins/EcalLaserAPDPNRatiosRef_PayloadInspector.cc @@ -16,6 +16,7 @@ #include #include +#include namespace { enum { kEBChannels = 61200, kEEChannels = 14648 }; @@ -190,9 +191,9 @@ namespace { float xmi[3] = {0.0, 0.24, 0.76}; float xma[3] = {0.24, 0.76, 1.00}; - TPad** pad = new TPad*; + std::array, 3> pad; for (int obj = 0; obj < 3; obj++) { - pad[obj] = new TPad(Form("p_%i", obj), Form("p_%i", obj), xmi[obj], 0.0, xma[obj], 0.94); + pad[obj] = std::make_unique(Form("p_%i", obj), Form("p_%i", obj), xmi[obj], 0.0, xma[obj], 0.94); pad[obj]->Draw(); } // EcalDrawMaps ICMap; @@ -279,10 +280,10 @@ namespace { float xmi[3] = {0.0, 0.24, 0.76}; float xma[3] = {0.24, 0.76, 1.00}; - TPad** pad = new TPad*; + std::array, 3> pad; for (int obj = 0; obj < 3; obj++) { - pad[obj] = new TPad(Form("p_%i", obj), Form("p_%i", obj), xmi[obj], 0.0, xma[obj], 0.94); + pad[obj] = std::make_unique(Form("p_%i", obj), Form("p_%i", obj), xmi[obj], 0.0, xma[obj], 0.94); pad[obj]->Draw(); } @@ -350,9 +351,9 @@ namespace { t1.SetTextColor(2); t1.DrawLatex(0.5, 0.96, Form("Ecal Laser APDPN Ratios Ref Summary, IOV %i", run)); - TPad* pad = new TPad("pad", "pad", 0.0, 0.0, 1.0, 0.94); - pad->Draw(); - pad->cd(); + TPad pad("pad", "pad", 0.0, 0.0, 1.0, 0.94); + pad.Draw(); + pad.cd(); align->Draw("TEXT"); drawTable(NbRows, 4); diff --git a/CondCore/EcalPlugins/plugins/EcalLaserAlphas_PayloadInspector.cc b/CondCore/EcalPlugins/plugins/EcalLaserAlphas_PayloadInspector.cc index a7589dd70fbfa..bcc09ddb1c912 100644 --- a/CondCore/EcalPlugins/plugins/EcalLaserAlphas_PayloadInspector.cc +++ b/CondCore/EcalPlugins/plugins/EcalLaserAlphas_PayloadInspector.cc @@ -16,6 +16,7 @@ #include #include +#include namespace { enum { kEBChannels = 61200, kEEChannels = 14648 }; @@ -185,9 +186,9 @@ namespace { float xmi[3] = {0.0, 0.24, 0.76}; float xma[3] = {0.24, 0.76, 1.00}; - TPad** pad = new TPad*; + std::array, 3> pad; for (int obj = 0; obj < 3; obj++) { - pad[obj] = new TPad(Form("p_%i", obj), Form("p_%i", obj), xmi[obj], 0.0, xma[obj], 0.94); + pad[obj] = std::make_unique(Form("p_%i", obj), Form("p_%i", obj), xmi[obj], 0.0, xma[obj], 0.94); pad[obj]->Draw(); } // EcalDrawMaps ICMap; @@ -293,10 +294,10 @@ namespace { } float xmi[3] = {0.0, 0.24, 0.76}; float xma[3] = {0.24, 0.76, 1.00}; - TPad** pad = new TPad*; + std::array, 3> pad; for (int obj = 0; obj < 3; obj++) { - pad[obj] = new TPad(Form("p_%i", obj), Form("p_%i", obj), xmi[obj], 0.0, xma[obj], 0.94); + pad[obj] = std::make_unique(Form("p_%i", obj), Form("p_%i", obj), xmi[obj], 0.0, xma[obj], 0.94); pad[obj]->Draw(); } @@ -363,9 +364,9 @@ namespace { t1.SetTextColor(2); t1.DrawLatex(0.5, 0.96, Form("Ecal Laser Alphas Summary, IOV %i", run)); - TPad* pad = new TPad("pad", "pad", 0.0, 0.0, 1.0, 0.94); - pad->Draw(); - pad->cd(); + TPad pad("pad", "pad", 0.0, 0.0, 1.0, 0.94); + pad.Draw(); + pad.cd(); align->Draw("TEXT"); drawTable(NbRows, 4); diff --git a/CondCore/EcalPlugins/plugins/EcalPFRecHitThresholds_PayloadInspector.cc b/CondCore/EcalPlugins/plugins/EcalPFRecHitThresholds_PayloadInspector.cc index db9cbc4a9881b..73296272e4138 100644 --- a/CondCore/EcalPlugins/plugins/EcalPFRecHitThresholds_PayloadInspector.cc +++ b/CondCore/EcalPlugins/plugins/EcalPFRecHitThresholds_PayloadInspector.cc @@ -15,6 +15,7 @@ #include "TLatex.h" #include +#include #include namespace { @@ -192,9 +193,9 @@ namespace { float xmi[3] = {0.0, 0.24, 0.76}; float xma[3] = {0.24, 0.76, 1.00}; - TPad** pad = new TPad*; + std::array, 3> pad; for (int obj = 0; obj < 3; obj++) { - pad[obj] = new TPad(Form("p_%i", obj), Form("p_%i", obj), xmi[obj], 0.0, xma[obj], 0.94); + pad[obj] = std::make_unique(Form("p_%i", obj), Form("p_%i", obj), xmi[obj], 0.0, xma[obj], 0.94); pad[obj]->Draw(); } // EcalDrawMaps ICMap; @@ -298,10 +299,10 @@ namespace { float xmi[3] = {0.0, 0.24, 0.76}; float xma[3] = {0.24, 0.76, 1.00}; - TPad** pad = new TPad*; + std::array, 3> pad; for (int obj = 0; obj < 3; obj++) { - pad[obj] = new TPad(Form("p_%i", obj), Form("p_%i", obj), xmi[obj], 0.0, xma[obj], 0.94); + pad[obj] = std::make_unique(Form("p_%i", obj), Form("p_%i", obj), xmi[obj], 0.0, xma[obj], 0.94); pad[obj]->Draw(); } @@ -368,9 +369,9 @@ namespace { t1.SetTextColor(2); t1.DrawLatex(0.5, 0.96, Form("Ecal PFRec Hit Thresholds Summary, IOV %i", run)); - TPad* pad = new TPad("pad", "pad", 0.0, 0.0, 1.0, 0.94); - pad->Draw(); - pad->cd(); + TPad pad("pad", "pad", 0.0, 0.0, 1.0, 0.94); + pad.Draw(); + pad.cd(); align->Draw("TEXT"); drawTable(NbRows, 4); diff --git a/CondCore/EcalPlugins/plugins/EcalPyUtils.cc b/CondCore/EcalPlugins/plugins/EcalPyUtils.cc index 27b0513b3ecd6..a4e7a12f024fb 100644 --- a/CondCore/EcalPlugins/plugins/EcalPyUtils.cc +++ b/CondCore/EcalPlugins/plugins/EcalPyUtils.cc @@ -8,10 +8,8 @@ #include "DataFormats/EcalDetId/interface/EBDetId.h" #include "DataFormats/EcalDetId/interface/EEDetId.h" #include "CondTools/Ecal/interface/EcalFloatCondObjectContainerXMLTranslator.h" -#include -#include - -using namespace boost::python; +#include +namespace py = pybind11; namespace ecalpyutils { @@ -59,7 +57,7 @@ namespace ecalpyutils { } } // namespace ecalpyutils -BOOST_PYTHON_MODULE(pluginEcalPyUtils) { +PYBIND11_MODULE(pluginEcalPyUtils, m) { // looks like these are already defined somewhere // python access to stl integer vectors @@ -71,12 +69,12 @@ BOOST_PYTHON_MODULE(pluginEcalPyUtils) { // .def(vector_indexing_suite >()) // ; - def("hashedIndexToEtaPhi", &ecalpyutils::hashedIndexToEtaPhi); - def("hashedIndexToXY", &ecalpyutils::hashedIndexToXY); - def("hashedIndex", &ecalpyutils::hashedIndex); - def("hashedIndexEE", &ecalpyutils::hashedIndexEE); - def("ism", &ecalpyutils::ism); - def("barrelfromXML", &EcalFloatCondObjectContainerXMLTranslator::barrelfromXML); - def("endcapfromXML", &EcalFloatCondObjectContainerXMLTranslator::endcapfromXML); - def("arraystoXML", &ecalpyutils::arraystoXML); + m.def("hashedIndexToEtaPhi", &ecalpyutils::hashedIndexToEtaPhi); + m.def("hashedIndexToXY", &ecalpyutils::hashedIndexToXY); + m.def("hashedIndex", &ecalpyutils::hashedIndex); + m.def("hashedIndexEE", &ecalpyutils::hashedIndexEE); + m.def("ism", &ecalpyutils::ism); + m.def("barrelfromXML", &EcalFloatCondObjectContainerXMLTranslator::barrelfromXML); + m.def("endcapfromXML", &EcalFloatCondObjectContainerXMLTranslator::endcapfromXML); + m.def("arraystoXML", &ecalpyutils::arraystoXML); } diff --git a/CondCore/EcalPlugins/plugins/EcalTPGCrystalStatus_PayloadInspector.cc b/CondCore/EcalPlugins/plugins/EcalTPGCrystalStatus_PayloadInspector.cc index 73a04734c8c01..071b35d6dab00 100644 --- a/CondCore/EcalPlugins/plugins/EcalTPGCrystalStatus_PayloadInspector.cc +++ b/CondCore/EcalPlugins/plugins/EcalTPGCrystalStatus_PayloadInspector.cc @@ -14,6 +14,8 @@ #include "TLatex.h" #include +#include +#include namespace { enum { kEBChannels = 61200, kEEChannels = 14648, kSides = 2 }; @@ -30,7 +32,7 @@ namespace { setSingleIov(true); } - bool fill(const std::vector >& iovs) override { + bool fill(const std::vector>& iovs) override { TH2F* barrel = new TH2F("EB", "EB TPG Crystal Status", MAX_IPHI, 0, MAX_IPHI, 2 * MAX_IETA, -MAX_IETA, MAX_IETA); TH2F* endc_p = new TH2F("EE+", "EE+ TPG Crystal Status", IX_MAX, IX_MIN, IX_MAX + 1, IY_MAX, IY_MIN, IY_MAX + 1); TH2F* endc_m = new TH2F("EE-", "EE- TPG Crystal Status", IX_MAX, IX_MIN, IX_MAX + 1, IY_MAX, IY_MIN, IY_MAX + 1); @@ -100,9 +102,9 @@ namespace { float xma[3] = {1.0, 0.5, 1.0}; float ymi[3] = {0.47, 0.0, 0.0}; float yma[3] = {0.94, 0.47, 0.47}; - TPad** pad = new TPad*; + std::array, 3> pad; for (int obj = 0; obj < 3; obj++) { - pad[obj] = new TPad(Form("p_%i", obj), Form("p_%i", obj), xmi[obj], ymi[obj], xma[obj], yma[obj]); + pad[obj] = std::make_unique(Form("p_%i", obj), Form("p_%i", obj), xmi[obj], ymi[obj], xma[obj], yma[obj]); pad[obj]->Draw(); } @@ -248,9 +250,9 @@ namespace { float xma[3] = {1.0, 0.5, 1.0}; float ymi[3] = {0.47, 0.0, 0.0}; float yma[3] = {0.94, 0.47, 0.47}; - std::vector pad; + std::vector> pad; for (int obj = 0; obj < 3; obj++) { - pad.push_back(new TPad(Form("p_%i", obj), Form("p_%i", obj), xmi[obj], ymi[obj], xma[obj], yma[obj])); + pad.emplace_back(new TPad(Form("p_%i", obj), Form("p_%i", obj), xmi[obj], ymi[obj], xma[obj], yma[obj])); pad[obj]->Draw(); } @@ -282,7 +284,7 @@ namespace { setSingleIov(true); } - bool fill(const std::vector >& iovs) override { + bool fill(const std::vector>& iovs) override { auto iov = iovs.front(); //get reference to 1st element in the vector iovs std::shared_ptr payload = fetchPayload(std::get<1>(iov)); //std::get<1>(iov) refers to the Hash in the tuple iov @@ -349,9 +351,9 @@ namespace { t1.SetTextColor(2); t1.DrawLatex(0.5, 0.96, Form("EcalTPGCrystalStatus Error Summary, IOV %i", run)); - TPad* pad = new TPad("pad", "pad", 0.0, 0.0, 1.0, 0.94); - pad->Draw(); - pad->cd(); + TPad pad("pad", "pad", 0.0, 0.0, 1.0, 0.94); + pad.Draw(); + pad.cd(); align->Draw("TEXT"); drawTable(NbRows, NbColumns); diff --git a/CondCore/EcalPlugins/plugins/EcalTPGFineGrainStripEE_PayloadInspector.cc b/CondCore/EcalPlugins/plugins/EcalTPGFineGrainStripEE_PayloadInspector.cc index 46b0938cf6aa9..6d2d55aa1c398 100644 --- a/CondCore/EcalPlugins/plugins/EcalTPGFineGrainStripEE_PayloadInspector.cc +++ b/CondCore/EcalPlugins/plugins/EcalTPGFineGrainStripEE_PayloadInspector.cc @@ -15,6 +15,8 @@ #include "TLatex.h" #include +#include +#include namespace { enum { NTCC = 108, NTower = 28, NStrip = 5, NXtal = 5 }; @@ -164,9 +166,9 @@ namespace { float ymi[4] = {0.47, 0.47, 0.0, 0.0}; float yma[4] = {0.94, 0.94, 0.47, 0.47}; - TPad** pad = new TPad*; + std::array, 4> pad; for (int obj = 0; obj < 4; obj++) { - pad[obj] = new TPad(Form("p_%i", obj), Form("p_%i", obj), xmi[obj], ymi[obj], xma[obj], yma[obj]); + pad[obj] = std::make_unique(Form("p_%i", obj), Form("p_%i", obj), xmi[obj], ymi[obj], xma[obj], yma[obj]); pad[obj]->Draw(); } @@ -192,7 +194,6 @@ namespace { canvas.SaveAs(ImageName.c_str()); - delete pad; delete endc_lut_p; delete endc_lut_m; delete endc_thresh_p; @@ -204,4 +205,4 @@ namespace { } // namespace // Register the classes as boost python plugin -PAYLOAD_INSPECTOR_MODULE(EcalTPGFineGrainStripEE) { PAYLOAD_INSPECTOR_CLASS(EcalTPGFineGrainStripEEPlot); } \ No newline at end of file +PAYLOAD_INSPECTOR_MODULE(EcalTPGFineGrainStripEE) { PAYLOAD_INSPECTOR_CLASS(EcalTPGFineGrainStripEEPlot); } diff --git a/CondCore/EcalPlugins/plugins/EcalTPGStripStatus_PayloadInspector.cc b/CondCore/EcalPlugins/plugins/EcalTPGStripStatus_PayloadInspector.cc index ca67b4b597e55..dea0df97092c2 100644 --- a/CondCore/EcalPlugins/plugins/EcalTPGStripStatus_PayloadInspector.cc +++ b/CondCore/EcalPlugins/plugins/EcalTPGStripStatus_PayloadInspector.cc @@ -15,6 +15,8 @@ #include "TLatex.h" #include +#include +#include namespace { enum { NTCC = 108, NTower = 28, NStrip = 5, NXtal = 5 }; @@ -138,9 +140,9 @@ namespace { float xmi[2] = {0.0, 0.5}; float xma[2] = {0.5, 1.0}; - TPad** pad = new TPad*; + std::array, 2> pad; for (int obj = 0; obj < 2; obj++) { - pad[obj] = new TPad(Form("p_%i", obj), Form("p_%i", obj), xmi[obj], 0.0, xma[obj], 0.94); + pad[obj] = std::make_unique(Form("p_%i", obj), Form("p_%i", obj), xmi[obj], 0.0, xma[obj], 0.94); pad[obj]->Draw(); } @@ -365,9 +367,9 @@ namespace { float xmi[2] = {0.0, 0.5}; float xma[2] = {0.5, 1.0}; - TPad** pad = new TPad*; + std::array, 2> pad; for (int obj = 0; obj < 2; obj++) { - pad[obj] = new TPad(Form("p_%i", obj), Form("p_%i", obj), xmi[obj], 0.0, xma[obj], 0.94); + pad[obj] = std::make_unique(Form("p_%i", obj), Form("p_%i", obj), xmi[obj], 0.0, xma[obj], 0.94); pad[obj]->Draw(); } @@ -442,9 +444,9 @@ namespace { t1.SetTextColor(2); t1.DrawLatex(0.5, 0.96, Form("Endcap:Number of masked Trigger Strips, IOV %i", run)); - TPad* pad = new TPad("pad", "pad", 0.0, 0.0, 1.0, 0.94); - pad->Draw(); - pad->cd(); + TPad pad("pad", "pad", 0.0, 0.0, 1.0, 0.94); + pad.Draw(); + pad.cd(); align->Draw("TEXT"); drawTable(NbRows, NbColumns); diff --git a/CondCore/EcalPlugins/plugins/EcalTimeCalibConstants_PayloadInspector.cc b/CondCore/EcalPlugins/plugins/EcalTimeCalibConstants_PayloadInspector.cc index 4674dcb2dd5a6..9fcf9e2b30809 100644 --- a/CondCore/EcalPlugins/plugins/EcalTimeCalibConstants_PayloadInspector.cc +++ b/CondCore/EcalPlugins/plugins/EcalTimeCalibConstants_PayloadInspector.cc @@ -16,6 +16,7 @@ #include #include +#include namespace { @@ -191,9 +192,9 @@ namespace { float xmi[3] = {0.0, 0.24, 0.76}; float xma[3] = {0.24, 0.76, 1.00}; - TPad** pad = new TPad*; + std::array, 3> pad; for (int obj = 0; obj < 3; obj++) { - pad[obj] = new TPad(Form("p_%i", obj), Form("p_%i", obj), xmi[obj], 0.0, xma[obj], 0.94); + pad[obj] = std::make_unique(Form("p_%i", obj), Form("p_%i", obj), xmi[obj], 0.0, xma[obj], 0.94); pad[obj]->Draw(); } // EcalDrawMaps ICMap; @@ -297,10 +298,10 @@ namespace { float xmi[3] = {0.0, 0.24, 0.76}; float xma[3] = {0.24, 0.76, 1.00}; - TPad** pad = new TPad*; + std::array, 3> pad; for (int obj = 0; obj < 3; obj++) { - pad[obj] = new TPad(Form("p_%i", obj), Form("p_%i", obj), xmi[obj], 0.0, xma[obj], 0.94); + pad[obj] = std::make_unique(Form("p_%i", obj), Form("p_%i", obj), xmi[obj], 0.0, xma[obj], 0.94); pad[obj]->Draw(); } @@ -367,9 +368,9 @@ namespace { t1.SetTextColor(2); t1.DrawLatex(0.5, 0.96, Form("Ecal Time Calib Constants Summary, IOV %i", run)); - TPad* pad = new TPad("pad", "pad", 0.0, 0.0, 1.0, 0.94); - pad->Draw(); - pad->cd(); + TPad pad("pad", "pad", 0.0, 0.0, 1.0, 0.94); + pad.Draw(); + pad.cd(); align->Draw("TEXT"); drawTable(NbRows, 4); diff --git a/CondCore/EcalPlugins/plugins/EcalTimeCalibErrors_PayloadInspector.cc b/CondCore/EcalPlugins/plugins/EcalTimeCalibErrors_PayloadInspector.cc index 6b227b7997577..8fb771b0e734b 100644 --- a/CondCore/EcalPlugins/plugins/EcalTimeCalibErrors_PayloadInspector.cc +++ b/CondCore/EcalPlugins/plugins/EcalTimeCalibErrors_PayloadInspector.cc @@ -16,6 +16,7 @@ #include #include +#include namespace { @@ -193,9 +194,9 @@ namespace { float xmi[3] = {0.0, 0.24, 0.76}; float xma[3] = {0.24, 0.76, 1.00}; - TPad** pad = new TPad*; + std::array, 3> pad; for (int obj = 0; obj < 3; obj++) { - pad[obj] = new TPad(Form("p_%i", obj), Form("p_%i", obj), xmi[obj], 0.0, xma[obj], 0.94); + pad[obj] = std::make_unique(Form("p_%i", obj), Form("p_%i", obj), xmi[obj], 0.0, xma[obj], 0.94); pad[obj]->Draw(); } // EcalDrawMaps ICMap; @@ -301,10 +302,10 @@ namespace { } float xmi[3] = {0.0, 0.24, 0.76}; float xma[3] = {0.24, 0.76, 1.00}; - TPad** pad = new TPad*; + std::array, 3> pad; for (int obj = 0; obj < 3; obj++) { - pad[obj] = new TPad(Form("p_%i", obj), Form("p_%i", obj), xmi[obj], 0.0, xma[obj], 0.94); + pad[obj] = std::make_unique(Form("p_%i", obj), Form("p_%i", obj), xmi[obj], 0.0, xma[obj], 0.94); pad[obj]->Draw(); } @@ -371,9 +372,9 @@ namespace { t1.SetTextColor(2); t1.DrawLatex(0.5, 0.96, Form("Ecal Time Calib Errors Summary, IOV %i", run)); - TPad* pad = new TPad("pad", "pad", 0.0, 0.0, 1.0, 0.94); - pad->Draw(); - pad->cd(); + TPad pad("pad", "pad", 0.0, 0.0, 1.0, 0.94); + pad.Draw(); + pad.cd(); align->Draw("TEXT"); drawTable(NbRows, 4); diff --git a/CondCore/EcalPlugins/plugins/EcalWeightXtalGroups_PayloadInspector.cc b/CondCore/EcalPlugins/plugins/EcalWeightXtalGroups_PayloadInspector.cc index 00e3b9546a762..1294c4b47f890 100644 --- a/CondCore/EcalPlugins/plugins/EcalWeightXtalGroups_PayloadInspector.cc +++ b/CondCore/EcalPlugins/plugins/EcalWeightXtalGroups_PayloadInspector.cc @@ -14,6 +14,8 @@ #include "TLatex.h" #include +#include +#include namespace { @@ -100,9 +102,9 @@ namespace { float xmi[3] = {0.0, 0.24, 0.76}; float xma[3] = {0.24, 0.76, 1.00}; - TPad** pad = new TPad*; + std::array, 3> pad; for (int obj = 0; obj < 3; obj++) { - pad[obj] = new TPad(Form("p_%i", obj), Form("p_%i", obj), xmi[obj], 0.0, xma[obj], 0.94); + pad[obj] = std::make_unique(Form("p_%i", obj), Form("p_%i", obj), xmi[obj], 0.0, xma[obj], 0.94); pad[obj]->Draw(); } // EcalDrawMaps ICMap; @@ -125,4 +127,4 @@ namespace { } // namespace // Register the classes as boost python plugin -PAYLOAD_INSPECTOR_MODULE(EcalWeightXtalGroups) { PAYLOAD_INSPECTOR_CLASS(EcalWeightXtalGroupsPlot); } \ No newline at end of file +PAYLOAD_INSPECTOR_MODULE(EcalWeightXtalGroups) { PAYLOAD_INSPECTOR_CLASS(EcalWeightXtalGroupsPlot); } diff --git a/CondCore/HLTPlugins/plugins/AlCaRecoTriggerBits_PayloadInspector.cc b/CondCore/HLTPlugins/plugins/AlCaRecoTriggerBits_PayloadInspector.cc index 70096f1615be2..2a19317a2f8c1 100644 --- a/CondCore/HLTPlugins/plugins/AlCaRecoTriggerBits_PayloadInspector.cc +++ b/CondCore/HLTPlugins/plugins/AlCaRecoTriggerBits_PayloadInspector.cc @@ -3,6 +3,7 @@ #include "CondCore/CondDB/interface/Time.h" #include "CondFormats/HLTObjects/interface/AlCaRecoTriggerBits.h" +#include #include #include #include @@ -12,13 +13,14 @@ namespace { + using namespace cond::payloadInspector; + /************************************************ Display AlCaRecoTriggerBits mapping *************************************************/ - class AlCaRecoTriggerBits_Display : public cond::payloadInspector::PlotImage { + class AlCaRecoTriggerBits_Display : public PlotImage { public: - AlCaRecoTriggerBits_Display() - : cond::payloadInspector::PlotImage("Table of AlCaRecoTriggerBits") { + AlCaRecoTriggerBits_Display() : PlotImage("Table of AlCaRecoTriggerBits") { setSingleIov(true); } @@ -127,24 +129,33 @@ namespace { /************************************************ Compare AlCaRecoTriggerBits mapping *************************************************/ - class AlCaRecoTriggerBits_CompareBase : public cond::payloadInspector::PlotImage { + template + class AlCaRecoTriggerBits_CompareBase : public PlotImage { public: AlCaRecoTriggerBits_CompareBase() - : cond::payloadInspector::PlotImage("Table of AlCaRecoTriggerBits comparison") {} - - bool fill(const std::vector > &iovs) override { - std::vector > sorted_iovs = iovs; - - // make absolute sure the IOVs are sortd by since - std::sort(begin(sorted_iovs), end(sorted_iovs), [](auto const &t1, auto const &t2) { - return std::get<0>(t1) < std::get<0>(t2); - }); - - auto firstiov = sorted_iovs.front(); - auto lastiov = sorted_iovs.back(); + : PlotImage("Table of AlCaRecoTriggerBits comparison") {} + + bool fill() override { + // trick to deal with the multi-ioved tag and two tag case at the same time + auto theIOVs = PlotBase::getTag<0>().iovs; + auto f_tagname = PlotBase::getTag<0>().name; + std::string l_tagname = ""; + auto firstiov = theIOVs.front(); + std::tuple lastiov; + + // we don't support (yet) comparison with more than 2 tags + assert(this->m_plotAnnotations.ntags < 3); + + if (this->m_plotAnnotations.ntags == 2) { + auto tag2iovs = PlotBase::getTag<1>().iovs; + l_tagname = PlotBase::getTag<1>().name; + lastiov = tag2iovs.front(); + } else { + lastiov = theIOVs.back(); + } - std::shared_ptr last_payload = fetchPayload(std::get<1>(lastiov)); - std::shared_ptr first_payload = fetchPayload(std::get<1>(firstiov)); + std::shared_ptr last_payload = this->fetchPayload(std::get<1>(lastiov)); + std::shared_ptr first_payload = this->fetchPayload(std::get<1>(firstiov)); std::string lastIOVsince = std::to_string(std::get<0>(lastiov)); std::string firstIOVsince = std::to_string(std::get<0>(firstiov)); @@ -195,9 +206,9 @@ namespace { y_x1.push_back(y); s_x1.push_back("#scale[1.2]{Key}"); y_x2.push_back(y); - s_x2.push_back("#scale[1.2]{in IOV: " + firstIOVsince + "}"); + s_x2.push_back(fmt::sprintf("#scale[1.2]{%s in IOV: %s}", f_tagname, firstIOVsince)); y_x3.push_back(y); - s_x3.push_back("#scale[1.2]{in IOV: " + lastIOVsince + "}"); + s_x3.push_back(fmt::sprintf("#scale[1.2]{%s in IOV: %s}", l_tagname, lastIOVsince)); y -= pitch / 3; // print the ones missing in the last key @@ -391,21 +402,14 @@ namespace { } //canvas.SetCanvasSize(2000,(1-y)*1000); - std::string fileName(m_imageFileName); + std::string fileName(this->m_imageFileName); canvas.SaveAs(fileName.c_str()); return true; } }; - class AlCaRecoTriggerBits_Compare : public AlCaRecoTriggerBits_CompareBase { - public: - AlCaRecoTriggerBits_Compare() : AlCaRecoTriggerBits_CompareBase() { this->setSingleIov(false); } - }; - - class AlCaRecoTriggerBits_CompareTwoTags : public AlCaRecoTriggerBits_CompareBase { - public: - AlCaRecoTriggerBits_CompareTwoTags() : AlCaRecoTriggerBits_CompareBase() { this->setTwoTags(true); } - }; + using AlCaRecoTriggerBits_Compare = AlCaRecoTriggerBits_CompareBase; + using AlCaRecoTriggerBits_CompareTwoTags = AlCaRecoTriggerBits_CompareBase; } // namespace diff --git a/CondCore/HLTPlugins/test/test.sh b/CondCore/HLTPlugins/test/test.sh index 739e1cceed0b6..e9d1d5ca299cd 100755 --- a/CondCore/HLTPlugins/test/test.sh +++ b/CondCore/HLTPlugins/test/test.sh @@ -38,4 +38,17 @@ getPayloadData.py \ --db Prod \ --test; -mv *.png $W_DIR/plots/AlCaRecoTriggerBits_Compare.png \ No newline at end of file +mv *.png $W_DIR/plots/AlCaRecoTriggerBits_Compare.png + +getPayloadData.py \ + --plugin pluginAlCaRecoTriggerBits_PayloadInspector \ + --plot plot_AlCaRecoTriggerBits_CompareTwoTags \ + --tag AlCaRecoTriggerBits_TrackerDQM_v2_prompt \ + --tagtwo AlCaRecoTriggerBits_TrackerDQM_v6_offline \ + --time_type Run \ + --iovs '{"start_iov": "325492", "end_iov": "325492"}' \ + --iovstwo '{"start_iov": "304738", "end_iov": "304738"}' \ + --db Prod \ + --test; + +mv *.png $W_DIR/plots/AlCaRecoTriggerBits_CompareTwoTags.png diff --git a/CondCore/HLTPlugins/test/testAlCaRecoTriggerBitsPayloadInspector.cpp b/CondCore/HLTPlugins/test/testAlCaRecoTriggerBitsPayloadInspector.cpp index d08272a31ec45..4eb5a7ecf29e7 100644 --- a/CondCore/HLTPlugins/test/testAlCaRecoTriggerBitsPayloadInspector.cpp +++ b/CondCore/HLTPlugins/test/testAlCaRecoTriggerBitsPayloadInspector.cpp @@ -22,8 +22,8 @@ int main(int argc, char** argv) { std::string connectionString("frontier://FrontierProd/CMS_CONDITIONS"); std::string tag = "AlCaRecoHLTpaths8e29_1e31_v7_hlt"; - cond::Time_t start = boost::lexical_cast(270000); - cond::Time_t end = boost::lexical_cast(304820); + cond::Time_t start = static_cast(270000); + cond::Time_t end = static_cast(304820); std::cout << "## AlCaRecoTriggerBit Histos" << std::endl; diff --git a/CondCore/PopCon/interface/PopCon.h b/CondCore/PopCon/interface/PopCon.h index a35261ae4f32c..38baeaee8b071 100644 --- a/CondCore/PopCon/interface/PopCon.h +++ b/CondCore/PopCon/interface/PopCon.h @@ -29,7 +29,6 @@ namespace popcon { class PopCon { public: typedef cond::Time_t Time_t; - //typedef cond::Summary Summary; PopCon(const edm::ParameterSet& pset); @@ -38,9 +37,6 @@ namespace popcon { template void write(Source const& source); - template - void writeOne(T* payload, Time_t time); - private: cond::persistency::Session initialize(); void finalize(Time_t lastTill); @@ -75,58 +71,37 @@ namespace popcon { static constexpr const char* const s_version = "5.0"; }; - template - void PopCon::writeOne(T* payload, Time_t time) { - m_dbService->writeOne(payload, time, m_record); - } - - template - void displayHelper(Container const& payloads) { - typename Container::const_iterator it; - for (it = payloads.begin(); it != payloads.end(); it++) - edm::LogInfo("PopCon") << "Since " << (*it).time << std::endl; - } - - template - const std::string displayIovHelper(Container const& payloads) { - if (payloads.empty()) - return std::string("Nothing to transfer;"); - std::ostringstream s; - // when only 1 payload is transferred; - if (payloads.size() == 1) - s << "Since " << (*payloads.begin()).time << "; "; - else { - // when more than one payload are transferred; - s << "first payload Since " << (*payloads.begin()).time << ", " - << "last payload Since " << (*payloads.rbegin()).time << "; "; - } - return s.str(); - } - template void PopCon::write(Source const& source) { typedef typename Source::value_type value_type; typedef typename Source::Container Container; std::pair ret = source(initialize(), m_tagInfo, m_logDBEntry); - Container const& payloads = *ret.first; + Container const& iovs = *ret.first; if (m_LoggingOn) { + std::string msg("Nothing to transfer;"); + size_t niovs = iovs.size(); + if (niovs) { + std::ostringstream s; + if (niovs == 1) { + s << "Since " << (*iovs.begin()).first << "; "; + } else { + s << "first payload Since " << (*iovs.begin()).first << ", " + << "last payload Since " << (*iovs.rbegin()).first << "; "; + } + msg = s.str(); + } std::ostringstream s; - s << "PopCon v" << s_version << "; " << displayIovHelper(payloads) << ret.second; - //s << "PopCon v" << s_version << "; " << cond::userInfo() << displayIovHelper(payloads) << ret.second; + s << "PopCon v" << s_version << "; " << msg << ret.second; m_dbService->setLogHeaderForRecord(m_record, source.id(), s.str()); } - displayHelper(payloads); + for (auto it : iovs) + edm::LogInfo("PopCon") << "Since " << it.first << std::endl; - std::for_each(payloads.begin(), - payloads.end(), - std::bind(&popcon::PopCon::writeOne, - this, - std::bind(&Container::value_type::payload, std::placeholders::_1), - std::bind(&Container::value_type::time, std::placeholders::_1))); + m_dbService->writeMany(iovs, m_record); - finalize(payloads.empty() ? Time_t(0) : payloads.back().time); + finalize(iovs.empty() ? Time_t(0) : iovs.rbegin()->first); } } // namespace popcon diff --git a/CondCore/PopCon/interface/PopConSourceHandler.h b/CondCore/PopCon/interface/PopConSourceHandler.h index ddfa95e66e62d..59f18796e66c4 100644 --- a/CondCore/PopCon/interface/PopConSourceHandler.h +++ b/CondCore/PopCon/interface/PopConSourceHandler.h @@ -32,44 +32,9 @@ namespace popcon { typedef T value_type; typedef PopConSourceHandler self; typedef cond::Time_t Time_t; - typedef cond::Summary Summary; - struct Triplet { - value_type* payload; - Summary* summary; - Time_t time; - }; - - typedef std::vector Container; - - typedef std::vector > OldContainer; - - class Ref { - public: - Ref() : m_dbsession() {} - Ref(cond::persistency::Session& dbsession, const std::string& hash) : m_dbsession(dbsession) { - m_d = m_dbsession.fetchPayload(hash); - } - ~Ref() {} - - Ref(const Ref& ref) : m_dbsession(ref.m_dbsession), m_d(ref.m_d) {} - - Ref& operator=(const Ref& ref) { - m_dbsession = ref.m_dbsession; - m_d = ref.m_d; - return *this; - } - - T const* ptr() const { return m_d.get(); } - - T const* operator->() const { return ptr(); } - // dereference operator - T const& operator*() const { return *ptr(); } - - private: - cond::persistency::Session m_dbsession; - std::shared_ptr m_d; - }; + typedef std::map > Container; + typedef std::unique_ptr Ref; PopConSourceHandler() : m_tagInfo(nullptr), m_logDBEntry(nullptr) {} @@ -78,7 +43,7 @@ namespace popcon { cond::TagInfo_t const& tagInfo() const { return *m_tagInfo; } // return last paylod of the tag - Ref lastPayload() const { return Ref(m_session, tagInfo().lastInterval.payloadId); } + Ref lastPayload() const { return m_session.fetchPayload(tagInfo().lastInterval.payloadId); } // return last successful log entry for the tag in question cond::LogDBEntry_t const& logDBEntry() const { return *m_logDBEntry; } @@ -102,10 +67,11 @@ namespace popcon { Container const& returnData() { getNewObjects(); - if (!m_to_transfer.empty()) - convertFromOld(); - sort(); - return m_triplets; + for (auto item : m_to_transfer) { + std::shared_ptr payload(item.first); + m_iovs.insert(std::make_pair(item.second, payload)); + } + return m_iovs; } std::string const& userTextLog() const { return m_userTextLog; } @@ -117,38 +83,9 @@ namespace popcon { // return a string identifing the source virtual std::string id() const = 0; - void sort() { - std::sort(m_triplets.begin(), - m_triplets.end(), - std::bind(std::less(), - std::bind(&Container::value_type::time, std::placeholders::_1), - std::bind(&Container::value_type::time, std::placeholders::_2))); - } - - // make sure to create a new one each time... - Summary* dummySummary(typename OldContainer::value_type const&) const { - return new cond::GenericSummary("not supplied"); - } - - void convertFromOld() { - std::for_each(m_to_transfer.begin(), - m_to_transfer.end(), - std::bind(&self::add, - this, - std::bind(&OldContainer::value_type::first, std::placeholders::_1), - std::bind(&self::dummySummary, this, std::placeholders::_1), - std::bind(&OldContainer::value_type::second, std::placeholders::_1))); - } - protected: cond::persistency::Session& dbSession() const { return m_session; } - int add(value_type* payload, Summary* summary, Time_t time) { - Triplet t = {payload, summary, time}; - m_triplets.push_back(t); - return m_triplets.size(); - } - private: mutable cond::persistency::Session m_session; @@ -159,12 +96,10 @@ namespace popcon { protected: //vector of payload objects and iovinfo to be transferred //class looses ownership of payload object - OldContainer m_to_transfer; + std::vector > m_to_transfer; - private: - Container m_triplets; + Container m_iovs; - protected: std::string m_userTextLog; }; } // namespace popcon diff --git a/CondCore/RunInfoPlugins/test/testRunInfoPayloadInspector.cpp b/CondCore/RunInfoPlugins/test/testRunInfoPayloadInspector.cpp index dc78079b886b4..5bd13a5c89358 100644 --- a/CondCore/RunInfoPlugins/test/testRunInfoPayloadInspector.cpp +++ b/CondCore/RunInfoPlugins/test/testRunInfoPayloadInspector.cpp @@ -22,8 +22,8 @@ int main(int argc, char** argv) { std::string connectionString("frontier://FrontierProd/CMS_CONDITIONS"); std::string tag = "runinfo_31X_hlt"; - cond::Time_t start = boost::lexical_cast(311950); - cond::Time_t end = boost::lexical_cast(312237); + cond::Time_t start = static_cast(311950); + cond::Time_t end = static_cast(312237); std::cout << "## RunInfo testing" << std::endl; diff --git a/CondCore/SiPixelPlugins/interface/SiPixelGainCalibHelper.h b/CondCore/SiPixelPlugins/interface/SiPixelGainCalibHelper.h index 5f8598040d07f..824c54cc592eb 100644 --- a/CondCore/SiPixelPlugins/interface/SiPixelGainCalibHelper.h +++ b/CondCore/SiPixelPlugins/interface/SiPixelGainCalibHelper.h @@ -426,7 +426,7 @@ namespace gainCalibHelper { auto paramValues = cond::payloadInspector::PlotBase::inputParamValues(); auto ip = paramValues.find("SetLog"); if (ip != paramValues.end()) { - auto answer = boost::lexical_cast(ip->second); + auto answer = ip->second; if (!SiPixelPI::checkAnswerOK(answer, setLog)) { throw cms::Exception(label_) << "\nERROR: " << answer @@ -590,7 +590,7 @@ namespace gainCalibHelper { auto paramValues = cond::payloadInspector::PlotBase::inputParamValues(); auto ip = paramValues.find("SetLog"); if (ip != paramValues.end()) { - auto answer = boost::lexical_cast(ip->second); + auto answer = ip->second; if (!SiPixelPI::checkAnswerOK(answer, setLog)) { throw cms::Exception(label_) << "\nERROR: " << answer diff --git a/CondCore/SiPixelPlugins/interface/SiPixelTemplateHelper.h b/CondCore/SiPixelPlugins/interface/SiPixelTemplateHelper.h index 7cf6dd251a897..873856e23addc 100644 --- a/CondCore/SiPixelPlugins/interface/SiPixelTemplateHelper.h +++ b/CondCore/SiPixelPlugins/interface/SiPixelTemplateHelper.h @@ -242,7 +242,10 @@ namespace templateHelper { h2_Header->GetXaxis()->SetBinLabel(idx, ""); for (unsigned int iy = 1; iy <= 12; iy++) { - if (tempValue.head.Dtype != 0 || uH < 0) { + // Some of the Phase-2 templates have DType = 0 for all partitions (TBPX, TEPX, TFPX) + // so they are distinguished by the uH strength value (<0). + // To avoid changing the behaviour of 0T payload (uH=-99) that case is treated separately + if (tempValue.head.Dtype != 0 || (uH < 0 && uH > -99)) { h2_ghost->SetBinContent(idx, iy, 1); } else { h2_ghost->SetBinContent(idx, iy, -1); diff --git a/CondCore/SiPixelPlugins/plugins/SiPixelFEDChannelContainer_PayloadInspector.cc b/CondCore/SiPixelPlugins/plugins/SiPixelFEDChannelContainer_PayloadInspector.cc index fd440af137345..1839bdf4fe5e5 100644 --- a/CondCore/SiPixelPlugins/plugins/SiPixelFEDChannelContainer_PayloadInspector.cc +++ b/CondCore/SiPixelPlugins/plugins/SiPixelFEDChannelContainer_PayloadInspector.cc @@ -82,7 +82,7 @@ namespace { auto paramValues = PlotBase::inputParamValues(); auto ip = paramValues.find("Scenarios"); if (ip != paramValues.end()) { - auto input = boost::lexical_cast(ip->second); + auto input = ip->second; typedef boost::tokenizer> tokenizer; boost::char_separator sep{","}; tokenizer tok{input, sep}; diff --git a/CondCore/SiPixelPlugins/test/testSiPixelPayloadInspector.cpp b/CondCore/SiPixelPlugins/test/testSiPixelPayloadInspector.cpp index 34b6ad1d50ed0..7f3871312afc2 100644 --- a/CondCore/SiPixelPlugins/test/testSiPixelPayloadInspector.cpp +++ b/CondCore/SiPixelPlugins/test/testSiPixelPayloadInspector.cpp @@ -33,8 +33,8 @@ int main(int argc, char** argv) { // Lorentz Angle std::string tag = "SiPixelLorentzAngle_v11_offline"; - cond::Time_t start = boost::lexical_cast(303790); - cond::Time_t end = boost::lexical_cast(324245); + cond::Time_t start = static_cast(303790); + cond::Time_t end = static_cast(324245); edm::LogPrint("testSiPixelPayloadInspector") << "## Exercising Lorentz Angle plots " << std::endl; @@ -68,7 +68,7 @@ int main(int argc, char** argv) { // 2 tags comparisons std::string tag2 = "SiPixelLorentzAngle_2016_ultralegacymc_v2"; - cond::Time_t start2 = boost::lexical_cast(1); + cond::Time_t start2 = static_cast(1); SiPixelLorentzAngleValueComparisonTwoTags histo6; histo6.process(connectionString, PI::mk_input(tag, start, start, tag2, start2, start2)); @@ -81,8 +81,8 @@ int main(int argc, char** argv) { // SiPixelQuality tag = "SiPixelQuality_forDigitizer_phase1_2018_permanentlyBad"; - start = boost::lexical_cast(1); - end = boost::lexical_cast(1); + start = static_cast(1); + end = static_cast(1); edm::LogPrint("testSiPixelPayloadInspector") << "## Exercising SiPixelQuality plots " << std::endl; @@ -97,8 +97,8 @@ int main(int argc, char** argv) { // SiPixelGainCalibrationOffline tag = "SiPixelGainCalibration_2009runs_express"; - start = boost::lexical_cast(312203); - end = boost::lexical_cast(312203); + start = static_cast(312203); + end = static_cast(312203); edm::LogPrint("testSiPixelPayloadInspector") << "## Exercising SiPixelGainCalibrationOffline plots " << std::endl; @@ -118,7 +118,7 @@ int main(int argc, char** argv) { histo13.process(connectionString, PI::mk_input(tag, start, end)); edm::LogPrint("testSiPixelPayloadInspector") << histo13.data() << std::endl; - end = boost::lexical_cast(326851); + end = static_cast(326851); SiPixelGainCalibOfflinePedestalComparisonSingleTag histo14; histo14.process(connectionString, PI::mk_input(tag, start, end)); @@ -132,7 +132,7 @@ int main(int argc, char** argv) { histo16.process(connectionString, PI::mk_input(tag, end, end)); edm::LogPrint("testSiPixelPayloadInspector") << histo16.data() << std::endl; - boost::python::dict inputs; + py::dict inputs; inputs["SetLog"] = "True"; // sets to true, 1,True,Yes will work SiPixelGainCalibrationOfflineGainsValuesBarrel histo17; @@ -143,8 +143,8 @@ int main(int argc, char** argv) { // SiPixelTemplates tag = "SiPixelTemplateDBObject38Tv3_express"; - start = boost::lexical_cast(326083); - end = boost::lexical_cast(326083); + start = static_cast(326083); + end = static_cast(326083); edm::LogPrint("testSiPixelPayloadInspector") << "## Exercising SiPixelTemplates plots " << std::endl; @@ -177,8 +177,8 @@ int main(int argc, char** argv) { // SiPixelGenErrors tag = "SiPixelGenErrorDBObject_phase1_BoR3_HV350_Tr2000"; - start = boost::lexical_cast(1); - end = boost::lexical_cast(1); + start = static_cast(1); + end = static_cast(1); edm::LogPrint("testSiPixelPayloadInspector") << "## Exercising SiPixelGenErrors plots " << std::endl; @@ -193,8 +193,8 @@ int main(int argc, char** argv) { // SiPixelQualityProbabilities tag = "SiPixelQualityProbabilities_UltraLegacy2018_v0_mc"; - start = boost::lexical_cast(1); - end = boost::lexical_cast(1); + start = static_cast(1); + end = static_cast(1); edm::LogPrint("testSiPixelPayloadInspector") << "## Exercising SiPixelQualityProbabilities plots " << std::endl; @@ -205,8 +205,8 @@ int main(int argc, char** argv) { // SiPixelDynamicInefficiency tag = "SiPixelDynamicInefficiency_PhaseI_v9"; - start = boost::lexical_cast(1); - end = boost::lexical_cast(1); + start = static_cast(1); + end = static_cast(1); edm::LogPrint("testSiPixelPayloadInspector") << "## Exercising SiPixeDynamicInefficiency plots " << std::endl; @@ -215,7 +215,7 @@ int main(int argc, char** argv) { edm::LogPrint("testSiPixelPayloadInspector") << histo26.data() << std::endl; tag2 = "SiPixelDynamicInefficiency_PhaseI_v6"; - start2 = boost::lexical_cast(1); + start2 = static_cast(1); SiPixelFullIneffROCsMapCompareTwoTags histo27; histo27.process(connectionString, PI::mk_input(tag, start, start, tag2, start2, start2)); diff --git a/CondCore/SiStripPlugins/plugins/SiStripApvGain_PayloadInspector.cc b/CondCore/SiStripPlugins/plugins/SiStripApvGain_PayloadInspector.cc index bc21118b11bc0..dc2b59002db67 100644 --- a/CondCore/SiStripPlugins/plugins/SiStripApvGain_PayloadInspector.cc +++ b/CondCore/SiStripPlugins/plugins/SiStripApvGain_PayloadInspector.cc @@ -566,7 +566,7 @@ namespace { auto paramValues = PlotBase::inputParamValues(); auto ip = paramValues.find("nsigma"); if (ip != paramValues.end()) { - nsigma = boost::lexical_cast(ip->second); + nsigma = std::stoul(ip->second); } // trick to deal with the multi-ioved tag and two tag case at the same time @@ -674,7 +674,7 @@ namespace { auto paramValues = PlotBase::inputParamValues(); auto ip = paramValues.find("nsigma"); if (ip != paramValues.end()) { - nsigma = boost::lexical_cast(ip->second); + nsigma = std::stoul(ip->second); edm::LogPrint("SiStripApvGain_PayloadInspector") << "using custom z-axis saturation: " << nsigma << " sigmas" << std::endl; } else { diff --git a/CondCore/SiStripPlugins/plugins/SiStripNoises_PayloadInspector.cc b/CondCore/SiStripPlugins/plugins/SiStripNoises_PayloadInspector.cc index f367b6ab14a05..213e1c848a583 100644 --- a/CondCore/SiStripPlugins/plugins/SiStripNoises_PayloadInspector.cc +++ b/CondCore/SiStripPlugins/plugins/SiStripNoises_PayloadInspector.cc @@ -117,7 +117,7 @@ namespace { auto paramValues = PlotBase::inputParamValues(); auto ip = paramValues.find("DetIds"); if (ip != paramValues.end()) { - auto input = boost::lexical_cast(ip->second); + auto input = ip->second; typedef boost::tokenizer> tokenizer; boost::char_separator sep{","}; tokenizer tok{input, sep}; @@ -316,7 +316,7 @@ namespace { auto paramValues = PlotBase::inputParamValues(); auto ip = paramValues.find("DetId"); if (ip != paramValues.end()) { - the_detid = boost::lexical_cast(ip->second); + the_detid = std::stoul(ip->second); } if (payload.get()) { @@ -962,7 +962,7 @@ namespace { auto paramValues = PlotBase::inputParamValues(); auto ip = paramValues.find("nsigma"); if (ip != paramValues.end()) { - nsigma = boost::lexical_cast(ip->second); + nsigma = std::stoul(ip->second); } // trick to deal with the multi-ioved tag and two tag case at the same time diff --git a/CondCore/SiStripPlugins/plugins/SiStripPedestals_PayloadInspector.cc b/CondCore/SiStripPlugins/plugins/SiStripPedestals_PayloadInspector.cc index 862300c85b89c..19089ff7b30ad 100644 --- a/CondCore/SiStripPlugins/plugins/SiStripPedestals_PayloadInspector.cc +++ b/CondCore/SiStripPlugins/plugins/SiStripPedestals_PayloadInspector.cc @@ -116,7 +116,7 @@ namespace { auto paramValues = PlotBase::inputParamValues(); auto ip = paramValues.find("DetIds"); if (ip != paramValues.end()) { - auto input = boost::lexical_cast(ip->second); + auto input = ip->second; typedef boost::tokenizer> tokenizer; boost::char_separator sep{","}; tokenizer tok{input, sep}; @@ -315,7 +315,7 @@ namespace { auto paramValues = PlotBase::inputParamValues(); auto ip = paramValues.find("DetId"); if (ip != paramValues.end()) { - the_detid = boost::lexical_cast(ip->second); + the_detid = std::stoul(ip->second); } if (payload.get()) { diff --git a/CondCore/SiStripPlugins/test/testSiStripPayloadInspector.cpp b/CondCore/SiStripPlugins/test/testSiStripPayloadInspector.cpp index 285202ed5293c..dad2e4c07b799 100644 --- a/CondCore/SiStripPlugins/test/testSiStripPayloadInspector.cpp +++ b/CondCore/SiStripPlugins/test/testSiStripPayloadInspector.cpp @@ -31,9 +31,10 @@ int main(int argc, char** argv) { // Gains std::string tag = "SiStripApvGain_FromParticles_GR10_v11_offline"; - cond::Time_t start = boost::lexical_cast(132440); - cond::Time_t end = boost::lexical_cast(285368); - boost::python::dict inputs; + + cond::Time_t start = static_cast(132440); + cond::Time_t end = static_cast(285368); + py::dict inputs; edm::LogPrint("testSiStripPayloadInspector") << "## Exercising Gains plots " << std::endl; @@ -72,8 +73,8 @@ int main(int argc, char** argv) { // Noise tag = "SiStripNoise_GR10_v1_hlt"; - start = boost::lexical_cast(312968); - end = boost::lexical_cast(313120); + start = static_cast(312968); + end = static_cast(313120); edm::LogPrint("testSiStripPayloadInspector") << "## Exercising Noise plots " << std::endl; @@ -98,8 +99,8 @@ int main(int argc, char** argv) { // Pedestals tag = "SiStripPedestals_v2_prompt"; - start = boost::lexical_cast(303420); - end = boost::lexical_cast(313120); + start = static_cast(303420); + end = static_cast(313120); edm::LogPrint("testSiStripPayloadInspector") << "## Exercising Pedestal plots " << std::endl; @@ -112,7 +113,8 @@ int main(int argc, char** argv) { edm::LogPrint("testSiStripPayloadInspector") << histo11.data() << std::endl; SiStripPedestalPerDetId histoPedestalForDetId; - inputs["DetIds"] += ",470065830,369121594,369124670,470177668"; // add a bunch of other DetIds + inputs["DetIds"] = py::cast(inputs["DetIds"]) + + ",470065830,369121594,369124670,470177668"; // add a bunch of other DetIds histoPedestalForDetId.setInputParamValues(inputs); histoPedestalForDetId.process(connectionString, PI::mk_input(tag, start, start)); edm::LogPrint("testSiStripPayloadInspector") << histoPedestalForDetId.data() << std::endl; @@ -120,8 +122,8 @@ int main(int argc, char** argv) { //Latency tag = "SiStripLatency_v2_prompt"; - start = boost::lexical_cast(315347); - end = boost::lexical_cast(316675); + start = static_cast(315347); + end = static_cast(316675); edm::LogPrint("testSiStripPayloadInspector") << "## Exercising Latency plots " << std::endl; @@ -135,8 +137,8 @@ int main(int argc, char** argv) { //Threshold tag = "SiStripThreshold_v1_prompt"; - start = boost::lexical_cast(315352); - end = boost::lexical_cast(315460); + start = static_cast(315352); + end = static_cast(315460); edm::LogPrint("testSiStripPayloadInspector") << "## Exercising Threshold plots " << std::endl; @@ -146,8 +148,8 @@ int main(int argc, char** argv) { // test SiStripTkMaps tag = "SiStripBadComponents_startupMC_for2017_v1_mc"; - start = boost::lexical_cast(1); - end = boost::lexical_cast(1); + start = static_cast(1); + end = static_cast(1); edm::LogPrint("testSiStripPayloadInspector") << "## Exercising SiStripTkMaps plots " << std::endl; diff --git a/CondCore/Utilities/BuildFile.xml b/CondCore/Utilities/BuildFile.xml index eca5755e41a15..c107dfe203abb 100644 --- a/CondCore/Utilities/BuildFile.xml +++ b/CondCore/Utilities/BuildFile.xml @@ -2,7 +2,6 @@ - diff --git a/CondCore/Utilities/bin/conddb_test_gt_perf.cpp b/CondCore/Utilities/bin/conddb_test_gt_perf.cpp index f9ddb33cb5bed..c2ebecd795130 100644 --- a/CondCore/Utilities/bin/conddb_test_gt_perf.cpp +++ b/CondCore/Utilities/bin/conddb_test_gt_perf.cpp @@ -2,8 +2,6 @@ #include "CondCore/CondDB/interface/IOVProxy.h" #include "CondCore/CondDB/interface/GTProxy.h" -#include "CondCore/CondDB/src/IOVSchema.cc" - #include "CondCore/Utilities/interface/Utilities.h" #include "CondCore/Utilities/interface/CondDBImport.h" #include @@ -189,12 +187,6 @@ bool cond::UntypedPayloadProxy::get(cond::Time_t targetTime, bool debug) { if (debug) std::cout << "Loaded payload of type \"" << payloadType << "\" (" << m_buffer.size() << " bytes)" << std::endl; } - // check if hash is correct: - cond::Hash localHash = cond::persistency::makeHash(payloadType, m_buffer); - if (localHash != m_data->current.payloadId) { - std::cout << "ERROR: payload of type " << payloadType << " with id " << m_data->current.payloadId - << " in DB has wrong local hash: " << localHash << std::endl; - } } return loaded; } diff --git a/CondCore/Utilities/bin/conddb_test_read.cpp b/CondCore/Utilities/bin/conddb_test_read.cpp index a4024d9fac3b7..2cbb9d44c4672 100644 --- a/CondCore/Utilities/bin/conddb_test_read.cpp +++ b/CondCore/Utilities/bin/conddb_test_read.cpp @@ -53,7 +53,7 @@ int cond::TestReadUtilities::execute() { std::string siovs = getOptionValue("iovs"); tokenizer tok(siovs); for (auto &t : tok) { - iovs.push_back(boost::lexical_cast(t)); + iovs.push_back(std::stoull(t)); } } diff --git a/CondCore/Utilities/interface/PayloadInspector.h b/CondCore/Utilities/interface/PayloadInspector.h index 11d873675082d..b2b0ae11b76f5 100644 --- a/CondCore/Utilities/interface/PayloadInspector.h +++ b/CondCore/Utilities/interface/PayloadInspector.h @@ -9,30 +9,33 @@ #include #include #include +#include #include #include "FWCore/Utilities/interface/GlobalIdentifier.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" -#include -#include -#include +#include +#include +namespace py = pybind11; namespace PI { - inline boost::python::list mk_input(const std::string& tagName, cond::Time_t start, cond::Time_t end) { - boost::python::list ret; - ret.append(boost::python::make_tuple(tagName, std::to_string(start), std::to_string(end))); + __attribute__((visibility("default"))) inline py::list mk_input(const std::string& tagName, + cond::Time_t start, + cond::Time_t end) { + py::list ret; + ret.append(py::make_tuple(tagName, std::to_string(start), std::to_string(end))); return ret; } - inline boost::python::list mk_input(const std::string& tagName0, - cond::Time_t start0, - cond::Time_t end0, - const std::string& tagName1, - cond::Time_t start1, - cond::Time_t end1) { - boost::python::list ret; - ret.append(boost::python::make_tuple(tagName0, std::to_string(start0), std::to_string(end0))); - ret.append(boost::python::make_tuple(tagName1, std::to_string(start1), std::to_string(end1))); + __attribute__((visibility("default"))) inline py::list mk_input(const std::string& tagName0, + cond::Time_t start0, + cond::Time_t end0, + const std::string& tagName1, + cond::Time_t start1, + cond::Time_t end1) { + py::list ret; + ret.append(py::make_tuple(tagName0, std::to_string(start0), std::to_string(end0))); + ret.append(py::make_tuple(tagName1, std::to_string(start1), std::to_string(end1))); return ret; } } // namespace PI @@ -228,16 +231,17 @@ namespace cond { bool isSingleIov() const; // required in the browser - boost::python::list inputParams() const; + __attribute__((visibility("default"))) py::list inputParams() const; // required in the browser - void setInputParamValues(const boost::python::dict& values); + __attribute__((visibility("default"))) void setInputParamValues(const py::dict& values); // returns the json file with the plot data std::string data() const; // triggers the processing producing the plot - bool process(const std::string& connectionString, const boost::python::list& tagsWithTimeBoundaries); + __attribute__((visibility("default"))) bool process(const std::string& connectionString, + const py::list& tagsWithTimeBoundaries); // called by the above method - to be used in C++ unit tests... bool exec_process(const std::string& connectionString, diff --git a/CondCore/Utilities/interface/PayloadInspectorModule.h b/CondCore/Utilities/interface/PayloadInspectorModule.h index 2dfa41c534671..a2f71dfbfa3f6 100644 --- a/CondCore/Utilities/interface/PayloadInspectorModule.h +++ b/CondCore/Utilities/interface/PayloadInspectorModule.h @@ -1,18 +1,21 @@ -#include +#include +namespace py = pybind11; #define PPCAT_NX(A, B) A##B #define PPCAT(A, B) PPCAT_NX(A, B) #define STRINGIZE_NX(A) #A #define STRINGIZE(A) STRINGIZE_NX(A) -#define PAYLOAD_INSPECTOR_MODULE(PAYLOAD_TYPENAME) BOOST_PYTHON_MODULE(plugin##PAYLOAD_TYPENAME##_PayloadInspector) +#define PAYLOAD_INSPECTOR_MODULE(PAYLOAD_TYPENAME) PYBIND11_MODULE(plugin##PAYLOAD_TYPENAME##_PayloadInspector, m) -#define PAYLOAD_INSPECTOR_CLASS(CLASS_NAME) \ - boost::python::class_ >( \ - STRINGIZE(PPCAT(plot_, CLASS_NAME)), boost::python::init<>()) \ - .def("process", &cond::payloadInspector::PlotBase::process) \ - .def("payloadType", &cond::payloadInspector::PlotBase::payloadType) \ - .def("title", &cond::payloadInspector::PlotBase::title) \ - .def("isSingleIov", &cond::payloadInspector::PlotBase::isSingleIov) \ - .def("isTwoTags", &cond::payloadInspector::PlotBase::isTwoTags) \ +#define PAYLOAD_INSPECTOR_CLASS(CLASS_NAME) \ + py::class_( \ + m, \ + STRINGIZE(PPCAT(plot_, CLASS_NAME))) \ + .def(py::init<>()) \ + .def("process", &cond::payloadInspector::PlotBase::process) \ + .def("payloadType", &cond::payloadInspector::PlotBase::payloadType) \ + .def("title", &cond::payloadInspector::PlotBase::title) \ + .def("isSingleIov", &cond::payloadInspector::PlotBase::isSingleIov) \ + .def("isTwoTags", &cond::payloadInspector::PlotBase::isTwoTags) \ .def("data", &cond::payloadInspector::PlotBase::data); diff --git a/CondCore/Utilities/plugins/BasicP_PayloadInspector.cc b/CondCore/Utilities/plugins/BasicP_PayloadInspector.cc index 35a4a52429b79..fbcd8389f8b9d 100644 --- a/CondCore/Utilities/plugins/BasicP_PayloadInspector.cc +++ b/CondCore/Utilities/plugins/BasicP_PayloadInspector.cc @@ -34,15 +34,15 @@ namespace { auto paramValues = cond::payloadInspector::PlotBase::inputParamValues(); auto ip = paramValues.find("Factor"); if (ip != paramValues.end()) { - v = v * boost::lexical_cast(ip->second); + v = v * std::stof(ip->second); } ip = paramValues.find("Offset"); if (ip != paramValues.end()) { - v = v + boost::lexical_cast(ip->second); + v = v + std::stof(ip->second); } ip = paramValues.find("Scale"); if (ip != paramValues.end()) { - v = v * boost::lexical_cast(ip->second); + v = v * std::stof(ip->second); } return v; } diff --git a/CondCore/Utilities/plugins/BuildFile.xml b/CondCore/Utilities/plugins/BuildFile.xml index a102433193fa1..122db196be4f8 100644 --- a/CondCore/Utilities/plugins/BuildFile.xml +++ b/CondCore/Utilities/plugins/BuildFile.xml @@ -12,12 +12,13 @@ - + + diff --git a/CondCore/Utilities/plugins/Module_2XML.cc b/CondCore/Utilities/plugins/Module_2XML.cc index deae196480a72..56b17db53b8a5 100644 --- a/CondCore/Utilities/plugins/Module_2XML.cc +++ b/CondCore/Utilities/plugins/Module_2XML.cc @@ -30,6 +30,9 @@ PAYLOAD_2XML_MODULE(pluginUtilities_payload2xml) { PAYLOAD_2XML_CLASS(CTPPSPixelAnalysisMask); PAYLOAD_2XML_CLASS(CTPPSPixelDAQMapping); PAYLOAD_2XML_CLASS(CTPPSPixelGainCalibrations); + PAYLOAD_2XML_CLASS(PPSAlignmentConfig) + PAYLOAD_2XML_CLASS(PPSAlignmentConfiguration) + PAYLOAD_2XML_CLASS(PPSAssociationCuts) PAYLOAD_2XML_CLASS(CastorChannelQuality); PAYLOAD_2XML_CLASS(CastorElectronicsMap); PAYLOAD_2XML_CLASS(CastorGainWidths); diff --git a/CondCore/Utilities/plugins/Module_PayloadInspector.cc b/CondCore/Utilities/plugins/Module_PayloadInspector.cc index 7b7817534709b..6d8d82f732f46 100644 --- a/CondCore/Utilities/plugins/Module_PayloadInspector.cc +++ b/CondCore/Utilities/plugins/Module_PayloadInspector.cc @@ -1,11 +1,11 @@ #include "CondCore/Utilities/interface/PayloadInspector.h" -#include -#include +#include +namespace py = pybind11; -BOOST_PYTHON_MODULE(pluginModule_PayloadInspector) { - boost::python::class_("ModuleVersion") - .def_readonly("label", &cond::payloadInspector::ModuleVersion::label); - boost::python::class_("PlotBase") +PYBIND11_MODULE(pluginModule_PayloadInspector, m) { + py::class_(m, "ModuleVersion") + .def_readonly_static("label", &cond::payloadInspector::ModuleVersion::label); + py::class_(m, "PlotBase") .def("process", &cond::payloadInspector::PlotBase::process) .def("payloadType", &cond::payloadInspector::PlotBase::payloadType) .def("type", &cond::payloadInspector::PlotBase::type) diff --git a/CondCore/Utilities/python/CondDBFW/command_line.py b/CondCore/Utilities/python/CondDBFW/command_line.py index 73074e65e6fd8..4462fbb7285b0 100755 --- a/CondCore/Utilities/python/CondDBFW/command_line.py +++ b/CondCore/Utilities/python/CondDBFW/command_line.py @@ -5,8 +5,6 @@ Works by taking the main keyword (first command given to the script), passing that to the function that will deal with that action, along with the following arguments as parameters for that function. """ -from __future__ import print_function -from __future__ import absolute_import from . import querying import argparse @@ -112,7 +110,7 @@ def copy_tag(arguments): # set end_of_validity to -1 because sqlite doesn't support long ints source_tag.end_of_validity = -1 source_tag.name = arguments.dest_tag - source_tag.modification_time = datetime.datetime.now() + source_tag.modification_time = datetime.datetime.utcnow() # create new iovs new_iovs = [] @@ -154,7 +152,7 @@ def copy_global_tag(arguments): tags = source_connection.tag(name=tags) # copy global tag first - global_tag.insertion_time = datetime.datetime.now() + global_tag.insertion_time = datetime.datetime.utcnow() global_tag.validity = -1 dest_connection.write_and_commit(global_tag) diff --git a/CondCore/Utilities/python/CondDBFW/data_formats.py b/CondCore/Utilities/python/CondDBFW/data_formats.py index e21a369c00911..4e5daadb36144 100644 --- a/CondCore/Utilities/python/CondDBFW/data_formats.py +++ b/CondCore/Utilities/python/CondDBFW/data_formats.py @@ -6,7 +6,6 @@ Note: may also contain a decorator that can wrap a class around a function that contains a script (future development). """ -from __future__ import absolute_import from .data_sources import json_data_node, json_list, json_dict, json_basic @@ -30,7 +29,7 @@ def to_datatables(script): def new_script(self, connection): try: data = script(self, connection) - if(isinstance(data, list)): + if(type(data) == list): data = _json_data_node.make(data) return to_datatables(data) except (KeyError, TypeError) as e: @@ -64,19 +63,19 @@ def _to_array_of_dicts(data): headers = data.get("headers").data() data_list = data.get("data").data() def unicode_to_str(string): - return str(string) if isinstance(string, unicode) else string - headers = map(unicode_to_str, headers) + return str(string) if type(string) == str else string + headers = list(map(unicode_to_str, headers)) def row_to_dict(row): - row = map(unicode_to_str, row) - return dict(zip(headers, row)) - array_of_dicts = map(row_to_dict, data_list) + row = list(map(unicode_to_str, row)) + return dict(list(zip(headers, row))) + array_of_dicts = list(map(row_to_dict, data_list)) return json_data_node.make(array_of_dicts) def _to_datatables(data): - headers = map(str, data.get(0).data().keys()) + headers = list(map(str, list(data.get(0).data().keys()))) new_data = [] for n in range(0, len(data.data())): - new_data.append(map(lambda entry : str(entry) if isinstance(entry, unicode) else entry, data.get(n).data().values())) + new_data.append([str(entry) if type(entry) == str else entry for entry in list(data.get(n).data().values())]) return json_data_node.make({ "headers" : headers, "data" : new_data diff --git a/CondCore/Utilities/python/CondDBFW/data_sources.py b/CondCore/Utilities/python/CondDBFW/data_sources.py index 2737308574dcc..1ad43a4d00255 100644 --- a/CondCore/Utilities/python/CondDBFW/data_sources.py +++ b/CondCore/Utilities/python/CondDBFW/data_sources.py @@ -3,8 +3,6 @@ This file contains the base DataSource class, and all sub classes that implement their own methods for parsing data. """ -from __future__ import print_function -from __future__ import absolute_import import json @@ -107,7 +105,7 @@ def __init__(self, sqlite_file_name): sql_query = "select %s from %s" % (column_string, table) results = cursor.execute(sql_query).fetchall() for n in range(0, len(results)): - results[n] = dict(zip(table_to_columns[table], map(str, results[n]))) + results[n] = dict(list(zip(table_to_columns[table], list(map(str, results[n]))))) table_to_data[str(table)] = results self._data = json_data_node.make(table_to_data) else: @@ -129,9 +127,9 @@ def __init__(self, data=None): # be created in code that shouldn't be doing it. @staticmethod def make(data): - if isinstance(data, list): + if type(data) == list: return json_list(data) - elif isinstance(data, dict): + elif type(data) == dict: return json_dict(data) else: return json_basic(data) @@ -159,12 +157,12 @@ def find(self, type_name): # traverse json_data_node structure, and find all lists # if this node in the structure is a list, return all sub lists lists = [] - if isinstance(self._data, type_name): + if type(self._data) == type_name: lists.append(self._data) - if isinstance(self._data, list): + if type(self._data) == list: for item in self._data: lists += json_data_node.make(item).find(type_name) - elif isinstance(self._data, dict): + elif type(self._data) == dict: for key in self._data: lists += json_data_node.make(self._data[key]).find(type_name) return lists @@ -198,7 +196,7 @@ def add_child(self, data): def __iter__(self): return self - def next(self): + def __next__(self): if self.iterator_index > len(self._data)-1: self.reset() raise StopIteration @@ -227,13 +225,13 @@ def indices(self, *indices): def get_members(self, member_name): # assume self.data() is a list - if not(type(member_name) in [str, unicode]): + if not(type(member_name) in [str, str]): raise TypeError("Value given for member name must be a string.") type_of_first_item = self.data()[0].__class__ for item in self.data(): if item.__class__ != type_of_first_item: return None - return json_data_node.make(map(lambda item : getattr(item, member_name), self.data())) + return json_data_node.make([getattr(item, member_name) for item in self.data()]) # format methods @@ -245,7 +243,7 @@ def as_dicts(self, convert_timestamps=False): if self.get(0).data().__class__.__name__ in ["GlobalTag", "GlobalTagMap", "Tag", "IOV", "Payload"]: # copy data - new_data = map(lambda item : item.as_dicts(convert_timestamps=convert_timestamps), [item for item in self.data()]) + new_data = [item.as_dicts(convert_timestamps=convert_timestamps) for item in [item for item in self.data()]] return new_data else: print("Data in json_list was not the correct type.") @@ -281,7 +279,7 @@ def as_table(self, fit=["all"], columns=None, hide=None, col_width=None, row_num table_name = None data = self.data() # gets headers stored in first dictionary - headers = data[0].keys() + headers = list(data[0].keys()) if columns != None: headers = columns @@ -298,7 +296,7 @@ def as_table(self, fit=["all"], columns=None, hide=None, col_width=None, row_num if col_width == None: import subprocess - table_width = int(0.95*int(subprocess.check_output(["stty", "size"]).split(" ")[1])) + table_width = int(0.95*int(subprocess.check_output([b'stty', b'size']).split(b' ')[1])) col_width = int(table_width/len(headers)) if hide != None: @@ -335,7 +333,7 @@ def cell(content, header, col_width, fit): for column in fit: if not(column in headers): - print("'%s' is not a valid column." % column) + print(("'%s' is not a valid column." % column)) return column_to_width[column] = max_width_of_column(column, data) diff --git a/CondCore/Utilities/python/CondDBFW/models.py b/CondCore/Utilities/python/CondDBFW/models.py index ca8f783445122..ee9c2773da8fb 100644 --- a/CondCore/Utilities/python/CondDBFW/models.py +++ b/CondCore/Utilities/python/CondDBFW/models.py @@ -8,8 +8,6 @@ so these will not work in a normal context outside the framework. """ -from __future__ import print_function -from __future__ import absolute_import import json import datetime @@ -24,7 +22,7 @@ exit() from . import data_sources, data_formats -import urllib, urllib2, base64 +import urllib.request, urllib.parse, urllib.error, urllib.request, urllib.error, urllib.parse, base64 from copy import deepcopy # get utility functions @@ -50,8 +48,8 @@ def session_independent_object(object, schema=None): return new_object def session_independent(objects): - if isinstance(objects, list): - return map(session_independent_object, objects) + if type(objects) == list: + return list(map(session_independent_object, objects)) else: # assume objects is a single object (not a list) return session_independent_object(objects) @@ -153,9 +151,9 @@ def apply(self): def apply_filter(orm_query, orm_class, attribute, value): filter_attribute = getattr(orm_class, attribute) - if isinstance(value, list): + if type(value) == list: orm_query = orm_query.filter(filter_attribute.in_(value)) - elif isinstance(value, data_sources.json_list): + elif type(value) == data_sources.json_list: orm_query = orm_query.filter(filter_attribute.in_(value.data())) elif type(value) in [Range, Radius]: @@ -163,7 +161,7 @@ def apply_filter(orm_query, orm_class, attribute, value): plus = value.get_end() orm_query = orm_query.filter(and_(filter_attribute >= minus, filter_attribute <= plus)) - elif isinstance(value, RegExp): + elif type(value) == RegExp: # Relies on being a SingletonThreadPool @@ -181,7 +179,7 @@ def apply_filter(orm_query, orm_class, attribute, value): return orm_query def apply_filters(orm_query, orm_class, **filters): - for (key, value) in filters.items(): + for (key, value) in list(filters.items()): if not(key in ["amount"]): orm_query = apply_filter(orm_query, orm_class, key, value) return orm_query @@ -189,8 +187,11 @@ def apply_filters(orm_query, orm_class, **filters): def generate(map_blobs=False, class_name=None): Base = declarative_base() + schema = {"schema" : "CMS_CONDITIONS"} + fk_schema_prefix = ("%s." % schema["schema"]) if schema else "" class GlobalTag(Base): + __table_args__ = schema __tablename__ = 'GLOBAL_TAG' headers = ["name", "validity", "description", "release", "insertion_time", "snapshot_time", "scenario", "workflow", "type"] @@ -246,7 +247,7 @@ def all(self, **kwargs): """ query = self.session.query(GlobalTag) query = apply_filters(query, self.__class__, **kwargs) - amount = kwargs["amount"] if "amount" in kwargs.keys() else None + amount = kwargs["amount"] if "amount" in list(kwargs.keys()) else None query_result = query.order_by(GlobalTag.name).limit(amount).all() gts = data_sources.json_data_node.make(query_result) return gts @@ -258,10 +259,10 @@ def tags(self, **kwargs): kwargs["global_tag_name"] = self.name all_tags = self.session.query(GlobalTagMap.global_tag_name, GlobalTagMap.record, GlobalTagMap.label, GlobalTagMap.tag_name) all_tags = apply_filters(all_tags, GlobalTagMap, **kwargs) - amount = kwargs["amount"] if "amount" in kwargs.keys() else None + amount = kwargs["amount"] if "amount" in list(kwargs.keys()) else None all_tags = all_tags.order_by(GlobalTagMap.tag_name).limit(amount).all() column_names = ["global_tag_name", "record", "label", "tag_name"] - all_tags = map(lambda row : dict(zip(column_names, map(to_timestamp, row))), all_tags) + all_tags = [dict(list(zip(column_names, list(map(to_timestamp, row))))) for row in all_tags] all_tags = data_formats._dicts_to_orm_objects(GlobalTagMap, all_tags) return data_sources.json_data_node.make(all_tags) @@ -281,7 +282,7 @@ def iovs(self, **kwargs): tag_names = self.tags().get_members("tag_name").data() iovs_all_tags = self.session.query(IOV).filter(IOV.tag_name.in_(tag_names)) iovs_all_tags = apply_filters(iovs_all_tags, IOV, **kwargs) - amount = kwargs["amount"] if "amount" in kwargs.keys() else None + amount = kwargs["amount"] if "amount" in list(kwargs.keys()) else None iovs_all_tags = iovs_all_tags.limit(amount).subquery() # now, join Global Tag Map table onto IOVs @@ -293,7 +294,7 @@ def iovs(self, **kwargs): iovs_gt_tags = iovs_gt_tags.order_by(iovs_all_tags.c.since).all() column_names = ["tag_name", "since", "payload_hash", "insertion_time"] - all_iovs = map(lambda row : dict(zip(column_names, row)), iovs_gt_tags) + all_iovs = [dict(list(zip(column_names, row))) for row in iovs_gt_tags] all_iovs = data_formats._dicts_to_orm_objects(IOV, all_iovs) return data_sources.json_data_node.make(all_iovs) @@ -335,14 +336,15 @@ def diff(self, gt): return data_sources.json_data_node.make(table) class GlobalTagMap(Base): + __table_args__ = schema __tablename__ = 'GLOBAL_TAG_MAP' headers = ["global_tag_name", "record", "label", "tag_name"] - global_tag_name = Column(String(100), ForeignKey('GLOBAL_TAG.name'), primary_key=True, nullable=False) - record = Column(String(100), ForeignKey('RECORDS.record'), primary_key=True, nullable=False) + global_tag_name = Column(String(100), ForeignKey(fk_schema_prefix + 'GLOBAL_TAG.name'), primary_key=True, nullable=False) + record = Column(String(100), ForeignKey(fk_schema_prefix + 'RECORDS.record'), primary_key=True, nullable=False) label = Column(String(100), primary_key=True, nullable=False) - tag_name = Column(String(100), ForeignKey('TAG.name'), nullable=False) + tag_name = Column(String(100), ForeignKey(fk_schema_prefix + 'TAG.name'), nullable=False) def __init__(self, dictionary={}, convert_timestamps=True): # assign each entry in a kwargs @@ -372,11 +374,12 @@ def as_dicts(self, convert_timestamps=False): class GlobalTagMapRequest(Base): + __table_args__ = schema __tablename__ = 'GLOBAL_TAG_MAP_REQUEST' queue = Column(String(100), primary_key=True, nullable=False) - tag = Column(String(100), ForeignKey('TAG.name'), primary_key=True, nullable=False) - record = Column(String(100), ForeignKey('RECORDS.record'), primary_key=True, nullable=False) + tag = Column(String(100), ForeignKey(fk_schema_prefix + 'TAG.name'), primary_key=True, nullable=False) + record = Column(String(100), ForeignKey(fk_schema_prefix + 'RECORDS.record'), primary_key=True, nullable=False) label = Column(String(100), primary_key=True, nullable=False) status = Column(String(1), nullable=False) description = Column(String(4000), nullable=False) @@ -420,13 +423,14 @@ def to_array(self): return [self.queue, self.tag, self.record, self.label, status_full_name(self.status), to_timestamp(self.time_submitted), to_timestamp(self.last_edited)] class IOV(Base): + __table_args__ = schema __tablename__ = 'IOV' headers = ["tag_name", "since", "payload_hash", "insertion_time"] - tag_name = Column(String(4000), ForeignKey('TAG.name'), primary_key=True, nullable=False) + tag_name = Column(String(4000), ForeignKey(fk_schema_prefix + 'TAG.name'), primary_key=True, nullable=False) since = Column(Integer, primary_key=True, nullable=False) - payload_hash = Column(String(40), ForeignKey('PAYLOAD.hash'), nullable=False) + payload_hash = Column(String(40), ForeignKey(fk_schema_prefix + 'PAYLOAD.hash'), nullable=False) insertion_time = Column(DateTime, primary_key=True, nullable=False) def __init__(self, dictionary={}, convert_timestamps=True): @@ -463,12 +467,13 @@ def all(self, **kwargs): """ query = self.session.query(IOV) query = apply_filters(query, IOV, **kwargs) - amount = kwargs["amount"] if "amount" in kwargs.keys() else None + amount = kwargs["amount"] if "amount" in list(kwargs.keys()) else None query_result = query.order_by(IOV.tag_name).order_by(IOV.since).limit(amount).all() return data_sources.json_data_node.make(query_result) class Payload(Base): + __table_args__ = schema __tablename__ = 'PAYLOAD' headers = ["hash", "object_type", "version", "insertion_time"] @@ -536,8 +541,8 @@ def parent_tags(self, **kwargs): query = self.session.query(IOV.tag_name) query = apply_filters(query, IOV, **kwargs) query_result = query.all() - tag_names = map(lambda entry : entry[0], query_result) - amount = kwargs["amount"] if "amount" in kwargs.keys() else None + tag_names = [entry[0] for entry in query_result] + amount = kwargs["amount"] if "amount" in list(kwargs.keys()) else None tags = self.session.query(Tag).filter(Tag.name.in_(tag_names)).order_by(Tag.name).limit(amount).all() return data_sources.json_data_node.make(tags) @@ -547,12 +552,13 @@ def all(self, **kwargs): """ query = self.session.query(Payload) query = apply_filters(query, Payload, **kwargs) - amount = kwargs["amount"] if "amount" in kwargs.keys() else None + amount = kwargs["amount"] if "amount" in list(kwargs.keys()) else None query_result = query.order_by(Payload.hash).limit(amount).all() return data_sources.json_data_node.make(query_result) class Record(Base): + __table_args__ = schema __tablename__ = 'RECORDS' headers = ["record", "object", "type"] @@ -583,16 +589,17 @@ def all(self, **kwargs): """ query = self.session.query(Record) query = apply_filters(query, Record, kwargs) - amount = kwargs["amount"] if "amount" in kwargs.keys() else None + amount = kwargs["amount"] if "amount" in list(kwargs.keys()) else None query_result = query.order_by(Record.record).limit(amount).all() return data_sources.json_data_node.make(query_result) class Tag(Base): + __table_args__ = schema __tablename__ = 'TAG' headers = ["name", "time_type", "object_type", "synchronization", "end_of_validity",\ - "description", "last_validated_time", "insertion_time", "modification_time"] + "description", "last_validated_time", "insertion_time", "modification_time", "protection_code"] name = Column(String(4000), primary_key=True, nullable=False) time_type = Column(String(4000), nullable=False) @@ -603,6 +610,7 @@ class Tag(Base): last_validated_time = Column(BigInteger, nullable=False) insertion_time = Column(DateTime, nullable=False) modification_time = Column(DateTime, nullable=False) + protection_code = Column(Integer, nullable=False) record = None label = None @@ -656,8 +664,8 @@ def parent_global_tags(self, **kwargs): query = apply_filters(query, GlobalTagMap, **kwargs) query_result = query.all() if len(query_result) != 0: - global_tag_names = map(lambda entry : entry[0], query_result) - amount = kwargs["amount"] if "amount" in kwargs.keys() else None + global_tag_names = [entry[0] for entry in query_result] + amount = kwargs["amount"] if "amount" in list(kwargs.keys()) else None global_tags = self.session.query(GlobalTag).filter(GlobalTag.name.in_(global_tag_names)).order_by(GlobalTag.name).limit(amount).all() else: global_tags = None @@ -669,7 +677,7 @@ def all(self, **kwargs): """ query = self.session.query(Tag) query = apply_filters(query, Tag, **kwargs) - amount = kwargs["amount"] if "amount" in kwargs.keys() else None + amount = kwargs["amount"] if "amount" in list(kwargs.keys()) else None query_result = query.order_by(Tag.name).limit(amount).all() return data_sources.json_data_node.make(query_result) @@ -680,7 +688,7 @@ def iovs(self, **kwargs): # filter_params contains a list of columns to filter the iovs by iovs_query = self.session.query(IOV).filter(IOV.tag_name == self.name) iovs_query = apply_filters(iovs_query, IOV, **kwargs) - amount = kwargs["amount"] if "amount" in kwargs.keys() else None + amount = kwargs["amount"] if "amount" in list(kwargs.keys()) else None iovs = iovs_query.order_by(IOV.since).limit(amount).all() return data_sources.json_data_node.make(iovs) @@ -738,8 +746,8 @@ def diff(self, tag, short=False): raise TypeError("Tag given must be a CondDBFW Tag object.") # get lists of iovs - iovs1 = dict(map(lambda iov : (iov.since, iov.payload_hash), self.iovs().data())) - iovs2 = dict(map(lambda iov : (iov.since, iov.payload_hash), tag.iovs().data())) + iovs1 = dict([(iov.since, iov.payload_hash) for iov in self.iovs().data()]) + iovs2 = dict([(iov.since, iov.payload_hash) for iov in tag.iovs().data()]) iovs = [(x, iovs1.get(x), iovs2.get(x)) for x in sorted(set(iovs1) | set(iovs2))] iovs.append(("Infinity", 1, 2)) @@ -851,7 +859,7 @@ def merge_into(self, tag, range_object): else: # otherwise, iterate down from n to find the last sqlite iov, # and assign that hash - for i in reversed(range(0,n)): + for i in reversed(list(range(0,n))): if new_iovs_list[i].source == "sqlite": print("change %s to %s at since %d" % (iov.payload_hash, new_iovs_list[i].payload_hash, iov.since)) iov.payload_hash = new_iovs_list[i].payload_hash @@ -867,7 +875,7 @@ def merge_into(self, tag, range_object): new_iov_list_copied = sorted(new_iov_list_copied, key=lambda iov : iov.since) - now = datetime.datetime.now() + now = datetime.datetime.utcnow() new_iovs = [] for iov in new_iov_list_copied: @@ -881,8 +889,47 @@ def merge_into(self, tag, range_object): return new_tag #sqlite.write_and_commit(new_iovs) + + class TagAuthorization(Base): + __table_args__ = schema + __tablename__ = 'TAG_AUTHORIZATION' + + headers = ["tag_name", "access_type", "credential", "credential_type"] + + tag_name = Column(String(100), ForeignKey(fk_schema_prefix + 'TAG.name'), primary_key=True, nullable=False) + access_type = Column(Integer, nullable=False) + credential = Column(String(100), primary_key=True, nullable=False) + credential_type = Column(Integer, nullable=False) + + def as_dicts(self): + """ + Returns dictionary form of this Tag Authorization. + """ + return { + "tag_name" : self.tag_name, + "access_type" : self.access_type, + "credential" : self.credential, + "credential_type" : self.credential_type + } + + def __repr__(self): + return '' % (self.tag_name, self.access_type, self.credential, self.credential_type) + + def to_array(self): + return [self.tag_name, self.access_type, self.credential, self.credential_type] + + def all(self, **kwargs): + """ + Returns `amount` Records ordered by Record record. + """ + query = self.session.query(TagAuthorization) + query = apply_filters(query, TagAuthorization, kwargs) + amount = kwargs["amount"] if "amount" in list(kwargs.keys()) else None + query_result = query.order_by(TagAuthorization.tag).limit(amount).all() + return data_sources.json_data_node.make(query_result) + classes = {"globaltag" : GlobalTag, "iov" : IOV, "globaltagmap" : GlobalTagMap,\ - "payload" : Payload, "tag" : Tag, "Base" : Base} + "payload" : Payload, "tag" : Tag, "TagAuthorization": TagAuthorization, "Base" : Base} if class_name == None: return classes diff --git a/CondCore/Utilities/python/CondDBFW/querying.py b/CondCore/Utilities/python/CondDBFW/querying.py index d7d3528a8e7db..1de2aa3eaddd1 100644 --- a/CondCore/Utilities/python/CondDBFW/querying.py +++ b/CondCore/Utilities/python/CondDBFW/querying.py @@ -6,8 +6,6 @@ connection class can also take a pre-constructed engine - useful for web services. """ -from __future__ import print_function -from __future__ import absolute_import import sqlalchemy from sqlalchemy import create_engine, text, or_ @@ -23,436 +21,439 @@ import sys class connection(object): - engine = None - connection = None - session = None - connection_data = None - netrc_authenticators = None - secrets = None - """ + engine = None + connection = None + session = None + connection_data = None + netrc_authenticators = None + secrets = None + """ Given a connection string, parses the connection string and connects. """ - def __init__(self, connection_data, mode=None, map_blobs=False, secrets=None, pooling=False): - - self._pooling = pooling - - # add querying utility properties - # these must belong to the connection since the way in which their values are handled - # depends on the database being connected to. - self.range = models.Range - self.radius = models.Radius - self.regexp = models.RegExp - self.regexp.connection_object = self - - if type(connection_data) in [str, unicode]: - # if we've been given a connection string, process it - self.connection_data = new_connection_dictionary(connection_data, secrets=secrets, mode=mode) - self.schema = self.connection_data.get("schema") if self.connection_data.get("schema") != None else "" - - self.range.database_type = self.connection_data["host"] - self.radius.database_type = self.connection_data["host"] - self.regexp.database_type = self.connection_data["host"] - else: - self.connection_data = connection_data - # assume we have an engine - # we need to take the string representation so we know which type of db we're aiming at - engine_string = str(connection_data) - db_type = None - if "oracle" in engine_string: - db_type = "oracle" - elif "frontier" in engine_string: - db_type = "frontier" - elif "sqlite" in engine_string: - db_type = "sqlite" - - self.range.database_type = db_type - self.radius.database_type = db_type - self.regexp.database_type = db_type - - from . import models as ms - self.models = ms.generate(map_blobs) - #self.base = self.models["Base"] - - def setup(self): - """ - Setup engine with given credentials from netrc file, and make a session maker. - """ - - if isinstance(self.connection_data, dict): - self.engine = engine_from_dictionary(self.connection_data, pooling=self._pooling) - else: - # we've been given an engine by the user - # use it as the engine - self.engine = self.connection_data - - self.sessionmaker = sessionmaker(bind=self.engine) - self.session = self.sessionmaker() - self.factory = factory(self) - - # assign correct schema for database name to each model - tmp_models_dict = {} - for key in self.models: - if self.models[key].__class__ == sqlalchemy.ext.declarative.api.DeclarativeMeta\ - and str(self.models[key].__name__) != "Base": - - if isinstance(self.connection_data, dict): - # we can only extract the secrets and schema individuall - # if we were given a dictionary... if we were given an engine - # we can't do this without parsing the connection string from the engine - # - a wide range of which it will be difficult to support! - self.models[key].__table__.schema = self.connection_data["schema"] - self.models[key].secrets = self.connection_data["secrets"] - - self.models[key].session = self.session - # isn't used anywhere - comment it out for now - #self.models[key].authentication = self.netrc_authenticators - self.models[key].connection = self - tmp_models_dict[key.lower()] = self.models[key] - tmp_models_dict[key.lower()].empty = False - - self.models = tmp_models_dict - - return self - - @staticmethod - def _get_CMS_frontier_connection_string(database): - try: - import subprocess - return subprocess.Popen(['cmsGetFnConnect', 'frontier://%s' % database], stdout = subprocess.PIPE).communicate()[0].strip() - except: - raise Exception("Frontier connections can only be constructed when inside a CMSSW environment.") - - @staticmethod - def _cms_frontier_string(database, schema="cms_conditions"): - """ - Get database string for frontier. - """ - import urllib - return 'oracle+frontier://@%s/%s' % (urllib.quote_plus(connection._get_CMS_frontier_connection_string(database)), schema) - - @staticmethod - def _cms_oracle_string(user, pwd, db_name): - """ - Get database string for oracle. - """ - return 'oracle://%s:%s@%s' % (user, pwd, db_name) - - @staticmethod - def build_oracle_url(user, pwd, db_name): - """ - Build the connection url, and get credentials from self.secrets dictionary. - """ - - database_url = connection._cms_oracle_string(user, pwd, db_name) - - try: - url = sqlalchemy.engine.url.make_url(database_url) - if url.password is None: - url.password = pwd - except sqlalchemy.exc.ArgumentError: - url = sqlalchemy.engine.url.make_url('sqlite:///%s' % db_name) - return url - - @staticmethod - def build_frontier_url(db_name, schema): - database_url = connection._cms_frontier_string(db_name, schema) - - try: - url = sqlalchemy.engine.url.make_url(database_url) - except sqlalchemy.exc.ArgumentError: - """ - Is this needed for a use case? - """ - url = sqlalchemy.engine.url.make_url('sqlite:///%s' % db_name) - return url - - # currently just commits and closes the current session (ends transaction, closes connection) - # may do other things later - def tear_down(self): - try: - self.session.commit() - self.close_session() - except: - return "Couldn't tear down connection on engine %s." % str(self.engine) - - def close_session(self): - self.session.close() - return True - - def hard_close(self): - self.engine.dispose() - return True - - # get model based on given model name - def model(self, model_name): - if model_name.__class__ == sqlalchemy.ext.declarative.api.DeclarativeMeta: - model_name = model_name.__name__ - model_name = model_name.replace("_", "") - return self.models[model_name] - - # model should be the class the developer wants to be instantiated - # pk_to_value maps primary keys to values - def object(self, model, pk_to_value): - if self.session == None: - return None - model_data = self.session.query(model) - for pk in pk_to_value: - model_data = model_data.filter(model.__dict__[pk] == pk_to_value[pk]) - return model_data.first() - - def global_tag(self, **pkargs): - return self.factory.object("globaltag", **pkargs) - - def global_tag_map(self, **pkargs): - return self.factory.object("globaltagmap", **pkargs) - - """def global_tag_map_request(self, **pkargs): + def __init__(self, connection_data, mode=None, map_blobs=False, secrets=None, pooling=False): + + self._pooling = pooling + + # add querying utility properties + # these must belong to the connection since the way in which their values are handled + # depends on the database being connected to. + self.range = models.Range + self.radius = models.Radius + self.regexp = models.RegExp + self.regexp.connection_object = self + + if type(connection_data) in [str, str]: + # if we've been given a connection string, process it + self.connection_data = new_connection_dictionary(connection_data, secrets=secrets, mode=mode) + self.schema = self.connection_data.get("schema") if self.connection_data.get("schema") != None else "" + + self.range.database_type = self.connection_data["host"] + self.radius.database_type = self.connection_data["host"] + self.regexp.database_type = self.connection_data["host"] + else: + self.connection_data = connection_data + # assume we have an engine + # we need to take the string representation so we know which type of db we're aiming at + engine_string = str(connection_data) + db_type = None + if "oracle" in engine_string: + db_type = "oracle" + elif "frontier" in engine_string: + db_type = "frontier" + elif "sqlite" in engine_string: + db_type = "sqlite" + + self.range.database_type = db_type + self.radius.database_type = db_type + self.regexp.database_type = db_type + + from . import models as ms + self.models = ms.generate(map_blobs) + #self.base = self.models["Base"] + + def setup(self): + """ + Setup engine with given credentials from netrc file, and make a session maker. + """ + + if type(self.connection_data) == dict: + self.engine = engine_from_dictionary(self.connection_data, pooling=self._pooling) + else: + # we've been given an engine by the user + # use it as the engine + self.engine = self.connection_data + + self.sessionmaker = sessionmaker(bind=self.engine) + self.session = self.sessionmaker() + self.factory = factory(self) + + # assign correct schema for database name to each model + tmp_models_dict = {} + for key in self.models: + if self.models[key].__class__ == sqlalchemy.ext.declarative.api.DeclarativeMeta\ + and str(self.models[key].__name__) != "Base": + + if type(self.connection_data) == dict: + # we can only extract the secrets and schema individuall + # if we were given a dictionary... if we were given an engine + # we can't do this without parsing the connection string from the engine + # - a wide range of which it will be difficult to support! + self.models[key].__table__.schema = self.connection_data["schema"] + self.models[key].secrets = self.connection_data["secrets"] + + self.models[key].session = self.session + # isn't used anywhere - comment it out for now + #self.models[key].authentication = self.netrc_authenticators + self.models[key].connection = self + tmp_models_dict[key.lower()] = self.models[key] + tmp_models_dict[key.lower()].empty = False + + self.models = tmp_models_dict + + return self + + @staticmethod + def _get_CMS_frontier_connection_string(database): + try: + import subprocess + return subprocess.Popen(['cmsGetFnConnect', 'frontier://%s' % database], stdout = subprocess.PIPE).communicate()[0].strip() + except: + raise Exception("Frontier connections can only be constructed when inside a CMSSW environment.") + + @staticmethod + def _cms_frontier_string(database, schema="cms_conditions"): + """ + Get database string for frontier. + """ + import urllib.request, urllib.parse, urllib.error + return 'oracle+frontier://@%s/%s' % (urllib.parse.quote_plus(connection._get_CMS_frontier_connection_string(database)), schema) + + @staticmethod + def _cms_oracle_string(user, pwd, db_name): + """ + Get database string for oracle. + """ + return 'oracle://%s:%s@%s' % (user, pwd, db_name) + + @staticmethod + def build_oracle_url(user, pwd, db_name): + """ + Build the connection url, and get credentials from self.secrets dictionary. + """ + + database_url = connection._cms_oracle_string(user, pwd, db_name) + + try: + url = sqlalchemy.engine.url.make_url(database_url) + if url.password is None: + url.password = pwd + except sqlalchemy.exc.ArgumentError: + url = sqlalchemy.engine.url.make_url('sqlite:///%s' % db_name) + return url + + @staticmethod + def build_frontier_url(db_name, schema): + database_url = connection._cms_frontier_string(db_name, schema) + + try: + url = sqlalchemy.engine.url.make_url(database_url) + except sqlalchemy.exc.ArgumentError: + """ + Is this needed for a use case? + """ + url = sqlalchemy.engine.url.make_url('sqlite:///%s' % db_name) + return url + + # currently just commits and closes the current session (ends transaction, closes connection) + # may do other things later + def tear_down(self): + try: + self.session.commit() + self.close_session() + except: + return "Couldn't tear down connection on engine %s." % str(self.engine) + + def close_session(self): + self.session.close() + return True + + def hard_close(self): + self.engine.dispose() + return True + + # get model based on given model name + def model(self, model_name): + if model_name.__class__ == sqlalchemy.ext.declarative.api.DeclarativeMeta: + model_name = model_name.__name__ + model_name = model_name.replace("_", "") + return self.models[model_name] + + # model should be the class the developer wants to be instantiated + # pk_to_value maps primary keys to values + def object(self, model, pk_to_value): + if self.session == None: + return None + model_data = self.session.query(model) + for pk in pk_to_value: + model_data = model_data.filter(model.__dict__[pk] == pk_to_value[pk]) + return model_data.first() + + def global_tag(self, **pkargs): + return self.factory.object("globaltag", **pkargs) + + def global_tag_map(self, **pkargs): + return self.factory.object("globaltagmap", **pkargs) + + """def global_tag_map_request(self, **pkargs): return self.factory.object("globaltagmaprequest", **pkargs)""" - def tag(self, **pkargs): - return self.factory.object("tag", **pkargs) + def tag(self, **pkargs): + return self.factory.object("tag", **pkargs) + + def tag_authorization(self, **pkargs): + return self.factory.object("tagauthorization", **pkargs) - def iov(self, **pkargs): - return self.factory.object("iov", **pkargs) + def iov(self, **pkargs): + return self.factory.object("iov", **pkargs) - def payload(self, **pkargs): - return self.factory.object("payload", **pkargs) + def payload(self, **pkargs): + return self.factory.object("payload", **pkargs) - """def record(self, **pkargs): + """def record(self, **pkargs): return self.factory.object("record", **pkargs)""" - # adds %% at the beginning and end so LIKE in SQL searches all of the string - def _oracle_match_format(self, string): - return "%%%s%%" % string - - # returns dictionary mapping object type to a list of all objects found in the search - def search_everything(self, string, amount=10): - string = self._oracle_match_format(string) - - gt = self.model("globaltag") - global_tags = self.session.query(gt).filter(or_( - gt.name.ilike(string), - gt.description.ilike(string), - gt.release.ilike(string) - )).limit(amount) - tag = self.model("tag") - tags = self.session.query(tag).filter(or_( - tag.name.ilike(string), - tag.object_type.ilike(string), - tag.description.ilike(string)) - ).limit(amount) - iov = self.model("iov") - iovs = self.session.query(iov).filter(or_( - iov.tag_name.ilike(string), - iov.since.ilike(string), - iov.payload_hash.ilike(string), - iov.insertion_time.ilike(string) - )).limit(amount) - payload = self.model("payload") - payloads = self.session.query(payload).filter(or_( - payload.hash.ilike(string), - payload.object_type.ilike(string), - payload.insertion_time.ilike(string) - )).limit(amount) - - return json_data_node.make({ - "global_tags" : global_tags.all(), - "tags" : tags.all(), - "iovs" : iovs.all(), - "payloads" : payloads.all() - }) - - def write(self, object): - new_object = models.session_independent_object(object, schema=self.schema) - self.session.add(new_object) - return new_object - - def commit(self): - try: - self.session.commit() - except: - traceback.print_exc() - self.session.rollback() - - def write_and_commit(self, object): - if isinstance(object, list): - for item in object: - self.write_and_commit(item) - else: - # should be changed to deal with errors - add them to exception handling if they appear - self.write(object) - self.commit() - - def rollback(self): - try: - self.session.rollback() - except: - traceback.print_exc() - print("Session couldn't be rolled back.") + # adds %% at the beginning and end so LIKE in SQL searches all of the string + def _oracle_match_format(self, string): + return "%%%s%%" % string + + # returns dictionary mapping object type to a list of all objects found in the search + def search_everything(self, string, amount=10): + string = self._oracle_match_format(string) + + gt = self.model("globaltag") + global_tags = self.session.query(gt).filter(or_( + gt.name.ilike(string), + gt.description.ilike(string), + gt.release.ilike(string) + )).limit(amount) + tag = self.model("tag") + tags = self.session.query(tag).filter(or_( + tag.name.ilike(string), + tag.object_type.ilike(string), + tag.description.ilike(string)) + ).limit(amount) + iov = self.model("iov") + iovs = self.session.query(iov).filter(or_( + iov.tag_name.ilike(string), + iov.since.ilike(string), + iov.payload_hash.ilike(string), + iov.insertion_time.ilike(string) + )).limit(amount) + payload = self.model("payload") + payloads = self.session.query(payload).filter(or_( + payload.hash.ilike(string), + payload.object_type.ilike(string), + payload.insertion_time.ilike(string) + )).limit(amount) + + return json_data_node.make({ + "global_tags" : global_tags.all(), + "tags" : tags.all(), + "iovs" : iovs.all(), + "payloads" : payloads.all() + }) + + def write(self, object): + new_object = models.session_independent_object(object, schema=self.schema) + self.session.add(new_object) + return new_object + + def commit(self): + try: + self.session.commit() + except: + traceback.print_exc() + self.session.rollback() + + def write_and_commit(self, object): + if type(object) == list: + for item in object: + self.write_and_commit(item) + else: + # should be changed to deal with errors - add them to exception handling if they appear + self.write(object) + self.commit() + + def rollback(self): + try: + self.session.rollback() + except: + traceback.print_exc() + print("Session couldn't be rolled back.") class factory(): - """ - Contains methods for creating objects. - """ - def __init__(self, connection): - self.connection = connection - - # class_name is the class name of the model to be used - # pkargs is a dictionary of keyword arguments used as primary key values - # this dictionary will be used to populate the object of type name class_name - def object(self, class_name, **pkargs): - from .data_sources import json_list - from .models import apply_filters - # get the class that self.connection holds from the class name - model = self.connection.model(class_name) - - if self.connection.session == None: - return None - - # query for the ORM object, and return the appropriate object (None, CondDBFW object, or json_list) - model_data = self.connection.session.query(model) - if len(pkargs.items()) != 0: - # apply the filters defined in **kwargs - model_data = apply_filters(model_data, model, **pkargs) - amount = pkargs["amount"] if "amount" in pkargs.keys() else None - model_data = model_data.limit(amount) - if model_data.count() > 1: - # if we have multiple objects, return a json_list - return json_list(model_data.all()) - elif model_data.count() == 1: - # if we have a single object, return that object - return model_data.first() - else: - # if we have no objects returned, return None - return None - else: - # no column arguments were given, so return an empty object - new_object = model() - new_object.empty = True - return new_object + """ + Contains methods for creating objects. + """ + def __init__(self, connection): + self.connection = connection + + # class_name is the class name of the model to be used + # pkargs is a dictionary of keyword arguments used as primary key values + # this dictionary will be used to populate the object of type name class_name + def object(self, class_name, **pkargs): + from .data_sources import json_list + from .models import apply_filters + # get the class that self.connection holds from the class name + model = self.connection.model(class_name) + + if self.connection.session == None: + return None + + # query for the ORM object, and return the appropriate object (None, CondDBFW object, or json_list) + model_data = self.connection.session.query(model) + if len(list(pkargs.items())) != 0: + # apply the filters defined in **kwargs + model_data = apply_filters(model_data, model, **pkargs) + amount = pkargs["amount"] if "amount" in list(pkargs.keys()) else None + model_data = model_data.limit(amount) + if model_data.count() > 1: + # if we have multiple objects, return a json_list + return json_list(model_data.all()) + elif model_data.count() == 1: + # if we have a single object, return that object + return model_data.first() + else: + # if we have no objects returned, return None + return None + else: + # no column arguments were given, so return an empty object + new_object = model() + new_object.empty = True + return new_object def _get_netrc_data(netrc_file, key): - """ - Returns a dictionary {login : ..., account : ..., password : ...} - """ - try: - headers = ["login", "account", "password"] - authenticator_tuple = netrc.netrc(netrc_file).authenticators(key) - if authenticator_tuple == None: - raise Exception("netrc file must contain key '%s'." % key) - except: - raise Exception("Couldn't get credentials from netrc file.") - return dict(zip(headers, authenticator_tuple)) + """ + Returns a dictionary {login : ..., account : ..., password : ...} + """ + try: + headers = ["login", "account", "password"] + authenticator_tuple = netrc.netrc(netrc_file).authenticators(key) + if authenticator_tuple == None: + raise Exception("netrc file must contain key '%s'." % key) + except: + raise Exception("Couldn't get credentials from netrc file.") + return dict(list(zip(headers, authenticator_tuple))) def new_connection_dictionary(connection_data, secrets=None, mode="r"): - """ - Function used to construct connection data dictionaries - internal to framework. - """ - frontier_str_length = len("frontier://") - sqlite_str_length = len("sqlite://") - #sqlite_file_str_length = len("sqlite_file://") - oracle_str_length = len("oracle://") - - if type(connection_data) in [str, unicode] and connection_data[0:frontier_str_length] == "frontier://": - """ - frontier://database_name/schema - """ - db_name = connection_data[frontier_str_length:].split("/")[0] - schema = connection_data[frontier_str_length:].split("/")[1] - connection_data = {} - connection_data["database_name"] = db_name - connection_data["schema"] = schema - connection_data["host"] = "frontier" - connection_data["secrets"] = None - elif type(connection_data) in [str, unicode] and connection_data[0:sqlite_str_length] == "sqlite://": - """ - sqlite://database_file_name - """ - # for now, just support "sqlite://" format for sqlite connection strings - db_name = connection_data[sqlite_str_length:] - schema = "" - connection_data = {} - connection_data["database_name"] = os.path.abspath(db_name) - connection_data["schema"] = schema - connection_data["host"] = "sqlite" - connection_data["secrets"] = None - elif type(connection_data) in [str, unicode] and connection_data[0:oracle_str_length] == "oracle://": - """ - oracle://account:password@database_name - or - oracle://database_name/schema (requires a separate method of authentication - either dictionary or netrc) - """ - new_connection_string = connection_data[oracle_str_length:] - - if ":" in new_connection_string: - # the user has given a password - usually in the case of the db upload service - database_name = new_connection_string[new_connection_string.index("@")+1:] - schema_name = new_connection_string[0:new_connection_string.index(":")] - # set username based on connection string - username = new_connection_string[0:new_connection_string.index(":")] - password = new_connection_string[new_connection_string.index(":")+1:new_connection_string.index("@")] - else: - mode_to_netrc_key_suffix = {"r" : "read", "w" : "write"} - database_name = new_connection_string[0:new_connection_string.index("/")] - schema_name = new_connection_string[new_connection_string.index("/")+1:] - if secrets == None: - username = str(raw_input("Enter the username you want to connect to the schema '%s' with: " % (schema_name))) - password = str(raw_input("Enter the password for the user '%s' in database '%s': " % (username, database_name))) - else: - if isinstance(secrets, str): - netrc_key = "%s/%s/%s" % (database_name, schema_name, mode_to_netrc_key_suffix[mode]) - netrc_data = _get_netrc_data(secrets, key=netrc_key) - # take the username from the netrc entry corresponding to the mode the database is opened in - # eg, if the user has given mode="read", the database_name/schema_name/read entry will be taken - username = netrc_data["login"] - password = netrc_data["password"] - elif isinstance(secrets, dict): - username = secrets["user"] - password = secrets["password"] - else: - raise Exception("Invalid type given for secrets. Either an str or a dict must be given.") - - #print("Connected to database %s, schema %s, with username %s." % (database_name, schema_name, username)) - - connection_data = {} - connection_data["database_name"] = database_name - connection_data["schema"] = schema_name - connection_data["password"] = password - connection_data["host"] = "oracle" - connection_data["secrets"] = {"login" : username, "password" : password} - - return connection_data + """ + Function used to construct connection data dictionaries - internal to framework. + """ + frontier_str_length = len("frontier://") + sqlite_str_length = len("sqlite://") + #sqlite_file_str_length = len("sqlite_file://") + oracle_str_length = len("oracle://") + + if type(connection_data) in [str, str] and connection_data[0:frontier_str_length] == "frontier://": + """ + frontier://database_name/schema + """ + db_name = connection_data[frontier_str_length:].split("/")[0] + schema = connection_data[frontier_str_length:].split("/")[1] + connection_data = {} + connection_data["database_name"] = db_name + connection_data["schema"] = schema + connection_data["host"] = "frontier" + connection_data["secrets"] = None + elif type(connection_data) in [str, str] and connection_data[0:sqlite_str_length] == "sqlite://": + """ + sqlite://database_file_name + """ + # for now, just support "sqlite://" format for sqlite connection strings + db_name = connection_data[sqlite_str_length:] + schema = "" + connection_data = {} + connection_data["database_name"] = os.path.abspath(db_name) + connection_data["schema"] = schema + connection_data["host"] = "sqlite" + connection_data["secrets"] = None + elif type(connection_data) in [str, str] and connection_data[0:oracle_str_length] == "oracle://": + """ + oracle://account:password@database_name + or + oracle://database_name/schema (requires a separate method of authentication - either dictionary or netrc) + """ + new_connection_string = connection_data[oracle_str_length:] + + if ":" in new_connection_string: + # the user has given a password - usually in the case of the db upload service + database_name = new_connection_string[new_connection_string.index("@")+1:] + schema_name = new_connection_string[0:new_connection_string.index(":")] + # set username based on connection string + username = new_connection_string[0:new_connection_string.index(":")] + password = new_connection_string[new_connection_string.index(":")+1:new_connection_string.index("@")] + else: + mode_to_netrc_key_suffix = {"r" : "read", "w" : "write"} + database_name = new_connection_string[0:new_connection_string.index("/")] + schema_name = new_connection_string[new_connection_string.index("/")+1:] + if secrets == None: + username = str(input("Enter the username you want to connect to the schema '%s' with: " % (schema_name))) + password = str(input("Enter the password for the user '%s' in database '%s': " % (username, database_name))) + else: + if type(secrets) == str: + netrc_key = "%s/%s/%s" % (database_name, schema_name, mode_to_netrc_key_suffix[mode]) + netrc_data = _get_netrc_data(secrets, key=netrc_key) + # take the username from the netrc entry corresponding to the mode the database is opened in + # eg, if the user has given mode="read", the database_name/schema_name/read entry will be taken + username = netrc_data["login"] + password = netrc_data["password"] + elif type(secrets) == dict: + username = secrets["user"] + password = secrets["password"] + else: + raise Exception("Invalid type given for secrets. Either an str or a dict must be given.") + + #print("Connected to database %s, schema %s, with username %s." % (database_name, schema_name, username)) + + connection_data = {} + connection_data["database_name"] = database_name + connection_data["schema"] = schema_name + connection_data["password"] = password + connection_data["host"] = "oracle" + connection_data["secrets"] = {"login" : username, "password" : password} + + return connection_data def engine_from_dictionary(dictionary, pooling=True): - if dictionary["host"] != "sqlite": - if dictionary["host"] != "frontier": - # probably oracle - # if not frontier, we have to authenticate - user = dictionary["secrets"]["login"] - pwd = dictionary["secrets"]["password"] - # set max label length for oracle - if pooling: - return create_engine(connection.build_oracle_url(user, pwd, dictionary["database_name"]), label_length=6) - else: - return create_engine(connection.build_oracle_url(user, pwd, dictionary["database_name"]), label_length=6, poolclass=NullPool) - else: - # if frontier, no need to authenticate - # set max label length for frontier - if pooling: - return create_engine(connection.build_frontier_url(dictionary["database_name"], dictionary["schema"]), label_length=6) - else: - return create_engine(connection.build_frontier_url(dictionary["database_name"], dictionary["schema"]), label_length=6, poolclass=NullPool) - else: - # if host is sqlite, making the url is easy - no authentication - return create_engine("sqlite:///%s" % dictionary["database_name"]) + if dictionary["host"] != "sqlite": + if dictionary["host"] != "frontier": + # probably oracle + # if not frontier, we have to authenticate + user = dictionary["secrets"]["login"] + pwd = dictionary["secrets"]["password"] + # set max label length for oracle + if pooling: + return create_engine(connection.build_oracle_url(user, pwd, dictionary["database_name"]), label_length=6) + else: + return create_engine(connection.build_oracle_url(user, pwd, dictionary["database_name"]), label_length=6, poolclass=NullPool) + else: + # if frontier, no need to authenticate + # set max label length for frontier + if pooling: + return create_engine(connection.build_frontier_url(dictionary["database_name"], dictionary["schema"]), label_length=6) + else: + return create_engine(connection.build_frontier_url(dictionary["database_name"], dictionary["schema"]), label_length=6, poolclass=NullPool) + else: + # if host is sqlite, making the url is easy - no authentication + return create_engine("sqlite:///%s" % dictionary["database_name"]) def connect(connection_data, mode="r", map_blobs=False, secrets=None, pooling=True): - """ - Utility method for user - set up a connection object. - """ - con = connection(connection_data=connection_data, mode=mode, map_blobs=map_blobs, secrets=secrets, pooling=pooling) - con = con.setup() - return con + """ + Utility method for user - set up a connection object. + """ + con = connection(connection_data=connection_data, mode=mode, map_blobs=map_blobs, secrets=secrets, pooling=pooling) + con = con.setup() + return con \ No newline at end of file diff --git a/CondCore/Utilities/python/CondDBFW/shell.py b/CondCore/Utilities/python/CondDBFW/shell.py index e039f63ad8f0b..a19704dae6176 100644 --- a/CondCore/Utilities/python/CondDBFW/shell.py +++ b/CondCore/Utilities/python/CondDBFW/shell.py @@ -3,8 +3,6 @@ Contains classes for shell part of framework - basically a collection of classes that are designed to be invoked on the command line. """ -from __future__ import print_function -from __future__ import absolute_import from . import querying import sys diff --git a/CondCore/Utilities/python/CondDBFW/uploadConditions.py b/CondCore/Utilities/python/CondDBFW/uploadConditions.py index 5e9b0de06ff2c..17977f42b5e8e 100755 --- a/CondCore/Utilities/python/CondDBFW/uploadConditions.py +++ b/CondCore/Utilities/python/CondDBFW/uploadConditions.py @@ -1,8 +1,11 @@ -#!/usr/bin/env python3 +#!/usr/bin/env python3 """ - +Primary Author: Joshua Dawes - CERN, CMS - The University of Manchester +Debugging, Integration and Maintenance: +Andres Cardenas - CERN, CMS - Universidad San Francisco + Upload script wrapper - controls the automatic update system. Note: the name of the file follows a different convention to the others because it should be the same as the current upload script name. @@ -15,10 +18,17 @@ 4. Invoke the CondDBFW.uploads module with the arguments given to this script. """ -from __future__ import print_function -import pycurl -from StringIO import StringIO +__version__ = 1 + +#import pycurl +import requests +import urllib3 +urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) +try: + from StringIO import StringIO +except: + pass import traceback import sys import os @@ -28,146 +38,18 @@ import netrc import shutil import getpass +import errno +import sqlite3 -def get_version_info(url): - """ - Queries the server-side for the commit hash it is currently using. - Note: this is the commit hash used by /data/services/common/CondDBFW on the server-side. - """ - request = pycurl.Curl() - request.setopt(request.CONNECTTIMEOUT, 60) - user_agent = "User-Agent: ConditionWebServices/1.0 python/%d.%d.%d PycURL/%s" % (sys.version_info[ :3 ] + (pycurl.version_info()[1],)) - request.setopt(request.USERAGENT, user_agent) - # we don't need to verify who signed the certificate or who the host is - request.setopt(request.SSL_VERIFYPEER, 0) - request.setopt(request.SSL_VERIFYHOST, 0) - response_buffer = StringIO() - request.setopt(request.WRITEFUNCTION, response_buffer.write) - request.setopt(request.URL, url + "conddbfw_version/") - request.perform() - return json.loads(response_buffer.getvalue()) - -def get_local_commit_hash(): - """ - Gets the commit hash used by the local repository CondDBFW/.git/. - """ - directory = os.path.abspath("CondDBFW") - - # get the commit hash of the code in `directory` - # by reading the .commit_hash file - try: - commit_hash_file_handle = open(os.path.join(directory, ".commit_hash"), "r") - commit_hash = commit_hash_file_handle.read().strip() - - # validate length of the commit hash - if len(commit_hash) != 40: - print("Commit hash found is not valid. Must be 40 characters long.") - exit() - - #commit_hash = run_in_shell("git --git-dir=%s rev-parse HEAD" % (os.path.join(directory, ".git")), shell=True).strip() - - return commit_hash - except Exception: - return None - -def get_directory_to_pull_to(default_directory, commit_hash): - """ - Finds out which directory we can safely use - either CondDBFW/ or a temporary directory. - """ - # try to write a file (and then delete it) - try: - handle = open(os.path.join(default_directory, "test_file"), "w") - handle.write("test") - handle.close() - os.remove(os.path.join(default_directory, "test_file")) - sys.path.insert(0, default_directory) - return default_directory - except IOError as io: - # cannot write to default directory, so set up a directory in /tmp/ - new_path = os.path.join("tmp", commit_hash[0:10]) - if not(os.path.exists(new_path)): - os.mkdir(new_path) - sys.path.insert(0, new_path) - return new_path - else: - # for now, fail - exit("Can't find anywhere to pull the new code base to.") horizontal_rule = "="*60 -def pull_code_from_git(target_directory, repository_url, hash): - """ - Pulls CondDBFW from the git repository specified by the upload server. - """ - # make directory - target = os.path.abspath(target_directory) - sys.path.append(target) - conddbfw_directory = os.path.join(target, "CondDBFW") - git_directory = os.path.join(conddbfw_directory, ".git") - if not(os.path.exists(conddbfw_directory)): - os.mkdir(conddbfw_directory) - else: - # if the directory exists, it may contain things - prompt the user - force_pull = str(raw_input("CondDBFW directory isn't empty - empty it, and update to new version? [y/n] ")) - if force_pull == "y": - # empty directory and delete it - run_in_shell("rm -rf CondDBFW", shell=True) - # remake the directory - it will be empty - os.mkdir(conddbfw_directory) - - print("Pulling code back from repository...") - print(horizontal_rule) - - run_in_shell("git --git-dir=%s clone %s CondDBFW" % (git_directory, repository_url), shell=True) - # --force makes sure we ignore any conflicts that - # could occur and overwrite everything in the checkout - run_in_shell("cd %s && git checkout --force -b version_used %s" % (conddbfw_directory, hash), shell=True) - - # write the hash to a file in the CondDBFW directory so we can delete the git repository - hash_file_handle = open(os.path.join(conddbfw_directory, ".commit_hash"), "w") - hash_file_handle.write(hash) - hash_file_handle.close() - - # can now delete .git directory - shutil.rmtree(git_directory) - - print(horizontal_rule) - print("Creating local log directories (if required)...") - if not(os.path.exists(os.path.join(target, "upload_logs"))): - os.mkdir(os.path.join(target, "upload_logs")) - if not(os.path.exists(os.path.join(target, "server_side_logs"))): - os.mkdir(os.path.join(target, "server_side_logs")) - print("Finished with log directories.") - print("Update of CondDBFW complete.") - - print(horizontal_rule) - - return True - -def run_in_shell(*popenargs, **kwargs): - """ - Runs string-based commands in the shell and returns the result. - """ - out = subprocess.PIPE if kwargs.get("stdout") == None else kwargs.get("stdout") - new_kwargs = kwargs - if new_kwargs.get("stdout"): - del new_kwargs["stdout"] - process = subprocess.Popen(*popenargs, stdout=out, **new_kwargs) - stdout = process.communicate()[0] - returnCode = process.returncode - cmd = kwargs.get('args') - if cmd is None: - cmd = popenargs[0] - if returnCode: - raise subprocess.CalledProcessError(returnCode, cmd) - return stdout - def run_upload(**parameters): """ Imports CondDBFW.uploads and runs the upload with the upload metadata obtained. """ try: - import CondDBFW.uploads as uploads + import CondCore.Utilities.CondDBFW.uploads as uploads except Exception as e: traceback.print_exc() exit("CondDBFW or one of its dependencies could not be imported.\n"\ @@ -176,6 +58,177 @@ def run_upload(**parameters): uploader = uploads.uploader(**parameters) result = uploader.upload() +def getInput(default, prompt = ''): + '''Like raw_input() but with a default and automatic strip(). + ''' + + answer = raw_input(prompt) + if answer: + return answer.strip() + + return default.strip() + + +def getInputWorkflow(prompt = ''): + '''Like getInput() but tailored to get target workflows (synchronization options). + ''' + + while True: + workflow = getInput(defaultWorkflow, prompt) + + if workflow in frozenset(['offline', 'hlt', 'express', 'prompt', 'pcl']): + return workflow + + print('Please specify one of the allowed workflows. See above for the explanation on each of them.') + + +def getInputChoose(optionsList, default, prompt = ''): + '''Makes the user choose from a list of options. + ''' + + while True: + index = getInput(default, prompt) + + try: + return optionsList[int(index)] + except ValueError: + print('Please specify an index of the list (i.e. integer).') + except IndexError: + print('The index you provided is not in the given list.') + + +def getInputRepeat(prompt = ''): + '''Like raw_input() but repeats if nothing is provided and automatic strip(). + ''' + + while True: + answer = raw_input(prompt) + if answer: + return answer.strip() + + print('You need to provide a value.') + +def runWizard(basename, dataFilename, metadataFilename): + while True: + print('''\nWizard for metadata for %s + +I will ask you some questions to fill the metadata file. For some of the questions there are defaults between square brackets (i.e. []), leave empty (i.e. hit Enter) to use them.''' % basename) + + # Try to get the available inputTags + try: + dataConnection = sqlite3.connect(dataFilename) + dataCursor = dataConnection.cursor() + dataCursor.execute('select name from sqlite_master where type == "table"') + tables = set(zip(*dataCursor.fetchall())[0]) + + # only conddb V2 supported... + if 'TAG' in tables: + dataCursor.execute('select NAME from TAG') + # In any other case, do not try to get the inputTags + else: + raise Exception() + + inputTags = dataCursor.fetchall() + if len(inputTags) == 0: + raise Exception() + inputTags = list(zip(*inputTags))[0] + + except Exception: + inputTags = [] + + if len(inputTags) == 0: + print('\nI could not find any input tag in your data file, but you can still specify one manually.') + + inputTag = getInputRepeat( + '\nWhich is the input tag (i.e. the tag to be read from the SQLite data file)?\ne.g. BeamSpotObject_ByRun\ninputTag: ') + + else: + print('\nI found the following input tags in your SQLite data file:') + for (index, inputTag) in enumerate(inputTags): + print(' %s) %s' % (index, inputTag)) + + inputTag = getInputChoose(inputTags, '0', + '\nWhich is the input tag (i.e. the tag to be read from the SQLite data file)?\ne.g. 0 (you select the first in the list)\ninputTag [0]: ') + + databases = { + 'oraprod': 'oracle://cms_orcon_prod/CMS_CONDITIONS', + 'prod': 'oracle://cms_orcon_prod/CMS_CONDITIONS', + 'oradev': 'oracle://cms_orcoff_prep/CMS_CONDITIONS', + 'prep': 'oracle://cms_orcoff_prep/CMS_CONDITIONS', + } + + destinationDatabase = '' + ntry = 0 + print('\nWhich is the destination database where the tags should be exported?') + print('\n%s) %s' % ('oraprod', databases['oraprod'])) + print('\n%s) %s' % ('oradev', databases['oradev'])) + + while ( destinationDatabase not in databases.values() ): + if ntry==0: + inputMessage = \ + '\nPossible choices: oraprod or oradev \ndestinationDatabase: ' + elif ntry==1: + inputMessage = \ + '\nPlease choose one of the two valid destinations: oraprod or oradev \ndestinationDatabase: ' + else: + raise Exception('No valid destination chosen. Bailing out...') + + databaseInput = getInputRepeat(inputMessage).lower() + if databaseInput in databases.keys(): + destinationDatabase = databases[databaseInput] + ntry += 1 + + while True: + since = getInput('', + '\nWhich is the given since? (if not specified, the one from the SQLite data file will be taken -- note that even if specified, still this may not be the final since, depending on the synchronization options you select later: if the synchronization target is not offline, and the since you give is smaller than the next possible one (i.e. you give a run number earlier than the one which will be started/processed next in prompt/hlt/express), the DropBox will move the since ahead to go to the first safe run instead of the value you gave)\ne.g. 1234\nsince []: ') + if not since: + since = None + break + else: + try: + since = int(since) + break + except ValueError: + print('The since value has to be an integer or empty (null).') + + userText = getInput('', + '\nWrite any comments/text you may want to describe your request\ne.g. Muon alignment scenario for...\nuserText []: ') + + destinationTags = {} + while True: + destinationTag = getInput('', + '\nWhich is the next destination tag to be added (leave empty to stop)?\ne.g. BeamSpotObjects_PCL_byRun_v0_offline\ndestinationTag []: ') + if not destinationTag: + if len(destinationTags) == 0: + print('There must be at least one destination tag.') + continue + break + + if destinationTag in destinationTags: + print( + 'You already added this destination tag. Overwriting the previous one with this new one.') + + destinationTags[destinationTag] = { + } + + metadata = { + 'destinationDatabase': destinationDatabase, + 'destinationTags': destinationTags, + 'inputTag': inputTag, + 'since': since, + 'userText': userText, + } + + metadata = json.dumps(metadata, sort_keys=True, indent=4) + print('\nThis is the generated metadata:\n%s' % metadata) + + if getInput('n', + '\nIs it fine (i.e. save in %s and *upload* the conditions if this is the latest file)?\nAnswer [n]: ' % metadataFilename).lower() == 'y': + break + print('Saving generated metadata in %s...', metadataFilename) + with open(metadataFilename, 'wb') as metadataFile: + metadataFile.write(metadata) + def parse_arguments(): # read in command line arguments, and build metadata dictionary from them parser = argparse.ArgumentParser(prog="cmsDbUpload client", description="CMS Conditions Upload Script in CondDBFW.") @@ -210,13 +263,19 @@ def parse_arguments(): parser.add_argument("--review-options", required=False, action="store_true") + parser.add_argument("--replay-file", required=False) + command_line_data = parser.parse_args() + if command_line_data.replay_file: + dictionary = json.loads("".join(open(command_line_data.replay_file, "r").readlines())) + command_line_data.tier0_response = dictionary["tier0_response"] + # default is the production server, which can point to either database anyway server_alias_to_url = { "prep" : "https://cms-conddb-dev.cern.ch/cmsDbCondUpload/", - "prod" : "https://cms-conddb.cern.ch/cmsDbCondUpload/", - None : "https://cms-conddb.cern.ch/cmsDbCondUpload/" + "dev" : "https://cms-conddb-dev.cern.ch/cmsDbCondUpload/", + "prod" : "https://cms-conddb.cern.ch/cmsDbCondUpload/" } # if prep, prod or None were given, convert to URLs in dictionary server_alias_to_url @@ -224,6 +283,17 @@ def parse_arguments(): if command_line_data.server in server_alias_to_url.keys(): command_line_data.server = server_alias_to_url[command_line_data.server] + # resolve destination databases + database_alias_to_connection = { + "prep": "oracle://cms_orcoff_prep/CMS_CONDITIONS", + "dev": "oracle://cms_orcoff_prep/CMS_CONDITIONS", + "prod": "oracle://cms_orcon_adg/CMS_CONDITIONS" + } + + if command_line_data.destinationDatabase in database_alias_to_connection.keys(): + command_line_data.destinationDatabase = database_alias_to_connection[command_line_data.destinationDatabase] + + # use netrc to get username and password try: netrc_file = command_line_data.netrc @@ -264,23 +334,63 @@ def parse_arguments(): since these override the options set in the metadata file. """ + + # Hash to use, entirely from command line if command_line_data.hashToUse != None: command_line_data.userText = "" metadata_dictionary = command_line_data.__dict__ elif command_line_data.metadataFile == None: - command_line_data.userText = command_line_data.userText\ - if command_line_data.userText != None\ - else str(raw_input("Tag's description [can be empty]:")) - metadata_dictionary = command_line_data.__dict__ - else: + if command_line_data.sourceDB != None and (command_line_data.inputTag == None or command_line_data.destinationTag == None or command_line_data.destinationDatabase == None): + basepath = command_line_data.sourceDB.rsplit('.db', 1)[0].rsplit('.txt', 1)[0] + basename = os.path.basename(basepath) + dataFilename = '%s.db' % basepath + metadataFilename = '%s.txt' % basepath + # Data file + try: + with open(dataFilename, 'rb') as dataFile: + pass + except IOError as e: + errMsg = 'Impossible to open SQLite data file %s' %dataFilename + print( errMsg ) + ret['status'] = -3 + ret['error'] = errMsg + return ret + + # Metadata file + + try: + with open(metadataFilename, 'rb') as metadataFile: + pass + except IOError as e: + if e.errno != errno.ENOENT: + errMsg = 'Impossible to open file %s (for other reason than not existing)' %metadataFilename + ret = {} + ret['status'] = -4 + ret['error'] = errMsg + exit (ret) + + if getInput('y', '\nIt looks like the metadata file %s does not exist and not enough parameters were received in the command line. Do you want me to create it and help you fill it?\nAnswer [y]: ' % metadataFilename).lower() != 'y': + errMsg = 'Metadata file %s does not exist' %metadataFilename + ret = {} + ret['status'] = -5 + ret['error'] = errMsg + exit(ret) + # Wizard + runWizard(basename, dataFilename, metadataFilename) + command_line_data.metadataFile = metadataFilename + else: + command_line_data.userText = command_line_data.userText\ + if command_line_data.userText != None\ + else str(raw_input("Tag's description [can be empty]:")) + metadata_dictionary = command_line_data.__dict__ + + if command_line_data.metadataFile != None: metadata_dictionary = json.loads("".join(open(os.path.abspath(command_line_data.metadataFile), "r").readlines())) metadata_dictionary["username"] = username metadata_dictionary["password"] = password metadata_dictionary["userText"] = metadata_dictionary.get("userText")\ if metadata_dictionary.get("userText") != None\ else str(raw_input("Tag's description [can be empty]:")) - # set the server to use to be the default one - metadata_dictionary["server"] = server_alias_to_url[None] # go through command line options and, if they are set, overwrite entries for (option_name, option_value) in command_line_data.__dict__.items(): @@ -314,47 +424,51 @@ def parse_arguments(): if raw_input("\nDo you want to continue? [y/n] ") != "y": exit() + if metadata_dictionary["server"] == None: + if metadata_dictionary["destinationDatabase"] == "oracle://cms_orcoff_prep/CMS_CONDITIONS": + metadata_dictionary["server"] = server_alias_to_url["prep"] + else: + metadata_dictionary["server"] = server_alias_to_url["prod"] + return metadata_dictionary +def get_version(url): + return requests.get(url + "script_version/", verify=False) + + if __name__ == "__main__": upload_metadata = parse_arguments() # upload_metadata should be used to decide the service url final_service_url = upload_metadata["server"] + try: + response = get_version(final_service_url) + server_version = response.json() + except Exception as e: + print(horizontal_rule) + print(e) + print("Could not connect to server at %s"%final_service_url) + print("If you specified a server please check it is correct. If that is not the issue please contact the AlcaDB team.") + print(horizontal_rule) + exit(1) - conddbfw_version = get_version_info(final_service_url) - local_version = get_local_commit_hash() + if server_version["version"] != __version__: + print(horizontal_rule) + print("Local upload script is different than server version. Please run the following command to get the latest script.") + print("curl --insecure -o uploadConditions.py %sget_upload_script/ && chmod +x uploadConditions.py;"%final_service_url) + print(horizontal_rule) + exit(1) - """ - Todo - case where we don't have write permission in the current directory (local_version == None and hashes don't match) - """ - # target_directory is only used if we don't find a version of CondDBFW locally, - # but is set here so we can access it later if we need to delete a temporary directory - target_directory = "" - # check if we have a persistent local version of CondDBFW - if local_version != None: - if conddbfw_version["hash"] == local_version: - # no update is required, pass for now - print("No change of version of CondDBFW is required - performing the upload.") - # add CondDBFW to the system paths (local_version != None, so we know it's in this directory) - sys.path.append(os.path.abspath(os.getcwd())) - elif conddbfw_version["hash"] != local_version: - # this is the case where CondDBFW is in the directory working_dir/CondDBFW, but there is an update available - # CondDBFW isn't in this directory, and the local commit hash doesn't match the latest one on the server - print("The server uses a different version of CondDBFW - changing to commit '%s' of CondDBFW." % conddbfw_version["hash"]) - shell_response = pull_code_from_git(os.getcwd(), conddbfw_version["repo"], conddbfw_version["hash"]) - else: - # no CondDBFW version - we should pull the code and start from scratch - # we can't look for temporary versions of it in /tmp/, since we can't guess the hash used to make the directory name - print("No CondDBFW version found locally - pulling one.") - target_directory = get_directory_to_pull_to(os.getcwd(), conddbfw_version["hash"]) - shell_response = pull_code_from_git(target_directory, conddbfw_version["repo"], conddbfw_version["hash"]) - - import CondDBFW.data_sources as data_sources + import CondCore.Utilities.CondDBFW.data_sources as data_sources upload_metadata["sqlite_file"] = upload_metadata.get("sourceDB") - + + try: + os.mkdir('upload_logs') + except OSError as e: + pass + # make new dictionary, and copy over everything except "metadata_source" upload_metadata_argument = {} for (key, value) in upload_metadata.items(): @@ -362,15 +476,15 @@ def parse_arguments(): upload_metadata_argument[key] = value upload_metadata["metadata_source"] = data_sources.json_data_node.make(upload_metadata_argument) - - # pass dictionary as arguments to match keywords - the constructor has a **kwargs parameter to deal with stray arguments - run_upload(**upload_metadata) - - # if the directory was temporary, delete it - if "tmp" in target_directory: + try: + # pass dictionary as arguments to match keywords - the constructor has a **kwargs parameter to deal with stray arguments + run_upload(**upload_metadata) + print(horizontal_rule) + print("Process completed without issues. Please check logs for further details.") + print(horizontal_rule) + except SystemExit as e: + print(horizontal_rule) + print("Process exited abnormally. Please check logs for details.") print(horizontal_rule) - print("Removing directory %s..." % target_directory) - try: - run_in_shell("rm -rf %s" % target_directory, shell=True) - except Exception as e: - print("Couldn't delete the directory %s - try to manually delete it." % target_directory) \ No newline at end of file + exit(1) + exit(0) diff --git a/CondCore/Utilities/python/CondDBFW/uploads.py b/CondCore/Utilities/python/CondDBFW/uploads.py index 2bc8927badfd3..953492d625128 100755 --- a/CondCore/Utilities/python/CondDBFW/uploads.py +++ b/CondCore/Utilities/python/CondDBFW/uploads.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/env python3 """ Joshua Dawes - CERN, CMS - The University of Manchester @@ -6,14 +6,12 @@ This module holds classes to help with uploading conditions to the drop box web service, which also uses CondDBFW to read and write data. """ -from __future__ import print_function -from __future__ import absolute_import import os import json import base64 from datetime import datetime -from urllib import urlencode +from urllib.parse import urlencode import math import sys import traceback @@ -42,7 +40,7 @@ def log(file_handle, message): """ Very simple logging function, used by output class. """ - file_handle.write("[%s] %s\n" % (to_timestamp(datetime.now()), message)) + file_handle.write("[%s] %s\n" % (to_timestamp(datetime.utcnow()), message)) def new_log_file_id(): """ @@ -59,38 +57,23 @@ def new_log_file_id(): return new_id class output(): - INFO = 0 - ERROR = 1 - WARNING = 2 - VERBOSE = 3 - DEBUG = 4 - """ Used to control output to the console and to the client-side log. """ - def __init__(self, log_handle=None, verbose=False, debug=False): + def __init__(self, log_handle=None, verbose=False): # first time writing progress bar, don't need to go back along the line self.current_output_length = 0 self._verbose = verbose self._log_handle = log_handle - self._debug = debug - self.labels = ["INFO", "ERROR", "WARNING", "VERBOSE", "DEBUG"] - def write(self, message="", level=INFO): + def write(self, message="", ignore_verbose=False): """ Write to the console and to the log file held by self. """ - message = "[%s] %s: %s"%(datetime.now(), self.labels[level], message) - if self._verbose: - if level == output.DEBUG and self._debug: - print(message) - elif level < output.DEBUG: - print(message) - elif self._debug: - if level == output.DEBUG: - print(message) - elif level <= output.ERROR: + if ignore_verbose: + print(message) + elif self._verbose: print(message) if self._log_handle != None: log(self._log_handle, message) @@ -123,7 +106,7 @@ def __init__(self, metadata_source=None, debug=False, verbose=False, testing=Fal self._handle = open(self.upload_log_file_name, "a") # set up client-side logging object - self._outputter = output(verbose=verbose, log_handle=self._handle, debug = self._debug) + self._outputter = output(verbose=verbose, log_handle=self._handle) self._outputter.write("Using server instance at '%s'." % self._SERVICE_URL) # expect a CondDBFW data_source object for metadata_source @@ -139,7 +122,7 @@ def __init__(self, metadata_source=None, debug=False, verbose=False, testing=Fal if self.metadata_source.get("destinationTags") == None: self.exit_upload("No destination Tag was given.") else: - if isinstance(self.metadata_source.get("destinationTags"), dict) and self.metadata_source.get("destinationTags").keys()[0] == None: + if type(self.metadata_source.get("destinationTags")) == dict and list(self.metadata_source.get("destinationTags").keys())[0] == None: self.exit_upload("No destination Tag was given.") # make sure a destination database was given @@ -171,7 +154,7 @@ def __init__(self, metadata_source=None, debug=False, verbose=False, testing=Fal self.exit_upload("SQLite file '%s' given doesn't exist." % self.sqlite_file_name) sqlite_con = querying.connect("sqlite://%s" % os.path.abspath(self.sqlite_file_name)) - self._outputter.write("Getting Tag and IOVs from SQLite database.", output.VERBOSE) + self._outputter.write("Getting Tag and IOVs from SQLite database.") # query for Tag, check for existence, then convert to dictionary tag = sqlite_con.tag(name=self.input_tag) @@ -184,7 +167,7 @@ def __init__(self, metadata_source=None, debug=False, verbose=False, testing=Fal if iovs == None: self.exit_upload("No IOVs found in the SQLite file given for Tag '%s'." % self.input_tag) iovs = iovs.as_dicts(convert_timestamps=True) - iovs = [iovs] if not isinstance(iovs, list) else iovs + iovs = [iovs] if type(iovs) != list else iovs """ Finally, get the list of all Payload hashes of IOVs, @@ -210,7 +193,7 @@ def __init__(self, metadata_source=None, debug=False, verbose=False, testing=Fal # set empty dictionary to contain Tag and IOV data from command line result_dictionary = {} - now = to_timestamp(datetime.now()) + now = to_timestamp(datetime.utcnow()) # tag dictionary will be taken from the server # this does not require any authentication tag = self.get_tag_dictionary() @@ -244,6 +227,17 @@ def __init__(self, metadata_source=None, debug=False, verbose=False, testing=Fal # Tag time_type says IOVs use Runs for sinces, so we convert to Lumi-based for uniform processing self.data_to_send["since"] = self.data_to_send["since"] << 32 + """ + TODO - Settle on a single destination tag format. + """ + # look for deprecated metadata entries - give warnings + # Note - we only really support this format + try: + if type(result_dictionary["destinationTags"]) == dict: + self._outputter.write("WARNING: Multiple destination tags in a single metadata source is deprecated.") + except Exception as e: + self._outputter.write("ERROR: %s" % str(e)) + @check_response(check="json") def get_tag_dictionary(self): url_data = {"tag_name" : self.metadata_source["destinationTag"], "database" : self.metadata_source["destinationDatabase"]} @@ -257,21 +251,21 @@ def check_response_for_error_key(self, response_dict, exit_if_error=True): If it is a dictionary, and one of its keys is "error", the server returned an error """ # if the decoded response data is a dictionary and has an error key in it, we should display an error and its traceback - if isinstance(response_dict, dict) and "error" in response_dict.keys(): + if type(response_dict) == dict and "error" in list(response_dict.keys()): splitter_string = "\n%s\n" % ("-"*50) - self._outputter.write("\nERROR: %s" % splitter_string, output.ERROR) - self._outputter.write(response_dict["error"], output.ERROR) + self._outputter.write("\nERROR: %s" % splitter_string, ignore_verbose=True) + self._outputter.write(response_dict["error"], ignore_verbose=True) # if the user has given the --debug flag, show the traceback as well if self._debug: # suggest to the user to email this to db upload experts - self._outputter.write("\nTRACEBACK (since --debug is set):%s" % splitter_string, output.DEBUG) + self._outputter.write("\nTRACEBACK (since --debug is set):%s" % splitter_string, ignore_verbose=True) if response_dict.get("traceback") != None: - self._outputter.write(response_dict["traceback"], output.DEBUG) + self._outputter.write(response_dict["traceback"], ignore_verbose=True) else: - self._outputter.write("No traceback was returned from the server.", output.DEBUG) + self._outputter.write("No traceback was returned from the server.", ignore_verbose=True) else: - self._outputter.write("Use the --debug option to show the traceback of this error.", output.INFO) + self._outputter.write("Use the --debug option to show the traceback of this error.", ignore_verbose=True) # write server side log to client side (if we have an error from creating an upload session, the log is in its initial state ("")) # if an error has occurred on the server side, a log will have been written @@ -282,9 +276,9 @@ def check_response_for_error_key(self, response_dict, exit_if_error=True): return False else: exit() - elif not("error" in response_dict.keys()) and "log_data" in response_dict.keys(): + elif not("error" in list(response_dict.keys())) and "log_data" in list(response_dict.keys()): # store the log data, if it's there, in memory - this is used if a request times out and we don't get any log data back - self._log_data = response_dict["log_data"][2:-1] + self._log_data = response_dict["log_data"] return True def write_server_side_log(self, log_data): @@ -314,18 +308,12 @@ def write_server_side_log(self, log_data): # tell the user where the log files are # in the next iteration we may just merge the log files and store one log (how it's done in the plotter module) - if self._SERVICE_URL.startswith("https://cms-conddb-dev.cern.ch/cmsDbCondUpload"): - logUrl = "https://cms-conddb.cern.ch/cmsDbBrowser/logs/show_cond_uploader_log/Prep/%s"%self.upload_session_id - else: - logUrl = "https://cms-conddb.cern.ch/cmsDbBrowser/logs/show_cond_uploader_log/Prod/%s"%self.upload_session_id - - print("[%s] INFO: Server log found at %s." % (datetime.now(), logUrl)) if server_log_file_name != None: - print("[%s] INFO: Local copy of server log file at '%s'." % (datetime.now(), server_log_file_name)) + print("Log file from server written to '%s'." % server_log_file_name) else: print("No server log file could be written locally.") - print("[%s] INFO: Local copy of client log file at '%s'." % (datetime.now(), self.upload_log_file_name)) + print("Log file from CondDBFW written to '%s'." % self.upload_log_file_name) def exit_upload(self, message=None): """ @@ -368,14 +356,14 @@ def upload(self): return False self.upload_session_id = upload_session_data["id"] - self._outputter.write("Upload session obtained with token '%s'." % self.upload_session_id, output.DEBUG) + self._outputter.write("Upload session obtained with token '%s'." % self.upload_session_id) self.server_side_log_file = upload_session_data["log_file"] except errors.NoMoreRetriesException as no_more_retries: return self.exit_upload("Ran out of retries opening an upload session, where the limit was 3.") except Exception as e: # something went wrong that we have no specific exception for, so just exit and output the traceback if --debug is set. - self._outputter.write(traceback.format_exc(), output.ERROR) + self._outputter.write(traceback.format_exc(), ignore_verbose=True) if not(self._verbose): self._outputter.write("Something went wrong that isn't handled by code - to get the traceback, run again with --verbose.") @@ -403,7 +391,7 @@ def upload(self): return self.exit_upload("Ran out of retries trying to filter IOVs by FCSR from server, where the limit was 3.") except Exception as e: # something went wrong that we have no specific exception for, so just exit and output the traceback if --debug is set. - self._outputter.write(traceback.format_exc(), output.ERROR) + self._outputter.write(traceback.format_exc(), ignore_verbose=True) if not(self._verbose): self._outputter.write("Something went wrong that isn't handled by code - to get the traceback, run again with --verbose.") @@ -429,10 +417,10 @@ def upload(self): # finally, check hashes_not_found with hashes not found locally - if there is an intersection, we stop the upload # because if a hash is not found and is not on the server, there is no data to upload - all_hashes = map(lambda iov : iov["payload_hash"], self.data_to_send["iovs"]) + all_hashes = [iov["payload_hash"] for iov in self.data_to_send["iovs"]] hashes_not_found = check_hashes_response["hashes_not_found"] hashes_found = list(set(all_hashes) - set(hashes_not_found)) - self._outputter.write("Checking for IOVs that have no Payload locally or on the server.", output.VERBOSE) + self._outputter.write("Checking for IOVs that have no Payload locally or on the server.") # check if any hashes not found on the server is used in the local SQLite database for hash_not_found in hashes_not_found: if hash_not_found in self.hashes_with_no_local_payload: @@ -440,19 +428,16 @@ def upload(self): for hash_found in hashes_found: if hash_found in self.hashes_with_no_local_payload: - self._outputter.write("Payload with hash %s on server, so can upload IOV." % hash_found, output.VERBOSE) - - self._outputter.write("Found %i Payloads in remote server" % len(hashes_found), output.INFO) - self._outputter.write("Found %i Payloads not in remote server" % len(hashes_not_found), output.INFO) + self._outputter.write("Payload with hash %s on server, so can upload IOV." % hash_found) - self._outputter.write("All IOVs either come with Payloads or point to a Payload already on the server.", output.VERBOSE) + self._outputter.write("All IOVs either come with Payloads or point to a Payload already on the server.") except errors.NoMoreRetriesException as no_more_retries: # for now, just write the log if we get a NoMoreRetriesException return self.exit_upload("Ran out of retries trying to check hashes of payloads to send, where the limit was 3.") except Exception as e: # something went wrong that we have no specific exception for, so just exit and output the traceback if --debug is set. - self._outputter.write(traceback.format_exc(), output.ERROR) + self._outputter.write(traceback.format_exc(), ignore_verbose=True) if not(self._verbose): self._outputter.write("Something went wrong that isn't handled by code - to get the traceback, run again with --verbose.") @@ -477,16 +462,10 @@ def upload(self): # note that the response (in send_metadata_response) is already decoded from base64 by the response check decorator send_metadata_response = self.send_metadata(self.upload_session_id) - no_error = self.check_response_for_error_key(send_metadata_response) if not(no_error) and self._testing: return False - try: - self._outputter.write(send_metadata_response["summary"], output.INFO) - except KeyError: - pass - # we have to call this explicitly here since check_response_for_error_key only writes the log file # if an error has occurred, whereas it should always be written here self.write_server_side_log(self._log_data) @@ -495,7 +474,7 @@ def upload(self): return self.exit_upload("Ran out of retries trying to send metadata, where the limit was 3.") except Exception as e: # something went wrong that we have no specific exception for, so just exit and output the traceback if --debug is set. - self._outputter.write(traceback.format_exc(), output.ERROR) + self._outputter.write(traceback.format_exc(), ignore_verbose=True) if not(self._verbose): self._outputter.write("Something went wrong that isn't handled by code - to get the traceback, run again with --verbose.") @@ -517,7 +496,7 @@ def get_upload_session_id(self): Open an upload session on the server, and get a unique token back that we can use to authenticate for all future requests, as long as the upload session is still open. """ - self._outputter.write("Getting upload session.", output.VERBOSE) + self._outputter.write("Getting upload session.") # send password in the body so it can be encrypted over https # username and password are taken from the netrc file @@ -525,11 +504,11 @@ def get_upload_session_id(self): # this method's end result is obtaining a token. body_data = base64.b64encode(json.dumps( { - "destinationTag" : self.data_to_send["destinationTags"].keys()[0], + "destinationTag" : list(self.data_to_send["destinationTags"].keys())[0], "username_or_token" : self.data_to_send["username"], "password" : self.data_to_send["password"] } - )) + ).encode('UTF-8')) url_data = {"database" : self.data_to_send["destinationDatabase"]} @@ -557,11 +536,15 @@ def get_fcsr_from_server(self, upload_session_id): Note: we do this in a separate function we so we can do the decoding check for json data with check_response. """ # tiny amount of client-side logic here - all of the work is done on the server + # tier0_response uses get() so if the key isn't present, we default to None + # tier0_response is for replaying uploads from the old upload service, with knowledge of the tier0 response + # when those uploads happened. url_data = { "database" : self.data_to_send["destinationDatabase"], "upload_session_id" : upload_session_id, - "destinationTag" : self.data_to_send["destinationTags"].keys()[0], - "sourceTagSync" : self.data_to_send["fcsr_filter"] + "destinationTag" : list(self.data_to_send["destinationTags"].keys())[0], + "sourceTagSync" : self.data_to_send["fcsr_filter"], + "tier0_response" : self.data_to_send.get("tier0_response") } query = url_query(url=self._SERVICE_URL + "get_fcsr/", url_data=url_data) result = query.send() @@ -626,7 +609,7 @@ def filter_iovs_by_fcsr(self, upload_session_id): self.data_to_send["iovs"][i]["since"] = self.data_to_send["since"] # modify insertion_time of iovs - new_time = to_timestamp(datetime.now()) + new_time = to_timestamp(datetime.utcnow()) for (i, iov) in enumerate(self.data_to_send["iovs"]): self.data_to_send["iovs"][i]["insertion_time"] = new_time @@ -634,9 +617,8 @@ def get_all_hashes(self): """ Get all the hashes from the dictionary of IOVs we have from the SQLite file. """ - self._outputter.write("\tGetting list of all hashes found in SQLite database.", output.DEBUG) - hashes = map(lambda iov : iov["payload_hash"], self.data_to_send["iovs"]) - self._outputter.write("Found %i local Payload(s) referenced in IOVs"%len(hashes), output.INFO) + self._outputter.write("\tGetting list of all hashes found in SQLite database.") + hashes = [iov["payload_hash"] for iov in self.data_to_send["iovs"]] return hashes @check_response(check="json") @@ -644,7 +626,7 @@ def get_hashes_to_send(self, upload_session_id): """ Get the hashes of the payloads we want to send that the server doesn't have yet. """ - self._outputter.write("Getting list of hashes that the server does not have Payloads for, to send to server.", output.DEBUG) + self._outputter.write("Getting list of hashes that the server does not have Payloads for, to send to server.") post_data = json.dumps(self.get_all_hashes()) url_data = {"database" : self.data_to_send["destinationDatabase"], "upload_session_id" : upload_session_id} query = url_query(url=self._SERVICE_URL + "check_hashes/", url_data=url_data, body=post_data) @@ -658,21 +640,22 @@ def send_payloads(self, hashes, upload_session_id): # if we have no hashes, we can't send anything # but don't exit since it might mean all the Payloads were already on the server if len(hashes) == 0: - self._outputter.write("No payloads to send - moving to IOV upload.") + self._outputter.write("No hashes to send - moving to metadata upload.") return True else: self._outputter.write("Sending payloads of hashes not found:") # construct connection string for local SQLite database file - database = ("sqlite://%s" % os.path.abspath(self.sqlite_file_name)) if isinstance(self.sqlite_file_name, str) else self.sqlite_file_name + database = ("sqlite://%s" % os.path.abspath(self.sqlite_file_name)) if type(self.sqlite_file_name) == str else self.sqlite_file_name # create CondDBFW connection that maps blobs - as we need to query for payload BLOBs (disabled by default in CondDBFW) self._outputter.write("\tConnecting to input SQLite database.") con = querying.connect(database, map_blobs=True) # query for the Payloads self._outputter.write("\tGetting Payloads from SQLite database based on list of hashes.") - payloads = con.payload(hash=hashes) + byte_hashes = [bytes(h, 'utf-8') for h in hashes] + payloads = con.payload(hash=byte_hashes) # if we get a single Payload back, put it in a list and turn it into a json_list - if payloads.__class__ != data_sources.json_list: + if payloads and payloads.__class__ != data_sources.json_list: payloads = data_sources.json_data_node.make([payloads]) # close the session with the SQLite database file - we won't use it again @@ -713,7 +696,7 @@ def send_blob(self, payload, upload_session_id): url_data = {"database" : self.data_to_send["destinationDatabase"], "upload_session_id" : upload_session_id} # construct the data to send in the body and header of the HTTPs request - for key in payload.keys(): + for key in list(payload.keys()): # skip blob if key != "data": if key == "insertion_time": @@ -730,7 +713,7 @@ def send_blob(self, payload, upload_session_id): return request_response except Exception as e: # make sure we don't try again - if a NoMoreRetriesException has been thrown, retries have run out - if isinstance(e, errors.NoMoreRetriesException): + if type(e) == errors.NoMoreRetriesException: self._outputter.write("\t\t\tPayload with hash '%s' was not uploaded because the maximum number of retries was exceeded." % payload["hash"]) self._outputter.write("Payload with hash '%s' was not uploaded because the maximum number of retries was exceeded." % payload["hash"]) return json.dumps({"error" : str(e), "traceback" : traceback.format_exc()}) @@ -744,16 +727,16 @@ def send_metadata(self, upload_session_id): # set user text if it's empty if self.data_to_send["userText"] in ["", None]: - self.data_to_send["userText"] = "Tag '%s' uploaded from CondDBFW client." % self.data_to_send["destinationTags"].keys()[0] + self.data_to_send["userText"] = "Tag '%s' uploaded from CondDBFW client." % list(self.data_to_send["destinationTags"].keys())[0] self._outputter.write("Sending metadata to server - see server_side_log at server_side_logs/upload_log_%s for details on metadata processing on server side."\ - % self.upload_session_id, output.VERBOSE) + % self.upload_session_id) # sent the HTTPs request to the server - url_data = {"database" : self.data_to_send["destinationDatabase"], "upload_session_id" : upload_session_id} + url_data = {"database" : self.data_to_send["destinationDatabase"], "upload_session_id" : upload_session_id, "tier0_response" : self.data_to_send.get("tier0_response")} request = url_query(url=self._SERVICE_URL + "upload_metadata/", url_data=url_data, body=json.dumps(self.data_to_send)) response = request.send() - self._outputter.write("Response received - conditions upload process complete.", output.VERBOSE) + self._outputter.write("Response received - conditions upload process complete.") return response if __name__ == "__main__": @@ -777,7 +760,7 @@ def send_metadata(self, upload_session_id): # make new dictionary, and copy over everything except "metadata_source" upload_metadata_argument = {} - for (key, value) in upload_metadata.items(): + for (key, value) in list(upload_metadata.items()): if key != "metadata_source": upload_metadata_argument[key] = value diff --git a/CondCore/Utilities/python/CondDBFW/url_query.py b/CondCore/Utilities/python/CondDBFW/url_query.py index 4639eb261800b..e6fab9c9ba55d 100644 --- a/CondCore/Utilities/python/CondDBFW/url_query.py +++ b/CondCore/Utilities/python/CondDBFW/url_query.py @@ -6,20 +6,35 @@ Provides methods for performing/closing the request, as well as getting the request response. Note: user agent string from current version of cmsDbUpload """ -from __future__ import print_function -from __future__ import absolute_import -import pycurl -from StringIO import StringIO -from urllib import urlencode +#import pycurl +import requests +from io import StringIO +from urllib.parse import urlencode import traceback import sys import json from .errors import * from time import sleep +import urllib3 +urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) + class url_query(): + def __init__(self, url=None, url_data=None, body=None): + self._url = url + self._url_data = url_data + self._body = body + + def send(self): + if self._body: + return requests.post(self._url, data=self._body, params=self._url_data, verify=False).text + else: + return requests.get(self._url, params=self._url_data, verify=False).text + +"""class url_query(): + def __init__(self, url=None, url_data=None, body=None, response_stream=None, timeout=60): if not(url): return None @@ -38,15 +53,15 @@ def __init__(self, url=None, url_data=None, body=None, response_stream=None, tim self._response = StringIO() if body: - if isinstance(body, dict): + if type(body) == dict: body = urlencode(body) - elif isinstance(body, list): + elif type(body) == list: body = json.dumps(body) self._r.setopt(self._r.POSTFIELDS, body) if url_data: - if isinstance(url_data, dict): + if type(url_data) == dict: url_data = urlencode(url_data) else: exit("URL data '%s' for request to URL '%s' was not valid - should be a dictionary." % (str(url_data), url)) @@ -54,7 +69,7 @@ def __init__(self, url=None, url_data=None, body=None, response_stream=None, tim # set the URL with url parameters if they were given self._r.setopt(self._r.URL, url + (("?%s" % url_data) if url_data else "")) - if response_stream and not isinstance(response_stream, StringIO): + if response_stream and type(response_stream) != StringIO: response_stream = StringIO() # copy reference to instance variable self._response = response_stream @@ -79,7 +94,7 @@ def send(self): attempt += 1 # this catches exceptions that occur with the actual http request # not exceptions sent back from server side - if isinstance(e, pycurl.error) and e[0] in [7, 52]: + if type(e) == pycurl.error and e[0] in [7, 52]: # wait two seconds to retry print("Request failed - waiting 3 seconds to retry.") sleep(3) @@ -89,4 +104,4 @@ def send(self): print("Unforesoon error occurred when sending data to server.") traceback.print_exc() if attempt == max_retries: - raise NoMoreRetriesException(max_retries) \ No newline at end of file + raise NoMoreRetriesException(max_retries)""" \ No newline at end of file diff --git a/CondCore/Utilities/python/CondDBFW/utils.py b/CondCore/Utilities/python/CondDBFW/utils.py index 053dacb0c15d2..277995e824b50 100644 --- a/CondCore/Utilities/python/CondDBFW/utils.py +++ b/CondCore/Utilities/python/CondDBFW/utils.py @@ -7,13 +7,13 @@ def to_timestamp(obj): """ Takes a datetime object and outputs a timestamp string with the format Y-m-d H:m:S.f """ - return obj.strftime('%Y-%m-%d %H:%M:%S.%f') if isinstance(obj, datetime.datetime) else obj + return obj.strftime('%d-%b-%y %I:%M:%S.%f %p') if isinstance(obj, datetime.datetime) else obj def to_datetime(date_string): """ Takes a date string with the format Y-m-d H:m:S.f and gives back a datetime.datetime object """ - return datetime.datetime.strptime(date_string.replace(",", "."), "%Y-%m-%d %H:%M:%S.%f") + return datetime.datetime.strptime(date_string.replace(",", "."), "%d-%b-%y %I:%M:%S.%f %p") def friendly_since(time_type, since): """ diff --git a/CondCore/Utilities/python/o2olib.py b/CondCore/Utilities/python/o2olib.py index 4aff86dd894d2..f76fc65d645db 100644 --- a/CondCore/Utilities/python/o2olib.py +++ b/CondCore/Utilities/python/o2olib.py @@ -133,22 +133,6 @@ def getSession( self, db_service, role, authPath ): self.logger.error( str(dberror) ) return session - def readConfiguration( self, config_filename ): - config = '' - try: - with open( config_filename, 'r' ) as config_file: - config = config_file.read() - if config == '': - self.logger.error( 'The file %s contains an empty string.', config_filename ) - else: - json.loads(config) - except IOError as e: - self.logger.error( 'The file %s cannot be open.', config_filename ) - except ValueError as e: - config = '' - self.logger.error( 'The file %s contains an invalid json string.', config_filename ) - return config - def connect( self, service, args ): self.session = self.getSession( service, args.role, args.auth ) self.verbose = args.verbose @@ -161,7 +145,9 @@ def connect( self, service, args ): def runManager( self ): return O2ORunMgr( self.db_connection, self.session, self.logger ) - def add( self, job_name, config_filename, int_val, freq_flag, en_flag ): + def add( self, job_name, configJson, int_val, freq_flag, en_flag ): + if configJson == '': + return False res = self.session.query(O2OJob.enabled).filter_by(name=job_name) enabled = None for r in res: @@ -169,9 +155,6 @@ def add( self, job_name, config_filename, int_val, freq_flag, en_flag ): if enabled: self.logger.error( "A job called '%s' exists already.", job_name ) return False - configJson = self.readConfiguration( config_filename ) - if configJson == '': - return False freq_val = 0 if freq_flag: freq_val = 1 @@ -208,7 +191,9 @@ def set( self, job_name, en_flag, fr_val=None ): else: self.logger.info( "Job '%s' unset 'frequent'" %job_name) - def setConfig( self, job_name, config_filename ): + def setConfig( self, job_name, configJson ): + if configJson == '': + return False res = self.session.query(O2OJob.enabled).filter_by(name=job_name) enabled = None for r in res: @@ -216,13 +201,11 @@ def setConfig( self, job_name, config_filename ): if enabled is None: self.logger.error( "A job called '%s' does not exist.", job_name ) return - configJson = self.readConfiguration( config_filename ) - if configJson == '': - return False config = O2OJobConf( job_name=job_name, insertion_time = datetime.utcnow(), configuration = configJson ) self.session.add(config) self.session.commit() self.logger.info( "New configuration inserted for job '%s'", job_name ) + return True def setInterval( self, job_name, int_val ): res = self.session.query(O2OJob.enabled).filter_by(name=job_name) @@ -396,15 +379,15 @@ def executeJob( self, args ): self.logger.error( "Unresolved template key %s in the command." %str(exc) ) return 3 self.logger.info('Command: "%s"', command ) + out = '' try: self.logger.info('Executing command...' ) pipe = subprocess.Popen( command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT ) - out = '' - for line in iter(pipe.stdout.readline, ''): + for line in pipe.stdout: if args.verbose is not None and args.verbose>=1: - sys.stdout.write(line) + sys.stdout.write(line.decode()) sys.stdout.flush() - out += line + out += line.decode() pipe.communicate() self.logger.info( 'Command returned code: %s' %pipe.returncode ) ret = pipe.returncode @@ -417,6 +400,32 @@ def executeJob( self, args ): with open(logFile,'a') as logF: logF.write(out) return ret + +def readConfiguration( config_filename ): + config = '' + try: + with open( config_filename, 'r' ) as config_file: + config = config_file.read().strip('\n') + if config == '': + logging.error( 'The file %s contains an empty string.', config_filename ) + else: + json.loads(config) + except IOError as e: + logging.error( 'The file %s cannot be open.', config_filename ) + except ValueError as e: + config = '' + logging.error( 'The file "%s" contains an invalid json string.', config_filename ) + return config + +def checkConfiguration( config_string ): + config = config_string + try: + json.loads(config) + except ValueError as e: + config = '' + logging.error( 'The string "%s" is an invalid json format.', config_string ) + return config + import optparse import argparse @@ -431,13 +440,15 @@ def execute(self): parser_subparsers = parser.add_subparsers(title='Available subcommands') parser_create = parser_subparsers.add_parser('create', description='Create a new O2O job') parser_create.add_argument('--name', '-n', type=str, help='The o2o job name',required=True) - parser_create.add_argument('--configFile', '-c', type=str, help='the JSON configuration file path',required=True) + parser_create.add_argument('--configFile', '-c', type=str, help='the JSON configuration file path') + parser_create.add_argument('--configString', '-s', type=str, help='the JSON configuration string') parser_create.add_argument('--interval', '-i', type=int, help='the chron job interval',default=0) - parser_create.add_argument('--frequent', '-f',action='store_true',help='set the "frequent" flag for this job') + parser_create.add_argument('--frequent', '-f',action='store_true',help='set the "frequent" flag for this job ("false" by default)') parser_create.set_defaults(func=self.create,role=auth.admin_role) parser_setConfig = parser_subparsers.add_parser('setConfig', description='Set a new configuration for the specified job. The configuration is expected as a list of entries "param": "value" (dictionary). The "param" labels will be used to inject the values in the command to execute. The dictionary is stored in JSON format.') parser_setConfig.add_argument('--name', '-n', type=str, help='The o2o job name',required=True) - parser_setConfig.add_argument('--configFile', '-c', type=str, help='the JSON configuration file path',required=True) + parser_setConfig.add_argument('--configFile', '-c', type=str, help='the JSON configuration file path') + parser_setConfig.add_argument('--configString', '-s', type=str, help='the JSON configuration string') parser_setConfig.set_defaults(func=self.setConfig,role=auth.admin_role) parser_setFrequent = parser_subparsers.add_parser('setFrequent',description='Set the "frequent" flag for the specified job') parser_setFrequent.add_argument('--name', '-n', type=str, help='The o2o job name',required=True) @@ -496,10 +507,36 @@ def setup(self, args): return self.mgr.connect( db_service, args ) def create(self): - self.mgr.add( self.args.name, self.args.configFile, self.args.interval, True ) + configJson = None + if self.args.configFile is not None: + if self.args.configString is not None: + logging.error('Ambigouous input provided: please specify a configFile OR a configString') + return False + else: + configJson = readConfiguration( self.args.configFile ) + else: + if self.args.configString is None: + logging.error('No configuration has been provided: please specify "configFile" or "configString" param.') + return False + else: + configJson = checkConfiguration( self.args.configString ) + self.mgr.add( self.args.name, configJson, self.args.interval, self.args.frequent, True ) def setConfig(self): - self.mgr.setConfig( self.args.name, self.args.configFile ) + configJson = None + if self.args.configFile is not None: + if self.args.configString is not None: + logging.error('Ambigouous input provided: please specify a configFile OR a configString') + return False + else: + configJson = readConfiguration( self.args.configFile ) + else: + if self.args.configString is None: + logging.error('No configuration has been provided: please specify "configFile" or "configString" param.') + return False + else: + configJson = checkConfiguration( self.args.configString ) + self.mgr.setConfig( self.args.name, configJson ) def setInterval(self): self.mgr.setInterval( self.args.name, self.args.interval ) diff --git a/CondCore/Utilities/src/CondDBFetch.cc b/CondCore/Utilities/src/CondDBFetch.cc index d950d7145e5ce..7043331b0a519 100644 --- a/CondCore/Utilities/src/CondDBFetch.cc +++ b/CondCore/Utilities/src/CondDBFetch.cc @@ -56,6 +56,9 @@ namespace cond { FETCH_PAYLOAD_CASE(CTPPSPixelAnalysisMask) FETCH_PAYLOAD_CASE(CTPPSPixelGainCalibrations) FETCH_PAYLOAD_CASE(CTPPSRPAlignmentCorrectionsData) + FETCH_PAYLOAD_CASE(PPSAlignmentConfig) + FETCH_PAYLOAD_CASE(PPSAlignmentConfiguration) + FETCH_PAYLOAD_CASE(PPSAssociationCuts) FETCH_PAYLOAD_CASE(LHCOpticalFunctionsSetCollection) FETCH_PAYLOAD_CASE(CastorChannelQuality) FETCH_PAYLOAD_CASE(CastorElectronicsMap) @@ -343,9 +346,7 @@ namespace cond { std::string payloadTypeName; bool found = session.fetchPayloadData(payloadId, payloadTypeName, data, streamerInfo); if (!found) - throwException( - "Payload with id " + boost::lexical_cast(payloadId) + " has not been found in the database.", - "fetch"); + throwException("Payload with id " + payloadId + " has not been found in the database.", "fetch"); return fetchOne(payloadTypeName, data, streamerInfo, payloadPtr); } diff --git a/CondCore/Utilities/src/CondDBImport.cc b/CondCore/Utilities/src/CondDBImport.cc index 06f2569ff44a2..2f28abd8b2728 100644 --- a/CondCore/Utilities/src/CondDBImport.cc +++ b/CondCore/Utilities/src/CondDBImport.cc @@ -76,6 +76,9 @@ namespace cond { IMPORT_PAYLOAD_CASE(CTPPSPixelAnalysisMask) IMPORT_PAYLOAD_CASE(CTPPSPixelGainCalibrations) IMPORT_PAYLOAD_CASE(CTPPSRPAlignmentCorrectionsData) + IMPORT_PAYLOAD_CASE(PPSAlignmentConfig) + IMPORT_PAYLOAD_CASE(PPSAlignmentConfiguration) + IMPORT_PAYLOAD_CASE(PPSAssociationCuts) IMPORT_PAYLOAD_CASE(LHCOpticalFunctionsSetCollection) IMPORT_PAYLOAD_CASE(CastorChannelQuality) IMPORT_PAYLOAD_CASE(CastorElectronicsMap) diff --git a/CondCore/Utilities/src/CondDBTools.cc b/CondCore/Utilities/src/CondDBTools.cc index cf1cce5a50178..52303ba94f30c 100644 --- a/CondCore/Utilities/src/CondDBTools.cc +++ b/CondCore/Utilities/src/CondDBTools.cc @@ -2,11 +2,8 @@ #include "CondCore/Utilities/interface/CondDBImport.h" #include "CondCore/CondDB/interface/ConnectionPool.h" // -#include "CondCore/CondDB/src/DbCore.h" -// -#include - #include +#include namespace cond { diff --git a/CondCore/Utilities/src/CondFormats.h b/CondCore/Utilities/src/CondFormats.h index ef04fcb0035bf..2fc9054377a8f 100644 --- a/CondCore/Utilities/src/CondFormats.h +++ b/CondCore/Utilities/src/CondFormats.h @@ -32,8 +32,11 @@ #include "CondFormats/PPSObjects/interface/CTPPSPixelAnalysisMask.h" #include "CondFormats/PPSObjects/interface/CTPPSPixelGainCalibrations.h" #include "CondFormats/PPSObjects/interface/CTPPSRPAlignmentCorrectionsData.h" +#include "CondFormats/PPSObjects/interface/PPSAssociationCuts.h" #include "CondFormats/PPSObjects/interface/PPSTimingCalibration.h" +#include "CondFormats/PPSObjects/interface/PPSAlignmentConfiguration.h" #include "CondFormats/PPSObjects/interface/LHCOpticalFunctionsSetCollection.h" +#include "CondFormats/PPSObjects/interface/PPSAlignmentConfig.h" #include "CondFormats/DTObjects/interface/DTCCBConfig.h" #include "CondFormats/DTObjects/interface/DTDeadFlag.h" #include "CondFormats/DTObjects/interface/DTHVStatus.h" diff --git a/CondCore/Utilities/src/PayloadInspector.cc b/CondCore/Utilities/src/PayloadInspector.cc index 15a0f80b4b6f3..82116f7501f79 100644 --- a/CondCore/Utilities/src/PayloadInspector.cc +++ b/CondCore/Utilities/src/PayloadInspector.cc @@ -5,7 +5,6 @@ #include #include -#include namespace cond { @@ -49,38 +48,39 @@ namespace cond { bool PlotBase::isTwoTags() const { return m_plotAnnotations.ntags == 2; } - boost::python::list PlotBase::inputParams() const { - boost::python::list tmp; + py::list PlotBase::inputParams() const { + py::list tmp; for (const auto& ip : m_inputParams) { tmp.append(ip); } return tmp; } - void PlotBase::setInputParamValues(const boost::python::dict& values) { - for (const auto& ip : m_inputParams) { - if (values.has_key(ip)) { - std::string val = boost::python::extract(values.get(ip)); - m_inputParamValues.insert(std::make_pair(ip, val)); + void PlotBase::setInputParamValues(const py::dict& values) { + for (auto item : values) { + std::string k = item.first.cast(); + std::string v = item.second.cast(); + if (m_inputParams.find(k) != m_inputParams.end()) { + m_inputParamValues.insert(std::make_pair(k, v)); } } } std::string PlotBase::data() const { return m_data; } - bool PlotBase::process(const std::string& connectionString, const boost::python::list& tagsWithTimeBoundaries) { - size_t nt = boost::python::len(tagsWithTimeBoundaries); + bool PlotBase::process(const std::string& connectionString, const py::list& tagsWithTimeBoundaries) { + size_t nt = py::len(tagsWithTimeBoundaries); bool ret = false; if (nt) { std::vector > tags; tags.resize(nt); for (size_t i = 0; i < nt; i++) { - boost::python::tuple entry = boost::python::extract(tagsWithTimeBoundaries[i]); - std::string tagName = boost::python::extract(entry[0]); - std::string time0s = boost::python::extract(entry[1]); - std::string time1s = boost::python::extract(entry[2]); - cond::Time_t time0 = boost::lexical_cast(time0s); - cond::Time_t time1 = boost::lexical_cast(time1s); + py::tuple entry = tagsWithTimeBoundaries[i].cast(); + std::string tagName = entry[0].cast(); + std::string time0s = entry[1].cast(); + std::string time1s = entry[2].cast(); + cond::Time_t time0 = std::stoull(time0s); + cond::Time_t time1 = std::stoull(time1s); tags[i] = std::make_tuple(tagName, time0, time1); } ret = exec_process(connectionString, tags); diff --git a/CondCore/Utilities/test/testPngHistograms.cpp b/CondCore/Utilities/test/testPngHistograms.cpp index f527f6e4ce27e..0ecbfef087a3b 100644 --- a/CondCore/Utilities/test/testPngHistograms.cpp +++ b/CondCore/Utilities/test/testPngHistograms.cpp @@ -23,7 +23,7 @@ int main(int argc, char** argv) { std::string connectionString("frontier://FrontierProd/CMS_CONDITIONS"); std::string tag = std::string("BasicPayload_v10.0"); - cond::Time_t since = boost::lexical_cast("901"); + cond::Time_t since = std::stoull("901"); std::cout << "## PNG Histo" << std::endl; diff --git a/CondFormats/CSCObjects/interface/CSCL1TPLookupTableCCLUT.h b/CondFormats/CSCObjects/interface/CSCL1TPLookupTableCCLUT.h new file mode 100644 index 0000000000000..3afcb817c9abd --- /dev/null +++ b/CondFormats/CSCObjects/interface/CSCL1TPLookupTableCCLUT.h @@ -0,0 +1,30 @@ +#ifndef CondFormats_CSCObjects_CSCL1TPLookupTableCCLUT_h +#define CondFormats_CSCObjects_CSCL1TPLookupTableCCLUT_h + +#include "CondFormats/Serialization/interface/Serializable.h" +#include +#include + +class CSCL1TPLookupTableCCLUT { +public: + CSCL1TPLookupTableCCLUT(); + ~CSCL1TPLookupTableCCLUT() {} + + typedef std::unordered_map > t_lut; + + // setters + void set_cclutPosition(t_lut lut); + void set_cclutSlope(t_lut lut); + + // getters + unsigned cclutPosition(unsigned pattern, unsigned code) const; + unsigned cclutSlope(unsigned pattern, unsigned code) const; + +private: + t_lut cclutPosition_; + t_lut cclutSlope_; + + COND_SERIALIZABLE; +}; + +#endif diff --git a/CondFormats/CSCObjects/interface/CSCL1TPLookupTableME11ILT.h b/CondFormats/CSCObjects/interface/CSCL1TPLookupTableME11ILT.h new file mode 100644 index 0000000000000..f6d530d30afe9 --- /dev/null +++ b/CondFormats/CSCObjects/interface/CSCL1TPLookupTableME11ILT.h @@ -0,0 +1,156 @@ +#ifndef CondFormats_CSCObjects_CSCL1TPLookupTableME11ILT_h +#define CondFormats_CSCObjects_CSCL1TPLookupTableME11ILT_h + +#include "CondFormats/Serialization/interface/Serializable.h" +#include + +class CSCL1TPLookupTableME11ILT { +public: + CSCL1TPLookupTableME11ILT(); + + ~CSCL1TPLookupTableME11ILT() {} + + typedef std::vector t_lut; + + // setters + void set_GEM_pad_CSC_hs_ME1b_even(t_lut lut); + void set_GEM_pad_CSC_hs_ME1a_even(t_lut lut); + void set_GEM_pad_CSC_hs_ME1b_odd(t_lut lut); + void set_GEM_pad_CSC_hs_ME1a_odd(t_lut lut); + + void set_GEM_pad_CSC_es_ME1b_even(t_lut lut); + void set_GEM_pad_CSC_es_ME1a_even(t_lut lut); + void set_GEM_pad_CSC_es_ME1b_odd(t_lut lut); + void set_GEM_pad_CSC_es_ME1a_odd(t_lut lut); + + void set_GEM_roll_L1_CSC_min_wg_ME11_even(t_lut lut); + void set_GEM_roll_L1_CSC_max_wg_ME11_even(t_lut lut); + void set_GEM_roll_L1_CSC_min_wg_ME11_odd(t_lut lut); + void set_GEM_roll_L1_CSC_max_wg_ME11_odd(t_lut lut); + + void set_GEM_roll_L2_CSC_min_wg_ME11_even(t_lut lut); + void set_GEM_roll_L2_CSC_max_wg_ME11_even(t_lut lut); + void set_GEM_roll_L2_CSC_min_wg_ME11_odd(t_lut lut); + void set_GEM_roll_L2_CSC_max_wg_ME11_odd(t_lut lut); + + // GEM-CSC trigger: slope correction + void set_CSC_slope_cosi_2to1_L1_ME11_even(t_lut lut); + void set_CSC_slope_cosi_2to1_L1_ME11_odd(t_lut lut); + void set_CSC_slope_cosi_3to1_L1_ME11_even(t_lut lut); + void set_CSC_slope_cosi_3to1_L1_ME11_odd(t_lut lut); + + void set_CSC_slope_cosi_corr_L1_ME11_even(t_lut lut); + void set_CSC_slope_cosi_corr_L2_ME11_even(t_lut lut); + void set_CSC_slope_cosi_corr_L1_ME11_odd(t_lut lut); + void set_CSC_slope_cosi_corr_L2_ME11_odd(t_lut lut); + + void set_CSC_slope_corr_L1_ME11_even(t_lut lut); + void set_CSC_slope_corr_L2_ME11_even(t_lut lut); + void set_CSC_slope_corr_L1_ME11_odd(t_lut lut); + void set_CSC_slope_corr_L2_ME11_odd(t_lut lut); + + void set_es_diff_slope_L1_ME1a_even(t_lut lut); + void set_es_diff_slope_L2_ME1a_even(t_lut lut); + void set_es_diff_slope_L1_ME1a_odd(t_lut lut); + void set_es_diff_slope_L2_ME1a_odd(t_lut lut); + void set_es_diff_slope_L1_ME1b_even(t_lut lut); + void set_es_diff_slope_L2_ME1b_even(t_lut lut); + void set_es_diff_slope_L1_ME1b_odd(t_lut lut); + void set_es_diff_slope_L2_ME1b_odd(t_lut lut); + + // getters + unsigned GEM_pad_CSC_hs_ME1b_even(unsigned pad) const; + unsigned GEM_pad_CSC_hs_ME1a_even(unsigned pad) const; + unsigned GEM_pad_CSC_hs_ME1b_odd(unsigned pad) const; + unsigned GEM_pad_CSC_hs_ME1a_odd(unsigned pad) const; + + unsigned GEM_pad_CSC_es_ME1b_even(unsigned pad) const; + unsigned GEM_pad_CSC_es_ME1a_even(unsigned pad) const; + unsigned GEM_pad_CSC_es_ME1b_odd(unsigned pad) const; + unsigned GEM_pad_CSC_es_ME1a_odd(unsigned pad) const; + + unsigned GEM_roll_L1_CSC_min_wg_ME11_even(unsigned roll) const; + unsigned GEM_roll_L1_CSC_max_wg_ME11_even(unsigned roll) const; + unsigned GEM_roll_L1_CSC_min_wg_ME11_odd(unsigned roll) const; + unsigned GEM_roll_L1_CSC_max_wg_ME11_odd(unsigned roll) const; + + unsigned GEM_roll_L2_CSC_min_wg_ME11_even(unsigned roll) const; + unsigned GEM_roll_L2_CSC_max_wg_ME11_even(unsigned roll) const; + unsigned GEM_roll_L2_CSC_min_wg_ME11_odd(unsigned roll) const; + unsigned GEM_roll_L2_CSC_max_wg_ME11_odd(unsigned roll) const; + + // GEM-CSC trigger: slope correction + unsigned CSC_slope_cosi_2to1_L1_ME11_even(unsigned channel) const; + unsigned CSC_slope_cosi_2to1_L1_ME11_odd(unsigned channel) const; + unsigned CSC_slope_cosi_3to1_L1_ME11_even(unsigned channel) const; + unsigned CSC_slope_cosi_3to1_L1_ME11_odd(unsigned channel) const; + + unsigned CSC_slope_cosi_corr_L1_ME11_even(unsigned channel) const; + unsigned CSC_slope_cosi_corr_L2_ME11_even(unsigned channel) const; + unsigned CSC_slope_cosi_corr_L1_ME11_odd(unsigned channel) const; + unsigned CSC_slope_cosi_corr_L2_ME11_odd(unsigned channel) const; + + unsigned CSC_slope_corr_L1_ME11_even(unsigned channel) const; + unsigned CSC_slope_corr_L2_ME11_even(unsigned channel) const; + unsigned CSC_slope_corr_L1_ME11_odd(unsigned channel) const; + unsigned CSC_slope_corr_L2_ME11_odd(unsigned channel) const; + + // GEM-CSC trigger: 1/8-strip difference to slope + unsigned es_diff_slope_L1_ME1a_even(unsigned es_diff) const; + unsigned es_diff_slope_L2_ME1a_even(unsigned es_diff) const; + unsigned es_diff_slope_L1_ME1a_odd(unsigned es_diff) const; + unsigned es_diff_slope_L2_ME1a_odd(unsigned es_diff) const; + unsigned es_diff_slope_L1_ME1b_even(unsigned es_diff) const; + unsigned es_diff_slope_L2_ME1b_even(unsigned es_diff) const; + unsigned es_diff_slope_L1_ME1b_odd(unsigned es_diff) const; + unsigned es_diff_slope_L2_ME1b_odd(unsigned es_diff) const; + +private: + t_lut GEM_pad_CSC_hs_ME1b_even_; + t_lut GEM_pad_CSC_hs_ME1a_even_; + t_lut GEM_pad_CSC_hs_ME1b_odd_; + t_lut GEM_pad_CSC_hs_ME1a_odd_; + + t_lut GEM_pad_CSC_es_ME1b_even_; + t_lut GEM_pad_CSC_es_ME1a_even_; + t_lut GEM_pad_CSC_es_ME1b_odd_; + t_lut GEM_pad_CSC_es_ME1a_odd_; + + t_lut GEM_roll_L1_CSC_min_wg_ME11_even_; + t_lut GEM_roll_L1_CSC_max_wg_ME11_even_; + t_lut GEM_roll_L1_CSC_min_wg_ME11_odd_; + t_lut GEM_roll_L1_CSC_max_wg_ME11_odd_; + + t_lut GEM_roll_L2_CSC_min_wg_ME11_even_; + t_lut GEM_roll_L2_CSC_max_wg_ME11_even_; + t_lut GEM_roll_L2_CSC_min_wg_ME11_odd_; + t_lut GEM_roll_L2_CSC_max_wg_ME11_odd_; + + t_lut CSC_slope_cosi_2to1_L1_ME11_even_; + t_lut CSC_slope_cosi_2to1_L1_ME11_odd_; + t_lut CSC_slope_cosi_3to1_L1_ME11_even_; + t_lut CSC_slope_cosi_3to1_L1_ME11_odd_; + + t_lut CSC_slope_cosi_corr_L1_ME11_even_; + t_lut CSC_slope_cosi_corr_L2_ME11_even_; + t_lut CSC_slope_cosi_corr_L1_ME11_odd_; + t_lut CSC_slope_cosi_corr_L2_ME11_odd_; + + t_lut CSC_slope_corr_L1_ME11_even_; + t_lut CSC_slope_corr_L2_ME11_even_; + t_lut CSC_slope_corr_L1_ME11_odd_; + t_lut CSC_slope_corr_L2_ME11_odd_; + + t_lut es_diff_slope_L1_ME1a_even_; + t_lut es_diff_slope_L2_ME1a_even_; + t_lut es_diff_slope_L1_ME1a_odd_; + t_lut es_diff_slope_L2_ME1a_odd_; + t_lut es_diff_slope_L1_ME1b_even_; + t_lut es_diff_slope_L2_ME1b_even_; + t_lut es_diff_slope_L1_ME1b_odd_; + t_lut es_diff_slope_L2_ME1b_odd_; + + COND_SERIALIZABLE; +}; + +#endif diff --git a/CondFormats/CSCObjects/interface/CSCL1TPLookupTableME21ILT.h b/CondFormats/CSCObjects/interface/CSCL1TPLookupTableME21ILT.h new file mode 100644 index 0000000000000..733581f13cf44 --- /dev/null +++ b/CondFormats/CSCObjects/interface/CSCL1TPLookupTableME21ILT.h @@ -0,0 +1,85 @@ +#ifndef CondFormats_CSCObjects_CSCL1TPLookupTableME21ILT_h +#define CondFormats_CSCObjects_CSCL1TPLookupTableME21ILT_h + +#include "CondFormats/Serialization/interface/Serializable.h" +#include + +class CSCL1TPLookupTableME21ILT { +public: + CSCL1TPLookupTableME21ILT(); + + ~CSCL1TPLookupTableME21ILT() {} + + typedef std::vector t_lut; + + // setters + void set_GEM_pad_CSC_hs_ME21_even(t_lut lut); + void set_GEM_pad_CSC_hs_ME21_odd(t_lut lut); + + void set_GEM_pad_CSC_es_ME21_even(t_lut lut); + void set_GEM_pad_CSC_es_ME21_odd(t_lut lut); + + void set_GEM_roll_L1_CSC_min_wg_ME21_even(t_lut lut); + void set_GEM_roll_L1_CSC_max_wg_ME21_even(t_lut lut); + void set_GEM_roll_L1_CSC_min_wg_ME21_odd(t_lut lut); + void set_GEM_roll_L1_CSC_max_wg_ME21_odd(t_lut lut); + + void set_GEM_roll_L2_CSC_min_wg_ME21_even(t_lut lut); + void set_GEM_roll_L2_CSC_max_wg_ME21_even(t_lut lut); + void set_GEM_roll_L2_CSC_min_wg_ME21_odd(t_lut lut); + void set_GEM_roll_L2_CSC_max_wg_ME21_odd(t_lut lut); + + void set_es_diff_slope_L1_ME21_even(t_lut lut); + void set_es_diff_slope_L2_ME21_even(t_lut lut); + void set_es_diff_slope_L1_ME21_odd(t_lut lut); + void set_es_diff_slope_L2_ME21_odd(t_lut lut); + + // getters + unsigned GEM_pad_CSC_hs_ME21_even(unsigned pad) const; + unsigned GEM_pad_CSC_hs_ME21_odd(unsigned pad) const; + + unsigned GEM_pad_CSC_es_ME21_even(unsigned pad) const; + unsigned GEM_pad_CSC_es_ME21_odd(unsigned pad) const; + + unsigned GEM_roll_L1_CSC_min_wg_ME21_even(unsigned roll) const; + unsigned GEM_roll_L1_CSC_max_wg_ME21_even(unsigned roll) const; + unsigned GEM_roll_L1_CSC_min_wg_ME21_odd(unsigned roll) const; + unsigned GEM_roll_L1_CSC_max_wg_ME21_odd(unsigned roll) const; + + unsigned GEM_roll_L2_CSC_min_wg_ME21_even(unsigned roll) const; + unsigned GEM_roll_L2_CSC_max_wg_ME21_even(unsigned roll) const; + unsigned GEM_roll_L2_CSC_min_wg_ME21_odd(unsigned roll) const; + unsigned GEM_roll_L2_CSC_max_wg_ME21_odd(unsigned roll) const; + + // GEM-CSC trigger: 1/8-strip difference to slope + unsigned es_diff_slope_L1_ME21_even(unsigned es_diff) const; + unsigned es_diff_slope_L2_ME21_even(unsigned es_diff) const; + unsigned es_diff_slope_L1_ME21_odd(unsigned es_diff) const; + unsigned es_diff_slope_L2_ME21_odd(unsigned es_diff) const; + +private: + std::vector GEM_pad_CSC_hs_ME21_even_; + std::vector GEM_pad_CSC_hs_ME21_odd_; + + std::vector GEM_pad_CSC_es_ME21_even_; + std::vector GEM_pad_CSC_es_ME21_odd_; + + std::vector GEM_roll_L1_CSC_min_wg_ME21_even_; + std::vector GEM_roll_L1_CSC_max_wg_ME21_even_; + std::vector GEM_roll_L1_CSC_min_wg_ME21_odd_; + std::vector GEM_roll_L1_CSC_max_wg_ME21_odd_; + + std::vector GEM_roll_L2_CSC_min_wg_ME21_even_; + std::vector GEM_roll_L2_CSC_max_wg_ME21_even_; + std::vector GEM_roll_L2_CSC_min_wg_ME21_odd_; + std::vector GEM_roll_L2_CSC_max_wg_ME21_odd_; + + std::vector es_diff_slope_L1_ME21_even_; + std::vector es_diff_slope_L2_ME21_even_; + std::vector es_diff_slope_L1_ME21_odd_; + std::vector es_diff_slope_L2_ME21_odd_; + + COND_SERIALIZABLE; +}; + +#endif diff --git a/CondFormats/CSCObjects/src/CSCL1TPLookupTableCCLUT.cc b/CondFormats/CSCObjects/src/CSCL1TPLookupTableCCLUT.cc new file mode 100644 index 0000000000000..85db058d93587 --- /dev/null +++ b/CondFormats/CSCObjects/src/CSCL1TPLookupTableCCLUT.cc @@ -0,0 +1,18 @@ +#include "CondFormats/CSCObjects/interface/CSCL1TPLookupTableCCLUT.h" + +CSCL1TPLookupTableCCLUT::CSCL1TPLookupTableCCLUT() { + cclutPosition_.reserve(5); + cclutSlope_.reserve(5); +} + +void CSCL1TPLookupTableCCLUT::set_cclutPosition(t_lut lut) { cclutPosition_ = std::move(lut); } + +void CSCL1TPLookupTableCCLUT::set_cclutSlope(t_lut lut) { cclutSlope_ = std::move(lut); } + +unsigned CSCL1TPLookupTableCCLUT::cclutPosition(unsigned pattern, unsigned code) const { + return cclutPosition_.at(pattern)[code]; +} + +unsigned CSCL1TPLookupTableCCLUT::cclutSlope(unsigned pattern, unsigned code) const { + return cclutSlope_.at(pattern)[code]; +} diff --git a/CondFormats/CSCObjects/src/CSCL1TPLookupTableME11ILT.cc b/CondFormats/CSCObjects/src/CSCL1TPLookupTableME11ILT.cc new file mode 100644 index 0000000000000..c0dab08691faf --- /dev/null +++ b/CondFormats/CSCObjects/src/CSCL1TPLookupTableME11ILT.cc @@ -0,0 +1,321 @@ +#include "CondFormats/CSCObjects/interface/CSCL1TPLookupTableME11ILT.h" + +CSCL1TPLookupTableME11ILT::CSCL1TPLookupTableME11ILT() + : GEM_pad_CSC_hs_ME1b_even_(0), + GEM_pad_CSC_hs_ME1a_even_(0), + GEM_pad_CSC_hs_ME1b_odd_(0), + GEM_pad_CSC_hs_ME1a_odd_(0), + + GEM_pad_CSC_es_ME1b_even_(0), + GEM_pad_CSC_es_ME1a_even_(0), + GEM_pad_CSC_es_ME1b_odd_(0), + GEM_pad_CSC_es_ME1a_odd_(0), + + GEM_roll_L1_CSC_min_wg_ME11_even_(0), + GEM_roll_L1_CSC_max_wg_ME11_even_(0), + GEM_roll_L1_CSC_min_wg_ME11_odd_(0), + GEM_roll_L1_CSC_max_wg_ME11_odd_(0), + + GEM_roll_L2_CSC_min_wg_ME11_even_(0), + GEM_roll_L2_CSC_max_wg_ME11_even_(0), + GEM_roll_L2_CSC_min_wg_ME11_odd_(0), + GEM_roll_L2_CSC_max_wg_ME11_odd_(0), + + CSC_slope_cosi_2to1_L1_ME11_even_(0), + CSC_slope_cosi_2to1_L1_ME11_odd_(0), + CSC_slope_cosi_3to1_L1_ME11_even_(0), + CSC_slope_cosi_3to1_L1_ME11_odd_(0), + + CSC_slope_cosi_corr_L1_ME11_even_(0), + CSC_slope_cosi_corr_L2_ME11_even_(0), + CSC_slope_cosi_corr_L1_ME11_odd_(0), + CSC_slope_cosi_corr_L2_ME11_odd_(0), + + CSC_slope_corr_L1_ME11_even_(0), + CSC_slope_corr_L2_ME11_even_(0), + CSC_slope_corr_L1_ME11_odd_(0), + CSC_slope_corr_L2_ME11_odd_(0), + + es_diff_slope_L1_ME1a_even_(0), + es_diff_slope_L2_ME1a_even_(0), + es_diff_slope_L1_ME1a_odd_(0), + es_diff_slope_L2_ME1a_odd_(0), + es_diff_slope_L1_ME1b_even_(0), + es_diff_slope_L2_ME1b_even_(0), + es_diff_slope_L1_ME1b_odd_(0), + es_diff_slope_L2_ME1b_odd_(0) {} + +// GEM-CSC trigger: coordinate conversion +void CSCL1TPLookupTableME11ILT::set_GEM_pad_CSC_hs_ME1b_even(t_lut lut) { GEM_pad_CSC_hs_ME1b_even_ = std::move(lut); } + +void CSCL1TPLookupTableME11ILT::set_GEM_pad_CSC_hs_ME1a_even(t_lut lut) { GEM_pad_CSC_hs_ME1a_even_ = std::move(lut); } + +void CSCL1TPLookupTableME11ILT::set_GEM_pad_CSC_hs_ME1b_odd(t_lut lut) { GEM_pad_CSC_hs_ME1b_odd_ = std::move(lut); } + +void CSCL1TPLookupTableME11ILT::set_GEM_pad_CSC_hs_ME1a_odd(t_lut lut) { GEM_pad_CSC_hs_ME1a_odd_ = std::move(lut); } + +void CSCL1TPLookupTableME11ILT::set_GEM_pad_CSC_es_ME1b_even(t_lut lut) { GEM_pad_CSC_es_ME1b_even_ = std::move(lut); } + +void CSCL1TPLookupTableME11ILT::set_GEM_pad_CSC_es_ME1a_even(t_lut lut) { GEM_pad_CSC_es_ME1a_even_ = std::move(lut); } + +void CSCL1TPLookupTableME11ILT::set_GEM_pad_CSC_es_ME1b_odd(t_lut lut) { GEM_pad_CSC_es_ME1b_odd_ = std::move(lut); } + +void CSCL1TPLookupTableME11ILT::set_GEM_pad_CSC_es_ME1a_odd(t_lut lut) { GEM_pad_CSC_es_ME1a_odd_ = std::move(lut); } + +void CSCL1TPLookupTableME11ILT::set_GEM_roll_L1_CSC_min_wg_ME11_even(t_lut lut) { + GEM_roll_L1_CSC_min_wg_ME11_even_ = std::move(lut); +} + +void CSCL1TPLookupTableME11ILT::set_GEM_roll_L1_CSC_max_wg_ME11_even(t_lut lut) { + GEM_roll_L1_CSC_max_wg_ME11_even_ = std::move(lut); +} + +void CSCL1TPLookupTableME11ILT::set_GEM_roll_L1_CSC_min_wg_ME11_odd(t_lut lut) { + GEM_roll_L1_CSC_min_wg_ME11_odd_ = std::move(lut); +} + +void CSCL1TPLookupTableME11ILT::set_GEM_roll_L1_CSC_max_wg_ME11_odd(t_lut lut) { + GEM_roll_L1_CSC_max_wg_ME11_odd_ = std::move(lut); +} + +void CSCL1TPLookupTableME11ILT::set_GEM_roll_L2_CSC_min_wg_ME11_even(t_lut lut) { + GEM_roll_L2_CSC_min_wg_ME11_even_ = std::move(lut); +} + +void CSCL1TPLookupTableME11ILT::set_GEM_roll_L2_CSC_max_wg_ME11_even(t_lut lut) { + GEM_roll_L2_CSC_max_wg_ME11_even_ = std::move(lut); +} + +void CSCL1TPLookupTableME11ILT::set_GEM_roll_L2_CSC_min_wg_ME11_odd(t_lut lut) { + GEM_roll_L2_CSC_min_wg_ME11_odd_ = std::move(lut); +} + +void CSCL1TPLookupTableME11ILT::set_GEM_roll_L2_CSC_max_wg_ME11_odd(t_lut lut) { + GEM_roll_L2_CSC_max_wg_ME11_odd_ = std::move(lut); +} + +// GEM-CSC trigger: slope correction +void CSCL1TPLookupTableME11ILT::set_CSC_slope_cosi_2to1_L1_ME11_even(t_lut lut) { + CSC_slope_cosi_2to1_L1_ME11_even_ = std::move(lut); +} + +void CSCL1TPLookupTableME11ILT::set_CSC_slope_cosi_2to1_L1_ME11_odd(t_lut lut) { + CSC_slope_cosi_2to1_L1_ME11_odd_ = std::move(lut); +} + +void CSCL1TPLookupTableME11ILT::set_CSC_slope_cosi_3to1_L1_ME11_even(t_lut lut) { + CSC_slope_cosi_3to1_L1_ME11_even_ = std::move(lut); +} + +void CSCL1TPLookupTableME11ILT::set_CSC_slope_cosi_3to1_L1_ME11_odd(t_lut lut) { + CSC_slope_cosi_3to1_L1_ME11_odd_ = std::move(lut); +} + +void CSCL1TPLookupTableME11ILT::set_CSC_slope_cosi_corr_L1_ME11_even(t_lut lut) { + CSC_slope_cosi_corr_L1_ME11_even_ = std::move(lut); +} +void CSCL1TPLookupTableME11ILT::set_CSC_slope_cosi_corr_L2_ME11_even(t_lut lut) { + CSC_slope_cosi_corr_L2_ME11_even_ = std::move(lut); +} + +void CSCL1TPLookupTableME11ILT::set_CSC_slope_cosi_corr_L1_ME11_odd(t_lut lut) { + CSC_slope_cosi_corr_L1_ME11_odd_ = std::move(lut); +} + +void CSCL1TPLookupTableME11ILT::set_CSC_slope_cosi_corr_L2_ME11_odd(t_lut lut) { + CSC_slope_cosi_corr_L2_ME11_odd_ = std::move(lut); +} + +void CSCL1TPLookupTableME11ILT::set_CSC_slope_corr_L1_ME11_even(t_lut lut) { + CSC_slope_corr_L1_ME11_even_ = std::move(lut); +} + +void CSCL1TPLookupTableME11ILT::set_CSC_slope_corr_L2_ME11_even(t_lut lut) { + CSC_slope_corr_L2_ME11_even_ = std::move(lut); +} + +void CSCL1TPLookupTableME11ILT::set_CSC_slope_corr_L1_ME11_odd(t_lut lut) { + CSC_slope_corr_L1_ME11_odd_ = std::move(lut); +} + +void CSCL1TPLookupTableME11ILT::set_CSC_slope_corr_L2_ME11_odd(t_lut lut) { + CSC_slope_corr_L2_ME11_odd_ = std::move(lut); +} + +void CSCL1TPLookupTableME11ILT::set_es_diff_slope_L1_ME1a_even(t_lut lut) { + es_diff_slope_L1_ME1a_even_ = std::move(lut); +} + +void CSCL1TPLookupTableME11ILT::set_es_diff_slope_L2_ME1a_even(t_lut lut) { + es_diff_slope_L2_ME1a_even_ = std::move(lut); +} + +void CSCL1TPLookupTableME11ILT::set_es_diff_slope_L1_ME1a_odd(t_lut lut) { + es_diff_slope_L1_ME1a_odd_ = std::move(lut); +} + +void CSCL1TPLookupTableME11ILT::set_es_diff_slope_L2_ME1a_odd(t_lut lut) { + es_diff_slope_L2_ME1a_odd_ = std::move(lut); +} + +void CSCL1TPLookupTableME11ILT::set_es_diff_slope_L1_ME1b_even(t_lut lut) { + es_diff_slope_L1_ME1b_even_ = std::move(lut); +} + +void CSCL1TPLookupTableME11ILT::set_es_diff_slope_L2_ME1b_even(t_lut lut) { + es_diff_slope_L2_ME1b_even_ = std::move(lut); +} + +void CSCL1TPLookupTableME11ILT::set_es_diff_slope_L1_ME1b_odd(t_lut lut) { + es_diff_slope_L1_ME1b_odd_ = std::move(lut); +} + +void CSCL1TPLookupTableME11ILT::set_es_diff_slope_L2_ME1b_odd(t_lut lut) { + es_diff_slope_L2_ME1b_odd_ = std::move(lut); +} + +// GEM-CSC trigger: coordinate conversion +unsigned CSCL1TPLookupTableME11ILT::GEM_pad_CSC_hs_ME1b_even(unsigned pad) const { + return GEM_pad_CSC_hs_ME1b_even_.at(pad); +} + +unsigned CSCL1TPLookupTableME11ILT::GEM_pad_CSC_hs_ME1a_even(unsigned pad) const { + return GEM_pad_CSC_hs_ME1a_even_.at(pad); +} + +unsigned CSCL1TPLookupTableME11ILT::GEM_pad_CSC_hs_ME1b_odd(unsigned pad) const { + return GEM_pad_CSC_hs_ME1b_odd_.at(pad); +} + +unsigned CSCL1TPLookupTableME11ILT::GEM_pad_CSC_hs_ME1a_odd(unsigned pad) const { + return GEM_pad_CSC_hs_ME1a_odd_.at(pad); +} + +unsigned CSCL1TPLookupTableME11ILT::GEM_pad_CSC_es_ME1b_even(unsigned pad) const { + return GEM_pad_CSC_es_ME1b_even_.at(pad); +} + +unsigned CSCL1TPLookupTableME11ILT::GEM_pad_CSC_es_ME1a_even(unsigned pad) const { + return GEM_pad_CSC_es_ME1a_even_.at(pad); +} + +unsigned CSCL1TPLookupTableME11ILT::GEM_pad_CSC_es_ME1b_odd(unsigned pad) const { + return GEM_pad_CSC_es_ME1b_odd_.at(pad); +} + +unsigned CSCL1TPLookupTableME11ILT::GEM_pad_CSC_es_ME1a_odd(unsigned pad) const { + return GEM_pad_CSC_es_ME1a_odd_.at(pad); +} + +unsigned CSCL1TPLookupTableME11ILT::GEM_roll_L1_CSC_min_wg_ME11_even(unsigned roll) const { + return GEM_roll_L1_CSC_min_wg_ME11_even_[roll]; +} + +unsigned CSCL1TPLookupTableME11ILT::GEM_roll_L1_CSC_max_wg_ME11_even(unsigned roll) const { + return GEM_roll_L1_CSC_max_wg_ME11_even_[roll]; +} + +unsigned CSCL1TPLookupTableME11ILT::GEM_roll_L1_CSC_min_wg_ME11_odd(unsigned roll) const { + return GEM_roll_L1_CSC_min_wg_ME11_odd_[roll]; +} + +unsigned CSCL1TPLookupTableME11ILT::GEM_roll_L1_CSC_max_wg_ME11_odd(unsigned roll) const { + return GEM_roll_L1_CSC_max_wg_ME11_odd_[roll]; +} + +unsigned CSCL1TPLookupTableME11ILT::GEM_roll_L2_CSC_min_wg_ME11_even(unsigned roll) const { + return GEM_roll_L2_CSC_min_wg_ME11_even_[roll]; +} + +unsigned CSCL1TPLookupTableME11ILT::GEM_roll_L2_CSC_max_wg_ME11_even(unsigned roll) const { + return GEM_roll_L2_CSC_max_wg_ME11_even_[roll]; +} + +unsigned CSCL1TPLookupTableME11ILT::GEM_roll_L2_CSC_min_wg_ME11_odd(unsigned roll) const { + return GEM_roll_L2_CSC_min_wg_ME11_odd_[roll]; +} + +unsigned CSCL1TPLookupTableME11ILT::GEM_roll_L2_CSC_max_wg_ME11_odd(unsigned roll) const { + return GEM_roll_L2_CSC_max_wg_ME11_odd_[roll]; +} + +// GEM-CSC trigger: slope correction +unsigned CSCL1TPLookupTableME11ILT::CSC_slope_cosi_2to1_L1_ME11_even(unsigned slope) const { + return CSC_slope_cosi_2to1_L1_ME11_even_[slope]; +} + +unsigned CSCL1TPLookupTableME11ILT::CSC_slope_cosi_2to1_L1_ME11_odd(unsigned slope) const { + return CSC_slope_cosi_2to1_L1_ME11_odd_[slope]; +} + +unsigned CSCL1TPLookupTableME11ILT::CSC_slope_cosi_3to1_L1_ME11_even(unsigned slope) const { + return CSC_slope_cosi_3to1_L1_ME11_even_[slope]; +} + +unsigned CSCL1TPLookupTableME11ILT::CSC_slope_cosi_3to1_L1_ME11_odd(unsigned slope) const { + return CSC_slope_cosi_3to1_L1_ME11_odd_[slope]; +} + +unsigned CSCL1TPLookupTableME11ILT::CSC_slope_cosi_corr_L1_ME11_even(unsigned slope) const { + return CSC_slope_cosi_corr_L1_ME11_even_[slope]; +} + +unsigned CSCL1TPLookupTableME11ILT::CSC_slope_cosi_corr_L1_ME11_odd(unsigned slope) const { + return CSC_slope_cosi_corr_L1_ME11_odd_[slope]; +} + +unsigned CSCL1TPLookupTableME11ILT::CSC_slope_cosi_corr_L2_ME11_even(unsigned slope) const { + return CSC_slope_cosi_corr_L2_ME11_even_[slope]; +} + +unsigned CSCL1TPLookupTableME11ILT::CSC_slope_cosi_corr_L2_ME11_odd(unsigned slope) const { + return CSC_slope_cosi_corr_L2_ME11_odd_[slope]; +} + +unsigned CSCL1TPLookupTableME11ILT::CSC_slope_corr_L1_ME11_even(unsigned slope) const { + return CSC_slope_corr_L1_ME11_even_[slope]; +} + +unsigned CSCL1TPLookupTableME11ILT::CSC_slope_corr_L1_ME11_odd(unsigned slope) const { + return CSC_slope_corr_L1_ME11_odd_[slope]; +} + +unsigned CSCL1TPLookupTableME11ILT::CSC_slope_corr_L2_ME11_even(unsigned slope) const { + return CSC_slope_corr_L2_ME11_even_[slope]; +} + +unsigned CSCL1TPLookupTableME11ILT::CSC_slope_corr_L2_ME11_odd(unsigned slope) const { + return CSC_slope_corr_L2_ME11_odd_[slope]; +} + +unsigned CSCL1TPLookupTableME11ILT::es_diff_slope_L1_ME1a_even(unsigned es_diff) const { + return es_diff_slope_L1_ME1a_even_[es_diff]; +} + +unsigned CSCL1TPLookupTableME11ILT::es_diff_slope_L2_ME1a_even(unsigned es_diff) const { + return es_diff_slope_L2_ME1a_even_[es_diff]; +} + +unsigned CSCL1TPLookupTableME11ILT::es_diff_slope_L1_ME1a_odd(unsigned es_diff) const { + return es_diff_slope_L1_ME1a_odd_[es_diff]; +} + +unsigned CSCL1TPLookupTableME11ILT::es_diff_slope_L2_ME1a_odd(unsigned es_diff) const { + return es_diff_slope_L2_ME1a_odd_[es_diff]; +} + +unsigned CSCL1TPLookupTableME11ILT::es_diff_slope_L1_ME1b_even(unsigned es_diff) const { + return es_diff_slope_L1_ME1b_even_[es_diff]; +} + +unsigned CSCL1TPLookupTableME11ILT::es_diff_slope_L2_ME1b_even(unsigned es_diff) const { + return es_diff_slope_L2_ME1b_even_[es_diff]; +} + +unsigned CSCL1TPLookupTableME11ILT::es_diff_slope_L1_ME1b_odd(unsigned es_diff) const { + return es_diff_slope_L1_ME1b_odd_[es_diff]; +} + +unsigned CSCL1TPLookupTableME11ILT::es_diff_slope_L2_ME1b_odd(unsigned es_diff) const { + return es_diff_slope_L2_ME1b_odd_[es_diff]; +} diff --git a/CondFormats/CSCObjects/src/CSCL1TPLookupTableME21ILT.cc b/CondFormats/CSCObjects/src/CSCL1TPLookupTableME21ILT.cc new file mode 100644 index 0000000000000..3ff567ca10645 --- /dev/null +++ b/CondFormats/CSCObjects/src/CSCL1TPLookupTableME21ILT.cc @@ -0,0 +1,143 @@ +#include "CondFormats/CSCObjects/interface/CSCL1TPLookupTableME21ILT.h" + +CSCL1TPLookupTableME21ILT::CSCL1TPLookupTableME21ILT() + : GEM_pad_CSC_hs_ME21_even_(0), + GEM_pad_CSC_hs_ME21_odd_(0), + + GEM_pad_CSC_es_ME21_even_(0), + GEM_pad_CSC_es_ME21_odd_(0), + + GEM_roll_L1_CSC_min_wg_ME21_even_(0), + GEM_roll_L1_CSC_max_wg_ME21_even_(0), + GEM_roll_L1_CSC_min_wg_ME21_odd_(0), + GEM_roll_L1_CSC_max_wg_ME21_odd_(0), + + GEM_roll_L2_CSC_min_wg_ME21_even_(0), + GEM_roll_L2_CSC_max_wg_ME21_even_(0), + GEM_roll_L2_CSC_min_wg_ME21_odd_(0), + GEM_roll_L2_CSC_max_wg_ME21_odd_(0), + + es_diff_slope_L1_ME21_even_(0), + es_diff_slope_L2_ME21_even_(0), + es_diff_slope_L1_ME21_odd_(0), + es_diff_slope_L2_ME21_odd_(0) {} + +void CSCL1TPLookupTableME21ILT::set_GEM_pad_CSC_hs_ME21_even(t_lut lut) { GEM_pad_CSC_hs_ME21_even_ = std::move(lut); } + +void CSCL1TPLookupTableME21ILT::set_GEM_pad_CSC_hs_ME21_odd(t_lut lut) { GEM_pad_CSC_hs_ME21_odd_ = std::move(lut); } + +void CSCL1TPLookupTableME21ILT::set_GEM_pad_CSC_es_ME21_even(t_lut lut) { GEM_pad_CSC_es_ME21_even_ = std::move(lut); } + +void CSCL1TPLookupTableME21ILT::set_GEM_pad_CSC_es_ME21_odd(t_lut lut) { GEM_pad_CSC_es_ME21_odd_ = std::move(lut); } + +void CSCL1TPLookupTableME21ILT::set_GEM_roll_L1_CSC_min_wg_ME21_even(t_lut lut) { + GEM_roll_L1_CSC_min_wg_ME21_even_ = std::move(lut); +} + +void CSCL1TPLookupTableME21ILT::set_GEM_roll_L1_CSC_max_wg_ME21_even(t_lut lut) { + GEM_roll_L1_CSC_max_wg_ME21_even_ = std::move(lut); +} + +void CSCL1TPLookupTableME21ILT::set_GEM_roll_L1_CSC_min_wg_ME21_odd(t_lut lut) { + GEM_roll_L1_CSC_min_wg_ME21_odd_ = std::move(lut); +} + +void CSCL1TPLookupTableME21ILT::set_GEM_roll_L1_CSC_max_wg_ME21_odd(t_lut lut) { + GEM_roll_L1_CSC_max_wg_ME21_odd_ = std::move(lut); +} + +void CSCL1TPLookupTableME21ILT::set_GEM_roll_L2_CSC_min_wg_ME21_even(t_lut lut) { + GEM_roll_L2_CSC_min_wg_ME21_even_ = std::move(lut); +} + +void CSCL1TPLookupTableME21ILT::set_GEM_roll_L2_CSC_max_wg_ME21_even(t_lut lut) { + GEM_roll_L2_CSC_max_wg_ME21_even_ = std::move(lut); +} + +void CSCL1TPLookupTableME21ILT::set_GEM_roll_L2_CSC_min_wg_ME21_odd(t_lut lut) { + GEM_roll_L2_CSC_min_wg_ME21_odd_ = std::move(lut); +} + +void CSCL1TPLookupTableME21ILT::set_GEM_roll_L2_CSC_max_wg_ME21_odd(t_lut lut) { + GEM_roll_L2_CSC_max_wg_ME21_odd_ = std::move(lut); +} + +void CSCL1TPLookupTableME21ILT::set_es_diff_slope_L1_ME21_even(t_lut lut) { + es_diff_slope_L1_ME21_even_ = std::move(lut); +} + +void CSCL1TPLookupTableME21ILT::set_es_diff_slope_L2_ME21_even(t_lut lut) { + es_diff_slope_L2_ME21_even_ = std::move(lut); +} + +void CSCL1TPLookupTableME21ILT::set_es_diff_slope_L1_ME21_odd(t_lut lut) { + es_diff_slope_L1_ME21_odd_ = std::move(lut); +} + +void CSCL1TPLookupTableME21ILT::set_es_diff_slope_L2_ME21_odd(t_lut lut) { + es_diff_slope_L2_ME21_odd_ = std::move(lut); +} + +unsigned CSCL1TPLookupTableME21ILT::GEM_pad_CSC_hs_ME21_even(unsigned pad) const { + return GEM_pad_CSC_hs_ME21_even_[pad]; +} + +unsigned CSCL1TPLookupTableME21ILT::GEM_pad_CSC_hs_ME21_odd(unsigned pad) const { + return GEM_pad_CSC_hs_ME21_odd_[pad]; +} + +unsigned CSCL1TPLookupTableME21ILT::GEM_pad_CSC_es_ME21_even(unsigned pad) const { + return GEM_pad_CSC_es_ME21_even_[pad]; +} + +unsigned CSCL1TPLookupTableME21ILT::GEM_pad_CSC_es_ME21_odd(unsigned pad) const { + return GEM_pad_CSC_es_ME21_odd_[pad]; +} + +unsigned CSCL1TPLookupTableME21ILT::GEM_roll_L1_CSC_min_wg_ME21_even(unsigned roll) const { + return GEM_roll_L1_CSC_min_wg_ME21_even_[roll]; +} + +unsigned CSCL1TPLookupTableME21ILT::GEM_roll_L1_CSC_max_wg_ME21_even(unsigned roll) const { + return GEM_roll_L1_CSC_max_wg_ME21_even_[roll]; +} + +unsigned CSCL1TPLookupTableME21ILT::GEM_roll_L1_CSC_min_wg_ME21_odd(unsigned roll) const { + return GEM_roll_L1_CSC_min_wg_ME21_odd_[roll]; +} + +unsigned CSCL1TPLookupTableME21ILT::GEM_roll_L1_CSC_max_wg_ME21_odd(unsigned roll) const { + return GEM_roll_L1_CSC_max_wg_ME21_odd_[roll]; +} + +unsigned CSCL1TPLookupTableME21ILT::GEM_roll_L2_CSC_min_wg_ME21_even(unsigned roll) const { + return GEM_roll_L2_CSC_min_wg_ME21_even_[roll]; +} + +unsigned CSCL1TPLookupTableME21ILT::GEM_roll_L2_CSC_max_wg_ME21_even(unsigned roll) const { + return GEM_roll_L2_CSC_max_wg_ME21_even_[roll]; +} + +unsigned CSCL1TPLookupTableME21ILT::GEM_roll_L2_CSC_min_wg_ME21_odd(unsigned roll) const { + return GEM_roll_L2_CSC_min_wg_ME21_odd_[roll]; +} + +unsigned CSCL1TPLookupTableME21ILT::GEM_roll_L2_CSC_max_wg_ME21_odd(unsigned roll) const { + return GEM_roll_L2_CSC_max_wg_ME21_odd_[roll]; +} + +unsigned CSCL1TPLookupTableME21ILT::es_diff_slope_L1_ME21_even(unsigned es_diff) const { + return es_diff_slope_L1_ME21_even_[es_diff]; +} + +unsigned CSCL1TPLookupTableME21ILT::es_diff_slope_L2_ME21_even(unsigned es_diff) const { + return es_diff_slope_L2_ME21_even_[es_diff]; +} + +unsigned CSCL1TPLookupTableME21ILT::es_diff_slope_L1_ME21_odd(unsigned es_diff) const { + return es_diff_slope_L1_ME21_odd_[es_diff]; +} + +unsigned CSCL1TPLookupTableME21ILT::es_diff_slope_L2_ME21_odd(unsigned es_diff) const { + return es_diff_slope_L2_ME21_odd_[es_diff]; +} diff --git a/CondFormats/CSCObjects/src/T_EventSetup_CSCL1TPLookupTableCCLUT.cc b/CondFormats/CSCObjects/src/T_EventSetup_CSCL1TPLookupTableCCLUT.cc new file mode 100644 index 0000000000000..9deec5db3b5cf --- /dev/null +++ b/CondFormats/CSCObjects/src/T_EventSetup_CSCL1TPLookupTableCCLUT.cc @@ -0,0 +1,4 @@ +#include "CondFormats/CSCObjects/interface/CSCL1TPLookupTableCCLUT.h" +#include "FWCore/Utilities/interface/typelookup.h" + +TYPELOOKUP_DATA_REG(CSCL1TPLookupTableCCLUT); diff --git a/CondFormats/CSCObjects/src/T_EventSetup_CSCL1TPLookupTableME11ILT.cc b/CondFormats/CSCObjects/src/T_EventSetup_CSCL1TPLookupTableME11ILT.cc new file mode 100644 index 0000000000000..69fd0f8efbed9 --- /dev/null +++ b/CondFormats/CSCObjects/src/T_EventSetup_CSCL1TPLookupTableME11ILT.cc @@ -0,0 +1,4 @@ +#include "CondFormats/CSCObjects/interface/CSCL1TPLookupTableME11ILT.h" +#include "FWCore/Utilities/interface/typelookup.h" + +TYPELOOKUP_DATA_REG(CSCL1TPLookupTableME11ILT); diff --git a/CondFormats/CSCObjects/src/T_EventSetup_CSCL1TPLookupTableME21ILT.cc b/CondFormats/CSCObjects/src/T_EventSetup_CSCL1TPLookupTableME21ILT.cc new file mode 100644 index 0000000000000..bb452ba805264 --- /dev/null +++ b/CondFormats/CSCObjects/src/T_EventSetup_CSCL1TPLookupTableME21ILT.cc @@ -0,0 +1,4 @@ +#include "CondFormats/CSCObjects/interface/CSCL1TPLookupTableME21ILT.h" +#include "FWCore/Utilities/interface/typelookup.h" + +TYPELOOKUP_DATA_REG(CSCL1TPLookupTableME21ILT); diff --git a/CondFormats/CSCObjects/src/classes_def.xml b/CondFormats/CSCObjects/src/classes_def.xml index 5355aff34ee2c..4ec72ea55e9ea 100644 --- a/CondFormats/CSCObjects/src/classes_def.xml +++ b/CondFormats/CSCObjects/src/classes_def.xml @@ -15,13 +15,13 @@ - + - + @@ -99,9 +99,13 @@ - + + + + + @@ -134,5 +138,4 @@ - - + diff --git a/CondFormats/CSCObjects/src/headers.h b/CondFormats/CSCObjects/src/headers.h index 29296e98f17c6..496bc998f6f8a 100644 --- a/CondFormats/CSCObjects/src/headers.h +++ b/CondFormats/CSCObjects/src/headers.h @@ -26,3 +26,6 @@ #include "CondFormats/CSCObjects/interface/CSCTriggerMapping.h" #include "CondFormats/CSCObjects/interface/CSCL1TPParameters.h" #include "CondFormats/CSCObjects/interface/CSCDBL1TPParameters.h" +#include "CondFormats/CSCObjects/interface/CSCL1TPLookupTableCCLUT.h" +#include "CondFormats/CSCObjects/interface/CSCL1TPLookupTableME11ILT.h" +#include "CondFormats/CSCObjects/interface/CSCL1TPLookupTableME21ILT.h" diff --git a/CondFormats/CSCObjects/test/testSerializationCSCObjects.cpp b/CondFormats/CSCObjects/test/testSerializationCSCObjects.cpp index d36fbf5e1e22a..49d8d6fb57ddb 100644 --- a/CondFormats/CSCObjects/test/testSerializationCSCObjects.cpp +++ b/CondFormats/CSCObjects/test/testSerializationCSCObjects.cpp @@ -34,6 +34,9 @@ int main() { testSerialization(); testSerialization(); testSerialization(); + testSerialization(); + testSerialization(); + testSerialization(); testSerialization(); testSerialization(); testSerialization(); diff --git a/CondFormats/CastorObjects/interface/AllClasses.h b/CondFormats/CastorObjects/interface/AllClasses.h deleted file mode 100644 index ac0d1349110df..0000000000000 --- a/CondFormats/CastorObjects/interface/AllClasses.h +++ /dev/null @@ -1,16 +0,0 @@ -#ifndef CondFormats_CastorObjects_AllClasses_h -#define CondFormats_CastorObjects_AllClasses_h -#include "CondFormats/CastorObjects/interface/AllObjects.h" -/* -class CastorPedestals; -class CastorPedestalWidths; -class CastorGains; -class CastorRawGains; -class CastorGainWidths; -class CastorQIEShape; -class CastorQIEData; -class CastorCalibrationQIEData; -class CastorChannelQuality; -class CastorElectronicsMap; -*/ -#endif diff --git a/CondFormats/Common/interface/Constants.h b/CondFormats/Common/interface/Constants.h deleted file mode 100644 index 8a4253dbcc168..0000000000000 --- a/CondFormats/Common/interface/Constants.h +++ /dev/null @@ -1,16 +0,0 @@ -#ifndef CondCommon_Constants_h -#define CondCommon_Constants_h -#include -#include -#include - -/* constants other than time used in cond - */ - -namespace cond { - - const std::string invalidToken(" "); - -} - -#endif //CondCommon_Constants_h diff --git a/CondFormats/DataRecord/interface/CSCL1TPLookupTableCCLUTRcd.h b/CondFormats/DataRecord/interface/CSCL1TPLookupTableCCLUTRcd.h new file mode 100644 index 0000000000000..e64928d8daf25 --- /dev/null +++ b/CondFormats/DataRecord/interface/CSCL1TPLookupTableCCLUTRcd.h @@ -0,0 +1,6 @@ +#ifndef CondFormats_DataRecord_CSCL1TPLookupTableCCLUTRcd +#define CondFormats_DataRecord_CSCL1TPLookupTableCCLUTRcd +#include "FWCore/Framework/interface/EventSetupRecordImplementation.h" +class CSCL1TPLookupTableCCLUTRcd : public edm::eventsetup::EventSetupRecordImplementation { +}; +#endif diff --git a/CondFormats/DataRecord/interface/CSCL1TPLookupTableME11ILTRcd.h b/CondFormats/DataRecord/interface/CSCL1TPLookupTableME11ILTRcd.h new file mode 100644 index 0000000000000..96fdacb936c58 --- /dev/null +++ b/CondFormats/DataRecord/interface/CSCL1TPLookupTableME11ILTRcd.h @@ -0,0 +1,6 @@ +#ifndef CondFormats_DataRecord_CSCL1TPLookupTableME11ILTRcd +#define CondFormats_DataRecord_CSCL1TPLookupTableME11ILTRcd +#include "FWCore/Framework/interface/EventSetupRecordImplementation.h" +class CSCL1TPLookupTableME11ILTRcd + : public edm::eventsetup::EventSetupRecordImplementation {}; +#endif diff --git a/CondFormats/DataRecord/interface/CSCL1TPLookupTableME21ILTRcd.h b/CondFormats/DataRecord/interface/CSCL1TPLookupTableME21ILTRcd.h new file mode 100644 index 0000000000000..c9930715a9534 --- /dev/null +++ b/CondFormats/DataRecord/interface/CSCL1TPLookupTableME21ILTRcd.h @@ -0,0 +1,6 @@ +#ifndef CondFormats_DataRecord_CSCL1TPLookupTableME21ILTRcd +#define CondFormats_DataRecord_CSCL1TPLookupTableME21ILTRcd +#include "FWCore/Framework/interface/EventSetupRecordImplementation.h" +class CSCL1TPLookupTableME21ILTRcd + : public edm::eventsetup::EventSetupRecordImplementation {}; +#endif diff --git a/CondFormats/DataRecord/interface/PPSAlignmentConfigurationRcd.h b/CondFormats/DataRecord/interface/PPSAlignmentConfigurationRcd.h new file mode 100644 index 0000000000000..159b1873f7e00 --- /dev/null +++ b/CondFormats/DataRecord/interface/PPSAlignmentConfigurationRcd.h @@ -0,0 +1,15 @@ +/**************************************************************************** +* Authors: +* Jan Kašpar (jan.kaspar@gmail.com) +* Mateusz Kocot (mateuszkocot99@gmail.com) +****************************************************************************/ + +#ifndef CondFormats_DataRecord_PPSAlignmentConfigurationRcd_h +#define CondFormats_DataRecord_PPSAlignmentConfigurationRcd_h + +#include "FWCore/Framework/interface/EventSetupRecordImplementation.h" + +class PPSAlignmentConfigurationRcd + : public edm::eventsetup::EventSetupRecordImplementation {}; + +#endif diff --git a/CondFormats/DataRecord/interface/PPSAssociationCutsRcd.h b/CondFormats/DataRecord/interface/PPSAssociationCutsRcd.h new file mode 100644 index 0000000000000..fa0ded88e74a4 --- /dev/null +++ b/CondFormats/DataRecord/interface/PPSAssociationCutsRcd.h @@ -0,0 +1,8 @@ +#ifndef CondFormats_DataRecord_PPSAssociationCutsRcd_h +#define CondFormats_DataRecord_PPSAssociationCutsRcd_h + +#include "FWCore/Framework/interface/EventSetupRecordImplementation.h" + +class PPSAssociationCutsRcd : public edm::eventsetup::EventSetupRecordImplementation {}; + +#endif diff --git a/CondFormats/DataRecord/interface/SiStripBadChannelRcd.h b/CondFormats/DataRecord/interface/SiStripBadChannelRcd.h deleted file mode 100644 index af76e665c008c..0000000000000 --- a/CondFormats/DataRecord/interface/SiStripBadChannelRcd.h +++ /dev/null @@ -1 +0,0 @@ -#include "CondFormats/DataRecord/interface/SiStripCondDataRecords.h" diff --git a/CondFormats/DataRecord/interface/SiStripBadFiberRcd.h b/CondFormats/DataRecord/interface/SiStripBadFiberRcd.h deleted file mode 100644 index af76e665c008c..0000000000000 --- a/CondFormats/DataRecord/interface/SiStripBadFiberRcd.h +++ /dev/null @@ -1 +0,0 @@ -#include "CondFormats/DataRecord/interface/SiStripCondDataRecords.h" diff --git a/CondFormats/DataRecord/interface/SiStripBadModuleRcd.h b/CondFormats/DataRecord/interface/SiStripBadModuleRcd.h deleted file mode 100644 index af76e665c008c..0000000000000 --- a/CondFormats/DataRecord/interface/SiStripBadModuleRcd.h +++ /dev/null @@ -1 +0,0 @@ -#include "CondFormats/DataRecord/interface/SiStripCondDataRecords.h" diff --git a/CondFormats/DataRecord/interface/SiStripModuleHVRcd.h b/CondFormats/DataRecord/interface/SiStripModuleHVRcd.h deleted file mode 100644 index af76e665c008c..0000000000000 --- a/CondFormats/DataRecord/interface/SiStripModuleHVRcd.h +++ /dev/null @@ -1 +0,0 @@ -#include "CondFormats/DataRecord/interface/SiStripCondDataRecords.h" diff --git a/CondFormats/DataRecord/interface/SiStripPerformanceSummaryRcd.h b/CondFormats/DataRecord/interface/SiStripPerformanceSummaryRcd.h deleted file mode 100644 index af76e665c008c..0000000000000 --- a/CondFormats/DataRecord/interface/SiStripPerformanceSummaryRcd.h +++ /dev/null @@ -1 +0,0 @@ -#include "CondFormats/DataRecord/interface/SiStripCondDataRecords.h" diff --git a/CondFormats/DataRecord/interface/SiStripRunSummaryRcd.h b/CondFormats/DataRecord/interface/SiStripRunSummaryRcd.h deleted file mode 100644 index af76e665c008c..0000000000000 --- a/CondFormats/DataRecord/interface/SiStripRunSummaryRcd.h +++ /dev/null @@ -1 +0,0 @@ -#include "CondFormats/DataRecord/interface/SiStripCondDataRecords.h" diff --git a/CondFormats/DataRecord/src/CSCL1TPLookupTableCCLUTRcd.cc b/CondFormats/DataRecord/src/CSCL1TPLookupTableCCLUTRcd.cc new file mode 100644 index 0000000000000..cf8d9849d459e --- /dev/null +++ b/CondFormats/DataRecord/src/CSCL1TPLookupTableCCLUTRcd.cc @@ -0,0 +1,4 @@ +#include "CondFormats/DataRecord/interface/CSCL1TPLookupTableCCLUTRcd.h" +#include "FWCore/Framework/interface/eventsetuprecord_registration_macro.h" + +EVENTSETUP_RECORD_REG(CSCL1TPLookupTableCCLUTRcd); diff --git a/CondFormats/DataRecord/src/CSCL1TPLookupTableME11ILTRcd.cc b/CondFormats/DataRecord/src/CSCL1TPLookupTableME11ILTRcd.cc new file mode 100644 index 0000000000000..5b634bee1ed4f --- /dev/null +++ b/CondFormats/DataRecord/src/CSCL1TPLookupTableME11ILTRcd.cc @@ -0,0 +1,4 @@ +#include "CondFormats/DataRecord/interface/CSCL1TPLookupTableME11ILTRcd.h" +#include "FWCore/Framework/interface/eventsetuprecord_registration_macro.h" + +EVENTSETUP_RECORD_REG(CSCL1TPLookupTableME11ILTRcd); diff --git a/CondFormats/DataRecord/src/CSCL1TPLookupTableME21ILTRcd.cc b/CondFormats/DataRecord/src/CSCL1TPLookupTableME21ILTRcd.cc new file mode 100644 index 0000000000000..2bb72edae143d --- /dev/null +++ b/CondFormats/DataRecord/src/CSCL1TPLookupTableME21ILTRcd.cc @@ -0,0 +1,4 @@ +#include "CondFormats/DataRecord/interface/CSCL1TPLookupTableME21ILTRcd.h" +#include "FWCore/Framework/interface/eventsetuprecord_registration_macro.h" + +EVENTSETUP_RECORD_REG(CSCL1TPLookupTableME21ILTRcd); diff --git a/CondFormats/DataRecord/src/PPSAlignmentConfigurationRcd.cc b/CondFormats/DataRecord/src/PPSAlignmentConfigurationRcd.cc new file mode 100644 index 0000000000000..4c952462c6597 --- /dev/null +++ b/CondFormats/DataRecord/src/PPSAlignmentConfigurationRcd.cc @@ -0,0 +1,10 @@ +/**************************************************************************** +* Authors: +* Jan Kašpar (jan.kaspar@gmail.com) +* Mateusz Kocot (mateuszkocot99@gmail.com) +****************************************************************************/ + +#include "CondFormats/DataRecord/interface/PPSAlignmentConfigurationRcd.h" +#include "FWCore/Framework/interface/eventsetuprecord_registration_macro.h" + +EVENTSETUP_RECORD_REG(PPSAlignmentConfigurationRcd); diff --git a/CondFormats/DataRecord/src/PPSAssociationCutsRcd.cc b/CondFormats/DataRecord/src/PPSAssociationCutsRcd.cc new file mode 100644 index 0000000000000..750bda92d75ca --- /dev/null +++ b/CondFormats/DataRecord/src/PPSAssociationCutsRcd.cc @@ -0,0 +1,4 @@ +#include "CondFormats/DataRecord/interface/PPSAssociationCutsRcd.h" +#include "FWCore/Framework/interface/eventsetuprecord_registration_macro.h" + +EVENTSETUP_RECORD_REG(PPSAssociationCutsRcd); diff --git a/CondFormats/HGCalObjects/interface/HeterogeneousHGCalHEFCellPositionsConditions.h b/CondFormats/HGCalObjects/interface/HeterogeneousHGCalHEFCellPositionsConditions.h index 5dea507cc7432..1a258736c7136 100644 --- a/CondFormats/HGCalObjects/interface/HeterogeneousHGCalHEFCellPositionsConditions.h +++ b/CondFormats/HGCalObjects/interface/HeterogeneousHGCalHEFCellPositionsConditions.h @@ -10,7 +10,6 @@ #include "CUDADataFormats/HGCal/interface/HGCConditions.h" #include "Geometry/HGCalCommonData/interface/HGCalDDDConstants.h" #include "Geometry/HGCalCommonData/interface/HGCalParameters.h" -#include "RecoLocalCalo/HGCalRecProducers/plugins/KernelManagerHGCalCellPositions.h" namespace cpar = hgcal_conditions::parameters; namespace cpos = hgcal_conditions::positions; diff --git a/CondFormats/HcalObjects/interface/HcalItemArrayColl.h b/CondFormats/HcalObjects/interface/HcalItemArrayColl.h deleted file mode 100644 index 40997120b675e..0000000000000 --- a/CondFormats/HcalObjects/interface/HcalItemArrayColl.h +++ /dev/null @@ -1,101 +0,0 @@ -#ifndef CondFormats_HcalObjects_HcalItemArrayColl_h -#define CondFormats_HcalObjects_HcalItemArrayColl_h - -#include "boost/array.hpp" -#include "boost/serialization/access.hpp" -#include "boost/serialization/version.hpp" -#include "boost/serialization/shared_ptr.hpp" -#include "boost/serialization/vector.hpp" -#include "boost/version.hpp" -#if BOOST_VERSION < 106400 -#include "boost/serialization/array.hpp" -#else -#include "boost/serialization/boost_array.hpp" -#endif - -#include -#include -#include - -// -// This collection manages arrays of pointers and references. -// In particular, it can be used for storing objects in -// an inheritance hierarchy by their base pointers. -// The pointee objects are owned by this collection. -// -template -class HcalItemArrayColl { -public: - typedef Item value_type; - typedef std::array, N> InputArray; - static constexpr unsigned arraySize() { return N; } - - // The following method adds a new array of pointers to the collection. - // This class will take ownership of the pointee objects. - void push_back(InputArray& arr) { - StoredArray st; - for (unsigned i = 0; i < N; ++i) - st[i] = std::shared_ptr(arr[i].release()); - data_.push_back(st); - } - - // Other modifiers - inline void clear() { data_.clear(); } - inline void reserve(const unsigned n) { data_.reserve(n); } - - // Some inspectors - inline std::size_t size() const { return data_.size(); } - inline bool empty() const { return data_.empty(); } - - // The following function returns nullptr if - // one of the argument indices is out of range - inline const Item* get(const unsigned itemIndex, const unsigned arrayIndex) const { - if (itemIndex < data_.size() && arrayIndex < N) - return data_[itemIndex][arrayIndex].get(); - else - return nullptr; - } - - // The following function throws an exception if - // one of the argument indices is out of range - inline Item& at(const unsigned itemIndex, const unsigned arrayIndex) const { - return *data_.at(itemIndex).at(arrayIndex); - } - - // Deep comparison for equality is useful for testing serialization - bool operator==(const HcalItemArrayColl& r) const { - const std::size_t sz = data_.size(); - if (sz != r.data_.size()) - return false; - for (std::size_t i = 0; i < sz; ++i) - for (unsigned j = 0; j < N; ++j) - if (!(*data_[i][j] == *r.data_[i][j])) - return false; - return true; - } - - inline bool operator!=(const HcalItemArrayColl& r) const { return !(*this == r); } - -private: - typedef boost::array, N> StoredArray; - std::vector data_; - - friend class boost::serialization::access; - - template - inline void serialize(Archive& ar, unsigned /* version */) { - ar& data_; - } -}; - -// boost serialization version number for this template -namespace boost { - namespace serialization { - template - struct version > { - BOOST_STATIC_CONSTANT(int, value = 1); - }; - } // namespace serialization -} // namespace boost - -#endif // CondFormats_HcalObjects_HcalItemArrayColl_h diff --git a/CondFormats/HcalObjects/interface/HcalItemArrayCollById.h b/CondFormats/HcalObjects/interface/HcalItemArrayCollById.h deleted file mode 100644 index 2c66a4860a717..0000000000000 --- a/CondFormats/HcalObjects/interface/HcalItemArrayCollById.h +++ /dev/null @@ -1,161 +0,0 @@ -#ifndef CondFormats_HcalObjects_HcalItemArrayCollById_h -#define CondFormats_HcalObjects_HcalItemArrayCollById_h - -#include - -#include "FWCore/Utilities/interface/Exception.h" - -#include "CondFormats/HcalObjects/interface/HcalItemArrayColl.h" -#include "CondFormats/HcalObjects/interface/HcalIndexLookup.h" -#include "DataFormats/HcalDetId/interface/HcalDetId.h" -#include "CondFormats/HcalObjects/interface/HcalDetIdTransform.h" -#include "CondFormats/HcalObjects/interface/AbsHcalAlgoData.h" - -// -// This collection allows lookup of arrays of items by HcalDetId. -// If the given HcalDetId is not explicitly listed in the -// lookup table, default item is returned. -// -// Just like HcalItemArrayColl, this collection works with pointers -// and references only, so it can be used with the inheritance -// scenarios. Note that the ownership of objects is shared with -// the collection provided in the constructor. The default array -// is owned by this collection. Its ownership will also become -// shared if a copy of this collection is made. -// -template -class HcalItemArrayCollById : public AbsHcalAlgoData { -public: - typedef Item value_type; - typedef typename HcalItemArrayColl::InputArray InputArray; - static constexpr unsigned arraySize() { return N; } - - // Dummy constructor. To be used for deserialization only. - inline HcalItemArrayCollById() : transformCode_(HcalDetIdTransform::N_TRANSFORMS) {} - - // Normal constructor - HcalItemArrayCollById(const HcalItemArrayColl& coll, - const HcalIndexLookup& indexLookupTable, - const unsigned detIdTransformCode, - InputArray& defaultFunctors) - : coll_(coll), lookup_(indexLookupTable), transformCode_(detIdTransformCode) { - // Check that the lookup table is valid for this application - if (lookup_.hasDuplicateIds()) - throw cms::Exception( - "In HcalItemArrayCollById constructor:" - " invalid lookup table"); - - // Check that the lookup table is consistent with the size - // of the collection - const unsigned maxIndex = lookup_.largestIndex(); - if (maxIndex != HcalIndexLookup::InvalidIndex && maxIndex >= coll_.size()) - throw cms::Exception( - "In HcalItemArrayCollById constructor:" - " collection and lookup table are inconsistent"); - - HcalDetIdTransform::validateCode(transformCode_); - - // Take care of the default array - setDefault(defaultFunctors); - } - - inline virtual ~HcalItemArrayCollById() {} - - // Modifier for the default array of items - inline void setDefault(InputArray& arr) { - for (unsigned i = 0; i < N; ++i) - default_[i] = std::shared_ptr(arr[i].release()); - } - - // Size of the internal collection, not counting the default - inline std::size_t size() const { return coll_.size(); } - - // Look up the index into the collection by detector id - inline unsigned getIndex(const HcalDetId& id) const { - return lookup_.find(HcalDetIdTransform::transform(id, transformCode_)); - } - - // Item lookup by its index and array index. If item lookup - // by index fails and the array index is not out of bounds, - // default item is returned. - inline const Item* getByIndex(const unsigned itemIndex, const unsigned arrayIndex) const { - const Item* f = coll_.get(itemIndex, arrayIndex); - if (f == nullptr && arrayIndex < N) - f = default_[arrayIndex].get(); - return f; - } - - // The following method will return nullptr if - // there is no corresponding default - inline const Item* getDefault(const unsigned arrayIndex) const { - if (arrayIndex < N) - return default_[arrayIndex].get(); - else - return nullptr; - } - - // Convenience function for getting what we need by id. - // Note that, if you are simply cycling over array indices, - // it will be more efficient to retrieve the item index - // first and then use "getByIndex" method. - inline const Item* get(const HcalDetId& id, const unsigned arrayIndex) const { - return getByIndex(getIndex(id), arrayIndex); - } - - // Similar comment applies here if you are just cycling over array indices - inline const Item& at(const HcalDetId& id, const unsigned arrayIndex) const { - const Item* f = getByIndex(getIndex(id), arrayIndex); - if (f == nullptr) - throw cms::Exception("In HcalItemArrayCollById::at: invalid detector id"); - return *f; - } - -protected: - virtual bool isEqual(const AbsHcalAlgoData& other) const override { - const HcalItemArrayCollById& r = static_cast(other); - if (coll_ != r.coll_) - return false; - if (lookup_ != r.lookup_) - return false; - if (transformCode_ != r.transformCode_) - return false; - for (unsigned j = 0; j < N; ++j) { - // The default may or may not be there - const bool ld = default_[j].get(); - const bool rd = r.default_[j].get(); - if (ld != rd) - return false; - if (ld) - if (!(*default_[j] == *r.default_[j])) - return false; - } - return true; - } - -private: - typedef boost::array, N> StoredArray; - - HcalItemArrayColl coll_; - HcalIndexLookup lookup_; - StoredArray default_; - uint32_t transformCode_; - - friend class boost::serialization::access; - - template - inline void serialize(Archive& ar, unsigned /* version */) { - ar& coll_& lookup_& default_& transformCode_; - } -}; - -// boost serialization version number for this template -namespace boost { - namespace serialization { - template - struct version > { - BOOST_STATIC_CONSTANT(int, value = 1); - }; - } // namespace serialization -} // namespace boost - -#endif // CondFormats_HcalObjects_HcalItemArrayCollById_h diff --git a/CondFormats/MFObjects/src/MagFieldConfig.cc b/CondFormats/MFObjects/src/MagFieldConfig.cc index 4b3853e9a0752..f1ef5440064d8 100644 --- a/CondFormats/MFObjects/src/MagFieldConfig.cc +++ b/CondFormats/MFObjects/src/MagFieldConfig.cc @@ -12,7 +12,6 @@ #include #include -#include using namespace std; using namespace magneticfield; @@ -81,8 +80,8 @@ vector MagFieldConfig::expandList(const string& list) { for (vstring::const_iterator i = v1.begin(); i != v1.end(); ++i) { vstring v2; boost::split(v2, *i, boost::is_any_of("-")); - unsigned start = boost::lexical_cast(v2.front()); - unsigned end = boost::lexical_cast(v2.back()); + unsigned start = std::stoul(v2.front()); + unsigned end = std::stoul(v2.back()); if ((v2.size() > 2) || (start > end)) { throw cms::Exception("ConfigurationError") << "VolumeBasedMagneticFieldESProducerFromDB: malformed configuration" << list << endl; diff --git a/CondFormats/MFObjects/test/MagFieldConfigDBWriter.cc b/CondFormats/MFObjects/test/MagFieldConfigDBWriter.cc index 47f1f5e4080e6..38a0081ae5d5f 100644 --- a/CondFormats/MFObjects/test/MagFieldConfigDBWriter.cc +++ b/CondFormats/MFObjects/test/MagFieldConfigDBWriter.cc @@ -45,10 +45,10 @@ void MagFieldConfigDBWriter::endJob() { try { if (dbOutputSvc->isNewTagRequest(record)) { //create mode - dbOutputSvc->writeOne(conf, dbOutputSvc->beginOfTime(), record); + dbOutputSvc->writeOne(*conf, dbOutputSvc->beginOfTime(), record); } else { //append mode. Note: correct PoolDBESSource must be loaded - dbOutputSvc->writeOne(conf, dbOutputSvc->currentTime(), record); + dbOutputSvc->writeOne(*conf, dbOutputSvc->currentTime(), record); } } catch (const cond::Exception& er) { std::cout << er.what() << std::endl; diff --git a/CondFormats/PPSObjects/interface/PPSAlignmentConfig.h b/CondFormats/PPSObjects/interface/PPSAlignmentConfig.h index cc4edb997b557..c75bedf888c7e 100644 --- a/CondFormats/PPSObjects/interface/PPSAlignmentConfig.h +++ b/CondFormats/PPSObjects/interface/PPSAlignmentConfig.h @@ -87,6 +87,8 @@ struct Binning { unsigned int n_bins_y_; double y_min_, y_max_; + + COND_SERIALIZABLE; }; std::ostream &operator<<(std::ostream &os, Binning &b); diff --git a/CondFormats/PPSObjects/interface/PPSAlignmentConfiguration.h b/CondFormats/PPSObjects/interface/PPSAlignmentConfiguration.h new file mode 100644 index 0000000000000..f514fa1c9bbd2 --- /dev/null +++ b/CondFormats/PPSObjects/interface/PPSAlignmentConfiguration.h @@ -0,0 +1,199 @@ +/**************************************************************************** +* Authors: +* Jan Kašpar (jan.kaspar@gmail.com) +* Mateusz Kocot (mateuszkocot99@gmail.com) +****************************************************************************/ + +#ifndef CondFormats_PPSObjects_PPSAlignmentConfiguration_h +#define CondFormats_PPSObjects_PPSAlignmentConfiguration_h + +#include "CondFormats/Serialization/interface/Serializable.h" + +#include +#include +#include + +class PPSAlignmentConfiguration { +public: + // Auxiliary structures + struct PointErrors { + double x_; + double y_; + double ex_; // error x + double ey_; // error y + + COND_SERIALIZABLE; + }; + + struct SelectionRange { + double x_min_; + double x_max_; + + COND_SERIALIZABLE; + }; + + struct RPConfig { + std::string name_; + unsigned int id_; + std::string position_; + double slope_; + double sh_x_; + + double x_min_fit_mode_, x_max_fit_mode_; + double y_max_fit_mode_; + double y_cen_add_; + double y_width_mult_; + + int x_slice_n_; + double x_slice_min_, x_slice_w_; + + COND_SERIALIZABLE; + }; + + struct SectorConfig { + std::string name_; + RPConfig rp_N_, rp_F_; + double slope_; + + bool cut_h_apply_; + double cut_h_a_, cut_h_c_, cut_h_si_; + + bool cut_v_apply_; + double cut_v_a_, cut_v_c_, cut_v_si_; + + COND_SERIALIZABLE; + }; + + struct Binning { + double bin_size_x_; // mm + unsigned int n_bins_x_; + + double pixel_x_offset_; + + unsigned int n_bins_y_; + double y_min_, y_max_; + + unsigned int diffFN_n_bins_x_; + double diffFN_x_min_, diffFN_x_max_; + + unsigned int slice_n_bins_x_, slice_n_bins_y_; + double slice_x_min_, slice_x_max_, slice_y_min_, slice_y_max_; + + COND_SERIALIZABLE; + }; + + // Getters + const SectorConfig& sectorConfig45() const; + const SectorConfig& sectorConfig56() const; + + double x_ali_sh_step() const; + + double y_mode_sys_unc() const; + double chiSqThreshold() const; + double y_mode_unc_max_valid() const; + double y_mode_max_valid() const; + + double minRPTracksSize() const; + double maxRPTracksSize() const; + double n_si() const; + + const std::map>& matchingReferencePoints() const; + const std::map& matchingShiftRanges() const; + + const std::map& alignment_x_meth_o_ranges() const; + unsigned int fitProfileMinBinEntries() const; + unsigned int fitProfileMinNReasonable() const; + unsigned int methOGraphMinN() const; + double methOUncFitRange() const; + + const std::map& alignment_x_relative_ranges() const; + unsigned int nearFarMinEntries() const; + + const std::map& alignment_y_ranges() const; + unsigned int modeGraphMinN() const; + unsigned int multSelProjYMinEntries() const; + + const Binning& binning() const; + + const std::vector& extraParams() const; + + // Setters + void setSectorConfig45(SectorConfig& sectorConfig45); + void setSectorConfig56(SectorConfig& sectorConfig56); + + void setX_ali_sh_step(double x_ali_sh_step); + + void setY_mode_sys_unc(double y_mode_sys_unc); + void setChiSqThreshold(double chiSqThreshold); + void setY_mode_unc_max_valid(double y_mode_unc_max_valid); + void setY_mode_max_valid(double y_mode_max_valid); + + void setMinRPTracksSize(unsigned int minRPTracksSize); + void setMaxRPTracksSize(unsigned int maxRPTracksSize); + void setN_si(double n_si); + + void setMatchingReferencePoints(std::map>& matchingReferencePoints); + void setMatchingShiftRanges(std::map& matchingShiftRanges); + + void setAlignment_x_meth_o_ranges(std::map& alignment_x_meth_o_ranges); + void setFitProfileMinBinEntries(unsigned int fitProfileMinBinEntries); + void setFitProfileMinNReasonable(unsigned int fitProfileMinNReasonable); + void setMethOGraphMinN(unsigned int methOGraphMinN); + void setMethOUncFitRange(double methOUncFitRange); + + void setAlignment_x_relative_ranges(std::map& alignment_x_relative_ranges); + void setNearFarMinEntries(unsigned int nearFarMinEntries); + + void setAlignment_y_ranges(std::map& alignment_y_ranges); + void setModeGraphMinN(unsigned int modeGraphMinN); + void setMultSelProjYMinEntries(unsigned int multSelProjYMinEntries); + + void setBinning(Binning& binning); + + void setExtraParams(std::vector& extraParams); + + // << operator + friend std::ostream& operator<<(std::ostream& os, const PPSAlignmentConfiguration& c); + +private: + SectorConfig sectorConfig45_, sectorConfig56_; + + double x_ali_sh_step_; // mm + + double y_mode_sys_unc_; + double chiSqThreshold_; + double y_mode_unc_max_valid_; + double y_mode_max_valid_; + + unsigned int minRPTracksSize_; + unsigned int maxRPTracksSize_; + double n_si_; + + std::map> matchingReferencePoints_; + std::map matchingShiftRanges_; + + std::map alignment_x_meth_o_ranges_; + unsigned int fitProfileMinBinEntries_; + unsigned int fitProfileMinNReasonable_; + unsigned int methOGraphMinN_; + double methOUncFitRange_; // mm + + std::map alignment_x_relative_ranges_; + unsigned int nearFarMinEntries_; + + std::map alignment_y_ranges_; + unsigned int modeGraphMinN_; + unsigned int multSelProjYMinEntries_; + + Binning binning_; + + std::vector extraParams_; + + COND_SERIALIZABLE; +}; + +std::ostream& operator<<(std::ostream& os, const PPSAlignmentConfiguration::RPConfig& rc); +std::ostream& operator<<(std::ostream& os, const PPSAlignmentConfiguration::SectorConfig& sc); +std::ostream& operator<<(std::ostream& os, const PPSAlignmentConfiguration::Binning& b); + +#endif diff --git a/CondFormats/PPSObjects/interface/PPSAssociationCuts.h b/CondFormats/PPSObjects/interface/PPSAssociationCuts.h new file mode 100644 index 0000000000000..12bbcd6d01538 --- /dev/null +++ b/CondFormats/PPSObjects/interface/PPSAssociationCuts.h @@ -0,0 +1,85 @@ +/**************************************************************************** + * Authors: + * Jan Kašpar + * Grzegorz Sroka + ****************************************************************************/ + +#ifndef CondFormats_PPSObjects_PPSAssociationCuts_h +#define CondFormats_PPSObjects_PPSAssociationCuts_h + +struct TF1; + +#include "CondFormats/Serialization/interface/Serializable.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/ParameterSet/interface/ParameterSetDescription.h" + +#include +#include +#include +#include + +class PPSAssociationCuts { +public: + class CutsPerArm { + public: + enum Quantities { qX, qY, qXi, qThetaY }; + + CutsPerArm() {} + + CutsPerArm(const edm::ParameterSet &iConfig, int sector); + + ~CutsPerArm() {} + + const std::vector &getMeans() const { return s_means_; } + const std::vector &getThresholds() const { return s_thresholds_; } + + double getTiTrMin() const { return ti_tr_min_; } + double getTiTrMax() const { return ti_tr_max_; } + + // returns whether the specified cut is applied + bool isApplied(Quantities quantity) const; + + // returns whether if the specified cut is satisfied (for a particular event) + bool isSatisfied(Quantities quantity, double x_near, double y_near, double xangle, double q_NF_diff) const; + + protected: + // string representation of the cut parameters - for serialisation + std::vector s_means_; + std::vector s_thresholds_; + + // TF1 representation of the cut parameters - for run time evaluations + std::vector > f_means_ COND_TRANSIENT; + std::vector > f_thresholds_ COND_TRANSIENT; + + // timing-tracking cuts + double ti_tr_min_; + double ti_tr_max_; + + static double evaluateExpression(std::shared_ptr expression, double x_near, double y_near, double xangle); + + COND_SERIALIZABLE; + }; + + PPSAssociationCuts() {} + + PPSAssociationCuts(const edm::ParameterSet &iConfig); + + ~PPSAssociationCuts() {} + + const CutsPerArm &getAssociationCuts(const int sector) const { return association_cuts_.at(sector); } + + static edm::ParameterSetDescription getDefaultParameters(); + +private: + std::map association_cuts_; + + COND_SERIALIZABLE; +}; + +//---------------------------------------------------------------------------------------------------- + +std::ostream &operator<<(std::ostream &os, const PPSAssociationCuts::CutsPerArm &cutsPerArm); + +std::ostream &operator<<(std::ostream &os, const PPSAssociationCuts &ppsAssociationCuts); + +#endif diff --git a/CondFormats/PPSObjects/src/PPSAlignmentConfig.cc b/CondFormats/PPSObjects/src/PPSAlignmentConfig.cc index 6cd6a35f90bf5..427269cbdd42c 100644 --- a/CondFormats/PPSObjects/src/PPSAlignmentConfig.cc +++ b/CondFormats/PPSObjects/src/PPSAlignmentConfig.cc @@ -10,10 +10,7 @@ * ****************************************************************************/ -#include "FWCore/Utilities/interface/typelookup.h" - #include "CondFormats/PPSObjects/interface/PPSAlignmentConfig.h" -TYPELOOKUP_DATA_REG(PPSAlignmentConfig); #include #include diff --git a/CondFormats/PPSObjects/src/PPSAlignmentConfiguration.cc b/CondFormats/PPSObjects/src/PPSAlignmentConfiguration.cc new file mode 100644 index 0000000000000..1e3db71078b63 --- /dev/null +++ b/CondFormats/PPSObjects/src/PPSAlignmentConfiguration.cc @@ -0,0 +1,263 @@ +/**************************************************************************** +* Authors: +* Jan Kašpar (jan.kaspar@gmail.com) +* Mateusz Kocot (mateuszkocot99@gmail.com) +****************************************************************************/ + +#include "CondFormats/PPSObjects/interface/PPSAlignmentConfiguration.h" + +#include +#include +#include + +// -------------------------------- PPSAlignmentConfiguration getters -------------------------------- + +const PPSAlignmentConfiguration::SectorConfig& PPSAlignmentConfiguration::sectorConfig45() const { + return sectorConfig45_; +} +const PPSAlignmentConfiguration::SectorConfig& PPSAlignmentConfiguration::sectorConfig56() const { + return sectorConfig56_; +} + +double PPSAlignmentConfiguration::x_ali_sh_step() const { return x_ali_sh_step_; } + +double PPSAlignmentConfiguration::y_mode_sys_unc() const { return y_mode_sys_unc_; } +double PPSAlignmentConfiguration::chiSqThreshold() const { return chiSqThreshold_; } +double PPSAlignmentConfiguration::y_mode_unc_max_valid() const { return y_mode_unc_max_valid_; } +double PPSAlignmentConfiguration::y_mode_max_valid() const { return y_mode_max_valid_; } + +double PPSAlignmentConfiguration::minRPTracksSize() const { return minRPTracksSize_; } +double PPSAlignmentConfiguration::maxRPTracksSize() const { return maxRPTracksSize_; } +double PPSAlignmentConfiguration::n_si() const { return n_si_; } + +const std::map>& +PPSAlignmentConfiguration::matchingReferencePoints() const { + return matchingReferencePoints_; +} +const std::map& +PPSAlignmentConfiguration::matchingShiftRanges() const { + return matchingShiftRanges_; +} + +const std::map& +PPSAlignmentConfiguration::alignment_x_meth_o_ranges() const { + return alignment_x_meth_o_ranges_; +} +unsigned int PPSAlignmentConfiguration::fitProfileMinBinEntries() const { return fitProfileMinBinEntries_; } +unsigned int PPSAlignmentConfiguration::fitProfileMinNReasonable() const { return fitProfileMinNReasonable_; } +unsigned int PPSAlignmentConfiguration::methOGraphMinN() const { return methOGraphMinN_; } +double PPSAlignmentConfiguration::methOUncFitRange() const { return methOUncFitRange_; } + +const std::map& +PPSAlignmentConfiguration::alignment_x_relative_ranges() const { + return alignment_x_relative_ranges_; +} +unsigned int PPSAlignmentConfiguration::nearFarMinEntries() const { return nearFarMinEntries_; } + +const std::map& PPSAlignmentConfiguration::alignment_y_ranges() + const { + return alignment_y_ranges_; +} +unsigned int PPSAlignmentConfiguration::modeGraphMinN() const { return modeGraphMinN_; } +unsigned int PPSAlignmentConfiguration::multSelProjYMinEntries() const { return multSelProjYMinEntries_; } + +const PPSAlignmentConfiguration::Binning& PPSAlignmentConfiguration::binning() const { return binning_; } + +const std::vector& PPSAlignmentConfiguration::extraParams() const { return extraParams_; } + +// -------------------------------- PPSAlignmentConfiguration setters -------------------------------- + +void PPSAlignmentConfiguration::setSectorConfig45(PPSAlignmentConfiguration::SectorConfig& sectorConfig45) { + sectorConfig45_ = sectorConfig45; +} +void PPSAlignmentConfiguration::setSectorConfig56(PPSAlignmentConfiguration::SectorConfig& sectorConfig56) { + sectorConfig56_ = sectorConfig56; +} + +void PPSAlignmentConfiguration::setX_ali_sh_step(double x_ali_sh_step) { x_ali_sh_step_ = x_ali_sh_step; } + +void PPSAlignmentConfiguration::setY_mode_sys_unc(double y_mode_sys_unc) { y_mode_sys_unc_ = y_mode_sys_unc; } +void PPSAlignmentConfiguration::setChiSqThreshold(double chiSqThreshold) { chiSqThreshold_ = chiSqThreshold; } +void PPSAlignmentConfiguration::setY_mode_unc_max_valid(double y_mode_unc_max_valid) { + y_mode_unc_max_valid_ = y_mode_unc_max_valid; +} +void PPSAlignmentConfiguration::setY_mode_max_valid(double y_mode_max_valid) { y_mode_max_valid_ = y_mode_max_valid; } + +void PPSAlignmentConfiguration::setMinRPTracksSize(unsigned int minRPTracksSize) { minRPTracksSize_ = minRPTracksSize; } +void PPSAlignmentConfiguration::setMaxRPTracksSize(unsigned int maxRPTracksSize) { maxRPTracksSize_ = maxRPTracksSize; } +void PPSAlignmentConfiguration::setN_si(double n_si) { n_si_ = n_si; } + +void PPSAlignmentConfiguration::setMatchingReferencePoints( + std::map>& matchingReferencePoints) { + matchingReferencePoints_ = matchingReferencePoints; +} +void PPSAlignmentConfiguration::setMatchingShiftRanges( + std::map& matchingShiftRanges) { + matchingShiftRanges_ = matchingShiftRanges; +} + +void PPSAlignmentConfiguration::setAlignment_x_meth_o_ranges( + std::map& alignment_x_meth_o_ranges) { + alignment_x_meth_o_ranges_ = alignment_x_meth_o_ranges; +} +void PPSAlignmentConfiguration::setFitProfileMinBinEntries(unsigned int fitProfileMinBinEntries) { + fitProfileMinBinEntries_ = fitProfileMinBinEntries; +} +void PPSAlignmentConfiguration::setFitProfileMinNReasonable(unsigned int fitProfileMinNReasonable) { + fitProfileMinNReasonable_ = fitProfileMinNReasonable; +} +void PPSAlignmentConfiguration::setMethOGraphMinN(unsigned int methOGraphMinN) { methOGraphMinN_ = methOGraphMinN; } +void PPSAlignmentConfiguration::setMethOUncFitRange(double methOUncFitRange) { methOUncFitRange_ = methOUncFitRange; } + +void PPSAlignmentConfiguration::setAlignment_x_relative_ranges( + std::map& alignment_x_relative_ranges) { + alignment_x_relative_ranges_ = alignment_x_relative_ranges; +} +void PPSAlignmentConfiguration::setNearFarMinEntries(unsigned int nearFarMinEntries) { + nearFarMinEntries_ = nearFarMinEntries; +} + +void PPSAlignmentConfiguration::setAlignment_y_ranges( + std::map& alignment_y_ranges) { + alignment_y_ranges_ = alignment_y_ranges; +} +void PPSAlignmentConfiguration::setModeGraphMinN(unsigned int modeGraphMinN) { modeGraphMinN_ = modeGraphMinN; } +void PPSAlignmentConfiguration::setMultSelProjYMinEntries(unsigned int multSelProjYMinEntries) { + multSelProjYMinEntries_ = multSelProjYMinEntries; +} + +void PPSAlignmentConfiguration::setBinning(PPSAlignmentConfiguration::Binning& binning) { binning_ = binning; } + +void PPSAlignmentConfiguration::setExtraParams(std::vector& extraParams) { extraParams_ = extraParams; } + +// -------------------------------- << operators -------------------------------- + +std::ostream& operator<<(std::ostream& os, const PPSAlignmentConfiguration::RPConfig& rc) { + os << std::fixed << std::setprecision(3); + os << " " << rc.name_ << ", id = " << rc.id_ << ", position = " << rc.position_ << ":\n"; + os << " slope = " << rc.slope_ << ", sh_x = " << rc.sh_x_ << "\n"; + os << " x_min_fit_mode = " << rc.x_min_fit_mode_ << ", x_max_fit_mode = " << rc.x_max_fit_mode_ << "\n"; + os << " y_max_fit_mode = " << rc.y_max_fit_mode_ << "\n"; + os << " y_cen_add = " << rc.y_cen_add_ << ", y_width_mult = " << rc.y_width_mult_ << "\n"; + os << std::setprecision(2); + os << " x slices: min = " << rc.x_slice_min_ << ", w = " << rc.x_slice_w_ << ", n = " << rc.x_slice_n_; + + return os; +} + +std::ostream& operator<<(std::ostream& os, const PPSAlignmentConfiguration::SectorConfig& sc) { + os << std::fixed << std::setprecision(3); + os << sc.name_ << ":\n"; + os << sc.rp_N_ << "\n" << sc.rp_F_ << "\n"; + os << std::setprecision(3); + os << " slope = " << sc.slope_ << "\n"; + os << " cut_h: apply = " << std::boolalpha << sc.cut_h_apply_ << ", a = " << sc.cut_h_a_ << ", c = " << sc.cut_h_c_ + << ", si = " << sc.cut_h_si_ << "\n"; + os << " cut_v: apply = " << std::boolalpha << sc.cut_v_apply_ << ", a = " << sc.cut_v_a_ << ", c = " << sc.cut_v_c_ + << ", si = " << sc.cut_v_si_ << "\n"; + + return os; +} + +std::ostream& operator<<(std::ostream& os, const PPSAlignmentConfiguration::Binning& b) { + os << " bin_size_x = " << b.bin_size_x_ << ", n_bins_x = " << b.n_bins_x_ << "\n"; + os << " pixel_x_offset = " << b.pixel_x_offset_ << "\n"; + os << " n_bins_y = " << b.n_bins_y_ << ", y_min = " << b.y_min_ << ", y_max = " << b.y_max_ << "\n"; + os << " diff far-near:" + << "\n"; + os << " n_bins_x = " << b.diffFN_n_bins_x_ << ", x_min = " << b.diffFN_x_min_ + << ", x_max = " << b.diffFN_x_max_ << "\n"; + os << " slice plots:" + << "\n"; + os << " n_bins_x = " << b.slice_n_bins_x_ << ", x_min = " << b.slice_x_min_ << ", x_max = " << b.slice_x_max_ + << "\n"; + os << " n_bins_y = " << b.slice_n_bins_y_ << ", y_min = " << b.slice_y_min_ << ", y_max = " << b.slice_y_max_; + + return os; +} + +std::ostream& operator<<(std::ostream& os, const PPSAlignmentConfiguration& c) { + os << "* " << c.sectorConfig45_ << "\n\n"; + os << "* " << c.sectorConfig56_ << "\n\n"; + + std::map rpTags = {{c.sectorConfig45_.rp_F_.id_, c.sectorConfig45_.rp_F_.name_}, + {c.sectorConfig45_.rp_N_.id_, c.sectorConfig45_.rp_N_.name_}, + {c.sectorConfig56_.rp_N_.id_, c.sectorConfig56_.rp_N_.name_}, + {c.sectorConfig56_.rp_F_.id_, c.sectorConfig56_.rp_F_.name_}}; + + os << "* x alignment shift step\n"; + os << " x_ali_sh_step = " << c.x_ali_sh_step_ << "\n\n"; + + os << "* mode graph parameters\n"; + os << " y_mode_sys_unc = " << c.y_mode_sys_unc_ << "\n"; + os << " chiSqThreshold = " << c.chiSqThreshold_ << "\n"; + os << " y_mode_unc_max_valid = " << c.y_mode_unc_max_valid_ << "\n"; + os << " y_mode_max_valid = " << c.y_mode_max_valid_ << "\n\n"; + + os << "* selection\n"; + os << " min_RP_tracks_size = " << c.minRPTracksSize_ << "\n"; + os << " max_RP_tracks_size = " << c.maxRPTracksSize_ << "\n\n"; + + os << "* cuts\n"; + os << " n_si = " << c.n_si_ << "\n\n"; + + os << "* matching\n" << std::setprecision(3); + + os << " shift ranges:\n"; + for (const auto& p : c.matchingShiftRanges_) + os << " RP " << rpTags[p.first] << " (" << std::setw(3) << p.first << "): sh_min = " << p.second.x_min_ + << ", sh_max = " << p.second.x_max_ << "\n"; + + os << " reference points:\n"; + for (const auto& pm : c.matchingReferencePoints_) { + os << " " << std::setw(3) << pm.first << ": "; + for (unsigned int i = 0; i < pm.second.size(); i++) { + const auto& p = pm.second[i]; + if (i % 5 == 0 && i > 0) + os << "\n "; + os << "(" << std::setw(6) << p.x_ << " +- " << p.ex_ << ", " << std::setw(6) << p.y_ << " +- " << p.ey_ << "), "; + } + os << "\n"; + } + + os << "\n" + << "* alignment_x_meth_o\n"; + for (const auto& p : c.alignment_x_meth_o_ranges_) + os << " RP " << rpTags[p.first] << " (" << std::setw(3) << p.first << "): sh_min = " << p.second.x_min_ + << ", sh_max = " << p.second.x_max_ << "\n"; + os << " fit_profile_min_bin_entries = " << c.fitProfileMinBinEntries_ << "\n"; + os << " fit_profile_min_N_reasonable = " << c.fitProfileMinNReasonable_ << "\n"; + os << " meth_o_graph_min_N = " << c.methOGraphMinN_ << "\n"; + os << " meth_o_unc_fit_range = " << c.methOUncFitRange_ << "\n"; + + os << "\n" + << "* alignment_x_relative\n"; + for (const auto& p : c.alignment_x_relative_ranges_) + if (p.first == c.sectorConfig45_.rp_N_.id_ || p.first == c.sectorConfig56_.rp_N_.id_) { // only near RPs + os << " RP " << rpTags[p.first] << " (" << std::setw(3) << p.first << "): sh_min = " << p.second.x_min_ + << ", sh_max = " << p.second.x_max_ << "\n"; + } + os << " near_far_min_entries = " << c.nearFarMinEntries_ << "\n"; + + os << "\n" + << "* alignment_y\n"; + for (const auto& p : c.alignment_y_ranges_) + os << " RP " << rpTags[p.first] << " (" << std::setw(3) << p.first << "): sh_min = " << p.second.x_min_ + << ", sh_max = " << p.second.x_max_ << "\n"; + os << " mode_graph_min_N = " << c.modeGraphMinN_ << "\n"; + os << " mult_sel_proj_y_min_entries = " << c.multSelProjYMinEntries_ << "\n"; + + os << "\n" + << "* binning\n"; + os << c.binning_ << "\n"; + + if (!c.extraParams_.empty()) { + os << "\n"; + os << "extra_params:\n"; + for (size_t i = 0; i < c.extraParams_.size(); i++) { + os << std::setw(5) << i << ": " << c.extraParams_[i] << "\n"; + } + } + + return os; +} diff --git a/CondFormats/PPSObjects/src/PPSAssociationCuts.cc b/CondFormats/PPSObjects/src/PPSAssociationCuts.cc new file mode 100644 index 0000000000000..ca04123c98c06 --- /dev/null +++ b/CondFormats/PPSObjects/src/PPSAssociationCuts.cc @@ -0,0 +1,130 @@ +/**************************************************************************** + * Authors: + * Jan Kašpar + * Grzegorz Sroka + ****************************************************************************/ + +#include "CondFormats/PPSObjects/interface/PPSAssociationCuts.h" +#include "FWCore/ParameterSet/interface/ParameterSetDescription.h" + +#include "TF1.h" + +#include + +//---------------------------------------------------------------------------------------------------- + +PPSAssociationCuts::CutsPerArm::CutsPerArm(const edm::ParameterSet &iConfig, int sector) { + const auto &association_cuts = iConfig.getParameterSet("association_cuts_" + std::to_string(sector)); + + const std::vector names{"x", "y", "xi", "th_y"}; + for (std::size_t i = 0; i < names.size(); ++i) { + std::string mean = association_cuts.getParameter(names[i] + "_cut_mean"); + s_means_.push_back(mean); + + std::string threshold = association_cuts.getParameter(names[i] + "_cut_threshold"); + s_thresholds_.push_back(threshold); + + f_means_.push_back(std::make_shared("f", mean.c_str())); + f_thresholds_.push_back(std::make_shared("f", threshold.c_str())); + } + + ti_tr_min_ = association_cuts.getParameter("ti_tr_min"); + ti_tr_max_ = association_cuts.getParameter("ti_tr_max"); +} + +//---------------------------------------------------------------------------------------------------- + +bool PPSAssociationCuts::CutsPerArm::isApplied(Quantities quantity) const { + return (!s_thresholds_.at(quantity).empty()) && (!s_means_.at(quantity).empty()); +} + +//---------------------------------------------------------------------------------------------------- + +bool PPSAssociationCuts::CutsPerArm::isSatisfied( + Quantities quantity, double x_near, double y_near, double xangle, double q_NF_diff) const { + if (!isApplied(quantity)) + return true; + const double mean = evaluateExpression(f_means_.at(quantity), x_near, y_near, xangle); + const double threshold = evaluateExpression(f_thresholds_.at(quantity), x_near, y_near, xangle); + return fabs(q_NF_diff - mean) < threshold; +} + +//---------------------------------------------------------------------------------------------------- + +double PPSAssociationCuts::CutsPerArm::evaluateExpression(std::shared_ptr expression, + double x_near, + double y_near, + double xangle) { + expression->SetParameter("x_near", x_near); + expression->SetParameter("y_near", y_near); + expression->SetParameter("xangle", xangle); + return expression->EvalPar(nullptr); +} + +//---------------------------------------------------------------------------------------------------- + +PPSAssociationCuts::PPSAssociationCuts(const edm::ParameterSet &iConfig) { + unsigned int i = 0; + for (const int §or : {45, 56}) + association_cuts_[i++] = CutsPerArm(iConfig, sector); +} + +//---------------------------------------------------------------------------------------------------- + +edm::ParameterSetDescription PPSAssociationCuts::getDefaultParameters() { + edm::ParameterSetDescription desc; + + desc.add("x_cut_mean", "")->setComment("mean of track-association cut in x, mm"); + desc.add("x_cut_threshold", "")->setComment("threshold of track-association cut in x, mm"); + + desc.add("y_cut_mean", "")->setComment("mean of track-association cut in y, mm"); + desc.add("y_cut_threshold", "")->setComment("threshold of track-association cut in y, mm"); + + desc.add("xi_cut_mean", "")->setComment("mean of track-association cut in xi"); + desc.add("xi_cut_threshold", "")->setComment("threshold of track-association cut in xi"); + + desc.add("th_y_cut_mean", "")->setComment("mean of track-association cut in th_y, rad"); + desc.add("th_y_cut_threshold", "")->setComment("threshold of track-association cut in th_y, rad"); + + desc.add("ti_tr_min", -1.)->setComment("minimum value for timing-tracking association cut"); + desc.add("ti_tr_max", +1.)->setComment("maximum value for timing-tracking association cut"); + + return desc; +} + +//---------------------------------------------------------------------------------------------------- + +std::ostream &operator<<(std::ostream &os, const PPSAssociationCuts::CutsPerArm &cutsPerArm) { + os << "CutsPerArm {" << std::endl; + + os << "\tmeans {"; + for (auto const &value : cutsPerArm.getMeans()) { + os << "\"" << value << "\", "; + } + os << "}" << std::endl << std::endl; + + os << "\tthresholds {"; + for (auto const &value : cutsPerArm.getThresholds()) { + os << "\"" << value << "\", "; + } + os << "}" << std::endl << std::endl; + + os << "\tti_tr_min " << cutsPerArm.getTiTrMin() << std::endl; + os << "\tti_tr_max " << cutsPerArm.getTiTrMax() << std::endl; + os << "}" << std::endl; + + return os; +} + +//---------------------------------------------------------------------------------------------------- + +std::ostream &operator<<(std::ostream &os, const PPSAssociationCuts &ppsAssociationCuts) { + os << "PPSAssociationCuts {" << std::endl; + os << "45" << std::endl; + os << ppsAssociationCuts.getAssociationCuts(0); + os << "56" << std::endl; + os << ppsAssociationCuts.getAssociationCuts(1); + os << "}" << std::endl; + + return os; +} \ No newline at end of file diff --git a/CondFormats/PPSObjects/src/PPSPixelTopology.cc b/CondFormats/PPSObjects/src/PPSPixelTopology.cc index 13d20b8a0547c..55f78046d9938 100644 --- a/CondFormats/PPSObjects/src/PPSPixelTopology.cc +++ b/CondFormats/PPSObjects/src/PPSPixelTopology.cc @@ -28,16 +28,17 @@ unsigned short PPSPixelTopology::pixelIndex(PixelInfo pI) const { bool PPSPixelTopology::isPixelHit(float xLocalCoordinate, float yLocalCoordinate, bool is3x2 = true) const { // check hit fiducial boundaries - double xModuleSize = 2 * ((no_of_pixels_simX_ / 2. + 1) * pitch_simX_ + dead_edge_width_); + const double xModuleSize = 2 * ((no_of_pixels_simX_ / 2. + 1) * pitch_simX_ + dead_edge_width_); if (xLocalCoordinate < -xModuleSize / 2. || xLocalCoordinate > xModuleSize / 2.) return false; - double yModuleSize = (no_of_pixels_simY_ + 4.) * pitch_simY_ + 2. * dead_edge_width_; - double y2x2top = no_of_pixels_simY_ / 6. * pitch_simY_ + dead_edge_width_; + const double yModuleSize = (no_of_pixels_simY_ + 4.) * pitch_simY_ + 2. * dead_edge_width_; + const double y2x2top = no_of_pixels_simY_ / 6. * pitch_simY_ + dead_edge_width_; if (is3x2 && (yLocalCoordinate < -yModuleSize / 2. || yLocalCoordinate > yModuleSize / 2.)) return false; - - if (!is3x2 && (yLocalCoordinate < -yModuleSize / 2. || yLocalCoordinate > y2x2top)) + if (!is3x2 && (runType_ == "Run2") && (yLocalCoordinate < -yModuleSize / 2. || yLocalCoordinate > y2x2top)) + return false; + if (!is3x2 && (runType_ == "Run3") && (yLocalCoordinate < -yModuleSize / 2. || yLocalCoordinate > yModuleSize / 2.)) return false; return true; diff --git a/CondFormats/PPSObjects/src/T_EventSetup_PPSAlignmentConfig.cc b/CondFormats/PPSObjects/src/T_EventSetup_PPSAlignmentConfig.cc new file mode 100644 index 0000000000000..5c45035747026 --- /dev/null +++ b/CondFormats/PPSObjects/src/T_EventSetup_PPSAlignmentConfig.cc @@ -0,0 +1,4 @@ +#include "CondFormats/PPSObjects/interface/PPSAlignmentConfig.h" +#include "FWCore/Utilities/interface/typelookup.h" + +TYPELOOKUP_DATA_REG(PPSAlignmentConfig); diff --git a/CondFormats/PPSObjects/src/T_EventSetup_PPSAlignmentConfiguration.cc b/CondFormats/PPSObjects/src/T_EventSetup_PPSAlignmentConfiguration.cc new file mode 100644 index 0000000000000..66ce70016939b --- /dev/null +++ b/CondFormats/PPSObjects/src/T_EventSetup_PPSAlignmentConfiguration.cc @@ -0,0 +1,4 @@ +#include "CondFormats/PPSObjects/interface/PPSAlignmentConfiguration.h" +#include "FWCore/Utilities/interface/typelookup.h" + +TYPELOOKUP_DATA_REG(PPSAlignmentConfiguration); diff --git a/CondFormats/PPSObjects/src/T_EventSetup_PPSAssociationCuts.cc b/CondFormats/PPSObjects/src/T_EventSetup_PPSAssociationCuts.cc new file mode 100644 index 0000000000000..f2858de6540ef --- /dev/null +++ b/CondFormats/PPSObjects/src/T_EventSetup_PPSAssociationCuts.cc @@ -0,0 +1,4 @@ +#include "CondFormats/PPSObjects/interface/PPSAssociationCuts.h" +#include "FWCore/Utilities/interface/typelookup.h" + +TYPELOOKUP_DATA_REG(PPSAssociationCuts); diff --git a/CondFormats/PPSObjects/src/classes_def.xml b/CondFormats/PPSObjects/src/classes_def.xml index 2b8be486f99ef..528dc7485e326 100644 --- a/CondFormats/PPSObjects/src/classes_def.xml +++ b/CondFormats/PPSObjects/src/classes_def.xml @@ -27,6 +27,12 @@ + + + + + + @@ -68,4 +74,28 @@ - \ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CondFormats/PPSObjects/src/headers.h b/CondFormats/PPSObjects/src/headers.h index bb179fd8df892..e0e1edae9d95e 100644 --- a/CondFormats/PPSObjects/src/headers.h +++ b/CondFormats/PPSObjects/src/headers.h @@ -5,6 +5,7 @@ #include "CondFormats/PPSObjects/interface/CTPPSRPAlignmentCorrectionsData.h" #include "CondFormats/PPSObjects/interface/CTPPSRPAlignmentCorrectionsDataSequence.h" #include "CondFormats/PPSObjects/interface/PPSTimingCalibration.h" +#include "CondFormats/PPSObjects/interface/PPSAlignmentConfiguration.h" #include "CondFormats/PPSObjects/interface/LHCOpticalFunctionsSet.h" #include "CondFormats/PPSObjects/interface/LHCOpticalFunctionsSetCollection.h" @@ -13,3 +14,6 @@ #include "CondFormats/PPSObjects/interface/PPSDirectSimulationData.h" #include "CondFormats/PPSObjects/interface/PPSPixelTopology.h" + +#include "CondFormats/PPSObjects/interface/PPSAlignmentConfig.h" +#include "CondFormats/PPSObjects/interface/PPSAssociationCuts.h" diff --git a/CondFormats/PPSObjects/test/BuildFile.xml b/CondFormats/PPSObjects/test/BuildFile.xml index b4b34bf621ee7..37fdb1e9d95c1 100644 --- a/CondFormats/PPSObjects/test/BuildFile.xml +++ b/CondFormats/PPSObjects/test/BuildFile.xml @@ -9,3 +9,15 @@ + + + + + + + + + + + + diff --git a/CondFormats/PPSObjects/test/testSerializationPPSAlignmentConfig.cc b/CondFormats/PPSObjects/test/testSerializationPPSAlignmentConfig.cc new file mode 100644 index 0000000000000..e979996e0d532 --- /dev/null +++ b/CondFormats/PPSObjects/test/testSerializationPPSAlignmentConfig.cc @@ -0,0 +1,17 @@ +#include "CondFormats/Serialization/interface/Test.h" + +#include "../src/headers.h" + +int main() { + testSerialization(); + testSerialization(); + testSerialization(); + testSerialization(); + testSerialization(); + + testSerialization>(); + testSerialization>>(); + testSerialization>(); + + testSerialization(); +} diff --git a/CondFormats/PPSObjects/test/testSerializationPPSAlignmentConfiguration.cc b/CondFormats/PPSObjects/test/testSerializationPPSAlignmentConfiguration.cc new file mode 100644 index 0000000000000..092c293844946 --- /dev/null +++ b/CondFormats/PPSObjects/test/testSerializationPPSAlignmentConfiguration.cc @@ -0,0 +1,17 @@ +#include "CondFormats/Serialization/interface/Test.h" + +#include "../src/headers.h" + +int main() { + testSerialization(); + testSerialization(); + testSerialization(); + testSerialization(); + testSerialization(); + + testSerialization>(); + testSerialization>>(); + testSerialization>(); + + testSerialization(); +} diff --git a/CondFormats/PPSObjects/test/testSerializationPPSAssociationCuts.cc b/CondFormats/PPSObjects/test/testSerializationPPSAssociationCuts.cc new file mode 100644 index 0000000000000..802165ff05a44 --- /dev/null +++ b/CondFormats/PPSObjects/test/testSerializationPPSAssociationCuts.cc @@ -0,0 +1,10 @@ +#include "CondFormats/Serialization/interface/Test.h" + +#include "CondFormats/PPSObjects/src/headers.h" + +int main() { + testSerialization(); + testSerialization(); + testSerialization>(); + testSerialization>(); +} \ No newline at end of file diff --git a/CondFormats/Serialization/interface/eos/polymorphic_portable_archive.hpp b/CondFormats/Serialization/interface/eos/polymorphic_portable_archive.hpp deleted file mode 100644 index 45933afa4bbd5..0000000000000 --- a/CondFormats/Serialization/interface/eos/polymorphic_portable_archive.hpp +++ /dev/null @@ -1,35 +0,0 @@ -/*****************************************************************************/ -/** - * \file polymorphic_portable_archive.hpp - * \brief Needed for unit tests on portable archives. - * \author christian.pfligersdorffer@gmx.at - * - * Header for testing portable archives with all of the serialization tests. - * Before use copy all hpp files from this directory to your boost folder - * boost_.../libs/serialization/test and run from there a visual studio - * prompt with b2 oder bjam -sBOOST_ARCHIVE_LIST=portable_archive.hpp - * - * \note Since portable archives version 5.0 we depend on program_options! - * Edit libs/serialization/test/Jamfile.v2 and change the requirements to - * : requirements /boost/filesystem /boost/program_options - */ -/****************************************************************************/ - -#pragma warning(disable : 4217 4127 4310 4244 4800 4267) - -// text_archive test header -// include output archive header -#include "portable_oarchive.hpp" -// set name of test output archive -typedef eos::polymorphic_portable_oarchive test_oarchive; -// set name of test output stream -typedef std::ofstream test_ostream; - -// repeat the above for input archive -#include "portable_iarchive.hpp" -typedef eos::polymorphic_portable_iarchive test_iarchive; -typedef std::ifstream test_istream; - -// define open mode for streams -// binary archives should use std::ios_base::binary -#define TEST_STREAM_FLAGS std::ios_base::binary diff --git a/CondFormats/Serialization/interface/eos/portable_archive.hpp b/CondFormats/Serialization/interface/eos/portable_archive.hpp deleted file mode 100644 index f5b51ccb82cee..0000000000000 --- a/CondFormats/Serialization/interface/eos/portable_archive.hpp +++ /dev/null @@ -1,35 +0,0 @@ -/*****************************************************************************/ -/** - * \file portable_archive.hpp - * \brief Needed for unit tests on portable archives. - * \author christian.pfligersdorffer@gmx.at - * - * Header for testing portable archives with all of the serialization tests. - * Before use copy all hpp files from this directory to your boost folder - * boost_.../libs/serialization/test and run from there a visual studio - * prompt with b2 oder bjam -sBOOST_ARCHIVE_LIST=portable_archive.hpp - * - * \note Since portable archives version 5.0 we depend on program_options! - * Edit libs/serialization/test/Jamfile.v2 and change the requirements to - * : requirements /boost/filesystem /boost/program_options - */ -/****************************************************************************/ - -#pragma warning(disable : 4217 4127 4310 4244 4800 4267) - -// text_archive test header -// include output archive header -#include "portable_oarchive.hpp" -// set name of test output archive -typedef eos::portable_oarchive test_oarchive; -// set name of test output stream -typedef std::ofstream test_ostream; - -// repeat the above for input archive -#include "portable_iarchive.hpp" -typedef eos::portable_iarchive test_iarchive; -typedef std::ifstream test_istream; - -// define open mode for streams -// binary archives should use std::ios_base::binary -#define TEST_STREAM_FLAGS std::ios_base::binary diff --git a/CondFormats/Serialization/interface/eos/portable_archive_exception.hpp b/CondFormats/Serialization/interface/eos/portable_archive_exception.hpp index 0aa18a83c752f..0f0628a93f6d8 100644 --- a/CondFormats/Serialization/interface/eos/portable_archive_exception.hpp +++ b/CondFormats/Serialization/interface/eos/portable_archive_exception.hpp @@ -14,7 +14,6 @@ #pragma once -#include #include #include @@ -75,7 +74,7 @@ namespace eos { template portable_archive_exception(const T& abnormal) : boost::archive::archive_exception(other_exception), msg("serialization of illegal floating point value: ") { - msg += boost::lexical_cast(abnormal); + msg += std::to_string(abnormal); } //! override the base class function with our message diff --git a/CondFormats/SiPixelObjects/interface/MapPathTodetUnit.h b/CondFormats/SiPixelObjects/interface/MapPathTodetUnit.h deleted file mode 100644 index e69de29bb2d1d..0000000000000 diff --git a/CondFormats/SiPixelObjects/src/SiPixelVCal.cc b/CondFormats/SiPixelObjects/src/SiPixelVCal.cc index a40fa5f4985af..da083bd629a84 100644 --- a/CondFormats/SiPixelObjects/src/SiPixelVCal.cc +++ b/CondFormats/SiPixelObjects/src/SiPixelVCal.cc @@ -1,6 +1,8 @@ #include "CondFormats/SiPixelObjects/interface/SiPixelVCal.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" +#include + bool SiPixelVCal::putSlopeAndOffset(const uint32_t& pixid, float& slopeValue, float& offsetValue) { std::map::const_iterator id = m_vcal.find(pixid); if (id != m_vcal.end()) { diff --git a/CondFormats/SiPixelTransient/src/SiPixelTemplate.cc b/CondFormats/SiPixelTransient/src/SiPixelTemplate.cc index ebf7fe3550807..57e7806db0326 100644 --- a/CondFormats/SiPixelTransient/src/SiPixelTemplate.cc +++ b/CondFormats/SiPixelTransient/src/SiPixelTemplate.cc @@ -106,6 +106,7 @@ #include "CondFormats/SiPixelTransient/interface/SimplePixel.h" #include "FWCore/Utilities/interface/FileInPath.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" +#include "FWCore/Utilities/interface/isFinite.h" #define LOGERROR(x) LogError(x) #define LOGINFO(x) LogInfo(x) #define LOGWARNING(x) LogWarning(x) @@ -1392,6 +1393,12 @@ bool SiPixelTemplate::interpolate(int id, float cotalpha, float cotbeta, float l throw cms::Exception("DataCorrupt") << "SiPixelTemplate::interpolate can't find needed template ID = " << id << std::endl; } + + //check for nan's + if (!edm::isFinite(cotalpha) || !edm::isFinite(cotbeta)) { + success_ = false; + return success_; + } #else assert(index_id_ >= 0 && index_id_ < (int)thePixelTemp_.size()); #endif diff --git a/CondFormats/SiPixelTransient/src/SiPixelTemplate2D.cc b/CondFormats/SiPixelTransient/src/SiPixelTemplate2D.cc index 7b52e28902c57..d9e3441e357d0 100644 --- a/CondFormats/SiPixelTransient/src/SiPixelTemplate2D.cc +++ b/CondFormats/SiPixelTransient/src/SiPixelTemplate2D.cc @@ -40,6 +40,7 @@ #include "CondFormats/SiPixelTransient/interface/SiPixelTemplate2D.h" #include "FWCore/Utilities/interface/FileInPath.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" +#include "FWCore/Utilities/interface/isFinite.h" #define LOGERROR(x) LogError(x) #define LOGINFO(x) LogInfo(x) #define ENDL " " @@ -679,6 +680,12 @@ bool SiPixelTemplate2D::interpolate(int id, float cotalpha, float cotbeta, float #ifndef SI_PIXEL_TEMPLATE_STANDALONE throw cms::Exception("DataCorrupt") << "SiPixelTemplate2D::illegal subdetector ID = " << thePixelTemp_[index_id_].head.Dtype << std::endl; + + //check for nan's + if (!edm::isFinite(cotalpha) || !edm::isFinite(cotbeta)) { + success_ = false; + return success_; + } #else std::cout << "SiPixelTemplate:2D:illegal subdetector ID = " << thePixelTemp_[index_id_].head.Dtype << std::endl; #endif diff --git a/CondFormats/SiStripObjects/src/SiStripDetSummary.cc b/CondFormats/SiStripObjects/src/SiStripDetSummary.cc index 7ade22ed47d7e..495ef24a2dff3 100644 --- a/CondFormats/SiStripObjects/src/SiStripDetSummary.cc +++ b/CondFormats/SiStripObjects/src/SiStripDetSummary.cc @@ -34,7 +34,6 @@ void SiStripDetSummary::add(DetId detid, float value) { break; } detNum += layer * 10 + stereo; - // string name( detector + boost::lexical_cast(layer) + boost::lexical_cast(stereo) ); valueMap_[detNum].mean += value; valueMap_[detNum].rms += value * value; valueMap_[detNum].count += 1; diff --git a/CondTools/CTPPS/plugins/RetrievePPSAlignmentConfig.cc b/CondTools/CTPPS/plugins/RetrievePPSAlignmentConfig.cc new file mode 100644 index 0000000000000..b780cf149ce30 --- /dev/null +++ b/CondTools/CTPPS/plugins/RetrievePPSAlignmentConfig.cc @@ -0,0 +1,42 @@ +/**************************************************************************** +* Author: +* Mateusz Kocot (mateuszkocot99@gmail.com) +****************************************************************************/ + +#include "FWCore/Framework/interface/Frameworkfwd.h" +#include "FWCore/Framework/interface/one/EDAnalyzer.h" +#include "FWCore/Framework/interface/Event.h" +#include "FWCore/Framework/interface/EventSetup.h" +#include "FWCore/Framework/interface/ESHandle.h" +#include "FWCore/Framework/interface/MakerMacros.h" + +#include "FWCore/MessageLogger/interface/MessageLogger.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/ServiceRegistry/interface/Service.h" + +#include "CondFormats/PPSObjects/interface/PPSAlignmentConfig.h" +#include "CondFormats/DataRecord/interface/PPSAlignmentConfigRcd.h" + +#include + +class RetrievePPSAlignmentConfig : public edm::one::EDAnalyzer<> { +public: + explicit RetrievePPSAlignmentConfig(const edm::ParameterSet &); + +private: + void analyze(const edm::Event &, const edm::EventSetup &) override; + + edm::ESGetToken esToken_; +}; + +RetrievePPSAlignmentConfig::RetrievePPSAlignmentConfig(const edm::ParameterSet &iConfig) : esToken_(esConsumes()) {} + +void RetrievePPSAlignmentConfig::analyze(const edm::Event &iEvent, const edm::EventSetup &iSetup) { + // get the data + const auto &ppsAlignmentConfig = iSetup.getData(esToken_); + + edm::LogInfo("PPS") << ppsAlignmentConfig; +} + +//define this as a plug-in +DEFINE_FWK_MODULE(RetrievePPSAlignmentConfig); diff --git a/CondTools/CTPPS/plugins/RetrievePPSAlignmentConfiguration.cc b/CondTools/CTPPS/plugins/RetrievePPSAlignmentConfiguration.cc new file mode 100644 index 0000000000000..823fe93efbc97 --- /dev/null +++ b/CondTools/CTPPS/plugins/RetrievePPSAlignmentConfiguration.cc @@ -0,0 +1,43 @@ +/**************************************************************************** +* Author: +* Mateusz Kocot (mateuszkocot99@gmail.com) +****************************************************************************/ + +#include "FWCore/Framework/interface/Frameworkfwd.h" +#include "FWCore/Framework/interface/one/EDAnalyzer.h" +#include "FWCore/Framework/interface/Event.h" +#include "FWCore/Framework/interface/EventSetup.h" +#include "FWCore/Framework/interface/ESHandle.h" +#include "FWCore/Framework/interface/MakerMacros.h" + +#include "FWCore/MessageLogger/interface/MessageLogger.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/ServiceRegistry/interface/Service.h" + +#include "CondFormats/PPSObjects/interface/PPSAlignmentConfiguration.h" +#include "CondFormats/DataRecord/interface/PPSAlignmentConfigurationRcd.h" + +#include + +class RetrievePPSAlignmentConfiguration : public edm::one::EDAnalyzer<> { +public: + explicit RetrievePPSAlignmentConfiguration(const edm::ParameterSet&); + +private: + void analyze(const edm::Event&, const edm::EventSetup&) override; + + edm::ESGetToken esToken_; +}; + +RetrievePPSAlignmentConfiguration::RetrievePPSAlignmentConfiguration(const edm::ParameterSet& iConfig) + : esToken_(esConsumes()) {} + +void RetrievePPSAlignmentConfiguration::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) { + // get the data + const auto& ppsAlignmentConfiguration = iSetup.getData(esToken_); + + edm::LogInfo("PPS") << ppsAlignmentConfiguration; +} + +//define this as a plug-in +DEFINE_FWK_MODULE(RetrievePPSAlignmentConfiguration); diff --git a/CondTools/CTPPS/plugins/RetrievePPSAssociationCuts.cc b/CondTools/CTPPS/plugins/RetrievePPSAssociationCuts.cc new file mode 100644 index 0000000000000..90d3c8f98d526 --- /dev/null +++ b/CondTools/CTPPS/plugins/RetrievePPSAssociationCuts.cc @@ -0,0 +1,42 @@ +/**************************************************************************** +* Author: +* Grzegorz Sroka +****************************************************************************/ + +#include "FWCore/Framework/interface/Frameworkfwd.h" +#include "FWCore/Framework/interface/one/EDAnalyzer.h" +#include "FWCore/Framework/interface/Event.h" +#include "FWCore/Framework/interface/EventSetup.h" +#include "FWCore/Framework/interface/ESHandle.h" +#include "FWCore/Framework/interface/MakerMacros.h" + +#include "FWCore/MessageLogger/interface/MessageLogger.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/ServiceRegistry/interface/Service.h" + +#include "CondFormats/PPSObjects/interface/PPSAssociationCuts.h" +#include "CondFormats/DataRecord/interface/PPSAssociationCutsRcd.h" + +#include + +class RetrievePPSAssociationCuts : public edm::one::EDAnalyzer<> { +public: + explicit RetrievePPSAssociationCuts(const edm::ParameterSet &); + +private: + void analyze(const edm::Event &, const edm::EventSetup &) override; + + edm::ESGetToken esToken_; +}; + +RetrievePPSAssociationCuts::RetrievePPSAssociationCuts(const edm::ParameterSet &iConfig) : esToken_(esConsumes()) {} + +void RetrievePPSAssociationCuts::analyze(const edm::Event &iEvent, const edm::EventSetup &iSetup) { + // get the data + const auto &ppsAssociationCuts = iSetup.getData(esToken_); + + edm::LogInfo("PPS") << ppsAssociationCuts; +} + +//define this as a plug-in +DEFINE_FWK_MODULE(RetrievePPSAssociationCuts); \ No newline at end of file diff --git a/CondTools/CTPPS/plugins/WritePPSAlignmentConfig.cc b/CondTools/CTPPS/plugins/WritePPSAlignmentConfig.cc new file mode 100644 index 0000000000000..84437bd4e3728 --- /dev/null +++ b/CondTools/CTPPS/plugins/WritePPSAlignmentConfig.cc @@ -0,0 +1,51 @@ +/**************************************************************************** +* Author: +* Mateusz Kocot (mateuszkocot99@gmail.com) +****************************************************************************/ + +#include "FWCore/Framework/interface/Frameworkfwd.h" +#include "FWCore/Framework/interface/one/EDAnalyzer.h" +#include "FWCore/Framework/interface/Event.h" +#include "FWCore/Framework/interface/EventSetup.h" +#include "FWCore/Framework/interface/ESHandle.h" +#include "FWCore/Framework/interface/MakerMacros.h" + +#include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/ServiceRegistry/interface/Service.h" + +#include "CondCore/DBOutputService/interface/PoolDBOutputService.h" + +#include "CondFormats/PPSObjects/interface/PPSAlignmentConfig.h" +#include "CondFormats/DataRecord/interface/PPSAlignmentConfigRcd.h" + +#include + +class WritePPSAlignmentConfig : public edm::one::EDAnalyzer<> { +public: + explicit WritePPSAlignmentConfig(const edm::ParameterSet &); + +private: + void analyze(const edm::Event &, const edm::EventSetup &) override; + + edm::ESGetToken esToken_; +}; + +WritePPSAlignmentConfig::WritePPSAlignmentConfig(const edm::ParameterSet &iConfig) + : esToken_(esConsumes( + edm::ESInputTag("", iConfig.getParameter("label")))) {} + +void WritePPSAlignmentConfig::analyze(const edm::Event &iEvent, const edm::EventSetup &iSetup) { + // get the data + const auto &ppsAlignmentConfig = iSetup.getData(esToken_); + + // store the data in a DB object + edm::Service poolDbService; + if (poolDbService.isAvailable()) { + poolDbService->writeOne(&ppsAlignmentConfig, poolDbService->currentTime(), "PPSAlignmentConfigRcd"); + } else { + throw cms::Exception("WritePPSAlignmentConfig") << "PoolDBService required."; + } +} + +//define this as a plug-in +DEFINE_FWK_MODULE(WritePPSAlignmentConfig); diff --git a/CondTools/CTPPS/plugins/WritePPSAlignmentConfiguration.cc b/CondTools/CTPPS/plugins/WritePPSAlignmentConfiguration.cc new file mode 100644 index 0000000000000..387ec812d0bb6 --- /dev/null +++ b/CondTools/CTPPS/plugins/WritePPSAlignmentConfiguration.cc @@ -0,0 +1,51 @@ +/**************************************************************************** +* Author: +* Mateusz Kocot (mateuszkocot99@gmail.com) +****************************************************************************/ + +#include "FWCore/Framework/interface/Frameworkfwd.h" +#include "FWCore/Framework/interface/one/EDAnalyzer.h" +#include "FWCore/Framework/interface/Event.h" +#include "FWCore/Framework/interface/EventSetup.h" +#include "FWCore/Framework/interface/ESHandle.h" +#include "FWCore/Framework/interface/MakerMacros.h" + +#include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/ServiceRegistry/interface/Service.h" + +#include "CondCore/DBOutputService/interface/PoolDBOutputService.h" + +#include "CondFormats/PPSObjects/interface/PPSAlignmentConfiguration.h" +#include "CondFormats/DataRecord/interface/PPSAlignmentConfigurationRcd.h" + +#include + +class WritePPSAlignmentConfiguration : public edm::one::EDAnalyzer<> { +public: + explicit WritePPSAlignmentConfiguration(const edm::ParameterSet &); + +private: + void analyze(const edm::Event &, const edm::EventSetup &) override; + + edm::ESGetToken esToken_; +}; + +WritePPSAlignmentConfiguration::WritePPSAlignmentConfiguration(const edm::ParameterSet &iConfig) + : esToken_(esConsumes( + edm::ESInputTag("", iConfig.getParameter("label")))) {} + +void WritePPSAlignmentConfiguration::analyze(const edm::Event &iEvent, const edm::EventSetup &iSetup) { + // get the data + const auto &ppsAlignmentConfiguration = iSetup.getData(esToken_); + + // store the data in a DB object + edm::Service poolDbService; + if (poolDbService.isAvailable()) { + poolDbService->writeOne(&ppsAlignmentConfiguration, poolDbService->currentTime(), "PPSAlignmentConfigurationRcd"); + } else { + throw cms::Exception("WritePPSAlignmentConfiguration") << "PoolDBService required."; + } +} + +//define this as a plug-in +DEFINE_FWK_MODULE(WritePPSAlignmentConfiguration); diff --git a/CondTools/CTPPS/plugins/WritePPSAssociationCuts.cc b/CondTools/CTPPS/plugins/WritePPSAssociationCuts.cc new file mode 100644 index 0000000000000..97f0eb3d4bbe7 --- /dev/null +++ b/CondTools/CTPPS/plugins/WritePPSAssociationCuts.cc @@ -0,0 +1,51 @@ +/**************************************************************************** +* Author: +* Grzegorz Sroka +****************************************************************************/ + +#include "FWCore/Framework/interface/Frameworkfwd.h" +#include "FWCore/Framework/interface/one/EDAnalyzer.h" +#include "FWCore/Framework/interface/Event.h" +#include "FWCore/Framework/interface/EventSetup.h" +#include "FWCore/Framework/interface/ESHandle.h" +#include "FWCore/Framework/interface/MakerMacros.h" + +#include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/ServiceRegistry/interface/Service.h" + +#include "CondCore/DBOutputService/interface/PoolDBOutputService.h" + +#include "CondFormats/PPSObjects/interface/PPSAssociationCuts.h" +#include "CondFormats/DataRecord/interface/PPSAssociationCutsRcd.h" + +#include + +class WritePPSAssociationCuts : public edm::one::EDAnalyzer<> { +public: + explicit WritePPSAssociationCuts(const edm::ParameterSet &); + +private: + void analyze(const edm::Event &, const edm::EventSetup &) override; + + edm::ESGetToken esToken_; +}; + +WritePPSAssociationCuts::WritePPSAssociationCuts(const edm::ParameterSet &iConfig) + : esToken_(esConsumes( + edm::ESInputTag("", iConfig.getParameter("label")))) {} + +void WritePPSAssociationCuts::analyze(const edm::Event &iEvent, const edm::EventSetup &iSetup) { + // get the data + const auto &ppsAssociationCuts = iSetup.getData(esToken_); + + // store the data in a DB object + edm::Service poolDbService; + if (poolDbService.isAvailable()) { + poolDbService->writeOne(&ppsAssociationCuts, poolDbService->currentTime(), "PPSAssociationCutsRcd"); + } else { + throw cms::Exception("WritePPSAssociationCuts") << "PoolDBService required."; + } +} + +//define this as a plug-in +DEFINE_FWK_MODULE(WritePPSAssociationCuts); diff --git a/CondTools/CTPPS/test/retrieve_PPSAlignmentConfig_cfg.py b/CondTools/CTPPS/test/retrieve_PPSAlignmentConfig_cfg.py new file mode 100644 index 0000000000000..5614bfe76bc4f --- /dev/null +++ b/CondTools/CTPPS/test/retrieve_PPSAlignmentConfig_cfg.py @@ -0,0 +1,52 @@ +##### configuration ##### +input_conditions = 'sqlite_file:alignment_config.db' # input database +run_number = 1 # used to select the IOV +db_tag = 'PPSAlignmentConfig_test_v1_prompt' # database tag +######################### + +import FWCore.ParameterSet.Config as cms + +process = cms.Process("retrievePPSAlignmentConfig") + +# Message Logger +process.MessageLogger = cms.Service("MessageLogger", + destinations = cms.untracked.vstring('retrieve_PPSAlignmentConfig'), + retrieve_PPSAlignmentConfig = cms.untracked.PSet( + threshold = cms.untracked.string('INFO') + ) +) + +# Load CondDB service +process.load("CondCore.CondDB.CondDB_cfi") + +# input database (in this case the local sqlite file) +process.CondDB.connect = input_conditions + +# A data source must always be defined. We don't need it, so here's a dummy one. +process.source = cms.Source("EmptyIOVSource", + timetype = cms.string('runnumber'), + firstValue = cms.uint64(run_number), + lastValue = cms.uint64(run_number), + interval = cms.uint64(1) +) + +# input service +process.PoolDBESSource = cms.ESSource("PoolDBESSource", + process.CondDB, + DumbStat = cms.untracked.bool(True), + toGet = cms.VPSet(cms.PSet( + record = cms.string('PPSAlignmentConfigRcd'), + tag = cms.string(db_tag) + )) +) + +# DB object retrieve module +process.retrieve_config = cms.EDAnalyzer("RetrievePPSAlignmentConfig", + toGet = cms.VPSet(cms.PSet( + record = cms.string('PPSAlignmentConfigRcd'), + data = cms.vstring('PPSAlignmentConfig') + )), + verbose = cms.untracked.bool(True) +) + +process.path = cms.Path(process.retrieve_config) diff --git a/CondTools/CTPPS/test/retrieve_PPSAlignmentConfiguration_cfg.py b/CondTools/CTPPS/test/retrieve_PPSAlignmentConfiguration_cfg.py new file mode 100644 index 0000000000000..2a9d3ddc5b1d3 --- /dev/null +++ b/CondTools/CTPPS/test/retrieve_PPSAlignmentConfiguration_cfg.py @@ -0,0 +1,52 @@ +##### configuration ##### +input_conditions = 'sqlite_file:alignment_config.db' # input database +run_number = 1 # used to select the IOV +db_tag = 'PPSAlignmentConfiguration_v1_express' # database tag +######################### + +import FWCore.ParameterSet.Config as cms + +process = cms.Process("retrievePPSAlignmentConfiguration") + +# Message Logger +process.MessageLogger = cms.Service("MessageLogger", + destinations = cms.untracked.vstring('retrieve_PPSAlignmentConfiguration'), + retrieve_PPSAlignmentConfiguration = cms.untracked.PSet( + threshold = cms.untracked.string('INFO') + ) +) + +# Load CondDB service +process.load("CondCore.CondDB.CondDB_cfi") +\ +# input database (in this case the local sqlite file) +process.CondDB.connect = input_conditions + +# A data source must always be defined. We don't need it, so here's a dummy one. +process.source = cms.Source("EmptyIOVSource", + timetype = cms.string('runnumber'), + firstValue = cms.uint64(run_number), + lastValue = cms.uint64(run_number), + interval = cms.uint64(1) +) + +# input service +process.PoolDBESSource = cms.ESSource("PoolDBESSource", + process.CondDB, + DumbStat = cms.untracked.bool(True), + toGet = cms.VPSet(cms.PSet( + record = cms.string('PPSAlignmentConfigurationRcd'), + tag = cms.string(db_tag) + )) +) + +# DB object retrieve module +process.retrieve_config = cms.EDAnalyzer("RetrievePPSAlignmentConfiguration", + toGet = cms.VPSet(cms.PSet( + record = cms.string('PPSAlignmentConfigurationRcd'), + data = cms.vstring('PPSAlignmentConfiguration') + )), + verbose = cms.untracked.bool(True) +) + +process.path = cms.Path(process.retrieve_config) diff --git a/CondTools/CTPPS/test/retrieve_PPSAssociationCuts_cfg.py b/CondTools/CTPPS/test/retrieve_PPSAssociationCuts_cfg.py new file mode 100644 index 0000000000000..29edd0aa0e066 --- /dev/null +++ b/CondTools/CTPPS/test/retrieve_PPSAssociationCuts_cfg.py @@ -0,0 +1,53 @@ +##### configuration ##### +input_conditions = 'sqlite_file:association_config.db' # input database +run_number = 1 # used to select the IOV +db_tag = 'PPSAssociationCuts_test' # database tag +######################### + +import FWCore.ParameterSet.Config as cms + +process = cms.Process("retrievePPSAssociationConfig") + +# Message Logger +process.MessageLogger = cms.Service("MessageLogger", + destinations = cms.untracked.vstring('cout'), + cout = cms.untracked.PSet( + threshold = cms.untracked.string('INFO') + ) + ) + + +# Load CondDB service +process.load("CondCore.CondDB.CondDB_cfi") + +# input database (in this case the local sqlite file) +process.CondDB.connect = input_conditions + +# A data source must always be defined. We don't need it, so here's a dummy one. +process.source = cms.Source("EmptyIOVSource", + timetype = cms.string('runnumber'), + firstValue = cms.uint64(run_number), + lastValue = cms.uint64(run_number), + interval = cms.uint64(1) + ) + +# input service +process.PoolDBESSource = cms.ESSource("PoolDBESSource", + process.CondDB, + DumbStat = cms.untracked.bool(True), + toGet = cms.VPSet(cms.PSet( + record = cms.string('PPSAssociationCutsRcd'), + tag = cms.string(db_tag) + )) + ) + +# DB object retrieve module +process.retrieve_config = cms.EDAnalyzer("RetrievePPSAssociationCuts", + toGet = cms.VPSet(cms.PSet( + record = cms.string('PPSAssociationCutsRcd'), + data = cms.vstring('PPSAssociationCuts') + )), + verbose = cms.untracked.bool(True) + ) + +process.path = cms.Path(process.retrieve_config) diff --git a/CondTools/CTPPS/test/write_PPSAlignmentConfig_cfg.py b/CondTools/CTPPS/test/write_PPSAlignmentConfig_cfg.py new file mode 100644 index 0000000000000..0a1fe540a76be --- /dev/null +++ b/CondTools/CTPPS/test/write_PPSAlignmentConfig_cfg.py @@ -0,0 +1,88 @@ +##### configuration ##### +output_conditions = 'sqlite_file:alignment_config.db' # output database +run_number = 1 # beginning of the IOV +db_tag = 'PPSAlignmentConfig_test_v1_prompt' # database tag +produce_logs = True # if set to True, a file with logs will be produced. +product_instance_label = 'db_test' # ES product label +######################### + +import FWCore.ParameterSet.Config as cms + +process = cms.Process("writePPSAlignmentConfig") + +# Message Logger +if produce_logs: + process.MessageLogger = cms.Service("MessageLogger", + destinations = cms.untracked.vstring('write_PPSAlignmentConfig', + 'cout' + ), + write_PPSAlignmentConfig = cms.untracked.PSet( + threshold = cms.untracked.string('INFO') + ), + cout = cms.untracked.PSet( + threshold = cms.untracked.string('WARNING') + ) + ) +else: + process.MessageLogger = cms.Service("MessageLogger", + destinations = cms.untracked.vstring('cout'), + cout = cms.untracked.PSet( + threshold = cms.untracked.string('WARNING') + ) + ) + +# Load CondDB service +process.load("CondCore.CondDB.CondDB_cfi") + +# output database +process.CondDB.connect = output_conditions + +# A data source must always be defined. We don't need it, so here's a dummy one. +process.source = cms.Source("EmptyIOVSource", + timetype = cms.string('runnumber'), + firstValue = cms.uint64(run_number), + lastValue = cms.uint64(run_number), + interval = cms.uint64(1) +) + +# output service +process.PoolDBOutputService = cms.Service("PoolDBOutputService", + process.CondDB, + timetype = cms.untracked.string('runnumber'), + toPut = cms.VPSet(cms.PSet( + record = cms.string('PPSAlignmentConfigRcd'), + tag = cms.string(db_tag) + )) +) + +# ESSource +process.ppsAlignmentConfigESSource = cms.ESSource("PPSAlignmentConfigESSource", + # PPSAlignmentConfigESSource parameters, defaults will be taken from fillDescriptions + label = cms.string(product_instance_label), + sector_45 = cms.PSet( + rp_N = cms.PSet( + name = cms.string('db_test_RP'), + id = cms.int32(44), + y_max_fit_mode = cms.double(66.6) + ) + ), + y_alignment = cms.PSet( + rp_L_F = cms.PSet( + x_min = cms.double(102), + x_max = cms.double(210.0) + ) + ) +) + +# DB object maker +process.config_writer = cms.EDAnalyzer("WritePPSAlignmentConfig", + record = cms.string('PPSAlignmentConfigRcd'), + loggingOn = cms.untracked.bool(True), + SinceAppendMode = cms.bool(True), + Source = cms.PSet( + IOVRun = cms.untracked.uint32(1) + ), + label = cms.string(product_instance_label) +) + +process.path = cms.Path(process.config_writer) \ No newline at end of file diff --git a/CondTools/CTPPS/test/write_PPSAlignmentConfiguration_cfg.py b/CondTools/CTPPS/test/write_PPSAlignmentConfiguration_cfg.py new file mode 100644 index 0000000000000..0c5b693ff9cab --- /dev/null +++ b/CondTools/CTPPS/test/write_PPSAlignmentConfiguration_cfg.py @@ -0,0 +1,90 @@ +##### configuration ##### +output_conditions = 'sqlite_file:alignment_config.db' # output database +run_number = 1 # beginning of the IOV +db_tag = 'PPSAlignmentConfiguration_v1_express' # database tag +produce_logs = True # if set to True, a file with logs will be produced. +product_instance_label = 'db_test' # ES product label +# ESSource parameters can be configured below +######################### + +import FWCore.ParameterSet.Config as cms + +process = cms.Process("writePPSAlignmentConfiguration") + +# Message Logger +if produce_logs: + process.MessageLogger = cms.Service("MessageLogger", + destinations = cms.untracked.vstring('write_PPSAlignmentConfiguration', + 'cout' + ), + write_PPSAlignmentConfiguration = cms.untracked.PSet( + threshold = cms.untracked.string('INFO') + ), + cout = cms.untracked.PSet( + threshold = cms.untracked.string('WARNING') + ) + ) +else: + process.MessageLogger = cms.Service("MessageLogger", + destinations = cms.untracked.vstring('cout'), + cout = cms.untracked.PSet( + threshold = cms.untracked.string('WARNING') + ) + ) + +# Load CondDB service +process.load("CondCore.CondDB.CondDB_cfi") + +# output database +process.CondDB.connect = output_conditions + +# A data source must always be defined. We don't need it, so here's a dummy one. +process.source = cms.Source("EmptyIOVSource", + timetype = cms.string('runnumber'), + firstValue = cms.uint64(run_number), + lastValue = cms.uint64(run_number), + interval = cms.uint64(1) +) + +# output service +process.PoolDBOutputService = cms.Service("PoolDBOutputService", + process.CondDB, + timetype = cms.untracked.string('runnumber'), + toPut = cms.VPSet(cms.PSet( + record = cms.string('PPSAlignmentConfigurationRcd'), + tag = cms.string(db_tag) + )) +) + +# ESSource +process.ppsAlignmentConfigurationESSource = cms.ESSource("PPSAlignmentConfigurationESSource", + # PPSAlignmentConfigurationESSource parameters, defaults will be taken from fillDescriptions + label = cms.string(product_instance_label), + sector_45 = cms.PSet( + rp_N = cms.PSet( + name = cms.string('db_test_RP'), + id = cms.int32(44), + y_max_fit_mode = cms.double(66.6) + ) + ), + y_alignment = cms.PSet( + rp_L_F = cms.PSet( + x_min = cms.double(102), + x_max = cms.double(210.0) + ) + ), + extra_params = cms.vdouble( 1.15, 102., 777.7 ) +) + +# DB object maker +process.config_writer = cms.EDAnalyzer("WritePPSAlignmentConfiguration", + record = cms.string('PPSAlignmentConfigurationRcd'), + loggingOn = cms.untracked.bool(True), + SinceAppendMode = cms.bool(True), + Source = cms.PSet( + IOVRun = cms.untracked.uint32(1) + ), + label = cms.string(product_instance_label) +) + +process.path = cms.Path(process.config_writer) diff --git a/CondTools/CTPPS/test/write_PPSAssociationCuts_cfg.py b/CondTools/CTPPS/test/write_PPSAssociationCuts_cfg.py new file mode 100644 index 0000000000000..de4c8ce69b5d7 --- /dev/null +++ b/CondTools/CTPPS/test/write_PPSAssociationCuts_cfg.py @@ -0,0 +1,67 @@ +##### configuration ##### +output_conditions = 'sqlite_file:association_config.db' # output database +run_number = 1 # beginning of the IOV +db_tag = 'PPSAssociationCuts_test' # database tag +product_instance_label = 'db_test_label' # ES product label +######################### + +import FWCore.ParameterSet.Config as cms + +process = cms.Process("writePPSAssociationCuts") + +# Message Logger + +process.MessageLogger = cms.Service("MessageLogger", + destinations = cms.untracked.vstring('cout'), + cout = cms.untracked.PSet( + threshold = cms.untracked.string('INFO') + ) + ) + +# Load CondDB service +process.load("CondCore.CondDB.CondDB_cfi") + +# output database +process.CondDB.connect = output_conditions + +# A data source must always be defined. We don't need it, so here's a dummy one. +process.source = cms.Source("EmptyIOVSource", + timetype = cms.string('runnumber'), + firstValue = cms.uint64(run_number), + lastValue = cms.uint64(run_number), + interval = cms.uint64(1) + ) + +# output service +process.PoolDBOutputService = cms.Service("PoolDBOutputService", + process.CondDB, + timetype = cms.untracked.string('runnumber'), + toPut = cms.VPSet(cms.PSet( + record = cms.string('PPSAssociationCutsRcd'), + tag = cms.string(db_tag) + )) + ) + +# ESSource + +import CalibPPS.ESProducers.ppsAssociationCuts_non_DB_cff as ac +ac.use_single_infinite_iov_entry(ac.ppsAssociationCutsESSource,ac.p2018) + +process.ppsAssociationCutsESSource = ac.ppsAssociationCutsESSource +process.ppsAssociationCutsESSource.appendToDataLabel = cms.string('product_instance_label') + + + + +# DB object maker +process.config_writer = cms.EDAnalyzer("WritePPSAssociationCuts", + record = cms.string('PPSAssociationCutsRcd'), + loggingOn = cms.untracked.bool(True), + SinceAppendMode = cms.bool(True), + Source = cms.PSet( + IOVRun = cms.untracked.uint32(1) + ), + label = cms.string("product_instance_label") + ) + +process.path = cms.Path(process.config_writer) diff --git a/CondTools/DT/plugins/DTKeyedConfigDBDump.cc b/CondTools/DT/plugins/DTKeyedConfigDBDump.cc index fb9a62d4b1db8..0f850e975616e 100644 --- a/CondTools/DT/plugins/DTKeyedConfigDBDump.cc +++ b/CondTools/DT/plugins/DTKeyedConfigDBDump.cc @@ -7,11 +7,16 @@ * */ -//----------------------- -// This Class' Header -- -//----------------------- -#include "CondTools/DT/plugins/DTKeyedConfigDBDump.h" - +//---------------------- +// Base Class Headers -- +//---------------------- +#include "FWCore/Framework/interface/one/EDAnalyzer.h" +//------------------------------------ +// Collaborating Class Declarations -- +//------------------------------------ +#include "FWCore/Framework/interface/Event.h" +#include "FWCore/Framework/interface/EventSetup.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" //------------------------------- // Collaborating Class Headers -- //------------------------------- @@ -21,12 +26,28 @@ #include "FWCore/Framework/interface/ESHandle.h" #include "FWCore/Framework/interface/MakerMacros.h" -//--------------- -// C++ Headers -- -//--------------- -#include -#include +//----------------------- +// This Class' Header -- +//----------------------- +class DTKeyedConfigDBDump : public edm::one::EDAnalyzer<> { +public: + /** Constructor + */ + explicit DTKeyedConfigDBDump(const edm::ParameterSet& ps); + + /** Destructor + */ + ~DTKeyedConfigDBDump() override; + + /** Operations + */ + /// + void beginJob() override; + void analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) override; +private: + edm::ESGetToken perskeylistToken_; +}; //------------------- // Initializations -- //------------------- @@ -34,7 +55,7 @@ //---------------- // Constructors -- //---------------- -DTKeyedConfigDBDump::DTKeyedConfigDBDump(const edm::ParameterSet& ps) {} +DTKeyedConfigDBDump::DTKeyedConfigDBDump(const edm::ParameterSet& ps) : perskeylistToken_(esConsumes()) {} //-------------- // Destructor -- @@ -46,28 +67,23 @@ DTKeyedConfigDBDump::~DTKeyedConfigDBDump() {} //-------------- void DTKeyedConfigDBDump::beginJob() { return; } -void DTKeyedConfigDBDump::analyze(const edm::Event& e, const edm::EventSetup& c) { +void DTKeyedConfigDBDump::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) { edm::eventsetup::EventSetupRecordKey recordKey( edm::eventsetup::EventSetupRecordKey::TypeTag::findType("DTKeyedConfigListRcd")); if (recordKey.type() == edm::eventsetup::EventSetupRecordKey::TypeTag()) { //record not found - std::cout << "Record \"DTKeyedConfigListRcd " - << "\" does not exist " << std::endl; + edm::LogWarning("DTKeyedConfigDBDump") << "Record \"DTKeyedConfigListRcd " + << "\" does not exist " << std::endl; } - edm::ESHandle klh; - std::cout << "got eshandle" << std::endl; - c.get().get(klh); - std::cout << "got context" << std::endl; - cond::persistency::KeyList const& kl = *klh.product(); - cond::persistency::KeyList const* kp = &kl; - std::cout << "now load and get" << std::endl; + cond::persistency::KeyList const* kp = &iSetup.getData(perskeylistToken_); + edm::LogInfo("DTKeyedConfigDBDump") << "now load and get" << std::endl; auto pkc = kp->getUsingKey(999999999); - std::cout << "now check" << std::endl; + edm::LogInfo("DTKeyedConfigDBDump") << "now check" << std::endl; if (pkc.get()) - std::cout << pkc->getId() << " " << *(pkc->dataBegin()) << std::endl; + edm::LogInfo("DTKeyedConfigDBDump") << pkc->getId() << " " << *(pkc->dataBegin()) << std::endl; else - std::cout << "not found" << std::endl; - std::cout << std::endl; + edm::LogInfo("DTKeyedConfigDBDump") << "not found" << std::endl; + edm::LogInfo("DTKeyedConfigDBDump") << std::endl; return; } diff --git a/CondTools/DT/plugins/DTKeyedConfigDBDump.h b/CondTools/DT/plugins/DTKeyedConfigDBDump.h deleted file mode 100644 index fd3b2efc752c0..0000000000000 --- a/CondTools/DT/plugins/DTKeyedConfigDBDump.h +++ /dev/null @@ -1,54 +0,0 @@ -#ifndef DTKeyedConfigDBDump_H -#define DTKeyedConfigDBDump_H -/** \class DTKeyedConfigDBDump - * - * Description: - * - * - * $Date: 2010/03/18 16:07:59 $ - * $Revision: 1.1.2.1 $ - * \author Paolo Ronchese INFN Padova - * - */ - -//---------------------- -// Base Class Headers -- -//---------------------- -#include "FWCore/Framework/interface/EDAnalyzer.h" - -//------------------------------------ -// Collaborating Class Declarations -- -//------------------------------------ -#include "FWCore/Framework/interface/Event.h" -#include "FWCore/Framework/interface/EventSetup.h" -#include "FWCore/ParameterSet/interface/ParameterSet.h" - -//--------------- -// C++ Headers -- -//--------------- -#include - -// --------------------- -// -- Class Interface -- -// --------------------- - -class DTKeyedConfigDBDump : public edm::EDAnalyzer { -public: - /** Constructor - */ - explicit DTKeyedConfigDBDump(const edm::ParameterSet& ps); - - /** Destructor - */ - ~DTKeyedConfigDBDump() override; - - /** Operations - */ - /// - void beginJob() override; - void analyze(const edm::Event& e, const edm::EventSetup& c) override; - -private: -}; - -#endif // DTKeyedConfigDBDump_H diff --git a/CondTools/DT/plugins/DTKeyedConfigDBInit.h b/CondTools/DT/plugins/DTKeyedConfigDBInit.h index 3ba081d05ce4c..acd8c9a26af5b 100644 --- a/CondTools/DT/plugins/DTKeyedConfigDBInit.h +++ b/CondTools/DT/plugins/DTKeyedConfigDBInit.h @@ -14,7 +14,7 @@ //---------------------- // Base Class Headers -- //---------------------- -#include "FWCore/Framework/interface/EDAnalyzer.h" +#include "FWCore/Framework/interface/one/EDAnalyzer.h" //------------------------------------ // Collaborating Class Declarations -- @@ -32,7 +32,7 @@ // -- Class Interface -- // --------------------- -class DTKeyedConfigDBInit : public edm::EDAnalyzer { +class DTKeyedConfigDBInit : public edm::one::EDAnalyzer<> { public: /** Constructor */ diff --git a/CondTools/DT/plugins/DTKeyedConfigPopConAnalyzer.cc b/CondTools/DT/plugins/DTKeyedConfigPopConAnalyzer.cc index 58d3b3854a4c4..0f63bdb4bbdfe 100644 --- a/CondTools/DT/plugins/DTKeyedConfigPopConAnalyzer.cc +++ b/CondTools/DT/plugins/DTKeyedConfigPopConAnalyzer.cc @@ -13,27 +13,25 @@ class DTKeyedConfigPopConAnalyzer : public popcon::PopConAnalyzer(pset), - copyData(pset.getParameter("Source").getUntrackedParameter("copyData", true)) {} + copyData(pset.getParameter("Source").getUntrackedParameter("copyData", true)), + perskeylistToken_(esConsumes()) {} ~DTKeyedConfigPopConAnalyzer() override {} - void analyze(const edm::Event& e, const edm::EventSetup& s) override { + void analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) override { if (!copyData) return; - - edm::ESHandle klh; - std::cout << "got eshandle" << std::endl; - s.get().get(klh); - std::cout << "got context" << std::endl; - cond::persistency::KeyList const& kl = *klh.product(); + edm::LogInfo("DTKeyedConfigPopConAnalyzer") << "got context" << std::endl; + cond::persistency::KeyList const& kl = iSetup.getData(perskeylistToken_); for (size_t i = 0; i < kl.size(); i++) { std::shared_ptr kelem = kl.getUsingIndex(i); if (kelem.get()) - std::cout << kelem->getId() << std::endl; + edm::LogInfo("DTKeyedConfigPopConAnalyzer") << kelem->getId() << std::endl; } source().setList(&kl); } private: bool copyData; + edm::ESGetToken perskeylistToken_; }; DEFINE_FWK_MODULE(DTKeyedConfigPopConAnalyzer); diff --git a/CondTools/DT/plugins/DTUserKeyedConfigPopConAnalyzer.cc b/CondTools/DT/plugins/DTUserKeyedConfigPopConAnalyzer.cc index 2087b2dbbf1a7..a8d8d06b92c55 100644 --- a/CondTools/DT/plugins/DTUserKeyedConfigPopConAnalyzer.cc +++ b/CondTools/DT/plugins/DTUserKeyedConfigPopConAnalyzer.cc @@ -12,23 +12,21 @@ class DTUserKeyedConfigPopConAnalyzer : public popcon::PopConAnalyzer { public: DTUserKeyedConfigPopConAnalyzer(const edm::ParameterSet& pset) - : popcon::PopConAnalyzer(pset) {} + : popcon::PopConAnalyzer(pset), perskeylistToken_(esConsumes()) {} ~DTUserKeyedConfigPopConAnalyzer() override {} - void analyze(const edm::Event& e, const edm::EventSetup& s) override { - edm::ESHandle klh; - std::cout << "got eshandle" << std::endl; - s.get().get(klh); - std::cout << "got context" << std::endl; - cond::persistency::KeyList const& kl = *klh.product(); + void analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) override { + edm::LogInfo("DTUserKeyedConfigPopConAnalyzer") << "got eSdata" << std::endl; + cond::persistency::KeyList const& kl = iSetup.getData(perskeylistToken_); for (size_t i = 0; i < kl.size(); i++) { std::shared_ptr kentry = kl.getUsingIndex(i); if (kentry.get()) - std::cout << kentry->getId() << std::endl; + edm::LogInfo("DTUserKeyedConfigPopConAnalyzer") << kentry->getId() << std::endl; } source().setList(&kl); } private: + edm::ESGetToken perskeylistToken_; }; DEFINE_FWK_MODULE(DTUserKeyedConfigPopConAnalyzer); diff --git a/CondTools/DT/test/stubs/DTGeometryDump.cc b/CondTools/DT/test/stubs/DTGeometryDump.cc index de2a6d9a18a83..58c91d90e5546 100644 --- a/CondTools/DT/test/stubs/DTGeometryDump.cc +++ b/CondTools/DT/test/stubs/DTGeometryDump.cc @@ -18,17 +18,15 @@ Toy EDAnalyzer for testing purposes only. namespace edmtest { - DTGeometryDump::DTGeometryDump(edm::ParameterSet const& p) {} + DTGeometryDump::DTGeometryDump(edm::ParameterSet const& p) : dtgeomToken_(esConsumes()) {} - DTGeometryDump::DTGeometryDump(int i) {} + DTGeometryDump::DTGeometryDump(int i) : dtgeomToken_(esConsumes()) {} DTGeometryDump::~DTGeometryDump() {} void DTGeometryDump::analyze(const edm::Event& e, const edm::EventSetup& context) { using namespace edm::eventsetup; - edm::ESHandle muonGeom; - context.get().get(muonGeom); - + auto muonGeom = context.getHandle(dtgeomToken_); const std::vector& ch_cont = muonGeom->chambers(); std::vector::const_iterator ch_iter = ch_cont.begin(); std::vector::const_iterator ch_iend = ch_cont.end(); diff --git a/CondTools/DT/test/stubs/DTGeometryDump.h b/CondTools/DT/test/stubs/DTGeometryDump.h index 1fffd243055f1..fbc1c7519b80c 100644 --- a/CondTools/DT/test/stubs/DTGeometryDump.h +++ b/CondTools/DT/test/stubs/DTGeometryDump.h @@ -12,6 +12,8 @@ Toy EDAnalyzer for testing purposes only. #include "FWCore/ParameterSet/interface/ParameterSet.h" #include +class DTGeometry; +class MuonGeometryRecord; namespace edmtest { class DTGeometryDump : public edm::EDAnalyzer { @@ -22,5 +24,6 @@ namespace edmtest { virtual void analyze(const edm::Event& e, const edm::EventSetup& c); private: + edm::ESGetToken dtgeomToken_; }; } // namespace edmtest diff --git a/CondTools/DT/test/stubs/DTHVDump.cc b/CondTools/DT/test/stubs/DTHVDump.cc index 8eab8714f2626..503a426170f04 100644 --- a/CondTools/DT/test/stubs/DTHVDump.cc +++ b/CondTools/DT/test/stubs/DTHVDump.cc @@ -12,7 +12,6 @@ Toy EDAnalyzer for testing purposes only. #include "FWCore/Framework/interface/ESHandle.h" #include "FWCore/Framework/interface/MakerMacros.h" #include "CoralBase/TimeStamp.h" - #include "CondTools/DT/test/stubs/DTHVDump.h" #include "CondFormats/DTObjects/interface/DTHVStatus.h" #include "CondFormats/DataRecord/interface/DTHVStatusRcd.h" @@ -21,11 +20,11 @@ Toy EDAnalyzer for testing purposes only. namespace edmtest { - DTHVDump::DTHVDump(edm::ParameterSet const& p) { + DTHVDump::DTHVDump(edm::ParameterSet const& p) : dthvstatusToken_(esConsumes()) { // parameters to setup } - DTHVDump::DTHVDump(int i) {} + DTHVDump::DTHVDump(int i) : dthvstatusToken_(esConsumes()) {} DTHVDump::~DTHVDump() {} @@ -36,8 +35,7 @@ namespace edmtest { std::cout << " ---EVENT NUMBER " << e.id().event() << std::endl; // get configuration for current run - edm::ESHandle hv; - context.get().get(hv); + auto hv = context.getHandle(dthvstatusToken_); std::cout << hv->version() << std::endl; std::cout << std::distance(hv->begin(), hv->end()) << " data in the container" << std::endl; edm::ValidityInterval iov(context.get().validityInterval()); diff --git a/CondTools/DT/test/stubs/DTHVDump.h b/CondTools/DT/test/stubs/DTHVDump.h index 5210572bd92dc..3f512bbe6d87d 100644 --- a/CondTools/DT/test/stubs/DTHVDump.h +++ b/CondTools/DT/test/stubs/DTHVDump.h @@ -12,7 +12,8 @@ Toy EDAnalyzer for testing purposes only. #include "FWCore/ParameterSet/interface/ParameterSet.h" #include - +class DTHVStatus; +class DTHVStatusRcd; namespace edmtest { class DTHVDump : public edm::EDAnalyzer { public: @@ -22,5 +23,6 @@ namespace edmtest { virtual void analyze(const edm::Event& e, const edm::EventSetup& c); private: + edm::ESGetToken dthvstatusToken_; }; } // namespace edmtest diff --git a/CondTools/DT/test/validate/DTCCBConfigValidateDBRead.cc b/CondTools/DT/test/validate/DTCCBConfigValidateDBRead.cc index 6bb4b9f30ab39..eea3710803c09 100644 --- a/CondTools/DT/test/validate/DTCCBConfigValidateDBRead.cc +++ b/CondTools/DT/test/validate/DTCCBConfigValidateDBRead.cc @@ -25,9 +25,11 @@ Toy EDAnalyzer for testing purposes only. #include "CondFormats/DataRecord/interface/DTCCBConfigRcd.h" DTCCBConfigValidateDBRead::DTCCBConfigValidateDBRead(edm::ParameterSet const& p) - : dataFileName(p.getParameter("chkFile")), elogFileName(p.getParameter("logFile")) {} + : dataFileName(p.getParameter("chkFile")), + elogFileName(p.getParameter("logFile")), + dtccbToken_(esConsumes()) {} -DTCCBConfigValidateDBRead::DTCCBConfigValidateDBRead(int i) {} +DTCCBConfigValidateDBRead::DTCCBConfigValidateDBRead(int i) : dtccbToken_(esConsumes()) {} DTCCBConfigValidateDBRead::~DTCCBConfigValidateDBRead() {} @@ -40,8 +42,7 @@ void DTCCBConfigValidateDBRead::analyze(const edm::Event& e, const edm::EventSet run_fn << "run" << e.id().run() << dataFileName; std::ifstream chkFile(run_fn.str().c_str()); std::ofstream logFile(elogFileName.c_str(), std::ios_base::app); - edm::ESHandle conf; - context.get().get(conf); + auto conf = context.getHandle(dtccbToken_); std::cout << conf->version() << std::endl; std::cout << std::distance(conf->begin(), conf->end()) << " data in the container" << std::endl; int whe; diff --git a/CondTools/DT/test/validate/DTCCBConfigValidateDBRead.h b/CondTools/DT/test/validate/DTCCBConfigValidateDBRead.h index 2a32d7606ad91..7150f5c315431 100644 --- a/CondTools/DT/test/validate/DTCCBConfigValidateDBRead.h +++ b/CondTools/DT/test/validate/DTCCBConfigValidateDBRead.h @@ -1,4 +1,3 @@ - /*---------------------------------------------------------------------- Toy EDAnalyzer for testing purposes only. @@ -11,7 +10,8 @@ Toy EDAnalyzer for testing purposes only. #include "FWCore/Framework/interface/EventSetup.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" class DTConfigKey; - +class DTCCBConfig; +class DTCCBConfigRcd; class DTCCBConfigValidateDBRead : public edm::EDAnalyzer { public: explicit DTCCBConfigValidateDBRead(edm::ParameterSet const& p); @@ -23,7 +23,7 @@ class DTCCBConfigValidateDBRead : public edm::EDAnalyzer { private: std::string dataFileName; std::string elogFileName; - + edm::ESGetToken dtccbToken_; static bool cfrDiff(const std::vector& l_conf, const std::vector& r_conf); static bool cfrDiff(const std::vector& l_conf, const std::vector& r_conf); }; diff --git a/CondTools/DT/test/validate/DTCompMapValidateDBRead.cc b/CondTools/DT/test/validate/DTCompMapValidateDBRead.cc index 6464a23e32591..d5058ff51b376 100644 --- a/CondTools/DT/test/validate/DTCompMapValidateDBRead.cc +++ b/CondTools/DT/test/validate/DTCompMapValidateDBRead.cc @@ -25,9 +25,11 @@ Toy EDAnalyzer for testing purposes only. #include "CondFormats/DataRecord/interface/DTReadOutMappingRcd.h" DTCompMapValidateDBRead::DTCompMapValidateDBRead(edm::ParameterSet const& p) - : dataFileName(p.getParameter("chkFile")), elogFileName(p.getParameter("logFile")) {} + : dataFileName(p.getParameter("chkFile")), + elogFileName(p.getParameter("logFile")), + dtreadoutmappingToken_(esConsumes()) {} -DTCompMapValidateDBRead::DTCompMapValidateDBRead(int i) {} +DTCompMapValidateDBRead::DTCompMapValidateDBRead(int i) : dtreadoutmappingToken_(esConsumes()) {} DTCompMapValidateDBRead::~DTCompMapValidateDBRead() {} @@ -41,8 +43,7 @@ void DTCompMapValidateDBRead::analyze(const edm::Event& e, const edm::EventSetup // std::ifstream chkFile( run_fn.str().c_str() ); std::ifstream chkFile(dataFileName.c_str()); std::ofstream logFile(elogFileName.c_str(), std::ios_base::app); - edm::ESHandle ro; - context.get().get(ro); + auto ro = context.getHandle(dtreadoutmappingToken_); std::cout << ro->mapRobRos() << " " << ro->mapCellTdc() << std::endl; std::cout << std::distance(ro->begin(), ro->end()) << " data in the container" << std::endl; int whe; diff --git a/CondTools/DT/test/validate/DTCompMapValidateDBRead.h b/CondTools/DT/test/validate/DTCompMapValidateDBRead.h index 932e4f7a7a538..c83caa8c71498 100644 --- a/CondTools/DT/test/validate/DTCompMapValidateDBRead.h +++ b/CondTools/DT/test/validate/DTCompMapValidateDBRead.h @@ -11,6 +11,8 @@ Toy EDAnalyzer for testing purposes only. #include "FWCore/Framework/interface/EventSetup.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" +class DTReadOutMapping; +class DTReadOutMappingRcd; class DTCompMapValidateDBRead : public edm::EDAnalyzer { public: explicit DTCompMapValidateDBRead(edm::ParameterSet const& p); @@ -22,4 +24,5 @@ class DTCompMapValidateDBRead : public edm::EDAnalyzer { private: std::string dataFileName; std::string elogFileName; + edm::ESGetToken dtreadoutmappingToken_; }; diff --git a/CondTools/DT/test/validate/DTDeadFlagValidateDBRead.cc b/CondTools/DT/test/validate/DTDeadFlagValidateDBRead.cc index 2333fb3a7bd94..f5989f5870c50 100644 --- a/CondTools/DT/test/validate/DTDeadFlagValidateDBRead.cc +++ b/CondTools/DT/test/validate/DTDeadFlagValidateDBRead.cc @@ -25,9 +25,11 @@ Toy EDAnalyzer for testing purposes only. #include "CondFormats/DataRecord/interface/DTDeadFlagRcd.h" DTDeadFlagValidateDBRead::DTDeadFlagValidateDBRead(edm::ParameterSet const& p) - : dataFileName(p.getParameter("chkFile")), elogFileName(p.getParameter("logFile")) {} + : dataFileName(p.getParameter("chkFile")), + elogFileName(p.getParameter("logFile")), + dtdeadflagToken_(esConsumes()) {} -DTDeadFlagValidateDBRead::DTDeadFlagValidateDBRead(int i) {} +DTDeadFlagValidateDBRead::DTDeadFlagValidateDBRead(int i) : dtdeadflagToken_(esConsumes()) {} DTDeadFlagValidateDBRead::~DTDeadFlagValidateDBRead() {} @@ -40,8 +42,7 @@ void DTDeadFlagValidateDBRead::analyze(const edm::Event& e, const edm::EventSetu run_fn << "run" << e.id().run() << dataFileName; std::ifstream chkFile(run_fn.str().c_str()); std::ofstream logFile(elogFileName.c_str(), std::ios_base::app); - edm::ESHandle df; - context.get().get(df); + auto df = context.getHandle(dtdeadflagToken_); std::cout << df->version() << std::endl; std::cout << std::distance(df->begin(), df->end()) << " data in the container" << std::endl; int whe; diff --git a/CondTools/DT/test/validate/DTDeadFlagValidateDBRead.h b/CondTools/DT/test/validate/DTDeadFlagValidateDBRead.h index 160b4015c65d7..1255f9b7457f0 100644 --- a/CondTools/DT/test/validate/DTDeadFlagValidateDBRead.h +++ b/CondTools/DT/test/validate/DTDeadFlagValidateDBRead.h @@ -10,7 +10,8 @@ Toy EDAnalyzer for testing purposes only. #include "FWCore/Framework/interface/EventSetup.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" - +class DTDeadFlag; +class DTDeadFlagRcd; class DTDeadFlagValidateDBRead : public edm::EDAnalyzer { public: explicit DTDeadFlagValidateDBRead(edm::ParameterSet const& p); @@ -22,4 +23,5 @@ class DTDeadFlagValidateDBRead : public edm::EDAnalyzer { private: std::string dataFileName; std::string elogFileName; + edm::ESGetToken dtdeadflagToken_; }; diff --git a/CondTools/DT/test/validate/DTHVStatusValidateDBRead.cc b/CondTools/DT/test/validate/DTHVStatusValidateDBRead.cc index e69811d95a74f..14fc6d432fd59 100644 --- a/CondTools/DT/test/validate/DTHVStatusValidateDBRead.cc +++ b/CondTools/DT/test/validate/DTHVStatusValidateDBRead.cc @@ -25,9 +25,11 @@ Toy EDAnalyzer for testing purposes only. #include "CondFormats/DataRecord/interface/DTHVStatusRcd.h" DTHVStatusValidateDBRead::DTHVStatusValidateDBRead(edm::ParameterSet const& p) - : dataFileName(p.getParameter("chkFile")), elogFileName(p.getParameter("logFile")) {} + : dataFileName(p.getParameter("chkFile")), + elogFileName(p.getParameter("logFile")), + dthvstatusToken_(esConsumes()) {} -DTHVStatusValidateDBRead::DTHVStatusValidateDBRead(int i) {} +DTHVStatusValidateDBRead::DTHVStatusValidateDBRead(int i) : dthvstatusToken_(esConsumes()) {} DTHVStatusValidateDBRead::~DTHVStatusValidateDBRead() {} @@ -40,8 +42,7 @@ void DTHVStatusValidateDBRead::analyze(const edm::Event& e, const edm::EventSetu run_fn << "run" << e.id().run() << dataFileName; std::ifstream chkFile(run_fn.str().c_str()); std::ofstream logFile(elogFileName.c_str(), std::ios_base::app); - edm::ESHandle hv; - context.get().get(hv); + auto hv = context.getHandle(dthvstatusToken_); std::cout << hv->version() << std::endl; std::cout << std::distance(hv->begin(), hv->end()) << " data in the container" << std::endl; int status; diff --git a/CondTools/DT/test/validate/DTHVStatusValidateDBRead.h b/CondTools/DT/test/validate/DTHVStatusValidateDBRead.h index 04578b31a2a1c..7d22769134d31 100644 --- a/CondTools/DT/test/validate/DTHVStatusValidateDBRead.h +++ b/CondTools/DT/test/validate/DTHVStatusValidateDBRead.h @@ -10,7 +10,8 @@ Toy EDAnalyzer for testing purposes only. #include "FWCore/Framework/interface/EventSetup.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" - +class DTHVStatus; +class DTHVStatusRcd; class DTHVStatusValidateDBRead : public edm::EDAnalyzer { public: explicit DTHVStatusValidateDBRead(edm::ParameterSet const& p); @@ -22,4 +23,5 @@ class DTHVStatusValidateDBRead : public edm::EDAnalyzer { private: std::string dataFileName; std::string elogFileName; + edm::ESGetToken dthvstatusToken_; }; diff --git a/CondTools/DT/test/validate/DTLVStatusValidateDBRead.cc b/CondTools/DT/test/validate/DTLVStatusValidateDBRead.cc index 5f934e1615fc0..f4d54eba544d8 100644 --- a/CondTools/DT/test/validate/DTLVStatusValidateDBRead.cc +++ b/CondTools/DT/test/validate/DTLVStatusValidateDBRead.cc @@ -25,9 +25,11 @@ Toy EDAnalyzer for testing purposes only. #include "CondFormats/DataRecord/interface/DTLVStatusRcd.h" DTLVStatusValidateDBRead::DTLVStatusValidateDBRead(edm::ParameterSet const& p) - : dataFileName(p.getParameter("chkFile")), elogFileName(p.getParameter("logFile")) {} + : dataFileName(p.getParameter("chkFile")), + elogFileName(p.getParameter("logFile")), + dtlvstatusToken_(esConsumes()) {} -DTLVStatusValidateDBRead::DTLVStatusValidateDBRead(int i) {} +DTLVStatusValidateDBRead::DTLVStatusValidateDBRead(int i) : dtlvstatusToken_(esConsumes()) {} DTLVStatusValidateDBRead::~DTLVStatusValidateDBRead() {} @@ -40,8 +42,7 @@ void DTLVStatusValidateDBRead::analyze(const edm::Event& e, const edm::EventSetu run_fn << "run" << e.id().run() << dataFileName; std::ifstream chkFile(run_fn.str().c_str()); std::ofstream logFile(elogFileName.c_str(), std::ios_base::app); - edm::ESHandle lv; - context.get().get(lv); + auto lv = context.getHandle(dtlvstatusToken_); std::cout << lv->version() << std::endl; std::cout << std::distance(lv->begin(), lv->end()) << " data in the container" << std::endl; int status; diff --git a/CondTools/DT/test/validate/DTLVStatusValidateDBRead.h b/CondTools/DT/test/validate/DTLVStatusValidateDBRead.h index 27230c325f28c..8f24277d50ffe 100644 --- a/CondTools/DT/test/validate/DTLVStatusValidateDBRead.h +++ b/CondTools/DT/test/validate/DTLVStatusValidateDBRead.h @@ -11,6 +11,8 @@ Toy EDAnalyzer for testing purposes only. #include "FWCore/Framework/interface/EventSetup.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" +class DTLVStatus; +class DTLVStatusRcd; class DTLVStatusValidateDBRead : public edm::EDAnalyzer { public: explicit DTLVStatusValidateDBRead(edm::ParameterSet const& p); @@ -22,4 +24,5 @@ class DTLVStatusValidateDBRead : public edm::EDAnalyzer { private: std::string dataFileName; std::string elogFileName; + edm::ESGetToken dtlvstatusToken_; }; diff --git a/CondTools/DT/test/validate/DTMtimeValidateDBRead.cc b/CondTools/DT/test/validate/DTMtimeValidateDBRead.cc index 775e675300a91..eb37bffff8cf5 100644 --- a/CondTools/DT/test/validate/DTMtimeValidateDBRead.cc +++ b/CondTools/DT/test/validate/DTMtimeValidateDBRead.cc @@ -23,11 +23,17 @@ Toy EDAnalyzer for testing purposes only. #include "CondTools/DT/test/validate/DTMtimeValidateDBRead.h" #include "CondFormats/DTObjects/interface/DTMtime.h" #include "CondFormats/DataRecord/interface/DTMtimeRcd.h" +#include "CondFormats/DTObjects/interface/DTRecoConditions.h" +#include "CondFormats/DataRecord/interface/DTRecoConditionsVdriftRcd.h" DTMtimeValidateDBRead::DTMtimeValidateDBRead(edm::ParameterSet const& p) - : dataFileName(p.getParameter("chkFile")), elogFileName(p.getParameter("logFile")) {} + : dataFileName(p.getParameter("chkFile")), + elogFileName(p.getParameter("logFile")), + readLegacyVDriftDB(p.getParameter("readLegacyVDriftDB")), + dtmtTimeToken_(esConsumes()), + dtrecoCondToken_(esConsumes()) {} -DTMtimeValidateDBRead::DTMtimeValidateDBRead(int i) {} +DTMtimeValidateDBRead::DTMtimeValidateDBRead(int i) : dtmtTimeToken_(esConsumes()), dtrecoCondToken_(esConsumes()) {} DTMtimeValidateDBRead::~DTMtimeValidateDBRead() {} @@ -40,11 +46,7 @@ void DTMtimeValidateDBRead::analyze(const edm::Event& e, const edm::EventSetup& run_fn << "run" << e.id().run() << dataFileName; std::ifstream chkFile(run_fn.str().c_str()); std::ofstream logFile(elogFileName.c_str(), std::ios_base::app); - edm::ESHandle mT; - context.get().get(mT); - std::cout << mT->version() << std::endl; - std::cout << std::distance(mT->begin(), mT->end()) << " data in the container" << std::endl; - int status; + int whe; int sta; int sec; @@ -53,27 +55,49 @@ void DTMtimeValidateDBRead::analyze(const edm::Event& e, const edm::EventSetup& float mTrms; float ckmt; float ckrms; - DTMtime::const_iterator iter = mT->begin(); - DTMtime::const_iterator iend = mT->end(); - while (iter != iend) { - const DTMtimeId& mTId = iter->first; - const DTMtimeData& mTData = iter->second; - status = mT->get(mTId.wheelId, mTId.stationId, mTId.sectorId, mTId.slId, mTime, mTrms, DTTimeUnits::counts); - if (status) - logFile << "ERROR while getting sl Mtime " << mTId.wheelId << " " << mTId.stationId << " " << mTId.sectorId << " " - << mTId.slId << " , status = " << status << std::endl; - if ((fabs(mTData.mTime - mTime) > 0.01) || (fabs(mTData.mTrms - mTrms) > 0.0001)) - logFile << "MISMATCH WHEN READING sl Mtime " << mTId.wheelId << " " << mTId.stationId << " " << mTId.sectorId - << " " << mTId.slId << " : " << mTData.mTime << " " << mTData.mTrms << " -> " << mTime << " " << mTrms - << std::endl; - iter++; - } + if (readLegacyVDriftDB) { //legacy format + auto mT = context.getHandle(dtmtTimeToken_); + std::cout << mT->version() << std::endl; + std::cout << std::distance(mT->begin(), mT->end()) << " data in the container" << std::endl; + + int status; + DTMtime::const_iterator iter = mT->begin(); + DTMtime::const_iterator iend = mT->end(); + while (iter != iend) { + const DTMtimeId& mTId = iter->first; + const DTMtimeData& mTData = iter->second; + status = mT->get(mTId.wheelId, mTId.stationId, mTId.sectorId, mTId.slId, mTime, mTrms, DTTimeUnits::counts); + if (status) + logFile << "ERROR while getting sl Mtime " << mTId.wheelId << " " << mTId.stationId << " " << mTId.sectorId + << " " << mTId.slId << " , status = " << status << std::endl; + if ((fabs(mTData.mTime - mTime) > 0.01) || (fabs(mTData.mTrms - mTrms) > 0.0001)) + logFile << "MISMATCH WHEN READING sl Mtime " << mTId.wheelId << " " << mTId.stationId << " " << mTId.sectorId + << " " << mTId.slId << " : " << mTData.mTime << " " << mTData.mTrms << " -> " << mTime << " " << mTrms + << std::endl; + iter++; + } - while (chkFile >> whe >> sta >> sec >> qua >> ckmt >> ckrms) { - status = mT->get(whe, sta, sec, qua, mTime, mTrms, DTTimeUnits::counts); - if ((fabs(ckmt - mTime) > 0.01) || (fabs(ckrms - mTrms) > 0.0001)) - logFile << "MISMATCH IN WRITING AND READING sl Mtime " << whe << " " << sta << " " << sec << " " << qua << " : " - << ckmt << " " << ckrms << " -> " << mTime << " " << mTrms << std::endl; + while (chkFile >> whe >> sta >> sec >> qua >> ckmt >> ckrms) { + status = mT->get(whe, sta, sec, qua, mTime, mTrms, DTTimeUnits::counts); + if ((fabs(ckmt - mTime) > 0.01) || (fabs(ckrms - mTrms) > 0.0001)) + logFile << "MISMATCH IN WRITING AND READING sl Mtime " << whe << " " << sta << " " << sec << " " << qua << " : " + << ckmt << " " << ckrms << " -> " << mTime << " " << mTrms << std::endl; + } + } else { + //hVdrift; + //context.get().get(hVdrift); + const DTRecoConditions* vDriftMap_ = &context.getData(dtrecoCondToken_); + // Consistency check: no parametrization is implemented for the time being + int version = vDriftMap_->version(); + if (version != 1) { + throw cms::Exception("Configuration") << "only version 1 is presently supported for VDriftDB"; + } + while (chkFile >> whe >> sta >> sec >> qua >> ckmt >> ckrms) { + mTime = vDriftMap_->get(DTWireId(whe, sta, sec, 1, 0, 0)); + if ((fabs(ckmt - mTime) > 0.01)) + logFile << "MISMATCH IN WRITING AND READING sl Mtime " << whe << " " << sta << " " << sec << " " << qua << " : " + << ckmt << " " << ckrms << " -> " << mTime << " --- " << std::endl; + } } } diff --git a/CondTools/DT/test/validate/DTMtimeValidateDBRead.h b/CondTools/DT/test/validate/DTMtimeValidateDBRead.h index a213f8b971e38..ce81cccf8c893 100644 --- a/CondTools/DT/test/validate/DTMtimeValidateDBRead.h +++ b/CondTools/DT/test/validate/DTMtimeValidateDBRead.h @@ -11,6 +11,10 @@ Toy EDAnalyzer for testing purposes only. #include "FWCore/Framework/interface/EventSetup.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" +class DTMtime; +class DTMtimeRcd; +class DTRecoConditions; +class DTRecoConditionsVdriftRcd; class DTMtimeValidateDBRead : public edm::EDAnalyzer { public: explicit DTMtimeValidateDBRead(edm::ParameterSet const& p); @@ -22,4 +26,7 @@ class DTMtimeValidateDBRead : public edm::EDAnalyzer { private: std::string dataFileName; std::string elogFileName; + bool readLegacyVDriftDB; // which DB to use + edm::ESGetToken dtmtTimeToken_; + edm::ESGetToken dtrecoCondToken_; }; diff --git a/CondTools/DT/test/validate/DTPerformanceValidateDBRead.cc b/CondTools/DT/test/validate/DTPerformanceValidateDBRead.cc index 9f90dc769dd25..7ea71c56d5cab 100644 --- a/CondTools/DT/test/validate/DTPerformanceValidateDBRead.cc +++ b/CondTools/DT/test/validate/DTPerformanceValidateDBRead.cc @@ -25,9 +25,11 @@ Toy EDAnalyzer for testing purposes only. #include "CondFormats/DataRecord/interface/DTPerformanceRcd.h" DTPerformanceValidateDBRead::DTPerformanceValidateDBRead(edm::ParameterSet const& p) - : dataFileName(p.getParameter("chkFile")), elogFileName(p.getParameter("logFile")) {} + : dataFileName(p.getParameter("chkFile")), + elogFileName(p.getParameter("logFile")), + dtperfToken_(esConsumes()) {} -DTPerformanceValidateDBRead::DTPerformanceValidateDBRead(int i) {} +DTPerformanceValidateDBRead::DTPerformanceValidateDBRead(int i) : dtperfToken_(esConsumes()) {} DTPerformanceValidateDBRead::~DTPerformanceValidateDBRead() {} @@ -40,8 +42,7 @@ void DTPerformanceValidateDBRead::analyze(const edm::Event& e, const edm::EventS run_fn << "run" << e.id().run() << dataFileName; std::ifstream chkFile(run_fn.str().c_str()); std::ofstream logFile(elogFileName.c_str(), std::ios_base::app); - edm::ESHandle mP; - context.get().get(mP); + auto mP = context.getHandle(dtperfToken_); std::cout << mP->version() << std::endl; std::cout << std::distance(mP->begin(), mP->end()) << " data in the container" << std::endl; int status; diff --git a/CondTools/DT/test/validate/DTPerformanceValidateDBRead.h b/CondTools/DT/test/validate/DTPerformanceValidateDBRead.h index cd73087147c17..f789eb17f8dec 100644 --- a/CondTools/DT/test/validate/DTPerformanceValidateDBRead.h +++ b/CondTools/DT/test/validate/DTPerformanceValidateDBRead.h @@ -11,6 +11,8 @@ Toy EDAnalyzer for testing purposes only. #include "FWCore/Framework/interface/EventSetup.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" +class DTPerformance; +class DTPerformanceRcd; class DTPerformanceValidateDBRead : public edm::EDAnalyzer { public: explicit DTPerformanceValidateDBRead(edm::ParameterSet const& p); @@ -22,4 +24,5 @@ class DTPerformanceValidateDBRead : public edm::EDAnalyzer { private: std::string dataFileName; std::string elogFileName; + edm::ESGetToken dtperfToken_; }; diff --git a/CondTools/DT/test/validate/DTROMapValidateDBRead.cc b/CondTools/DT/test/validate/DTROMapValidateDBRead.cc index a74ec0259a57a..7896e6c993b5e 100644 --- a/CondTools/DT/test/validate/DTROMapValidateDBRead.cc +++ b/CondTools/DT/test/validate/DTROMapValidateDBRead.cc @@ -25,9 +25,11 @@ Toy EDAnalyzer for testing purposes only. #include "CondFormats/DataRecord/interface/DTReadOutMappingRcd.h" DTROMapValidateDBRead::DTROMapValidateDBRead(edm::ParameterSet const& p) - : dataFileName(p.getParameter("chkFile")), elogFileName(p.getParameter("logFile")) {} + : dataFileName(p.getParameter("chkFile")), + elogFileName(p.getParameter("logFile")), + dtreadoutmappingToken_(esConsumes()) {} -DTROMapValidateDBRead::DTROMapValidateDBRead(int i) {} +DTROMapValidateDBRead::DTROMapValidateDBRead(int i) : dtreadoutmappingToken_(esConsumes()) {} DTROMapValidateDBRead::~DTROMapValidateDBRead() {} @@ -41,8 +43,7 @@ void DTROMapValidateDBRead::analyze(const edm::Event& e, const edm::EventSetup& // std::ifstream chkFile( run_fn.str().c_str() ); std::ifstream chkFile(dataFileName.c_str()); std::ofstream logFile(elogFileName.c_str(), std::ios_base::app); - edm::ESHandle ro; - context.get().get(ro); + auto ro = context.getHandle(dtreadoutmappingToken_); std::cout << ro->mapRobRos() << " " << ro->mapCellTdc() << std::endl; std::cout << std::distance(ro->begin(), ro->end()) << " data in the container" << std::endl; int whe; diff --git a/CondTools/DT/test/validate/DTROMapValidateDBRead.h b/CondTools/DT/test/validate/DTROMapValidateDBRead.h index 754c0cb9aa5cf..ef436d1fe2ec2 100644 --- a/CondTools/DT/test/validate/DTROMapValidateDBRead.h +++ b/CondTools/DT/test/validate/DTROMapValidateDBRead.h @@ -11,6 +11,9 @@ Toy EDAnalyzer for testing purposes only. #include "FWCore/Framework/interface/EventSetup.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" +class DTReadOutMapping; +class DTReadOutMappingRcd; + class DTROMapValidateDBRead : public edm::EDAnalyzer { public: explicit DTROMapValidateDBRead(edm::ParameterSet const& p); @@ -22,4 +25,5 @@ class DTROMapValidateDBRead : public edm::EDAnalyzer { private: std::string dataFileName; std::string elogFileName; + edm::ESGetToken dtreadoutmappingToken_; }; diff --git a/CondTools/DT/test/validate/DTRangeT0ValidateDBRead.cc b/CondTools/DT/test/validate/DTRangeT0ValidateDBRead.cc index 532371c0ad27b..9d435269d3df3 100644 --- a/CondTools/DT/test/validate/DTRangeT0ValidateDBRead.cc +++ b/CondTools/DT/test/validate/DTRangeT0ValidateDBRead.cc @@ -25,9 +25,11 @@ Toy EDAnalyzer for testing purposes only. #include "CondFormats/DataRecord/interface/DTRangeT0Rcd.h" DTRangeT0ValidateDBRead::DTRangeT0ValidateDBRead(edm::ParameterSet const& p) - : dataFileName(p.getParameter("chkFile")), elogFileName(p.getParameter("logFile")) {} + : dataFileName(p.getParameter("chkFile")), + elogFileName(p.getParameter("logFile")), + dtrangeToken_(esConsumes()) {} -DTRangeT0ValidateDBRead::DTRangeT0ValidateDBRead(int i) {} +DTRangeT0ValidateDBRead::DTRangeT0ValidateDBRead(int i) : dtrangeToken_(esConsumes()) {} DTRangeT0ValidateDBRead::~DTRangeT0ValidateDBRead() {} @@ -40,8 +42,7 @@ void DTRangeT0ValidateDBRead::analyze(const edm::Event& e, const edm::EventSetup run_fn << "run" << e.id().run() << dataFileName; std::ifstream chkFile(run_fn.str().c_str()); std::ofstream logFile(elogFileName.c_str(), std::ios_base::app); - edm::ESHandle tR; - context.get().get(tR); + auto tR = context.getHandle(dtrangeToken_); std::cout << tR->version() << std::endl; std::cout << std::distance(tR->begin(), tR->end()) << " data in the container" << std::endl; int status; diff --git a/CondTools/DT/test/validate/DTRangeT0ValidateDBRead.h b/CondTools/DT/test/validate/DTRangeT0ValidateDBRead.h index 6b7beeca7a50b..baf4ec326da8c 100644 --- a/CondTools/DT/test/validate/DTRangeT0ValidateDBRead.h +++ b/CondTools/DT/test/validate/DTRangeT0ValidateDBRead.h @@ -11,6 +11,9 @@ Toy EDAnalyzer for testing purposes only. #include "FWCore/Framework/interface/EventSetup.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" +class DTRangeT0; +class DTRangeT0Rcd; + class DTRangeT0ValidateDBRead : public edm::EDAnalyzer { public: explicit DTRangeT0ValidateDBRead(edm::ParameterSet const& p); @@ -22,4 +25,5 @@ class DTRangeT0ValidateDBRead : public edm::EDAnalyzer { private: std::string dataFileName; std::string elogFileName; + edm::ESGetToken dtrangeToken_; }; diff --git a/CondTools/DT/test/validate/DTStatusFlagValidateDBRead.cc b/CondTools/DT/test/validate/DTStatusFlagValidateDBRead.cc index 58b752d5ea0f4..b617adcacfea9 100644 --- a/CondTools/DT/test/validate/DTStatusFlagValidateDBRead.cc +++ b/CondTools/DT/test/validate/DTStatusFlagValidateDBRead.cc @@ -25,9 +25,11 @@ Toy EDAnalyzer for testing purposes only. #include "CondFormats/DataRecord/interface/DTStatusFlagRcd.h" DTStatusFlagValidateDBRead::DTStatusFlagValidateDBRead(edm::ParameterSet const& p) - : dataFileName(p.getParameter("chkFile")), elogFileName(p.getParameter("logFile")) {} + : dataFileName(p.getParameter("chkFile")), + elogFileName(p.getParameter("logFile")), + dtstatusFlagToken_(esConsumes()) {} -DTStatusFlagValidateDBRead::DTStatusFlagValidateDBRead(int i) {} +DTStatusFlagValidateDBRead::DTStatusFlagValidateDBRead(int i) : dtstatusFlagToken_(esConsumes()) {} DTStatusFlagValidateDBRead::~DTStatusFlagValidateDBRead() {} @@ -40,8 +42,7 @@ void DTStatusFlagValidateDBRead::analyze(const edm::Event& e, const edm::EventSe run_fn << "run" << e.id().run() << dataFileName; std::ifstream chkFile(run_fn.str().c_str()); std::ofstream logFile(elogFileName.c_str(), std::ios_base::app); - edm::ESHandle sf; - context.get().get(sf); + auto sf = context.getHandle(dtstatusFlagToken_); std::cout << sf->version() << std::endl; std::cout << std::distance(sf->begin(), sf->end()) << " data in the container" << std::endl; int whe; diff --git a/CondTools/DT/test/validate/DTStatusFlagValidateDBRead.h b/CondTools/DT/test/validate/DTStatusFlagValidateDBRead.h index 02297c20d470c..fb8527f7b97b8 100644 --- a/CondTools/DT/test/validate/DTStatusFlagValidateDBRead.h +++ b/CondTools/DT/test/validate/DTStatusFlagValidateDBRead.h @@ -11,6 +11,8 @@ Toy EDAnalyzer for testing purposes only. #include "FWCore/Framework/interface/EventSetup.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" +class DTStatusFlag; +class DTStatusFlagRcd; class DTStatusFlagValidateDBRead : public edm::EDAnalyzer { public: explicit DTStatusFlagValidateDBRead(edm::ParameterSet const& p); @@ -22,4 +24,5 @@ class DTStatusFlagValidateDBRead : public edm::EDAnalyzer { private: std::string dataFileName; std::string elogFileName; + edm::ESGetToken dtstatusFlagToken_; }; diff --git a/CondTools/DT/test/validate/DTT0ValidateDBRead.cc b/CondTools/DT/test/validate/DTT0ValidateDBRead.cc index 00d999dd38d88..325343d771175 100644 --- a/CondTools/DT/test/validate/DTT0ValidateDBRead.cc +++ b/CondTools/DT/test/validate/DTT0ValidateDBRead.cc @@ -25,9 +25,11 @@ Toy EDAnalyzer for testing purposes only. #include "CondFormats/DataRecord/interface/DTT0Rcd.h" DTT0ValidateDBRead::DTT0ValidateDBRead(edm::ParameterSet const& p) - : dataFileName(p.getParameter("chkFile")), elogFileName(p.getParameter("logFile")) {} + : dataFileName(p.getParameter("chkFile")), + elogFileName(p.getParameter("logFile")), + dtT0Token_(esConsumes()) {} -DTT0ValidateDBRead::DTT0ValidateDBRead(int i) {} +DTT0ValidateDBRead::DTT0ValidateDBRead(int i) : dtT0Token_(esConsumes()) {} DTT0ValidateDBRead::~DTT0ValidateDBRead() {} @@ -40,8 +42,7 @@ void DTT0ValidateDBRead::analyze(const edm::Event& e, const edm::EventSetup& con run_fn << "run" << e.id().run() << dataFileName; std::ifstream chkFile(run_fn.str().c_str()); std::ofstream logFile(elogFileName.c_str(), std::ios_base::app); - edm::ESHandle t0; - context.get().get(t0); + auto t0 = context.getHandle(dtT0Token_); std::cout << t0->version() << std::endl; std::cout << std::distance(t0->begin(), t0->end()) << " data in the container" << std::endl; int whe; diff --git a/CondTools/DT/test/validate/DTT0ValidateDBRead.h b/CondTools/DT/test/validate/DTT0ValidateDBRead.h index 753563393a680..a99961d48f21f 100644 --- a/CondTools/DT/test/validate/DTT0ValidateDBRead.h +++ b/CondTools/DT/test/validate/DTT0ValidateDBRead.h @@ -11,6 +11,8 @@ Toy EDAnalyzer for testing purposes only. #include "FWCore/Framework/interface/EventSetup.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" +class DTT0; +class DTT0Rcd; class DTT0ValidateDBRead : public edm::EDAnalyzer { public: explicit DTT0ValidateDBRead(edm::ParameterSet const& p); @@ -22,4 +24,5 @@ class DTT0ValidateDBRead : public edm::EDAnalyzer { private: std::string dataFileName; std::string elogFileName; + edm::ESGetToken dtT0Token_; }; diff --git a/CondTools/DT/test/validate/DTTPGParametersValidateDBRead.cc b/CondTools/DT/test/validate/DTTPGParametersValidateDBRead.cc index 72e2ec817b12b..a208bb23ad85f 100644 --- a/CondTools/DT/test/validate/DTTPGParametersValidateDBRead.cc +++ b/CondTools/DT/test/validate/DTTPGParametersValidateDBRead.cc @@ -25,9 +25,11 @@ Toy EDAnalyzer for testing purposes only. #include "CondFormats/DataRecord/interface/DTTPGParametersRcd.h" DTTPGParametersValidateDBRead::DTTPGParametersValidateDBRead(edm::ParameterSet const& p) - : dataFileName(p.getParameter("chkFile")), elogFileName(p.getParameter("logFile")) {} + : dataFileName(p.getParameter("chkFile")), + elogFileName(p.getParameter("logFile")), + dttpgPramToken_(esConsumes()) {} -DTTPGParametersValidateDBRead::DTTPGParametersValidateDBRead(int i) {} +DTTPGParametersValidateDBRead::DTTPGParametersValidateDBRead(int i) : dttpgPramToken_(esConsumes()) {} DTTPGParametersValidateDBRead::~DTTPGParametersValidateDBRead() {} @@ -40,8 +42,7 @@ void DTTPGParametersValidateDBRead::analyze(const edm::Event& e, const edm::Even run_fn << "run" << e.id().run() << dataFileName; std::ifstream chkFile(run_fn.str().c_str()); std::ofstream logFile(elogFileName.c_str(), std::ios_base::app); - edm::ESHandle tpg; - context.get().get(tpg); + auto tpg = context.getHandle(dttpgPramToken_); std::cout << tpg->version() << std::endl; std::cout << std::distance(tpg->begin(), tpg->end()) << " data in the container" << std::endl; int whe; diff --git a/CondTools/DT/test/validate/DTTPGParametersValidateDBRead.h b/CondTools/DT/test/validate/DTTPGParametersValidateDBRead.h index 0e9ec5cc5a137..6c6082d92154f 100644 --- a/CondTools/DT/test/validate/DTTPGParametersValidateDBRead.h +++ b/CondTools/DT/test/validate/DTTPGParametersValidateDBRead.h @@ -11,6 +11,8 @@ Toy EDAnalyzer for testing purposes only. #include "FWCore/Framework/interface/EventSetup.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" +class DTTPGParameters; +class DTTPGParametersRcd; class DTTPGParametersValidateDBRead : public edm::EDAnalyzer { public: explicit DTTPGParametersValidateDBRead(edm::ParameterSet const& p); @@ -22,4 +24,5 @@ class DTTPGParametersValidateDBRead : public edm::EDAnalyzer { private: std::string dataFileName; std::string elogFileName; + edm::ESGetToken dttpgPramToken_; }; diff --git a/CondTools/DT/test/validate/DTTtrigValidateDBRead.cc b/CondTools/DT/test/validate/DTTtrigValidateDBRead.cc index 2875b3da47988..bd9917d6f8d58 100644 --- a/CondTools/DT/test/validate/DTTtrigValidateDBRead.cc +++ b/CondTools/DT/test/validate/DTTtrigValidateDBRead.cc @@ -25,9 +25,11 @@ Toy EDAnalyzer for testing purposes only. #include "CondFormats/DataRecord/interface/DTTtrigRcd.h" DTTtrigValidateDBRead::DTTtrigValidateDBRead(edm::ParameterSet const& p) - : dataFileName(p.getParameter("chkFile")), elogFileName(p.getParameter("logFile")) {} + : dataFileName(p.getParameter("chkFile")), + elogFileName(p.getParameter("logFile")), + dtTrigToken_(esConsumes()) {} -DTTtrigValidateDBRead::DTTtrigValidateDBRead(int i) {} +DTTtrigValidateDBRead::DTTtrigValidateDBRead(int i) : dtTrigToken_(esConsumes()) {} DTTtrigValidateDBRead::~DTTtrigValidateDBRead() {} @@ -40,8 +42,7 @@ void DTTtrigValidateDBRead::analyze(const edm::Event& e, const edm::EventSetup& run_fn << "run" << e.id().run() << dataFileName; std::ifstream chkFile(run_fn.str().c_str()); std::ofstream logFile(elogFileName.c_str(), std::ios_base::app); - edm::ESHandle tT; - context.get().get(tT); + auto tT = context.getHandle(dtTrigToken_); std::cout << tT->version() << std::endl; std::cout << std::distance(tT->begin(), tT->end()) << " data in the container" << std::endl; int status; diff --git a/CondTools/DT/test/validate/DTTtrigValidateDBRead.h b/CondTools/DT/test/validate/DTTtrigValidateDBRead.h index 02c2a2938a160..925d47d137728 100644 --- a/CondTools/DT/test/validate/DTTtrigValidateDBRead.h +++ b/CondTools/DT/test/validate/DTTtrigValidateDBRead.h @@ -10,6 +10,8 @@ Toy EDAnalyzer for testing purposes only. #include "FWCore/Framework/interface/EventSetup.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" +class DTTtrig; +class DTTtrigRcd; class DTTtrigValidateDBRead : public edm::EDAnalyzer { public: @@ -22,4 +24,5 @@ class DTTtrigValidateDBRead : public edm::EDAnalyzer { private: std::string dataFileName; std::string elogFileName; + edm::ESGetToken dtTrigToken_; }; diff --git a/CondTools/Ecal/interface/ESDBCopy.h b/CondTools/Ecal/interface/ESDBCopy.h index c658aa62effca..c4cac2c5dd824 100644 --- a/CondTools/Ecal/interface/ESDBCopy.h +++ b/CondTools/Ecal/interface/ESDBCopy.h @@ -1,9 +1,22 @@ -#ifndef ESDBCOPY_H -#define ESDBCOPY_H +#ifndef CondTools_Ecal_ESDBCopy_h +#define CondTools_Ecal_ESDBCopy_h -#include "FWCore/Framework/interface/EDAnalyzer.h" +#include "FWCore/Framework/interface/one/EDAnalyzer.h" #include "CondCore/CondDB/interface/Exception.h" +#include "CondFormats/ESObjects/interface/ESPedestals.h" +#include "CondFormats/DataRecord/interface/ESPedestalsRcd.h" +#include "CondFormats/ESObjects/interface/ESADCToGeVConstant.h" +#include "CondFormats/DataRecord/interface/ESADCToGeVConstantRcd.h" +#include "CondFormats/ESObjects/interface/ESChannelStatus.h" +#include "CondFormats/DataRecord/interface/ESChannelStatusRcd.h" +#include "CondFormats/ESObjects/interface/ESIntercalibConstants.h" +#include "CondFormats/DataRecord/interface/ESIntercalibConstantsRcd.h" +#include "CondFormats/ESObjects/interface/ESWeightStripGroups.h" +#include "CondFormats/DataRecord/interface/ESWeightStripGroupsRcd.h" +#include "CondFormats/ESObjects/interface/ESTBWeights.h" +#include "CondFormats/DataRecord/interface/ESTBWeightsRcd.h" + #include "FWCore/Framework/interface/IOVSyncValue.h" #include @@ -15,7 +28,7 @@ namespace edm { class EventSetup; } // namespace edm -class ESDBCopy : public edm::EDAnalyzer { +class ESDBCopy : public edm::one::EDAnalyzer<> { public: explicit ESDBCopy(const edm::ParameterSet& iConfig); ~ESDBCopy() override; @@ -23,12 +36,19 @@ class ESDBCopy : public edm::EDAnalyzer { void analyze(const edm::Event& evt, const edm::EventSetup& evtSetup) override; private: - bool shouldCopy(const edm::EventSetup& evtSetup, std::string container); - void copyToDB(const edm::EventSetup& evtSetup, std::string container); + bool shouldCopy(const edm::EventSetup& evtSetup, const std::string& container); + void copyToDB(const edm::EventSetup& evtSetup, const std::string& container); std::string m_timetype; std::map m_cacheIDs; std::map m_records; + + const edm::ESGetToken esPedestalsToken_; + const edm::ESGetToken esADCToGeVConstantToken_; + const edm::ESGetToken esChannelStatusToken_; + const edm::ESGetToken esIntercalibConstantsToken_; + const edm::ESGetToken esWeightStripGroupsToken_; + const edm::ESGetToken esTBWeightsToken_; }; #endif diff --git a/CondTools/Ecal/interface/EcalDBCopy.h b/CondTools/Ecal/interface/EcalDBCopy.h index 2b638b44db3dd..69a3d65bf7ff9 100644 --- a/CondTools/Ecal/interface/EcalDBCopy.h +++ b/CondTools/Ecal/interface/EcalDBCopy.h @@ -1,11 +1,32 @@ #ifndef ECALDBCOPY_H #define ECALDBCOPY_H -#include "FWCore/Framework/interface/EDAnalyzer.h" +#include "FWCore/Framework/interface/one/EDAnalyzer.h" #include "CondCore/CondDB/interface/Exception.h" #include "FWCore/Framework/interface/IOVSyncValue.h" - +#include "CondFormats/EcalObjects/interface/EcalPedestals.h" +#include "CondFormats/EcalObjects/interface/EcalTimeCalibConstants.h" +#include "CondFormats/EcalObjects/interface/EcalChannelStatus.h" +#include "CondFormats/EcalObjects/interface/EcalDQMChannelStatus.h" +#include "CondFormats/EcalObjects/interface/EcalDQMTowerStatus.h" +#include "CondFormats/EcalObjects/interface/EcalDCSTowerStatus.h" +#include "CondFormats/EcalObjects/interface/EcalDAQTowerStatus.h" +#include "CondFormats/EcalObjects/interface/EcalTPGCrystalStatus.h" +#include "CondFormats/EcalObjects/interface/EcalLinearCorrections.h" +#include "CondFormats/EcalObjects/interface/EcalIntercalibConstants.h" +#include "CondFormats/EcalObjects/interface/EcalIntercalibErrors.h" +#include "CondFormats/EcalObjects/interface/EcalGainRatios.h" +#include "CondFormats/EcalObjects/interface/EcalWeightXtalGroups.h" +#include "CondFormats/EcalObjects/interface/EcalIntercalibConstantsMC.h" +#include "CondFormats/EcalObjects/interface/EcalLaserAlphas.h" +#include "CondFormats/EcalObjects/interface/EcalLaserAPDPNRatiosRef.h" +#include "CondFormats/EcalObjects/interface/EcalClusterCrackCorrParameters.h" +#include "CondFormats/EcalObjects/interface/EcalPFRecHitThresholds.h" +#include "CondFormats/EcalObjects/interface/EcalClusterEnergyUncertaintyParameters.h" +#include "CondFormats/EcalObjects/interface/EcalClusterEnergyCorrectionParameters.h" +#include "CondFormats/EcalObjects/interface/EcalClusterEnergyCorrectionObjectSpecificParameters.h" +#include "CondFormats/EcalObjects/interface/EcalClusterLocalContCorrParameters.h" #include #include @@ -15,7 +36,54 @@ namespace edm { class EventSetup; } // namespace edm -class EcalDBCopy : public edm::EDAnalyzer { +class EcalADCToGeVConstant; +class EcalTPGTowerStatus; +class EcalTBWeights; +class EcalLaserAPDPNRatios; +class Alignments; +class EcalTimeOffsetConstant; +class EcalSampleMask; +class EcalSimPulseShape; +class EcalTimeBiasCorrections; +class EcalSamplesCorrelation; + +class EcalPedestalsRcd; +class EcalADCToGeVConstantRcd; +class EcalTimeCalibConstantsRcd; +class EcalChannelStatusRcd; +class EcalDQMChannelStatusRcd; +class EcalDQMTowerStatusRcd; +class EcalDCSTowerStatusRcd; +class EcalTPGCrystalStatusRcd; +class EcalDAQTowerStatusRcd; +class EcalTPGTowerStatusRcd; +class EcalTPGTowerStatusRcd; +class EcalIntercalibConstantsRcd; +class EcalLinearCorrectionsRcd; +class EcalIntercalibConstantsMCRcd; +class EcalIntercalibErrorsRcd; +class EcalGainRatiosRcd; +class EcalWeightXtalGroupsRcd; +class EcalTBWeightsRcd; +class EcalLaserAlphasRcd; +class EcalLaserAPDPNRatiosRcd; +class EcalLaserAPDPNRatiosRefRcd; +class EcalClusterCrackCorrParametersRcd; +class EcalPFRecHitThresholdsRcd; +class EcalClusterEnergyUncertaintyParametersRcd; +class EcalClusterEnergyCorrectionParametersRcd; +class EcalClusterEnergyCorrectionObjectSpecificParametersRcd; +class EcalClusterLocalContCorrParametersRcd; +class EBAlignmentRcd; +class EEAlignmentRcd; +class ESAlignmentRcd; +class EcalTimeOffsetConstantRcd; +class EcalSampleMaskRcd; +class EcalSimPulseShapeRcd; +class EcalTimeBiasCorrectionsRcd; +class EcalSamplesCorrelationRcd; + +class EcalDBCopy : public edm::one::EDAnalyzer<> { public: explicit EcalDBCopy(const edm::ParameterSet& iConfig); ~EcalDBCopy() override; @@ -23,12 +91,52 @@ class EcalDBCopy : public edm::EDAnalyzer { void analyze(const edm::Event& evt, const edm::EventSetup& evtSetup) override; private: - bool shouldCopy(const edm::EventSetup& evtSetup, std::string container); - void copyToDB(const edm::EventSetup& evtSetup, std::string container); + bool shouldCopy(const edm::EventSetup& evtSetup, const std::string& container); + void copyToDB(const edm::EventSetup& evtSetup, const std::string& container); std::string m_timetype; std::map m_cacheIDs; std::map m_records; + edm::ESGetToken ecalPedestalToken_; + edm::ESGetToken ecalADCtoGeVToken_; + edm::ESGetToken ecalTimeCalibToken_; + edm::ESGetToken ecalChannelStatusToken_; + edm::ESGetToken ecalDQMChannelStatusToken_; + edm::ESGetToken ecalDQMTowerStatusToken_; + edm::ESGetToken ecalDCSTowerStatusToken_; + edm::ESGetToken ecalDAQTowerStatusToken_; + edm::ESGetToken ecalTPGCrystalStatusToken_; + edm::ESGetToken ecalTPGTowerStatusToken_; + edm::ESGetToken ecalIntercalibConstantsToken_; + edm::ESGetToken ecalLinearCorrectionsToken_; + edm::ESGetToken ecalIntercalibConstantsMCToken_; + edm::ESGetToken ecalIntercalibErrorsToken_; + edm::ESGetToken ecalGainRatiosToken_; + edm::ESGetToken ecalWeightXtalGroupsToken_; + edm::ESGetToken ecalTBWeightsToken_; + edm::ESGetToken ecalLaserAlphasToken_; + edm::ESGetToken ecalLaserAPDPNRatiosToken_; + edm::ESGetToken ecalLaserAPDPNRatiosRefToken_; + edm::ESGetToken + ecalClusterCrackCorrParametersToken_; + edm::ESGetToken ecalPFRecHitThresholdsToken_; + edm::ESGetToken + ecalClusterEnergyUncertaintyParametersToken_; + edm::ESGetToken + ecalClusterEnergyCorrectionParametersToken_; + edm::ESGetToken + ecalClusterEnergyCorrectionObjectSpecificParametersToken_; + edm::ESGetToken + ecalClusterLocalContCorrParametersToken_; + edm::ESGetToken ebAlignmentToken_; + edm::ESGetToken eeAlignmentToken_; + edm::ESGetToken esAlignmentToken_; + edm::ESGetToken ecalTimeOffsetConstantToken_; + edm::ESGetToken ecalSampleMaskToken_; + edm::ESGetToken ecalSimPulseShapeToken_; + edm::ESGetToken ecalTimeBiasCorrectionsToken_; + edm::ESGetToken ecalSamplesCorrelationToken_; }; #endif diff --git a/CondTools/Ecal/interface/EcalGetLaserData.h b/CondTools/Ecal/interface/EcalGetLaserData.h index e85fa5277d93c..c6a06f4b0f1a5 100644 --- a/CondTools/Ecal/interface/EcalGetLaserData.h +++ b/CondTools/Ecal/interface/EcalGetLaserData.h @@ -1,28 +1,12 @@ #ifndef ECALGETLASERDATA_H #define ECALGETLASERDATA_H -#include "FWCore/Framework/interface/EDAnalyzer.h" -#include "CondCore/CondDB/interface/Exception.h" - -#include "FWCore/Framework/interface/IOVSyncValue.h" - -#include "CondFormats/EcalObjects/interface/EcalLaserAPDPNRatios.h" -#include "CondFormats/DataRecord/interface/EcalLaserAPDPNRatiosRcd.h" +#include "FWCore/Framework/interface/one/EDAnalyzer.h" #include "CondFormats/EcalObjects/interface/EcalLaserAPDPNRatiosRef.h" -#include "CondFormats/DataRecord/interface/EcalLaserAPDPNRatiosRefRcd.h" #include "CondFormats/EcalObjects/interface/EcalLaserAlphas.h" -#include "CondFormats/DataRecord/interface/EcalLaserAlphasRcd.h" - -#include "OnlineDB/EcalCondDB/interface/all_monitoring_types.h" -#include "OnlineDB/Oracle/interface/Oracle.h" -#include "OnlineDB/EcalCondDB/interface/EcalCondDBInterface.h" - -#include "DataFormats/EcalDetId/interface/EBDetId.h" -#include "DataFormats/EcalDetId/interface/EEDetId.h" #include #include -#include #include #include @@ -32,7 +16,12 @@ namespace edm { class EventSetup; } // namespace edm -class EcalGetLaserData : public edm::EDAnalyzer { +class EcalLaserAPDPNRatios; +class EcalLaserAPDPNRatiosRcd; +class EcalLaserAPDPNRatiosRefRcd; +class EcalLaserAlphasRcd; + +class EcalGetLaserData : public edm::one::EDAnalyzer<> { public: explicit EcalGetLaserData(const edm::ParameterSet& iConfig); ~EcalGetLaserData() override; @@ -48,6 +37,9 @@ class EcalGetLaserData : public edm::EDAnalyzer { void beginJob() override; void endJob() override; + edm::ESGetToken ecalLaserAPDPNRatiosToken_; + edm::ESGetToken ecalLaserAPDPNRatiosRefToken_; + edm::ESGetToken ecalLaserAlphasToken_; }; #endif diff --git a/CondTools/Ecal/interface/EcalIntercalibConstantsHandler.h b/CondTools/Ecal/interface/EcalIntercalibConstantsHandler.h deleted file mode 100644 index 062fd8546863b..0000000000000 --- a/CondTools/Ecal/interface/EcalIntercalibConstantsHandler.h +++ /dev/null @@ -1,17 +0,0 @@ -/** - \file - Declaration of class IntercalibConstantsHandler - - \author Stefano ARGIRO - \version $Id: EcalIntercalibConstantsHandler.h,v 1.1 2008/11/14 15:46:05 argiro Exp $ - \date 09 Sep 2008 -*/ - -#ifndef _CondToolsEcal_EcalIntercalibConstantsHandler_h_ -#define _CondToolsEcal_EcalIntercalibConstantsHandler_h_ - -#include "CondTools/Ecal/interface/EcalFloatCondObjectContainerHandler.h" - -typedef EcalFloatCondObjectContainerHandler EcalIntercalibConstantsHandler; - -#endif diff --git a/CondTools/Ecal/interface/EcalIntercalibConstantsMCHandler.h b/CondTools/Ecal/interface/EcalIntercalibConstantsMCHandler.h deleted file mode 100644 index f92ede7ae1f35..0000000000000 --- a/CondTools/Ecal/interface/EcalIntercalibConstantsMCHandler.h +++ /dev/null @@ -1,18 +0,0 @@ -/** - \file - Declaration of class InterlcalibConstantsMCHandler - - \author Stefano ARGIRO - \version $Id: EcalIntercalibConstantsMCHandler.h,v 1.1 2009/04/08 15:20:25 argiro Exp $ - \date 09 Sep 2008 -*/ - -#ifndef _CondToolsEcal_EcalIntercalibConstantsMCHandler_h_ -#define _CondToolsEcal_EcalIntercalibConstantsMCHandler_h_ - - -#include "CondTools/Ecal/interface/EcalFloatCondObjectContainerHandler.h" - -typedef EcalFloatCondObjectContainerHandler EcalIntercalibConstantsMCHandler; - -#endif diff --git a/CondTools/Ecal/interface/EcalIntercalibErrorsHandler.h b/CondTools/Ecal/interface/EcalIntercalibErrorsHandler.h deleted file mode 100644 index f881eb7356ebf..0000000000000 --- a/CondTools/Ecal/interface/EcalIntercalibErrorsHandler.h +++ /dev/null @@ -1,23 +0,0 @@ -/** - \file - Declaration of class IntercalibErrorsHandler - - \author Stefano ARGIRO - \version $Id: EcalIntercalibErrorsHandler.h,v 1.1 2008/11/14 15:46:05 argiro Exp $ - \date 09 Sep 2008 -*/ - -#ifndef _CondToolsEcal_EcalIntercalibErrorsHandler_h_ -#define _CondToolsEcal_EcalIntercalibErrorsHandler_h_ - -#include "CondTools/Ecal/interface/EcalFloatCondObjectContainerHandler.h" - -typedef EcalFloatCondObjectContainerHandler EcalIntercalibErrorsHandler; - -#endif // _CondToolsEcal_EcalIntercalibErrorsHandler_h_ - -// Configure (x)emacs for this file ... -// Local Variables: -// mode:c++ -// compile-command: "scram b" -// End diff --git a/CondTools/Ecal/interface/EcalIntercalibErrorsXMLTranslator.h b/CondTools/Ecal/interface/EcalIntercalibErrorsXMLTranslator.h deleted file mode 100644 index eec459e867071..0000000000000 --- a/CondTools/Ecal/interface/EcalIntercalibErrorsXMLTranslator.h +++ /dev/null @@ -1,17 +0,0 @@ -/** - Translates a EcalIntercalibErrors record to XML - and vice versa - - \author Stefano ARGIRO - \version $Id: EcalIntercalibErrorsXMLTranslator.h,v 1.3 2009/06/30 16:15:16 argiro Exp $ - \date 20 Jun 2008 -*/ - -#ifndef __EcalIntercalibErrorsXMLTranslator_h_ -#define __EcalIntercalibErrorsXMLTranslator_h_ - -#include "CondTools/Ecal/interface/EcalFloatCondObjectContainerXMLTranslator.h" - -typedef EcalFloatCondObjectContainerXMLTranslator EcalIntercalibErrorsXMLTranslator; - -#endif // __EcalIntercalibErrorsXMLTranslator_h_ diff --git a/CondTools/Ecal/interface/EcalPFRecHitThresholdsMaker.h b/CondTools/Ecal/interface/EcalPFRecHitThresholdsMaker.h index 5dd0f16cc2672..08103e946489d 100644 --- a/CondTools/Ecal/interface/EcalPFRecHitThresholdsMaker.h +++ b/CondTools/Ecal/interface/EcalPFRecHitThresholdsMaker.h @@ -1,13 +1,13 @@ #ifndef ECALPFRECHITTHRESHOLDSMAKER_H #define ECALPFRECHITTHRESHOLDSMAKER_H -#include "FWCore/Framework/interface/EDAnalyzer.h" +#include "FWCore/Framework/interface/one/EDAnalyzer.h" #include "CondCore/CondDB/interface/Exception.h" #include "FWCore/Framework/interface/IOVSyncValue.h" - +#include "CondFormats/EcalObjects/interface/EcalPedestals.h" +#include "CondFormats/EcalObjects/interface/EcalIntercalibConstants.h" #include -#include namespace edm { class ParameterSet; @@ -15,7 +15,13 @@ namespace edm { class EventSetup; } // namespace edm -class EcalPFRecHitThresholdsMaker : public edm::EDAnalyzer { +class EcalPedestalsRcd; +class EcalADCToGeVConstant; +class EcalADCToGeVConstantRcd; +class EcalIntercalibConstantsRcd; +class EcalLaserDbService; +class EcalLaserDbRecord; +class EcalPFRecHitThresholdsMaker : public edm::one::EDAnalyzer<> { public: explicit EcalPFRecHitThresholdsMaker(const edm::ParameterSet& iConfig); ~EcalPFRecHitThresholdsMaker() override; @@ -25,6 +31,10 @@ class EcalPFRecHitThresholdsMaker : public edm::EDAnalyzer { private: std::string m_timetype; double m_nsigma; + edm::ESGetToken ecalPedestalsToken_; + edm::ESGetToken ecalADCToGeVConstantToken_; + edm::ESGetToken ecalIntercalibConstantsToken_; + edm::ESGetToken ecalLaserDbServiceToken_; }; #endif diff --git a/CondTools/Ecal/interface/EcalPFRecHitThresholdsXMLTranslator.h b/CondTools/Ecal/interface/EcalPFRecHitThresholdsXMLTranslator.h deleted file mode 100644 index 509ed640de898..0000000000000 --- a/CondTools/Ecal/interface/EcalPFRecHitThresholdsXMLTranslator.h +++ /dev/null @@ -1,17 +0,0 @@ -/** - Translates a EcalPFRecHitThresholds record to XML - and vice versa - - \author Stefano ARGIRO - \version $Id: EcalPFRecHitThresholdsXMLTranslator.h,v 1.2 2009/06/30 14:40:11 argiro Exp $ - \date 20 Jun 2008 -*/ - -#ifndef __EcalPFRecHitThresholdsXMLTranslator_h_ -#define __EcalPFRecHitThresholdsXMLTranslator_h_ - -#include "CondTools/Ecal/interface/EcalFloatCondObjectContainerXMLTranslator.h" - -typedef EcalFloatCondObjectContainerXMLTranslator EcalPFRecHitThresholdsXMLTranslator; - -#endif // __EcalPFRecHitThresholdsXMLTranslator_h_ diff --git a/CondTools/Ecal/interface/EcalTimeCalibConstantsHandler.h b/CondTools/Ecal/interface/EcalTimeCalibConstantsHandler.h deleted file mode 100644 index f48c154857f93..0000000000000 --- a/CondTools/Ecal/interface/EcalTimeCalibConstantsHandler.h +++ /dev/null @@ -1,18 +0,0 @@ -/** - \file - Declaration of class EcalTimeCalibConstantsHandler - - \author Seth COOPER - \version $Id: EcalTimeCalibConstantsHandler.h,v 1.1 2009/10/26 14:14:11 scooper Exp $ - \date 09 Sep 2008 -*/ - -#ifndef _CondToolsEcal_EcalTimeCalibConstantsHandler_h_ -#define _CondToolsEcal_EcalTimeCalibConstantsHandler_h_ - -#include "CondTools/Ecal/interface/EcalFloatCondObjectContainerHandler.h" - -typedef EcalFloatCondObjectContainerHandler EcalTimeCalibConstantsHandler; - -#endif - diff --git a/CondTools/Ecal/interface/EcalTimeCalibConstantsXMLTranslator.h b/CondTools/Ecal/interface/EcalTimeCalibConstantsXMLTranslator.h deleted file mode 100644 index 945623f0d7c1c..0000000000000 --- a/CondTools/Ecal/interface/EcalTimeCalibConstantsXMLTranslator.h +++ /dev/null @@ -1,19 +0,0 @@ -/** - Translates an EcalTimeCalibConstants record to XML - and vice versa - - \author Seth COOPER - \version $Id: EcalTimeCalibConstantsXMLTranslator.h,v 1.1 2009/10/26 16:15:16 scooper Exp $ - \date 20 Jun 2008 -*/ - -#ifndef __EcalTimeCalibConstantsXMLTranslator_h_ -#define __EcalTimeCalibConstantsXMLTranslator_h_ - -#include "CondTools/Ecal/interface/EcalFloatCondObjectContainerXMLTranslator.h" - -typedef EcalFloatCondObjectContainerXMLTranslator EcalTimeCalibConstantsXMLTranslator; - - -#endif // __EcalTimeCalibConstantsXMLTranslator_h_ - diff --git a/CondTools/Ecal/interface/EcalTimeCalibErrorsHandler.h b/CondTools/Ecal/interface/EcalTimeCalibErrorsHandler.h deleted file mode 100644 index b6b829e068020..0000000000000 --- a/CondTools/Ecal/interface/EcalTimeCalibErrorsHandler.h +++ /dev/null @@ -1,18 +0,0 @@ -/** - \file - Declaration of class EcalTimeCalibErrorsHandler - - \author Seth COOPER - \version $Id: EcalTimeCalibErrorsHandler.h,v 1.1 2009/10/26 14:14:11 scooper Exp $ - \date 09 Sep 2008 -*/ - -#ifndef _CondToolsEcal_EcalTimeCalibErrorsHandler_h_ -#define _CondToolsEcal_EcalTimeCalibErrorsHandler_h_ - -#include "CondTools/Ecal/interface/EcalFloatCondObjectContainerHandler.h" - -typedef EcalFloatCondObjectContainerHandler EcalTimeCalibErrorsHandler; - -#endif - diff --git a/CondTools/Ecal/interface/EcalTimeCalibErrorsXMLTranslator.h b/CondTools/Ecal/interface/EcalTimeCalibErrorsXMLTranslator.h deleted file mode 100644 index 241363a884e78..0000000000000 --- a/CondTools/Ecal/interface/EcalTimeCalibErrorsXMLTranslator.h +++ /dev/null @@ -1,19 +0,0 @@ -/** - Translates an EcalTimeCalibErrors record to XML - and vice versa - - \author Seth COOPER - \version $Id: EcalTimeCalibErrorsXMLTranslator.h,v 1.1 2009/10/26 16:15:16 scooper Exp $ - \date 20 Jun 2008 -*/ - -#ifndef __EcalTimeCalibErrorsXMLTranslator_h_ -#define __EcalTimeCalibErrorsXMLTranslator_h_ - -#include "CondTools/Ecal/interface/EcalFloatCondObjectContainerXMLTranslator.h" - -typedef EcalFloatCondObjectContainerXMLTranslator EcalTimeCalibErrorsXMLTranslator; - - -#endif // __EcalTimeCalibErrorsXMLTranslator_h_ - diff --git a/CondTools/Ecal/plugins/TestEcalChannelStatusAnalyzer.cc b/CondTools/Ecal/plugins/TestEcalChannelStatusAnalyzer.cc index a3a5ce72bf6c9..b53bf7d29c767 100644 --- a/CondTools/Ecal/plugins/TestEcalChannelStatusAnalyzer.cc +++ b/CondTools/Ecal/plugins/TestEcalChannelStatusAnalyzer.cc @@ -9,13 +9,12 @@ class ExTestEcalChannelStatusAnalyzer : public popcon::PopConAnalyzer(pset), m_populator(pset), - m_source(pset.getParameter("Source")) {} + m_source(pset.getParameter("Source")), + ecalElectronicsMappingToken_(esConsumes()) {} private: void analyze(const edm::Event& ev, const edm::EventSetup& iSetup) override { - edm::ESHandle eleMap; - iSetup.get().get(eleMap); - ecalElectronicsMap = eleMap.product(); + ecalElectronicsMap = &iSetup.getData(ecalElectronicsMappingToken_); } void endJob() override { @@ -29,6 +28,7 @@ class ExTestEcalChannelStatusAnalyzer : public popcon::PopConAnalyzer ecalElectronicsMappingToken_; }; //define this as a plug-in diff --git a/CondTools/Ecal/src/ESDBCopy.cc b/CondTools/Ecal/src/ESDBCopy.cc index 360c833f2b1e0..b3fbfa4a9c5c1 100644 --- a/CondTools/Ecal/src/ESDBCopy.cc +++ b/CondTools/Ecal/src/ESDBCopy.cc @@ -3,56 +3,44 @@ #include "FWCore/ParameterSet/interface/ParameterSet.h" -#include "FWCore/Framework/interface/ESHandle.h" #include "FWCore/Framework/interface/EventSetup.h" #include "CondTools/Ecal/interface/ESDBCopy.h" -#include "CondFormats/ESObjects/interface/ESPedestals.h" -#include "CondFormats/DataRecord/interface/ESPedestalsRcd.h" -#include "CondFormats/ESObjects/interface/ESADCToGeVConstant.h" -#include "CondFormats/DataRecord/interface/ESADCToGeVConstantRcd.h" -#include "CondFormats/ESObjects/interface/ESChannelStatus.h" -#include "CondFormats/DataRecord/interface/ESChannelStatusRcd.h" -#include "CondFormats/ESObjects/interface/ESIntercalibConstants.h" -#include "CondFormats/DataRecord/interface/ESIntercalibConstantsRcd.h" -#include "CondFormats/ESObjects/interface/ESWeightStripGroups.h" -#include "CondFormats/DataRecord/interface/ESWeightStripGroupsRcd.h" -#include "CondFormats/ESObjects/interface/ESTBWeights.h" -#include "CondFormats/DataRecord/interface/ESTBWeightsRcd.h" - #include ESDBCopy::ESDBCopy(const edm::ParameterSet& iConfig) - : m_timetype(iConfig.getParameter("timetype")), m_cacheIDs(), m_records() { + : m_timetype(iConfig.getParameter("timetype")), + m_cacheIDs(), + m_records(), + esPedestalsToken_(esConsumes()), + esADCToGeVConstantToken_(esConsumes()), + esChannelStatusToken_(esConsumes()), + esIntercalibConstantsToken_(esConsumes()), + esWeightStripGroupsToken_(esConsumes()), + esTBWeightsToken_(esConsumes()) { std::string container; - std::string tag; std::string record; typedef std::vector Parameters; Parameters toCopy = iConfig.getParameter("toCopy"); - for (Parameters::iterator i = toCopy.begin(); i != toCopy.end(); ++i) { - container = i->getParameter("container"); - record = i->getParameter("record"); - m_cacheIDs.insert(std::make_pair(container, 0)); - m_records.insert(std::make_pair(container, record)); + for (const auto& iparam : toCopy) { + container = iparam.getParameter("container"); + record = iparam.getParameter("record"); + m_cacheIDs.emplace(container, 0); + m_records.emplace(container, record); } } ESDBCopy::~ESDBCopy() {} void ESDBCopy::analyze(const edm::Event& evt, const edm::EventSetup& evtSetup) { - std::string container; - std::string record; - typedef std::map::const_iterator recordIter; - for (recordIter i = m_records.begin(); i != m_records.end(); ++i) { - container = (*i).first; - record = (*i).second; - if (shouldCopy(evtSetup, container)) { - copyToDB(evtSetup, container); + for (const auto& irec : m_records) { + if (shouldCopy(evtSetup, irec.first)) { + copyToDB(evtSetup, irec.first); } } } -bool ESDBCopy::shouldCopy(const edm::EventSetup& evtSetup, std::string container) { +bool ESDBCopy::shouldCopy(const edm::EventSetup& evtSetup, const std::string& container) { unsigned long long cacheID = 0; if (container == "ESPedestals") { cacheID = evtSetup.get().cacheIdentifier(); @@ -66,9 +54,7 @@ bool ESDBCopy::shouldCopy(const edm::EventSetup& evtSetup, std::string container cacheID = evtSetup.get().cacheIdentifier(); } else if (container == "ESChannelStatus") { cacheID = evtSetup.get().cacheIdentifier(); - } - - else { + } else { throw cms::Exception("Unknown container"); } @@ -80,7 +66,7 @@ bool ESDBCopy::shouldCopy(const edm::EventSetup& evtSetup, std::string container } } -void ESDBCopy::copyToDB(const edm::EventSetup& evtSetup, std::string container) { +void ESDBCopy::copyToDB(const edm::EventSetup& evtSetup, const std::string& container) { edm::Service dbOutput; if (!dbOutput.isAvailable()) { throw cms::Exception("PoolDBOutputService is not available"); @@ -89,52 +75,38 @@ void ESDBCopy::copyToDB(const edm::EventSetup& evtSetup, std::string container) std::string recordName = m_records[container]; if (container == "ESPedestals") { - edm::ESHandle handle; - evtSetup.get().get(handle); - const ESPedestals* obj = handle.product(); - std::cout << "ped pointer is: " << obj << std::endl; + const auto* obj = &evtSetup.getData(esPedestalsToken_); + edm::LogInfo("ESDBCopy") << "ped pointer is: " << obj; dbOutput->createNewIOV( new ESPedestals(*obj), dbOutput->beginOfTime(), dbOutput->endOfTime(), recordName); } else if (container == "ESADCToGeVConstant") { - edm::ESHandle handle; - evtSetup.get().get(handle); - const ESADCToGeVConstant* obj = handle.product(); - std::cout << "adc pointer is: " << obj << std::endl; - + const auto* obj = &evtSetup.getData(esADCToGeVConstantToken_); + edm::LogInfo("ESDBCopy") << "adc pointer is: " << obj; dbOutput->createNewIOV( new ESADCToGeVConstant(*obj), dbOutput->beginOfTime(), dbOutput->endOfTime(), recordName); } else if (container == "ESChannelStatus") { - edm::ESHandle handle; - evtSetup.get().get(handle); - const ESChannelStatus* obj = handle.product(); - std::cout << "channel status pointer is: " << obj << std::endl; - + const auto* obj = &evtSetup.getData(esChannelStatusToken_); + edm::LogInfo("ESDBCopy") << "channel status pointer is: " << obj; dbOutput->createNewIOV( new ESChannelStatus(*obj), dbOutput->beginOfTime(), dbOutput->endOfTime(), recordName); } else if (container == "ESIntercalibConstants") { - edm::ESHandle handle; - evtSetup.get().get(handle); - const ESIntercalibConstants* obj = handle.product(); - std::cout << "inter pointer is: " << obj << std::endl; + const auto* obj = &evtSetup.getData(esIntercalibConstantsToken_); + edm::LogInfo("ESDBCopy") << "inter pointer is: " << obj; dbOutput->createNewIOV( new ESIntercalibConstants(*obj), dbOutput->beginOfTime(), dbOutput->endOfTime(), recordName); } else if (container == "ESWeightStripGroups") { - edm::ESHandle handle; - evtSetup.get().get(handle); - const ESWeightStripGroups* obj = handle.product(); - std::cout << "weight pointer is: " << obj << std::endl; + const auto* obj = &evtSetup.getData(esWeightStripGroupsToken_); + edm::LogInfo("ESDBCopy") << "weight pointer is: " << obj; dbOutput->createNewIOV( new ESWeightStripGroups(*obj), dbOutput->beginOfTime(), dbOutput->endOfTime(), recordName); } else if (container == "ESTBWeights") { - edm::ESHandle handle; - evtSetup.get().get(handle); - const ESTBWeights* obj = handle.product(); - std::cout << "tbweight pointer is: " << obj << std::endl; + const auto* obj = &evtSetup.getData(esTBWeightsToken_); + edm::LogInfo("ESDBCopy") << "tbweight pointer is: " << obj; dbOutput->createNewIOV( new ESTBWeights(*obj), dbOutput->beginOfTime(), dbOutput->endOfTime(), recordName); @@ -142,5 +114,5 @@ void ESDBCopy::copyToDB(const edm::EventSetup& evtSetup, std::string container) throw cms::Exception("Unknown container"); } - std::cout << "ESDBCopy wrote " << recordName << std::endl; + edm::LogInfo("ESDBCopy") << "ESDBCopy wrote " << recordName; } diff --git a/CondTools/Ecal/src/EcalDBCopy.cc b/CondTools/Ecal/src/EcalDBCopy.cc index 2ea779c8b19de..1f04ce036df8e 100644 --- a/CondTools/Ecal/src/EcalDBCopy.cc +++ b/CondTools/Ecal/src/EcalDBCopy.cc @@ -1,67 +1,38 @@ #include "FWCore/ServiceRegistry/interface/Service.h" #include "CondCore/DBOutputService/interface/PoolDBOutputService.h" - #include "FWCore/ParameterSet/interface/ParameterSet.h" - #include "FWCore/Framework/interface/ESHandle.h" #include "FWCore/Framework/interface/EventSetup.h" - #include "CondTools/Ecal/interface/EcalDBCopy.h" -#include "CondFormats/EcalObjects/interface/EcalPedestals.h" #include "CondFormats/DataRecord/interface/EcalPedestalsRcd.h" #include "CondFormats/EcalObjects/interface/EcalADCToGeVConstant.h" #include "CondFormats/DataRecord/interface/EcalADCToGeVConstantRcd.h" -#include "CondFormats/EcalObjects/interface/EcalTimeCalibConstants.h" #include "CondFormats/DataRecord/interface/EcalTimeCalibConstantsRcd.h" -#include "CondFormats/EcalObjects/interface/EcalChannelStatus.h" #include "CondFormats/DataRecord/interface/EcalChannelStatusRcd.h" -#include "CondFormats/EcalObjects/interface/EcalLinearCorrections.h" #include "CondFormats/DataRecord/interface/EcalLinearCorrectionsRcd.h" -#include "CondFormats/EcalObjects/interface/EcalIntercalibConstants.h" #include "CondFormats/DataRecord/interface/EcalIntercalibConstantsRcd.h" -#include "CondFormats/EcalObjects/interface/EcalIntercalibConstantsMC.h" #include "CondFormats/DataRecord/interface/EcalIntercalibConstantsMCRcd.h" -#include "CondFormats/EcalObjects/interface/EcalIntercalibErrors.h" #include "CondFormats/DataRecord/interface/EcalIntercalibErrorsRcd.h" -#include "CondFormats/EcalObjects/interface/EcalGainRatios.h" #include "CondFormats/DataRecord/interface/EcalGainRatiosRcd.h" -#include "CondFormats/EcalObjects/interface/EcalWeightXtalGroups.h" #include "CondFormats/DataRecord/interface/EcalWeightXtalGroupsRcd.h" #include "CondFormats/EcalObjects/interface/EcalTBWeights.h" #include "CondFormats/DataRecord/interface/EcalTBWeightsRcd.h" -#include "CondFormats/EcalObjects/interface/EcalLaserAlphas.h" #include "CondFormats/DataRecord/interface/EcalLaserAlphasRcd.h" #include "CondFormats/EcalObjects/interface/EcalLaserAPDPNRatios.h" #include "CondFormats/DataRecord/interface/EcalLaserAPDPNRatiosRcd.h" -#include "CondFormats/EcalObjects/interface/EcalLaserAPDPNRatiosRef.h" #include "CondFormats/DataRecord/interface/EcalLaserAPDPNRatiosRefRcd.h" -#include "CondFormats/EcalObjects/interface/EcalTPGCrystalStatus.h" #include "CondFormats/DataRecord/interface/EcalTPGCrystalStatusRcd.h" #include "CondFormats/EcalObjects/interface/EcalTPGTowerStatus.h" #include "CondFormats/DataRecord/interface/EcalTPGTowerStatusRcd.h" - -#include "CondFormats/EcalObjects/interface/EcalDCSTowerStatus.h" #include "CondFormats/DataRecord/interface/EcalDCSTowerStatusRcd.h" -#include "CondFormats/EcalObjects/interface/EcalDAQTowerStatus.h" #include "CondFormats/DataRecord/interface/EcalDAQTowerStatusRcd.h" -#include "CondFormats/EcalObjects/interface/EcalDQMTowerStatus.h" #include "CondFormats/DataRecord/interface/EcalDQMTowerStatusRcd.h" -#include "CondFormats/EcalObjects/interface/EcalDQMChannelStatus.h" #include "CondFormats/DataRecord/interface/EcalDQMChannelStatusRcd.h" - -#include "CondFormats/EcalObjects/interface/EcalClusterCrackCorrParameters.h" #include "CondFormats/DataRecord/interface/EcalClusterCrackCorrParametersRcd.h" - -#include "CondFormats/EcalObjects/interface/EcalPFRecHitThresholds.h" #include "CondFormats/DataRecord/interface/EcalPFRecHitThresholdsRcd.h" - -#include "CondFormats/EcalObjects/interface/EcalClusterEnergyCorrectionParameters.h" #include "CondFormats/DataRecord/interface/EcalClusterEnergyCorrectionParametersRcd.h" -#include "CondFormats/EcalObjects/interface/EcalClusterEnergyUncertaintyParameters.h" #include "CondFormats/DataRecord/interface/EcalClusterEnergyUncertaintyParametersRcd.h" -#include "CondFormats/EcalObjects/interface/EcalClusterEnergyCorrectionObjectSpecificParameters.h" #include "CondFormats/DataRecord/interface/EcalClusterEnergyCorrectionObjectSpecificParametersRcd.h" -#include "CondFormats/EcalObjects/interface/EcalClusterLocalContCorrParameters.h" #include "CondFormats/DataRecord/interface/EcalClusterLocalContCorrParametersRcd.h" #include "CondFormats/Alignment/interface/Alignments.h" @@ -86,36 +57,66 @@ #include EcalDBCopy::EcalDBCopy(const edm::ParameterSet& iConfig) - : m_timetype(iConfig.getParameter("timetype")), m_cacheIDs(), m_records() { + : m_timetype(iConfig.getParameter("timetype")), + m_cacheIDs(), + m_records(), + ecalPedestalToken_(esConsumes()), + ecalADCtoGeVToken_(esConsumes()), + ecalTimeCalibToken_(esConsumes()), + ecalChannelStatusToken_(esConsumes()), + ecalDQMChannelStatusToken_(esConsumes()), + ecalDQMTowerStatusToken_(esConsumes()), + ecalDCSTowerStatusToken_(esConsumes()), + ecalDAQTowerStatusToken_(esConsumes()), + ecalTPGCrystalStatusToken_(esConsumes()), + ecalTPGTowerStatusToken_(esConsumes()), + ecalIntercalibConstantsToken_(esConsumes()), + ecalLinearCorrectionsToken_(esConsumes()), + ecalIntercalibConstantsMCToken_(esConsumes()), + ecalIntercalibErrorsToken_(esConsumes()), + ecalGainRatiosToken_(esConsumes()), + ecalWeightXtalGroupsToken_(esConsumes()), + ecalTBWeightsToken_(esConsumes()), + ecalLaserAlphasToken_(esConsumes()), + ecalLaserAPDPNRatiosToken_(esConsumes()), + ecalLaserAPDPNRatiosRefToken_(esConsumes()), + ecalClusterCrackCorrParametersToken_(esConsumes()), + ecalPFRecHitThresholdsToken_(esConsumes()), + ecalClusterEnergyUncertaintyParametersToken_(esConsumes()), + ecalClusterEnergyCorrectionParametersToken_(esConsumes()), + ecalClusterEnergyCorrectionObjectSpecificParametersToken_(esConsumes()), + ecalClusterLocalContCorrParametersToken_(esConsumes()), + ebAlignmentToken_(esConsumes()), + eeAlignmentToken_(esConsumes()), + esAlignmentToken_(esConsumes()), + ecalTimeOffsetConstantToken_(esConsumes()), + ecalSampleMaskToken_(esConsumes()), + ecalSimPulseShapeToken_(esConsumes()), + ecalTimeBiasCorrectionsToken_(esConsumes()), + ecalSamplesCorrelationToken_(esConsumes()) { std::string container; - std::string tag; std::string record; typedef std::vector Parameters; Parameters toCopy = iConfig.getParameter("toCopy"); - for (Parameters::iterator i = toCopy.begin(); i != toCopy.end(); ++i) { - container = i->getParameter("container"); - record = i->getParameter("record"); - m_cacheIDs.insert(std::make_pair(container, 0)); - m_records.insert(std::make_pair(container, record)); + for (auto& iparam : toCopy) { + container = iparam.getParameter("container"); + record = iparam.getParameter("record"); + m_cacheIDs.emplace(container, 0); + m_records.emplace(container, record); } } EcalDBCopy::~EcalDBCopy() {} void EcalDBCopy::analyze(const edm::Event& evt, const edm::EventSetup& evtSetup) { - std::string container; - std::string record; - typedef std::map::const_iterator recordIter; - for (recordIter i = m_records.begin(); i != m_records.end(); ++i) { - container = (*i).first; - record = (*i).second; - if (shouldCopy(evtSetup, container)) { - copyToDB(evtSetup, container); + for (const auto& irec : m_records) { + if (shouldCopy(evtSetup, irec.first)) { + copyToDB(evtSetup, irec.first); } } } -bool EcalDBCopy::shouldCopy(const edm::EventSetup& evtSetup, std::string container) { +bool EcalDBCopy::shouldCopy(const edm::EventSetup& evtSetup, const std::string& container) { unsigned long long cacheID = 0; if (container == "EcalPedestals") { cacheID = evtSetup.get().cacheIdentifier(); @@ -199,7 +200,7 @@ bool EcalDBCopy::shouldCopy(const edm::EventSetup& evtSetup, std::string contain } } -void EcalDBCopy::copyToDB(const edm::EventSetup& evtSetup, std::string container) { +void EcalDBCopy::copyToDB(const edm::EventSetup& evtSetup, const std::string& container) { edm::Service dbOutput; if (!dbOutput.isAvailable()) { throw cms::Exception("PoolDBOutputService is not available"); @@ -208,209 +209,160 @@ void EcalDBCopy::copyToDB(const edm::EventSetup& evtSetup, std::string container std::string recordName = m_records[container]; if (container == "EcalPedestals") { - edm::ESHandle handle; - evtSetup.get().get(handle); - const EcalPedestals* obj = handle.product(); - std::cout << "ped pointer is: " << obj << std::endl; + const EcalPedestals* obj = &evtSetup.getData(ecalPedestalToken_); + edm::LogInfo("EcalDBCopy") << "ped pointer is: " << obj << std::endl; dbOutput->createNewIOV( new EcalPedestals(*obj), dbOutput->beginOfTime(), dbOutput->endOfTime(), recordName); } else if (container == "EcalADCToGeVConstant") { - edm::ESHandle handle; - evtSetup.get().get(handle); - const EcalADCToGeVConstant* obj = handle.product(); - std::cout << "adc pointer is: " << obj << std::endl; + const EcalADCToGeVConstant* obj = &evtSetup.getData(ecalADCtoGeVToken_); + edm::LogInfo("EcalDBCopy") << "adc pointer is: " << obj << std::endl; dbOutput->createNewIOV( new EcalADCToGeVConstant(*obj), dbOutput->beginOfTime(), dbOutput->endOfTime(), recordName); } else if (container == "EcalTimeCalibConstants") { - edm::ESHandle handle; - evtSetup.get().get(handle); - const EcalTimeCalibConstants* obj = handle.product(); - std::cout << "adc pointer is: " << obj << std::endl; + const EcalTimeCalibConstants* obj = &evtSetup.getData(ecalTimeCalibToken_); + edm::LogInfo("EcalDBCopy") << "adc pointer is: " << obj << std::endl; dbOutput->createNewIOV( new EcalTimeCalibConstants(*obj), dbOutput->beginOfTime(), dbOutput->endOfTime(), recordName); } else if (container == "EcalChannelStatus") { - edm::ESHandle handle; - evtSetup.get().get(handle); - const EcalChannelStatus* obj = handle.product(); - std::cout << "channel status pointer is: " << obj << std::endl; + const EcalChannelStatus* obj = &evtSetup.getData(ecalChannelStatusToken_); + edm::LogInfo("EcalDBCopy") << "channel status pointer is: " << obj << std::endl; dbOutput->createNewIOV( new EcalChannelStatus(*obj), dbOutput->beginOfTime(), dbOutput->endOfTime(), recordName); } else if (container == "EcalDQMChannelStatus") { - edm::ESHandle handle; - evtSetup.get().get(handle); - const EcalDQMChannelStatus* obj = handle.product(); - std::cout << "DQM channel status pointer is: " << obj << std::endl; + const EcalDQMChannelStatus* obj = &evtSetup.getData(ecalDQMChannelStatusToken_); + edm::LogInfo("EcalDBCopy") << "DQM channel status pointer is: " << obj << std::endl; dbOutput->createNewIOV( new EcalDQMChannelStatus(*obj), dbOutput->beginOfTime(), dbOutput->endOfTime(), recordName); } else if (container == "EcalDQMTowerStatus") { - edm::ESHandle handle; - evtSetup.get().get(handle); - const EcalDQMTowerStatus* obj = handle.product(); - std::cout << "DQM Tower status pointer is: " << obj << std::endl; + const EcalDQMTowerStatus* obj = &evtSetup.getData(ecalDQMTowerStatusToken_); + edm::LogInfo("EcalDBCopy") << "DQM Tower status pointer is: " << obj << std::endl; dbOutput->createNewIOV( new EcalDQMTowerStatus(*obj), dbOutput->beginOfTime(), dbOutput->endOfTime(), recordName); } else if (container == "EcalDCSTowerStatus") { - edm::ESHandle handle; - evtSetup.get().get(handle); - const EcalDCSTowerStatus* obj = handle.product(); - std::cout << "channel status pointer is: " << obj << std::endl; + const EcalDCSTowerStatus* obj = &evtSetup.getData(ecalDCSTowerStatusToken_); + edm::LogInfo("EcalDBCopy") << "channel status pointer is: " << obj << std::endl; dbOutput->createNewIOV( new EcalDCSTowerStatus(*obj), dbOutput->beginOfTime(), dbOutput->endOfTime(), recordName); } else if (container == "EcalDAQTowerStatus") { - edm::ESHandle handle; - evtSetup.get().get(handle); - const EcalDAQTowerStatus* obj = handle.product(); - std::cout << "DAQ channel status pointer is: " << obj << std::endl; + const EcalDAQTowerStatus* obj = &evtSetup.getData(ecalDAQTowerStatusToken_); + edm::LogInfo("EcalDBCopy") << "DAQ channel status pointer is: " << obj << std::endl; dbOutput->createNewIOV( new EcalDAQTowerStatus(*obj), dbOutput->beginOfTime(), dbOutput->endOfTime(), recordName); } else if (container == "EcalTPGCrystalStatus") { - edm::ESHandle handle; - evtSetup.get().get(handle); - const EcalTPGCrystalStatus* obj = handle.product(); - std::cout << "TPG channel status pointer is: " << obj << std::endl; + const EcalTPGCrystalStatus* obj = &evtSetup.getData(ecalTPGCrystalStatusToken_); + edm::LogInfo("EcalDBCopy") << "TPG channel status pointer is: " << obj << std::endl; dbOutput->createNewIOV( new EcalTPGCrystalStatus(*obj), dbOutput->beginOfTime(), dbOutput->endOfTime(), recordName); } else if (container == "EcalTPGTowerStatus") { - edm::ESHandle handle; - evtSetup.get().get(handle); - const EcalTPGTowerStatus* obj = handle.product(); - std::cout << "TPG tower status pointer is: " << obj << std::endl; + const EcalTPGTowerStatus* obj = &evtSetup.getData(ecalTPGTowerStatusToken_); + edm::LogInfo("EcalDBCopy") << "TPG tower status pointer is: " << obj << std::endl; dbOutput->createNewIOV( new EcalTPGTowerStatus(*obj), dbOutput->beginOfTime(), dbOutput->endOfTime(), recordName); } else if (container == "EcalIntercalibConstants") { - edm::ESHandle handle; - evtSetup.get().get(handle); - const EcalIntercalibConstants* obj = handle.product(); - std::cout << "inter pointer is: " << obj << std::endl; + const EcalIntercalibConstants* obj = &evtSetup.getData(ecalIntercalibConstantsToken_); + edm::LogInfo("EcalDBCopy") << "inter pointer is: " << obj << std::endl; dbOutput->createNewIOV( new EcalIntercalibConstants(*obj), dbOutput->beginOfTime(), dbOutput->endOfTime(), recordName); } else if (container == "EcalLinearCorrections") { - edm::ESHandle handle; - evtSetup.get().get(handle); - const EcalLinearCorrections* obj = handle.product(); - std::cout << "inter pointer is: " << obj << std::endl; + const EcalLinearCorrections* obj = &evtSetup.getData(ecalLinearCorrectionsToken_); + edm::LogInfo("EcalDBCopy") << "inter pointer is: " << obj << std::endl; dbOutput->createNewIOV( new EcalLinearCorrections(*obj), dbOutput->beginOfTime(), dbOutput->endOfTime(), recordName); } else if (container == "EcalIntercalibConstantsMC") { - edm::ESHandle handle; - evtSetup.get().get(handle); - const EcalIntercalibConstantsMC* obj = handle.product(); - std::cout << "intercalib MC pointer is: " << obj << std::endl; + const EcalIntercalibConstantsMC* obj = &evtSetup.getData(ecalIntercalibConstantsMCToken_); + edm::LogInfo("EcalDBCopy") << "intercalib MC pointer is: " << obj << std::endl; dbOutput->createNewIOV( new EcalIntercalibConstantsMC(*obj), dbOutput->beginOfTime(), dbOutput->endOfTime(), recordName); } else if (container == "EcalIntercalibErrors") { - edm::ESHandle handle; - evtSetup.get().get(handle); - const EcalIntercalibErrors* obj = handle.product(); - std::cout << "inter pointer is: " << obj << std::endl; + const EcalIntercalibErrors* obj = &evtSetup.getData(ecalIntercalibErrorsToken_); + edm::LogInfo("EcalDBCopy") << "inter pointer is: " << obj << std::endl; dbOutput->createNewIOV( new EcalIntercalibErrors(*obj), dbOutput->beginOfTime(), dbOutput->endOfTime(), recordName); } else if (container == "EcalGainRatios") { - edm::ESHandle handle; - evtSetup.get().get(handle); - const EcalGainRatios* obj = handle.product(); - std::cout << "gain pointer is: " << obj << std::endl; + const EcalGainRatios* obj = &evtSetup.getData(ecalGainRatiosToken_); + edm::LogInfo("EcalDBCopy") << "gain pointer is: " << obj << std::endl; dbOutput->createNewIOV( new EcalGainRatios(*obj), dbOutput->beginOfTime(), dbOutput->endOfTime(), recordName); } else if (container == "EcalWeightXtalGroups") { - edm::ESHandle handle; - evtSetup.get().get(handle); - const EcalWeightXtalGroups* obj = handle.product(); - std::cout << "weight pointer is: " << obj << std::endl; + const EcalWeightXtalGroups* obj = &evtSetup.getData(ecalWeightXtalGroupsToken_); + edm::LogInfo("EcalDBCopy") << "weight pointer is: " << obj << std::endl; dbOutput->createNewIOV( new EcalWeightXtalGroups(*obj), dbOutput->beginOfTime(), dbOutput->endOfTime(), recordName); } else if (container == "EcalTBWeights") { - edm::ESHandle handle; - evtSetup.get().get(handle); - const EcalTBWeights* obj = handle.product(); - std::cout << "tbweight pointer is: " << obj << std::endl; + const EcalTBWeights* obj = &evtSetup.getData(ecalTBWeightsToken_); + edm::LogInfo("EcalDBCopy") << "tbweight pointer is: " << obj << std::endl; dbOutput->createNewIOV( new EcalTBWeights(*obj), dbOutput->beginOfTime(), dbOutput->endOfTime(), recordName); } else if (container == "EcalLaserAlphas") { - edm::ESHandle handle; - evtSetup.get().get(handle); - const EcalLaserAlphas* obj = handle.product(); - std::cout << "ecalLaserAlpha pointer is: " << obj << std::endl; + const EcalLaserAlphas* obj = &evtSetup.getData(ecalLaserAlphasToken_); + edm::LogInfo("EcalDBCopy") << "ecalLaserAlpha pointer is: " << obj << std::endl; dbOutput->createNewIOV( new EcalLaserAlphas(*obj), dbOutput->beginOfTime(), dbOutput->endOfTime(), recordName); } else if (container == "EcalLaserAPDPNRatios") { - edm::ESHandle handle; - evtSetup.get().get(handle); - const EcalLaserAPDPNRatios* obj = handle.product(); - std::cout << "tbweight pointer is: " << obj << std::endl; + const EcalLaserAPDPNRatios* obj = &evtSetup.getData(ecalLaserAPDPNRatiosToken_); + edm::LogInfo("EcalDBCopy") << "tbweight pointer is: " << obj << std::endl; dbOutput->createNewIOV( new EcalLaserAPDPNRatios(*obj), dbOutput->beginOfTime(), dbOutput->endOfTime(), recordName); } else if (container == "EcalLaserAPDPNRatiosRef") { - edm::ESHandle handle; - evtSetup.get().get(handle); - const EcalLaserAPDPNRatiosRef* obj = handle.product(); - std::cout << "tbweight pointer is: " << obj << std::endl; + const EcalLaserAPDPNRatiosRef* obj = &evtSetup.getData(ecalLaserAPDPNRatiosRefToken_); + edm::LogInfo("EcalDBCopy") << "tbweight pointer is: " << obj << std::endl; dbOutput->createNewIOV( new EcalLaserAPDPNRatiosRef(*obj), dbOutput->beginOfTime(), dbOutput->endOfTime(), recordName); } else if (container == "EcalClusterCrackCorrParameters") { - edm::ESHandle handle; - evtSetup.get().get(handle); - const EcalClusterCrackCorrParameters* obj = handle.product(); - std::cout << "cluster crack pointer is: " << obj << std::endl; + const EcalClusterCrackCorrParameters* obj = &evtSetup.getData(ecalClusterCrackCorrParametersToken_); + edm::LogInfo("EcalDBCopy") << "cluster crack pointer is: " << obj << std::endl; dbOutput->createNewIOV( new EcalClusterCrackCorrParameters(*obj), dbOutput->beginOfTime(), dbOutput->endOfTime(), recordName); } else if (container == "EcalPFRecHitThresholds") { - edm::ESHandle handle; - evtSetup.get().get(handle); - const EcalPFRecHitThresholds* obj = handle.product(); - std::cout << "Ecal PF rec hit thresholds pointer is: " << obj << std::endl; + const EcalPFRecHitThresholds* obj = &evtSetup.getData(ecalPFRecHitThresholdsToken_); + edm::LogInfo("EcalDBCopy") << "Ecal PF rec hit thresholds pointer is: " << obj << std::endl; dbOutput->createNewIOV( new EcalPFRecHitThresholds(*obj), dbOutput->beginOfTime(), dbOutput->endOfTime(), recordName); } else if (container == "EcalClusterEnergyUncertaintyParameters") { - edm::ESHandle handle; - evtSetup.get().get(handle); - const EcalClusterEnergyUncertaintyParameters* obj = handle.product(); - std::cout << "tbweight pointer is: " << obj << std::endl; + const EcalClusterEnergyUncertaintyParameters* obj = &evtSetup.getData(ecalClusterEnergyUncertaintyParametersToken_); + edm::LogInfo("EcalDBCopy") << "tbweight pointer is: " << obj << std::endl; dbOutput->createNewIOV( new EcalClusterEnergyUncertaintyParameters(*obj), dbOutput->beginOfTime(), dbOutput->endOfTime(), recordName); } else if (container == "EcalClusterEnergyCorrectionParameters") { - edm::ESHandle handle; - evtSetup.get().get(handle); - const EcalClusterEnergyCorrectionParameters* obj = handle.product(); - std::cout << "tbweight pointer is: " << obj << std::endl; + const EcalClusterEnergyCorrectionParameters* obj = &evtSetup.getData(ecalClusterEnergyCorrectionParametersToken_); + edm::LogInfo("EcalDBCopy") << "tbweight pointer is: " << obj << std::endl; dbOutput->createNewIOV( new EcalClusterEnergyCorrectionParameters(*obj), dbOutput->beginOfTime(), dbOutput->endOfTime(), recordName); } else if (container == "EcalClusterEnergyCorrectionObjectSpecificParameters") { - edm::ESHandle handle; - evtSetup.get().get(handle); - const EcalClusterEnergyCorrectionObjectSpecificParameters* obj = handle.product(); - std::cout << "tbweight pointer is: " << obj << std::endl; + const EcalClusterEnergyCorrectionObjectSpecificParameters* obj = + &evtSetup.getData(ecalClusterEnergyCorrectionObjectSpecificParametersToken_); + edm::LogInfo("EcalDBCopy") << "tbweight pointer is: " << obj << std::endl; dbOutput->createNewIOV( new EcalClusterEnergyCorrectionObjectSpecificParameters(*obj), dbOutput->beginOfTime(), @@ -418,65 +370,49 @@ void EcalDBCopy::copyToDB(const edm::EventSetup& evtSetup, std::string container recordName); } else if (container == "EcalClusterLocalContCorrParameters") { - edm::ESHandle handle; - evtSetup.get().get(handle); - const EcalClusterLocalContCorrParameters* obj = handle.product(); - std::cout << "tbweight pointer is: " << obj << std::endl; + const EcalClusterLocalContCorrParameters* obj = &evtSetup.getData(ecalClusterLocalContCorrParametersToken_); + edm::LogInfo("EcalDBCopy") << "tbweight pointer is: " << obj << std::endl; dbOutput->createNewIOV( new EcalClusterLocalContCorrParameters(*obj), dbOutput->beginOfTime(), dbOutput->endOfTime(), recordName); } else if (container == "EBAlignment") { - edm::ESHandle handle; - evtSetup.get().get(handle); - const Alignments* obj = handle.product(); - std::cout << "EB alignment pointer is: " << obj << std::endl; + const Alignments* obj = &evtSetup.getData(ebAlignmentToken_); + edm::LogInfo("EcalDBCopy") << "EB alignment pointer is: " << obj << std::endl; dbOutput->createNewIOV( new Alignments(*obj), dbOutput->beginOfTime(), dbOutput->endOfTime(), recordName); } else if (container == "EEAlignment") { - edm::ESHandle handle; - evtSetup.get().get(handle); - const Alignments* obj = handle.product(); - std::cout << "EE alignment pointer is: " << obj << std::endl; + const Alignments* obj = &evtSetup.getData(eeAlignmentToken_); + edm::LogInfo("EcalDBCopy") << "EE alignment pointer is: " << obj << std::endl; dbOutput->createNewIOV( new Alignments(*obj), dbOutput->beginOfTime(), dbOutput->endOfTime(), recordName); } else if (container == "ESAlignment") { - edm::ESHandle handle; - evtSetup.get().get(handle); - const Alignments* obj = handle.product(); - std::cout << "ES alignment pointer is: " << obj << std::endl; + const Alignments* obj = &evtSetup.getData(esAlignmentToken_); + edm::LogInfo("EcalDBCopy") << "ES alignment pointer is: " << obj << std::endl; dbOutput->createNewIOV( new Alignments(*obj), dbOutput->beginOfTime(), dbOutput->endOfTime(), recordName); } else if (container == "EcalTimeOffsetConstant") { - edm::ESHandle handle; - evtSetup.get().get(handle); - const EcalTimeOffsetConstant* obj = handle.product(); - std::cout << "TimeOffset pointer is: " << obj << std::endl; + const EcalTimeOffsetConstant* obj = &evtSetup.getData(ecalTimeOffsetConstantToken_); + edm::LogInfo("EcalDBCopy") << "TimeOffset pointer is: " << obj << std::endl; dbOutput->createNewIOV( new EcalTimeOffsetConstant(*obj), dbOutput->beginOfTime(), dbOutput->endOfTime(), recordName); } else if (container == "EcalSampleMask") { - edm::ESHandle handle; - evtSetup.get().get(handle); - const EcalSampleMask* obj = handle.product(); - std::cout << "sample mask pointer is: " << obj << std::endl; + const EcalSampleMask* obj = &evtSetup.getData(ecalSampleMaskToken_); + edm::LogInfo("EcalDBCopy") << "sample mask pointer is: " << obj << std::endl; dbOutput->createNewIOV( new EcalSampleMask(*obj), dbOutput->beginOfTime(), dbOutput->endOfTime(), recordName); } else if (container == "EcalSimPulseShape") { - edm::ESHandle handle; - evtSetup.get().get(handle); - const EcalSimPulseShape* obj = handle.product(); + const EcalSimPulseShape* obj = &evtSetup.getData(ecalSimPulseShapeToken_); dbOutput->createNewIOV( new EcalSimPulseShape(*obj), dbOutput->beginOfTime(), dbOutput->endOfTime(), recordName); } else if (container == "EcalTimeBiasCorrections") { - edm::ESHandle handle; - evtSetup.get().get(handle); - const EcalTimeBiasCorrections* obj = handle.product(); - std::cout << "TimeBiasCorrections pointer is: " << obj << std::endl; + const EcalTimeBiasCorrections* obj = &evtSetup.getData(ecalTimeBiasCorrectionsToken_); + edm::LogInfo("EcalDBCopy") << "TimeBiasCorrections pointer is: " << obj << std::endl; EcalTimeBiasCorrections* bias_; bias_ = new EcalTimeBiasCorrections(); std::vector vect = obj->EBTimeCorrAmplitudeBins; @@ -490,10 +426,8 @@ void EcalDBCopy::copyToDB(const edm::EventSetup& evtSetup, std::string container dbOutput->writeOne(bias_, dbOutput->beginOfTime(), "EcalTimeBiasCorrectionsRcd"); } else if (container == "EcalSamplesCorrelation") { - edm::ESHandle handle; - evtSetup.get().get(handle); - const EcalSamplesCorrelation* obj = handle.product(); - std::cout << "SamplesCorrelation pointer is: " << obj << std::endl; + const EcalSamplesCorrelation* obj = &evtSetup.getData(ecalSamplesCorrelationToken_); + edm::LogInfo("EcalDBCopy") << "SamplesCorrelation pointer is: " << obj << std::endl; EcalSamplesCorrelation* correl_; correl_ = new EcalSamplesCorrelation(); std::vector vect = obj->EBG12SamplesCorrelation; @@ -514,5 +448,5 @@ void EcalDBCopy::copyToDB(const edm::EventSetup& evtSetup, std::string container throw cms::Exception("Unknown container"); } - std::cout << "EcalDBCopy wrote " << recordName << std::endl; + edm::LogInfo("EcalDBCopy") << "EcalDBCopy wrote " << recordName << std::endl; } diff --git a/CondTools/Ecal/src/EcalGetLaserData.cc b/CondTools/Ecal/src/EcalGetLaserData.cc index 0040ce225e6a6..5d3a0f1d360ce 100644 --- a/CondTools/Ecal/src/EcalGetLaserData.cc +++ b/CondTools/Ecal/src/EcalGetLaserData.cc @@ -19,27 +19,38 @@ #include // user include files - -#include "FWCore/ServiceRegistry/interface/Service.h" -#include "CondCore/DBOutputService/interface/PoolDBOutputService.h" - #include "FWCore/Framework/interface/Frameworkfwd.h" #include "FWCore/Framework/interface/EDAnalyzer.h" - #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/MakerMacros.h" - +#include "FWCore/Framework/interface/ESHandle.h" +#include "FWCore/Framework/interface/EventSetup.h" +#include "FWCore/Framework/interface/EventSetupRecordKey.h" +#include "FWCore/MessageLogger/interface/MessageLogger.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/ServiceRegistry/interface/Service.h" +#include "FWCore/Framework/interface/IOVSyncValue.h" -#include "DataFormats/Common/interface/Handle.h" +#include "CondCore/CondDB/interface/Exception.h" +#include "CondCore/DBOutputService/interface/PoolDBOutputService.h" -#include "CondTools/Ecal/interface/EcalGetLaserData.h" +#include "CondFormats/EcalObjects/interface/EcalLaserAPDPNRatios.h" +#include "CondFormats/DataRecord/interface/EcalLaserAPDPNRatiosRcd.h" +#include "CondFormats/EcalObjects/interface/EcalLaserAPDPNRatiosRef.h" +#include "CondFormats/DataRecord/interface/EcalLaserAPDPNRatiosRefRcd.h" +#include "CondFormats/EcalObjects/interface/EcalLaserAlphas.h" +#include "CondFormats/DataRecord/interface/EcalLaserAlphasRcd.h" -#include "FWCore/Framework/interface/ESHandle.h" -#include "FWCore/Framework/interface/EventSetup.h" -#include "FWCore/Framework/interface/EventSetupRecordKey.h" +#include "OnlineDB/EcalCondDB/interface/all_monitoring_types.h" +#include "OnlineDB/Oracle/interface/Oracle.h" +#include "OnlineDB/EcalCondDB/interface/EcalCondDBInterface.h" -#include "FWCore/MessageLogger/interface/MessageLogger.h" +#include "DataFormats/EcalDetId/interface/EBDetId.h" +#include "DataFormats/EcalDetId/interface/EEDetId.h" + +#include "DataFormats/Common/interface/Handle.h" + +#include "CondTools/Ecal/interface/EcalGetLaserData.h" // // constants, enums and typedefs @@ -55,21 +66,21 @@ EcalGetLaserData::EcalGetLaserData(const edm::ParameterSet& iConfig) : // m_timetype(iConfig.getParameter("timetype")), m_cacheIDs(), - m_records() { - std::string container; - std::string tag; - std::string record; - + m_records(), + ecalLaserAPDPNRatiosToken_(esConsumes()), + ecalLaserAPDPNRatiosRefToken_(esConsumes()), + ecalLaserAlphasToken_(esConsumes()) { //m_firstRun=(unsigned long long)atoi( iConfig.getParameter("firstRun").c_str()); //m_lastRun=(unsigned long long)atoi( iConfig.getParameter("lastRun").c_str()); - + std::string container; + std::string record; typedef std::vector Parameters; Parameters toGet = iConfig.getParameter("toGet"); - for (Parameters::iterator i = toGet.begin(); i != toGet.end(); ++i) { - container = i->getParameter("container"); - record = i->getParameter("record"); - m_cacheIDs.insert(std::make_pair(container, 0)); - m_records.insert(std::make_pair(container, record)); + for (const auto& iparam : toGet) { + container = iparam.getParameter("container"); + record = iparam.getParameter("record"); + m_cacheIDs.emplace(container, 0); + m_records.emplace(container, record); } //now do what ever initialization is needed } @@ -88,26 +99,19 @@ void EcalGetLaserData::analyze(const edm::Event& evt, const edm::EventSetup& evt using namespace edm; // loop on offline DB conditions to be transferred as from config file - std::string container; - std::string record; - typedef std::map::const_iterator recordIter; - for (recordIter i = m_records.begin(); i != m_records.end(); ++i) { - container = (*i).first; - record = (*i).second; - - std::string recordName = m_records[container]; + for (const auto& irec : m_records) { + const std::string& container = irec.first; + //record = irec.second; if (container == "EcalLaserAPDPNRatios") { // get from offline DB the last valid laser set - edm::ESHandle handle; - evtSetup.get().get(handle); - + const EcalLaserAPDPNRatios* laserapdpnrRatios = &evtSetup.getData(ecalLaserAPDPNRatiosToken_); // this is the offline object EcalLaserAPDPNRatios::EcalLaserTimeStamp timestamp; EcalLaserAPDPNRatios::EcalLaserAPDPNpair apdpnpair; - const EcalLaserAPDPNRatios::EcalLaserAPDPNRatiosMap& laserRatiosMap = handle.product()->getLaserMap(); - const EcalLaserAPDPNRatios::EcalLaserTimeStampMap& laserTimeMap = handle.product()->getTimeMap(); + const EcalLaserAPDPNRatios::EcalLaserAPDPNRatiosMap& laserRatiosMap = laserapdpnrRatios->getLaserMap(); + const EcalLaserAPDPNRatios::EcalLaserTimeStampMap& laserTimeMap = laserapdpnrRatios->getTimeMap(); // loop through ecal barrel for (int iEta = -EBDetId::MAX_IETA; iEta <= EBDetId::MAX_IETA; ++iEta) { @@ -119,8 +123,8 @@ void EcalGetLaserData::analyze(const edm::Event& evt, const edm::EventSetup& evt if (hi < static_cast(laserRatiosMap.size())) { apdpnpair = laserRatiosMap[hi]; - std::cout << "A sample value of APDPN pair EB : " << hi << " : " << apdpnpair.p1 << " , " << apdpnpair.p2 - << std::endl; + edm::LogInfo("EcalGetLaserData") << "A sample value of APDPN pair EB : " << hi << " : " << apdpnpair.p1 + << " , " << apdpnpair.p2 << std::endl; } else { edm::LogError("EcalGetLaserData") << "error with laserRatiosMap!" << std::endl; } @@ -138,8 +142,8 @@ void EcalGetLaserData::analyze(const edm::Event& evt, const edm::EventSetup& evt if (hi < static_cast(laserRatiosMap.size())) { apdpnpair = laserRatiosMap[hi]; - std::cout << "A sample value of APDPN pair EE+ : " << hi << " : " << apdpnpair.p1 << " , " << apdpnpair.p2 - << std::endl; + edm::LogInfo("EcalGetLaserData") << "A sample value of APDPN pair EE+ : " << hi << " : " << apdpnpair.p1 + << " , " << apdpnpair.p2 << std::endl; } else { edm::LogError("EcalGetLaserData") << "error with laserRatiosMap!" << std::endl; } @@ -151,8 +155,8 @@ void EcalGetLaserData::analyze(const edm::Event& evt, const edm::EventSetup& evt if (hi < static_cast(laserRatiosMap.size())) { apdpnpair = laserRatiosMap[hi]; - std::cout << "A sample value of APDPN pair EE- : " << hi << " : " << apdpnpair.p1 << " , " << apdpnpair.p2 - << std::endl; + edm::LogInfo("EcalGetLaserData") << "A sample value of APDPN pair EE- : " << hi << " : " << apdpnpair.p1 + << " , " << apdpnpair.p2 << std::endl; } else { edm::LogError("EcalGetLaserData") << "error with laserRatiosMap!" << std::endl; } @@ -161,19 +165,16 @@ void EcalGetLaserData::analyze(const edm::Event& evt, const edm::EventSetup& evt for (int i = 0; i < 92; i++) { timestamp = laserTimeMap[i]; - std::cout << "A value of timestamp pair : " << i << " " << timestamp.t1.value() << " , " << timestamp.t2.value() - << std::endl; + edm::LogInfo("EcalGetLaserData") << "A value of timestamp pair : " << i << " " << timestamp.t1.value() << " , " + << timestamp.t2.value() << std::endl; } - std::cout << ".. just retrieved the last valid record from DB " << std::endl; + edm::LogInfo("EcalGetLaserData") << ".. just retrieved the last valid record from DB " << std::endl; } else if (container == "EcalLaserAPDPNRatiosRef") { // get from offline DB the last valid laser set - edm::ESHandle handle; - evtSetup.get().get(handle); - EcalLaserAPDPNref apdpnref; - const EcalLaserAPDPNRatiosRefMap& laserRefMap = handle.product()->getMap(); + const EcalLaserAPDPNRatiosRefMap& laserRefMap = (&evtSetup.getData(ecalLaserAPDPNRatiosRefToken_))->getMap(); // first barrel for (int iEta = -EBDetId::MAX_IETA; iEta <= EBDetId::MAX_IETA; ++iEta) { @@ -185,7 +186,8 @@ void EcalGetLaserData::analyze(const edm::Event& evt, const edm::EventSetup& evt if (hi < static_cast(laserRefMap.size())) { apdpnref = laserRefMap[hi]; - std::cout << "A sample value of APDPN Reference value EB : " << hi << " : " << apdpnref << std::endl; + edm::LogInfo("EcalGetLaserData") + << "A sample value of APDPN Reference value EB : " << hi << " : " << apdpnref << std::endl; } else { edm::LogError("EcalGetLaserData") << "error with laserRefMap!" << std::endl; } @@ -203,7 +205,8 @@ void EcalGetLaserData::analyze(const edm::Event& evt, const edm::EventSetup& evt if (hi < static_cast(laserRefMap.size())) { apdpnref = laserRefMap[hi]; - std::cout << "A sample value of APDPN Reference value EE+ : " << hi << " : " << apdpnref << std::endl; + edm::LogInfo("EcalGetLaserData") + << "A sample value of APDPN Reference value EE+ : " << hi << " : " << apdpnref << std::endl; } else { edm::LogError("EcalGetLaserData") << "error with laserRefMap!" << std::endl; @@ -216,23 +219,21 @@ void EcalGetLaserData::analyze(const edm::Event& evt, const edm::EventSetup& evt if (hi < static_cast(laserRefMap.size())) { apdpnref = laserRefMap[hi]; - std::cout << "A sample value of APDPN Reference value EE- : " << hi << " : " << apdpnref << std::endl; + edm::LogInfo("EcalGetLaserData") + << "A sample value of APDPN Reference value EE- : " << hi << " : " << apdpnref << std::endl; } else { edm::LogError("EcalGetLaserData") << "error with laserRefMap!" << std::endl; } } } - std::cout << "... just retrieved the last valid record from DB " << std::endl; + edm::LogInfo("EcalGetLaserData") << "... just retrieved the last valid record from DB " << std::endl; } else if (container == "EcalLaserAlphas") { // get from offline DB the last valid laser set - edm::ESHandle handle; - evtSetup.get().get(handle); - // this is the offline object EcalLaserAlpha alpha; - const EcalLaserAlphaMap& laserAlphaMap = handle.product()->getMap(); // map of apdpns + const EcalLaserAlphaMap& laserAlphaMap = (&evtSetup.getData(ecalLaserAlphasToken_))->getMap(); // map of apdpns // first barrel for (int iEta = -EBDetId::MAX_IETA; iEta <= EBDetId::MAX_IETA; ++iEta) { @@ -244,7 +245,8 @@ void EcalGetLaserData::analyze(const edm::Event& evt, const edm::EventSetup& evt if (hi < static_cast(laserAlphaMap.size())) { alpha = laserAlphaMap[hi]; - std::cout << " A sample value of Alpha value EB : " << hi << " : " << alpha << std::endl; + edm::LogInfo("EcalGetLaserData") + << " A sample value of Alpha value EB : " << hi << " : " << alpha << std::endl; } else { edm::LogError("EcalGetLaserData") << "error with laserAlphaMap!" << std::endl; } @@ -262,7 +264,8 @@ void EcalGetLaserData::analyze(const edm::Event& evt, const edm::EventSetup& evt if (hi < static_cast(laserAlphaMap.size())) { alpha = laserAlphaMap[hi]; - std::cout << " A sample value of Alpha value EE+ : " << hi << " : " << alpha << std::endl; + edm::LogInfo("EcalGetLaserData") + << " A sample value of Alpha value EE+ : " << hi << " : " << alpha << std::endl; } else { edm::LogError("EcalGetLaserData") << "error with laserAlphaMap!" << std::endl; } @@ -274,14 +277,15 @@ void EcalGetLaserData::analyze(const edm::Event& evt, const edm::EventSetup& evt if (hi < static_cast(laserAlphaMap.size())) { alpha = laserAlphaMap[hi]; - std::cout << " A sample value of Alpha value EE- : " << hi << " : " << alpha << std::endl; + edm::LogInfo("EcalGetLaserData") + << " A sample value of Alpha value EE- : " << hi << " : " << alpha << std::endl; } else { edm::LogError("EcalGetLaserData") << "error with laserAlphaMap!" << std::endl; } } } - std::cout << "... just retrieved the last valid record from DB " << std::endl; + edm::LogInfo("EcalGetLaserData") << "... just retrieved the last valid record from DB " << std::endl; } else { edm::LogError("EcalGetLaserData") << "Cannot retrieve for container: " << container << std::endl; diff --git a/CondTools/Ecal/src/EcalPFRecHitThresholdsMaker.cc b/CondTools/Ecal/src/EcalPFRecHitThresholdsMaker.cc index a9038062963a3..e897c83b43209 100644 --- a/CondTools/Ecal/src/EcalPFRecHitThresholdsMaker.cc +++ b/CondTools/Ecal/src/EcalPFRecHitThresholdsMaker.cc @@ -1,102 +1,27 @@ #include "FWCore/ServiceRegistry/interface/Service.h" #include "CondCore/DBOutputService/interface/PoolDBOutputService.h" - #include "FWCore/ParameterSet/interface/ParameterSet.h" - #include "FWCore/Framework/interface/ESHandle.h" #include "FWCore/Framework/interface/EventSetup.h" - #include "FWCore/Framework/interface/Event.h" - #include "CalibCalorimetry/EcalLaserCorrection/interface/EcalLaserDbService.h" #include "CalibCalorimetry/EcalLaserCorrection/interface/EcalLaserDbRecord.h" - #include "CondTools/Ecal/interface/EcalPFRecHitThresholdsMaker.h" -#include "CondFormats/EcalObjects/interface/EcalPedestals.h" +#include "CondFormats/EcalObjects/interface/EcalPFRecHitThresholds.h" +#include "CondFormats/DataRecord/interface/EcalPFRecHitThresholdsRcd.h" #include "CondFormats/DataRecord/interface/EcalPedestalsRcd.h" +#include "CondFormats/DataRecord/interface/EcalIntercalibConstantsRcd.h" #include "CondFormats/EcalObjects/interface/EcalADCToGeVConstant.h" #include "CondFormats/DataRecord/interface/EcalADCToGeVConstantRcd.h" -#include "CondFormats/EcalObjects/interface/EcalTimeCalibConstants.h" -#include "CondFormats/DataRecord/interface/EcalTimeCalibConstantsRcd.h" -#include "CondFormats/EcalObjects/interface/EcalChannelStatus.h" -#include "CondFormats/DataRecord/interface/EcalChannelStatusRcd.h" -#include "CondFormats/EcalObjects/interface/EcalLinearCorrections.h" -#include "CondFormats/DataRecord/interface/EcalLinearCorrectionsRcd.h" -#include "CondFormats/EcalObjects/interface/EcalIntercalibConstants.h" -#include "CondFormats/DataRecord/interface/EcalIntercalibConstantsRcd.h" -#include "CondFormats/EcalObjects/interface/EcalIntercalibConstantsMC.h" -#include "CondFormats/DataRecord/interface/EcalIntercalibConstantsMCRcd.h" -#include "CondFormats/EcalObjects/interface/EcalIntercalibErrors.h" -#include "CondFormats/DataRecord/interface/EcalIntercalibErrorsRcd.h" -#include "CondFormats/EcalObjects/interface/EcalGainRatios.h" -#include "CondFormats/DataRecord/interface/EcalGainRatiosRcd.h" -#include "CondFormats/EcalObjects/interface/EcalWeightXtalGroups.h" -#include "CondFormats/DataRecord/interface/EcalWeightXtalGroupsRcd.h" -#include "CondFormats/EcalObjects/interface/EcalTBWeights.h" -#include "CondFormats/DataRecord/interface/EcalTBWeightsRcd.h" -#include "CondFormats/EcalObjects/interface/EcalLaserAlphas.h" -#include "CondFormats/DataRecord/interface/EcalLaserAlphasRcd.h" -#include "CondFormats/EcalObjects/interface/EcalLaserAPDPNRatios.h" -#include "CondFormats/DataRecord/interface/EcalLaserAPDPNRatiosRcd.h" -#include "CondFormats/EcalObjects/interface/EcalLaserAPDPNRatiosRef.h" -#include "CondFormats/DataRecord/interface/EcalLaserAPDPNRatiosRefRcd.h" -#include "CondFormats/EcalObjects/interface/EcalTPGCrystalStatus.h" -#include "CondFormats/DataRecord/interface/EcalTPGCrystalStatusRcd.h" -#include "CondFormats/EcalObjects/interface/EcalTPGTowerStatus.h" -#include "CondFormats/DataRecord/interface/EcalTPGTowerStatusRcd.h" - -#include "CondFormats/EcalObjects/interface/EcalDCSTowerStatus.h" -#include "CondFormats/DataRecord/interface/EcalDCSTowerStatusRcd.h" -#include "CondFormats/EcalObjects/interface/EcalDAQTowerStatus.h" -#include "CondFormats/DataRecord/interface/EcalDAQTowerStatusRcd.h" -#include "CondFormats/EcalObjects/interface/EcalDQMTowerStatus.h" -#include "CondFormats/DataRecord/interface/EcalDQMTowerStatusRcd.h" -#include "CondFormats/EcalObjects/interface/EcalDQMChannelStatus.h" -#include "CondFormats/DataRecord/interface/EcalDQMChannelStatusRcd.h" - -#include "CondFormats/EcalObjects/interface/EcalClusterCrackCorrParameters.h" -#include "CondFormats/DataRecord/interface/EcalClusterCrackCorrParametersRcd.h" - -#include "CondFormats/EcalObjects/interface/EcalPFRecHitThresholds.h" -#include "CondFormats/DataRecord/interface/EcalPFRecHitThresholdsRcd.h" - -#include "CondFormats/EcalObjects/interface/EcalClusterEnergyCorrectionParameters.h" -#include "CondFormats/DataRecord/interface/EcalClusterEnergyCorrectionParametersRcd.h" -#include "CondFormats/EcalObjects/interface/EcalClusterEnergyUncertaintyParameters.h" -#include "CondFormats/DataRecord/interface/EcalClusterEnergyUncertaintyParametersRcd.h" -#include "CondFormats/EcalObjects/interface/EcalClusterEnergyCorrectionObjectSpecificParameters.h" -#include "CondFormats/DataRecord/interface/EcalClusterEnergyCorrectionObjectSpecificParametersRcd.h" -#include "CondFormats/EcalObjects/interface/EcalClusterLocalContCorrParameters.h" -#include "CondFormats/DataRecord/interface/EcalClusterLocalContCorrParametersRcd.h" - -#include "CondFormats/Alignment/interface/Alignments.h" -#include "CondFormats/AlignmentRecord/interface/EBAlignmentRcd.h" -#include "CondFormats/AlignmentRecord/interface/EEAlignmentRcd.h" -#include "CondFormats/AlignmentRecord/interface/ESAlignmentRcd.h" -#include "CondFormats/EcalObjects/interface/EcalTimeOffsetConstant.h" -#include "CondFormats/DataRecord/interface/EcalTimeOffsetConstantRcd.h" - -#include "CondFormats/EcalObjects/interface/EcalSampleMask.h" -#include "CondFormats/DataRecord/interface/EcalSampleMaskRcd.h" - -#include "CondFormats/EcalObjects/interface/EcalTimeBiasCorrections.h" -#include "CondFormats/DataRecord/interface/EcalTimeBiasCorrectionsRcd.h" - -#include "CondFormats/EcalObjects/interface/EcalSamplesCorrelation.h" -#include "CondFormats/DataRecord/interface/EcalSamplesCorrelationRcd.h" - -#include "DataFormats/Provenance/interface/Timestamp.h" - -#include "CondCore/DBOutputService/interface/PoolDBOutputService.h" #include EcalPFRecHitThresholdsMaker::EcalPFRecHitThresholdsMaker(const edm::ParameterSet& iConfig) - : m_timetype(iConfig.getParameter("timetype")) { - std::string container; - std::string tag; - std::string record; - + : m_timetype(iConfig.getParameter("timetype")), + ecalPedestalsToken_(esConsumes()), + ecalADCToGeVConstantToken_(esConsumes()), + ecalIntercalibConstantsToken_(esConsumes()), + ecalLaserDbServiceToken_(esConsumes()) { m_nsigma = iConfig.getParameter("NSigma"); } @@ -108,23 +33,16 @@ void EcalPFRecHitThresholdsMaker::analyze(const edm::Event& evt, const edm::Even throw cms::Exception("PoolDBOutputService is not available"); } - edm::ESHandle handle1; - evtSetup.get().get(handle1); - const EcalPedestals* ped_db = handle1.product(); - std::cout << "ped pointer is: " << ped_db << std::endl; + const EcalPedestals* ped_db = &evtSetup.getData(ecalPedestalsToken_); + edm::LogInfo("EcalPFRecHitThresholdsMaker") << "ped pointer is: " << ped_db << std::endl; - edm::ESHandle handle2; - evtSetup.get().get(handle2); - const EcalADCToGeVConstant* adc_db = handle2.product(); - std::cout << "adc pointer is: " << adc_db << std::endl; + const EcalADCToGeVConstant* adc_db = &evtSetup.getData(ecalADCToGeVConstantToken_); + edm::LogInfo("EcalPFRecHitThresholdsMaker") << "adc pointer is: " << adc_db << std::endl; - edm::ESHandle handle3; - evtSetup.get().get(handle3); - const EcalIntercalibConstants* ical_db = handle3.product(); - std::cout << "inter pointer is: " << ical_db << std::endl; + const EcalIntercalibConstants* ical_db = &evtSetup.getData(ecalIntercalibConstantsToken_); + edm::LogInfo("EcalPFRecHitThresholdsMaker") << "inter pointer is: " << ical_db << std::endl; - edm::ESHandle laser; - evtSetup.get().get(laser); + const auto laser = evtSetup.getHandle(ecalLaserDbServiceToken_); EcalPFRecHitThresholds* pfthresh = new EcalPFRecHitThresholds(); @@ -155,7 +73,7 @@ void EcalPFRecHitThresholdsMaker::analyze(const edm::Event& evt, const edm::Even EcalPFRecHitThreshold thresh = aped.rms_x12 * calib * adc_EB * lasercalib * m_nsigma; if (iPhi == 100) - std::cout << "Thresh(GeV)=" << thresh << std::endl; + edm::LogInfo("EcalPFRecHitThresholdsMaker") << "Thresh(GeV)=" << thresh << std::endl; pfthresh->insert(std::make_pair(ebdetid.rawId(), thresh)); } @@ -198,7 +116,7 @@ void EcalPFRecHitThresholdsMaker::analyze(const edm::Event& evt, const edm::Even pfthresh->insert(std::make_pair(eedetid.rawId(), thresh)); if (iX == 50) - std::cout << "Thresh(GeV)=" << thresh << std::endl; + edm::LogInfo("EcalPFRecHitThresholdsMaker") << "Thresh(GeV)=" << thresh << std::endl; } } } @@ -206,5 +124,5 @@ void EcalPFRecHitThresholdsMaker::analyze(const edm::Event& evt, const edm::Even dbOutput->createNewIOV( pfthresh, dbOutput->beginOfTime(), dbOutput->endOfTime(), "EcalPFRecHitThresholdsRcd"); - std::cout << "EcalPFRecHitThresholdsMaker wrote it " << std::endl; + edm::LogInfo("EcalPFRecHitThresholdsMaker") << "EcalPFRecHitThresholdsMaker wrote it " << std::endl; } diff --git a/CondTools/Ecal/test/testXMLTranslators.cc b/CondTools/Ecal/test/testXMLTranslators.cc deleted file mode 100644 index cde70f806f3aa..0000000000000 --- a/CondTools/Ecal/test/testXMLTranslators.cc +++ /dev/null @@ -1,472 +0,0 @@ -#include "CondTools/Ecal/interface/EcalADCToGeVXMLTranslator.h" -#include "CondTools/Ecal/interface/EcalIntercalibConstantsXMLTranslator.h" -#include "CondTools/Ecal/interface/EcalLinearCorrectionsXMLTranslator.h" -#include "CondTools/Ecal/interface/EcalIntercalibErrorsXMLTranslator.h" -#include "CondTools/Ecal/interface/EcalWeightGroupXMLTranslator.h" -#include "CondTools/Ecal/interface/EcalTBWeightsXMLTranslator.h" -#include "CondTools/Ecal/interface/EcalLaserAPDPNRatiosXMLTranslator.h" -#include "CondTools/Ecal/interface/EcalTimeCalibConstantsXMLTranslator.h" -#include "CondTools/Ecal/interface/EcalTimeCalibErrorsXMLTranslator.h" - -#include "CondFormats/EcalObjects/interface/EcalADCToGeVConstant.h" -#include "CondFormats/EcalObjects/interface/EcalLinearCorrections.h" -#include "CondFormats/EcalObjects/interface/EcalIntercalibConstants.h" -#include "CondFormats/EcalObjects/interface/EcalIntercalibErrors.h" -#include "CondFormats/EcalObjects/interface/EcalLaserAPDPNRatios.h" -#include "CondFormats/EcalObjects/interface/EcalIntercalibConstantsMC.h" - -#include "CondFormats/EcalObjects/interface/EcalTimeCalibConstants.h" -#include "CondFormats/EcalObjects/interface/EcalTimeCalibErrors.h" - -#include "CondFormats/EcalObjects/interface/EcalXtalGroupId.h" -#include "CondFormats/EcalObjects/interface/EcalWeightXtalGroups.h" -#include "CondFormats/EcalObjects/interface/EcalIntercalibErrors.h" - -#include "CondTools/Ecal/interface/EcalGainRatiosXMLTranslator.h" -#include "CondTools/Ecal/interface/EcalChannelStatusXMLTranslator.h" -#include "CondTools/Ecal/interface/EcalWeightSetXMLTranslator.h" - -#include "CondFormats/EcalObjects/interface/EcalGainRatios.h" -#include "CondFormats/EcalObjects/interface/EcalMGPAGainRatio.h" - -#include "CondFormats/EcalObjects/interface/EcalChannelStatus.h" -#include "CondFormats/EcalObjects/interface/EcalChannelStatusCode.h" - -#include "CondFormats/EcalObjects/interface/EcalWeightSet.h" -#include "CondTools/Ecal/interface/EcalCondHeader.h" - -#include "CondFormats/EcalObjects/interface/EcalTBWeights.h" - -#include "DataFormats/EcalDetId/interface/EBDetId.h" - - - -#include -using std::cout; -using std::endl; - -#include - -int main(){ - - // Test ADCtoGeV - - EcalCondHeader header; - EcalCondHeader header2; - - - header.method_="testmethod"; - header.version_="testversion"; - header.datasource_="testdata"; - header.since_=123; - header.tag_="testtag"; - header.date_="Mar 24 1973"; - - - - EcalADCToGeVConstant adctogev_constant; - EcalADCToGeVConstant adctogev_constant2; - - adctogev_constant.setEBValue(1.1); - adctogev_constant.setEEValue(2.2); - - std::string adctogevfile("/tmp/EcalADCToGeVConstant.xml"); - std::string adctogevfile2("/tmp/adctogev2.xml"); - - EcalADCToGeVXMLTranslator::writeXML(adctogevfile,header,adctogev_constant); - EcalADCToGeVXMLTranslator::readXML(adctogevfile,header2,adctogev_constant2); - EcalADCToGeVXMLTranslator::writeXML(adctogevfile2,header2,adctogev_constant2); - - - // Test Intercalibration - - - EcalLinearCorrections lin_constants; - EcalIntercalibConstants intercalib_constants; - EcalIntercalibErrors intercalib_errors; - - std::string linfile("/tmp/EcalLinearCorrections.xml"); - std::string intercalibfile("/tmp/EcalIntercalibConstants.xml"); - std::string intercaliberrfile("/tmp/EcalIntercalibErrors.xml"); - std::string intercalibfiledb("/tmp/EcalIntercalibConstantsDB.xml"); - - for (int cellid = 0; - cellid < EBDetId::kSizeForDenseIndexing; - ++cellid){// loop on EB cells - - - uint32_t rawid = EBDetId::unhashIndex(cellid); - - EcalIntercalibConstant intercalib_constant = - EBDetId::unhashIndex(cellid).iphi(); - - EcalIntercalibConstant lin_constant = - EBDetId::unhashIndex(cellid).iphi(); - - EcalIntercalibError intercalib_error = intercalib_constant +1; - - lin_constants[rawid]=lin_constant; - intercalib_constants[rawid]=intercalib_constant; - intercalib_errors[rawid] =intercalib_error; - } - - for (int cellid = 0; - cellid < EEDetId::kSizeForDenseIndexing; - ++cellid){// loop on EB cells - - - - if (EEDetId::validHashIndex(cellid)){ - uint32_t rawid = EEDetId::unhashIndex(cellid); - EcalLinearCorrection lin_constant = EEDetId::unhashIndex(cellid).ix();; - EcalIntercalibConstant intercalib_constant = EEDetId::unhashIndex(cellid).ix();; - EcalIntercalibError intercalib_error = intercalib_constant +1; - - lin_constants[rawid]=lin_constant; - intercalib_constants[rawid]=intercalib_constant; - intercalib_errors[rawid]=intercalib_error; - } // if - } - - - - EcalLinearCorrectionsXMLTranslator::writeXML(linfile,header, - lin_constants); - - EcalIntercalibConstantsXMLTranslator::writeXML(intercalibfile,header, - intercalib_constants); - - EcalIntercalibErrorsXMLTranslator::writeXML(intercaliberrfile,header, - intercalib_errors); - - EcalIntercalibConstants lin_constants2; - EcalIntercalibConstants intercalib_constants2; - EcalIntercalibErrors intercalib_errors2; - - - EcalLinearCorrectionsXMLTranslator::readXML(linfile,header2, - lin_constants2); - - EcalIntercalibConstantsXMLTranslator::readXML(intercalibfile,header2, - intercalib_constants2); - - EcalIntercalibErrorsXMLTranslator::readXML(intercaliberrfile,header2, - intercalib_errors2); - - std::string linfile2("/tmp/linfile-2.xml"); - std::string intercalibfile2("/tmp/intercalibfile-2.xml"); - std::string intercaliberrfile2("/tmp/intercaliberrfile-2.xml"); - - EcalLinearCorrectionsXMLTranslator::writeXML(linfile2, - header2, - lin_constants2); - EcalIntercalibConstantsXMLTranslator::writeXML(intercalibfile2, - header2, - intercalib_constants2); - - EcalIntercalibErrorsXMLTranslator::writeXML(intercaliberrfile,header2, - intercalib_errors2); - - cout << "Done testing Intercalib abd Linear Corrections" << endl; - - // Test Timing Intercalibration - - - EcalTimeCalibConstants timeCalib_constants; - EcalTimeCalibErrors timeCalib_errors; - - std::string timeCalibFile("/tmp/EcalTimeCalibConstants.xml"); - std::string timeCalibErrFile("/tmp/EcalTimeCalibErrors.xml"); - std::string timeCalibFileDB("/tmp/EcalTimeCalibConstantsDB.xml"); - - for (int cellid = 0; - cellid < EBDetId::kSizeForDenseIndexing; - ++cellid){// loop on EB cells - - - uint32_t rawid = EBDetId::unhashIndex(cellid); - - EcalTimeCalibConstant timeCalib_constant = - EBDetId::unhashIndex(cellid).iphi(); - - EcalTimeCalibError timeCalib_error = timeCalib_constant +1; - - timeCalib_constants[rawid]=timeCalib_constant; - timeCalib_errors[rawid] =timeCalib_error; - } - - for (int cellid = 0; - cellid < EEDetId::kSizeForDenseIndexing; - ++cellid){// loop on EB cells - - - - if (EEDetId::validHashIndex(cellid)){ - uint32_t rawid = EEDetId::unhashIndex(cellid); - EcalTimeCalibConstant timeCalib_constant = EEDetId::unhashIndex(cellid).ix();; - EcalTimeCalibError timeCalib_error = timeCalib_constant +1; - - timeCalib_constants[rawid]=timeCalib_constant; - timeCalib_errors[rawid]=timeCalib_error; - } // if - } - - - - EcalTimeCalibConstantsXMLTranslator::writeXML(timeCalibFile,header, - timeCalib_constants); - - EcalTimeCalibErrorsXMLTranslator::writeXML(timeCalibErrFile,header, - timeCalib_errors); - - EcalTimeCalibConstants timeCalib_constants2; - EcalTimeCalibErrors timeCalib_errors2; - - - EcalTimeCalibConstantsXMLTranslator::readXML(timeCalibFile,header2, - timeCalib_constants2); - - EcalTimeCalibErrorsXMLTranslator::readXML(timeCalibErrFile,header, - timeCalib_errors2); - - std::string timeCalibFile2("/tmp/timeCalibFile-2.xml"); - std::string timeCalibErrFile2("/tmp/timeCalibErrFile-2.xml"); - - EcalTimeCalibConstantsXMLTranslator::writeXML(timeCalibFile2, - header2, - timeCalib_constants2); - - EcalTimeCalibErrorsXMLTranslator::writeXML(timeCalibErrFile2,header2, - timeCalib_errors2); - cout << "Done testing timing intercalib " << endl; - - // test xtalgroup - - EcalWeightGroupXMLTranslator grouptrans; - - EcalWeightXtalGroups groups; - - std::string groupfile("/tmp/EcalWeightXtalGroups.xml"); - - for (int cellid = 0 ; - cellid < EBDetId::kSizeForDenseIndexing; - ++cellid){// loop on EB cells - - - uint32_t rawid = EBDetId::unhashIndex(cellid); - // a random gid - EcalXtalGroupId gid( EBDetId::unhashIndex(cellid).iphi()); - groups[rawid]=gid; - - } - - for (int cellid = 0; - cellid < EEDetId::kSizeForDenseIndexing; - ++cellid){// loop on EB cells - - - - if (EEDetId::validHashIndex(cellid)){ - uint32_t rawid = EEDetId::unhashIndex(cellid); - // a random gid - EcalXtalGroupId gid( EEDetId::unhashIndex(cellid).ix()); - groups[rawid]=gid; - } // if - } - - - - grouptrans.writeXML(groupfile,header,groups); - - EcalWeightXtalGroups groups2; - - grouptrans.readXML(groupfile,header2,groups2); - - std::string groupfile2("/tmp/group-2.xml"); - - grouptrans.writeXML(groupfile2,header2,groups2); - - cout << "Done testing groups " << endl; - - EcalGainRatiosXMLTranslator transGainRatios; - - EcalGainRatios gainratios; - - std::string filenamegr("/tmp/EcalGainRatios.xml"); - std::string newfilegr("/tmp/gainratios-2.xml"); - - - for (int cellid = 0; - cellid < EBDetId::kSizeForDenseIndexing; - ++cellid){// loop on EB cells - - - EcalMGPAGainRatio ecalGR; - ecalGR.setGain12Over6(2.); - ecalGR.setGain6Over1(5.); - - gainratios.insert(std::make_pair(EBDetId::unhashIndex(cellid),ecalGR)); - - } - - for (int cellid = 0; - cellid < EEDetId::kSizeForDenseIndexing; - ++cellid){// loop on EE cells - - if (EEDetId::validHashIndex(cellid)){ - EcalMGPAGainRatio ecalGR; - ecalGR.setGain12Over6(2.); - ecalGR.setGain6Over1(5.); - gainratios.insert(std::make_pair(EEDetId::unhashIndex(cellid),ecalGR)); - } // if - } - - - transGainRatios.writeXML(filenamegr,header,gainratios); - - EcalGainRatios gainratios2; - transGainRatios.readXML(filenamegr,header2,gainratios2); - - - transGainRatios.writeXML(newfilegr,header2,gainratios2); - - - cout << "Done testing gainratios " << endl; - - EcalChannelStatusXMLTranslator transChannelStatus; - - EcalChannelStatus channelstatus; - - - for (int cellid = 0; - cellid < EBDetId::kSizeForDenseIndexing; - ++cellid){// loop on EB cells - - - EcalChannelStatusCode ecalCSC = EcalChannelStatusCode(16); - - uint32_t rawid= EBDetId::unhashIndex(cellid); - - channelstatus[rawid]=ecalCSC; - - } - - for (int cellid = 0; - cellid < EEDetId::kSizeForDenseIndexing; - ++cellid){// loop on Ee cells - - if (EEDetId::validHashIndex(cellid)){ - - uint32_t rawid= EEDetId::unhashIndex(cellid); - EcalChannelStatusCode ecalCSC = EcalChannelStatusCode(35); - channelstatus[rawid]=ecalCSC; - } // if - } - - std::string cscfile("/tmp/EcalChannelStatus.xml"); - - transChannelStatus.writeXML(cscfile,header,channelstatus); - - EcalChannelStatus channelstatus2; - - transChannelStatus.readXML(cscfile,header2,channelstatus2); - - std::string cscfile2("/tmp/cscfile-2.xml"); - - transChannelStatus.writeXML(cscfile2,header2,channelstatus2); - - - cout << "Done testing channelstatus " << endl; - - EcalTBWeightsXMLTranslator transWeight; - - EcalWeightSet weightset; - - - for(int i=0;i<3;i++) - { - for(int k=0;k<10;k++) - { - weightset.getWeightsBeforeGainSwitch()(i,k) = 1.2*k; - weightset.getWeightsAfterGainSwitch()(i,k) = 1.2*k; - } - } - - - - for(int i=0;i<10;i++) - { - for(int k=0;k<10;k++) - { - weightset.getChi2WeightsBeforeGainSwitch()(i,k) = 1.2*k; - weightset.getChi2WeightsAfterGainSwitch()(i,k) = 1.2*k; - } - } - - EcalXtalGroupId gid=1; - EcalTBWeights::EcalTDCId tid=2; - - - EcalTBWeights tbw; - tbw.setValue(gid,tid,weightset); - - - std::string filew("/tmp/EcalTBWeights.xml"); - std::string filew2("/tmp/tbweight2.xml"); - - transWeight.writeXML(filew,header,tbw); - - - EcalTBWeights tbw2; - - transWeight.readXML(filew,header2,tbw2); - - transWeight.writeXML(filew2,header2,tbw2); - - - // test laser - - std::string filelaser("/tmp/EcalLaserAPDPNratios.xml"); - std::string filelaser2("/tmp/EcalLaserAPDPNratios-2.xml"); - - EcalLaserAPDPNRatios laserrecord1; - EcalLaserAPDPNRatios laserrecord2; - - for (int cellid = 0; - cellid < EBDetId::kSizeForDenseIndexing; - ++cellid){// loop on EB cells - - - uint32_t rawid= EBDetId::unhashIndex(cellid); - - EcalLaserAPDPNRatios::EcalLaserAPDPNpair pair; - pair.p1 =1; - pair.p2 =2; - pair.p3 =3; - - laserrecord1.setValue(rawid,pair); - - } - - for (int cellid = 0; - cellid < EEDetId::kSizeForDenseIndexing; - ++cellid){// loop on Ee cells - - if (EEDetId::validHashIndex(cellid)){ - - uint32_t rawid= EEDetId::unhashIndex(cellid); - EcalLaserAPDPNRatios::EcalLaserAPDPNpair pair; - pair.p1 =1; - pair.p2 =2; - pair.p3 =3; - - laserrecord1.setValue(rawid,pair); - - } // if - } - - EcalLaserAPDPNRatiosXMLTranslator::writeXML(filelaser,header,laserrecord1); - EcalLaserAPDPNRatiosXMLTranslator::readXML(filelaser,header2,laserrecord2); - EcalLaserAPDPNRatiosXMLTranslator::writeXML(filelaser2,header2,laserrecord2); - return 0; -} diff --git a/CondTools/Geometry/plugins/CSCRecoIdealDBLoader.cc b/CondTools/Geometry/plugins/CSCRecoIdealDBLoader.cc index ab0ee4eb17814..885ca3858378a 100644 --- a/CondTools/Geometry/plugins/CSCRecoIdealDBLoader.cc +++ b/CondTools/Geometry/plugins/CSCRecoIdealDBLoader.cc @@ -28,10 +28,16 @@ class CSCRecoIdealDBLoader : public edm::one::EDAnalyzer { private: bool fromDD4Hep_; + edm::ESGetToken dd4HepCompactViewToken_; + edm::ESGetToken compactViewToken_; + edm::ESGetToken muonGeomConstantsToken_; }; CSCRecoIdealDBLoader::CSCRecoIdealDBLoader(const edm::ParameterSet& iC) { fromDD4Hep_ = iC.getUntrackedParameter("fromDD4Hep", false); + dd4HepCompactViewToken_ = esConsumes(); + compactViewToken_ = esConsumes(); + muonGeomConstantsToken_ = esConsumes(); } void CSCRecoIdealDBLoader::beginRun(const edm::Run&, edm::EventSetup const& es) { @@ -45,19 +51,15 @@ void CSCRecoIdealDBLoader::beginRun(const edm::Run&, edm::EventSetup const& es) return; } - edm::ESHandle pMNDC; + auto pMNDC = es.getHandle(muonGeomConstantsToken_); CSCGeometryParsFromDD cscgp; if (fromDD4Hep_) { - edm::ESTransientHandle pDD; - es.get().get(pDD); - es.get().get(pMNDC); + auto pDD = es.getTransientHandle(dd4HepCompactViewToken_); const cms::DDCompactView& cpv = *pDD; cscgp.build(&cpv, *pMNDC, *rig, *rdp); } else { - edm::ESTransientHandle pDD; - es.get().get(pDD); - es.get().get(pMNDC); + auto pDD = es.getTransientHandle(compactViewToken_); const DDCompactView& cpv = *pDD; cscgp.build(&cpv, *pMNDC, *rig, *rdp); } diff --git a/CondTools/Geometry/plugins/DTRecoIdealDBLoader.cc b/CondTools/Geometry/plugins/DTRecoIdealDBLoader.cc index 1311f825cedde..c8f9dc2795fce 100644 --- a/CondTools/Geometry/plugins/DTRecoIdealDBLoader.cc +++ b/CondTools/Geometry/plugins/DTRecoIdealDBLoader.cc @@ -29,10 +29,16 @@ class DTRecoIdealDBLoader : public edm::one::EDAnalyzer { private: bool fromDD4Hep_; + edm::ESGetToken dd4HepCompactViewToken_; + edm::ESGetToken compactViewToken_; + edm::ESGetToken muonGeomConstantsToken_; }; DTRecoIdealDBLoader::DTRecoIdealDBLoader(const edm::ParameterSet& iC) { fromDD4Hep_ = iC.getUntrackedParameter("fromDD4Hep", false); + dd4HepCompactViewToken_ = esConsumes(); + compactViewToken_ = esConsumes(); + muonGeomConstantsToken_ = esConsumes(); } void DTRecoIdealDBLoader::beginRun(const edm::Run&, edm::EventSetup const& es) { @@ -43,19 +49,15 @@ void DTRecoIdealDBLoader::beginRun(const edm::Run&, edm::EventSetup const& es) { return; } - edm::ESHandle pMNDC; + auto pMNDC = es.getHandle(muonGeomConstantsToken_); DTGeometryParsFromDD dtgp; if (fromDD4Hep_) { - edm::ESTransientHandle pDD; - es.get().get(pDD); - es.get().get(pMNDC); + auto pDD = es.getTransientHandle(dd4HepCompactViewToken_); const cms::DDCompactView& cpv = *pDD; dtgp.build(&cpv, *pMNDC, *rig); } else { - edm::ESTransientHandle pDD; - es.get().get(pDD); - es.get().get(pMNDC); + auto pDD = es.getTransientHandle(compactViewToken_); const DDCompactView& cpv = *pDD; dtgp.build(&cpv, *pMNDC, *rig); } diff --git a/CondTools/Geometry/plugins/GEMRecoIdealDBLoader.cc b/CondTools/Geometry/plugins/GEMRecoIdealDBLoader.cc index 48fd98f03488b..7787aa61d5e33 100644 --- a/CondTools/Geometry/plugins/GEMRecoIdealDBLoader.cc +++ b/CondTools/Geometry/plugins/GEMRecoIdealDBLoader.cc @@ -30,10 +30,16 @@ class GEMRecoIdealDBLoader : public edm::one::EDAnalyzer { private: bool fromDD4Hep_; + edm::ESGetToken dd4HepCompactViewToken_; + edm::ESGetToken compactViewToken_; + edm::ESGetToken muonGeomConstantsToken_; }; GEMRecoIdealDBLoader::GEMRecoIdealDBLoader(const edm::ParameterSet& iC) { fromDD4Hep_ = iC.getUntrackedParameter("fromDD4Hep", false); // set true for DD4HEP + dd4HepCompactViewToken_ = esConsumes(); + compactViewToken_ = esConsumes(); + muonGeomConstantsToken_ = esConsumes(); } void GEMRecoIdealDBLoader::beginRun(const edm::Run&, edm::EventSetup const& es) { @@ -46,22 +52,19 @@ void GEMRecoIdealDBLoader::beginRun(const edm::Run&, edm::EventSetup const& es) } if (mydbservice->isNewTagRequest("GEMRecoGeometryRcd")) { - edm::ESHandle pMNDC; + auto pMNDC = es.getHandle(muonGeomConstantsToken_); + GEMGeometryParsFromDD rpcpd; RecoIdealGeometry* rig = new RecoIdealGeometry; if (fromDD4Hep_) { edm::LogVerbatim("GEMRecoIdealDBLoader") << "(0) GEMRecoIdealDBLoader - DD4HEP "; - edm::ESTransientHandle pDD; - es.get().get(pDD); - es.get().get(pMNDC); + auto pDD = es.getTransientHandle(dd4HepCompactViewToken_); const cms::DDCompactView& cpv = *pDD; rpcpd.build(&cpv, *pMNDC, *rig); } else { edm::LogVerbatim("GEMRecoIdealDBLoader") << "(0) GEMRecoIdealDBLoader - DDD "; - edm::ESTransientHandle pDD; - es.get().get(pDD); - es.get().get(pMNDC); + auto pDD = es.getTransientHandle(compactViewToken_); const DDCompactView& cpv = *pDD; rpcpd.build(&cpv, *pMNDC, *rig); } diff --git a/CondTools/Geometry/plugins/HcalParametersDBBuilder.cc b/CondTools/Geometry/plugins/HcalParametersDBBuilder.cc index bd49e5ac6aafb..1a21df2ad7a8f 100644 --- a/CondTools/Geometry/plugins/HcalParametersDBBuilder.cc +++ b/CondTools/Geometry/plugins/HcalParametersDBBuilder.cc @@ -26,6 +26,8 @@ class HcalParametersDBBuilder : public edm::one::EDAnalyzer private: bool fromDD4Hep_; + edm::ESGetToken dd4HepCompactViewToken_; + edm::ESGetToken compactViewToken_; }; HcalParametersDBBuilder::HcalParametersDBBuilder(const edm::ParameterSet& ps) @@ -34,6 +36,8 @@ HcalParametersDBBuilder::HcalParametersDBBuilder(const edm::ParameterSet& ps) edm::LogVerbatim("HCalGeom") << "HcalParametersDBBuilder::HcalParametersDBBuilder called with dd4hep: " << fromDD4Hep_; #endif + dd4HepCompactViewToken_ = esConsumes(); + compactViewToken_ = esConsumes(); } void HcalParametersDBBuilder::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { @@ -56,15 +60,13 @@ void HcalParametersDBBuilder::beginRun(const edm::Run&, edm::EventSetup const& e #ifdef EDM_ML_DEBUG edm::LogVerbatim("HCalGeom") << "HcalParametersDBBuilder::Try to access cms::DDCompactView"; #endif - edm::ESTransientHandle cpv; - es.get().get(cpv); + auto cpv = es.getTransientHandle(dd4HepCompactViewToken_); builder.build((*cpv), *php); } else { #ifdef EDM_ML_DEBUG edm::LogVerbatim("HCalGeom") << "HcalParametersDBBuilder::Try to access DDCompactView"; #endif - edm::ESTransientHandle cpv; - es.get().get(cpv); + auto cpv = es.getTransientHandle(compactViewToken_); builder.build(&(*cpv), *php); } diff --git a/CondTools/Geometry/plugins/ME0RecoIdealDBLoader.cc b/CondTools/Geometry/plugins/ME0RecoIdealDBLoader.cc index c28765de7483a..84e71da6d2888 100644 --- a/CondTools/Geometry/plugins/ME0RecoIdealDBLoader.cc +++ b/CondTools/Geometry/plugins/ME0RecoIdealDBLoader.cc @@ -28,10 +28,16 @@ class ME0RecoIdealDBLoader : public edm::one::EDAnalyzer { private: bool fromDD4Hep_; + edm::ESGetToken dd4HepCompactViewToken_; + edm::ESGetToken compactViewToken_; + edm::ESGetToken muonGeomConstantsToken_; }; ME0RecoIdealDBLoader::ME0RecoIdealDBLoader(const edm::ParameterSet& iC) { fromDD4Hep_ = iC.getUntrackedParameter("fromDD4Hep", false); // set true for DD4HEP + dd4HepCompactViewToken_ = esConsumes(); + compactViewToken_ = esConsumes(); + muonGeomConstantsToken_ = esConsumes(); } void ME0RecoIdealDBLoader::beginRun(const edm::Run&, edm::EventSetup const& es) { @@ -44,21 +50,17 @@ void ME0RecoIdealDBLoader::beginRun(const edm::Run&, edm::EventSetup const& es) } if (mydbservice->isNewTagRequest("ME0RecoGeometryRcd")) { - edm::ESHandle pMNDC; + auto pMNDC = es.getHandle(muonGeomConstantsToken_); ME0GeometryParsFromDD me0pd; RecoIdealGeometry* rig = new RecoIdealGeometry; if (fromDD4Hep_) { edm::LogVerbatim("ME0RecoIdealDBLoader") << "(0) ME0RecoIdealDBLoader - DD4HEP "; - edm::ESTransientHandle pDD; - es.get().get(pDD); - es.get().get(pMNDC); + auto pDD = es.getTransientHandle(dd4HepCompactViewToken_); const cms::DDCompactView& cpv = *pDD; me0pd.build(&cpv, *pMNDC, *rig); } else { edm::LogVerbatim("ME0RecoIdealDBLoader") << "(0) ME0RecoIdealDBLoader - DDD "; - edm::ESTransientHandle pDD; - es.get().get(pDD); - es.get().get(pMNDC); + auto pDD = es.getTransientHandle(compactViewToken_); const DDCompactView& cpv = *pDD; me0pd.build(&cpv, *pMNDC, *rig); } diff --git a/CondTools/Geometry/plugins/PCaloGeometryBuilder.cc b/CondTools/Geometry/plugins/PCaloGeometryBuilder.cc index 258b2d17fcc6a..a5542127e73c1 100644 --- a/CondTools/Geometry/plugins/PCaloGeometryBuilder.cc +++ b/CondTools/Geometry/plugins/PCaloGeometryBuilder.cc @@ -19,7 +19,17 @@ class PCaloGeometryBuilder : public edm::one::EDAnalyzer { PCaloGeometryBuilder(const edm::ParameterSet& pset) : m_ecalE(pset.getUntrackedParameter("EcalE", true)), m_ecalP(pset.getUntrackedParameter("EcalP", true)), - m_hgcal(pset.getUntrackedParameter("HGCal", false)) {} + m_hgcal(pset.getUntrackedParameter("HGCal", false)) { + const std::string toDB("_toDB"); + ebGeomToken_ = esConsumes(edm::ESInputTag(EcalBarrelGeometry::producerTag() + toDB)); + eeGeomToken_ = esConsumes(edm::ESInputTag(EcalEndcapGeometry::producerTag() + toDB)); + esGeomToken_ = esConsumes(edm::ESInputTag(EcalPreshowerGeometry::producerTag() + toDB)); + hgcalGeomToken_ = esConsumes(edm::ESInputTag(HGCalGeometry::producerTag() + toDB)); + hcalGeomToken_ = esConsumes(edm::ESInputTag(HcalGeometry::producerTag() + toDB)); + ctGeomToken_ = esConsumes(edm::ESInputTag(CaloTowerGeometry::producerTag() + toDB)); + zdcGeomToken_ = esConsumes(edm::ESInputTag(ZdcGeometry::producerTag() + toDB)); + castGeomToken_ = esConsumes(edm::ESInputTag(CastorGeometry::producerTag() + toDB)); + } void beginRun(edm::Run const& iEvent, edm::EventSetup const&) override; void analyze(edm::Event const& iEvent, edm::EventSetup const&) override {} @@ -29,48 +39,46 @@ class PCaloGeometryBuilder : public edm::one::EDAnalyzer { bool m_ecalE; bool m_ecalP; bool m_hgcal; + edm::ESGetToken ebGeomToken_; + edm::ESGetToken eeGeomToken_; + edm::ESGetToken esGeomToken_; + edm::ESGetToken hgcalGeomToken_; + edm::ESGetToken hcalGeomToken_; + edm::ESGetToken ctGeomToken_; + edm::ESGetToken zdcGeomToken_; + edm::ESGetToken castGeomToken_; }; void PCaloGeometryBuilder::beginRun(const edm::Run&, edm::EventSetup const& es) { - const std::string toDB("_toDB"); - - std::cout << "Writing out " << EcalBarrelGeometry::producerTag() << std::endl; - edm::ESHandle pGeb; - es.get().get(EcalBarrelGeometry::producerTag() + toDB, pGeb); - + edm::LogInfo("PCaloGeometryBuilder") << "Writing out " << EcalBarrelGeometry::producerTag() << std::endl; + auto pGeb = es.getHandle(ebGeomToken_); if (m_ecalE) { - std::cout << "Writing out " << EcalEndcapGeometry::producerTag() << std::endl; - edm::ESHandle pGee; - es.get().get(EcalEndcapGeometry::producerTag() + toDB, pGee); + edm::LogInfo("PCaloGeometryBuilder") << "Writing out " << EcalEndcapGeometry::producerTag() << std::endl; + auto pGeb = es.getHandle(eeGeomToken_); } if (m_ecalP) { - std::cout << "Writing out " << EcalPreshowerGeometry::producerTag() << std::endl; - edm::ESHandle pGes; - es.get().get(EcalPreshowerGeometry::producerTag() + toDB, pGes); + edm::LogInfo("PCaloGeometryBuilder") << "Writing out " << EcalPreshowerGeometry::producerTag() << std::endl; + auto pGes = es.getHandle(esGeomToken_); } if (m_hgcal) { - std::cout << "Writing out " << HGCalGeometry::producerTag() << std::endl; - edm::ESHandle pGee; - es.get().get(HGCalGeometry::producerTag() + toDB, pGee); + edm::LogInfo("PCaloGeometryBuilder") << "Writing out " << HGCalGeometry::producerTag() << std::endl; + auto pGhgcal = es.getHandle(hgcalGeomToken_); + ; } - std::cout << "Writing out " << HcalGeometry::producerTag() << std::endl; - edm::ESHandle pGhcal; - es.get().get(HcalGeometry::producerTag() + toDB, pGhcal); + edm::LogInfo("PCaloGeometryBuilder") << "Writing out " << HcalGeometry::producerTag() << std::endl; + auto pGhcal = es.getHandle(hcalGeomToken_); - std::cout << "Writing out " << CaloTowerGeometry::producerTag() << std::endl; - edm::ESHandle pGct; - es.get().get(CaloTowerGeometry::producerTag() + toDB, pGct); + edm::LogInfo("PCaloGeometryBuilder") << "Writing out " << CaloTowerGeometry::producerTag() << std::endl; + auto pGct = es.getHandle(ctGeomToken_); - std::cout << "Writing out " << ZdcGeometry::producerTag() << std::endl; - edm::ESHandle pGzdc; - es.get().get(ZdcGeometry::producerTag() + toDB, pGzdc); + edm::LogInfo("PCaloGeometryBuilder") << "Writing out " << ZdcGeometry::producerTag() << std::endl; + auto pGzdc = es.getHandle(zdcGeomToken_); - std::cout << "Writing out " << CastorGeometry::producerTag() << std::endl; - edm::ESHandle pGcast; - es.get().get(CastorGeometry::producerTag() + toDB, pGcast); + edm::LogInfo("PCaloGeometryBuilder") << "Writing out " << CastorGeometry::producerTag() << std::endl; + auto pGcast = es.getHandle(castGeomToken_); } DEFINE_FWK_MODULE(PCaloGeometryBuilder); diff --git a/CondTools/Geometry/plugins/PGeometricDetBuilder.cc b/CondTools/Geometry/plugins/PGeometricDetBuilder.cc index 2e9fae089ae4c..5b4ad5d8d4302 100644 --- a/CondTools/Geometry/plugins/PGeometricDetBuilder.cc +++ b/CondTools/Geometry/plugins/PGeometricDetBuilder.cc @@ -32,10 +32,16 @@ class PGeometricDetBuilder : public edm::one::EDAnalyzer { private: void putOne(const GeometricDet* gd, PGeometricDet* pgd, int lev); bool fromDD4hep_; + edm::ESGetToken dd4HepCompactViewToken_; + edm::ESGetToken compactViewToken_; + edm::ESGetToken geometricDetToken_; }; PGeometricDetBuilder::PGeometricDetBuilder(const edm::ParameterSet& iConfig) { fromDD4hep_ = iConfig.getParameter("fromDD4hep"); + dd4HepCompactViewToken_ = esConsumes(); + compactViewToken_ = esConsumes(); + geometricDetToken_ = esConsumes(); } void PGeometricDetBuilder::beginRun(const edm::Run&, edm::EventSetup const& es) { @@ -46,15 +52,11 @@ void PGeometricDetBuilder::beginRun(const edm::Run&, edm::EventSetup const& es) return; } if (!fromDD4hep_) { - edm::ESTransientHandle pDD; - es.get().get(pDD); + auto pDD = es.getTransientHandle(compactViewToken_); } else { - edm::ESTransientHandle pDD; - es.get().get(pDD); + auto pDD = es.getTransientHandle(dd4HepCompactViewToken_); } - edm::ESHandle rDD; - es.get().get(rDD); - const GeometricDet* tracker = &(*rDD); + const GeometricDet* tracker = &es.getData(geometricDetToken_); // so now I have the tracker itself. loop over all its components to store them. putOne(tracker, pgd, 0); diff --git a/CondTools/Geometry/plugins/PHGCalParametersDBBuilder.cc b/CondTools/Geometry/plugins/PHGCalParametersDBBuilder.cc index 6e70a64d40ed5..5468c050f6d70 100644 --- a/CondTools/Geometry/plugins/PHGCalParametersDBBuilder.cc +++ b/CondTools/Geometry/plugins/PHGCalParametersDBBuilder.cc @@ -31,6 +31,8 @@ class PHGCalParametersDBBuilder : public edm::one::EDAnalyzer dd4HepCompactViewToken_; + edm::ESGetToken compactViewToken_; }; PHGCalParametersDBBuilder::PHGCalParametersDBBuilder(const edm::ParameterSet& iC) { @@ -40,6 +42,9 @@ PHGCalParametersDBBuilder::PHGCalParametersDBBuilder(const edm::ParameterSet& iC namec_ = iC.getParameter("nameC"); namet_ = iC.getParameter("nameT"); fromDD4Hep_ = iC.getParameter("fromDD4Hep"); + dd4HepCompactViewToken_ = esConsumes(); + compactViewToken_ = esConsumes(); + #ifdef EDM_ML_DEBUG edm::LogVerbatim("HGCalGeom") << "HGCalParametersESModule for " << name_ << ":" << name2_ << ":" << namew_ << ":" << namec_ << ":" << namet_ << " and fromDD4Hep flag " << fromDD4Hep_; @@ -71,15 +76,13 @@ void PHGCalParametersDBBuilder::beginRun(const edm::Run&, edm::EventSetup const& #ifdef EDM_ML_DEBUG edm::LogVerbatim("HGCalGeom") << "PHGCalParametersDBBuilder::Try to access cm::DDCompactView"; #endif - edm::ESTransientHandle cpv; - es.get().get(cpv); + auto cpv = es.getTransientHandle(dd4HepCompactViewToken_); builder.build(cpv.product(), *ptp, name_, namew_, namec_, namet_, name2_); } else { #ifdef EDM_ML_DEBUG edm::LogVerbatim("HGCalGeom") << "PHGCalParametersDBBuilder::Try to access DDCompactView"; #endif - edm::ESTransientHandle cpv; - es.get().get(cpv); + auto cpv = es.getTransientHandle(compactViewToken_); builder.build(cpv.product(), *ptp, name_, namew_, namec_, namet_); } swapParameters(ptp, phgp); diff --git a/CondTools/Geometry/plugins/PTrackerParametersDBBuilder.cc b/CondTools/Geometry/plugins/PTrackerParametersDBBuilder.cc index 834408e29356c..7013331e71f41 100644 --- a/CondTools/Geometry/plugins/PTrackerParametersDBBuilder.cc +++ b/CondTools/Geometry/plugins/PTrackerParametersDBBuilder.cc @@ -20,10 +20,14 @@ class PTrackerParametersDBBuilder : public edm::one::EDAnalyzer dd4HepCompactViewToken_; + edm::ESGetToken compactViewToken_; }; PTrackerParametersDBBuilder::PTrackerParametersDBBuilder(const edm::ParameterSet& iConfig) { fromDD4hep_ = iConfig.getParameter("fromDD4hep"); + dd4HepCompactViewToken_ = esConsumes(); + compactViewToken_ = esConsumes(); } void PTrackerParametersDBBuilder::beginRun(const edm::Run&, edm::EventSetup const& es) { @@ -37,12 +41,10 @@ void PTrackerParametersDBBuilder::beginRun(const edm::Run&, edm::EventSetup cons TrackerParametersFromDD builder; if (!fromDD4hep_) { - edm::ESTransientHandle cpv; - es.get().get(cpv); + auto cpv = es.getTransientHandle(compactViewToken_); builder.build(&(*cpv), *ptp); } else { - edm::ESTransientHandle cpv; - es.get().get(cpv); + auto cpv = es.getTransientHandle(dd4HepCompactViewToken_); builder.build(&(*cpv), *ptp); } diff --git a/CondTools/Geometry/plugins/RPCRecoIdealDBLoader.cc b/CondTools/Geometry/plugins/RPCRecoIdealDBLoader.cc index 2c7fd91be2331..69332ef488c9e 100644 --- a/CondTools/Geometry/plugins/RPCRecoIdealDBLoader.cc +++ b/CondTools/Geometry/plugins/RPCRecoIdealDBLoader.cc @@ -28,10 +28,16 @@ class RPCRecoIdealDBLoader : public edm::one::EDAnalyzer { private: bool fromDD4Hep_; + edm::ESGetToken dd4HepCompactViewToken_; + edm::ESGetToken compactViewToken_; + edm::ESGetToken muonGeomConstantsToken_; }; RPCRecoIdealDBLoader::RPCRecoIdealDBLoader(const edm::ParameterSet& iC) { fromDD4Hep_ = iC.getUntrackedParameter("fromDD4Hep", false); + dd4HepCompactViewToken_ = esConsumes(); + compactViewToken_ = esConsumes(); + muonGeomConstantsToken_ = esConsumes(); } void RPCRecoIdealDBLoader::beginRun(const edm::Run&, edm::EventSetup const& es) { @@ -42,19 +48,15 @@ void RPCRecoIdealDBLoader::beginRun(const edm::Run&, edm::EventSetup const& es) return; } - edm::ESHandle pMNDC; + auto pMNDC = es.getHandle(muonGeomConstantsToken_); RPCGeometryParsFromDD rpcpd; if (fromDD4Hep_) { - edm::ESTransientHandle pDD; - es.get().get(pDD); - es.get().get(pMNDC); + auto pDD = es.getTransientHandle(dd4HepCompactViewToken_); const cms::DDCompactView& cpv = *pDD; rpcpd.build(&cpv, *pMNDC, *rig); } else { - edm::ESTransientHandle pDD; - es.get().get(pDD); - es.get().get(pMNDC); + auto pDD = es.getTransientHandle(compactViewToken_); const DDCompactView& cpv = *pDD; rpcpd.build(&cpv, *pMNDC, *rig); } diff --git a/CondTools/Geometry/plugins/XMLGeometryReader.cc b/CondTools/Geometry/plugins/XMLGeometryReader.cc index e1011abab24e7..ff6350373266d 100644 --- a/CondTools/Geometry/plugins/XMLGeometryReader.cc +++ b/CondTools/Geometry/plugins/XMLGeometryReader.cc @@ -25,18 +25,19 @@ class XMLGeometryReader : public edm::one::EDAnalyzer { private: std::string m_fname; std::string m_label; + edm::ESGetToken fileBlobToken_; }; XMLGeometryReader::XMLGeometryReader(const edm::ParameterSet& iConfig) { m_fname = iConfig.getUntrackedParameter("XMLFileName", "test.xml"); m_label = iConfig.getUntrackedParameter("geomLabel", "Extended"); + fileBlobToken_ = esConsumes(); } void XMLGeometryReader::beginRun(edm::Run const& run, edm::EventSetup const& iSetup) { edm::LogInfo("XMLGeometryReader") << "XMLGeometryReader::beginRun"; - edm::ESHandle geometry; - iSetup.get().get(m_label, geometry); + auto geometry = iSetup.getHandle(fileBlobToken_); std::unique_ptr > blob((*geometry).getUncompressedBlob()); std::string outfile1(m_fname); diff --git a/CondTools/L1Trigger/interface/Interval.h b/CondTools/L1Trigger/interface/Interval.h deleted file mode 100644 index 48217473b3f37..0000000000000 --- a/CondTools/L1Trigger/interface/Interval.h +++ /dev/null @@ -1,104 +0,0 @@ -#ifndef CondTools_L1Trigger_Interval_h -#define CondTools_L1Trigger_Interval_h - -#include -#include - -namespace l1t -{ - /* Template class that will be used to represnt interval from one value to another. - * In general this class is not interested in what interval mark means, most of the time - * it should be number, time or something similar - * - * This class requires that TimeType should have defined operator == and < as defined in STL. - * It is enforced via sserts that start time is less then end time under provided operator <. - * TimeType requires empty constructor. - * - * Payload should have defined copy constructor and assigment operator. - */ - template - class Interval - { - public: - /* Construncts the class with provided start and end times. Payload is created - * with default constructor. - */ - Interval (const TimeType& start, const TimeType& end) - : m_start (start), m_end (end), isInvalid (false) - { assert (m_start <= m_end); } - - /* Constructs the class with given start and end times, as well as given payload. - */ - Interval (const TimeType& start, const TimeType& end, const PayloadType& payload) - : m_start(start), m_end (end), _payload (payload), isInvalid (false) {} - - /* Sets the payload to the given one. */ - void setPayload (const PayloadType& payload) { this->_payload = payload; } - /* Returns the payload */ - const PayloadType& payload () const { return this->_payload; } - - /* Returns start time */ - const TimeType & start () const { return this->m_start; } - /* Returns end time */ - const TimeType & end () const { return this->m_end; } - - /* Static member that will define an invalid interval. Two invalid interfaces are - * always considered equal. - */ - static Interval & invalid (); - - // Operator overloading - bool operator== (const Interval & other) const - { return (this->isInvalid == true && other.isInvalid == true ) || - (this->start () == other.start ()) && (this->end () == other.end () && - this->isInvalid == other.isInvalid); } - - bool operator!= (const Interval & other) const - { return ! (*this == other); } - - protected: - /* Private data */ - TimeType m_start; - TimeType m_end; - PayloadType _payload; - - /* flag that will check if this interval is invalid */ - bool isInvalid; - }; - - /* Manages a list of intervals and provides method to find interval that contains - * some value. - * - * Template parameters are used to manage Interval class, so all requirements to these - * parameters comes from Interval class - */ - template - class IntervalManager - { - public: - /* Adds one given interval to the list of intervals. - */ - void addInterval (const Interval & interval) - { intervalMap.insert (std::make_pair (interval.start (), interval)); } - - /* Removes all stored intervals from the list - */ - void clear () { intervalMap.clear (); } - - /* Returns interval that contaisn given time. If multiple intervals exists - * any of them is returned - */ - const Interval & find (const TimeType & time) const; - - protected: - /* Information to store list of intervals */ - typedef std::map > IntervalMap; - IntervalMap intervalMap; - }; - -} // namespace - -// implementation -#include "CondTools/L1Trigger/src/Interval.icc" - -#endif diff --git a/CondTools/RPC/interface/L1RPCHwConfigDBWriter.h b/CondTools/RPC/interface/L1RPCHwConfigDBWriter.h deleted file mode 100644 index 5ac0c70158af1..0000000000000 --- a/CondTools/RPC/interface/L1RPCHwConfigDBWriter.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef L1RPCHWCONFIGDBWRITER -#define L1RPCHWCONFIGDBWRITER - -#include "CondCore/PopCon/interface/PopConAnalyzer.h" -#include "CondTools/RPC/interface/L1RPCHwConfigSourceHandler.h" - - -class L1RPCHwConfigDBWriter : public popcon::PopConAnalyzer -{ - public: - L1RPCHwConfigDBWriter(const edm::ParameterSet&); - private: - void initSource(const edm::Event& evt, const edm::EventSetup& est); - int m_validate; -}; - - -#endif diff --git a/CondTools/RPC/interface/RPCEMapDBWriter.h b/CondTools/RPC/interface/RPCEMapDBWriter.h deleted file mode 100644 index 37175c3ade0b4..0000000000000 --- a/CondTools/RPC/interface/RPCEMapDBWriter.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef RPCEMAPDBWRITER -#define RPCEMAPDBWRITER - -#include "CondCore/PopCon/interface/PopConAnalyzer.h" -#include "CondTools/RPC/interface/RPCEMapSourceHandler.h" - - -class RPCEMapDBWriter : public popcon::PopConAnalyzer -{ - public: - RPCEMapDBWriter(const edm::ParameterSet&); - private: - void initSource(const edm::Event& evt, const edm::EventSetup& est); - int m_validate; -}; - - -#endif diff --git a/CondTools/RunInfo/interface/BTransitionAnalyzer.h b/CondTools/RunInfo/interface/BTransitionAnalyzer.h index b4078a7f7793c..fb0d058840ebb 100644 --- a/CondTools/RunInfo/interface/BTransitionAnalyzer.h +++ b/CondTools/RunInfo/interface/BTransitionAnalyzer.h @@ -17,7 +17,11 @@ namespace cond { class BTransitionAnalyzer : public edm::one::EDAnalyzer { public: BTransitionAnalyzer(const edm::ParameterSet& pset) - : m_currentThreshold(pset.getUntrackedParameter("currentThreshold", 18000.)) {} + : m_currentThreshold(pset.getUntrackedParameter("currentThreshold", 18000.)), + m_RunInfoToken(esConsumes()), + m_ESToken(esConsumes()), + m_ESTokenB0T(esConsumes(edm::ESInputTag("", "0T"))), + m_ESTokenB38T(esConsumes(edm::ESInputTag("", "38T"))) {} #ifdef __INTEL_COMPILER virtual ~BTransitionAnalyzer() = default; #endif @@ -28,9 +32,8 @@ namespace cond { void beginRun(edm::Run const&, edm::EventSetup const&) final{}; void analyze(edm::Event const&, edm::EventSetup const&) final{}; void endRun(edm::Run const& run, edm::EventSetup const& eventSetup) final { - edm::ESHandle runInfoHandle; + edm::ESHandle runInfoHandle = eventSetup.getHandle(m_RunInfoToken); edm::ESHandle payloadHandle, payloadRefHandle; - eventSetup.get().get(runInfoHandle); double avg_current = (double)runInfoHandle->m_avg_current; double current_default = -1; std::string bOnLabel = std::string("38T"); @@ -40,13 +43,16 @@ namespace cond { << " A for run: " << run.run() << " with the corresponding threshold: " << m_currentThreshold << " A." << std::endl; - if (avg_current != current_default && avg_current <= m_currentThreshold) + if (avg_current != current_default && avg_current <= m_currentThreshold) { bFieldLabel = bOffLabel; + payloadHandle = eventSetup.getHandle(m_ESTokenB0T); + } else { + payloadHandle = eventSetup.getHandle(m_ESTokenB38T); + } edm::LogInfo("BTransitionAnalyzer") << "The magnet was " << (bFieldLabel == bOnLabel ? "ON" : "OFF") << " during run " << run.run() << ".\nLoading the product for the corrisponding label " << bFieldLabel << std::endl; - eventSetup.get().get(bFieldLabel, payloadHandle); - eventSetup.get().get(payloadRefHandle); + payloadRefHandle = eventSetup.getHandle(m_ESToken); edm::Service mydbservice; if (mydbservice.isAvailable()) { if (!equalPayloads(payloadHandle, payloadRefHandle)) { @@ -68,6 +74,10 @@ namespace cond { private: double m_currentThreshold; + const edm::ESGetToken m_RunInfoToken; + const edm::ESGetToken m_ESToken; + const edm::ESGetToken m_ESTokenB0T; + const edm::ESGetToken m_ESTokenB38T; }; } //namespace cond #endif //BTRANSITIONANALYZER_H diff --git a/CondTools/RunInfo/interface/LHCInfoPopConSourceHandler.h b/CondTools/RunInfo/interface/LHCInfoPopConSourceHandler.h index b5354952d869f..9a96c57765066 100644 --- a/CondTools/RunInfo/interface/LHCInfoPopConSourceHandler.h +++ b/CondTools/RunInfo/interface/LHCInfoPopConSourceHandler.h @@ -47,7 +47,6 @@ class LHCInfoPopConSourceHandler : public popcon::PopConSourceHandler { std::unique_ptr m_fillPayload; std::shared_ptr m_prevPayload; std::vector > > m_tmpBuffer; - std::vector > m_payloadBuffer; bool m_lastPayloadEmpty = false; }; diff --git a/CondTools/RunInfo/plugins/FillInfoESAnalyzer.cc b/CondTools/RunInfo/plugins/FillInfoESAnalyzer.cc index b0a671da4fd40..7f37da876acb8 100644 --- a/CondTools/RunInfo/plugins/FillInfoESAnalyzer.cc +++ b/CondTools/RunInfo/plugins/FillInfoESAnalyzer.cc @@ -1,8 +1,7 @@ #include #include #include -#include "FWCore/Framework/interface/EDAnalyzer.h" -#include "FWCore/Framework/interface/ESHandle.h" +#include "FWCore/Framework/interface/one/EDAnalyzer.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/EventSetup.h" #include "FWCore/Framework/interface/MakerMacros.h" @@ -10,33 +9,39 @@ #include "CondFormats/DataRecord/interface/FillInfoRcd.h" namespace edmtest { - class FillInfoESAnalyzer : public edm::EDAnalyzer { + class FillInfoESAnalyzer : public edm::one::EDAnalyzer<> { + private: + const edm::ESGetToken m_FillInfoToken; + public: - explicit FillInfoESAnalyzer(edm::ParameterSet const& p) { std::cout << "FillInfoESAnalyzer" << std::endl; } - explicit FillInfoESAnalyzer(int i) { std::cout << "FillInfoESAnalyzer " << i << std::endl; } - ~FillInfoESAnalyzer() override { std::cout << "~FillInfoESAnalyzer " << std::endl; } + explicit FillInfoESAnalyzer(edm::ParameterSet const& p) : m_FillInfoToken(esConsumes()) { + edm::LogPrint("FillInfoESAnalyzer") << "FillInfoESAnalyzer" << std::endl; + } + explicit FillInfoESAnalyzer(int i) { + edm::LogPrint("FillInfoESAnalyzer") << "FillInfoESAnalyzer " << i << std::endl; + } + ~FillInfoESAnalyzer() override { edm::LogPrint("FillInfoESAnalyzer") << "~FillInfoESAnalyzer " << std::endl; } void analyze(const edm::Event& e, const edm::EventSetup& c) override; }; void FillInfoESAnalyzer::analyze(const edm::Event& e, const edm::EventSetup& context) { - std::cout << "###FillInfoESAnalyzer::analyze" << std::endl; - std::cout << " I AM IN RUN NUMBER " << e.id().run() << std::endl; - std::cout << " ---EVENT NUMBER " << e.id().event() << std::endl; + edm::LogPrint("FillInfoESAnalyzer") << "###FillInfoESAnalyzer::analyze" << std::endl; + edm::LogPrint("FillInfoESAnalyzer") << " I AM IN RUN NUMBER " << e.id().run() << std::endl; + edm::LogPrint("FillInfoESAnalyzer") << " ---EVENT NUMBER " << e.id().event() << std::endl; edm::eventsetup::EventSetupRecordKey recordKey( edm::eventsetup::EventSetupRecordKey::TypeTag::findType("FillInfoRcd")); if (recordKey.type() == edm::eventsetup::EventSetupRecordKey::TypeTag()) { //record not found - std::cout << "Record \"FillInfoRcd" - << "\" does not exist " << std::endl; + edm::LogPrint("FillInfoESAnalyzer") << "Record \"FillInfoRcd" + << "\" does not exist " << std::endl; } - edm::ESHandle sum; - std::cout << "got eshandle" << std::endl; - context.get().get(sum); - std::cout << "got context" << std::endl; + edm::LogPrint("FillInfoESAnalyzer") << "got eshandle" << std::endl; + edm::ESHandle sum = context.getHandle(m_FillInfoToken); + edm::LogPrint("FillInfoESAnalyzer") << "got context" << std::endl; const FillInfo* summary = sum.product(); - std::cout << "got FillInfo* " << std::endl; - std::cout << "print result" << std::endl; - std::cout << *summary; + edm::LogPrint("FillInfoESAnalyzer") << "got FillInfo* " << std::endl; + edm::LogPrint("FillInfoESAnalyzer") << "print result" << std::endl; + edm::LogPrint("FillInfoESAnalyzer") << *summary; } DEFINE_FWK_MODULE(FillInfoESAnalyzer); } // namespace edmtest diff --git a/CondTools/RunInfo/plugins/LHCInfoESAnalyzer.cc b/CondTools/RunInfo/plugins/LHCInfoESAnalyzer.cc index ef8aef7e5674a..652326164a95e 100644 --- a/CondTools/RunInfo/plugins/LHCInfoESAnalyzer.cc +++ b/CondTools/RunInfo/plugins/LHCInfoESAnalyzer.cc @@ -1,8 +1,7 @@ #include #include #include -#include "FWCore/Framework/interface/EDAnalyzer.h" -#include "FWCore/Framework/interface/ESHandle.h" +#include "FWCore/Framework/interface/one/EDAnalyzer.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/EventSetup.h" #include "FWCore/Framework/interface/MakerMacros.h" @@ -10,33 +9,37 @@ #include "CondFormats/DataRecord/interface/LHCInfoRcd.h" namespace edmtest { - class LHCInfoESAnalyzer : public edm::EDAnalyzer { + class LHCInfoESAnalyzer : public edm::one::EDAnalyzer<> { + private: + const edm::ESGetToken m_LHCInfoToken; + public: - explicit LHCInfoESAnalyzer(edm::ParameterSet const& p) { std::cout << "LHCInfoESAnalyzer" << std::endl; } - explicit LHCInfoESAnalyzer(int i) { std::cout << "LHCInfoESAnalyzer " << i << std::endl; } - ~LHCInfoESAnalyzer() override { std::cout << "~LHCInfoESAnalyzer " << std::endl; } + explicit LHCInfoESAnalyzer(edm::ParameterSet const& p) : m_LHCInfoToken(esConsumes()) { + edm::LogPrint("LHCInfoESAnalyzer") << "LHCInfoESAnalyzer" << std::endl; + } + explicit LHCInfoESAnalyzer(int i) { edm::LogPrint("LHCInfoESAnalyzer") << "LHCInfoESAnalyzer " << i << std::endl; } + ~LHCInfoESAnalyzer() override { edm::LogPrint("LHCInfoESAnalyzer") << "~LHCInfoESAnalyzer " << std::endl; } void analyze(const edm::Event& e, const edm::EventSetup& c) override; }; void LHCInfoESAnalyzer::analyze(const edm::Event& e, const edm::EventSetup& context) { - std::cout << "###LHCInfoESAnalyzer::analyze" << std::endl; - std::cout << " I AM IN RUN NUMBER " << e.id().run() << std::endl; - std::cout << " ---EVENT NUMBER " << e.id().event() << std::endl; + edm::LogPrint("LHCInfoESAnalyzer") << "###LHCInfoESAnalyzer::analyze" << std::endl; + edm::LogPrint("LHCInfoESAnalyzer") << " I AM IN RUN NUMBER " << e.id().run() << std::endl; + edm::LogPrint("LHCInfoESAnalyzer") << " ---EVENT NUMBER " << e.id().event() << std::endl; edm::eventsetup::EventSetupRecordKey recordKey( edm::eventsetup::EventSetupRecordKey::TypeTag::findType("LHCInfoRcd")); if (recordKey.type() == edm::eventsetup::EventSetupRecordKey::TypeTag()) { //record not found - std::cout << "Record \"LHCInfoRcd" - << "\" does not exist " << std::endl; + edm::LogPrint("LHCInfoESAnalyzer") << "Record \"LHCInfoRcd" + << "\" does not exist " << std::endl; } - edm::ESHandle sum; - std::cout << "got eshandle" << std::endl; - context.get().get(sum); - std::cout << "got context" << std::endl; + edm::LogPrint("LHCInfoESAnalyzer") << "got eshandle" << std::endl; + edm::ESHandle sum = context.getHandle(m_LHCInfoToken); + edm::LogPrint("LHCInfoESAnalyzer") << "got context" << std::endl; const LHCInfo* summary = sum.product(); - std::cout << "got LHCInfo* " << std::endl; - std::cout << "print result" << std::endl; - std::cout << *summary; + edm::LogPrint("LHCInfoESAnalyzer") << "got LHCInfo* " << std::endl; + edm::LogPrint("LHCInfoESAnalyzer") << "print result" << std::endl; + edm::LogPrint("LHCInfoESAnalyzer") << *summary; } DEFINE_FWK_MODULE(LHCInfoESAnalyzer); } // namespace edmtest diff --git a/CondTools/RunInfo/plugins/RunInfoESAnalyzer.cc b/CondTools/RunInfo/plugins/RunInfoESAnalyzer.cc index 73ed2cea5619b..b50861abf30f6 100644 --- a/CondTools/RunInfo/plugins/RunInfoESAnalyzer.cc +++ b/CondTools/RunInfo/plugins/RunInfoESAnalyzer.cc @@ -2,75 +2,54 @@ #include #include #include -#include "FWCore/Framework/interface/EDAnalyzer.h" +#include "FWCore/Framework/interface/one/EDAnalyzer.h" #include "FWCore/Framework/interface/Event.h" -#include "FWCore/Framework/interface/ESHandle.h" #include "FWCore/Framework/interface/MakerMacros.h" - #include "FWCore/Framework/interface/EventSetup.h" - #include "CondFormats/RunInfo/interface/RunInfo.h" - #include "CondFormats/DataRecord/interface/RunSummaryRcd.h" using namespace std; namespace edmtest { - class RunInfoESAnalyzer : public edm::EDAnalyzer { + class RunInfoESAnalyzer : public edm::one::EDAnalyzer<> { + private: + const edm::ESGetToken m_RunInfoToken; + public: - explicit RunInfoESAnalyzer(edm::ParameterSet const& p) { std::cout << "RunInfoESAnalyzer" << std::endl; } - explicit RunInfoESAnalyzer(int i) { std::cout << "RunInfoESAnalyzer " << i << std::endl; } - ~RunInfoESAnalyzer() override { std::cout << "~RunInfoESAnalyzer " << std::endl; } - // virtual void beginJob(); - // virtual void beginRun(const edm::Run&, const edm::EventSetup& context); + explicit RunInfoESAnalyzer(edm::ParameterSet const& p) : m_RunInfoToken(esConsumes()) { + edm::LogPrint("RunInfoESAnalyzer") << "RunInfoESAnalyzer" << std::endl; + } + explicit RunInfoESAnalyzer(int i) { edm::LogPrint("RunInfoESAnalyzer") << "RunInfoESAnalyzer " << i << std::endl; } + ~RunInfoESAnalyzer() override { edm::LogPrint("RunInfoESAnalyzer") << "~RunInfoESAnalyzer " << std::endl; } void analyze(const edm::Event& e, const edm::EventSetup& c) override; - - private: }; - - /* void - RunInfoESAnalyzer::beginRun(const edm::Run&, const edm::EventSetup& context){ - std::cout<<"###RunInfoESAnalyzer::beginRun"< RunInfo_lumiarray; - std::cout<<"got eshandle"<().get(RunInfo_lumiarray); - std::cout<<"got data"< sum; - std::cout << "got eshandle" << std::endl; - context.get().get(sum); - std::cout << "got context" << std::endl; + edm::LogPrint("RunInfoESAnalyzer") << "got eshandle" << std::endl; + edm::ESHandle sum = context.getHandle(m_RunInfoToken); + edm::LogPrint("RunInfoESAnalyzer") << "got context" << std::endl; const RunInfo* summary = sum.product(); - std::cout << "got RunInfo* " << std::endl; - - std::cout << "print result" << std::endl; + edm::LogPrint("RunInfoESAnalyzer") << "got RunInfo* " << std::endl; + edm::LogPrint("RunInfoESAnalyzer") << "print result" << std::endl; summary->printAllValues(); - /* std::vector subdet = summary->getSubdtIn(); - std::cout<<"subdetector in the run "<< std::endl; + /* + std::vector subdet = summary->getSubdtIn(); + edm::LogPrint("RunInfoESAnalyzer")<<"subdetector in the run "<< std::endl; for (size_t i=0; i " << subdet[i] << std::endl; + edm::LogPrint("RunInfoESAnalyzer")<<"--> " << subdet[i] << std::endl; } */ } diff --git a/CondTools/RunInfo/plugins/RunSummaryESAnalyzer.cc b/CondTools/RunInfo/plugins/RunSummaryESAnalyzer.cc index ae4b69b5f47a3..1d23fb1b5c283 100644 --- a/CondTools/RunInfo/plugins/RunSummaryESAnalyzer.cc +++ b/CondTools/RunInfo/plugins/RunSummaryESAnalyzer.cc @@ -2,75 +2,59 @@ #include #include #include -#include "FWCore/Framework/interface/EDAnalyzer.h" +#include "FWCore/Framework/interface/one/EDAnalyzer.h" #include "FWCore/Framework/interface/Event.h" -#include "FWCore/Framework/interface/ESHandle.h" #include "FWCore/Framework/interface/MakerMacros.h" - #include "FWCore/Framework/interface/EventSetup.h" - #include "CondFormats/RunInfo/interface/RunSummary.h" - #include "CondFormats/DataRecord/interface/RunSummaryRcd.h" using namespace std; namespace edmtest { - class RunSummaryESAnalyzer : public edm::EDAnalyzer { + class RunSummaryESAnalyzer : public edm::one::EDAnalyzer<> { + private: + const edm::ESGetToken m_RunSummaryToken; + public: - explicit RunSummaryESAnalyzer(edm::ParameterSet const& p) { std::cout << "RunSummaryESAnalyzer" << std::endl; } - explicit RunSummaryESAnalyzer(int i) { std::cout << "RunSummaryESAnalyzer " << i << std::endl; } - ~RunSummaryESAnalyzer() override { std::cout << "~RunSummaryESAnalyzer " << std::endl; } - // virtual void beginJob(); - // virtual void beginRun(const edm::Run&, const edm::EventSetup& context); + explicit RunSummaryESAnalyzer(edm::ParameterSet const& p) : m_RunSummaryToken(esConsumes()) { + edm::LogPrint("RunSummaryESAnalyzer") << "RunSummaryESAnalyzer" << std::endl; + } + explicit RunSummaryESAnalyzer(int i) { + edm::LogPrint("RunSummaryESAnalyzer") << "RunSummaryESAnalyzer " << i << std::endl; + } + ~RunSummaryESAnalyzer() override { edm::LogPrint("RunSummaryESAnalyzer") << "~RunSummaryESAnalyzer " << std::endl; } void analyze(const edm::Event& e, const edm::EventSetup& c) override; private: }; - /* void - RunSummaryESAnalyzer::beginRun(const edm::Run&, const edm::EventSetup& context){ - std::cout<<"###RunSummaryESAnalyzer::beginRun"< RunSummary_lumiarray; - std::cout<<"got eshandle"<().get(RunSummary_lumiarray); - std::cout<<"got data"< sum; - std::cout << "got eshandle" << std::endl; - context.get().get(sum); - std::cout << "got context" << std::endl; + edm::LogPrint("RunSummaryESAnalyzer") << "got eshandle" << std::endl; + edm::ESHandle sum = context.getHandle(m_RunSummaryToken); + edm::LogPrint("RunSummaryESAnalyzer") << "got context" << std::endl; const RunSummary* summary = sum.product(); - std::cout << "got RunSummary* " << std::endl; + edm::LogPrint("RunSummaryESAnalyzer") << "got RunSummary* " << std::endl; - std::cout << "print result" << std::endl; + edm::LogPrint("RunSummaryESAnalyzer") << "print result" << std::endl; summary->printAllValues(); std::vector subdet = summary->getSubdtIn(); - std::cout << "subdetector in the run " << std::endl; + edm::LogPrint("RunSummaryESAnalyzer") << "subdetector in the run " << std::endl; for (size_t i = 0; i < subdet.size(); i++) { - std::cout << "--> " << subdet[i] << std::endl; + edm::LogPrint("RunSummaryESAnalyzer") << "--> " << subdet[i] << std::endl; } } DEFINE_FWK_MODULE(RunSummaryESAnalyzer); diff --git a/CondTools/RunInfo/plugins/XangleBetaStarFilter.cc b/CondTools/RunInfo/plugins/XangleBetaStarFilter.cc index 3f15ee08ca43b..25efa0de9d5fd 100644 --- a/CondTools/RunInfo/plugins/XangleBetaStarFilter.cc +++ b/CondTools/RunInfo/plugins/XangleBetaStarFilter.cc @@ -6,17 +6,16 @@ #include "FWCore/Framework/interface/ESHandle.h" #include "FWCore/Framework/interface/MakerMacros.h" #include "FWCore/Utilities/interface/Exception.h" -#include "FWCore/Framework/interface/EDFilter.h" +#include "FWCore/Framework/interface/stream/EDFilter.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "FWCore/Framework/interface/EventSetup.h" - #include "CondFormats/RunInfo/interface/LHCInfo.h" #include "CondFormats/DataRecord/interface/LHCInfoRcd.h" //---------------------------------------------------------------------------------------------------- -class XangleBetaStarFilter : public edm::EDFilter { +class XangleBetaStarFilter : public edm::stream::EDFilter<> { public: explicit XangleBetaStarFilter(const edm::ParameterSet &); diff --git a/CondTools/RunInfo/src/FillInfoPopConSourceHandler.cc b/CondTools/RunInfo/src/FillInfoPopConSourceHandler.cc index 0ecb37fbdb8be..545be7b1827df 100644 --- a/CondTools/RunInfo/src/FillInfoPopConSourceHandler.cc +++ b/CondTools/RunInfo/src/FillInfoPopConSourceHandler.cc @@ -145,7 +145,8 @@ void FillInfoPopConSourceHandler::getNewObjects() { //execute the query coral::ICursor &fillDataCursor = fillDataQuery->execute(); //initialize loop variables - unsigned short previousFillNumber = 1, currentFill = m_firstFill; + unsigned short previousFillNumber = 1; + unsigned short currentFill = m_firstFill; cond::Time_t previousFillEndTime = 0ULL, afterPreviousFillEndTime = 0ULL, beforeStableBeamStartTime = 0ULL; if (tagInfo().size > 0) { previousFillNumber = previousFill->fillNumber(); diff --git a/CondTools/RunInfo/src/LHCInfoPopConSourceHandler.cc b/CondTools/RunInfo/src/LHCInfoPopConSourceHandler.cc index 0ab9ba892f4f9..a1b4ed97e42e9 100644 --- a/CondTools/RunInfo/src/LHCInfoPopConSourceHandler.cc +++ b/CondTools/RunInfo/src/LHCInfoPopConSourceHandler.cc @@ -31,8 +31,7 @@ LHCInfoPopConSourceHandler::LHCInfoPopConSourceHandler(edm::ParameterSet const& m_authpath(pset.getUntrackedParameter("authenticationPath", "")), m_fillPayload(), m_prevPayload(), - m_tmpBuffer(), - m_payloadBuffer() { + m_tmpBuffer() { if (pset.exists("startTime")) { m_startTime = boost::posix_time::time_from_string(pset.getUntrackedParameter("startTime")); } @@ -773,19 +772,18 @@ bool LHCInfoPopConSourceHandler::getEcalData(cond::persistency::Session& session void LHCInfoPopConSourceHandler::addEmptyPayload(cond::Time_t iov) { bool add = false; - if (m_to_transfer.empty()) { + if (m_iovs.empty()) { if (!m_lastPayloadEmpty) add = true; } else { - LHCInfo* lastAdded = m_to_transfer.back().first; + auto lastAdded = m_iovs.rbegin()->second; if (lastAdded->fillNumber() != 0) { add = true; } } if (add) { auto newPayload = std::make_shared(); - m_to_transfer.push_back(std::make_pair(newPayload.get(), iov)); - m_payloadBuffer.push_back(newPayload); + m_iovs.insert(std::make_pair(iov, newPayload)); m_prevPayload = newPayload; } } @@ -816,26 +814,24 @@ namespace LHCInfoImpl { } size_t transferPayloads(const std::vector>>& buffer, - std::vector>& payloadBuffer, - std::vector>& vecToTransfer, + std::map>& iovsToTransfer, std::shared_ptr& prevPayload) { size_t niovs = 0; for (auto& iov : buffer) { bool add = false; - LHCInfo& payload = *iov.second; + auto payload = iov.second; cond::Time_t since = iov.first; - if (vecToTransfer.empty()) { + if (iovsToTransfer.empty()) { add = true; } else { - LHCInfo& lastAdded = *vecToTransfer.back().first; - if (!comparePayloads(lastAdded, payload)) { + LHCInfo& lastAdded = *iovsToTransfer.rbegin()->second; + if (!comparePayloads(lastAdded, *payload)) { add = true; } } if (add) { niovs++; - vecToTransfer.push_back(std::make_pair(&payload, since)); - payloadBuffer.push_back(iov.second); + iovsToTransfer.insert(std::make_pair(since, payload)); prevPayload = iov.second; } } @@ -965,11 +961,10 @@ void LHCInfoPopConSourceHandler::getNewObjects() { getEcalData(session2, startSampleTime, endSampleTime, updateEcal); session2.transaction().commit(); // - size_t niovs = LHCInfoImpl::transferPayloads(m_tmpBuffer, m_payloadBuffer, m_to_transfer, m_prevPayload); + size_t niovs = LHCInfoImpl::transferPayloads(m_tmpBuffer, m_iovs, m_prevPayload); edm::LogInfo(m_name) << "Added " << niovs << " iovs within the Fill time"; m_tmpBuffer.clear(); iovAdded = true; - //if(m_prevPayload->fillNumber() and m_prevPayload->endTime()!=0ULL) addEmptyPayload( m_fillPayload->endTime() ); if (m_prevPayload->fillNumber() and m_fillPayload->endTime() != 0ULL) addEmptyPayload(m_fillPayload->endTime()); } diff --git a/CondTools/RunInfo/src/RunInfoRead.cc b/CondTools/RunInfo/src/RunInfoRead.cc index 1b7ac4230dafa..f135f1aa3945b 100644 --- a/CondTools/RunInfo/src/RunInfoRead.cc +++ b/CondTools/RunInfo/src/RunInfoRead.cc @@ -23,22 +23,22 @@ #include namespace { - std::string dot("."); - std::string quote("\""); - std::string bNOTb(" NOT "); - std::string squoted(const std::string& s) { return quote + s + quote; } + const std::string dot("."); + const std::string quote("\""); + const std::string bNOTb(" NOT "); + const std::string squoted(const std::string& s) { return quote + s + quote; } //now strings for the tables and columns to be queried - std::string sParameterTable("RUNSESSION_PARAMETER"); - std::string sDateTable("RUNSESSION_DATE"); - std::string sStringTable("RUNSESSION_STRING"); - std::string sIdParameterColumn("ID"); - std::string sRunNumberParameterColumn("RUNNUMBER"); - std::string sNameParameterColumn("NAME"); - std::string sRunSessionParameterIdDataColumn("RUNSESSION_PARAMETER_ID"); - std::string sValueDataColumn("VALUE"); - std::string sDCSMagnetTable("CMSFWMAGNET"); - std::string sDCSMagnetCurrentColumn("CURRENT"); - std::string sDCSMagnetChangeDateColumn("CHANGE_DATE"); + const std::string sParameterTable("RUNSESSION_PARAMETER"); + const std::string sDateTable("RUNSESSION_DATE"); + const std::string sStringTable("RUNSESSION_STRING"); + const std::string sIdParameterColumn("ID"); + const std::string sRunNumberParameterColumn("RUNNUMBER"); + const std::string sNameParameterColumn("NAME"); + const std::string sRunSessionParameterIdDataColumn("RUNSESSION_PARAMETER_ID"); + const std::string sValueDataColumn("VALUE"); + const std::string sDCSMagnetTable("CMSFWMAGNET"); + const std::string sDCSMagnetCurrentColumn("CURRENT"); + const std::string sDCSMagnetChangeDateColumn("CHANGE_DATE"); } // namespace RunInfoRead::RunInfoRead(const std::string& connectionString, const edm::ParameterSet& connectionPset) diff --git a/CondTools/RunInfo/src/RunSummaryHandler.cc b/CondTools/RunInfo/src/RunSummaryHandler.cc index eddf3499f8c76..3232e3fea56c2 100644 --- a/CondTools/RunInfo/src/RunSummaryHandler.cc +++ b/CondTools/RunInfo/src/RunSummaryHandler.cc @@ -47,7 +47,6 @@ void RunSummaryHandler::getNewObjects() { size_t n_empty_run = 0; if (tagInfo().size > 0 && (tagInfo().lastInterval.since + 1) < snc) { - n_empty_run = snc - tagInfo().lastInterval.since - 1; edm::LogInfo("RunSummaryHandler") << "------- " << "entering fake run from " << tagInfo().lastInterval.since + 1 << "to " << snc - 1 << "- > getNewObjects" << std::endl; diff --git a/CondTools/RunInfo/test/BuildFile.xml b/CondTools/RunInfo/test/BuildFile.xml index 831fe9b570583..07301e711c422 100644 --- a/CondTools/RunInfo/test/BuildFile.xml +++ b/CondTools/RunInfo/test/BuildFile.xml @@ -1,6 +1,6 @@ - + diff --git a/CondTools/SiPixel/test/SiPixelCondObjForHLTBuilder_cfg.py b/CondTools/SiPixel/test/SiPixelCondObjForHLTBuilder_cfg.py index 3ecf4c4834144..c3b611ffe6539 100644 --- a/CondTools/SiPixel/test/SiPixelCondObjForHLTBuilder_cfg.py +++ b/CondTools/SiPixel/test/SiPixelCondObjForHLTBuilder_cfg.py @@ -4,7 +4,7 @@ process.load("Configuration.StandardSequences.MagneticField_cff") #process.load("Geometry.TrackerSimData.trackerSimGeometryXML_cfi") -process.load("Configuration.StandardSequences.Geometry_cff") +process.load("Configuration.StandardSequences.GeometryDB_cff") process.load("Geometry.TrackerGeometryBuilder.trackerGeometry_cfi") process.load("Geometry.TrackerGeometryBuilder.idealForDigiTrackerGeometry_cff") process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff") diff --git a/CondTools/SiPixel/test/SiPixelCondObjForHLTReader_cfg.py b/CondTools/SiPixel/test/SiPixelCondObjForHLTReader_cfg.py index d812254bdd31a..6d9e0f0c3d9e4 100644 --- a/CondTools/SiPixel/test/SiPixelCondObjForHLTReader_cfg.py +++ b/CondTools/SiPixel/test/SiPixelCondObjForHLTReader_cfg.py @@ -4,7 +4,7 @@ process.load("FWCore.MessageService.MessageLogger_cfi") #process.load("Geometry.TrackerSimData.trackerSimGeometryXML_cfi") -process.load("Configuration.StandardSequences.Geometry_cff") +process.load("Configuration.StandardSequences.GeometryDB_cff") process.load("Geometry.TrackerGeometryBuilder.trackerGeometry_cfi") process.load("Geometry.TrackerGeometryBuilder.idealForDigiTrackerGeometry_cff") process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff") diff --git a/CondTools/SiPixel/test/SiPixelCondObjOfflineBuilder_cfg.py b/CondTools/SiPixel/test/SiPixelCondObjOfflineBuilder_cfg.py index 5d341f082810e..2dfdac01d9d95 100644 --- a/CondTools/SiPixel/test/SiPixelCondObjOfflineBuilder_cfg.py +++ b/CondTools/SiPixel/test/SiPixelCondObjOfflineBuilder_cfg.py @@ -4,7 +4,7 @@ process.load("Configuration.StandardSequences.MagneticField_cff") #process.load("Geometry.TrackerSimData.trackerSimGeometryXML_cfi") -process.load("Configuration.StandardSequences.Geometry_cff") +process.load("Configuration.StandardSequences.GeometryDB_cff") process.load("Geometry.TrackerGeometryBuilder.trackerGeometry_cfi") process.load("Geometry.TrackerGeometryBuilder.idealForDigiTrackerGeometry_cff") process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff") diff --git a/CondTools/SiPixel/test/SiPixelCondObjOfflineReader_cfg.py b/CondTools/SiPixel/test/SiPixelCondObjOfflineReader_cfg.py index 9a3efdd0f22ee..263f12884c334 100644 --- a/CondTools/SiPixel/test/SiPixelCondObjOfflineReader_cfg.py +++ b/CondTools/SiPixel/test/SiPixelCondObjOfflineReader_cfg.py @@ -4,7 +4,7 @@ process.load("FWCore.MessageService.MessageLogger_cfi") #process.load("Geometry.TrackerSimData.trackerSimGeometryXML_cfi") -process.load("Configuration.StandardSequences.Geometry_cff") +process.load("Configuration.StandardSequences.GeometryDB_cff") process.load("Geometry.TrackerGeometryBuilder.trackerGeometry_cfi") process.load("Geometry.TrackerGeometryBuilder.idealForDigiTrackerGeometry_cff") process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff") diff --git a/CondTools/SiPixel/test/SiPixelCondObjReader_cfg.py b/CondTools/SiPixel/test/SiPixelCondObjReader_cfg.py index 25c43578d3957..00a988dd5a5a8 100644 --- a/CondTools/SiPixel/test/SiPixelCondObjReader_cfg.py +++ b/CondTools/SiPixel/test/SiPixelCondObjReader_cfg.py @@ -4,7 +4,7 @@ process.load("FWCore.MessageService.MessageLogger_cfi") #process.load("Geometry.TrackerSimData.trackerSimGeometryXML_cfi") -process.load("Configuration.StandardSequences.Geometry_cff") +process.load("Configuration.StandardSequences.GeometryDB_cff") process.load("Geometry.TrackerGeometryBuilder.trackerGeometry_cfi") process.load("Geometry.TrackerGeometryBuilder.idealForDigiTrackerGeometry_cff") process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff") diff --git a/CondTools/SiPixel/test/SiPixelGainCalibrationReadDQMFile.cc b/CondTools/SiPixel/test/SiPixelGainCalibrationReadDQMFile.cc index 26868a87de495..f7e4fe86e332d 100644 --- a/CondTools/SiPixel/test/SiPixelGainCalibrationReadDQMFile.cc +++ b/CondTools/SiPixel/test/SiPixelGainCalibrationReadDQMFile.cc @@ -459,24 +459,20 @@ void SiPixelGainCalibrationReadDQMFile::fillDatabase(const edm::EventSetup &iSet if (record_ == "SiPixelGainCalibrationForHLTRcd") { std::cout << "now doing SiPixelGainCalibrationForHLTRcd payload..." << std::endl; if (mydbservice->isNewTagRequest(record_)) { - mydbservice->createNewIOV(theGainCalibrationDbInputHLT.release(), - mydbservice->beginOfTime(), - mydbservice->endOfTime(), - "SiPixelGainCalibrationForHLTRcd"); + mydbservice->createNewIOV( + *theGainCalibrationDbInputHLT, mydbservice->beginOfTime(), "SiPixelGainCalibrationForHLTRcd"); } else { mydbservice->appendSinceTime( - theGainCalibrationDbInputHLT.release(), mydbservice->currentTime(), "SiPixelGainCalibrationForHLTRcd"); + *theGainCalibrationDbInputHLT, mydbservice->currentTime(), "SiPixelGainCalibrationForHLTRcd"); } } else if (record_ == "SiPixelGainCalibrationOfflineRcd") { std::cout << "now doing SiPixelGainCalibrationOfflineRcd payload..." << std::endl; if (mydbservice->isNewTagRequest(record_)) { - mydbservice->createNewIOV(theGainCalibrationDbInputOffline.release(), - mydbservice->beginOfTime(), - mydbservice->endOfTime(), - "SiPixelGainCalibrationOfflineRcd"); + mydbservice->createNewIOV( + *theGainCalibrationDbInputOffline, mydbservice->beginOfTime(), "SiPixelGainCalibrationOfflineRcd"); } else { mydbservice->appendSinceTime( - theGainCalibrationDbInputOffline.release(), mydbservice->currentTime(), "SiPixelGainCalibrationOfflineRcd"); + *theGainCalibrationDbInputOffline, mydbservice->currentTime(), "SiPixelGainCalibrationOfflineRcd"); } } edm::LogInfo(" --- all OK"); diff --git a/CondTools/SiPixel/test/SiPixelGainCalibrationReadDQMFile_cfg.py b/CondTools/SiPixel/test/SiPixelGainCalibrationReadDQMFile_cfg.py index 7d168952c8e2e..92865be54bbc4 100644 --- a/CondTools/SiPixel/test/SiPixelGainCalibrationReadDQMFile_cfg.py +++ b/CondTools/SiPixel/test/SiPixelGainCalibrationReadDQMFile_cfg.py @@ -2,7 +2,7 @@ process = cms.Process("test") process.load("CondTools.SiPixel.SiPixelGainCalibrationService_cfi") -process.load("Configuration.StandardSequences.Geometry_cff") +process.load("Configuration.StandardSequences.GeometryDB_cff") process.load("Geometry.TrackerGeometryBuilder.trackerGeometry_cfi") process.load("Geometry.TrackerGeometryBuilder.idealForDigiTrackerGeometry_cff") process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff") diff --git a/CondTools/SiPixel/test/SiPixelGainCalibrationRejectNoisyAndDead_cfg.py b/CondTools/SiPixel/test/SiPixelGainCalibrationRejectNoisyAndDead_cfg.py index 0f8286118a90d..8532973109332 100644 --- a/CondTools/SiPixel/test/SiPixelGainCalibrationRejectNoisyAndDead_cfg.py +++ b/CondTools/SiPixel/test/SiPixelGainCalibrationRejectNoisyAndDead_cfg.py @@ -2,7 +2,7 @@ process = cms.Process("test") process.load("CondTools.SiPixel.SiPixelGainCalibrationService_cfi") -process.load("Configuration.StandardSequences.Geometry_cff") +process.load("Configuration.StandardSequences.GeometryDB_cff") process.load("Geometry.TrackerGeometryBuilder.trackerGeometry_cfi") process.load("Geometry.TrackerGeometryBuilder.idealForDigiTrackerGeometry_cff") process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff") diff --git a/CondTools/SiStrip/interface/SiStripCondObjBuilderBase.h b/CondTools/SiStrip/interface/SiStripCondObjBuilderBase.h deleted file mode 100644 index 115599f4b0aef..0000000000000 --- a/CondTools/SiStrip/interface/SiStripCondObjBuilderBase.h +++ /dev/null @@ -1,30 +0,0 @@ -#ifndef CondTools_SiStrip_SiStripCondObjBuilderBase_H -#define CondTools_SiStrip_SiStripCondObjBuilderBase_H - -#include "FWCore/ParameterSet/interface/ParameterSet.h" -#include -#include - -template -class SiStripCondObjBuilderBase { -public: - SiStripCondObjBuilderBase(const edm::ParameterSet& pset) : _pset(pset){}; - virtual ~SiStripCondObjBuilderBase() noexcept(false){}; - - virtual void initialize(){}; - - /** Returns MetaData information in a stringstream */ - virtual void getMetaDataString(std::stringstream& ss){}; - - /** Check MetaData information in a stringstream */ - virtual bool checkForCompatibility(std::string ss) { return true; } - - /** Returns the CondObj */ - virtual void getObj(T*& obj){}; - -protected: - T* obj_; - edm::ParameterSet _pset; -}; - -#endif // CondTools_SiStrip_SiStripCondObjBuilderBase_H diff --git a/CondTools/SiStrip/interface/SiStripDepCondObjBuilderBase.h b/CondTools/SiStrip/interface/SiStripDepCondObjBuilderBase.h deleted file mode 100644 index 7e0b86c9b86d2..0000000000000 --- a/CondTools/SiStrip/interface/SiStripDepCondObjBuilderBase.h +++ /dev/null @@ -1,30 +0,0 @@ -#ifndef CondTools_SiStrip_SiStripDepCondObjBuilderBase_H -#define CondTools_SiStrip_SiStripDepCondObjBuilderBase_H - -#include "FWCore/ParameterSet/interface/ParameterSet.h" -#include -#include - -template -class SiStripDepCondObjBuilderBase { -public: - SiStripDepCondObjBuilderBase(const edm::ParameterSet& pset) : _pset(pset){}; - virtual ~SiStripDepCondObjBuilderBase(){}; - - virtual void initialize(){}; - - /** Returns MetaData information in a stringstream */ - virtual void getMetaDataString(std::stringstream& ss){}; - - /** Check MetaData information in a stringstream */ - virtual bool checkForCompatibility(std::string ss) { return true; } - - /** Returns the CondObj */ - virtual void getObj(T*& obj, const D* depObj){}; - -protected: - T* obj_; - edm::ParameterSet _pset; -}; - -#endif // CondTools_SiStrip_SiStripDepCondObjBuilderBase_H diff --git a/CondTools/SiStrip/plugins/SiStripApvSimulationParametersBuilder.cc b/CondTools/SiStrip/plugins/SiStripApvSimulationParametersBuilder.cc index 6863d9bf59e58..b5d7e89ae6e4c 100644 --- a/CondTools/SiStrip/plugins/SiStripApvSimulationParametersBuilder.cc +++ b/CondTools/SiStrip/plugins/SiStripApvSimulationParametersBuilder.cc @@ -23,10 +23,10 @@ void SiStripApvSimulationParametersBuilder::analyze(const edm::Event&, const edm if (mydbservice.isAvailable()) { if (mydbservice->isNewTagRequest("SiStripApvSimulationParametersRcd")) { mydbservice->createNewIOV( - obj.get(), mydbservice->beginOfTime(), mydbservice->endOfTime(), "SiStripApvSimulationParametersRcd"); + *obj, mydbservice->beginOfTime(), "SiStripApvSimulationParametersRcd"); } else { mydbservice->appendSinceTime( - obj.get(), mydbservice->currentTime(), "SiStripApvSimulationParametersRcd"); + *obj, mydbservice->currentTime(), "SiStripApvSimulationParametersRcd"); } } else { edm::LogError("SiStripApvSimulationParametersBuilder") << "Service is unavailable"; diff --git a/CondTools/SiStrip/plugins/SiStripBadChannelBuilder.cc b/CondTools/SiStrip/plugins/SiStripBadChannelBuilder.cc index eea06c86a5bf7..4252970489e59 100644 --- a/CondTools/SiStrip/plugins/SiStripBadChannelBuilder.cc +++ b/CondTools/SiStrip/plugins/SiStripBadChannelBuilder.cc @@ -79,11 +79,10 @@ std::unique_ptr SiStripBadChannelBuilder::getNewObject() { if (mydbservice.isAvailable()) { if (mydbservice->isNewTagRequest("SiStripBadStripRcd")) { - mydbservice->createNewIOV( - obj.get(), mydbservice->beginOfTime(), mydbservice->endOfTime(), "SiStripBadStripRcd"); + mydbservice->createNewIOV(*obj, mydbservice->beginOfTime(), "SiStripBadStripRcd"); } else { - //mydbservice->createNewIOV(obj.get(),mydbservice->currentTime(),"SiStripBadStripRcd"); - mydbservice->appendSinceTime(obj.get(), mydbservice->currentTime(), "SiStripBadStripRcd"); + //mydbservice->createNewIOV(*obj, mydbservice->currentTime(),"SiStripBadStripRcd"); + mydbservice->appendSinceTime(*obj, mydbservice->currentTime(), "SiStripBadStripRcd"); } } else { edm::LogError("SiStripBadStripBuilder") << "Service is unavailable" << std::endl; diff --git a/CondTools/SiStrip/test/SiStripDetVOffFakeBuilder_cfg.py b/CondTools/SiStrip/test/SiStripDetVOffFakeBuilder_cfg.py index 6d8c5cade745f..c33cd43c3f7aa 100644 --- a/CondTools/SiStrip/test/SiStripDetVOffFakeBuilder_cfg.py +++ b/CondTools/SiStrip/test/SiStripDetVOffFakeBuilder_cfg.py @@ -31,7 +31,7 @@ )) ) -process.load("Configuration.StandardSequences.Geometry_cff") +process.load("Configuration.StandardSequences.GeometryDB_cff") process.TrackerDigiGeometryESModule.applyAlignment = False process.prod = cms.EDAnalyzer("SiStripDetVOffFakeBuilder") diff --git a/CondTools/SiStrip/test/SiStripFedCablingBuilder_cfg.py b/CondTools/SiStrip/test/SiStripFedCablingBuilder_cfg.py index e5c0d47c76984..fd1b07788723e 100644 --- a/CondTools/SiStrip/test/SiStripFedCablingBuilder_cfg.py +++ b/CondTools/SiStrip/test/SiStripFedCablingBuilder_cfg.py @@ -35,7 +35,7 @@ )) ) -process.load("Configuration.StandardSequences.Geometry_cff") +process.load("Configuration.StandardSequences.GeometryDB_cff") process.TrackerDigiGeometryESModule.applyAlignment = False process.SiStripConnectivity = cms.ESProducer("SiStripConnectivity") process.SiStripRegionConnectivity = cms.ESProducer("SiStripRegionConnectivity", diff --git a/CondTools/SiStrip/test/SiStripFedCablingReader_cfg.py b/CondTools/SiStrip/test/SiStripFedCablingReader_cfg.py index 7b5c4bcb10cc2..3c7f757284db1 100644 --- a/CondTools/SiStrip/test/SiStripFedCablingReader_cfg.py +++ b/CondTools/SiStrip/test/SiStripFedCablingReader_cfg.py @@ -33,7 +33,7 @@ )) ) -process.load("Configuration.StandardSequences.Geometry_cff") +process.load("Configuration.StandardSequences.GeometryDB_cff") process.TrackerDigiGeometryESModule.applyAlignment = False process.SiStripConnectivity = cms.ESProducer("SiStripConnectivity") process.SiStripRegionConnectivity = cms.ESProducer("SiStripRegionConnectivity", diff --git a/Configuration/AlCa/python/autoAlca.py b/Configuration/AlCa/python/autoAlca.py index ab1eec7399b72..51f166826ffe7 100644 --- a/Configuration/AlCa/python/autoAlca.py +++ b/Configuration/AlCa/python/autoAlca.py @@ -124,3 +124,11 @@ def buildList(pdList, matrix): 'allForPromptCosmics' : buildList(['Cosmics'], AlCaRecoMatrix), 'allForExpressCosmics' : buildList(['ExpressCosmics'], AlCaRecoMatrix) } autoAlca.update(AlCaRecoMatrix) + +# list of AlCa sequences that have modules that do not support concurrent LuminosityBlocks +AlCaNoConcurrentLumis = [ + 'PromptCalibProd', # AlcaBeamSpotProducer + 'PromptCalibProdSiPixelAli', # AlignmentProducerAsAnalyzer, MillePedeFileConverter + 'PromptCalibProdBeamSpotHP', # AlcaBeamSpotProducer + 'PromptCalibProdBeamSpotHPLowPU', # AlcaBeamSpotProducer +] diff --git a/Configuration/AlCa/python/autoCond.py b/Configuration/AlCa/python/autoCond.py index 3e0d8af7ddc1d..3816ce9494b82 100644 --- a/Configuration/AlCa/python/autoCond.py +++ b/Configuration/AlCa/python/autoCond.py @@ -2,81 +2,83 @@ ### NEW KEYS ### # GlobalTag for MC production with perfectly aligned and calibrated detector for Run1 - 'run1_design' : '120X_mcRun1_design_v1', + 'run1_design' : '121X_mcRun1_design_v4', # GlobalTag for MC production (pp collisions) with realistic alignment and calibrations for Run1 - 'run1_mc' : '120X_mcRun1_realistic_v1', + 'run1_mc' : '121X_mcRun1_realistic_v4', # GlobalTag for MC production (Heavy Ions collisions) with realistic alignment and calibrations for Run1 - 'run1_mc_hi' : '120X_mcRun1_HeavyIon_v1', + 'run1_mc_hi' : '121X_mcRun1_HeavyIon_v5', # GlobalTag for MC production with pessimistic alignment and calibrations for Run2 - 'run2_mc_50ns' : '120X_mcRun2_startup_v1', + 'run2_mc_50ns' : '121X_mcRun2_startup_v4', # GlobalTag for MC production (2015 L1 Trigger Stage1) with startup-like alignment and calibrations for Run2, L1 trigger in Stage1 mode - 'run2_mc_l1stage1' : '120X_mcRun2_asymptotic_l1stage1_v1', + 'run2_mc_l1stage1' : '121X_mcRun2_asymptotic_l1stage1_v4', # GlobalTag for MC production with perfectly aligned and calibrated detector for Run2 - 'run2_design' : '120X_mcRun2_design_v1', + 'run2_design' : '121X_mcRun2_design_v4', #GlobalTag for MC production with optimistic alignment and calibrations for 2016, prior to VFP change - 'run2_mc_pre_vfp' : '120X_mcRun2_asymptotic_preVFP_v2', + 'run2_mc_pre_vfp' : '121X_mcRun2_asymptotic_preVFP_v4', #GlobalTag for MC production with optimistic alignment and calibrations for 2016, after VFP change - 'run2_mc' : '120X_mcRun2_asymptotic_v2', + 'run2_mc' : '121X_mcRun2_asymptotic_v4', # GlobalTag for MC production (cosmics) with starup-like alignment and calibrations for Run2, Strip tracker in peak mode - 'run2_mc_cosmics' : '120X_mcRun2cosmics_asymptotic_deco_v1', + 'run2_mc_cosmics' : '121X_mcRun2cosmics_asymptotic_deco_v4', # GlobalTag for MC production (Heavy Ions collisions) with optimistic alignment and calibrations for Run2 - 'run2_mc_hi' : '120X_mcRun2_HeavyIon_v1', + 'run2_mc_hi' : '121X_mcRun2_HeavyIon_v4', # GlobalTag for MC production (p-Pb collisions) with realistic alignment and calibrations for Run2 - 'run2_mc_pa' : '120X_mcRun2_pA_v1', + 'run2_mc_pa' : '121X_mcRun2_pA_v4', # GlobalTag for Run2 data reprocessing - 'run2_data' : '120X_dataRun2_v2', + 'run2_data' : '121X_dataRun2_v4', # GlobalTag for Run2 data 2018B relvals only: HEM-15-16 fail - 'run2_data_HEfail' : '120X_dataRun2_HEfail_v1', + 'run2_data_HEfail' : '121X_dataRun2_HEfail_v4', # GlobalTag for Run2 data relvals: allows customization to run with fixed L1 menu - 'run2_data_relval' : '120X_dataRun2_relval_v2', + 'run2_data_relval' : '121X_dataRun2_relval_v4', # GlobalTag for Run2 HI data - 'run2_data_promptlike_hi' : '120X_dataRun2_PromptLike_HI_v1', + 'run2_data_promptlike_hi' : '121X_dataRun2_PromptLike_HI_v4', # GlobalTag for Run3 HLT: it points to the online GT - 'run3_hlt' : '113X_dataRun3_HLT_v3', + 'run3_hlt' : '121X_dataRun3_HLT_v4', # GlobalTag with fixed snapshot time for Run2 HLT RelVals: customizations to run with fixed L1 Menu - 'run2_hlt_relval' : '113X_dataRun2_HLT_relval_v2', + 'run2_hlt_relval' : '121X_dataRun2_HLT_relval_v4', # GlobalTag for Run3 data relvals (express GT) - 'run3_data_express' : '113X_dataRun3_Express_v4', + 'run3_data_express' : '121X_dataRun3_Express_v4', # GlobalTag for Run3 data relvals - 'run3_data_prompt' : '113X_dataRun3_Prompt_v3', + 'run3_data_prompt' : '121X_dataRun3_Prompt_v4', + # GlobalTag for Run3 offline data reprocessing + 'run3_data' : '121X_dataRun3_v4', # GlobalTag for MC production with perfectly aligned and calibrated detector for Phase1 2017 (and 0,0,~0-centred beamspot) - 'phase1_2017_design' : '120X_mc2017_design_v1', + 'phase1_2017_design' : '121X_mc2017_design_v4', # GlobalTag for MC production with realistic conditions for Phase1 2017 detector - 'phase1_2017_realistic' : '120X_mc2017_realistic_v1', + 'phase1_2017_realistic' : '121X_mc2017_realistic_v4', # GlobalTag for MC production with realistic conditions for Phase1 2017 detector, for PP reference run 'phase1_2017_realistic_ppref' : '120X_mc2017_realistic_forppRef5TeV_v2', # GlobalTag for MC production (cosmics) with realistic alignment and calibrations for Phase1 2017 detector, Strip tracker in DECO mode - 'phase1_2017_cosmics' : '120X_mc2017cosmics_realistic_deco_v1', + 'phase1_2017_cosmics' : '121X_mc2017cosmics_realistic_deco_v4', # GlobalTag for MC production (cosmics) with realistic alignment and calibrations for Phase1 2017 detector, Strip tracker in PEAK mode - 'phase1_2017_cosmics_peak' : '120X_mc2017cosmics_realistic_peak_v1', + 'phase1_2017_cosmics_peak' : '121X_mc2017cosmics_realistic_peak_v4', # GlobalTag for MC production with perfectly aligned and calibrated detector for full Phase1 2018 (and 0,0,0-centred beamspot) - 'phase1_2018_design' : '120X_upgrade2018_design_v1', + 'phase1_2018_design' : '121X_upgrade2018_design_v4', # GlobalTag for MC production with realistic conditions for full Phase1 2018 detector - 'phase1_2018_realistic' : '120X_upgrade2018_realistic_v1', + 'phase1_2018_realistic' : '121X_upgrade2018_realistic_v4', # GlobalTag for MC production with realistic run-dependent (RD) conditions for full Phase1 2018 detector - 'phase1_2018_realistic_rd' : '113X_upgrade2018_realistic_RD_v5', + 'phase1_2018_realistic_rd' : '121X_upgrade2018_realistic_RD_v4', # GlobalTag for MC production with realistic conditions for full Phase1 2018 detector for Heavy Ion - 'phase1_2018_realistic_hi' : '120X_upgrade2018_realistic_HI_v1', + 'phase1_2018_realistic_hi' : '121X_upgrade2018_realistic_HI_v4', # GlobalTag for MC production with realistic conditions for full Phase1 2018 detector: HEM-15-16 fail - 'phase1_2018_realistic_HEfail' : '120X_upgrade2018_realistic_HEfail_v1', + 'phase1_2018_realistic_HEfail' : '121X_upgrade2018_realistic_HEfail_v4', # GlobalTag for MC production (cosmics) with realistic conditions for full Phase1 2018 detector, Strip tracker in DECO mode - 'phase1_2018_cosmics' : '120X_upgrade2018cosmics_realistic_deco_v1', + 'phase1_2018_cosmics' : '121X_upgrade2018cosmics_realistic_deco_v6', # GlobalTag for MC production (cosmics) with realistic conditions for full Phase1 2018 detector, Strip tracker in PEAK mode - 'phase1_2018_cosmics_peak' : '120X_upgrade2018cosmics_realistic_peak_v1', + 'phase1_2018_cosmics_peak' : '121X_upgrade2018cosmics_realistic_peak_v4', # GlobalTag for MC production with perfectly aligned and calibrated detector for Phase1 2021 - 'phase1_2021_design' : '120X_mcRun3_2021_design_v3', # GT containing design conditions for Phase1 2021 + 'phase1_2021_design' : '121X_mcRun3_2021_design_v6', # GlobalTag for MC production with realistic conditions for Phase1 2021 - 'phase1_2021_realistic' : '120X_mcRun3_2021_realistic_v4', # GT containing realistic conditions for Phase1 2021 + 'phase1_2021_realistic' : '121X_mcRun3_2021_realistic_v7', # GlobalTag for MC production (cosmics) with realistic conditions for Phase1 2021, Strip tracker in DECO mode - 'phase1_2021_cosmics' : '120X_mcRun3_2021cosmics_realistic_deco_v3', + 'phase1_2021_cosmics' : '121X_mcRun3_2021cosmics_realistic_deco_v7', # GlobalTag for MC production with realistic conditions for Phase1 2021 detector for Heavy Ion - 'phase1_2021_realistic_hi' : '120X_mcRun3_2021_realistic_HI_v3', + 'phase1_2021_realistic_hi' : '121X_mcRun3_2021_realistic_HI_v7', # GlobalTag for MC production with realistic conditions for Phase1 2023 - 'phase1_2023_realistic' : '120X_mcRun3_2023_realistic_v4', # GT containing realistic conditions for Phase1 2023 + 'phase1_2023_realistic' : '121X_mcRun3_2023_realistic_v6', # GlobalTag for MC production with realistic conditions for Phase1 2024 - 'phase1_2024_realistic' : '120X_mcRun3_2024_realistic_v4', # GT containing realistic conditions for Phase1 2024 + 'phase1_2024_realistic' : '121X_mcRun3_2024_realistic_v6', # GlobalTag for MC production with realistic conditions for Phase2 - 'phase2_realistic' : '113X_mcRun4_realistic_v7' + 'phase2_realistic' : '121X_mcRun4_realistic_v4' } aliases = { diff --git a/Configuration/AlCa/python/autoPCL.py b/Configuration/AlCa/python/autoPCL.py index e2825741730a0..5d5a06f7ecd14 100644 --- a/Configuration/AlCa/python/autoPCL.py +++ b/Configuration/AlCa/python/autoPCL.py @@ -8,5 +8,6 @@ 'PromptCalibProdSiStripGainsAAG' : 'SiStripGainsAAG', 'PromptCalibProdLumiPCC': 'LumiPCC', 'PromptCalibProdSiPixel' : 'SiPixelQuality', - 'PromptCalibProdPPS' : 'PPSTimingCalibration' + 'PromptCalibProdPPS' : 'PPSTimingCalibration', + 'PromptCalibProdPPSDiamondSampic' : 'PPSDiamondSampicTimingCalibration' } diff --git a/Configuration/Applications/python/ConfigBuilder.py b/Configuration/Applications/python/ConfigBuilder.py index ab050086b91ab..77ee5c889eee3 100644 --- a/Configuration/Applications/python/ConfigBuilder.py +++ b/Configuration/Applications/python/ConfigBuilder.py @@ -1151,9 +1151,9 @@ def inGeometryKeys(opt): self.REDIGIDefaultSeq=self.DIGIDefaultSeq # for alca, skims, etc - def addExtraStream(self,name,stream,workflow='full'): + def addExtraStream(self, name, stream, workflow='full', cppType="PoolOutputModule"): # define output module and go from there - output = cms.OutputModule("PoolOutputModule") + output = cms.OutputModule(cppType) if stream.selectEvents.parameters_().__len__()!=0: output.SelectEvents = stream.selectEvents else: @@ -1187,8 +1187,9 @@ def doNotInlineEventContent(instance,label = "process."+stream.content+".outputC if self._options.filtername: output.dataset.filterName= cms.untracked.string(self._options.filtername+"_"+stream.name) - #add an automatic flushing to limit memory consumption - output.eventAutoFlushCompressedSize=cms.untracked.int32(5*1024*1024) + if cppType == "PoolOutputModule": + #add an automatic flushing to limit memory consumption + output.eventAutoFlushCompressedSize=cms.untracked.int32(5*1024*1024) if workflow in ("producers,full"): if isinstance(stream.paths,tuple): @@ -1275,7 +1276,7 @@ def prepare_ALCA(self, sequence = None, workflow = 'full'): # decide which ALCA paths to use alcaList = sequence.split("+") maxLevel=0 - from Configuration.AlCa.autoAlca import autoAlca + from Configuration.AlCa.autoAlca import autoAlca, AlCaNoConcurrentLumis # support @X from autoAlca.py, and recursion support: i.e T0:@Mu+@EG+... self.expandMapping(alcaList,autoAlca) self.AlCaPaths=[] @@ -1283,10 +1284,16 @@ def prepare_ALCA(self, sequence = None, workflow = 'full'): alcastream = getattr(alcaConfig,name) shortName = name.replace('ALCARECOStream','') if shortName in alcaList and isinstance(alcastream,cms.FilteredStream): - output = self.addExtraStream(name,alcastream, workflow = workflow) + if shortName in AlCaNoConcurrentLumis: + print("Setting numberOfConcurrentLuminosityBlocks=1 because of AlCa sequence {}".format(shortName)) + self._options.nConcurrentLumis = "1" + self._options.nConcurrentIOVs = "1" + isNano = (alcastream.dataTier == "NANOAOD") + output = self.addExtraStream(name, alcastream, workflow=workflow, + cppType=("NanoAODOutputModule" if isNano else "PoolOutputModule")) self.executeAndRemember('process.ALCARECOEventContent.outputCommands.extend(process.OutALCARECO'+shortName+'_noDrop.outputCommands)') self.AlCaPaths.append(shortName) - if 'DQM' in alcaList: + if 'DQM' in alcaList and not isNano: if not self._options.inlineEventContent and hasattr(self.process,name): self.executeAndRemember('process.' + name + '.outputCommands.append("keep *_MEtoEDMConverter_*_*")') else: @@ -1364,6 +1371,8 @@ def prepare_GEN(self, sequence = None): raise Exception("Neither gen fragment of input files provided: this is an inconsistent GEN step configuration") if not loadFailure: + from Configuration.Generator.concurrentLumisDisable import noConcurrentLumiGenerators + generatorModule=sys.modules[loadFragment] genModules=generatorModule.__dict__ #remove lhe producer module since this should have been @@ -1381,6 +1390,10 @@ def prepare_GEN(self, sequence = None): theObject = getattr(generatorModule,name) if isinstance(theObject, cmstypes._Module): self._options.inlineObjets=name+','+self._options.inlineObjets + if theObject.type_() in noConcurrentLumiGenerators: + print("Setting numberOfConcurrentLuminosityBlocks=1 because of generator {}".format(theObject.type_())) + self._options.nConcurrentLumis = "1" + self._options.nConcurrentIOVs = "1" elif isinstance(theObject, cms.Sequence) or isinstance(theObject, cmstypes.ESProducer): self._options.inlineObjets+=','+name diff --git a/Configuration/Applications/python/cmsDriverOptions.py b/Configuration/Applications/python/cmsDriverOptions.py index 6d3643231cdb5..ba8fc6e6442ed 100755 --- a/Configuration/Applications/python/cmsDriverOptions.py +++ b/Configuration/Applications/python/cmsDriverOptions.py @@ -72,13 +72,6 @@ def OptionsFromItems(items): #now adjust the given parameters before passing it to the ConfigBuilder - # concurrency options - nStreams = options.nStreams if options.nStreams != '0' else options.nThreads - if options.nConcurrentLumis == '0': - options.nConcurrentLumis = '1' if nStreams == '1' else '2' - if options.nConcurrentIOVs == '0': - options.nConcurrentIOVs = options.nConcurrentLumis - #trail a "/" to dirin and dirout if options.dirin!='' and (not options.dirin.endswith('/')): options.dirin+='/' if options.dirout!='' and (not options.dirout.endswith('/')): options.dirout+='/' diff --git a/Configuration/DataProcessing/test/run_CfgTest.sh b/Configuration/DataProcessing/test/run_CfgTest.sh index ad04c1d7c2db6..9d09dbb9e99a3 100755 --- a/Configuration/DataProcessing/test/run_CfgTest.sh +++ b/Configuration/DataProcessing/test/run_CfgTest.sh @@ -21,6 +21,12 @@ do runTest "${LOCAL_TEST_DIR}/RunAlcaHarvesting.py --scenario $scenario --lfn /store/whatever --dataset /A/B/C --global-tag GLOBALTAG --workflows=BeamSpotByRun,BeamSpotByLumi,SiStripQuality" done +declare -a arr=("cosmicsEra_Run2_2018" "cosmicsHybridEra_Run2_2018" "cosmicsEra_Run3") +for scenario in "${arr[@]}" +do + runTest "${LOCAL_TEST_DIR}/RunExpressProcessing.py --scenario $scenario --global-tag GLOBALTAG --lfn /store/whatever --fevt --dqmio --alcareco SiStripCalCosmicsNano " +done + declare -a arr=("HeavyIonsEra_Run2_2018") for scenario in "${arr[@]}" do diff --git a/Configuration/Eras/python/Modifier_run3_nanoAOD_devel_cff.py b/Configuration/Eras/python/Modifier_run3_nanoAOD_devel_cff.py new file mode 100644 index 0000000000000..29aa657695945 --- /dev/null +++ b/Configuration/Eras/python/Modifier_run3_nanoAOD_devel_cff.py @@ -0,0 +1,3 @@ +import FWCore.ParameterSet.Config as cms + +run3_nanoAOD_devel = cms.Modifier() diff --git a/Configuration/EventContent/python/AlCaRecoOutput_cff.py b/Configuration/EventContent/python/AlCaRecoOutput_cff.py index 6c8f7a465e64a..4c5fdbf6c04dd 100644 --- a/Configuration/EventContent/python/AlCaRecoOutput_cff.py +++ b/Configuration/EventContent/python/AlCaRecoOutput_cff.py @@ -53,6 +53,7 @@ from CalibTracker.SiPixelQuality.ALCARECOSiPixelCalZeroBias_Output_cff import * # AlCaReco for tracker calibration using Cosmics events from Calibration.TkAlCaRecoProducers.ALCARECOSiStripCalCosmics_Output_cff import * +from Calibration.TkAlCaRecoProducers.ALCARECOSiStripCalCosmicsNano_Output_cff import * from Calibration.TkAlCaRecoProducers.ALCARECOSiPixelCalCosmics_Output_cff import * # AlCaReco for tracker based alignment using beam halo @@ -91,6 +92,7 @@ from Calibration.HcalAlCaRecoProducers.ALCARECOHcalCalIsoTrk_Output_cff import * from Calibration.HcalAlCaRecoProducers.ALCARECOHcalCalIsoTrkFilter_Output_cff import * from Calibration.HcalAlCaRecoProducers.ALCARECOHcalCalIsoTrkNoHLT_Output_cff import * +from Calibration.HcalAlCaRecoProducers.ALCARECOHcalCalIsoTrkProducerFilter_Output_cff import * # HCAL calibration with iterative phi sym from Calibration.HcalAlCaRecoProducers.ALCARECOHcalCalIterativePhiSym_Output_cff import * # HCAL calibration with min.bias @@ -107,6 +109,7 @@ from Calibration.HcalAlCaRecoProducers.ALCARECOHcalCalIsolatedBunchSelector_Output_cff import * # HCAL calibration with muons (HB/HE) from Calibration.HcalAlCaRecoProducers.ALCARECOHcalCalHBHEMuonFilter_Output_cff import * +from Calibration.HcalAlCaRecoProducers.ALCARECOHcalCalHBHEMuonProducerFilter_Output_cff import * # HCAL calibration with muons from low PU (HB/HE) from Calibration.HcalAlCaRecoProducers.ALCARECOHcalCalLowPUHBHEMuonFilter_Output_cff import * # HCAL calibration with muons (HE) @@ -143,6 +146,7 @@ ############################################################### from CalibPPS.TimingCalibration.ALCARECOPPSCalTrackBasedSel_Output_cff import * from CalibPPS.TimingCalibration.ALCARECOPPSTimingCalib_Output_cff import * +from CalibPPS.TimingCalibration.ALCARECOPPSDiamondSampicTimingCalib_Output_cff import * ############################################################### # stream for prompt-calibration @ Tier0 diff --git a/Configuration/Generator/python/ADDMonoJet_13TeV_d3MD3_TuneCUETP8M1_cfi.py b/Configuration/Generator/python/ADDMonoJet_13TeV_d3MD3_TuneCUETP8M1_cfi.py index eccfa2766d29a..ca1b2c1ebe96a 100644 --- a/Configuration/Generator/python/ADDMonoJet_13TeV_d3MD3_TuneCUETP8M1_cfi.py +++ b/Configuration/Generator/python/ADDMonoJet_13TeV_d3MD3_TuneCUETP8M1_cfi.py @@ -1,7 +1,7 @@ import FWCore.ParameterSet.Config as cms from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", pythiaPylistVerbosity = cms.untracked.int32(1), filterEfficiency = cms.untracked.double(1.0), pythiaHepMCVerbosity = cms.untracked.bool(False), diff --git a/Configuration/Generator/python/ADDMonoJet_13TeV_d3MD3_cfi.py b/Configuration/Generator/python/ADDMonoJet_13TeV_d3MD3_cfi.py index ccf56b72f7b2d..06c8d611ce7d0 100644 --- a/Configuration/Generator/python/ADDMonoJet_13TeV_d3MD3_cfi.py +++ b/Configuration/Generator/python/ADDMonoJet_13TeV_d3MD3_cfi.py @@ -1,5 +1,5 @@ import FWCore.ParameterSet.Config as cms -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", pythiaPylistVerbosity = cms.untracked.int32(1), filterEfficiency = cms.untracked.double(1.0), pythiaHepMCVerbosity = cms.untracked.bool(False), diff --git a/Configuration/Generator/python/ADDMonoJet_8TeV_d3MD3_TuneCUETP8M1_cfi.py b/Configuration/Generator/python/ADDMonoJet_8TeV_d3MD3_TuneCUETP8M1_cfi.py index 8d0bd20e3f1c1..286fab3da0bf2 100644 --- a/Configuration/Generator/python/ADDMonoJet_8TeV_d3MD3_TuneCUETP8M1_cfi.py +++ b/Configuration/Generator/python/ADDMonoJet_8TeV_d3MD3_TuneCUETP8M1_cfi.py @@ -1,7 +1,7 @@ import FWCore.ParameterSet.Config as cms from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", pythiaPylistVerbosity = cms.untracked.int32(1), filterEfficiency = cms.untracked.double(1.0), pythiaHepMCVerbosity = cms.untracked.bool(False), diff --git a/Configuration/Generator/python/AMPT_PPb_5020GeV_MinimumBias_ExtGen_cfi.py b/Configuration/Generator/python/AMPT_PPb_5020GeV_MinimumBias_ExtGen_cfi.py new file mode 100644 index 0000000000000..6e65e6b357683 --- /dev/null +++ b/Configuration/Generator/python/AMPT_PPb_5020GeV_MinimumBias_ExtGen_cfi.py @@ -0,0 +1,57 @@ +import FWCore.ParameterSet.Config as cms + +_generator = cms.EDFilter("AMPTGeneratorFilter", + diquarky = cms.double(0.0), + diquarkx = cms.double(0.0), + diquarkpx = cms.double(7.0), + ntmax = cms.int32(1000), + dpcoal = cms.double(1000000.0), + diquarkembedding = cms.int32(0), + maxmiss = cms.int32(1000), + ktkick = cms.int32(1), + mu = cms.double(3.2264), + quenchingpar = cms.double(2.0), + popcornpar = cms.double(1.0), + drcoal = cms.double(1000000.0), + amptmode = cms.int32(1), + izpc = cms.int32(0), + popcornmode = cms.bool(True), + minijetpt = cms.double(-7.0), + ks0decay = cms.bool(False), + alpha = cms.double(0.47140452), + dt = cms.double(0.2), + rotateEventPlane = cms.bool(True), + shadowingmode = cms.bool(True), + diquarkpy = cms.double(0.0), + deuteronfactor = cms.int32(5), + stringFragB = cms.double(0.9),#default value in Hijing. Good for pA + quenchingmode = cms.bool(False), + stringFragA = cms.double(0.5), + deuteronmode = cms.int32(0), + doInitialAndFinalRadiation = cms.int32(3), + phidecay = cms.bool(True), + deuteronxsec = cms.int32(1), + pthard = cms.double(2.0), + firstRun = cms.untracked.uint32(1), + frame = cms.string('CMS'), + targ = cms.string('P'), + izp = cms.int32(82), + bMin = cms.double(0), + firstEvent = cms.untracked.uint32(1), + izt = cms.int32(1), + proj = cms.string('A'), + comEnergy = cms.double(5020.0), + iat = cms.int32(1), + bMax = cms.double(15), + iap = cms.int32(208) +) + +from GeneratorInterface.Core.ExternalGeneratorFilter import ExternalGeneratorFilter +generator = ExternalGeneratorFilter(_generator) + +configurationMetadata = cms.untracked.PSet( + version = cms.untracked.string('$Revision$'), + name = cms.untracked.string('$Source$'), + annotation = cms.untracked.string('AMPT PPb 5020 GeV Minimum Bias') +) + diff --git a/Configuration/Generator/python/BsToMuMu_forSTEAM_13TeV_ExtGen_cfi.py b/Configuration/Generator/python/BsToMuMu_forSTEAM_13TeV_ExtGen_cfi.py new file mode 100644 index 0000000000000..936788c9dcd3e --- /dev/null +++ b/Configuration/Generator/python/BsToMuMu_forSTEAM_13TeV_ExtGen_cfi.py @@ -0,0 +1,68 @@ +import FWCore.ParameterSet.Config as cms +from Configuration.Generator.Pythia8CommonSettings_cfi import * +from Configuration.Generator.MCTunes2017.PythiaCP5Settings_cfi import * +from GeneratorInterface.EvtGenInterface.EvtGenSetting_cff import * + +_generator = cms.EDFilter("Pythia8GeneratorFilter", + comEnergy = cms.double(13000.0), + crossSection = cms.untracked.double(54000000000), + filterEfficiency = cms.untracked.double(3.0e-4), + pythiaHepMCVerbosity = cms.untracked.bool(False), + maxEventsToPrint = cms.untracked.int32(0), + pythiaPylistVerbosity = cms.untracked.int32(0), + ExternalDecays = cms.PSet( + #using alternative name for decayer + EvtGen1 = cms.untracked.PSet( + #uses latest evt and decay tables from evtgen + decay_table = cms.string('GeneratorInterface/EvtGenInterface/data/DECAY_NOLONGLIFE.DEC'), + particle_property_file = cms.FileInPath('GeneratorInterface/EvtGenInterface/data/evt.pdl'), + convertPythiaCodes = cms.untracked.bool(False), + #here we will use the user.dec store in the release + user_decay_file = cms.vstring('GeneratorInterface/ExternalDecays/data/Bs_mumu.dec'), + list_forced_decays = cms.vstring('MyB_s0','Myanti-B_s0'), + operates_on_particles = cms.vint32() + ), + parameterSets = cms.vstring('EvtGen1') + ), + PythiaParameters = cms.PSet( + pythia8CommonSettingsBlock, + pythia8CP5SettingsBlock, + processParameters = cms.vstring( + #filter of a b-quark before hadronizing, and use a better data-like process + 'PTFilter:filter = on', + 'PTFilter:quarkToFilter = 5', + 'PTFilter:scaleToFilter = 1.0', + 'SoftQCD:nonDiffractive = on', + ), + parameterSets = cms.vstring('pythia8CommonSettings', + 'pythia8CP5Settings', + 'processParameters', + ) + ) +) + +from GeneratorInterface.Core.ExternalGeneratorFilter import ExternalGeneratorFilter +generator = ExternalGeneratorFilter(_generator) + +generator.PythiaParameters.processParameters.extend(EvtGenExtraParticles) + +MuMuFilter = cms.EDFilter("MCParticlePairFilter", + Status = cms.untracked.vint32(1, 1), + MinPt = cms.untracked.vdouble(3., 3.), + MaxEta = cms.untracked.vdouble(2.5, 2.5), + MinEta = cms.untracked.vdouble(-2.5, -2.5), + ParticleCharge = cms.untracked.int32(-1), + ParticleID1 = cms.untracked.vint32(13,-13), + ) + +# -- Require Muon from Bs +MuFilter = cms.EDFilter("PythiaFilter", + Status = cms.untracked.int32(1), + MotherID = cms.untracked.int32(531), + MinPt = cms.untracked.double(3.), + ParticleID = cms.untracked.int32(13), + MaxEta = cms.untracked.double(2.5), + MinEta = cms.untracked.double(-2.5) + ) + +ProductionFilterSequence = cms.Sequence(generator*MuMuFilter*MuFilter) diff --git a/Configuration/Generator/python/BuToJPsiPrimePhiToJPsiPiKK_14TeV_TuneCP5_pythia8_cfi.py b/Configuration/Generator/python/BuToJPsiPrimeKToJPsiPiPiK_14TeV_TuneCP5_pythia8_cfi.py similarity index 100% rename from Configuration/Generator/python/BuToJPsiPrimePhiToJPsiPiKK_14TeV_TuneCP5_pythia8_cfi.py rename to Configuration/Generator/python/BuToJPsiPrimeKToJPsiPiPiK_14TeV_TuneCP5_pythia8_cfi.py diff --git a/Configuration/Generator/python/BuToKstarJPsiToMuMu_forSTEAM_13TeV_ExtGen_cfi.py b/Configuration/Generator/python/BuToKstarJPsiToMuMu_forSTEAM_13TeV_ExtGen_cfi.py new file mode 100644 index 0000000000000..7960f0138482d --- /dev/null +++ b/Configuration/Generator/python/BuToKstarJPsiToMuMu_forSTEAM_13TeV_ExtGen_cfi.py @@ -0,0 +1,106 @@ +import FWCore.ParameterSet.Config as cms +from Configuration.Generator.Pythia8CommonSettings_cfi import * +from Configuration.Generator.MCTunes2017.PythiaCP5Settings_cfi import * +from GeneratorInterface.EvtGenInterface.EvtGenSetting_cff import * + +_generator = cms.EDFilter("Pythia8GeneratorFilter", + pythiaPylistVerbosity = cms.untracked.int32(0), + pythiaHepMCVerbosity = cms.untracked.bool(False), + comEnergy = cms.double(13000.0), + maxEventsToPrint = cms.untracked.int32(0), + ExternalDecays = cms.PSet( + EvtGen130 = cms.untracked.PSet( + #uses latest evt and decay tables from evtgen + decay_table = cms.string('GeneratorInterface/EvtGenInterface/data/DECAY_NOLONGLIFE.DEC'), + particle_property_file = cms.FileInPath('GeneratorInterface/EvtGenInterface/data/evt.pdl'), + convertPythiaCodes = cms.untracked.bool(False), + #user_decay_file = cms.vstring('GeneratorInterface/ExternalDecays/data/Bu_Kstarmumu_Kspi.dec'), + #content was dump in the embed string below. This should test this feature. + list_forced_decays = cms.vstring('MyB+','MyB-'), + operates_on_particles = cms.vint32(), + user_decay_embedded= cms.vstring( + '# This is the decay file for the decay B+ -> MU+ MU- K*+(-> Ks pi+)', + '#', + '# Descriptor: [B+ -> mu+ mu- {,gamma} {,gamma} (K*+ -> Ks pi+)]cc', + '#', + '# NickName:', + '#', + '# Physics: Includes radiative mode', + '#', + '# Tested: Yes', + '# By: K. Ulmer', + '# Date: 2-26-08', + '#', + 'Alias MyB+ B+', + 'Alias MyB- B-', + 'ChargeConj MyB+ MyB-', + 'Alias MyK*+ K*+', + 'Alias MyK*- K*-', + 'ChargeConj MyK*+ MyK*-', + 'Alias MyK_S0 K_S0', + 'ChargeConj MyK_S0 MyK_S0', + '#', + 'Decay MyB+', + ' 1.000 MyK*+ mu+ mu- BTOSLLBALL;', + 'Enddecay', + 'CDecay MyB-', + '#', + 'Decay MyK*+', + ' 1.000 MyK_S0 pi+ VSS;', + 'Enddecay', + 'CDecay MyK*-', + '#', + 'Decay MyK_S0', + ' 1.000 pi+ pi- PHSP;', + 'Enddecay', + 'End' + ), + ), + parameterSets = cms.vstring('EvtGen130') + ), + PythiaParameters = cms.PSet( + pythia8CommonSettingsBlock, + pythia8CP5SettingsBlock, + processParameters = cms.vstring( + 'HardQCD:gg2bbbar = on ', + 'HardQCD:qqbar2bbbar = on ', + 'HardQCD:hardbbbar = on', + 'PhaseSpace:pTHatMin = 20.', + ), + parameterSets = cms.vstring('pythia8CommonSettings', + 'pythia8CP5Settings', + 'processParameters', + ) + ) + ) + +from GeneratorInterface.Core.ExternalGeneratorFilter import ExternalGeneratorFilter +generator = ExternalGeneratorFilter(_generator) + +generator.PythiaParameters.processParameters.extend(EvtGenExtraParticles) + +configurationMetadata = cms.untracked.PSet( + version = cms.untracked.string('$Revision: 1.1 $'), + name = cms.untracked.string('$Source: Configuration/Generator/python/BuToKstarMuMu_forSTEAM_13TeV_cfi.py $'), + annotation = cms.untracked.string('Summer14: Pythia8+EvtGen130 generation of Bu --> K* Mu+Mu-, 13TeV, Tune CP5') + ) + +########### +# Filters # +########### +# Filter only pp events which produce a B+: +bufilter = cms.EDFilter("PythiaFilter", ParticleID = cms.untracked.int32(521)) + +# Filter on final state muons +mumugenfilter = cms.EDFilter("MCParticlePairFilter", + Status = cms.untracked.vint32(1, 1), + MinPt = cms.untracked.vdouble(2.8, 2.8), + MinP = cms.untracked.vdouble(2.8, 2.8), + MaxEta = cms.untracked.vdouble(2.3, 2.3), + MinEta = cms.untracked.vdouble(-2.3, -2.3), + ParticleID1 = cms.untracked.vint32(13,-13), + ParticleID2 = cms.untracked.vint32(13,-13) + ) + + +ProductionFilterSequence = cms.Sequence(generator*bufilter*mumugenfilter) diff --git a/Configuration/Generator/python/BulkG_M1200_narrow_2L2Q_LHE_13TeV_cff.py b/Configuration/Generator/python/BulkG_M1200_narrow_2L2Q_LHE_13TeV_cff.py index 012fbd5cd4e4e..243ff1eb70539 100644 --- a/Configuration/Generator/python/BulkG_M1200_narrow_2L2Q_LHE_13TeV_cff.py +++ b/Configuration/Generator/python/BulkG_M1200_narrow_2L2Q_LHE_13TeV_cff.py @@ -10,5 +10,6 @@ nEvents = cms.untracked.uint32(5000), numberOfParameters = cms.uint32(1), outputFile = cms.string('cmsgrid_final.lhe'), - scriptName = cms.FileInPath('GeneratorInterface/LHEInterface/data/run_generic_tarball_cvmfs.sh') + scriptName = cms.FileInPath('GeneratorInterface/LHEInterface/data/run_generic_tarball_cvmfs.sh'), + generateConcurrently = cms.untracked.bool(True) ) diff --git a/Configuration/Generator/python/DYToLL_M-50_13TeV_pythia8_cff.py b/Configuration/Generator/python/DYToLL_M-50_13TeV_pythia8_cff.py index ad1ceb86cec57..40613ea13825b 100644 --- a/Configuration/Generator/python/DYToLL_M-50_13TeV_pythia8_cff.py +++ b/Configuration/Generator/python/DYToLL_M-50_13TeV_pythia8_cff.py @@ -5,7 +5,7 @@ -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", comEnergy = cms.double(13000.0), crossSection = cms.untracked.double(6.44), filterEfficiency = cms.untracked.double(1), diff --git a/Configuration/Generator/python/DYToLL_M-50_14TeV_pythia8_cff.py b/Configuration/Generator/python/DYToLL_M-50_14TeV_pythia8_cff.py index 2520f4ef884b5..0b101f26d9500 100644 --- a/Configuration/Generator/python/DYToLL_M-50_14TeV_pythia8_cff.py +++ b/Configuration/Generator/python/DYToLL_M-50_14TeV_pythia8_cff.py @@ -5,7 +5,7 @@ -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", comEnergy = cms.double(14000.0), crossSection = cms.untracked.double(6.44), filterEfficiency = cms.untracked.double(1), diff --git a/Configuration/Generator/python/DYToll012Jets_5f_LO_MLM_Madgraph_LHE_13TeV_cff.py b/Configuration/Generator/python/DYToll012Jets_5f_LO_MLM_Madgraph_LHE_13TeV_cff.py index 67fdc7fd16773..5a8ce265714e6 100644 --- a/Configuration/Generator/python/DYToll012Jets_5f_LO_MLM_Madgraph_LHE_13TeV_cff.py +++ b/Configuration/Generator/python/DYToll012Jets_5f_LO_MLM_Madgraph_LHE_13TeV_cff.py @@ -5,5 +5,6 @@ outputFile = cms.string("cmsgrid_final.lhe"), numberOfParameters = cms.uint32(4), args = cms.vstring('/cvmfs/cms.cern.ch/phys_generator/gridpacks/UL/13TeV/madgraph/V5_2.6.5/dyellell012j_5f_LO_MLM/dyellell012j_5f_LO_MLM_slc6_amd64_gcc630_CMSSW_9_3_16_tarball.tar.xz','false','slc6_amd64_gcc630','CMSSW_9_3_16'), - nEvents = cms.untracked.uint32(10) + nEvents = cms.untracked.uint32(10), + generateConcurrently = cms.untracked.bool(True) ) diff --git a/Configuration/Generator/python/DarkSUSY_mH_125_mN1_60_mGammaD_10_cT_10_Madgraph_LHE_13TeV_cfi.py b/Configuration/Generator/python/DarkSUSY_mH_125_mN1_60_mGammaD_10_cT_10_Madgraph_LHE_13TeV_cfi.py index 26a43f44634af..4fc71bdfcbcdf 100644 --- a/Configuration/Generator/python/DarkSUSY_mH_125_mN1_60_mGammaD_10_cT_10_Madgraph_LHE_13TeV_cfi.py +++ b/Configuration/Generator/python/DarkSUSY_mH_125_mN1_60_mGammaD_10_cT_10_Madgraph_LHE_13TeV_cfi.py @@ -5,7 +5,8 @@ nEvents = cms.untracked.uint32(5000), numberOfParameters = cms.uint32(1), outputFile = cms.string('cmsgrid_final.lhe'), - scriptName = cms.FileInPath('GeneratorInterface/LHEInterface/data/run_generic_tarball_cvmfs.sh') + scriptName = cms.FileInPath('GeneratorInterface/LHEInterface/data/run_generic_tarball_cvmfs.sh'), + generateConcurrently = cms.untracked.bool(True) ) #Link to datacards: diff --git a/Configuration/Generator/python/DisplacedSUSY_stopToBottom_M_300_1000mm_TuneCUETP8M1_13TeV_pythia8_cff.py b/Configuration/Generator/python/DisplacedSUSY_stopToBottom_M_300_1000mm_TuneCUETP8M1_13TeV_pythia8_cff.py index 064453f26450b..2dad86ae027a4 100644 --- a/Configuration/Generator/python/DisplacedSUSY_stopToBottom_M_300_1000mm_TuneCUETP8M1_13TeV_pythia8_cff.py +++ b/Configuration/Generator/python/DisplacedSUSY_stopToBottom_M_300_1000mm_TuneCUETP8M1_13TeV_pythia8_cff.py @@ -757,7 +757,7 @@ from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", pythiaPylistVerbosity = cms.untracked.int32(0), filterEfficiency = cms.untracked.double(1), pythiaHepMCVerbosity = cms.untracked.bool(False), diff --git a/Configuration/Generator/python/DisplacedSUSY_stopToBottom_M_800_500mm_TuneCP5_13TeV_pythia8_cff.py b/Configuration/Generator/python/DisplacedSUSY_stopToBottom_M_800_500mm_TuneCP5_13TeV_pythia8_cff.py index cf7e9ec6f0473..ad9f657e7462d 100644 --- a/Configuration/Generator/python/DisplacedSUSY_stopToBottom_M_800_500mm_TuneCP5_13TeV_pythia8_cff.py +++ b/Configuration/Generator/python/DisplacedSUSY_stopToBottom_M_800_500mm_TuneCP5_13TeV_pythia8_cff.py @@ -758,7 +758,7 @@ from Configuration.Generator.MCTunes2017.PythiaCP5Settings_cfi import * from Configuration.Generator.PSweightsPythia.PythiaPSweightsSettings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", pythiaPylistVerbosity = cms.untracked.int32(0), filterEfficiency = cms.untracked.double(1), pythiaHepMCVerbosity = cms.untracked.bool(False), diff --git a/Configuration/Generator/python/DisplacedSUSY_stopToBottom_M_800_500mm_TuneCP5_14TeV_pythia8_cff.py b/Configuration/Generator/python/DisplacedSUSY_stopToBottom_M_800_500mm_TuneCP5_14TeV_pythia8_cff.py index d52aec8471eb3..8eecd4c64736a 100644 --- a/Configuration/Generator/python/DisplacedSUSY_stopToBottom_M_800_500mm_TuneCP5_14TeV_pythia8_cff.py +++ b/Configuration/Generator/python/DisplacedSUSY_stopToBottom_M_800_500mm_TuneCP5_14TeV_pythia8_cff.py @@ -758,7 +758,7 @@ from Configuration.Generator.MCTunes2017.PythiaCP5Settings_cfi import * from Configuration.Generator.PSweightsPythia.PythiaPSweightsSettings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", pythiaPylistVerbosity = cms.untracked.int32(0), filterEfficiency = cms.untracked.double(1), pythiaHepMCVerbosity = cms.untracked.bool(False), diff --git a/Configuration/Generator/python/EtaBToJpsiJpsi_14TeV_TuneCP5_pythia8_cfi.py b/Configuration/Generator/python/EtaBToJpsiJpsi_14TeV_TuneCP5_pythia8_cfi.py index f49837db3d6fe..92f6cdec4da68 100644 --- a/Configuration/Generator/python/EtaBToJpsiJpsi_14TeV_TuneCP5_pythia8_cfi.py +++ b/Configuration/Generator/python/EtaBToJpsiJpsi_14TeV_TuneCP5_pythia8_cfi.py @@ -3,7 +3,7 @@ from Configuration.Generator.MCTunes2017.PythiaCP5Settings_cfi import * from GeneratorInterface.EvtGenInterface.EvtGenSetting_cff import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", maxEventsToPrint = cms.untracked.int32(1), pythiaPylistVerbosity = cms.untracked.int32(1), filterEfficiency = cms.untracked.double(0.4045), diff --git a/Configuration/Generator/python/EtaBToJpsiJpsi_forSTEAM_TuneCUEP8M1_13TeV_cfi.py b/Configuration/Generator/python/EtaBToJpsiJpsi_forSTEAM_TuneCUEP8M1_13TeV_cfi.py index 1f887fc068ed4..8b827afd949a7 100644 --- a/Configuration/Generator/python/EtaBToJpsiJpsi_forSTEAM_TuneCUEP8M1_13TeV_cfi.py +++ b/Configuration/Generator/python/EtaBToJpsiJpsi_forSTEAM_TuneCUEP8M1_13TeV_cfi.py @@ -2,7 +2,7 @@ import FWCore.ParameterSet.Config as cms from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", maxEventsToPrint = cms.untracked.int32(1), pythiaPylistVerbosity = cms.untracked.int32(1), filterEfficiency = cms.untracked.double(1.0), diff --git a/Configuration/Generator/python/GGHZZ4L_JHUGen_Pow_NNPDF30_LHE_13TeV_cff.py b/Configuration/Generator/python/GGHZZ4L_JHUGen_Pow_NNPDF30_LHE_13TeV_cff.py index 256dad0eef046..d146b81a64f0b 100644 --- a/Configuration/Generator/python/GGHZZ4L_JHUGen_Pow_NNPDF30_LHE_13TeV_cff.py +++ b/Configuration/Generator/python/GGHZZ4L_JHUGen_Pow_NNPDF30_LHE_13TeV_cff.py @@ -9,6 +9,7 @@ nEvents = cms.untracked.uint32(5000), numberOfParameters = cms.uint32(1), outputFile = cms.string('cmsgrid_final.lhe'), - scriptName = cms.FileInPath('GeneratorInterface/LHEInterface/data/run_generic_tarball_cvmfs.sh') + scriptName = cms.FileInPath('GeneratorInterface/LHEInterface/data/run_generic_tarball_cvmfs.sh'), + generateConcurrently = cms.untracked.bool(True) ) diff --git a/Configuration/Generator/python/GGHZZ4L_JHUGen_Pow_NNPDF30_LHE_13TeV_cfi.py b/Configuration/Generator/python/GGHZZ4L_JHUGen_Pow_NNPDF30_LHE_13TeV_cfi.py index be19bfb780025..3fbff127b2a35 100644 --- a/Configuration/Generator/python/GGHZZ4L_JHUGen_Pow_NNPDF30_LHE_13TeV_cfi.py +++ b/Configuration/Generator/python/GGHZZ4L_JHUGen_Pow_NNPDF30_LHE_13TeV_cfi.py @@ -12,7 +12,8 @@ nEvents = cms.untracked.uint32(5000), numberOfParameters = cms.uint32(1), outputFile = cms.string('cmsgrid_final.lhe'), - scriptName = cms.FileInPath('GeneratorInterface/LHEInterface/data/run_generic_tarball_cvmfs.sh') + scriptName = cms.FileInPath('GeneratorInterface/LHEInterface/data/run_generic_tarball_cvmfs.sh'), + generateConcurrently = cms.untracked.bool(True) ) diff --git a/Configuration/Generator/python/GGToHtautau_13TeV_pythia8_cff.py b/Configuration/Generator/python/GGToHtautau_13TeV_pythia8_cff.py index 6f2110b9288e7..489ae93671bbe 100644 --- a/Configuration/Generator/python/GGToHtautau_13TeV_pythia8_cff.py +++ b/Configuration/Generator/python/GGToHtautau_13TeV_pythia8_cff.py @@ -5,7 +5,7 @@ -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", comEnergy = cms.double(13000.0), crossSection = cms.untracked.double(6.44), filterEfficiency = cms.untracked.double(1), diff --git a/Configuration/Generator/python/GGToHtautau_13TeV_pythia8_taupinu_cff.py b/Configuration/Generator/python/GGToHtautau_13TeV_pythia8_taupinu_cff.py index 3fb6ee3d3ed90..003623718f3ce 100644 --- a/Configuration/Generator/python/GGToHtautau_13TeV_pythia8_taupinu_cff.py +++ b/Configuration/Generator/python/GGToHtautau_13TeV_pythia8_taupinu_cff.py @@ -2,7 +2,7 @@ -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", comEnergy = cms.double(13000.0), crossSection = cms.untracked.double(6.44), filterEfficiency = cms.untracked.double(1), diff --git a/Configuration/Generator/python/GGToHtautau_13TeV_pythia8_taurhonu_cff.py b/Configuration/Generator/python/GGToHtautau_13TeV_pythia8_taurhonu_cff.py index c71ae928fabbd..414a5e5752cac 100644 --- a/Configuration/Generator/python/GGToHtautau_13TeV_pythia8_taurhonu_cff.py +++ b/Configuration/Generator/python/GGToHtautau_13TeV_pythia8_taurhonu_cff.py @@ -5,7 +5,7 @@ -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", comEnergy = cms.double(13000.0), crossSection = cms.untracked.double(6.44), filterEfficiency = cms.untracked.double(1), diff --git a/Configuration/Generator/python/H125GGgluonfusion_13TeV_TuneCP5_cfi.py b/Configuration/Generator/python/H125GGgluonfusion_13TeV_TuneCP5_cfi.py index e5d363e086885..0a80b1448b316 100644 --- a/Configuration/Generator/python/H125GGgluonfusion_13TeV_TuneCP5_cfi.py +++ b/Configuration/Generator/python/H125GGgluonfusion_13TeV_TuneCP5_cfi.py @@ -2,7 +2,7 @@ from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.MCTunes2017.PythiaCP5Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", pythiaPylistVerbosity = cms.untracked.int32(1), # put here the efficiency of your filter (1. if no filter) filterEfficiency = cms.untracked.double(1.0), diff --git a/Configuration/Generator/python/H125GGgluonfusion_13TeV_TuneCUETP8M1_cfi.py b/Configuration/Generator/python/H125GGgluonfusion_13TeV_TuneCUETP8M1_cfi.py index e74b47238fa93..591f44f70fa17 100644 --- a/Configuration/Generator/python/H125GGgluonfusion_13TeV_TuneCUETP8M1_cfi.py +++ b/Configuration/Generator/python/H125GGgluonfusion_13TeV_TuneCUETP8M1_cfi.py @@ -2,7 +2,7 @@ from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", pythiaPylistVerbosity = cms.untracked.int32(1), # put here the efficiency of your filter (1. if no filter) filterEfficiency = cms.untracked.double(1.0), diff --git a/Configuration/Generator/python/H125GGgluonfusion_14TeV_TuneCP5_cfi.py b/Configuration/Generator/python/H125GGgluonfusion_14TeV_TuneCP5_cfi.py index b2dd1adfb5837..d7b1e94280a1b 100644 --- a/Configuration/Generator/python/H125GGgluonfusion_14TeV_TuneCP5_cfi.py +++ b/Configuration/Generator/python/H125GGgluonfusion_14TeV_TuneCP5_cfi.py @@ -2,7 +2,7 @@ from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.MCTunes2017.PythiaCP5Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", pythiaPylistVerbosity = cms.untracked.int32(1), # put here the efficiency of your filter (1. if no filter) filterEfficiency = cms.untracked.double(1.0), diff --git a/Configuration/Generator/python/H125GGgluonfusion_14TeV_TuneCUETP8M1_cfi.py b/Configuration/Generator/python/H125GGgluonfusion_14TeV_TuneCUETP8M1_cfi.py index 263fb35457362..bd7a95fe62a65 100644 --- a/Configuration/Generator/python/H125GGgluonfusion_14TeV_TuneCUETP8M1_cfi.py +++ b/Configuration/Generator/python/H125GGgluonfusion_14TeV_TuneCUETP8M1_cfi.py @@ -2,7 +2,7 @@ from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", pythiaPylistVerbosity = cms.untracked.int32(1), # put here the efficiency of your filter (1. if no filter) filterEfficiency = cms.untracked.double(1.0), diff --git a/Configuration/Generator/python/H130GGgluonfusion_14TeV_TuneCUETP8M1_cfi.py b/Configuration/Generator/python/H130GGgluonfusion_14TeV_TuneCUETP8M1_cfi.py index 904e8c2bb288b..fdbbed9c735da 100644 --- a/Configuration/Generator/python/H130GGgluonfusion_14TeV_TuneCUETP8M1_cfi.py +++ b/Configuration/Generator/python/H130GGgluonfusion_14TeV_TuneCUETP8M1_cfi.py @@ -2,7 +2,7 @@ from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", pythiaPylistVerbosity = cms.untracked.int32(1), # put here the efficiency of your filter (1. if no filter) filterEfficiency = cms.untracked.double(1.0), diff --git a/Configuration/Generator/python/H130GGgluonfusion_8TeV_TuneCUETP8M1_cfi.py b/Configuration/Generator/python/H130GGgluonfusion_8TeV_TuneCUETP8M1_cfi.py index 4c5e9b3f70022..0857d444b9873 100644 --- a/Configuration/Generator/python/H130GGgluonfusion_8TeV_TuneCUETP8M1_cfi.py +++ b/Configuration/Generator/python/H130GGgluonfusion_8TeV_TuneCUETP8M1_cfi.py @@ -2,7 +2,7 @@ from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", pythiaPylistVerbosity = cms.untracked.int32(1), # put here the efficiency of your filter (1. if no filter) filterEfficiency = cms.untracked.double(1.0), diff --git a/Configuration/Generator/python/H165WW2L_8TeV_TuneCUETP8M1_cfi.py b/Configuration/Generator/python/H165WW2L_8TeV_TuneCUETP8M1_cfi.py index 9501fc5739225..d7413e709270f 100644 --- a/Configuration/Generator/python/H165WW2L_8TeV_TuneCUETP8M1_cfi.py +++ b/Configuration/Generator/python/H165WW2L_8TeV_TuneCUETP8M1_cfi.py @@ -1,7 +1,7 @@ import FWCore.ParameterSet.Config as cms from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", pythiaPylistVerbosity = cms.untracked.int32(1), # put here the efficiency of your filter (1. if no filter) filterEfficiency = cms.untracked.double(1.0), diff --git a/Configuration/Generator/python/H200ZZ4L_13TeV_TuneCUETP8M1_cfi.py b/Configuration/Generator/python/H200ZZ4L_13TeV_TuneCUETP8M1_cfi.py index 6c163d1ab2b56..7761c64b0e97f 100644 --- a/Configuration/Generator/python/H200ZZ4L_13TeV_TuneCUETP8M1_cfi.py +++ b/Configuration/Generator/python/H200ZZ4L_13TeV_TuneCUETP8M1_cfi.py @@ -1,7 +1,7 @@ import FWCore.ParameterSet.Config as cms from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", pythiaHepMCVerbosity = cms.untracked.bool(False), maxEventsToPrint = cms.untracked.int32(0), pythiaPylistVerbosity = cms.untracked.int32(0), diff --git a/Configuration/Generator/python/H200ZZ4L_8TeV_TuneCUETP8M1_cfi.py b/Configuration/Generator/python/H200ZZ4L_8TeV_TuneCUETP8M1_cfi.py index 6de3fd6100542..61746ac6f07aa 100644 --- a/Configuration/Generator/python/H200ZZ4L_8TeV_TuneCUETP8M1_cfi.py +++ b/Configuration/Generator/python/H200ZZ4L_8TeV_TuneCUETP8M1_cfi.py @@ -1,7 +1,7 @@ import FWCore.ParameterSet.Config as cms from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", pythiaHepMCVerbosity = cms.untracked.bool(False), maxEventsToPrint = cms.untracked.int32(0), pythiaPylistVerbosity = cms.untracked.int32(0), diff --git a/Configuration/Generator/python/HSCPstop_M_200_TuneCUETP8M1_13TeV_pythia8_cff.py b/Configuration/Generator/python/HSCPstop_M_200_TuneCUETP8M1_13TeV_pythia8_cff.py index 14dc17a365e82..96100a86ed019 100644 --- a/Configuration/Generator/python/HSCPstop_M_200_TuneCUETP8M1_13TeV_pythia8_cff.py +++ b/Configuration/Generator/python/HSCPstop_M_200_TuneCUETP8M1_13TeV_pythia8_cff.py @@ -12,7 +12,7 @@ from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", pythiaPylistVerbosity = cms.untracked.int32(0), filterEfficiency = cms.untracked.double(-1), pythiaHepMCVerbosity = cms.untracked.bool(False), diff --git a/Configuration/Generator/python/Hydjet_Quenched_B12_5020GeV_ExtGen_cfi.py b/Configuration/Generator/python/Hydjet_Quenched_B12_5020GeV_ExtGen_cfi.py new file mode 100644 index 0000000000000..b4d10b568aae7 --- /dev/null +++ b/Configuration/Generator/python/Hydjet_Quenched_B12_5020GeV_ExtGen_cfi.py @@ -0,0 +1,31 @@ +import FWCore.ParameterSet.Config as cms + +from Configuration.Generator.Pyquen2015Settings_cff import * + +_generator = cms.EDFilter("HydjetGeneratorFilter", + collisionParameters5020GeV, + qgpParameters, + hydjetParameters, + hydjetMode = cms.string('kHydroQJets'), + PythiaParameters = cms.PSet(pyquenPythiaDefaultBlock, + # Quarkonia and Weak Bosons added back upon dilepton group's request. + parameterSets = cms.vstring('pythiaUESettings', + 'hydjetPythiaDefault', + 'myParameters', + 'pythiaJets', + 'pythiaPromptPhotons', + 'pythiaZjets', + 'pythiaBottomoniumNRQCD', + 'pythiaCharmoniumNRQCD', + 'pythiaQuarkoniaSettings', + 'pythiaWeakBosons' + ) + ), + cFlag = cms.int32(0), + bMin = cms.double(0), + bMax = cms.double(30), + bFixed = cms.double(12) + ) + +from GeneratorInterface.Core.ExternalGeneratorFilter import ExternalGeneratorFilter +generator = ExternalGeneratorFilter(_generator) \ No newline at end of file diff --git a/Configuration/Generator/python/InclusiveppMuX_8TeV_TuneCUETP8M1_cfi.py b/Configuration/Generator/python/InclusiveppMuX_8TeV_TuneCUETP8M1_cfi.py index 8e3920ccc6f60..e676c404a675a 100644 --- a/Configuration/Generator/python/InclusiveppMuX_8TeV_TuneCUETP8M1_cfi.py +++ b/Configuration/Generator/python/InclusiveppMuX_8TeV_TuneCUETP8M1_cfi.py @@ -2,7 +2,7 @@ from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", pythiaHepMCVerbosity = cms.untracked.bool(False), maxEventsToPrint = cms.untracked.int32(0), pythiaPylistVerbosity = cms.untracked.int32(1), diff --git a/Configuration/Generator/python/JpsiMM_13TeV_TuneCUETP8M1_cfi.py b/Configuration/Generator/python/JpsiMM_13TeV_TuneCUETP8M1_cfi.py index 37f34a5e24dbb..739a214f521bb 100644 --- a/Configuration/Generator/python/JpsiMM_13TeV_TuneCUETP8M1_cfi.py +++ b/Configuration/Generator/python/JpsiMM_13TeV_TuneCUETP8M1_cfi.py @@ -3,7 +3,7 @@ from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import * from Configuration.Generator.Pythia8CharmoniumSettings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", pythiaPylistVerbosity = cms.untracked.int32(0), filterEfficiency = cms.untracked.double(0.138), pythiaHepMCVerbosity = cms.untracked.bool(False), diff --git a/Configuration/Generator/python/JpsiMM_14TeV_TuneCUETP8M1_cfi.py b/Configuration/Generator/python/JpsiMM_14TeV_TuneCUETP8M1_cfi.py index 522ad64501344..cd04ad09e8f91 100644 --- a/Configuration/Generator/python/JpsiMM_14TeV_TuneCUETP8M1_cfi.py +++ b/Configuration/Generator/python/JpsiMM_14TeV_TuneCUETP8M1_cfi.py @@ -3,7 +3,7 @@ from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import * from Configuration.Generator.Pythia8CharmoniumSettings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", pythiaPylistVerbosity = cms.untracked.int32(0), filterEfficiency = cms.untracked.double(0.138), pythiaHepMCVerbosity = cms.untracked.bool(False), diff --git a/Configuration/Generator/python/JpsiMM_8TeV_TuneCUETP8M1_cfi.py b/Configuration/Generator/python/JpsiMM_8TeV_TuneCUETP8M1_cfi.py index 497077b280fa7..7b175bfbd862d 100644 --- a/Configuration/Generator/python/JpsiMM_8TeV_TuneCUETP8M1_cfi.py +++ b/Configuration/Generator/python/JpsiMM_8TeV_TuneCUETP8M1_cfi.py @@ -3,7 +3,7 @@ from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import * from Configuration.Generator.Pythia8CharmoniumSettings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", pythiaPylistVerbosity = cms.untracked.int32(0), filterEfficiency = cms.untracked.double(0.138), pythiaHepMCVerbosity = cms.untracked.bool(False), diff --git a/Configuration/Generator/python/JpsiMM_Pt_20_inf_8TeV_TuneCUETP8M1_cfi.py b/Configuration/Generator/python/JpsiMM_Pt_20_inf_8TeV_TuneCUETP8M1_cfi.py index f04318bc903ef..cc22060b845d3 100644 --- a/Configuration/Generator/python/JpsiMM_Pt_20_inf_8TeV_TuneCUETP8M1_cfi.py +++ b/Configuration/Generator/python/JpsiMM_Pt_20_inf_8TeV_TuneCUETP8M1_cfi.py @@ -3,7 +3,7 @@ from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import * from Configuration.Generator.Pythia8CharmoniumSettings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", pythiaPylistVerbosity = cms.untracked.int32(0), filterEfficiency = cms.untracked.double(0.0154), pythiaHepMCVerbosity = cms.untracked.bool(False), diff --git a/Configuration/Generator/python/JpsiMuMu_Pt-8_forSTEAM_13TeV_TuneCUETP8M1_cfi.py b/Configuration/Generator/python/JpsiMuMu_Pt-8_forSTEAM_13TeV_TuneCUETP8M1_cfi.py index 710707e361f0f..e6a59e1c47c67 100644 --- a/Configuration/Generator/python/JpsiMuMu_Pt-8_forSTEAM_13TeV_TuneCUETP8M1_cfi.py +++ b/Configuration/Generator/python/JpsiMuMu_Pt-8_forSTEAM_13TeV_TuneCUETP8M1_cfi.py @@ -2,7 +2,7 @@ from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", pythiaPylistVerbosity = cms.untracked.int32(0), filterEfficiency = cms.untracked.double(0.026), pythiaHepMCVerbosity = cms.untracked.bool(False), diff --git a/Configuration/Generator/python/MinBias_13TeV_pythia8_TuneCUETP8M1_cfi.py b/Configuration/Generator/python/MinBias_13TeV_pythia8_TuneCUETP8M1_cfi.py index dd9253e4549f7..47377fc1bc40d 100644 --- a/Configuration/Generator/python/MinBias_13TeV_pythia8_TuneCUETP8M1_cfi.py +++ b/Configuration/Generator/python/MinBias_13TeV_pythia8_TuneCUETP8M1_cfi.py @@ -2,7 +2,7 @@ from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", crossSection = cms.untracked.double(71.39e+09), maxEventsToPrint = cms.untracked.int32(0), pythiaPylistVerbosity = cms.untracked.int32(1), diff --git a/Configuration/Generator/python/MinBias_13TeV_pythia8_cff.py b/Configuration/Generator/python/MinBias_13TeV_pythia8_cff.py index e047804ebbbb8..44dc2213ffbb3 100644 --- a/Configuration/Generator/python/MinBias_13TeV_pythia8_cff.py +++ b/Configuration/Generator/python/MinBias_13TeV_pythia8_cff.py @@ -5,7 +5,7 @@ -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", crossSection = cms.untracked.double(71.39e+09), maxEventsToPrint = cms.untracked.int32(0), pythiaPylistVerbosity = cms.untracked.int32(1), diff --git a/Configuration/Generator/python/MinBias_14TeV_pythia8_TuneCP5_cfi.py b/Configuration/Generator/python/MinBias_14TeV_pythia8_TuneCP5_cfi.py index 75cfa58f7b907..9fbc560e7b5ee 100644 --- a/Configuration/Generator/python/MinBias_14TeV_pythia8_TuneCP5_cfi.py +++ b/Configuration/Generator/python/MinBias_14TeV_pythia8_TuneCP5_cfi.py @@ -2,7 +2,7 @@ from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.MCTunes2017.PythiaCP5Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", crossSection = cms.untracked.double(71.39e+09), maxEventsToPrint = cms.untracked.int32(0), pythiaPylistVerbosity = cms.untracked.int32(1), diff --git a/Configuration/Generator/python/MinBias_14TeV_pythia8_TuneCUETP8M1_cfi.py b/Configuration/Generator/python/MinBias_14TeV_pythia8_TuneCUETP8M1_cfi.py index 0667e1bebb2e0..a721d0a43c162 100644 --- a/Configuration/Generator/python/MinBias_14TeV_pythia8_TuneCUETP8M1_cfi.py +++ b/Configuration/Generator/python/MinBias_14TeV_pythia8_TuneCUETP8M1_cfi.py @@ -2,7 +2,7 @@ from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", crossSection = cms.untracked.double(71.39e+09), maxEventsToPrint = cms.untracked.int32(0), pythiaPylistVerbosity = cms.untracked.int32(1), diff --git a/Configuration/Generator/python/MinBias_8TeV_pythia8_TuneCUETP8M1_cff.py b/Configuration/Generator/python/MinBias_8TeV_pythia8_TuneCUETP8M1_cff.py index d47b0715a38b9..310ffd0fa7484 100644 --- a/Configuration/Generator/python/MinBias_8TeV_pythia8_TuneCUETP8M1_cff.py +++ b/Configuration/Generator/python/MinBias_8TeV_pythia8_TuneCUETP8M1_cff.py @@ -5,7 +5,7 @@ -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", crossSection = cms.untracked.double(71.39e+09), maxEventsToPrint = cms.untracked.int32(0), pythiaPylistVerbosity = cms.untracked.int32(1), diff --git a/Configuration/Generator/python/MinBias_TuneCUETP8M1_13TeV_pythia8_cff.py b/Configuration/Generator/python/MinBias_TuneCUETP8M1_13TeV_pythia8_cff.py index b416e2ed685ff..ffaaab9e6cc0e 100644 --- a/Configuration/Generator/python/MinBias_TuneCUETP8M1_13TeV_pythia8_cff.py +++ b/Configuration/Generator/python/MinBias_TuneCUETP8M1_13TeV_pythia8_cff.py @@ -3,7 +3,7 @@ from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", maxEventsToPrint = cms.untracked.int32(1), pythiaPylistVerbosity = cms.untracked.int32(1), filterEfficiency = cms.untracked.double(1.0), diff --git a/Configuration/Generator/python/PYTHIA8_PhiToMuMu_TuneCUETP8M1_13TeV_cff.py b/Configuration/Generator/python/PYTHIA8_PhiToMuMu_TuneCUETP8M1_13TeV_cff.py index 88fd27297769b..744af2ad59184 100644 --- a/Configuration/Generator/python/PYTHIA8_PhiToMuMu_TuneCUETP8M1_13TeV_cff.py +++ b/Configuration/Generator/python/PYTHIA8_PhiToMuMu_TuneCUETP8M1_13TeV_cff.py @@ -3,7 +3,7 @@ from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", maxEventsToPrint = cms.untracked.int32(1), pythiaPylistVerbosity = cms.untracked.int32(1), filterEfficiency = cms.untracked.double(1.0), diff --git a/Configuration/Generator/python/PhotonJet_Pt_10_13TeV_TuneCUETP8M1_cfi.py b/Configuration/Generator/python/PhotonJet_Pt_10_13TeV_TuneCUETP8M1_cfi.py index 23c3d97b31e7a..5f72f55ea2ffd 100644 --- a/Configuration/Generator/python/PhotonJet_Pt_10_13TeV_TuneCUETP8M1_cfi.py +++ b/Configuration/Generator/python/PhotonJet_Pt_10_13TeV_TuneCUETP8M1_cfi.py @@ -2,7 +2,7 @@ from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", pythiaHepMCVerbosity = cms.untracked.bool(False), maxEventsToPrint = cms.untracked.int32(0), pythiaPylistVerbosity = cms.untracked.int32(0), diff --git a/Configuration/Generator/python/PhotonJet_Pt_10_14TeV_TuneCP5_cfi.py b/Configuration/Generator/python/PhotonJet_Pt_10_14TeV_TuneCP5_cfi.py index f4725c67d460e..d2e47ff6686b9 100644 --- a/Configuration/Generator/python/PhotonJet_Pt_10_14TeV_TuneCP5_cfi.py +++ b/Configuration/Generator/python/PhotonJet_Pt_10_14TeV_TuneCP5_cfi.py @@ -2,7 +2,7 @@ from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.MCTunes2017.PythiaCP5Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", pythiaHepMCVerbosity = cms.untracked.bool(False), maxEventsToPrint = cms.untracked.int32(0), pythiaPylistVerbosity = cms.untracked.int32(0), diff --git a/Configuration/Generator/python/PhotonJet_Pt_10_14TeV_TuneCUETP8M1_cfi.py b/Configuration/Generator/python/PhotonJet_Pt_10_14TeV_TuneCUETP8M1_cfi.py index f729ee85fe98c..abbe8efadae4e 100644 --- a/Configuration/Generator/python/PhotonJet_Pt_10_14TeV_TuneCUETP8M1_cfi.py +++ b/Configuration/Generator/python/PhotonJet_Pt_10_14TeV_TuneCUETP8M1_cfi.py @@ -2,7 +2,7 @@ from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", pythiaHepMCVerbosity = cms.untracked.bool(False), maxEventsToPrint = cms.untracked.int32(0), pythiaPylistVerbosity = cms.untracked.int32(0), diff --git a/Configuration/Generator/python/PhotonJet_Pt_10_8TeV_TuneCUETP8M1_cfi.py b/Configuration/Generator/python/PhotonJet_Pt_10_8TeV_TuneCUETP8M1_cfi.py index 5472a330b7e4a..03826a60529c2 100644 --- a/Configuration/Generator/python/PhotonJet_Pt_10_8TeV_TuneCUETP8M1_cfi.py +++ b/Configuration/Generator/python/PhotonJet_Pt_10_8TeV_TuneCUETP8M1_cfi.py @@ -2,7 +2,7 @@ from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", pythiaHepMCVerbosity = cms.untracked.bool(False), maxEventsToPrint = cms.untracked.int32(0), pythiaPylistVerbosity = cms.untracked.int32(0), diff --git a/Configuration/Generator/python/Psi2SToJPsiPiPi_14TeV_TuneCP5_pythia8_cfi.py b/Configuration/Generator/python/Psi2SToJPsiPiPi_14TeV_TuneCP5_pythia8_cfi.py index 03b89fe9f385e..5349fbdc0af3a 100644 --- a/Configuration/Generator/python/Psi2SToJPsiPiPi_14TeV_TuneCP5_pythia8_cfi.py +++ b/Configuration/Generator/python/Psi2SToJPsiPiPi_14TeV_TuneCP5_pythia8_cfi.py @@ -2,7 +2,7 @@ from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.MCTunes2017.PythiaCP5Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", pythiaPylistVerbosity = cms.untracked.int32(0), pythiaHepMCVerbosity = cms.untracked.bool(False), maxEventsToPrint = cms.untracked.int32(0), diff --git a/Configuration/Generator/python/Pyquen_ZeemumuJets_pt10_2760GeV_ExtGen_cfi.py b/Configuration/Generator/python/Pyquen_ZeemumuJets_pt10_2760GeV_ExtGen_cfi.py new file mode 100644 index 0000000000000..b81f6578e004a --- /dev/null +++ b/Configuration/Generator/python/Pyquen_ZeemumuJets_pt10_2760GeV_ExtGen_cfi.py @@ -0,0 +1,36 @@ +import FWCore.ParameterSet.Config as cms + +from Configuration.Generator.PyquenDefaultSettings_cff import * + +_generator = cms.EDFilter("PyquenGeneratorFilter", + collisionParameters, + qgpParameters, + pyquenParameters, + doQuench = cms.bool(True), + bFixed = cms.double(0.0), ## fixed impact param (fm); valid only if cflag_=0 + PythiaParameters = cms.PSet(pyquenPythiaDefaultBlock, + parameterSets = cms.vstring('pythiaUESettings','customProcesses','pythiaZjets','pythiaZtoMuonsAndElectrons','kinematics'), + kinematics = cms.vstring ("CKIN(3)=10", #min pthat + "CKIN(4)=9999", #max pthat + "CKIN(7)=-2.", #min rapidity + "CKIN(8)=2." #max rapidity + ) + + ), + cFlag = cms.int32(0), ## centrality flag + bMin = cms.double(0.0), ## min impact param (fm); valid only if cflag_!=0 + bMax = cms.double(0.0) ## max impact param (fm); valid only if cflag_!=0 + ) + +from GeneratorInterface.Core.ExternalGeneratorFilter import ExternalGeneratorFilter +generator = ExternalGeneratorFilter(_generator) + +_generator.embeddingMode = False + +configurationMetadata = cms.untracked.PSet( + version = cms.untracked.string('$Revision: 1.3 $'), + name = cms.untracked.string('$Source: /local/projects/CMSSW/rep/CMSSW/Configuration/Generator/python/Pyquen_ZeemumuJets_pt10_2760GeV_cfi.py,v $'), + annotation = cms.untracked.string('PYQUEN Z->mumu and Z->ee (pt-hat > 10 GeV) at sqrt(s) = 2.76TeV') + ) + +ProductionFilterSequence = cms.Sequence(generator) diff --git a/Configuration/Generator/python/Pythia8_PhotonJetpt15_20_10TeV_cff.py b/Configuration/Generator/python/Pythia8_PhotonJetpt15_20_10TeV_cff.py index d3d387cf9cfa9..45958f49988f3 100644 --- a/Configuration/Generator/python/Pythia8_PhotonJetpt15_20_10TeV_cff.py +++ b/Configuration/Generator/python/Pythia8_PhotonJetpt15_20_10TeV_cff.py @@ -2,7 +2,7 @@ ##from Configuration.Generator.PythiaUESettings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", pythiaHepMCVerbosity = cms.untracked.bool(False), maxEventsToPrint = cms.untracked.int32(0), pythiaPylistVerbosity = cms.untracked.int32(0), diff --git a/Configuration/Generator/python/QCDForPF_13TeV_TuneCUETP8M1_cfi.py b/Configuration/Generator/python/QCDForPF_13TeV_TuneCUETP8M1_cfi.py index 2f0376ee68e23..083c006ba80a7 100644 --- a/Configuration/Generator/python/QCDForPF_13TeV_TuneCUETP8M1_cfi.py +++ b/Configuration/Generator/python/QCDForPF_13TeV_TuneCUETP8M1_cfi.py @@ -2,7 +2,7 @@ from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", pythiaHepMCVerbosity = cms.untracked.bool(False), maxEventsToPrint = cms.untracked.int32(0), pythiaPylistVerbosity = cms.untracked.int32(1), diff --git a/Configuration/Generator/python/QCDForPF_14TeV_TuneCP5_cfi.py b/Configuration/Generator/python/QCDForPF_14TeV_TuneCP5_cfi.py index 68a3f3f890540..a29ebc25467dc 100644 --- a/Configuration/Generator/python/QCDForPF_14TeV_TuneCP5_cfi.py +++ b/Configuration/Generator/python/QCDForPF_14TeV_TuneCP5_cfi.py @@ -2,7 +2,7 @@ from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.MCTunes2017.PythiaCP5Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", pythiaHepMCVerbosity = cms.untracked.bool(False), maxEventsToPrint = cms.untracked.int32(0), pythiaPylistVerbosity = cms.untracked.int32(1), diff --git a/Configuration/Generator/python/QCDForPF_14TeV_TuneCUETP8M1_cfi.py b/Configuration/Generator/python/QCDForPF_14TeV_TuneCUETP8M1_cfi.py index 646c726cd429d..6ad025942a5af 100644 --- a/Configuration/Generator/python/QCDForPF_14TeV_TuneCUETP8M1_cfi.py +++ b/Configuration/Generator/python/QCDForPF_14TeV_TuneCUETP8M1_cfi.py @@ -2,7 +2,7 @@ from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", pythiaHepMCVerbosity = cms.untracked.bool(False), maxEventsToPrint = cms.untracked.int32(0), pythiaPylistVerbosity = cms.untracked.int32(1), diff --git a/Configuration/Generator/python/QCDForPF_8TeV_TuneCUETP8M1_cfi.py b/Configuration/Generator/python/QCDForPF_8TeV_TuneCUETP8M1_cfi.py index 6345fd177f2b4..401d87ff95ce6 100644 --- a/Configuration/Generator/python/QCDForPF_8TeV_TuneCUETP8M1_cfi.py +++ b/Configuration/Generator/python/QCDForPF_8TeV_TuneCUETP8M1_cfi.py @@ -2,7 +2,7 @@ from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", pythiaHepMCVerbosity = cms.untracked.bool(False), maxEventsToPrint = cms.untracked.int32(0), pythiaPylistVerbosity = cms.untracked.int32(1), diff --git a/Configuration/Generator/python/QCD_Pt-15To7000_TuneCUETP8M1_Flat_14TeV-pythia8_cff.py b/Configuration/Generator/python/QCD_Pt-15To7000_TuneCUETP8M1_Flat_14TeV-pythia8_cff.py index b891f4b97e3fe..0e2b075b24a65 100644 --- a/Configuration/Generator/python/QCD_Pt-15To7000_TuneCUETP8M1_Flat_14TeV-pythia8_cff.py +++ b/Configuration/Generator/python/QCD_Pt-15To7000_TuneCUETP8M1_Flat_14TeV-pythia8_cff.py @@ -4,7 +4,7 @@ from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", comEnergy = cms.double(14000.0), crossSection = cms.untracked.double(2.0221e+09), filterEfficiency = cms.untracked.double(1.0), diff --git a/Configuration/Generator/python/QCD_Pt-20toInf_MuEnrichedPt15_TuneCUETP8M1_13TeV_pythia8_cff.py b/Configuration/Generator/python/QCD_Pt-20toInf_MuEnrichedPt15_TuneCUETP8M1_13TeV_pythia8_cff.py index 7ca22905e2e7c..68c1432259061 100644 --- a/Configuration/Generator/python/QCD_Pt-20toInf_MuEnrichedPt15_TuneCUETP8M1_13TeV_pythia8_cff.py +++ b/Configuration/Generator/python/QCD_Pt-20toInf_MuEnrichedPt15_TuneCUETP8M1_13TeV_pythia8_cff.py @@ -3,7 +3,7 @@ from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", maxEventsToPrint = cms.untracked.int32(1), pythiaPylistVerbosity = cms.untracked.int32(1), filterEfficiency = cms.untracked.double(0.00042), diff --git a/Configuration/Generator/python/QCD_Pt-20toInf_MuEnrichedPt15_TuneCUETP8M1_14TeV_pythia8_cff.py b/Configuration/Generator/python/QCD_Pt-20toInf_MuEnrichedPt15_TuneCUETP8M1_14TeV_pythia8_cff.py index 951546046d24d..a24d3ecfea70a 100644 --- a/Configuration/Generator/python/QCD_Pt-20toInf_MuEnrichedPt15_TuneCUETP8M1_14TeV_pythia8_cff.py +++ b/Configuration/Generator/python/QCD_Pt-20toInf_MuEnrichedPt15_TuneCUETP8M1_14TeV_pythia8_cff.py @@ -3,7 +3,7 @@ from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", maxEventsToPrint = cms.untracked.int32(1), pythiaPylistVerbosity = cms.untracked.int32(1), filterEfficiency = cms.untracked.double(0.00042), diff --git a/Configuration/Generator/python/QCD_Pt15To7000_Flat_14TeV_TuneCP5_cff.py b/Configuration/Generator/python/QCD_Pt15To7000_Flat_14TeV_TuneCP5_cff.py index 60a038e4be76c..1a0136de21ddf 100644 --- a/Configuration/Generator/python/QCD_Pt15To7000_Flat_14TeV_TuneCP5_cff.py +++ b/Configuration/Generator/python/QCD_Pt15To7000_Flat_14TeV_TuneCP5_cff.py @@ -4,7 +4,7 @@ from Configuration.Generator.MCTunes2017.PythiaCP5Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", comEnergy = cms.double(14000.0), crossSection = cms.untracked.double(2.0221e+09), filterEfficiency = cms.untracked.double(1.0), diff --git a/Configuration/Generator/python/QCD_Pt20toInf_MuEnrichedPt15_14TeV_TuneCP5_cff.py b/Configuration/Generator/python/QCD_Pt20toInf_MuEnrichedPt15_14TeV_TuneCP5_cff.py index 36d1e912bf0df..db66cd4bd43c3 100644 --- a/Configuration/Generator/python/QCD_Pt20toInf_MuEnrichedPt15_14TeV_TuneCP5_cff.py +++ b/Configuration/Generator/python/QCD_Pt20toInf_MuEnrichedPt15_14TeV_TuneCP5_cff.py @@ -3,7 +3,7 @@ from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.MCTunes2017.PythiaCP5Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", maxEventsToPrint = cms.untracked.int32(1), pythiaPylistVerbosity = cms.untracked.int32(1), filterEfficiency = cms.untracked.double(0.00042), diff --git a/Configuration/Generator/python/QCD_Pt_120_170_13TeV_TuneCUETP8M1_cfi.py b/Configuration/Generator/python/QCD_Pt_120_170_13TeV_TuneCUETP8M1_cfi.py index f6fa34c97571c..d28901a35cdfe 100644 --- a/Configuration/Generator/python/QCD_Pt_120_170_13TeV_TuneCUETP8M1_cfi.py +++ b/Configuration/Generator/python/QCD_Pt_120_170_13TeV_TuneCUETP8M1_cfi.py @@ -2,7 +2,7 @@ from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", pythiaPylistVerbosity = cms.untracked.int32(0), filterEfficiency = cms.untracked.double(1.0), pythiaHepMCVerbosity = cms.untracked.bool(False), diff --git a/Configuration/Generator/python/QCD_Pt_120_170_8TeV_TuneCUETP8M1_cfi.py b/Configuration/Generator/python/QCD_Pt_120_170_8TeV_TuneCUETP8M1_cfi.py index 7755b29b155f0..e8a30864b74bb 100644 --- a/Configuration/Generator/python/QCD_Pt_120_170_8TeV_TuneCUETP8M1_cfi.py +++ b/Configuration/Generator/python/QCD_Pt_120_170_8TeV_TuneCUETP8M1_cfi.py @@ -2,7 +2,7 @@ from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", pythiaPylistVerbosity = cms.untracked.int32(0), filterEfficiency = cms.untracked.double(1.0), pythiaHepMCVerbosity = cms.untracked.bool(False), diff --git a/Configuration/Generator/python/QCD_Pt_15_20_8TeV_TuneCUETP8M1_cfi.py b/Configuration/Generator/python/QCD_Pt_15_20_8TeV_TuneCUETP8M1_cfi.py index 78f774d7e8c7c..954c3996af69f 100644 --- a/Configuration/Generator/python/QCD_Pt_15_20_8TeV_TuneCUETP8M1_cfi.py +++ b/Configuration/Generator/python/QCD_Pt_15_20_8TeV_TuneCUETP8M1_cfi.py @@ -2,7 +2,7 @@ from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", pythiaPylistVerbosity = cms.untracked.int32(0), filterEfficiency = cms.untracked.double(1.0), pythiaHepMCVerbosity = cms.untracked.bool(False), diff --git a/Configuration/Generator/python/QCD_Pt_170_230_8TeV_TuneCUETP8M1_cfi.py b/Configuration/Generator/python/QCD_Pt_170_230_8TeV_TuneCUETP8M1_cfi.py index 831b40da414d5..1c3f52e0ce89f 100644 --- a/Configuration/Generator/python/QCD_Pt_170_230_8TeV_TuneCUETP8M1_cfi.py +++ b/Configuration/Generator/python/QCD_Pt_170_230_8TeV_TuneCUETP8M1_cfi.py @@ -2,7 +2,7 @@ from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", pythiaPylistVerbosity = cms.untracked.int32(0), filterEfficiency = cms.untracked.double(1.0), pythiaHepMCVerbosity = cms.untracked.bool(False), diff --git a/Configuration/Generator/python/QCD_Pt_1800_2400_13TeV_TuneCP5_cfi.py b/Configuration/Generator/python/QCD_Pt_1800_2400_13TeV_TuneCP5_cfi.py index a622e9c1ab058..c19ae06f8e454 100644 --- a/Configuration/Generator/python/QCD_Pt_1800_2400_13TeV_TuneCP5_cfi.py +++ b/Configuration/Generator/python/QCD_Pt_1800_2400_13TeV_TuneCP5_cfi.py @@ -2,7 +2,7 @@ from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.MCTunes2017.PythiaCP5Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", pythiaHepMCVerbosity = cms.untracked.bool(False), maxEventsToPrint = cms.untracked.int32(0), pythiaPylistVerbosity = cms.untracked.int32(1), diff --git a/Configuration/Generator/python/QCD_Pt_1800_2400_14TeV_TuneCP5_cfi.py b/Configuration/Generator/python/QCD_Pt_1800_2400_14TeV_TuneCP5_cfi.py index 91afc5d319358..f75b98564bb5b 100644 --- a/Configuration/Generator/python/QCD_Pt_1800_2400_14TeV_TuneCP5_cfi.py +++ b/Configuration/Generator/python/QCD_Pt_1800_2400_14TeV_TuneCP5_cfi.py @@ -2,7 +2,7 @@ from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.MCTunes2017.PythiaCP5Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", pythiaHepMCVerbosity = cms.untracked.bool(False), maxEventsToPrint = cms.untracked.int32(0), pythiaPylistVerbosity = cms.untracked.int32(1), diff --git a/Configuration/Generator/python/QCD_Pt_20_30_8TeV_TuneCUETP8M1_cfi.py b/Configuration/Generator/python/QCD_Pt_20_30_8TeV_TuneCUETP8M1_cfi.py index 4e9025a6aac5a..c0837c6eb2e59 100644 --- a/Configuration/Generator/python/QCD_Pt_20_30_8TeV_TuneCUETP8M1_cfi.py +++ b/Configuration/Generator/python/QCD_Pt_20_30_8TeV_TuneCUETP8M1_cfi.py @@ -2,7 +2,7 @@ from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", pythiaPylistVerbosity = cms.untracked.int32(0), filterEfficiency = cms.untracked.double(1.0), pythiaHepMCVerbosity = cms.untracked.bool(False), diff --git a/Configuration/Generator/python/QCD_Pt_3000_3500_13TeV_TuneCUETP8M1_cfi.py b/Configuration/Generator/python/QCD_Pt_3000_3500_13TeV_TuneCUETP8M1_cfi.py index 38c6aaab7d074..b27ee99ff3d5c 100644 --- a/Configuration/Generator/python/QCD_Pt_3000_3500_13TeV_TuneCUETP8M1_cfi.py +++ b/Configuration/Generator/python/QCD_Pt_3000_3500_13TeV_TuneCUETP8M1_cfi.py @@ -2,7 +2,7 @@ from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", pythiaHepMCVerbosity = cms.untracked.bool(False), maxEventsToPrint = cms.untracked.int32(0), pythiaPylistVerbosity = cms.untracked.int32(1), diff --git a/Configuration/Generator/python/QCD_Pt_3000_3500_14TeV_TuneCUETP8M1_cfi.py b/Configuration/Generator/python/QCD_Pt_3000_3500_14TeV_TuneCUETP8M1_cfi.py index e09e7383534ca..f72a41c562cc6 100644 --- a/Configuration/Generator/python/QCD_Pt_3000_3500_14TeV_TuneCUETP8M1_cfi.py +++ b/Configuration/Generator/python/QCD_Pt_3000_3500_14TeV_TuneCUETP8M1_cfi.py @@ -2,7 +2,7 @@ from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", pythiaHepMCVerbosity = cms.untracked.bool(False), maxEventsToPrint = cms.untracked.int32(0), pythiaPylistVerbosity = cms.untracked.int32(1), diff --git a/Configuration/Generator/python/QCD_Pt_3000_3500_8TeV_TuneCUETP8M1_cfi.py b/Configuration/Generator/python/QCD_Pt_3000_3500_8TeV_TuneCUETP8M1_cfi.py index 46330e955246d..f6af723433716 100644 --- a/Configuration/Generator/python/QCD_Pt_3000_3500_8TeV_TuneCUETP8M1_cfi.py +++ b/Configuration/Generator/python/QCD_Pt_3000_3500_8TeV_TuneCUETP8M1_cfi.py @@ -2,7 +2,7 @@ from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", pythiaHepMCVerbosity = cms.untracked.bool(False), maxEventsToPrint = cms.untracked.int32(0), pythiaPylistVerbosity = cms.untracked.int32(1), diff --git a/Configuration/Generator/python/QCD_Pt_30_13TeV_pythia8_cff.py b/Configuration/Generator/python/QCD_Pt_30_13TeV_pythia8_cff.py index d9898f05e7ceb..4be3beb69f78a 100644 --- a/Configuration/Generator/python/QCD_Pt_30_13TeV_pythia8_cff.py +++ b/Configuration/Generator/python/QCD_Pt_30_13TeV_pythia8_cff.py @@ -5,7 +5,7 @@ -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", crossSection = cms.untracked.double(5.72e+07), maxEventsToPrint = cms.untracked.int32(0), pythiaPylistVerbosity = cms.untracked.int32(1), diff --git a/Configuration/Generator/python/QCD_Pt_30_50_13TeV_TuneCUETP8M1_cfi.py b/Configuration/Generator/python/QCD_Pt_30_50_13TeV_TuneCUETP8M1_cfi.py index a306aedc54a43..c2eb43bcb32e7 100644 --- a/Configuration/Generator/python/QCD_Pt_30_50_13TeV_TuneCUETP8M1_cfi.py +++ b/Configuration/Generator/python/QCD_Pt_30_50_13TeV_TuneCUETP8M1_cfi.py @@ -2,7 +2,7 @@ from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", pythiaPylistVerbosity = cms.untracked.int32(0), filterEfficiency = cms.untracked.double(1.0), pythiaHepMCVerbosity = cms.untracked.bool(False), diff --git a/Configuration/Generator/python/QCD_Pt_30_50_8TeV_TuneCUETP8M1_cfi.py b/Configuration/Generator/python/QCD_Pt_30_50_8TeV_TuneCUETP8M1_cfi.py index cccadc7516c0e..e7d358a710b50 100644 --- a/Configuration/Generator/python/QCD_Pt_30_50_8TeV_TuneCUETP8M1_cfi.py +++ b/Configuration/Generator/python/QCD_Pt_30_50_8TeV_TuneCUETP8M1_cfi.py @@ -2,7 +2,7 @@ from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", pythiaPylistVerbosity = cms.untracked.int32(0), filterEfficiency = cms.untracked.double(1.0), pythiaHepMCVerbosity = cms.untracked.bool(False), diff --git a/Configuration/Generator/python/QCD_Pt_30_80_BCtoE_8TeV_TuneCUETP8M1_cfi.py b/Configuration/Generator/python/QCD_Pt_30_80_BCtoE_8TeV_TuneCUETP8M1_cfi.py index 1bbf55b643ffa..06f269ebe4bda 100644 --- a/Configuration/Generator/python/QCD_Pt_30_80_BCtoE_8TeV_TuneCUETP8M1_cfi.py +++ b/Configuration/Generator/python/QCD_Pt_30_80_BCtoE_8TeV_TuneCUETP8M1_cfi.py @@ -2,7 +2,7 @@ from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", pythiaHepMCVerbosity = cms.untracked.bool(False), maxEventsToPrint = cms.untracked.int32(0), pythiaPylistVerbosity = cms.untracked.int32(1), diff --git a/Configuration/Generator/python/QCD_Pt_50_80_8TeV_TuneCUETP8M1_cfi.py b/Configuration/Generator/python/QCD_Pt_50_80_8TeV_TuneCUETP8M1_cfi.py index 9101d03939f84..573be5b005cde 100644 --- a/Configuration/Generator/python/QCD_Pt_50_80_8TeV_TuneCUETP8M1_cfi.py +++ b/Configuration/Generator/python/QCD_Pt_50_80_8TeV_TuneCUETP8M1_cfi.py @@ -2,7 +2,7 @@ from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", pythiaPylistVerbosity = cms.untracked.int32(0), filterEfficiency = cms.untracked.double(1.0), pythiaHepMCVerbosity = cms.untracked.bool(False), diff --git a/Configuration/Generator/python/QCD_Pt_600_800_13TeV_TuneCUETP8M1_cfi.py b/Configuration/Generator/python/QCD_Pt_600_800_13TeV_TuneCUETP8M1_cfi.py index 3609adc003fb1..e429c3030623e 100644 --- a/Configuration/Generator/python/QCD_Pt_600_800_13TeV_TuneCUETP8M1_cfi.py +++ b/Configuration/Generator/python/QCD_Pt_600_800_13TeV_TuneCUETP8M1_cfi.py @@ -2,7 +2,7 @@ from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", pythiaPylistVerbosity = cms.untracked.int32(0), filterEfficiency = cms.untracked.double(1.0), pythiaHepMCVerbosity = cms.untracked.bool(False), diff --git a/Configuration/Generator/python/QCD_Pt_600_800_14TeV_TuneCUETP8M1_cfi.py b/Configuration/Generator/python/QCD_Pt_600_800_14TeV_TuneCUETP8M1_cfi.py index f10b163c66827..c044543c9b718 100644 --- a/Configuration/Generator/python/QCD_Pt_600_800_14TeV_TuneCUETP8M1_cfi.py +++ b/Configuration/Generator/python/QCD_Pt_600_800_14TeV_TuneCUETP8M1_cfi.py @@ -2,7 +2,7 @@ from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", pythiaPylistVerbosity = cms.untracked.int32(0), filterEfficiency = cms.untracked.double(1.0), pythiaHepMCVerbosity = cms.untracked.bool(False), diff --git a/Configuration/Generator/python/QCD_Pt_600_800_8TeV_TuneCUETP8M1_cfi.py b/Configuration/Generator/python/QCD_Pt_600_800_8TeV_TuneCUETP8M1_cfi.py index eb1f5054986b3..f362186d751c6 100644 --- a/Configuration/Generator/python/QCD_Pt_600_800_8TeV_TuneCUETP8M1_cfi.py +++ b/Configuration/Generator/python/QCD_Pt_600_800_8TeV_TuneCUETP8M1_cfi.py @@ -2,7 +2,7 @@ from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", pythiaPylistVerbosity = cms.untracked.int32(0), filterEfficiency = cms.untracked.double(1.0), pythiaHepMCVerbosity = cms.untracked.bool(False), diff --git a/Configuration/Generator/python/QCD_Pt_80_120_13TeV_TuneCUETP8M1_cfi.py b/Configuration/Generator/python/QCD_Pt_80_120_13TeV_TuneCUETP8M1_cfi.py index bcf6aed30dba7..7ecbfb5812301 100644 --- a/Configuration/Generator/python/QCD_Pt_80_120_13TeV_TuneCUETP8M1_cfi.py +++ b/Configuration/Generator/python/QCD_Pt_80_120_13TeV_TuneCUETP8M1_cfi.py @@ -2,7 +2,7 @@ from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", pythiaPylistVerbosity = cms.untracked.int32(0), filterEfficiency = cms.untracked.double(1.0), pythiaHepMCVerbosity = cms.untracked.bool(False), diff --git a/Configuration/Generator/python/QCD_Pt_80_120_14TeV_TuneCP5_cfi.py b/Configuration/Generator/python/QCD_Pt_80_120_14TeV_TuneCP5_cfi.py index 72b2178de7be1..75a45397830d8 100644 --- a/Configuration/Generator/python/QCD_Pt_80_120_14TeV_TuneCP5_cfi.py +++ b/Configuration/Generator/python/QCD_Pt_80_120_14TeV_TuneCP5_cfi.py @@ -2,7 +2,7 @@ from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.MCTunes2017.PythiaCP5Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", pythiaPylistVerbosity = cms.untracked.int32(0), filterEfficiency = cms.untracked.double(1.0), pythiaHepMCVerbosity = cms.untracked.bool(False), diff --git a/Configuration/Generator/python/QCD_Pt_80_120_14TeV_TuneCUETP8M1_cfi.py b/Configuration/Generator/python/QCD_Pt_80_120_14TeV_TuneCUETP8M1_cfi.py index 668777bd52b2c..d7177b97b7e8f 100644 --- a/Configuration/Generator/python/QCD_Pt_80_120_14TeV_TuneCUETP8M1_cfi.py +++ b/Configuration/Generator/python/QCD_Pt_80_120_14TeV_TuneCUETP8M1_cfi.py @@ -2,7 +2,7 @@ from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", pythiaPylistVerbosity = cms.untracked.int32(0), filterEfficiency = cms.untracked.double(1.0), pythiaHepMCVerbosity = cms.untracked.bool(False), diff --git a/Configuration/Generator/python/QCD_Pt_80_120_8TeV_TuneCUETP8M1_cfi.py b/Configuration/Generator/python/QCD_Pt_80_120_8TeV_TuneCUETP8M1_cfi.py index 56c0817d5992e..6ffa64d23a34a 100644 --- a/Configuration/Generator/python/QCD_Pt_80_120_8TeV_TuneCUETP8M1_cfi.py +++ b/Configuration/Generator/python/QCD_Pt_80_120_8TeV_TuneCUETP8M1_cfi.py @@ -2,7 +2,7 @@ from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", pythiaPylistVerbosity = cms.untracked.int32(0), filterEfficiency = cms.untracked.double(1.0), pythiaHepMCVerbosity = cms.untracked.bool(False), diff --git a/Configuration/Generator/python/QCD_Pt_80_170_BCtoE_8TeV_TuneCUETP8M1_cfi.py b/Configuration/Generator/python/QCD_Pt_80_170_BCtoE_8TeV_TuneCUETP8M1_cfi.py index 77afa1e413734..5a626bed4a129 100644 --- a/Configuration/Generator/python/QCD_Pt_80_170_BCtoE_8TeV_TuneCUETP8M1_cfi.py +++ b/Configuration/Generator/python/QCD_Pt_80_170_BCtoE_8TeV_TuneCUETP8M1_cfi.py @@ -2,7 +2,7 @@ from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", pythiaHepMCVerbosity = cms.untracked.bool(False), maxEventsToPrint = cms.untracked.int32(0), pythiaPylistVerbosity = cms.untracked.int32(1), diff --git a/Configuration/Generator/python/QQH120Inv_8TeV_TuneCUETP8M1_cfi.py b/Configuration/Generator/python/QQH120Inv_8TeV_TuneCUETP8M1_cfi.py index af44fd49ad985..ab9ff54fb3168 100644 --- a/Configuration/Generator/python/QQH120Inv_8TeV_TuneCUETP8M1_cfi.py +++ b/Configuration/Generator/python/QQH120Inv_8TeV_TuneCUETP8M1_cfi.py @@ -1,7 +1,7 @@ import FWCore.ParameterSet.Config as cms from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", pythiaPylistVerbosity = cms.untracked.int32(1), # put here the efficiency of your filter (1. if no filter) filterEfficiency = cms.untracked.double(1.0), diff --git a/Configuration/Generator/python/QQH1352T_13TeV_TuneCUETP8M1_cfi.py b/Configuration/Generator/python/QQH1352T_13TeV_TuneCUETP8M1_cfi.py index 8255ba54ce734..0d7822dbea238 100644 --- a/Configuration/Generator/python/QQH1352T_13TeV_TuneCUETP8M1_cfi.py +++ b/Configuration/Generator/python/QQH1352T_13TeV_TuneCUETP8M1_cfi.py @@ -1,7 +1,7 @@ import FWCore.ParameterSet.Config as cms from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", pythiaPylistVerbosity = cms.untracked.int32(1), # put here the efficiency of your filter (1. if no filter) filterEfficiency = cms.untracked.double(1.0), diff --git a/Configuration/Generator/python/QQH1352T_8TeV_TuneCUETP8M1_cfi.py b/Configuration/Generator/python/QQH1352T_8TeV_TuneCUETP8M1_cfi.py index 89a5673f5e211..8a8cc8928a57e 100644 --- a/Configuration/Generator/python/QQH1352T_8TeV_TuneCUETP8M1_cfi.py +++ b/Configuration/Generator/python/QQH1352T_8TeV_TuneCUETP8M1_cfi.py @@ -1,7 +1,7 @@ import FWCore.ParameterSet.Config as cms from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", pythiaPylistVerbosity = cms.untracked.int32(1), # put here the efficiency of your filter (1. if no filter) filterEfficiency = cms.untracked.double(1.0), diff --git a/Configuration/Generator/python/QQToHToTauTau_mh125_TuneCP5_14TeV_pythia8_cfi.py b/Configuration/Generator/python/QQToHToTauTau_mh125_TuneCP5_14TeV_pythia8_cfi.py index 68648d19e2bd6..4f60b75d2bde0 100644 --- a/Configuration/Generator/python/QQToHToTauTau_mh125_TuneCP5_14TeV_pythia8_cfi.py +++ b/Configuration/Generator/python/QQToHToTauTau_mh125_TuneCP5_14TeV_pythia8_cfi.py @@ -1,7 +1,7 @@ import FWCore.ParameterSet.Config as cms from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.MCTunes2017.PythiaCP5Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", pythiaPylistVerbosity = cms.untracked.int32(1), # put here the efficiency of your filter (1. if no filter) filterEfficiency = cms.untracked.double(1.0), diff --git a/Configuration/Generator/python/RS750_quarks_and_leptons_8TeV_TuneCUETP8M1_cff.py b/Configuration/Generator/python/RS750_quarks_and_leptons_8TeV_TuneCUETP8M1_cff.py index ef55039c6aa8d..4db26dd7f60ac 100644 --- a/Configuration/Generator/python/RS750_quarks_and_leptons_8TeV_TuneCUETP8M1_cff.py +++ b/Configuration/Generator/python/RS750_quarks_and_leptons_8TeV_TuneCUETP8M1_cff.py @@ -1,7 +1,7 @@ import FWCore.ParameterSet.Config as cms from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", pythiaPylistVerbosity = cms.untracked.int32(1), filterEfficiency = cms.untracked.double(1.0), pythiaHepMCVerbosity = cms.untracked.bool(False), diff --git a/Configuration/Generator/python/RSGravitonToGammaGamma_kMpl01_M_3000_TuneCUETP8M1_13TeV_pythia8_cfi.py b/Configuration/Generator/python/RSGravitonToGammaGamma_kMpl01_M_3000_TuneCUETP8M1_13TeV_pythia8_cfi.py index 88e4f9a858ae5..434df7c217e66 100644 --- a/Configuration/Generator/python/RSGravitonToGammaGamma_kMpl01_M_3000_TuneCUETP8M1_13TeV_pythia8_cfi.py +++ b/Configuration/Generator/python/RSGravitonToGammaGamma_kMpl01_M_3000_TuneCUETP8M1_13TeV_pythia8_cfi.py @@ -3,7 +3,7 @@ from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", comEnergy = cms.double(13000.0), crossSection = cms.untracked.double(1), filterEfficiency = cms.untracked.double(1), diff --git a/Configuration/Generator/python/RSKKGluon_m3000GeV_13TeV_TuneCUETP8M1_cff.py b/Configuration/Generator/python/RSKKGluon_m3000GeV_13TeV_TuneCUETP8M1_cff.py index 6bc8fd0ec63b7..c2377395bf0d6 100644 --- a/Configuration/Generator/python/RSKKGluon_m3000GeV_13TeV_TuneCUETP8M1_cff.py +++ b/Configuration/Generator/python/RSKKGluon_m3000GeV_13TeV_TuneCUETP8M1_cff.py @@ -3,7 +3,7 @@ from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", crossSection = cms.untracked.double(1.0), pythiaPylistVerbosity = cms.untracked.int32(0), filterEfficiency = cms.untracked.double(1.0), diff --git a/Configuration/Generator/python/RSKKGluon_m3000GeV_13TeV_cff.py b/Configuration/Generator/python/RSKKGluon_m3000GeV_13TeV_cff.py index e3b98fd91b6b7..dc4149d3f4bdb 100644 --- a/Configuration/Generator/python/RSKKGluon_m3000GeV_13TeV_cff.py +++ b/Configuration/Generator/python/RSKKGluon_m3000GeV_13TeV_cff.py @@ -1,7 +1,7 @@ import FWCore.ParameterSet.Config as cms -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", crossSection = cms.untracked.double(1.0), pythiaPylistVerbosity = cms.untracked.int32(0), filterEfficiency = cms.untracked.double(1.0), diff --git a/Configuration/Generator/python/ReggeGribovPartonMC_EposLHC_4080_4080GeV_pPb_ExtGen_cfi.py b/Configuration/Generator/python/ReggeGribovPartonMC_EposLHC_4080_4080GeV_pPb_ExtGen_cfi.py new file mode 100644 index 0000000000000..0225adc6dc657 --- /dev/null +++ b/Configuration/Generator/python/ReggeGribovPartonMC_EposLHC_4080_4080GeV_pPb_ExtGen_cfi.py @@ -0,0 +1,17 @@ +import FWCore.ParameterSet.Config as cms + +_generator = cms.EDFilter("ReggeGribovPartonMCGeneratorFilter", + + bmin = cms.double(0), #impact parameter min in fm + bmax = cms.double(10000),#impact parameter max in fm + paramFileName = cms.untracked.string("Configuration/Generator/data/ReggeGribovPartonMC.param"), #file with more parameters specific to crmc interface + skipNuclFrag = cms.bool(True), #in HI collisions nuclear fragments with pt=0 can be in the hep event. to skip those activate this option + beammomentum = cms.double(4080), + targetmomentum = cms.double(-4080), + beamid = cms.int32(208), + targetid = cms.int32(1), + model = cms.int32(0), + ) + +from GeneratorInterface.Core.ExternalGeneratorFilter import ExternalGeneratorFilter +generator = ExternalGeneratorFilter(_generator) \ No newline at end of file diff --git a/Configuration/Generator/python/SMS-Higgsino_mN2-170_mC1-160_mN1-150_HT60_TuneCP5_13TeV_pythia8_cfi.py b/Configuration/Generator/python/SMS-Higgsino_mN2-170_mC1-160_mN1-150_HT60_TuneCP5_13TeV_pythia8_cfi.py new file mode 100644 index 0000000000000..a7a190657ceef --- /dev/null +++ b/Configuration/Generator/python/SMS-Higgsino_mN2-170_mC1-160_mN1-150_HT60_TuneCP5_13TeV_pythia8_cfi.py @@ -0,0 +1,276 @@ +import FWCore.ParameterSet.Config as cms + +from Configuration.Generator.Pythia8CommonSettings_cfi import * +from Configuration.Generator.MCTunes2017.PythiaCP5Settings_cfi import * + +SLHA_TABLE = """ +Block MODSEL # Model selection + 1 0 # Generic MSSM +Block MINPAR # Input parameters + 3 1.00000000E+00 # tanb at m_Z +# +Block SMINPUTS # SM parameters + 1 1.27931277E+02 # alpha_em^-1(MZ)^MSbar + 2 1.16639000E-05 # G_mu [GeV^-2] + 3 1.17200000E-01 # alpha_s(MZ)^MSbar + 4 9.11876000E+01 # m_Z(pole) + 5 4.20000000E+00 # m_b(m_b), MSbar + 6 1.74300000E+02 # m_t(pole) + 7 1.77700000E+00 # m_tau(pole) +Block MASS # Mass spectrum +# PDG code mass particle + 24 8.04009772E+01 # W+ + 25 10.0E+4 # h0 + 35 10.0E+4 # H0 + 36 10.0E+4 # A0 + 37 10.0E+4 # H+ + 1000001 10.0E+4 # ~d_L + 2000001 10.0E+4 # ~d_R + 1000002 10.0E+4 # ~u_L + 2000002 10.0E+4 # ~u_R + 1000003 10.0E+4 # ~s_L + 2000003 10.0E+4 # ~s_R + 1000004 10.0E+4 # ~c_L + 2000004 10.0E+4 # ~c_R + 1000005 10.0E+4 # ~b_1 + 2000005 10.0E+4 # ~b_2 + 1000006 10.0E+4 # ~t_1 + 2000006 10.0E+4 # ~t_2 + 1000011 10.0E+4 # ~e_L- + 2000011 10.0E+4 # ~e_R- + 1000012 10.0E+4 # ~nu_eL + 1000013 10.0E+4 # ~mu_L- + 2000013 10.0E+4 # ~mu_R- + 1000014 10.0E+4 # ~nu_muL + 1000015 10.0E+4 # ~tau_1- + 2000015 10.0E+4 # ~tau_2- + 1000016 10.0E+4 # ~nu_tauL + 1000021 10.0E+4 # ~g + 1000022 150 # ~chi_10 + 1000023 170 # ~chi_20 + 1000025 10.0E+4 # ~chi_30 + 1000035 10.0E+4 # ~chi_40 + 1000024 160 # ~chi_1+ + 1000037 10.0E+4 # ~chi_2+ +# +BLOCK NMIX # Neutralino Mixing Matrix + 1 1 0.00000000E+00 # N_11 + 1 2 0.00000000E+00 # N_12 + 1 3 0.70710678E+00 # N_13 + 1 4 0.70710678E+00 # N_14 + 2 1 0.00000000E+00 # N_21 + 2 2 0.00000000E+00 # N_22 + 2 3 0.70710678E+00 # N_23 + 2 4 -0.70710678E+00 # N_24 + 3 1 0.00000000E+00 # N_31 + 3 2 1.00000000E+00 # N_32 + 3 3 0.00000000E+00 # N_33 + 3 4 0.00000000E+00 # N_34 + 4 1 1.00000000E+00 # N_41 + 4 2 0.00000000E+00 # N_42 + 4 3 0.00000000E+00 # N_43 + 4 4 0.00000000E+00 # N_44 +# +BLOCK UMIX # Chargino Mixing Matrix U + 1 1 0.00000000E+00 # U_11 + 1 2 1.00000000E+00 # U_12 + 2 1 1.00000000E+00 # U_21 + 2 2 0.00000000E+00 # U_22 +# +BLOCK VMIX # Chargino Mixing Matrix V + 1 1 0.00000000E+00 # V_11 + 1 2 1.00000000E+00 # V_12 + 2 1 1.00000000E+00 # V_21 + 2 2 0.00000000E+00 # V_22 +# +BLOCK STOPMIX # Stop Mixing Matrix + 1 1 1.0 # cos(theta_t) + 1 2 0.0 # sin(theta_t) + 2 1 0.0 # -sin(theta_t) + 2 2 1.0 # cos(theta_t) +# +BLOCK SBOTMIX # Sbottom Mixing Matrix + 1 1 9.66726392E-01 # cos(theta_b) + 1 2 2.55812594E-01 # sin(theta_b) + 2 1 -2.55812594E-01 # -sin(theta_b) + 2 2 9.66726392E-01 # cos(theta_b) +# +BLOCK STAUMIX # Stau Mixing Matrix + 1 1 4.51419848E-01 # cos(theta_tau) + 1 2 8.92311672E-01 # sin(theta_tau) + 2 1 -8.92311672E-01 # -sin(theta_tau) + 2 2 4.51419848E-01 # cos(theta_tau) +# +BLOCK ALPHA # Higgs mixing + -1.13676047E-01 # Mixing angle in the neutral Higgs boson sector +# +BLOCK HMIX Q= 2.90528802E+02 # DRbar Higgs Parameters + 1 3.05599351E+02 # mu(Q)MSSM +# +BLOCK AU Q= 2.90528802E+02 # The trilinear couplings + 1 1 0.00000000E+00 # A_u(Q) DRbar + 2 2 0.00000000E+00 # A_c(Q) DRbar + 3 3 -4.46245994E+02 # A_t(Q) DRbar +# +BLOCK AD Q= 2.90528802E+02 # The trilinear couplings + 1 1 0.00000000E+00 # A_d(Q) DRbar + 2 2 0.00000000E+00 # A_s(Q) DRbar + 3 3 -8.28806503E+02 # A_b(Q) DRbar +# +BLOCK AE Q= 2.90528802E+02 # The trilinear couplings + 1 1 0.00000000E+00 # A_e(Q) DRbar + 2 2 0.00000000E+00 # A_mu(Q) DRbar + 3 3 -4.92306701E+02 # A_tau(Q) DRbar +# +BLOCK MSOFT Q= 2.90528802E+02 # The soft SUSY breaking masses at the scale Q + 1 6.39136864E+01 # M_1(Q) + 2 1.22006983E+02 # M_2(Q) + 3 3.90619532E+02 # M_3(Q) + 21 4.42860395E+04 # mH1^2(Q) + 22 -9.76585434E+04 # mH2^2(Q) + 31 2.26648170E+02 # meL(Q) + 32 2.26648170E+02 # mmuL(Q) + 33 2.24355944E+02 # mtauL(Q) + 34 2.08394096E+02 # meR(Q) + 35 2.08394096E+02 # mmuR(Q) + 36 2.03337218E+02 # mtauR(Q) + 41 4.08594291E+02 # mqL1(Q) + 42 4.08594291E+02 # mqL2(Q) + 43 3.46134575E+02 # mqL3(Q) + 44 3.98943379E+02 # muR(Q) + 45 3.98943379E+02 # mcR(Q) + 46 2.58021672E+02 # mtR(Q) + 47 3.95211849E+02 # mdR(Q) + 48 3.95211849E+02 # msR(Q) + 49 3.90320031E+02 # mbR(Q) +# +# +# +# ================= +# |The decay table| +# ================= +# +# - The QCD corrections to the decays gluino -> squark + quark +# squark -> gaugino + quark_prime +# squark -> squark_prime + Higgs +# squark -> gluino + quark +# are included. +# +# - The multi-body decays for the inos, stops and sbottoms are included. +# +# - The loop induced decays for the gluino, neutralinos and stops +# are included. +# +# - The SUSY decays of the top quark are included. +# +# +# +# PDG Width +DECAY 1000022 0.00000000E+00 # neutralino1 decays +DECAY 1000021 1.00000000E+00 # gluino decays +# BR NDA ID1 ID2 + 0.000000E+00 3 1000022 1 -1 + 0.000000E+00 3 1000022 2 -2 + 0.000000E+00 3 1000022 3 -3 + 0.000000E+00 3 1000022 4 -4 + 0.000000E+00 3 1000022 5 -5 + 1.000000E+00 3 1000022 6 -6 +# +# PDG Width +DECAY 1000006 0.00000000E+00 # stop1 decays +DECAY 2000006 0.00000000E+00 # stop2 decays +DECAY 1000005 0.00000000E+00 # sbottom1 decays +DECAY 2000005 0.00000000E+00 # sbottom2 decays +# +# PDG Width +DECAY 1000002 1.00000000E+00 # sup_L decays +# BR NDA ID1 ID2 + 1.00000000E+00 2 1000022 2 # BR(~u_L -> ~chi_10 u) +# +# PDG Width +DECAY 2000002 1.00000000E+00 # sup_R decays +# BR NDA ID1 ID2 + 1.00000000E+00 2 1000022 2 # BR(~u_R -> ~chi_10 u) +# +# PDG Width +DECAY 1000001 1.00000000E+00 # sdown_L decays +# BR NDA ID1 ID2 + 1.00000000E+00 2 1000022 1 # BR(~d_L -> ~chi_10 d) +# +# PDG Width +DECAY 2000001 1.00000000E+00 # sdown_R decays +# BR NDA ID1 ID2 + 1.00000000E+00 2 1000022 1 # BR(~d_R -> ~chi_10 d) +# +# PDG Width +DECAY 1000004 1.00000000E+00 # scharm_L decays +# BR NDA ID1 ID2 + 1.00000000E+00 2 1000022 4 # BR(~c_L -> ~chi_10 c) +# +# PDG Width +DECAY 2000004 1.00000000E+00 # scharm_R decays +# BR NDA ID1 ID2 + 1.00000000E+00 2 1000022 4 # BR(~c_R -> ~chi_10 c) +# +# PDG Width +DECAY 1000003 1.00000000E+00 # sstrange_L decays +# BR NDA ID1 ID2 + 1.00000000E+00 2 1000022 3 # BR(~s_L -> ~chi_10 s) +# +# PDG Width +DECAY 2000003 1.00000000E+00 # sstrange_R decays +# BR NDA ID1 ID2 + 1.00000000E+00 2 1000022 3 # BR(~s_R -> ~chi_10 s) +# +# PDG Width +DECAY 1000011 0.00000000E+00 # selectron_L decays +DECAY 2000011 0.00000000E+00 # selectron_R decays +DECAY 1000013 0.00000000E+00 # smuon_L decays +DECAY 2000013 0.00000000E+00 # smuon_R decays +DECAY 1000015 0.00000000E+00 # stau_1 decays +DECAY 2000015 0.00000000E+00 # stau_2 decays +# +# PDG Width +DECAY 1000012 0.00000000E+00 # snu_elL decays +DECAY 1000014 0.00000000E+00 # snu_muL decays +DECAY 1000016 0.00000000E+00 # snu_tauL decays +# PDG Width +DECAY 1000024 2.02592183E-05 # chargino1+ decays +# BR NDA ID1 ID2 ID3 + 0.33333333E+00 3 1000022 -11 12 # BR(~chi_1+ -> ~chi_10 e+ nu_e) + 0.33333333E+00 3 1000022 -13 14 # BR(~chi_1+ -> ~chi_10 mu+ nu_mu) + 0.33333333E+00 3 1000022 -15 16 # BR(~chi_1+ -> ~chi_10 tau+ nu_tau) +# PDG Width +DECAY 1000037 0.00000000E+00 # chargino2+ decays +DECAY 1000023 1.00000000E-05 # neutralino2 decays + 0.33333333E+00 3 1000022 -11 11 # BR(~chi_1+ -> ~chi_10 e+ nu_e) + 0.33333333E+00 3 1000022 -13 13 # BR(~chi_1+ -> ~chi_10 mu+ nu_mu) + 0.33333333E+00 3 1000022 -15 15 # BR(~chi_1+ -> ~chi_10 tau+ nu_tau) +DECAY 1000025 0.00000000E+00 # neutralino3 decays +DECAY 1000035 0.00000000E+00 # neutralino4 decays +""" + +generator = cms.EDFilter("Pythia8GeneratorFilter", + pythiaPylistVerbosity = cms.untracked.int32(0), + filterEfficiency = cms.untracked.double(1.0), + pythiaHepMCVerbosity = cms.untracked.bool(False), + comEnergy = cms.double(13000), + SLHATableForPythia8 = cms.string(SLHA_TABLE), + maxEventsToPrint = cms.untracked.int32(0), + PythiaParameters = cms.PSet( + pythia8CommonSettingsBlock, + pythia8CP5SettingsBlock, + processParameters = cms.vstring( + 'SUSY:all = off', + 'SUSY:qqbar2chi0chi0 = on', + 'SUSY:qqbar2chi+-chi0 = on', + 'SUSY:qqbar2chi+chi- = on', + 'PhaseSpace:pTHatMin = 60.', + ), + parameterSets = cms.vstring( + 'pythia8CommonSettings', + 'pythia8CP5Settings', + 'processParameters' + ) + ) +) diff --git a/Configuration/Generator/python/SMS-T1tttt_mGl-1500_mLSP-100_13TeV-pythia8_cfi.py b/Configuration/Generator/python/SMS-T1tttt_mGl-1500_mLSP-100_13TeV-pythia8_cfi.py index c7f0b156728ec..4a53d3e688faa 100644 --- a/Configuration/Generator/python/SMS-T1tttt_mGl-1500_mLSP-100_13TeV-pythia8_cfi.py +++ b/Configuration/Generator/python/SMS-T1tttt_mGl-1500_mLSP-100_13TeV-pythia8_cfi.py @@ -247,7 +247,7 @@ DECAY 1000035 0.00000000E+00 # neutralino4 decays """ -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", pythiaPylistVerbosity = cms.untracked.int32(0), filterEfficiency = cms.untracked.double(1.0), pythiaHepMCVerbosity = cms.untracked.bool(False), diff --git a/Configuration/Generator/python/SMS-T1tttt_mGl-1500_mLSP-100_TuneCP5_14TeV_pythia8_cfi.py b/Configuration/Generator/python/SMS-T1tttt_mGl-1500_mLSP-100_TuneCP5_14TeV_pythia8_cfi.py index c303f50a5bb72..0e21f5399c5b0 100644 --- a/Configuration/Generator/python/SMS-T1tttt_mGl-1500_mLSP-100_TuneCP5_14TeV_pythia8_cfi.py +++ b/Configuration/Generator/python/SMS-T1tttt_mGl-1500_mLSP-100_TuneCP5_14TeV_pythia8_cfi.py @@ -247,7 +247,7 @@ DECAY 1000035 0.00000000E+00 # neutralino4 decays """ -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", pythiaPylistVerbosity = cms.untracked.int32(0), filterEfficiency = cms.untracked.double(1.0), pythiaHepMCVerbosity = cms.untracked.bool(False), diff --git a/Configuration/Generator/python/SoftQCDDiffractive_13TeV_pythia8_cff.py b/Configuration/Generator/python/SoftQCDDiffractive_13TeV_pythia8_cff.py index f905f933f4a0f..77015a618d6de 100644 --- a/Configuration/Generator/python/SoftQCDDiffractive_13TeV_pythia8_cff.py +++ b/Configuration/Generator/python/SoftQCDDiffractive_13TeV_pythia8_cff.py @@ -5,7 +5,7 @@ -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", crossSection = cms.untracked.double(71.39e+09), maxEventsToPrint = cms.untracked.int32(0), pythiaPylistVerbosity = cms.untracked.int32(1), diff --git a/Configuration/Generator/python/SoftQCDelastic_13TeV_pythia8_cff.py b/Configuration/Generator/python/SoftQCDelastic_13TeV_pythia8_cff.py index d03797ff95a7f..c6f3c42ac2626 100644 --- a/Configuration/Generator/python/SoftQCDelastic_13TeV_pythia8_cff.py +++ b/Configuration/Generator/python/SoftQCDelastic_13TeV_pythia8_cff.py @@ -5,7 +5,7 @@ -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", crossSection = cms.untracked.double(71.39e+09), maxEventsToPrint = cms.untracked.int32(0), pythiaPylistVerbosity = cms.untracked.int32(1), diff --git a/Configuration/Generator/python/SoftQCDinelastic_13TeV_pythia8_cff.py b/Configuration/Generator/python/SoftQCDinelastic_13TeV_pythia8_cff.py index 0b6549b3804e1..1afa5e18a6131 100644 --- a/Configuration/Generator/python/SoftQCDinelastic_13TeV_pythia8_cff.py +++ b/Configuration/Generator/python/SoftQCDinelastic_13TeV_pythia8_cff.py @@ -5,7 +5,7 @@ -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", crossSection = cms.untracked.double(71.39e+09), maxEventsToPrint = cms.untracked.int32(0), pythiaPylistVerbosity = cms.untracked.int32(1), diff --git a/Configuration/Generator/python/SoftQCDnonDiffractive_13TeV_pythia8_cff.py b/Configuration/Generator/python/SoftQCDnonDiffractive_13TeV_pythia8_cff.py index 6b4b50b1838e4..948b0a5729b30 100644 --- a/Configuration/Generator/python/SoftQCDnonDiffractive_13TeV_pythia8_cff.py +++ b/Configuration/Generator/python/SoftQCDnonDiffractive_13TeV_pythia8_cff.py @@ -5,7 +5,7 @@ -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", crossSection = cms.untracked.double(71.39e+09), maxEventsToPrint = cms.untracked.int32(0), pythiaPylistVerbosity = cms.untracked.int32(1), diff --git a/Configuration/Generator/python/TTbar012Jets_5f_NLO_FXFX_Madgraph_LHE_13TeV_cfi.py b/Configuration/Generator/python/TTbar012Jets_5f_NLO_FXFX_Madgraph_LHE_13TeV_cfi.py index cf4725da618d0..3128d2d78cd68 100644 --- a/Configuration/Generator/python/TTbar012Jets_5f_NLO_FXFX_Madgraph_LHE_13TeV_cfi.py +++ b/Configuration/Generator/python/TTbar012Jets_5f_NLO_FXFX_Madgraph_LHE_13TeV_cfi.py @@ -8,7 +8,8 @@ nEvents = cms.untracked.uint32(5000), numberOfParameters = cms.uint32(1), outputFile = cms.string('cmsgrid_final.lhe'), - scriptName = cms.FileInPath('GeneratorInterface/LHEInterface/data/run_generic_tarball_cvmfs.sh') + scriptName = cms.FileInPath('GeneratorInterface/LHEInterface/data/run_generic_tarball_cvmfs.sh'), + generateConcurrently = cms.untracked.bool(True) ) #Link to datacards: diff --git a/Configuration/Generator/python/TTbarLepton_13TeV_TuneCUETP8M1_cfi.py b/Configuration/Generator/python/TTbarLepton_13TeV_TuneCUETP8M1_cfi.py index ecba70bf9500c..bf29b0affac9e 100644 --- a/Configuration/Generator/python/TTbarLepton_13TeV_TuneCUETP8M1_cfi.py +++ b/Configuration/Generator/python/TTbarLepton_13TeV_TuneCUETP8M1_cfi.py @@ -2,7 +2,7 @@ from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", pythiaHepMCVerbosity = cms.untracked.bool(False), maxEventsToPrint = cms.untracked.int32(0), pythiaPylistVerbosity = cms.untracked.int32(0), diff --git a/Configuration/Generator/python/TTbarLepton_8TeV_TuneCUETP8M1_cfi.py b/Configuration/Generator/python/TTbarLepton_8TeV_TuneCUETP8M1_cfi.py index 52b6889a037ff..124c34db722cd 100644 --- a/Configuration/Generator/python/TTbarLepton_8TeV_TuneCUETP8M1_cfi.py +++ b/Configuration/Generator/python/TTbarLepton_8TeV_TuneCUETP8M1_cfi.py @@ -2,7 +2,7 @@ from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", pythiaHepMCVerbosity = cms.untracked.bool(False), maxEventsToPrint = cms.untracked.int32(0), pythiaPylistVerbosity = cms.untracked.int32(0), diff --git a/Configuration/Generator/python/TTbarToDilepton_mt172p5_TuneCP5_14TeV_pythia8_cfi.py b/Configuration/Generator/python/TTbarToDilepton_mt172p5_TuneCP5_14TeV_pythia8_cfi.py index d94cb5b3caed2..7a6a8d05d77b2 100644 --- a/Configuration/Generator/python/TTbarToDilepton_mt172p5_TuneCP5_14TeV_pythia8_cfi.py +++ b/Configuration/Generator/python/TTbarToDilepton_mt172p5_TuneCP5_14TeV_pythia8_cfi.py @@ -2,7 +2,7 @@ from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.MCTunes2017.PythiaCP5Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", pythiaHepMCVerbosity = cms.untracked.bool(False), maxEventsToPrint = cms.untracked.int32(0), pythiaPylistVerbosity = cms.untracked.int32(0), diff --git a/Configuration/Generator/python/TTbar_13TeV_TuneCUETP8M1_cfi.py b/Configuration/Generator/python/TTbar_13TeV_TuneCUETP8M1_cfi.py index 2f2a164bcfe41..23dc9ebbb35a0 100644 --- a/Configuration/Generator/python/TTbar_13TeV_TuneCUETP8M1_cfi.py +++ b/Configuration/Generator/python/TTbar_13TeV_TuneCUETP8M1_cfi.py @@ -2,7 +2,7 @@ from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", pythiaHepMCVerbosity = cms.untracked.bool(False), maxEventsToPrint = cms.untracked.int32(0), pythiaPylistVerbosity = cms.untracked.int32(0), diff --git a/Configuration/Generator/python/TTbar_14TeV_TuneCP5_cfi.py b/Configuration/Generator/python/TTbar_14TeV_TuneCP5_cfi.py index 2adc0878812f7..156823d1b6790 100644 --- a/Configuration/Generator/python/TTbar_14TeV_TuneCP5_cfi.py +++ b/Configuration/Generator/python/TTbar_14TeV_TuneCP5_cfi.py @@ -2,7 +2,7 @@ from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.MCTunes2017.PythiaCP5Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", pythiaHepMCVerbosity = cms.untracked.bool(False), maxEventsToPrint = cms.untracked.int32(0), pythiaPylistVerbosity = cms.untracked.int32(0), diff --git a/Configuration/Generator/python/TTbar_14TeV_TuneCUETP8M1_cfi.py b/Configuration/Generator/python/TTbar_14TeV_TuneCUETP8M1_cfi.py index 4cf4f54b47f94..f8c932a4c28dd 100644 --- a/Configuration/Generator/python/TTbar_14TeV_TuneCUETP8M1_cfi.py +++ b/Configuration/Generator/python/TTbar_14TeV_TuneCUETP8M1_cfi.py @@ -2,7 +2,7 @@ from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", pythiaHepMCVerbosity = cms.untracked.bool(False), maxEventsToPrint = cms.untracked.int32(0), pythiaPylistVerbosity = cms.untracked.int32(0), diff --git a/Configuration/Generator/python/TTbar_8TeV_TuneCUETP8M1_cfi.py b/Configuration/Generator/python/TTbar_8TeV_TuneCUETP8M1_cfi.py index bdb6616c13ba6..e6962a0df592a 100644 --- a/Configuration/Generator/python/TTbar_8TeV_TuneCUETP8M1_cfi.py +++ b/Configuration/Generator/python/TTbar_8TeV_TuneCUETP8M1_cfi.py @@ -2,7 +2,7 @@ from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", pythiaHepMCVerbosity = cms.untracked.bool(False), maxEventsToPrint = cms.untracked.int32(0), pythiaPylistVerbosity = cms.untracked.int32(0), diff --git a/Configuration/Generator/python/TauToMuMuMu_14TeV_TuneCP5_cfi.py b/Configuration/Generator/python/TauToMuMuMu_14TeV_TuneCP5_cfi.py index acab51bd844e9..9a85c27131d01 100644 --- a/Configuration/Generator/python/TauToMuMuMu_14TeV_TuneCP5_cfi.py +++ b/Configuration/Generator/python/TauToMuMuMu_14TeV_TuneCP5_cfi.py @@ -2,7 +2,7 @@ from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.MCTunes2017.PythiaCP5Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", pythiaHepMCVerbosity = cms.untracked.bool(False), maxEventsToPrint = cms.untracked.int32(0), pythiaPylistVerbosity = cms.untracked.int32(0), diff --git a/Configuration/Generator/python/UpsMM_8TeV_TuneCUETP8M1_cfi.py b/Configuration/Generator/python/UpsMM_8TeV_TuneCUETP8M1_cfi.py index 236cf933aa97c..debb3ba6e2226 100644 --- a/Configuration/Generator/python/UpsMM_8TeV_TuneCUETP8M1_cfi.py +++ b/Configuration/Generator/python/UpsMM_8TeV_TuneCUETP8M1_cfi.py @@ -3,7 +3,7 @@ from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import * import FWCore.ParameterSet.Config as cms -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", pythiaPylistVerbosity = cms.untracked.int32(0), filterEfficiency = cms.untracked.double(0.0757), pythiaHepMCVerbosity = cms.untracked.bool(False), diff --git a/Configuration/Generator/python/Upsilon1SToMuMu_forSTEAM_13TeV_TuneCUETP8M1_cfi.py b/Configuration/Generator/python/Upsilon1SToMuMu_forSTEAM_13TeV_TuneCUETP8M1_cfi.py index 21a77bda0dc78..1e3e73ae91d42 100644 --- a/Configuration/Generator/python/Upsilon1SToMuMu_forSTEAM_13TeV_TuneCUETP8M1_cfi.py +++ b/Configuration/Generator/python/Upsilon1SToMuMu_forSTEAM_13TeV_TuneCUETP8M1_cfi.py @@ -3,7 +3,7 @@ from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import * from Configuration.Generator.Pythia8BottomoniumSettings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", pythiaPylistVerbosity = cms.untracked.int32(0), filterEfficiency = cms.untracked.double(0.53), pythiaHepMCVerbosity = cms.untracked.bool(False), diff --git a/Configuration/Generator/python/Upsilon1SToMuMu_forSTEAM_14TeV_TuneCP5_cfi.py b/Configuration/Generator/python/Upsilon1SToMuMu_forSTEAM_14TeV_TuneCP5_cfi.py index 338f243b74140..a43ad8d24357d 100644 --- a/Configuration/Generator/python/Upsilon1SToMuMu_forSTEAM_14TeV_TuneCP5_cfi.py +++ b/Configuration/Generator/python/Upsilon1SToMuMu_forSTEAM_14TeV_TuneCP5_cfi.py @@ -3,7 +3,7 @@ from Configuration.Generator.MCTunes2017.PythiaCP5Settings_cfi import * from Configuration.Generator.Pythia8BottomoniumSettings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", pythiaPylistVerbosity = cms.untracked.int32(0), filterEfficiency = cms.untracked.double(0.53), pythiaHepMCVerbosity = cms.untracked.bool(False), diff --git a/Configuration/Generator/python/VBFHZZ4Nu_Pow_NNPDF30_LHE_13TeV_cff.py b/Configuration/Generator/python/VBFHZZ4Nu_Pow_NNPDF30_LHE_13TeV_cff.py index b843ca714c6c5..3656b6c35a6ba 100644 --- a/Configuration/Generator/python/VBFHZZ4Nu_Pow_NNPDF30_LHE_13TeV_cff.py +++ b/Configuration/Generator/python/VBFHZZ4Nu_Pow_NNPDF30_LHE_13TeV_cff.py @@ -8,5 +8,6 @@ nEvents = cms.untracked.uint32(5000), numberOfParameters = cms.uint32(1), outputFile = cms.string('cmsgrid_final.lhe'), - scriptName = cms.FileInPath('GeneratorInterface/LHEInterface/data/run_generic_tarball_cvmfs.sh') + scriptName = cms.FileInPath('GeneratorInterface/LHEInterface/data/run_generic_tarball_cvmfs.sh'), + generateConcurrently = cms.untracked.bool(True) ) diff --git a/Configuration/Generator/python/VBFHZZ4Nu_Pow_NNPDF30_LHE_13TeV_cfi.py b/Configuration/Generator/python/VBFHZZ4Nu_Pow_NNPDF30_LHE_13TeV_cfi.py index 2a6d918a81d3f..ea3435ffb8d8b 100644 --- a/Configuration/Generator/python/VBFHZZ4Nu_Pow_NNPDF30_LHE_13TeV_cfi.py +++ b/Configuration/Generator/python/VBFHZZ4Nu_Pow_NNPDF30_LHE_13TeV_cfi.py @@ -11,7 +11,8 @@ nEvents = cms.untracked.uint32(5000), numberOfParameters = cms.uint32(1), outputFile = cms.string('cmsgrid_final.lhe'), - scriptName = cms.FileInPath('GeneratorInterface/LHEInterface/data/run_generic_tarball_cvmfs.sh') + scriptName = cms.FileInPath('GeneratorInterface/LHEInterface/data/run_generic_tarball_cvmfs.sh'), + generateConcurrently = cms.untracked.bool(True) ) diff --git a/Configuration/Generator/python/VBFHZZ4Nu_TuneCP5_14TeV_pythia8_cfi.py b/Configuration/Generator/python/VBFHZZ4Nu_TuneCP5_14TeV_pythia8_cfi.py index 84cafcd9d62c4..d4b29e8f6e0d5 100644 --- a/Configuration/Generator/python/VBFHZZ4Nu_TuneCP5_14TeV_pythia8_cfi.py +++ b/Configuration/Generator/python/VBFHZZ4Nu_TuneCP5_14TeV_pythia8_cfi.py @@ -2,7 +2,7 @@ from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.MCTunes2017.PythiaCP5Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", pythiaHepMCVerbosity = cms.untracked.bool(False), comEnergy = cms.double(14000.0), maxEventsToPrint = cms.untracked.int32(0), diff --git a/Configuration/Generator/python/VBFHbb_Pow_NNPDF30_LHE_13TeV_cff.py b/Configuration/Generator/python/VBFHbb_Pow_NNPDF30_LHE_13TeV_cff.py index d7918efaca278..62d5934907233 100644 --- a/Configuration/Generator/python/VBFHbb_Pow_NNPDF30_LHE_13TeV_cff.py +++ b/Configuration/Generator/python/VBFHbb_Pow_NNPDF30_LHE_13TeV_cff.py @@ -8,5 +8,6 @@ nEvents = cms.untracked.uint32(5000), numberOfParameters = cms.uint32(1), outputFile = cms.string('cmsgrid_final.lhe'), - scriptName = cms.FileInPath('GeneratorInterface/LHEInterface/data/run_generic_tarball_cvmfs.sh') + scriptName = cms.FileInPath('GeneratorInterface/LHEInterface/data/run_generic_tarball_cvmfs.sh'), + generateConcurrently = cms.untracked.bool(True) ) diff --git a/Configuration/Generator/python/VBFHbb_Pow_NNPDF30_LHE_13TeV_cfi.py b/Configuration/Generator/python/VBFHbb_Pow_NNPDF30_LHE_13TeV_cfi.py index d4b107e50d1ba..aa5c396c252cc 100644 --- a/Configuration/Generator/python/VBFHbb_Pow_NNPDF30_LHE_13TeV_cfi.py +++ b/Configuration/Generator/python/VBFHbb_Pow_NNPDF30_LHE_13TeV_cfi.py @@ -11,7 +11,8 @@ nEvents = cms.untracked.uint32(5000), numberOfParameters = cms.uint32(1), outputFile = cms.string('cmsgrid_final.lhe'), - scriptName = cms.FileInPath('GeneratorInterface/LHEInterface/data/run_generic_tarball_cvmfs.sh') + scriptName = cms.FileInPath('GeneratorInterface/LHEInterface/data/run_generic_tarball_cvmfs.sh'), + generateConcurrently = cms.untracked.bool(True) ) diff --git a/Configuration/Generator/python/WE_13TeV_TuneCUETP8M1_cfi.py b/Configuration/Generator/python/WE_13TeV_TuneCUETP8M1_cfi.py index 1b68a919d7bf3..1f9b60ba4bdd0 100644 --- a/Configuration/Generator/python/WE_13TeV_TuneCUETP8M1_cfi.py +++ b/Configuration/Generator/python/WE_13TeV_TuneCUETP8M1_cfi.py @@ -2,7 +2,7 @@ from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", pythiaPylistVerbosity = cms.untracked.int32(0), filterEfficiency = cms.untracked.double(1.0), pythiaHepMCVerbosity = cms.untracked.bool(False), diff --git a/Configuration/Generator/python/WE_14TeV_TuneCUETP8M1_cfi.py b/Configuration/Generator/python/WE_14TeV_TuneCUETP8M1_cfi.py index 9d367ff5f746f..c788251974d7f 100644 --- a/Configuration/Generator/python/WE_14TeV_TuneCUETP8M1_cfi.py +++ b/Configuration/Generator/python/WE_14TeV_TuneCUETP8M1_cfi.py @@ -2,7 +2,7 @@ from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", pythiaPylistVerbosity = cms.untracked.int32(0), filterEfficiency = cms.untracked.double(1.0), pythiaHepMCVerbosity = cms.untracked.bool(False), diff --git a/Configuration/Generator/python/WE_8TeV_TuneCUETP8M1_cfi.py b/Configuration/Generator/python/WE_8TeV_TuneCUETP8M1_cfi.py index 8196b6fc9ad99..b114df6e87fda 100644 --- a/Configuration/Generator/python/WE_8TeV_TuneCUETP8M1_cfi.py +++ b/Configuration/Generator/python/WE_8TeV_TuneCUETP8M1_cfi.py @@ -2,7 +2,7 @@ from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", pythiaPylistVerbosity = cms.untracked.int32(0), filterEfficiency = cms.untracked.double(1.0), pythiaHepMCVerbosity = cms.untracked.bool(False), diff --git a/Configuration/Generator/python/WM_13TeV_TuneCUETP8M1_cfi.py b/Configuration/Generator/python/WM_13TeV_TuneCUETP8M1_cfi.py index bd9ca9538771e..11bed8b85d1dc 100644 --- a/Configuration/Generator/python/WM_13TeV_TuneCUETP8M1_cfi.py +++ b/Configuration/Generator/python/WM_13TeV_TuneCUETP8M1_cfi.py @@ -2,7 +2,7 @@ from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", pythiaPylistVerbosity = cms.untracked.int32(0), filterEfficiency = cms.untracked.double(1.0), pythiaHepMCVerbosity = cms.untracked.bool(False), diff --git a/Configuration/Generator/python/WM_8TeV_TuneCUETP8M1_cfi.py b/Configuration/Generator/python/WM_8TeV_TuneCUETP8M1_cfi.py index ab1f7675b1224..0b70bb38daa5f 100644 --- a/Configuration/Generator/python/WM_8TeV_TuneCUETP8M1_cfi.py +++ b/Configuration/Generator/python/WM_8TeV_TuneCUETP8M1_cfi.py @@ -2,7 +2,7 @@ from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", pythiaPylistVerbosity = cms.untracked.int32(0), filterEfficiency = cms.untracked.double(1.0), pythiaHepMCVerbosity = cms.untracked.bool(False), diff --git a/Configuration/Generator/python/WToLNu_13TeV_pythia8_cff.py b/Configuration/Generator/python/WToLNu_13TeV_pythia8_cff.py index e2a2f419daa4a..d605e41ad8927 100644 --- a/Configuration/Generator/python/WToLNu_13TeV_pythia8_cff.py +++ b/Configuration/Generator/python/WToLNu_13TeV_pythia8_cff.py @@ -5,7 +5,7 @@ -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", comEnergy = cms.double(13000.0), crossSection = cms.untracked.double(6.44), filterEfficiency = cms.untracked.double(1), diff --git a/Configuration/Generator/python/WToLNu_14TeV_TuneCP5_pythia8_cfi.py b/Configuration/Generator/python/WToLNu_14TeV_TuneCP5_pythia8_cfi.py index 0ab27b9359f09..f64588a1b1f84 100644 --- a/Configuration/Generator/python/WToLNu_14TeV_TuneCP5_pythia8_cfi.py +++ b/Configuration/Generator/python/WToLNu_14TeV_TuneCP5_pythia8_cfi.py @@ -2,7 +2,7 @@ from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.MCTunes2017.PythiaCP5Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", pythiaPylistVerbosity = cms.untracked.int32(0), filterEfficiency = cms.untracked.double(1.0), pythiaHepMCVerbosity = cms.untracked.bool(False), diff --git a/Configuration/Generator/python/WToMuNu_14TeV_TuneCP5_pythia8_cfi.py b/Configuration/Generator/python/WToMuNu_14TeV_TuneCP5_pythia8_cfi.py index d6f2fd727959d..d33bae46c6139 100644 --- a/Configuration/Generator/python/WToMuNu_14TeV_TuneCP5_pythia8_cfi.py +++ b/Configuration/Generator/python/WToMuNu_14TeV_TuneCP5_pythia8_cfi.py @@ -2,7 +2,7 @@ from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.MCTunes2017.PythiaCP5Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", pythiaPylistVerbosity = cms.untracked.int32(0), filterEfficiency = cms.untracked.double(1.0), pythiaHepMCVerbosity = cms.untracked.bool(False), diff --git a/Configuration/Generator/python/Wjet_Pt_3000_3500_13TeV_TuneCUETP8M1_cfi.py b/Configuration/Generator/python/Wjet_Pt_3000_3500_13TeV_TuneCUETP8M1_cfi.py index a44e154070ccc..399705abccc66 100644 --- a/Configuration/Generator/python/Wjet_Pt_3000_3500_13TeV_TuneCUETP8M1_cfi.py +++ b/Configuration/Generator/python/Wjet_Pt_3000_3500_13TeV_TuneCUETP8M1_cfi.py @@ -2,7 +2,7 @@ from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", pythiaHepMCVerbosity = cms.untracked.bool(False), maxEventsToPrint = cms.untracked.int32(0), pythiaPylistVerbosity = cms.untracked.int32(0), diff --git a/Configuration/Generator/python/Wjet_Pt_3000_3500_14TeV_TuneCUETP8M1_cfi.py b/Configuration/Generator/python/Wjet_Pt_3000_3500_14TeV_TuneCUETP8M1_cfi.py index a3402d0258d5d..9fef3ee8dc1e3 100644 --- a/Configuration/Generator/python/Wjet_Pt_3000_3500_14TeV_TuneCUETP8M1_cfi.py +++ b/Configuration/Generator/python/Wjet_Pt_3000_3500_14TeV_TuneCUETP8M1_cfi.py @@ -2,7 +2,7 @@ from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", pythiaHepMCVerbosity = cms.untracked.bool(False), maxEventsToPrint = cms.untracked.int32(0), pythiaPylistVerbosity = cms.untracked.int32(0), diff --git a/Configuration/Generator/python/Wjet_Pt_3000_3500_8TeV_TuneCUETP8M1_cfi.py b/Configuration/Generator/python/Wjet_Pt_3000_3500_8TeV_TuneCUETP8M1_cfi.py index 46c827d6ed6b0..121c989dd5a3c 100644 --- a/Configuration/Generator/python/Wjet_Pt_3000_3500_8TeV_TuneCUETP8M1_cfi.py +++ b/Configuration/Generator/python/Wjet_Pt_3000_3500_8TeV_TuneCUETP8M1_cfi.py @@ -2,7 +2,7 @@ from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", pythiaHepMCVerbosity = cms.untracked.bool(False), maxEventsToPrint = cms.untracked.int32(0), pythiaPylistVerbosity = cms.untracked.int32(0), diff --git a/Configuration/Generator/python/Wjet_Pt_80_120_13TeV_TuneCUETP8M1_cfi.py b/Configuration/Generator/python/Wjet_Pt_80_120_13TeV_TuneCUETP8M1_cfi.py index 76d1fc7c54a49..e609bb9a19bcb 100644 --- a/Configuration/Generator/python/Wjet_Pt_80_120_13TeV_TuneCUETP8M1_cfi.py +++ b/Configuration/Generator/python/Wjet_Pt_80_120_13TeV_TuneCUETP8M1_cfi.py @@ -2,7 +2,7 @@ from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", pythiaHepMCVerbosity = cms.untracked.bool(False), maxEventsToPrint = cms.untracked.int32(0), pythiaPylistVerbosity = cms.untracked.int32(0), diff --git a/Configuration/Generator/python/Wjet_Pt_80_120_14TeV_TuneCUETP8M1_cfi.py b/Configuration/Generator/python/Wjet_Pt_80_120_14TeV_TuneCUETP8M1_cfi.py index 44d4a001e7243..40a3757878b9a 100644 --- a/Configuration/Generator/python/Wjet_Pt_80_120_14TeV_TuneCUETP8M1_cfi.py +++ b/Configuration/Generator/python/Wjet_Pt_80_120_14TeV_TuneCUETP8M1_cfi.py @@ -2,7 +2,7 @@ from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", pythiaHepMCVerbosity = cms.untracked.bool(False), maxEventsToPrint = cms.untracked.int32(0), pythiaPylistVerbosity = cms.untracked.int32(0), diff --git a/Configuration/Generator/python/Wjet_Pt_80_120_8TeV_TuneCUETP8M1_cfi.py b/Configuration/Generator/python/Wjet_Pt_80_120_8TeV_TuneCUETP8M1_cfi.py index e6d8862d55f04..d080966ad8244 100644 --- a/Configuration/Generator/python/Wjet_Pt_80_120_8TeV_TuneCUETP8M1_cfi.py +++ b/Configuration/Generator/python/Wjet_Pt_80_120_8TeV_TuneCUETP8M1_cfi.py @@ -2,7 +2,7 @@ from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", pythiaHepMCVerbosity = cms.untracked.bool(False), maxEventsToPrint = cms.untracked.int32(0), pythiaPylistVerbosity = cms.untracked.int32(0), diff --git a/Configuration/Generator/python/WpM_13TeV_TuneCUETP8M1_cfi.py b/Configuration/Generator/python/WpM_13TeV_TuneCUETP8M1_cfi.py index a7daf31830b75..4bc78d6e92c5c 100644 --- a/Configuration/Generator/python/WpM_13TeV_TuneCUETP8M1_cfi.py +++ b/Configuration/Generator/python/WpM_13TeV_TuneCUETP8M1_cfi.py @@ -2,7 +2,7 @@ from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", pythiaHepMCVerbosity = cms.untracked.bool(False), maxEventsToPrint = cms.untracked.int32(0), pythiaPylistVerbosity = cms.untracked.int32(1), diff --git a/Configuration/Generator/python/WpM_8TeV_TuneCUETP8M1_cfi.py b/Configuration/Generator/python/WpM_8TeV_TuneCUETP8M1_cfi.py index a4b411d6e49b5..8ec1fb7fe94c9 100644 --- a/Configuration/Generator/python/WpM_8TeV_TuneCUETP8M1_cfi.py +++ b/Configuration/Generator/python/WpM_8TeV_TuneCUETP8M1_cfi.py @@ -2,7 +2,7 @@ from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", pythiaHepMCVerbosity = cms.untracked.bool(False), maxEventsToPrint = cms.untracked.int32(0), pythiaPylistVerbosity = cms.untracked.int32(1), diff --git a/Configuration/Generator/python/WprimeToENu_M-2000_TuneCUETP8M1_13TeV-pythia8_cff.py b/Configuration/Generator/python/WprimeToENu_M-2000_TuneCUETP8M1_13TeV-pythia8_cff.py index f3b3bf5b72fdb..2f6db18b8e8ee 100644 --- a/Configuration/Generator/python/WprimeToENu_M-2000_TuneCUETP8M1_13TeV-pythia8_cff.py +++ b/Configuration/Generator/python/WprimeToENu_M-2000_TuneCUETP8M1_13TeV-pythia8_cff.py @@ -5,7 +5,7 @@ from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", pythiaPylistVerbosity = cms.untracked.int32(1), filterEfficiency = cms.untracked.double(1), pythiaHepMCVerbosity = cms.untracked.bool(False), diff --git a/Configuration/Generator/python/WprimeToLNu_M2000_14TeV_TuneCP5_pythia8_cfi.py b/Configuration/Generator/python/WprimeToLNu_M2000_14TeV_TuneCP5_pythia8_cfi.py index 5f3c2c32ba905..e52494c368268 100644 --- a/Configuration/Generator/python/WprimeToLNu_M2000_14TeV_TuneCP5_pythia8_cfi.py +++ b/Configuration/Generator/python/WprimeToLNu_M2000_14TeV_TuneCP5_pythia8_cfi.py @@ -2,7 +2,7 @@ from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.MCTunes2017.PythiaCP5Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", pythiaHepMCVerbosity = cms.untracked.bool(False), maxEventsToPrint = cms.untracked.int32(0), pythiaPylistVerbosity = cms.untracked.int32(1), diff --git a/Configuration/Generator/python/WprimeTolNu_M3000_13TeV_pythia8_cff.py b/Configuration/Generator/python/WprimeTolNu_M3000_13TeV_pythia8_cff.py index cebfe1a256b5c..3343d2d14c0e2 100644 --- a/Configuration/Generator/python/WprimeTolNu_M3000_13TeV_pythia8_cff.py +++ b/Configuration/Generator/python/WprimeTolNu_M3000_13TeV_pythia8_cff.py @@ -3,7 +3,7 @@ from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.MCTunes2017.PythiaCP5Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", comEnergy = cms.double(13000.0), crossSection = cms.untracked.double(0.013), filterEfficiency = cms.untracked.double(1), diff --git a/Configuration/Generator/python/ZEEMM_13TeV_TuneCUETP8M1_cfi.py b/Configuration/Generator/python/ZEEMM_13TeV_TuneCUETP8M1_cfi.py index d64cb3dc117fe..4a5474b7dbffe 100644 --- a/Configuration/Generator/python/ZEEMM_13TeV_TuneCUETP8M1_cfi.py +++ b/Configuration/Generator/python/ZEEMM_13TeV_TuneCUETP8M1_cfi.py @@ -1,7 +1,7 @@ import FWCore.ParameterSet.Config as cms from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", pythiaHepMCVerbosity = cms.untracked.bool(False), maxEventsToPrint = cms.untracked.int32(0), pythiaPylistVerbosity = cms.untracked.int32(0), diff --git a/Configuration/Generator/python/ZEE_13TeV_TuneCUETP8M1_cfi.py b/Configuration/Generator/python/ZEE_13TeV_TuneCUETP8M1_cfi.py index 85805ba09807c..67a0a3f265376 100644 --- a/Configuration/Generator/python/ZEE_13TeV_TuneCUETP8M1_cfi.py +++ b/Configuration/Generator/python/ZEE_13TeV_TuneCUETP8M1_cfi.py @@ -2,7 +2,7 @@ from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", pythiaHepMCVerbosity = cms.untracked.bool(False), maxEventsToPrint = cms.untracked.int32(0), pythiaPylistVerbosity = cms.untracked.int32(0), diff --git a/Configuration/Generator/python/ZEE_14TeV_TuneCP5_cfi.py b/Configuration/Generator/python/ZEE_14TeV_TuneCP5_cfi.py index 309ef6743b07e..966bcbb04d7af 100644 --- a/Configuration/Generator/python/ZEE_14TeV_TuneCP5_cfi.py +++ b/Configuration/Generator/python/ZEE_14TeV_TuneCP5_cfi.py @@ -2,7 +2,7 @@ from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.MCTunes2017.PythiaCP5Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", pythiaHepMCVerbosity = cms.untracked.bool(False), maxEventsToPrint = cms.untracked.int32(0), pythiaPylistVerbosity = cms.untracked.int32(0), diff --git a/Configuration/Generator/python/ZEE_14TeV_TuneCUETP8M1_cfi.py b/Configuration/Generator/python/ZEE_14TeV_TuneCUETP8M1_cfi.py index 3d8c9a19c9f0e..ca4b20cb0fa51 100644 --- a/Configuration/Generator/python/ZEE_14TeV_TuneCUETP8M1_cfi.py +++ b/Configuration/Generator/python/ZEE_14TeV_TuneCUETP8M1_cfi.py @@ -2,7 +2,7 @@ from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", pythiaHepMCVerbosity = cms.untracked.bool(False), maxEventsToPrint = cms.untracked.int32(0), pythiaPylistVerbosity = cms.untracked.int32(0), diff --git a/Configuration/Generator/python/ZEE_8TeV_TuneCUETP8M1_cfi.py b/Configuration/Generator/python/ZEE_8TeV_TuneCUETP8M1_cfi.py index 654d7c12ee3f0..643accb4678d5 100644 --- a/Configuration/Generator/python/ZEE_8TeV_TuneCUETP8M1_cfi.py +++ b/Configuration/Generator/python/ZEE_8TeV_TuneCUETP8M1_cfi.py @@ -2,7 +2,7 @@ from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", pythiaHepMCVerbosity = cms.untracked.bool(False), maxEventsToPrint = cms.untracked.int32(0), pythiaPylistVerbosity = cms.untracked.int32(0), diff --git a/Configuration/Generator/python/ZMM_13TeV_TuneCUETP8M1_cfi.py b/Configuration/Generator/python/ZMM_13TeV_TuneCUETP8M1_cfi.py index 625ef9b224450..619e4560eb2a9 100644 --- a/Configuration/Generator/python/ZMM_13TeV_TuneCUETP8M1_cfi.py +++ b/Configuration/Generator/python/ZMM_13TeV_TuneCUETP8M1_cfi.py @@ -2,7 +2,7 @@ from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", pythiaHepMCVerbosity = cms.untracked.bool(False), maxEventsToPrint = cms.untracked.int32(0), pythiaPylistVerbosity = cms.untracked.int32(0), diff --git a/Configuration/Generator/python/ZMM_14TeV_TuneCP5_cfi.py b/Configuration/Generator/python/ZMM_14TeV_TuneCP5_cfi.py index dae81d9149055..75bda3ce3e01c 100644 --- a/Configuration/Generator/python/ZMM_14TeV_TuneCP5_cfi.py +++ b/Configuration/Generator/python/ZMM_14TeV_TuneCP5_cfi.py @@ -2,7 +2,7 @@ from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.MCTunes2017.PythiaCP5Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", pythiaHepMCVerbosity = cms.untracked.bool(False), maxEventsToPrint = cms.untracked.int32(0), pythiaPylistVerbosity = cms.untracked.int32(0), diff --git a/Configuration/Generator/python/ZMM_14TeV_TuneCUETP8M1_cfi.py b/Configuration/Generator/python/ZMM_14TeV_TuneCUETP8M1_cfi.py index fd2a3735e44fa..e090854eefc81 100644 --- a/Configuration/Generator/python/ZMM_14TeV_TuneCUETP8M1_cfi.py +++ b/Configuration/Generator/python/ZMM_14TeV_TuneCUETP8M1_cfi.py @@ -2,7 +2,7 @@ from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", pythiaHepMCVerbosity = cms.untracked.bool(False), maxEventsToPrint = cms.untracked.int32(0), pythiaPylistVerbosity = cms.untracked.int32(0), diff --git a/Configuration/Generator/python/ZMM_8TeV_TuneCUETP8M1_cfi.py b/Configuration/Generator/python/ZMM_8TeV_TuneCUETP8M1_cfi.py index 7f18fbfa5c9cf..476454143653e 100644 --- a/Configuration/Generator/python/ZMM_8TeV_TuneCUETP8M1_cfi.py +++ b/Configuration/Generator/python/ZMM_8TeV_TuneCUETP8M1_cfi.py @@ -2,7 +2,7 @@ from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", pythiaHepMCVerbosity = cms.untracked.bool(False), maxEventsToPrint = cms.untracked.int32(0), pythiaPylistVerbosity = cms.untracked.int32(0), diff --git a/Configuration/Generator/python/ZPrime5000JJ_8TeV_TuneCUETP8M1_cfi.py b/Configuration/Generator/python/ZPrime5000JJ_8TeV_TuneCUETP8M1_cfi.py index 946e637bb8b70..26dc0b20ea679 100644 --- a/Configuration/Generator/python/ZPrime5000JJ_8TeV_TuneCUETP8M1_cfi.py +++ b/Configuration/Generator/python/ZPrime5000JJ_8TeV_TuneCUETP8M1_cfi.py @@ -2,7 +2,7 @@ from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", #pythiaHepMCVerbosity = cms.untracked.bool(False), comEnergy = cms.double(13000.0), maxEventsToPrint = cms.untracked.int32(0), diff --git a/Configuration/Generator/python/ZTT_All_hadronic_13TeV_TuneCUETP8M1_cfi.py b/Configuration/Generator/python/ZTT_All_hadronic_13TeV_TuneCUETP8M1_cfi.py index e121555ef959e..05d4e44d5c934 100644 --- a/Configuration/Generator/python/ZTT_All_hadronic_13TeV_TuneCUETP8M1_cfi.py +++ b/Configuration/Generator/python/ZTT_All_hadronic_13TeV_TuneCUETP8M1_cfi.py @@ -2,7 +2,7 @@ from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", pythiaHepMCVerbosity = cms.untracked.bool(False), maxEventsToPrint = cms.untracked.int32(0), pythiaPylistVerbosity = cms.untracked.int32(0), diff --git a/Configuration/Generator/python/ZTT_All_hadronic_14TeV_TuneCP5_cfi.py b/Configuration/Generator/python/ZTT_All_hadronic_14TeV_TuneCP5_cfi.py index 942f178ad5432..88a3dfe88c096 100644 --- a/Configuration/Generator/python/ZTT_All_hadronic_14TeV_TuneCP5_cfi.py +++ b/Configuration/Generator/python/ZTT_All_hadronic_14TeV_TuneCP5_cfi.py @@ -2,7 +2,7 @@ from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.MCTunes2017.PythiaCP5Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", pythiaHepMCVerbosity = cms.untracked.bool(False), maxEventsToPrint = cms.untracked.int32(0), pythiaPylistVerbosity = cms.untracked.int32(0), diff --git a/Configuration/Generator/python/ZTT_All_hadronic_14TeV_TuneCUETP8M1_cfi.py b/Configuration/Generator/python/ZTT_All_hadronic_14TeV_TuneCUETP8M1_cfi.py index e7ec7bfe423cf..0c34757662742 100644 --- a/Configuration/Generator/python/ZTT_All_hadronic_14TeV_TuneCUETP8M1_cfi.py +++ b/Configuration/Generator/python/ZTT_All_hadronic_14TeV_TuneCUETP8M1_cfi.py @@ -2,7 +2,7 @@ from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", pythiaHepMCVerbosity = cms.untracked.bool(False), maxEventsToPrint = cms.untracked.int32(0), pythiaPylistVerbosity = cms.untracked.int32(0), diff --git a/Configuration/Generator/python/ZTT_All_hadronic_8TeV_TuneCUETP8M1_cfi.py b/Configuration/Generator/python/ZTT_All_hadronic_8TeV_TuneCUETP8M1_cfi.py index b4824f236e099..040510dc48470 100644 --- a/Configuration/Generator/python/ZTT_All_hadronic_8TeV_TuneCUETP8M1_cfi.py +++ b/Configuration/Generator/python/ZTT_All_hadronic_8TeV_TuneCUETP8M1_cfi.py @@ -2,7 +2,7 @@ from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", pythiaHepMCVerbosity = cms.untracked.bool(False), maxEventsToPrint = cms.untracked.int32(0), pythiaPylistVerbosity = cms.untracked.int32(0), diff --git a/Configuration/Generator/python/ZTT_Tauola_OneLepton_OtherHadrons_8TeV_TuneCUETP8M1_ExtGen_cfi.py b/Configuration/Generator/python/ZTT_Tauola_OneLepton_OtherHadrons_8TeV_TuneCUETP8M1_ExtGen_cfi.py new file mode 100644 index 0000000000000..4efa414036615 --- /dev/null +++ b/Configuration/Generator/python/ZTT_Tauola_OneLepton_OtherHadrons_8TeV_TuneCUETP8M1_ExtGen_cfi.py @@ -0,0 +1,40 @@ +import FWCore.ParameterSet.Config as cms +from Configuration.Generator.Pythia8CommonSettings_cfi import * +from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import * +from GeneratorInterface.ExternalDecays.TauolaSettings_cff import * + +_generator = cms.EDFilter("Pythia8GeneratorFilter", + pythiaHepMCVerbosity = cms.untracked.bool(False), + maxEventsToPrint = cms.untracked.int32(0), + pythiaPylistVerbosity = cms.untracked.int32(0), + filterEfficiency = cms.untracked.double(1.0), + comEnergy = cms.double(8000.0), + ExternalDecays = cms.PSet( + Tauola = cms.untracked.PSet( + TauolaPolar, + InputCards = cms.PSet( + pjak1 = cms.int32(0), + pjak2 = cms.int32(0), + mdtau = cms.int32(214) + ), + ), + parameterSets = cms.vstring('Tauola') + ), + PythiaParameters = cms.PSet( + pythia8CommonSettingsBlock, + pythia8CUEP8M1SettingsBlock, + processParameters = cms.vstring( + 'WeakSingleBoson:ffbar2gmZ = on', + '23:onMode = off', + '23:onIfAny = 15', + 'PhaseSpace:mHatMin = 75.', + ), + parameterSets = cms.vstring('pythia8CommonSettings', + 'pythia8CUEP8M1Settings', + 'processParameters', + ) + ) + ) + +from GeneratorInterface.Core.ExternalGeneratorFilter import ExternalGeneratorFilter +generator = ExternalGeneratorFilter(_generator, _external_process_components_=cms.vstring("HepPDTESSource")) \ No newline at end of file diff --git a/Configuration/Generator/python/ZmumuJets_Pt_20_300_GEN_13TeV_TuneCUETP8M1_cfg.py b/Configuration/Generator/python/ZmumuJets_Pt_20_300_GEN_13TeV_TuneCUETP8M1_cfg.py index ac0806b9d21eb..3bcffa5bf479d 100644 --- a/Configuration/Generator/python/ZmumuJets_Pt_20_300_GEN_13TeV_TuneCUETP8M1_cfg.py +++ b/Configuration/Generator/python/ZmumuJets_Pt_20_300_GEN_13TeV_TuneCUETP8M1_cfg.py @@ -2,7 +2,7 @@ from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", #pythiaHepMCVerbosity = cms.untracked.bool(False), maxEventsToPrint = cms.untracked.int32(0), pythiaPylistVerbosity = cms.untracked.int32(0), diff --git a/Configuration/Generator/python/ZpEE_2250_13TeV_Tauola_TuneCUETP8M1_cfi.py b/Configuration/Generator/python/ZpEE_2250_13TeV_Tauola_TuneCUETP8M1_cfi.py index c71f8e5819813..131a9fff76d7d 100644 --- a/Configuration/Generator/python/ZpEE_2250_13TeV_Tauola_TuneCUETP8M1_cfi.py +++ b/Configuration/Generator/python/ZpEE_2250_13TeV_Tauola_TuneCUETP8M1_cfi.py @@ -2,7 +2,7 @@ from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", #pythiaHepMCVerbosity = cms.untracked.bool(False), comEnergy = cms.double(13000.0), maxEventsToPrint = cms.untracked.int32(0), diff --git a/Configuration/Generator/python/ZpEE_2250_13TeV_TuneCUETP8M1_cfi.py b/Configuration/Generator/python/ZpEE_2250_13TeV_TuneCUETP8M1_cfi.py index c71f8e5819813..131a9fff76d7d 100644 --- a/Configuration/Generator/python/ZpEE_2250_13TeV_TuneCUETP8M1_cfi.py +++ b/Configuration/Generator/python/ZpEE_2250_13TeV_TuneCUETP8M1_cfi.py @@ -2,7 +2,7 @@ from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", #pythiaHepMCVerbosity = cms.untracked.bool(False), comEnergy = cms.double(13000.0), maxEventsToPrint = cms.untracked.int32(0), diff --git a/Configuration/Generator/python/ZpEE_2250_8TeV_TuneCUETP8M1_cfi.py b/Configuration/Generator/python/ZpEE_2250_8TeV_TuneCUETP8M1_cfi.py index 70c828f67a3ce..a2c141672676b 100644 --- a/Configuration/Generator/python/ZpEE_2250_8TeV_TuneCUETP8M1_cfi.py +++ b/Configuration/Generator/python/ZpEE_2250_8TeV_TuneCUETP8M1_cfi.py @@ -2,7 +2,7 @@ from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", #pythiaHepMCVerbosity = cms.untracked.bool(False), comEnergy = cms.double(8000.0), maxEventsToPrint = cms.untracked.int32(0), diff --git a/Configuration/Generator/python/ZpMM_13TeV_TuneCUETP8M1_cfi.py b/Configuration/Generator/python/ZpMM_13TeV_TuneCUETP8M1_cfi.py index 138950a1e4eb1..aa1deb9b22790 100644 --- a/Configuration/Generator/python/ZpMM_13TeV_TuneCUETP8M1_cfi.py +++ b/Configuration/Generator/python/ZpMM_13TeV_TuneCUETP8M1_cfi.py @@ -2,7 +2,7 @@ from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", pythiaHepMCVerbosity = cms.untracked.bool(False), comEnergy = cms.double(13000.0), maxEventsToPrint = cms.untracked.int32(0), diff --git a/Configuration/Generator/python/ZpMM_2250_13TeV_Tauola_TuneCUETP8M1_cfi.py b/Configuration/Generator/python/ZpMM_2250_13TeV_Tauola_TuneCUETP8M1_cfi.py index 5cbcd9e4eb7e1..b606e0906d648 100644 --- a/Configuration/Generator/python/ZpMM_2250_13TeV_Tauola_TuneCUETP8M1_cfi.py +++ b/Configuration/Generator/python/ZpMM_2250_13TeV_Tauola_TuneCUETP8M1_cfi.py @@ -2,7 +2,7 @@ from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", #pythiaHepMCVerbosity = cms.untracked.bool(False), comEnergy = cms.double(13000.0), maxEventsToPrint = cms.untracked.int32(0), diff --git a/Configuration/Generator/python/ZpMM_2250_13TeV_TuneCUETP8M1_cfi.py b/Configuration/Generator/python/ZpMM_2250_13TeV_TuneCUETP8M1_cfi.py index 5cbcd9e4eb7e1..b606e0906d648 100644 --- a/Configuration/Generator/python/ZpMM_2250_13TeV_TuneCUETP8M1_cfi.py +++ b/Configuration/Generator/python/ZpMM_2250_13TeV_TuneCUETP8M1_cfi.py @@ -2,7 +2,7 @@ from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", #pythiaHepMCVerbosity = cms.untracked.bool(False), comEnergy = cms.double(13000.0), maxEventsToPrint = cms.untracked.int32(0), diff --git a/Configuration/Generator/python/ZpMM_2250_8TeV_TuneCUETP8M1_cfi.py b/Configuration/Generator/python/ZpMM_2250_8TeV_TuneCUETP8M1_cfi.py index a9bb1855a36ed..ba08583d51a03 100644 --- a/Configuration/Generator/python/ZpMM_2250_8TeV_TuneCUETP8M1_cfi.py +++ b/Configuration/Generator/python/ZpMM_2250_8TeV_TuneCUETP8M1_cfi.py @@ -2,7 +2,7 @@ from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", #pythiaHepMCVerbosity = cms.untracked.bool(False), comEnergy = cms.double(8000.0), maxEventsToPrint = cms.untracked.int32(0), diff --git a/Configuration/Generator/python/ZpMM_8TeV_TuneCUETP8M1_cfi.py b/Configuration/Generator/python/ZpMM_8TeV_TuneCUETP8M1_cfi.py index d7e1d96107cd4..cf3c598d7e846 100644 --- a/Configuration/Generator/python/ZpMM_8TeV_TuneCUETP8M1_cfi.py +++ b/Configuration/Generator/python/ZpMM_8TeV_TuneCUETP8M1_cfi.py @@ -2,7 +2,7 @@ from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", pythiaHepMCVerbosity = cms.untracked.bool(False), comEnergy = cms.double(8000.0), maxEventsToPrint = cms.untracked.int32(0), diff --git a/Configuration/Generator/python/ZpTT_1500_13TeV_TuneCUETP8M1_cfi.py b/Configuration/Generator/python/ZpTT_1500_13TeV_TuneCUETP8M1_cfi.py index 8aa09a04bedda..abdee33185345 100644 --- a/Configuration/Generator/python/ZpTT_1500_13TeV_TuneCUETP8M1_cfi.py +++ b/Configuration/Generator/python/ZpTT_1500_13TeV_TuneCUETP8M1_cfi.py @@ -2,7 +2,7 @@ from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", #pythiaHepMCVerbosity = cms.untracked.bool(False), comEnergy = cms.double(13000.0), maxEventsToPrint = cms.untracked.int32(0), diff --git a/Configuration/Generator/python/ZpTT_1500_14TeV_TuneCP5_cfi.py b/Configuration/Generator/python/ZpTT_1500_14TeV_TuneCP5_cfi.py index a0875b36c1bd0..c85e0c7061fde 100644 --- a/Configuration/Generator/python/ZpTT_1500_14TeV_TuneCP5_cfi.py +++ b/Configuration/Generator/python/ZpTT_1500_14TeV_TuneCP5_cfi.py @@ -2,7 +2,7 @@ from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.MCTunes2017.PythiaCP5Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", #pythiaHepMCVerbosity = cms.untracked.bool(False), comEnergy = cms.double(14000.0), maxEventsToPrint = cms.untracked.int32(0), diff --git a/Configuration/Generator/python/ZpTT_1500_8TeV_TuneCUETP8M1_cfi.py b/Configuration/Generator/python/ZpTT_1500_8TeV_TuneCUETP8M1_cfi.py index 2dbd2b551b1d9..758a21cc4a6e7 100644 --- a/Configuration/Generator/python/ZpTT_1500_8TeV_TuneCUETP8M1_cfi.py +++ b/Configuration/Generator/python/ZpTT_1500_8TeV_TuneCUETP8M1_cfi.py @@ -2,7 +2,7 @@ from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", #pythiaHepMCVerbosity = cms.untracked.bool(False), comEnergy = cms.double(8000.0), maxEventsToPrint = cms.untracked.int32(0), diff --git a/Configuration/Generator/python/ZpToEE_m6000_TuneCP5_14TeV_pythia8_cfi.py b/Configuration/Generator/python/ZpToEE_m6000_TuneCP5_14TeV_pythia8_cfi.py index 30501a7412bb2..bd1dc7b2f1cac 100644 --- a/Configuration/Generator/python/ZpToEE_m6000_TuneCP5_14TeV_pythia8_cfi.py +++ b/Configuration/Generator/python/ZpToEE_m6000_TuneCP5_14TeV_pythia8_cfi.py @@ -2,7 +2,7 @@ from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.MCTunes2017.PythiaCP5Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", pythiaHepMCVerbosity = cms.untracked.bool(False), comEnergy = cms.double(14000.0), maxEventsToPrint = cms.untracked.int32(0), diff --git a/Configuration/Generator/python/ZpToMM_m6000_TuneCP5_14TeV_pythia8_cfi.py b/Configuration/Generator/python/ZpToMM_m6000_TuneCP5_14TeV_pythia8_cfi.py index d160723c7b466..c1dd5179b91e9 100644 --- a/Configuration/Generator/python/ZpToMM_m6000_TuneCP5_14TeV_pythia8_cfi.py +++ b/Configuration/Generator/python/ZpToMM_m6000_TuneCP5_14TeV_pythia8_cfi.py @@ -2,7 +2,7 @@ from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.MCTunes2017.PythiaCP5Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", pythiaHepMCVerbosity = cms.untracked.bool(False), comEnergy = cms.double(14000.0), maxEventsToPrint = cms.untracked.int32(0), diff --git a/Configuration/Generator/python/ZprimeToll_M3000_13TeV_pythia8_cff.py b/Configuration/Generator/python/ZprimeToll_M3000_13TeV_pythia8_cff.py index 5752a0c94bbb9..a94aaa948cab0 100644 --- a/Configuration/Generator/python/ZprimeToll_M3000_13TeV_pythia8_cff.py +++ b/Configuration/Generator/python/ZprimeToll_M3000_13TeV_pythia8_cff.py @@ -3,7 +3,7 @@ from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.MCTunes2017.PythiaCP5Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", comEnergy = cms.double(13000.0), crossSection = cms.untracked.double(0.013), filterEfficiency = cms.untracked.double(1), diff --git a/Configuration/Generator/python/bJpsiX_8TeV_TuneCUETP8M1_cfi.py b/Configuration/Generator/python/bJpsiX_8TeV_TuneCUETP8M1_cfi.py index 564a2e2ead1e4..b5694d5f6132b 100644 --- a/Configuration/Generator/python/bJpsiX_8TeV_TuneCUETP8M1_cfi.py +++ b/Configuration/Generator/python/bJpsiX_8TeV_TuneCUETP8M1_cfi.py @@ -1,7 +1,7 @@ import FWCore.ParameterSet.Config as cms from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import * -generator = cms.EDFilter("Pythia8GeneratorFilter", +generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter", pythiaPylistVerbosity = cms.untracked.int32(0), filterEfficiency = cms.untracked.double(0.00013), pythiaHepMCVerbosity = cms.untracked.bool(False), diff --git a/Configuration/Generator/python/concurrentLumisDisable.py b/Configuration/Generator/python/concurrentLumisDisable.py new file mode 100644 index 0000000000000..5c0f3b851d9b5 --- /dev/null +++ b/Configuration/Generator/python/concurrentLumisDisable.py @@ -0,0 +1,17 @@ +# list of generator EDModules (C++ type) that do not support concurrentLuminosityBlocks +noConcurrentLumiGenerators = [ + "AMPTGeneratorFilter", + "BeamHaloProducer", + "CosMuoGenProducer", + "Herwig7GeneratorFilter", + "HydjetGeneratorFilter", + "PyquenGeneratorFilter", + "Pythia6GeneratorFilter", + "Pythia8EGun", + "Pythia8GeneratorFilter", + "Pythia8HadronizerFilter", + "Pythia8PtAndDxyGun", + "Pythia8PtGun", + "ReggeGribovPartonMCGeneratorFilter", + "SherpaGeneratorFilter", +] diff --git a/Configuration/Generator/python/sherpa_ttbar_2j_MENLOPS_13TeV_MASTER_ExtGen_cff.py b/Configuration/Generator/python/sherpa_ttbar_2j_MENLOPS_13TeV_MASTER_ExtGen_cff.py new file mode 100644 index 0000000000000..06fa6024f2e42 --- /dev/null +++ b/Configuration/Generator/python/sherpa_ttbar_2j_MENLOPS_13TeV_MASTER_ExtGen_cff.py @@ -0,0 +1,67 @@ +import FWCore.ParameterSet.Config as cms +import os + +source = cms.Source("EmptySource") + +_generator = cms.EDFilter("SherpaGeneratorFilter", + maxEventsToPrint = cms.int32(0), + filterEfficiency = cms.untracked.double(1.0), + crossSection = cms.untracked.double(-1), + SherpaProcess = cms.string('ttbar_2j_MENLOPS_13TeV'), + SherpackLocation = cms.string('/cvmfs/cms.cern.ch/phys_generator/gridpacks/slc7_amd64_gcc820/13TeV/sherpa/2.2.8'), + SherpackChecksum = cms.string('4efdf38e0d189d58c65a554ef901d027'), + FetchSherpack = cms.bool(True), + SherpaPath = cms.string('./'), + SherpaPathPiece = cms.string('./'), + SherpaResultDir = cms.string('Result'), + SherpaDefaultWeight = cms.double(1.0), + SherpaParameters = cms.PSet(parameterSets = cms.vstring( + "MPI_Cross_Sections", + "Run"), + MPI_Cross_Sections = cms.vstring( + " MPIs in Sherpa, Model = Amisic:", + " semihard xsec = 39.5554 mb,", + " non-diffractive xsec = 17.0318 mb with nd factor = 0.3142." + ), + Run = cms.vstring( + " (run){", + " CORE_SCALE TTBar;", + " METS_BBAR_MODE 5;", + " NJET:=2; LJET:=2; QCUT:=20.;", + " ME_SIGNAL_GENERATOR Comix Amegic LOOPGEN;", + " OL_PREFIX={0} ".format(os.environ['CMS_OPENLOOPS_PREFIX']), + " LOOPGEN:=OpenLoops;", + " MI_HANDLER=Amisic;", + " NLO_SMEAR_THRESHOLD 1;", + " NLO_SMEAR_POWER 2;", + " HARD_DECAYS On;", + " HARD_SPIN_CORRELATIONS=1;", + " SOFT_SPIN_CORRELATIONS=1;", + " PDF_LIBRARY LHAPDFSherpa;", + " PDF_SET NNPDF31_nnlo_hessian_pdfas;", + " USE_PDF_ALPHAS=1;", + " BEAM_1=2212; BEAM_ENERGY_1=6500;", + " BEAM_2=2212; BEAM_ENERGY_2=6500;", + " STABLE[6] 0; WIDTH[6] 0; STABLE[24] 0;", + " EXCLUSIVE_CLUSTER_MODE 1;", + " HEPMC_TREE_LIKE=1;", + " PRETTY_PRINT=Off;", + "}(run)", + " (processes){", + " Process : 93 93 -> 6 -6 93{NJET};", + " Order (*,0); CKKW sqr(QCUT/E_CMS);", + " NLO_QCD_Mode MC@NLO {LJET};", + " ME_Generator Amegic {LJET};", + " RS_ME_Generator Comix {LJET};", + " Loop_Generator LOOPGEN {LJET};", + " Integration_Error 0.05 {3,4};", + " End process;", + "}(processes)" + ), + ) +) + +from GeneratorInterface.Core.ExternalGeneratorFilter import ExternalGeneratorFilter +generator = ExternalGeneratorFilter(_generator) + +ProductionFilterSequence = cms.Sequence(generator) diff --git a/Configuration/Geometry/README.md b/Configuration/Geometry/README.md index eda01e110afeb..0e55329cb4558 100644 --- a/Configuration/Geometry/README.md +++ b/Configuration/Geometry/README.md @@ -1,3 +1,18 @@ +# To work on geometry package + +### To create or update geometries +``` +git cms-addpkg Geometry/CMSCommonData +git cms-addpkg Configuration/Geometry +scram b -j 8 +cd Configuration/Geometry +vi python/dict2021Geometry.py +python3 ./scripts/generate2021Geometry.py -D 2021 +``` +Note: +* For Phase-2, use [generate2026Geometry.py](./python/dict2026Geometry.py) and [generate2026Geometry.py](./scripts/generate2026Geometry.py) instead. +* For the list of geometries, see below. + # Run 3 Geometries The Run 3 geometry is automatically created using the script [generate2021Geometry.py](./scripts/generate2021Geometry.py). @@ -23,20 +38,22 @@ PPS: * P3: 2021 baseline (same as P2 but removing common materials) * P4: 2021 baseline (same as P2 or P3 but using the same Vacuum) * P5: new Run3 detectors +* P6: Same as P5 but with unique names for materials The script also handles the common and forward elements of the geometry: * O3: 2021 baseline * O4: as O3, but with zero material * O5: as O3, but with trackermaterial removed (they are in T5, T6, T7, T8) +* O6: Replaces O3 as baseline to remove duplicate material definition * F1: 2021 baseline Several detector combinations have been generated: -* 2021 = T3+C1+M1+P4+O3+F1 -* 2021ZeroMaterial = T4+C1+M1+P4+O4+F1 -* 2021FlatMinus05Percent = T5+C1+M1+P4+O5+F1 -* 2021FlatMinus10Percent = T6+C1+M1+P4+O5+F1 -* 2021FlatPlus05Percent = T7+C1+M1+P4+O5+F1 -* 2021FlatPlus10Percent = T8+C1+M1+P4+O5+F1 +* 2021 = T3+C1+M1+P6+O6+F1 +* 2021ZeroMaterial = T4+C1+M1+P6+O4+F1 +* 2021FlatMinus05Percent = T5+C1+M1+P6+O5+F1 +* 2021FlatMinus10Percent = T6+C1+M1+P6+O5+F1 +* 2021FlatPlus05Percent = T7+C1+M1+P6+O5+F1 +* 2021FlatPlus10Percent = T8+C1+M1+P6+O5+F1 # Phase 2 Geometries diff --git a/Configuration/Geometry/python/GeometryDD4hepExtended2021FlatMinus05PercentReco_cff.py b/Configuration/Geometry/python/GeometryDD4hepExtended2021FlatMinus05PercentReco_cff.py index 0e921c0acea74..3cc9ae3004e21 100644 --- a/Configuration/Geometry/python/GeometryDD4hepExtended2021FlatMinus05PercentReco_cff.py +++ b/Configuration/Geometry/python/GeometryDD4hepExtended2021FlatMinus05PercentReco_cff.py @@ -12,7 +12,6 @@ from Geometry.TrackerGeometryBuilder.trackerParameters_cff import * from Geometry.TrackerNumberingBuilder.trackerTopology_cfi import * from Geometry.TrackerGeometryBuilder.idealForDigiTrackerGeometry_cff import * -trackerGeometry.applyAlignment = cms.bool(False) # calo from Geometry.CaloEventSetup.CaloTopology_cfi import * diff --git a/Configuration/Geometry/python/GeometryDD4hepExtended2021FlatMinus10PercentReco_cff.py b/Configuration/Geometry/python/GeometryDD4hepExtended2021FlatMinus10PercentReco_cff.py index 469e47feb7236..53fdfe55fdf7f 100644 --- a/Configuration/Geometry/python/GeometryDD4hepExtended2021FlatMinus10PercentReco_cff.py +++ b/Configuration/Geometry/python/GeometryDD4hepExtended2021FlatMinus10PercentReco_cff.py @@ -12,7 +12,6 @@ from Geometry.TrackerGeometryBuilder.trackerParameters_cff import * from Geometry.TrackerNumberingBuilder.trackerTopology_cfi import * from Geometry.TrackerGeometryBuilder.idealForDigiTrackerGeometry_cff import * -trackerGeometry.applyAlignment = cms.bool(False) # calo from Geometry.CaloEventSetup.CaloTopology_cfi import * diff --git a/Configuration/Geometry/python/GeometryDD4hepExtended2021FlatPlus05PercentReco_cff.py b/Configuration/Geometry/python/GeometryDD4hepExtended2021FlatPlus05PercentReco_cff.py index 19aac45a7d9e7..898420b813bc8 100644 --- a/Configuration/Geometry/python/GeometryDD4hepExtended2021FlatPlus05PercentReco_cff.py +++ b/Configuration/Geometry/python/GeometryDD4hepExtended2021FlatPlus05PercentReco_cff.py @@ -12,7 +12,6 @@ from Geometry.TrackerGeometryBuilder.trackerParameters_cff import * from Geometry.TrackerNumberingBuilder.trackerTopology_cfi import * from Geometry.TrackerGeometryBuilder.idealForDigiTrackerGeometry_cff import * -trackerGeometry.applyAlignment = cms.bool(False) # calo from Geometry.CaloEventSetup.CaloTopology_cfi import * diff --git a/Configuration/Geometry/python/GeometryDD4hepExtended2021FlatPlus10PercentReco_cff.py b/Configuration/Geometry/python/GeometryDD4hepExtended2021FlatPlus10PercentReco_cff.py index 6ca4b2f0b6b6c..ac606c5857577 100644 --- a/Configuration/Geometry/python/GeometryDD4hepExtended2021FlatPlus10PercentReco_cff.py +++ b/Configuration/Geometry/python/GeometryDD4hepExtended2021FlatPlus10PercentReco_cff.py @@ -12,7 +12,6 @@ from Geometry.TrackerGeometryBuilder.trackerParameters_cff import * from Geometry.TrackerNumberingBuilder.trackerTopology_cfi import * from Geometry.TrackerGeometryBuilder.idealForDigiTrackerGeometry_cff import * -trackerGeometry.applyAlignment = cms.bool(False) # calo from Geometry.CaloEventSetup.CaloTopology_cfi import * diff --git a/Configuration/Geometry/python/GeometryDD4hepExtended2021Reco_cff.py b/Configuration/Geometry/python/GeometryDD4hepExtended2021Reco_cff.py index 8b94a6b3d9f79..bb0eed90f8e97 100644 --- a/Configuration/Geometry/python/GeometryDD4hepExtended2021Reco_cff.py +++ b/Configuration/Geometry/python/GeometryDD4hepExtended2021Reco_cff.py @@ -12,7 +12,6 @@ from Geometry.TrackerGeometryBuilder.trackerParameters_cff import * from Geometry.TrackerNumberingBuilder.trackerTopology_cfi import * from Geometry.TrackerGeometryBuilder.idealForDigiTrackerGeometry_cff import * -trackerGeometry.applyAlignment = cms.bool(False) # calo from Geometry.CaloEventSetup.CaloTopology_cfi import * diff --git a/Configuration/Geometry/python/GeometryDD4hepExtended2021ZeroMaterialReco_cff.py b/Configuration/Geometry/python/GeometryDD4hepExtended2021ZeroMaterialReco_cff.py index b9ae26ff64194..2b687c4b806f1 100644 --- a/Configuration/Geometry/python/GeometryDD4hepExtended2021ZeroMaterialReco_cff.py +++ b/Configuration/Geometry/python/GeometryDD4hepExtended2021ZeroMaterialReco_cff.py @@ -12,7 +12,6 @@ from Geometry.TrackerGeometryBuilder.trackerParameters_cff import * from Geometry.TrackerNumberingBuilder.trackerTopology_cfi import * from Geometry.TrackerGeometryBuilder.idealForDigiTrackerGeometry_cff import * -trackerGeometry.applyAlignment = cms.bool(False) # calo from Geometry.CaloEventSetup.CaloTopology_cfi import * diff --git a/Configuration/Geometry/python/GeometryDDDSimDB_cff.py b/Configuration/Geometry/python/GeometryDDDSimDB_cff.py index f78a9d05efb85..cfdc361714b58 100644 --- a/Configuration/Geometry/python/GeometryDDDSimDB_cff.py +++ b/Configuration/Geometry/python/GeometryDDDSimDB_cff.py @@ -4,12 +4,14 @@ # Geometry master configuration # # Ideal geometry, needed for simulation +# +# Strictly xpeaking muonOffsetESProducer_cff is not needed; +# added for consistency with the DD4Hep version +# from GeometryReaders.XMLIdealGeometryESSource.cmsGeometryDB_cff import * from Geometry.MuonNumbering.muonNumberingInitialization_cfi import * from Geometry.TrackerNumberingBuilder.trackerNumberingGeometryDB_cfi import * from Geometry.EcalCommonData.ecalSimulationParameters_cff import * -from Geometry.HcalCommonData.hcalSimulationParameters_cff import * -from Geometry.HcalCommonData.hcalDDDSimConstants_cfi import * -from Geometry.HcalCommonData.hcalSimulationConstants_cfi import * -from Geometry.HcalCommonData.caloSimulationParameters_cff import * +from Geometry.HcalCommonData.hcalSimDBConstants_cff import * from Geometry.MuonNumbering.muonGeometryConstants_cff import * +from Geometry.MuonNumbering.muonOffsetESProducer_cff import * diff --git a/Configuration/Geometry/python/GeometryExtended2021FlatMinus05PercentReco_cff.py b/Configuration/Geometry/python/GeometryExtended2021FlatMinus05PercentReco_cff.py index 2457ac1b060ba..c98b17ff1dce4 100644 --- a/Configuration/Geometry/python/GeometryExtended2021FlatMinus05PercentReco_cff.py +++ b/Configuration/Geometry/python/GeometryExtended2021FlatMinus05PercentReco_cff.py @@ -12,7 +12,6 @@ from Geometry.TrackerGeometryBuilder.trackerParameters_cff import * from Geometry.TrackerNumberingBuilder.trackerTopology_cfi import * from Geometry.TrackerGeometryBuilder.idealForDigiTrackerGeometry_cff import * -trackerGeometry.applyAlignment = cms.bool(False) # calo from Geometry.CaloEventSetup.CaloTopology_cfi import * diff --git a/Configuration/Geometry/python/GeometryExtended2021FlatMinus10PercentReco_cff.py b/Configuration/Geometry/python/GeometryExtended2021FlatMinus10PercentReco_cff.py index 83ada461b0a85..0d20e27f047ab 100644 --- a/Configuration/Geometry/python/GeometryExtended2021FlatMinus10PercentReco_cff.py +++ b/Configuration/Geometry/python/GeometryExtended2021FlatMinus10PercentReco_cff.py @@ -12,7 +12,6 @@ from Geometry.TrackerGeometryBuilder.trackerParameters_cff import * from Geometry.TrackerNumberingBuilder.trackerTopology_cfi import * from Geometry.TrackerGeometryBuilder.idealForDigiTrackerGeometry_cff import * -trackerGeometry.applyAlignment = cms.bool(False) # calo from Geometry.CaloEventSetup.CaloTopology_cfi import * diff --git a/Configuration/Geometry/python/GeometryExtended2021FlatPlus05PercentReco_cff.py b/Configuration/Geometry/python/GeometryExtended2021FlatPlus05PercentReco_cff.py index 82b4c2cf5f218..ca96a5b16ec9b 100644 --- a/Configuration/Geometry/python/GeometryExtended2021FlatPlus05PercentReco_cff.py +++ b/Configuration/Geometry/python/GeometryExtended2021FlatPlus05PercentReco_cff.py @@ -12,7 +12,6 @@ from Geometry.TrackerGeometryBuilder.trackerParameters_cff import * from Geometry.TrackerNumberingBuilder.trackerTopology_cfi import * from Geometry.TrackerGeometryBuilder.idealForDigiTrackerGeometry_cff import * -trackerGeometry.applyAlignment = cms.bool(False) # calo from Geometry.CaloEventSetup.CaloTopology_cfi import * diff --git a/Configuration/Geometry/python/GeometryExtended2021FlatPlus10PercentReco_cff.py b/Configuration/Geometry/python/GeometryExtended2021FlatPlus10PercentReco_cff.py index 52faf9264acfd..14a33b3afc6f8 100644 --- a/Configuration/Geometry/python/GeometryExtended2021FlatPlus10PercentReco_cff.py +++ b/Configuration/Geometry/python/GeometryExtended2021FlatPlus10PercentReco_cff.py @@ -12,7 +12,6 @@ from Geometry.TrackerGeometryBuilder.trackerParameters_cff import * from Geometry.TrackerNumberingBuilder.trackerTopology_cfi import * from Geometry.TrackerGeometryBuilder.idealForDigiTrackerGeometry_cff import * -trackerGeometry.applyAlignment = cms.bool(False) # calo from Geometry.CaloEventSetup.CaloTopology_cfi import * diff --git a/Configuration/Geometry/python/GeometryExtended2021Reco_cff.py b/Configuration/Geometry/python/GeometryExtended2021Reco_cff.py index 792748585f995..f573869340ef1 100644 --- a/Configuration/Geometry/python/GeometryExtended2021Reco_cff.py +++ b/Configuration/Geometry/python/GeometryExtended2021Reco_cff.py @@ -12,7 +12,6 @@ from Geometry.TrackerGeometryBuilder.trackerParameters_cff import * from Geometry.TrackerNumberingBuilder.trackerTopology_cfi import * from Geometry.TrackerGeometryBuilder.idealForDigiTrackerGeometry_cff import * -trackerGeometry.applyAlignment = cms.bool(False) # calo from Geometry.CaloEventSetup.CaloTopology_cfi import * diff --git a/Configuration/Geometry/python/GeometryExtended2021ZeroMaterialReco_cff.py b/Configuration/Geometry/python/GeometryExtended2021ZeroMaterialReco_cff.py index d80bc32f051fb..31be348f0238c 100644 --- a/Configuration/Geometry/python/GeometryExtended2021ZeroMaterialReco_cff.py +++ b/Configuration/Geometry/python/GeometryExtended2021ZeroMaterialReco_cff.py @@ -12,7 +12,6 @@ from Geometry.TrackerGeometryBuilder.trackerParameters_cff import * from Geometry.TrackerNumberingBuilder.trackerTopology_cfi import * from Geometry.TrackerGeometryBuilder.idealForDigiTrackerGeometry_cff import * -trackerGeometry.applyAlignment = cms.bool(False) # calo from Geometry.CaloEventSetup.CaloTopology_cfi import * diff --git a/Configuration/Geometry/python/dict2021Geometry.py b/Configuration/Geometry/python/dict2021Geometry.py index 46936c6ef792a..8ddd9095f0f10 100644 --- a/Configuration/Geometry/python/dict2021Geometry.py +++ b/Configuration/Geometry/python/dict2021Geometry.py @@ -3,7 +3,7 @@ commonDict = { "abbrev" : "O", "name" : "common", - "default" : 3, + "default" : 6, "O1" : { 1 : [ 'Geometry/CMSCommonData/data/materials/2021/v1/materials.xml', @@ -143,6 +143,34 @@ ], "era" : "run3_common, stage2L1Trigger_2021", }, + "O6" : { + 1 : [ + 'Geometry/CMSCommonData/data/materials/2021/v3/materials.xml', + 'Geometry/TrackerCommonData/data/trackermaterial/2021/v2/trackermaterial.xml', + 'Geometry/CMSCommonData/data/rotations.xml', + 'Geometry/CMSCommonData/data/extend/v3/cmsextent.xml', + 'Geometry/CMSCommonData/data/cavernData/2021/v1/cavernData.xml', + 'Geometry/CMSCommonData/data/cms/2021/v3/cms.xml', + 'Geometry/CMSCommonData/data/cmsMother.xml', + 'Geometry/CMSCommonData/data/eta3/etaMax.xml', + 'Geometry/CMSCommonData/data/cmsTracker.xml', + 'Geometry/CMSCommonData/data/caloBase/2017/v1/caloBase.xml', + 'Geometry/CMSCommonData/data/cmsCalo.xml', + 'Geometry/CMSCommonData/data/muonBase/2018/v1/muonBase.xml', + 'Geometry/CMSCommonData/data/cmsMuon.xml', + 'Geometry/CMSCommonData/data/mgnt.xml', + 'Geometry/CMSCommonData/data/beampipe/2021/v1/beampipe.xml', + 'Geometry/CMSCommonData/data/cmsBeam/2021/v1/cmsBeam.xml', + 'Geometry/CMSCommonData/data/muonMB.xml', + 'Geometry/CMSCommonData/data/muonMagnet.xml', + 'Geometry/CMSCommonData/data/cavern/2021/v1/cavern.xml', + 'Geometry/CMSCommonData/data/cavernFloor/2017/v1/cavernFloor.xml', + ], + 5 : [ + 'Geometry/CMSCommonData/data/FieldParameters.xml', + ], + "era" : "run3_common, stage2L1Trigger_2021", + }, } trackerDict = { @@ -350,7 +378,6 @@ 'from Geometry.TrackerGeometryBuilder.trackerParameters_cff import *', 'from Geometry.TrackerNumberingBuilder.trackerTopology_cfi import *', 'from Geometry.TrackerGeometryBuilder.idealForDigiTrackerGeometry_cff import *', - 'trackerGeometry.applyAlignment = cms.bool(False)', ], }, "T2" : { @@ -553,7 +580,6 @@ 'from Geometry.TrackerGeometryBuilder.trackerParameters_cff import *', 'from Geometry.TrackerNumberingBuilder.trackerTopology_cfi import *', 'from Geometry.TrackerGeometryBuilder.idealForDigiTrackerGeometry_cff import *', - 'trackerGeometry.applyAlignment = cms.bool(False)', ], }, "T3" : { @@ -573,7 +599,7 @@ 'Geometry/TrackerCommonData/data/PhaseI/v2/pixfwdbladeInnerZminus.xml', 'Geometry/TrackerCommonData/data/PhaseI/v2/pixfwdbladeOuterZplus.xml', 'Geometry/TrackerCommonData/data/PhaseI/v2/pixfwdbladeOuterZminus.xml', - 'Geometry/TrackerCommonData/data/PhaseI/v2/pixbarmaterial.xml', + 'Geometry/TrackerCommonData/data/PhaseI/v3/pixbarmaterial.xml', 'Geometry/TrackerCommonData/data/PhaseI/v2/pixbarladder.xml', 'Geometry/TrackerCommonData/data/PhaseI/v2/pixbarladderfull0.xml', 'Geometry/TrackerCommonData/data/PhaseI/v2/pixbarladderfull1.xml', @@ -587,8 +613,8 @@ 'Geometry/TrackerCommonData/data/PhaseI/v2/pixbar.xml', 'Geometry/TrackerCommonData/data/Run2/trackerpatchpannel.xml', 'Geometry/TrackerCommonData/data/Run2/trackerpixelnose.xml', - 'Geometry/TrackerCommonData/data/tibtidcommonmaterial/2021/v1/tibtidcommonmaterial.xml', - 'Geometry/TrackerCommonData/data/tibmaterial/2021/v1/tibmaterial.xml', + 'Geometry/TrackerCommonData/data/tibtidcommonmaterial/2021/v2/tibtidcommonmaterial.xml', + 'Geometry/TrackerCommonData/data/tibmaterial/2021/v2/tibmaterial.xml', 'Geometry/TrackerCommonData/data/tibmodpar.xml', 'Geometry/TrackerCommonData/data/tibmodule0.xml', 'Geometry/TrackerCommonData/data/tibmodule0a.xml', @@ -621,7 +647,7 @@ 'Geometry/TrackerCommonData/data/tiblayer2.xml', 'Geometry/TrackerCommonData/data/tiblayer3.xml', 'Geometry/TrackerCommonData/data/tib.xml', - 'Geometry/TrackerCommonData/data/tidmaterial/2021/v1/tidmaterial.xml', + 'Geometry/TrackerCommonData/data/tidmaterial/2021/v2/tidmaterial.xml', 'Geometry/TrackerCommonData/data/tidmodpar.xml', 'Geometry/TrackerCommonData/data/tidmodule0.xml', 'Geometry/TrackerCommonData/data/tidmodule0r.xml', @@ -644,7 +670,7 @@ 'Geometry/TrackerCommonData/data/tibtidservices.xml', 'Geometry/TrackerCommonData/data/tibtidservicesf.xml', 'Geometry/TrackerCommonData/data/tibtidservicesb.xml', - 'Geometry/TrackerCommonData/data/tobmaterial/2021/v1/tobmaterial.xml', + 'Geometry/TrackerCommonData/data/tobmaterial/2021/v2/tobmaterial.xml', 'Geometry/TrackerCommonData/data/tobmodpar.xml', 'Geometry/TrackerCommonData/data/tobmodule0.xml', 'Geometry/TrackerCommonData/data/tobmodule2.xml', @@ -757,7 +783,6 @@ 'from Geometry.TrackerGeometryBuilder.trackerParameters_cff import *', 'from Geometry.TrackerNumberingBuilder.trackerTopology_cfi import *', 'from Geometry.TrackerGeometryBuilder.idealForDigiTrackerGeometry_cff import *', - 'trackerGeometry.applyAlignment = cms.bool(False)', ], }, "T4" : { @@ -961,7 +986,6 @@ 'from Geometry.TrackerGeometryBuilder.trackerParameters_cff import *', 'from Geometry.TrackerNumberingBuilder.trackerTopology_cfi import *', 'from Geometry.TrackerGeometryBuilder.idealForDigiTrackerGeometry_cff import *', - 'trackerGeometry.applyAlignment = cms.bool(False)', ], }, "T5" : { @@ -1166,7 +1190,6 @@ 'from Geometry.TrackerGeometryBuilder.trackerParameters_cff import *', 'from Geometry.TrackerNumberingBuilder.trackerTopology_cfi import *', 'from Geometry.TrackerGeometryBuilder.idealForDigiTrackerGeometry_cff import *', - 'trackerGeometry.applyAlignment = cms.bool(False)', ], }, "T6" : { @@ -1371,7 +1394,6 @@ 'from Geometry.TrackerGeometryBuilder.trackerParameters_cff import *', 'from Geometry.TrackerNumberingBuilder.trackerTopology_cfi import *', 'from Geometry.TrackerGeometryBuilder.idealForDigiTrackerGeometry_cff import *', - 'trackerGeometry.applyAlignment = cms.bool(False)', ], }, "T7" : { @@ -1576,7 +1598,6 @@ 'from Geometry.TrackerGeometryBuilder.trackerParameters_cff import *', 'from Geometry.TrackerNumberingBuilder.trackerTopology_cfi import *', 'from Geometry.TrackerGeometryBuilder.idealForDigiTrackerGeometry_cff import *', - 'trackerGeometry.applyAlignment = cms.bool(False)', ], }, "T8" : { @@ -1781,7 +1802,6 @@ 'from Geometry.TrackerGeometryBuilder.trackerParameters_cff import *', 'from Geometry.TrackerNumberingBuilder.trackerTopology_cfi import *', 'from Geometry.TrackerGeometryBuilder.idealForDigiTrackerGeometry_cff import *', - 'trackerGeometry.applyAlignment = cms.bool(False)', ], }, } @@ -1947,7 +1967,7 @@ ppsDict = { "abbrev" : "P", "name" : "pps", - "default" : 2, + "default" : 6, "P1" : { 2 : [ 'Geometry/ForwardCommonData/data/Run2/totemMaterials.xml', @@ -2465,6 +2485,204 @@ ], "reco" :[ + ], + }, + "P6" : { + 2 : [ + 'Geometry/VeryForwardData/data/RP_Box.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_000.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_001.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_002.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_003.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_004.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_005.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_020.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_021.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_022.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_023.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_024.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_025.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_100.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_101.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_102.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_103.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_104.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_105.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_120.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_121.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_122.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_123.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_124.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_125.xml', + 'Geometry/VeryForwardData/data/RP_Hybrid/v2/RP_Hybrid.xml', + 'Geometry/VeryForwardData/data/RP_Materials/v4/RP_Materials.xml', + 'Geometry/VeryForwardData/data/RP_Transformations.xml', + 'Geometry/VeryForwardData/data/RP_Detectors_Assembly.xml', + 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_000.xml', + 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_001.xml', + 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_002.xml', + 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_004.xml', + 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_005.xml', + 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_020.xml', + 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_021.xml', + 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_024.xml', + 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_025.xml', + 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_100.xml', + 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_101.xml', + 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_102.xml', + 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_104.xml', + 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_105.xml', + 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_120.xml', + 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_121.xml', + 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_124.xml', + 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_125.xml', + 'Geometry/VeryForwardData/data/RP_Device/v1/RP_Device.xml', + 'Geometry/VeryForwardData/data/RP_Vertical_Device/2021/Simu/v2/RP_Vertical_Device.xml', + 'Geometry/VeryForwardData/data/RP_Horizontal_Device/2021/Simu/v2/RP_Horizontal_Device.xml', + 'Geometry/VeryForwardData/data/CTPPS_2021/Stations/Simu/v3/CTPPS_220_Right_Station.xml', + 'Geometry/VeryForwardData/data/CTPPS_2021/Stations/Simu/v3/CTPPS_220_Left_Station.xml', + 'Geometry/VeryForwardData/data/CTPPS_2021/Stations/Simu/v3/CTPPS_210_Right_Station.xml', + 'Geometry/VeryForwardData/data/CTPPS_2021/Stations/Simu/v3/CTPPS_210_Left_Station.xml', + 'Geometry/VeryForwardData/data/CTPPS_2021/Stations/Simu/v3/CTPPS_Stations_Assembly.xml', + 'Geometry/VeryForwardData/data/CTPPS_2021/Cuts_Per_Region/Simu/v1/CTPPS_Cuts_Per_Region.xml', + 'Geometry/VeryForwardData/data/RP_Sensitive_Dets.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_Transformations.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_Parameters.xml', + 'Geometry/VeryForwardData/data/CTPPS_Timing_Station_Parameters.xml', + 'Geometry/VeryForwardData/data/CTPPS_Timing_Horizontal_Pot/v2/CTPPS_Timing_Horizontal_Pot.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern1_Segment1.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern2_Segment1.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern2_Segment2.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern3_Segment1.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern3_Segment2.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern3_Segment3.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern3_Segment4.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern4_Segment1.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern4_Segment2.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern4_Segment3.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern4_Segment4.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern4_Segment5.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_2021/CTPPS_Diamond_Planes/CTPPS_Diamond_Plane1.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_2021/CTPPS_Diamond_Planes/CTPPS_Diamond_Plane2.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_2021/CTPPS_Diamond_Planes/CTPPS_Diamond_Plane3.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_2021/CTPPS_Diamond_Planes/CTPPS_Diamond_Plane4.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_2021/CTPPS_Diamond_Detector_Assembly/v1/CTPPS_Diamond_Detector_Assembly.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_2021/Simu/v1/CTPPS_Detectors_Assembly_022.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_2021/Simu/v1/CTPPS_Detectors_Assembly_122.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_Sensitive_Dets_TimingHits.xml', + 'Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Modules/v2/ppstrackerMaterials.xml', + 'Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Modules/v2/PPS_Pixel_Module_2x2_Run3.xml', + 'Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Modules/v2/PPS_Pixel_Sens.xml', + 'Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Assembly/v1/CTPPS_Pixel_Assembly_Box_Real_003.xml', + 'Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Assembly/v1/CTPPS_Pixel_Assembly_Box_Real_023.xml', + 'Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Assembly/v1/CTPPS_Pixel_Assembly_Box_Real_103.xml', + 'Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Assembly/v1/CTPPS_Pixel_Assembly_Box_Real_123.xml', + 'Geometry/VeryForwardData/data/CTPPS_2021/RP_Dist_Beam_Cent/Simu/v1/RP_Dist_Beam_Cent.xml', + ], + "sim" : [ + + ], + "reco" :[ + + ], + }, + "P7" : { + 2 : [ + 'Geometry/VeryForwardData/data/RP_Box.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_000.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_001.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_002.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_003.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_004.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_005.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_020.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_021.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_022.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_023.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_024.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_025.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_100.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_101.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_102.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_103.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_104.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_105.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_120.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_121.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_122.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_123.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_124.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_125.xml', + 'Geometry/VeryForwardData/data/RP_Hybrid/v2/RP_Hybrid.xml', + 'Geometry/VeryForwardData/data/RP_Materials/v4/RP_Materials.xml', + 'Geometry/VeryForwardData/data/RP_Transformations.xml', + 'Geometry/VeryForwardData/data/RP_Detectors_Assembly.xml', + 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_000.xml', + 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_001.xml', + 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_002.xml', + 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_004.xml', + 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_005.xml', + 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_020.xml', + 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_021.xml', + 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_024.xml', + 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_025.xml', + 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_100.xml', + 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_101.xml', + 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_102.xml', + 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_104.xml', + 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_105.xml', + 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_120.xml', + 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_121.xml', + 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_124.xml', + 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_125.xml', + 'Geometry/VeryForwardData/data/RP_Device/v1/RP_Device.xml', + 'Geometry/VeryForwardData/data/RP_Vertical_Device/2021/Simu/v2/RP_Vertical_Device.xml', + 'Geometry/VeryForwardData/data/RP_Horizontal_Device/2021/Simu/v2/RP_Horizontal_Device.xml', + 'Geometry/VeryForwardData/data/CTPPS_2021/Stations/Simu/v3/CTPPS_220_Right_Station.xml', + 'Geometry/VeryForwardData/data/CTPPS_2021/Stations/Simu/v3/CTPPS_220_Left_Station.xml', + 'Geometry/VeryForwardData/data/CTPPS_2021/Stations/Simu/v3/CTPPS_210_Right_Station.xml', + 'Geometry/VeryForwardData/data/CTPPS_2021/Stations/Simu/v3/CTPPS_210_Left_Station.xml', + 'Geometry/VeryForwardData/data/CTPPS_2021/Stations/Simu/v3/CTPPS_Stations_Assembly.xml', + 'Geometry/VeryForwardData/data/CTPPS_2021/Cuts_Per_Region/Simu/v1/CTPPS_Cuts_Per_Region.xml', + 'Geometry/VeryForwardData/data/RP_Sensitive_Dets.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_Transformations.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_Parameters.xml', + 'Geometry/VeryForwardData/data/CTPPS_Timing_Station_Parameters.xml', + 'Geometry/VeryForwardData/data/CTPPS_Timing_Horizontal_Pot/v2/CTPPS_Timing_Horizontal_Pot.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern1_Segment1.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern2_Segment1.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern2_Segment2.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern3_Segment1.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern3_Segment2.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern3_Segment3.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern3_Segment4.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern4_Segment1.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern4_Segment2.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern4_Segment3.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern4_Segment4.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern4_Segment5.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_2021/CTPPS_Diamond_Planes/CTPPS_Diamond_Plane1.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_2021/CTPPS_Diamond_Planes/CTPPS_Diamond_Plane2.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_2021/CTPPS_Diamond_Planes/CTPPS_Diamond_Plane3.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_2021/CTPPS_Diamond_Planes/CTPPS_Diamond_Plane4.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_2021/CTPPS_Diamond_Detector_Assembly/v1/CTPPS_Diamond_Detector_Assembly.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_2021/Simu/v1/CTPPS_Detectors_Assembly_022.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_2021/Simu/v1/CTPPS_Detectors_Assembly_122.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_Sensitive_Dets_TimingHits.xml', + 'Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Modules/v2/ppstrackerMaterials.xml', + 'Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Modules/v3/PPS_Pixel_Module_2x2_Run3.xml', + 'Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Modules/v2/PPS_Pixel_Sens.xml', + 'Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Assembly/v2/CTPPS_Pixel_Assembly_Box_Real_003.xml', + 'Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Assembly/v2/CTPPS_Pixel_Assembly_Box_Real_023.xml', + 'Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Assembly/v2/CTPPS_Pixel_Assembly_Box_Real_103.xml', + 'Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Assembly/v2/CTPPS_Pixel_Assembly_Box_Real_123.xml', + 'Geometry/VeryForwardData/data/CTPPS_2021/RP_Dist_Beam_Cent/Simu/v1/RP_Dist_Beam_Cent.xml', + ], + "sim" : [ + + ], + "reco" :[ + ], }, } @@ -2472,12 +2690,13 @@ allDicts = [ commonDict, trackerDict, caloDict, muonDict, forwardDict, ppsDict ] detectorVersionDict = { - ("O3","T3","C1","M1","F1","P4") : "2021", - ("O4","T4","C1","M1","F1","P4") : "2021ZeroMaterial", - ("O5","T5","C1","M1","F1","P4") : "2021FlatMinus05Percent", - ("O5","T6","C1","M1","F1","P4") : "2021FlatMinus10Percent", - ("O5","T7","C1","M1","F1","P4") : "2021FlatPlus05Percent", - ("O5","T8","C1","M1","F1","P4") : "2021FlatPlus10Percent", + ("O6","T3","C1","M1","F1","P6") : "2021", + ("O4","T4","C1","M1","F1","P6") : "2021ZeroMaterial", + ("O5","T5","C1","M1","F1","P6") : "2021FlatMinus05Percent", + ("O5","T6","C1","M1","F1","P6") : "2021FlatMinus10Percent", + ("O5","T7","C1","M1","F1","P6") : "2021FlatPlus05Percent", + ("O5","T8","C1","M1","F1","P6") : "2021FlatPlus10Percent", } -deprecatedSubdets = set([ "T1", "T2", "O1", "O2", "P1", "P2", "P3" ]) +deprecatedSubdets = set([ "T1", "T2", "O1", "O2", "O3", "P1", "P2", "P3", + "P4", "P5" ]) diff --git a/Configuration/Geometry/python/dict2026Geometry.py b/Configuration/Geometry/python/dict2026Geometry.py index d450ab5c3b596..1812e975e7491 100644 --- a/Configuration/Geometry/python/dict2026Geometry.py +++ b/Configuration/Geometry/python/dict2026Geometry.py @@ -978,7 +978,7 @@ 1 : [ 'Geometry/EcalCommonData/data/eregalgo/2026/v2/eregalgo.xml', 'Geometry/EcalCommonData/data/ectkcable/2026/v1/ectkcable.xml', - 'Geometry/EcalCommonData/data/ectkcablemat/2026/v1/ectkcablemat.xml', + 'Geometry/EcalCommonData/data/ectkcablemat/2026/v2/ectkcablemat.xml', 'Geometry/EcalCommonData/data/ebalgo.xml', 'Geometry/EcalCommonData/data/ebcon/2021/v1/ebcon.xml', 'Geometry/EcalCommonData/data/ebrot.xml', diff --git a/Configuration/Geometry/python/generateGeometry.py b/Configuration/Geometry/python/generateGeometry.py index af5ef6c4d33bf..a64a012778eca 100644 --- a/Configuration/Geometry/python/generateGeometry.py +++ b/Configuration/Geometry/python/generateGeometry.py @@ -25,14 +25,15 @@ def __init__(self, scriptName, detectorVersionDefault, detectorPrefix, detectorY self.deprecatedDets = deprecatedDets self.deprecatedSubdets = deprecatedSubdets self.detectorVersionType = detectorVersionType + self.detectorVersionNull = self.detectorVersionType(0) def generateGeom(self, detectorTuple, args): detectorVersion = self.detectorPrefix+str(args.detectorVersionManual) # reverse dict search if overall D# specified - if args.v_detector>0: + if args.v_detector!=self.detectorVersionNull: detectorVersion = self.detectorPrefix+str(args.v_detector) if detectorVersion in self.detectorVersionDict.values(): - detectorTuple = self.detectorVersionDict.keys()[self.detectorVersionDict.values().index(detectorVersion)] + detectorTuple = list(self.detectorVersionDict.keys())[list(self.detectorVersionDict.values()).index(detectorVersion)] else: print("Unknown detector "+detectorVersion) sys.exit(1) @@ -249,7 +250,7 @@ def run(self): for aDict in self.allDicts: parser.add_argument("-"+aDict["abbrev"], "--"+aDict["name"], dest="v_"+aDict["name"], default=aDict["default"], type=int, help="version for "+aDict["name"]) parser.add_argument("-V", "--version", dest="detectorVersionManual", default=self.detectorVersionDefault, type=int, help="manual detector version number") - parser.add_argument("-D", "--detector", dest="v_detector", default=0, type=self.detectorVersionType, help="version for whole detector, ignored if 0, overrides subdet versions otherwise") + parser.add_argument("-D", "--detector", dest="v_detector", default=self.detectorVersionNull, type=self.detectorVersionType, help="version for whole detector, ignored if 0, overrides subdet versions otherwise") parser.add_argument("-l", "--list", dest="doList", default=False, action="store_true", help="list known detector versions and exit") parser.add_argument("-t", "--test", dest="doTest", default=False, action="store_true", help="enable unit test mode") args = parser.parse_args() diff --git a/Configuration/HLT/python/addOnTestsHLT.py b/Configuration/HLT/python/addOnTestsHLT.py index c49ace09eef0a..dc134db316c88 100644 --- a/Configuration/HLT/python/addOnTestsHLT.py +++ b/Configuration/HLT/python/addOnTestsHLT.py @@ -1,25 +1,25 @@ def addOnTestsHLT(): addOnTestsHLT = { - 'hlt_mc_Fake' : ['cmsDriver.py TTbar_Tauola_8TeV_TuneCUETP8M1_cfi -s GEN,SIM,DIGI,L1,DIGI2RAW --mc --scenario=pp -n 10 --conditions auto:run1_mc_Fake --relval 9000,50 --datatier "GEN-SIM-RAW" --eventcontent RAWSIM --customise=HLTrigger/Configuration/CustomConfigs.L1T --fileout file:RelVal_Raw_Fake_MC.root', + 'hlt_mc_Fake' : ['cmsDriver.py TTbar_8TeV_TuneCUETP8M1_cfi -s GEN,SIM,DIGI,L1,DIGI2RAW --mc --scenario=pp -n 10 --conditions auto:run1_mc_Fake --relval 9000,50 --datatier "GEN-SIM-RAW" --eventcontent RAWSIM --customise=HLTrigger/Configuration/CustomConfigs.L1T --fileout file:RelVal_Raw_Fake_MC.root', 'HLTrigger/Configuration/test/OnLine_HLT_Fake.py', 'cmsDriver.py RelVal -s HLT:Fake,RAW2DIGI,L1Reco,RECO --mc --scenario=pp -n 10 --conditions auto:run1_mc_Fake --relval 9000,50 --datatier "RAW-HLT-RECO" --eventcontent FEVTDEBUGHLT --customise=HLTrigger/Configuration/CustomConfigs.L1THLT --processName=HLTRECO --filein file:RelVal_Raw_Fake_MC.root --fileout file:RelVal_Raw_Fake_MC_HLT_RECO.root'], - 'hlt_mc_Fake1': ['cmsDriver.py TTbar_Tauola_13TeV_TuneCUETP8M1_cfi -s GEN,SIM,DIGI,L1,DIGI2RAW --mc --scenario=pp -n 10 --conditions auto:run2_mc_Fake1 --relval 9000,50 --datatier "GEN-SIM-RAW" --eventcontent RAWSIM --customise=HLTrigger/Configuration/CustomConfigs.L1T --era Run2_25ns --fileout file:RelVal_Raw_Fake1_MC.root', + 'hlt_mc_Fake1': ['cmsDriver.py TTbar_13TeV_TuneCUETP8M1_cfi -s GEN,SIM,DIGI,L1,DIGI2RAW --mc --scenario=pp -n 10 --conditions auto:run2_mc_Fake1 --relval 9000,50 --datatier "GEN-SIM-RAW" --eventcontent RAWSIM --customise=HLTrigger/Configuration/CustomConfigs.L1T --era Run2_25ns --fileout file:RelVal_Raw_Fake1_MC.root', 'HLTrigger/Configuration/test/OnLine_HLT_Fake1.py', 'cmsDriver.py RelVal -s HLT:Fake1,RAW2DIGI,L1Reco,RECO --mc --scenario=pp -n 10 --conditions auto:run2_mc_Fake1 --relval 9000,50 --datatier "RAW-HLT-RECO" --eventcontent FEVTDEBUGHLT --customise=HLTrigger/Configuration/CustomConfigs.L1THLT --era Run2_25ns --processName=HLTRECO --filein file:RelVal_Raw_Fake1_MC.root --fileout file:RelVal_Raw_Fake1_MC_HLT_RECO.root'], - 'hlt_mc_Fake2': ['cmsDriver.py TTbar_Tauola_13TeV_TuneCUETP8M1_cfi -s GEN,SIM,DIGI,L1,DIGI2RAW --mc --scenario=pp -n 10 --conditions auto:run2_mc_Fake2 --relval 9000,50 --datatier "GEN-SIM-RAW" --eventcontent RAWSIM --customise=HLTrigger/Configuration/CustomConfigs.L1T --era Run2_2016 --fileout file:RelVal_Raw_Fake2_MC.root', + 'hlt_mc_Fake2': ['cmsDriver.py TTbar_13TeV_TuneCUETP8M1_cfi -s GEN,SIM,DIGI,L1,DIGI2RAW --mc --scenario=pp -n 10 --conditions auto:run2_mc_Fake2 --relval 9000,50 --datatier "GEN-SIM-RAW" --eventcontent RAWSIM --customise=HLTrigger/Configuration/CustomConfigs.L1T --era Run2_2016 --fileout file:RelVal_Raw_Fake2_MC.root', 'HLTrigger/Configuration/test/OnLine_HLT_Fake2.py', 'cmsDriver.py RelVal -s HLT:Fake2,RAW2DIGI,L1Reco,RECO --mc --scenario=pp -n 10 --conditions auto:run2_mc_Fake2 --relval 9000,50 --datatier "RAW-HLT-RECO" --eventcontent FEVTDEBUGHLT --customise=HLTrigger/Configuration/CustomConfigs.L1THLT --era Run2_2016 --processName=HLTRECO --filein file:RelVal_Raw_Fake2_MC.root --fileout file:RelVal_Raw_Fake2_MC_HLT_RECO.root'], - 'hlt_mc_GRun' : ['cmsDriver.py TTbar_Tauola_13TeV_TuneCUETP8M1_cfi -s GEN,SIM,DIGI,L1,DIGI2RAW --mc --scenario=pp -n 10 --conditions auto:run3_mc_GRun --relval 9000,50 --datatier "GEN-SIM-RAW" --eventcontent RAWSIM --customise=HLTrigger/Configuration/CustomConfigs.L1T --era Run3 --fileout file:RelVal_Raw_GRun_MC.root', + 'hlt_mc_GRun' : ['cmsDriver.py TTbar_13TeV_TuneCUETP8M1_cfi -s GEN,SIM,DIGI,L1,DIGI2RAW --mc --scenario=pp -n 10 --conditions auto:run3_mc_GRun --relval 9000,50 --datatier "GEN-SIM-RAW" --eventcontent RAWSIM --customise=HLTrigger/Configuration/CustomConfigs.L1T --era Run3 --fileout file:RelVal_Raw_GRun_MC.root', 'HLTrigger/Configuration/test/OnLine_HLT_GRun.py', 'cmsDriver.py RelVal -s HLT:GRun,RAW2DIGI,L1Reco,RECO --mc --scenario=pp -n 10 --conditions auto:run3_mc_GRun --relval 9000,50 --datatier "RAW-HLT-RECO" --eventcontent FEVTDEBUGHLT --customise=HLTrigger/Configuration/CustomConfigs.L1THLT --era Run3 --processName=HLTRECO --filein file:RelVal_Raw_GRun_MC.root --fileout file:RelVal_Raw_GRun_MC_HLT_RECO.root'], - 'hlt_mc_HIon' : ['cmsDriver.py TTbar_Tauola_13TeV_TuneCUETP8M1_cfi -s GEN,SIM,DIGI,L1,DIGI2RAW --mc --scenario=pp -n 10 --conditions auto:run3_mc_HIon --relval 9000,50 --datatier "GEN-SIM-RAW" --eventcontent RAWSIM --customise=HLTrigger/Configuration/CustomConfigs.L1T --era Run3_pp_on_PbPb --fileout file:RelVal_Raw_HIon_MC.root', + 'hlt_mc_HIon' : ['cmsDriver.py TTbar_13TeV_TuneCUETP8M1_cfi -s GEN,SIM,DIGI,L1,DIGI2RAW --mc --scenario=pp -n 10 --conditions auto:run3_mc_HIon --relval 9000,50 --datatier "GEN-SIM-RAW" --eventcontent RAWSIM --customise=HLTrigger/Configuration/CustomConfigs.L1T --era Run3_pp_on_PbPb --fileout file:RelVal_Raw_HIon_MC.root', 'HLTrigger/Configuration/test/OnLine_HLT_HIon.py', 'cmsDriver.py RelVal -s HLT:HIon,RAW2DIGI,L1Reco,RECO --mc --scenario=pp -n 10 --conditions auto:run3_mc_HIon --relval 9000,50 --datatier "RAW-HLT-RECO" --eventcontent FEVTDEBUGHLT --customise=HLTrigger/Configuration/CustomConfigs.L1THLT --era Run3_pp_on_PbPb --processName=HLTRECO --filein file:RelVal_Raw_HIon_MC.root --fileout file:RelVal_Raw_HIon_MC_HLT_RECO.root'], - 'hlt_mc_PIon' : ['cmsDriver.py TTbar_Tauola_13TeV_TuneCUETP8M1_cfi -s GEN,SIM,DIGI,L1,DIGI2RAW --mc --scenario=pp -n 10 --conditions auto:run3_mc_PIon --relval 9000,50 --datatier "GEN-SIM-RAW" --eventcontent RAWSIM --customise=HLTrigger/Configuration/CustomConfigs.L1T --era Run3 --fileout file:RelVal_Raw_PIon_MC.root', + 'hlt_mc_PIon' : ['cmsDriver.py TTbar_13TeV_TuneCUETP8M1_cfi -s GEN,SIM,DIGI,L1,DIGI2RAW --mc --scenario=pp -n 10 --conditions auto:run3_mc_PIon --relval 9000,50 --datatier "GEN-SIM-RAW" --eventcontent RAWSIM --customise=HLTrigger/Configuration/CustomConfigs.L1T --era Run3 --fileout file:RelVal_Raw_PIon_MC.root', 'HLTrigger/Configuration/test/OnLine_HLT_PIon.py', 'cmsDriver.py RelVal -s HLT:PIon,RAW2DIGI,L1Reco,RECO --mc --scenario=pp -n 10 --conditions auto:run3_mc_PIon --relval 9000,50 --datatier "RAW-HLT-RECO" --eventcontent FEVTDEBUGHLT --customise=HLTrigger/Configuration/CustomConfigs.L1THLT --era Run3 --processName=HLTRECO --filein file:RelVal_Raw_PIon_MC.root --fileout file:RelVal_Raw_PIon_MC_HLT_RECO.root'], - 'hlt_mc_PRef' : ['cmsDriver.py TTbar_Tauola_13TeV_TuneCUETP8M1_cfi -s GEN,SIM,DIGI,L1,DIGI2RAW --mc --scenario=pp -n 10 --conditions auto:run3_mc_PRef --relval 9000,50 --datatier "GEN-SIM-RAW" --eventcontent RAWSIM --customise=HLTrigger/Configuration/CustomConfigs.L1T --era Run3 --fileout file:RelVal_Raw_PRef_MC.root', + 'hlt_mc_PRef' : ['cmsDriver.py TTbar_13TeV_TuneCUETP8M1_cfi -s GEN,SIM,DIGI,L1,DIGI2RAW --mc --scenario=pp -n 10 --conditions auto:run3_mc_PRef --relval 9000,50 --datatier "GEN-SIM-RAW" --eventcontent RAWSIM --customise=HLTrigger/Configuration/CustomConfigs.L1T --era Run3 --fileout file:RelVal_Raw_PRef_MC.root', 'HLTrigger/Configuration/test/OnLine_HLT_PRef.py', 'cmsDriver.py RelVal -s HLT:PRef,RAW2DIGI,L1Reco,RECO --mc --scenario=pp -n 10 --conditions auto:run3_mc_PRef --relval 9000,50 --datatier "RAW-HLT-RECO" --eventcontent FEVTDEBUGHLT --customise=HLTrigger/Configuration/CustomConfigs.L1THLT --era Run3 --processName=HLTRECO --filein file:RelVal_Raw_PRef_MC.root --fileout file:RelVal_Raw_PRef_MC_HLT_RECO.root'], 'hlt_data_Fake' : ['cmsDriver.py RelVal -s L1REPACK:GT1 --data --scenario=pp -n 10 --conditions auto:run1_hlt_Fake --relval 9000,50 --datatier "RAW" --eventcontent RAW --customise=HLTrigger/Configuration/CustomConfigs.L1T --fileout file:RelVal_Raw_Fake_DATA.root --filein /store/data/Run2012A/MuEG/RAW/v1/000/191/718/14932935-E289-E111-830C-5404A6388697.root', diff --git a/Configuration/HLT/python/autoCondHLT.py b/Configuration/HLT/python/autoCondHLT.py index 242fb3525da1b..3a02420e3b1ac 100644 --- a/Configuration/HLT/python/autoCondHLT.py +++ b/Configuration/HLT/python/autoCondHLT.py @@ -43,21 +43,21 @@ 'run2_hlt_Fake' : ('run2_hlt_relval' ,l1Menus['Fake']), 'run2_hlt_Fake1' : ('run2_hlt_relval' ,l1Menus['Fake1']), 'run2_hlt_Fake2' : ('run2_hlt_relval' ,l1Menus['Fake2']), - 'run3_hlt_FULL' : ('run2_hlt_relval' ,l1Menus['FULL']), - 'run3_hlt_GRun' : ('run2_hlt_relval' ,l1Menus['GRun']), - 'run3_hlt_HIon' : ('run2_hlt_relval' ,l1Menus['HIon']), - 'run3_hlt_PIon' : ('run2_hlt_relval' ,l1Menus['PIon']), - 'run3_hlt_PRef' : ('run2_hlt_relval' ,l1Menus['PRef']), + 'run3_hlt_FULL' : ('run3_hlt' ,l1Menus['FULL']), + 'run3_hlt_GRun' : ('run3_hlt' ,l1Menus['GRun']), + 'run3_hlt_HIon' : ('run3_hlt' ,l1Menus['HIon']), + 'run3_hlt_PIon' : ('run3_hlt' ,l1Menus['PIon']), + 'run3_hlt_PRef' : ('run3_hlt' ,l1Menus['PRef']), 'run1_data_Fake' : ('run1_data' ,l1Menus['Fake']), 'run2_data_Fake' : ('run2_data_relval' ,l1Menus['Fake']), 'run2_data_Fake1' : ('run2_data_relval' ,l1Menus['Fake1']), 'run2_data_Fake2' : ('run2_data_relval' ,l1Menus['Fake2']), - 'run3_data_FULL' : ('run2_data_relval' ,l1Menus['FULL']), - 'run3_data_GRun' : ('run2_data_relval' ,l1Menus['GRun']), - 'run3_data_HIon' : ('run2_data_promptlike_hi' ,l1Menus['HIon']), - 'run3_data_PIon' : ('run2_data_relval' ,l1Menus['PIon']), - 'run3_data_PRef' : ('run2_data_relval' ,l1Menus['PRef']), + 'run3_data_FULL' : ('run3_data_prompt' ,l1Menus['FULL']), + 'run3_data_GRun' : ('run3_data_prompt' ,l1Menus['GRun']), + 'run3_data_HIon' : ('run3_data_prompt' ,l1Menus['HIon']), + 'run3_data_PIon' : ('run3_data_prompt' ,l1Menus['PIon']), + 'run3_data_PRef' : ('run3_data_prompt' ,l1Menus['PRef']), } diff --git a/Configuration/ProcessModifiers/python/trackingMkFit_cff.py b/Configuration/ProcessModifiers/python/trackingMkFit_cff.py index d8bfde4165a77..14bc499d1d301 100644 --- a/Configuration/ProcessModifiers/python/trackingMkFit_cff.py +++ b/Configuration/ProcessModifiers/python/trackingMkFit_cff.py @@ -18,13 +18,13 @@ trackingMkFitCommon, trackingMkFitInitialStepPreSplitting, trackingMkFitInitialStep, - trackingMkFitLowPtQuadStep, +# trackingMkFitLowPtQuadStep, # to be enabled later trackingMkFitHighPtTripletStep, - trackingMkFitLowPtTripletStep, +# trackingMkFitLowPtTripletStep, # to be enabled later trackingMkFitDetachedQuadStep, # trackingMkFitDetachedTripletStep, # to be enabled later # trackingMkFitPixelPairStep, # to be enabled later # trackingMkFitMixedTripletStep, # to be enabled later - trackingMkFitPixelLessStep, - trackingMkFitTobTecStep, +# trackingMkFitPixelLessStep, # to be enabled later +# trackingMkFitTobTecStep, # to be enabled later ) diff --git a/Configuration/PyReleaseValidation/README.md b/Configuration/PyReleaseValidation/README.md index 4c43222519724..6942ed89355d1 100644 --- a/Configuration/PyReleaseValidation/README.md +++ b/Configuration/PyReleaseValidation/README.md @@ -32,13 +32,17 @@ The offsets currently in use are: * 0.4: LowPU tracking era, `Run2_2017_trackingLowPU` * 0.5: Pixel tracking only + 0.1 * 0.501: Patatrack, pixel only quadruplets, on CPU -* 0.502: Patatrack, pixel only quadruplets, on GPU +* 0.502: Patatrack, pixel only quadruplets, with automatic offload to GPU if available * 0.505: Patatrack, pixel only triplets, on CPU -* 0.506: Patatrack, pixel only triplets, on GPU -* 0.511: Patatrack, ECAL only CPU -* 0.512: Patatrack, ECAL only GPU -* 0.521: Patatrack, HCAL only CPU -* 0.522: Patatrack, HCAL only GPU +* 0.506: Patatrack, pixel only triplets, with automatic offload to GPU if available +* 0.511: Patatrack, ECAL only, on CPU +* 0.512: Patatrack, ECAL only, with automatic offload to GPU if available +* 0.521: Patatrack, HCAL only, on CPU +* 0.522: Patatrack, HCAL only, with automatic offload to GPU if available +* 0.591: Patatrack, full reco with pixel quadruplets, on CPU +* 0.592: Patatrack, full reco with pixel quadruplets, with automatic offload to GPU if available +* 0.595: Patatrack, full reco with pixel triplets, on CPU +* 0.596: Patatrack, full reco with pixel triplets, with automatic offload to GPU if available * 0.6: HE Collapse (old depth segmentation for 2018) * 0.7: trackingMkFit modifier * 0.8: BPH Parking (Run-2) diff --git a/Configuration/PyReleaseValidation/python/MatrixInjector.py b/Configuration/PyReleaseValidation/python/MatrixInjector.py index 6d8a1223ef32e..750c460b53c99 100644 --- a/Configuration/PyReleaseValidation/python/MatrixInjector.py +++ b/Configuration/PyReleaseValidation/python/MatrixInjector.py @@ -65,6 +65,19 @@ def __init__(self,opt,mode='init',options=''): if(opt.batchName): self.batchName = '__'+opt.batchName+'-'+self.batchTime + #################################### + # Checking and setting up GPU attributes + #################################### + # Mendatory + self.RequiresGPU = opt.gpu + self.GPUMemoryMB = opt.GPUMemoryMB + self.CUDACapabilities = opt.CUDACapabilities + self.CUDARuntime = opt.CUDARuntime + # optional + self.GPUName = opt.GPUName + self.CUDADriverVersion = opt.CUDADriverVersion + self.CUDARuntimeVersion = opt.CUDARuntimeVersion + # WMagent url if not self.wmagent: # Overwrite with env variable @@ -180,8 +193,18 @@ def __init__(self,opt,mode='init',options=''): "nowmIO": {}, "Multicore" : opt.nThreads, # this is the per-taskchain Multicore; it's the default assigned to a task if it has no value specified "EventStreams": self.numberOfStreams, - "KeepOutput" : False + "KeepOutput" : False, + "RequiresGPU" : None, + "GPUParams": None + } + self.defaultGPUParams={ + "GPUMemoryMB": self.GPUMemoryMB, + "CUDACapabilities": self.CUDACapabilities, + "CUDARuntime": self.CUDARuntime } + if self.GPUName: self.defaultGPUParams.update({"GPUName": self.GPUName}) + if self.CUDADriverVersion: self.defaultGPUParams.update({"CUDADriverVersion": self.CUDADriverVersion}) + if self.CUDARuntimeVersion: self.defaultGPUParams.update({"CUDARuntimeVersion": self.CUDARuntimeVersion}) self.chainDicts={} @@ -408,6 +431,9 @@ def prepare(self, mReader, directories, mode='init'): if setPrimaryDs: chainDict['nowmTasklist'][-1]['PrimaryDataset']=setPrimaryDs nextHasDSInput=None + if 'GPU' in step and self.RequiresGPU != 'forbidden': + chainDict['nowmTasklist'][-1]['RequiresGPU'] = self.RequiresGPU + chainDict['nowmTasklist'][-1]['GPUParams']=json.dumps(self.defaultGPUParams) else: #not first step and no inputDS chainDict['nowmTasklist'].append(copy.deepcopy(self.defaultTask)) @@ -420,6 +446,9 @@ def prepare(self, mReader, directories, mode='init'): chainDict['nowmTasklist'][-1]['LumisPerJob']=splitForThisWf if step in wmsplit: chainDict['nowmTasklist'][-1]['LumisPerJob']=wmsplit[step] + if 'GPU' in step and self.RequiresGPU != 'forbidden': + chainDict['nowmTasklist'][-1]['RequiresGPU'] = self.RequiresGPU + chainDict['nowmTasklist'][-1]['GPUParams']=json.dumps(self.defaultGPUParams) # change LumisPerJob for Hadronizer steps. if 'Hadronizer' in step: @@ -439,11 +468,14 @@ def prepare(self, mReader, directories, mode='init'): if 'pileup' in chainDict['nowmTasklist'][-1]['nowmIO']: chainDict['nowmTasklist'][-1]['MCPileup']=chainDict['nowmTasklist'][-1]['nowmIO']['pileup'] if '--pileup ' in s[2][index]: # catch --pileup (scenarion) and not --pileup_ (dataset to be mixed) => works also making PRE-MIXed dataset + pileupString = s[2][index].split()[s[2][index].split().index('--pileup')+1] processStrPrefix='PU_' # take care of pu overlay done with GEN-SIM mixing - if ( s[2][index].split()[ s[2][index].split().index('--pileup')+1 ] ).find('25ns') > 0 : + if pileupString.find('25ns') > 0 : processStrPrefix='PU25ns_' - elif ( s[2][index].split()[ s[2][index].split().index('--pileup')+1 ] ).find('50ns') > 0 : + elif pileupString.find('50ns') > 0 : processStrPrefix='PU50ns_' + elif 'nopu' in pileupString.lower(): + processStrPrefix='' if 'premix_stage2' in s[2][index] and '--pileup_input' in s[2][index]: # take care of pu overlay done with DIGI mixing of premixed events if s[2][index].split()[ s[2][index].split().index('--pileup_input')+1 ].find('25ns') > 0 : processStrPrefix='PUpmx25ns_' diff --git a/Configuration/PyReleaseValidation/python/relval_2017.py b/Configuration/PyReleaseValidation/python/relval_2017.py index 440b8d120f04a..0c65ccc7fd102 100644 --- a/Configuration/PyReleaseValidation/python/relval_2017.py +++ b/Configuration/PyReleaseValidation/python/relval_2017.py @@ -16,18 +16,19 @@ # 2017 (ele guns 10, 35, 1000; pho guns 10, 35; mu guns 1, 10, 100, 1000, QCD 3TeV, QCD Flat) # (ZMM, TTbar, ZEE, MinBias, TTbar PU, ZEE PU, TTbar design) # (TTbar trackingOnly, trackingRun2, trackingOnlyRun2, trackingLowPU, pixelTrackingOnly) -# (TTbar PU with JME NanoAOD) +# (TTbar PU with JME NanoAOD, disable for now due to Run-3 Nano-Prompt preparation) # 2018 (ele guns 10, 35, 1000; pho guns 10, 35; mu guns 1, 10, 100, 1000, QCD 3TeV, QCD Flat) # 2018 (ZMM, TTbar, ZEE, MinBias, TTbar PU, ZEE PU, TTbar design) # (TTbar trackingOnly, pixelTrackingOnly) # (HE collapse: TTbar, TTbar PU, TTbar design) # (ParkingBPH: TTbar) -# (TTbar PU with JME NanoAOD) +# (TTbar PU with JME NanoAOD, disable for now due to Run-3 Nano-Prompt preparation) # (Patatrack pixel-only: ZMM - on CPU: quadruplets, triplets) # (Patatrack pixel-only: TTbar - on CPU: quadruplets, triplets) # (Patatrack ECAL-only: TTbar - on CPU) # (Patatrack HCAL-only: TTbar - on CPU) -# 2021 (DD4HEP: TTbar, ZMM) +# 2021 (DD4HEP XML: TTbar, ZMM) +# (DD4HEP DB: TTbar) # (ele guns 10, 35, 1000; pho guns 10, 35; mu guns 1, 10, 100, 1000, QCD 3TeV, QCD Flat) # (ZMM, TTbar, ZEE, MinBias, TTbar PU, TTbar PU premix, ZEE PU, TTbar design, GluGluTo2Jets, GluGluTo2Jets PU) # (TTbar trackingOnly, pixelTrackingOnly, trackingMkFit, trackdnn) @@ -43,13 +44,13 @@ numWFIB = [10001.0,10002.0,10003.0,10004.0,10005.0,10006.0,10007.0,10008.0,10009.0,10059.0,10071.0, 10042.0,10024.0,10025.0,10026.0,10023.0,10224.0,10225.0,10424.0, 10024.1,10024.2,10024.3,10024.4,10024.5, - 10224.15, + #10224.15, 10801.0,10802.0,10803.0,10804.0,10805.0,10806.0,10807.0,10808.0,10809.0,10859.0,10871.0, 10842.0,10824.0,10825.0,10826.0,10823.0,11024.0,11025.0,11224.0, 10824.1,10824.5, 10824.6,11024.6,11224.6, 10824.8, - 11024.15, + #11024.15, 10842.501,10842.505, 10824.501,10824.505, 10824.511, diff --git a/Configuration/PyReleaseValidation/python/relval_extendedgen.py b/Configuration/PyReleaseValidation/python/relval_extendedgen.py index 233578a08bab4..043a9e9e5d096 100644 --- a/Configuration/PyReleaseValidation/python/relval_extendedgen.py +++ b/Configuration/PyReleaseValidation/python/relval_extendedgen.py @@ -68,3 +68,14 @@ workflows[560]=['',['ZprimeToll_M3000_13TeV_pythia8','HARVESTGEN']] workflows[561]=['',['WprimeTolNu_M3000_13TeV_pythia8','HARVESTGEN']] workflows[562]=['BulkG_ZZ_2L2Q_M1200_narrow_13TeV_pythia8',['BulkG_M1200_narrow_2L2Q_LHE_13TeV','Hadronizer_TuneCUETP8M1_Mad_pythia8','HARVESTGEN2']] + +# ExternalGeneratorFilter +# validated GEN fragments are taken from other workflows. Annotation: generator, origin workflow id +workflows[570]=['',['BuToKstarJPsiToMuMu_forSTEAM_13TeV_ExtGen','HARVESTGEN']] # Pythia8+EvtGen130, 541 +workflows[571]=['',['BsToMuMu_forSTEAM_13TeV_ExtGen','HARVESTGEN']] # Pythia8+EvtGen1, 545 +workflows[572]=['',['ZTTFS_ExtGen','HARVESTGEN']] # Pythia8+Tauola, 124.2 +workflows[573]=['',['sherpa_ttbar_2j_MENLOPS_13TeV_MASTER_ExtGen','HARVESTGEN']] # Sherpa, 536 +workflows[574]=['',['HydjetQ_B12_5020GeV_2018_ExtGen','HARVESTGEN']] # Hydjet, 150 +workflows[575]=['',['AMPT_PPb_5020GeV_MinimumBias_ExtGen','HARVESTGEN']] # AMPT, 280 +workflows[576]=['',['EPOS_PPb_8160GeV_MinimumBias_ExtGen','HARVESTGEN']] # ReggeGribovPartonMC, 281 +workflows[577]=['',['Pyquen_ZeemumuJets_pt10_2760GeV_ExtGen','HARVESTGEN']] # Pyquen, 302 diff --git a/Configuration/PyReleaseValidation/python/relval_gpu.py b/Configuration/PyReleaseValidation/python/relval_gpu.py index db417a2a94365..04dfa32a05f83 100644 --- a/Configuration/PyReleaseValidation/python/relval_gpu.py +++ b/Configuration/PyReleaseValidation/python/relval_gpu.py @@ -20,12 +20,16 @@ # (Patatrack pixel-only triplets: TTbar - on GPU, both CPU and GPU, auto) # (Patatrack ECAL-only: TTbar - on GPU, both CPU and GPU, auto) # (Patatrack HCAL-only: TTbar - on GPU, both CPU and GPU, auto) +# (Patatrack full reco with pixel quadruplets: TTbar - on GPU, both CPU and GPU, auto) +# (Patatrack full reco with pixel triplets: TTbar - on GPU, both CPU and GPU, auto) # mc 2021 (Patatrack pixel-only quadruplets: ZMM - on GPU, both CPU and GPU, auto) # (Patatrack pixel-only triplets: ZMM - on GPU, both CPU and GPU, auto) # (Patatrack pixel-only quadruplets: TTbar - on GPU, both CPU and GPU, auto) # (Patatrack pixel-only triplets: TTbar - on GPU, both CPU and GPU, auto) # (Patatrack ECAL-only: TTbar - on GPU, both CPU and GPU, auto) # (Patatrack HCAL-only: TTbar - on GPU, both CPU and GPU, auto) +# (Patatrack full reco with pixel quadruplets: TTbar - on GPU, both CPU and GPU, auto) +# (Patatrack full reco with pixel triplets: TTbar - on GPU, both CPU and GPU, auto) numWFIB = [ 10842.502, # 10842.503,10842.504, 10842.506, # 10842.507,10842.508, @@ -33,12 +37,16 @@ 10824.506, # 10824.507,10824.508, 10824.512, # 10824.513,10824.514, 10824.522, # 10824.523,10824.524, + 10824.592, # 10824.593,10824.594, + 10824.596, # 10824.597,10824.598, 11650.502, # 11650.503,11650.504, 11650.506, # 11650.507,11650.508, 11634.502, # 11634.503,11634.504, 11634.506, # 11634.507,11634.508, 11634.512, # 11634.513,11634.514, 11634.522, # 11634.523,11634.524 + 11634.592, # 11634.593,11634.594, + 11634.596, # 11634.597,11634.598, ] for numWF in numWFIB: if not numWF in _upgrade_workflows: continue diff --git a/Configuration/PyReleaseValidation/python/relval_pileup.py b/Configuration/PyReleaseValidation/python/relval_pileup.py index 8f2fd8794c9d9..55b30ebadced3 100644 --- a/Configuration/PyReleaseValidation/python/relval_pileup.py +++ b/Configuration/PyReleaseValidation/python/relval_pileup.py @@ -39,7 +39,7 @@ workflows[25202]=['',['TTbar_13','DIGIUP15_PU25','RECOUP15_PU25','HARVESTUP15_PU25','NANOUP15_PU25']] workflows[25202.1]=['',['TTbar_13','DIGIUP15APVSimu_PU25','RECOUP15_PU25','HARVESTUP15_PU25']] workflows[25202.2]=['',['TTbar_13','DIGIUP15APVSimu_PU25','RECOUP15_PU25_HIPM','HARVESTUP15_PU25']] -workflows[25202.15]=['',['TTbar_13','DIGIUP15_PU25','RECOUP15_PU25','HARVESTUP15_PU25','NANOUP15MC_PU25_JME']] +#workflows[25202.15]=['',['TTbar_13','DIGIUP15_PU25','RECOUP15_PU25','HARVESTUP15_PU25','NANOUP15MC_PU25_JME']] #JME NanoAOD, disable until Nano-Run3 prompt dev is done workflows[25203]=['',['H125GGgluonfusion_13','DIGIUP15_PU25','RECOUP15_PU25','HARVESTUP15_PU25','NANOUP15_PU25']] workflows[25204]=['',['QQH1352T_13','DIGIUP15_PU25','RECOUP15_PU25','HARVESTUP15_PU25']] workflows[25205]=['',['ZTT_13','DIGIUP15_PU25','RECOUP15_PU25','HARVESTUP15_PU25','NANOUP15_PU25']] diff --git a/Configuration/PyReleaseValidation/python/relval_standard.py b/Configuration/PyReleaseValidation/python/relval_standard.py index 7e339233900b6..d82ea4a2e5a1a 100644 --- a/Configuration/PyReleaseValidation/python/relval_standard.py +++ b/Configuration/PyReleaseValidation/python/relval_standard.py @@ -191,6 +191,8 @@ workflows[136.735] = ['',['RunNoBPTX2016B','HLTDR2_2016','RECODR2reHLTAlCaTkCosmics_HIPM','HARVESTDR2']] # reminiAOD wf on 2016B input, mainly here for PPS testing workflows[136.72411] = ['',['RunJetHT2016B_reminiaodUL','REMINIAOD_data2016UL_HIPM','HARVESTDR2_REMINIAOD_data2016UL_HIPM']] +workflows[136.72412] = ['',['RunJetHT2016B_reminiaodUL','REMININANO_data2016UL_HIPM','HARVESTDR2_REMININANO_data2016UL_HIPM']] +#workflows[136.72413] = ['',['RunJetHT2016B_reminiaodUL','REMININANO_data2016UL_HIPM_met','HARVESTDR2_REMININANO_data2016UL_HIPM_met']] #diable for now until MET is fixed. ### run 2016C ### workflows[136.736] = ['',['RunHLTPhy2016C','HLTDR2_2016','RECODR2_2016reHLT_HIPM','HARVESTDR2']] @@ -425,11 +427,14 @@ workflows[136.885521] = ['',['RunHLTPhy2018D','HLTDR2_2018','RECODR2_2018reHLT_HCALOnlyCPU','HARVEST2018_HCALOnly']] workflows[136.888521] = ['',['RunJetHT2018D','HLTDR2_2018','RECODR2_2018reHLT_HCALOnlyCPU','HARVEST2018_HCALOnly']] +### run 2021 CRUZET ### +workflows[136.897] = ['',['RunCosmics2021CRUZET','RECOCOSDRUN3','ALCACOSDRUN3','HARVESTDCRUN3']] + # multi-run harvesting workflows[137.8] = ['',['RunEGamma2018C','HLTDR2_2018','RECODR2_2018reHLT_skimEGamma_Offline_L1TEgDQM', 'RunEGamma2018D','HLTDR2_2018','RECODR2_2018reHLT_skimEGamma_Prompt_L1TEgDQM','HARVEST2018_L1TEgDQM_MULTIRUN']] ### LS2 - MWGR ### -workflows[138.1] = ['',['RunCosmics2021','RECOCOSDPROMPTRUN3','ALCACOSDRUN3','HARVESTDCRUN3']] +workflows[138.1] = ['',['RunCosmics2021','RECOCOSDPROMPTRUN3','ALCACOSDPROMPTRUN3','HARVESTDCPROMPTRUN3']] workflows[138.2] = ['',['RunCosmics2021','RECOCOSDEXPRUN3','ALCACOSDEXPRUN3','HARVESTDCEXPRUN3']] #### Test of lumi section boundary crossing with run2 2018D #### diff --git a/Configuration/PyReleaseValidation/python/relval_steps.py b/Configuration/PyReleaseValidation/python/relval_steps.py index 3c6bd56721c47..f4e71afd8fc11 100644 --- a/Configuration/PyReleaseValidation/python/relval_steps.py +++ b/Configuration/PyReleaseValidation/python/relval_steps.py @@ -493,6 +493,9 @@ ### LS2 - MWGR 2021 - CSC, DAQ, DCS, DQM, DT, ECAL, GEM, HCAL, L1SCOUT, PIXEL, RPC, TCDS, TRACKER, TRG ### steps['RunCosmics2021']={'INPUT':InputInfo(dataSet='/ExpressCosmics/Commissioning2021-Express-v1/FEVT',label='2021GR5',ls={343498: [[1, 10000]]},events=100000,location='STD')} +#### run3 Cosmics #### +##Run 344518 @ 0T 2021CRUZET +steps['RunCosmics2021CRUZET']={'INPUT':InputInfo(dataSet='/Cosmics/Commissioning2021-v1/RAW',label='2021CRUZET',run=[344518],events=100000,location='STD')} #### Test of lumi section boundary crossing with run2 2018D #### Run2018Dml1={320822: [[1,1]] , 320823: [[1,1]]} @@ -1354,6 +1357,15 @@ def identityFS(wf): steps['ZprimeToll_M3000_13TeV_pythia8']=genvalid('ZprimeToll_M3000_13TeV_pythia8_cff',step1GenDefaults) steps['WprimeTolNu_M3000_13TeV_pythia8']=genvalid('WprimeTolNu_M3000_13TeV_pythia8_cff',step1GenDefaults) +steps['BsToMuMu_forSTEAM_13TeV_ExtGen']=genvalid('BsToMuMu_forSTEAM_13TeV_ExtGen_cfi',step1GenDefaults) +steps['BuToKstarJPsiToMuMu_forSTEAM_13TeV_ExtGen']=genvalid('BuToKstarJPsiToMuMu_forSTEAM_13TeV_ExtGen_cfi',step1GenDefaults) +steps['ZTTFS_ExtGen']=genvalid('ZTT_Tauola_OneLepton_OtherHadrons_8TeV_TuneCUETP8M1_ExtGen_cfi',step1GenDefaults) +steps['sherpa_ttbar_2j_MENLOPS_13TeV_MASTER_ExtGen']=genvalid('sherpa_ttbar_2j_MENLOPS_13TeV_MASTER_ExtGen_cff',merge([{'-n':'50'},step1GenDefaults])) +steps['HydjetQ_B12_5020GeV_2018_ExtGen']=genvalid('Hydjet_Quenched_B12_5020GeV_ExtGen_cfi',step1GenDefaults) +steps['AMPT_PPb_5020GeV_MinimumBias_ExtGen']=genvalid('AMPT_PPb_5020GeV_MinimumBias_ExtGen_cfi',step1GenDefaults) +steps['EPOS_PPb_8160GeV_MinimumBias_ExtGen']=genvalid('ReggeGribovPartonMC_EposLHC_4080_4080GeV_pPb_ExtGen_cfi',step1GenDefaults) +steps['Pyquen_ZeemumuJets_pt10_2760GeV_ExtGen']=genvalid('Pyquen_ZeemumuJets_pt10_2760GeV_ExtGen_cfi',step1GenDefaults) + # Generator Hadronization (Hadronization of LHE) steps['WJetsLNu_13TeV_madgraph-pythia8']=genvalid('Hadronizer_MgmMatchTuneCUETP8M1_13TeV_madgraph_pythia8_cff',step1GenDefaults,dataSet='/WJetsToLNu_13TeV-madgraph/Fall13wmLHE-START62_V1-v1/GEN') steps['Hadronizer_TuneCUETP8M1_13TeV_MLM_5f_max4j_LHE_pythia8']=genvalid('Hadronizer_TuneCUETP8M1_13TeV_MLM_5f_max4j_LHE_pythia8_cff',step1HadronizerDefaults) @@ -1543,7 +1555,7 @@ def gen2018RD(fragment,howMuch): #Herwig7 steps['TTbar_13TeV_Pow_herwig7']=genvalid('Configuration/Generator/python/TT_13TeV_Pow_Herwig7_cff',step1LHEGenDQM) -steps['DYToLL012Jets_5FS_TuneCH3_13TeV_amcatnloFxFx_herwig7']=genvalid('Configuration/Generator/python/DYToLL012Jets_5FS_TuneCH3_13TeV_amcatnloFxFx_herwig7_cff',step1LHEGenDQM) +steps['DYToLL012Jets_5FS_TuneCH3_13TeV_amcatnloFxFx_herwig7']=genvalid('Configuration/Generator/python/DYToLL012Jets_5FS_TuneCH3_13TeV_amcatnloFxFx_herwig7_cff',merge([{'-n':'12'},step1LHEGenDQM])) steps['DYToLL01234Jets_5FS_TuneCH3_13TeV_madgraphMLM_herwig7']=genvalid('Configuration/Generator/python/DYToLL01234Jets_5FS_TuneCH3_13TeV_madgraphMLM_herwig7_cff',step1LHEGenDQM) @@ -2161,7 +2173,7 @@ def lhegensim2018ml(fragment,howMuch): },dataReco]) steps['RECOCOSDRUN2']=merge([{'--conditions':'auto:run2_data','--era':'Run2_2016'},steps['RECOCOSD']]) -steps['RECOCOSDRUN3']=merge([{'--conditions':'auto:run3_data_prompt','--era':'Run3'},steps['RECOCOSD']]) +steps['RECOCOSDRUN3']=merge([{'--conditions':'auto:run3_data','--era':'Run3'},steps['RECOCOSD']]) steps['RECOCOSDPROMPTRUN3']=merge([{'--conditions':'auto:run3_data_prompt', '--era':'Run3', @@ -2585,10 +2597,11 @@ def gen2021HiMix(fragment,howMuch): '-s':'ALCA:TkAlCosmics0T+MuAlGlobalCosmics+HcalCalHOCosmics+DQM' } -steps['ALCACOSDRUN2']=merge([{'--conditions':'auto:run2_data','--era':'Run2_2016','-s':'ALCA:SiPixelCalCosmics+TkAlCosmics0T+SiStripCalCosmics+MuAlGlobalCosmics+HcalCalHOCosmics+DQM'},steps['ALCACOSD']]) +steps['ALCACOSDRUN2']=merge([{'--conditions':'auto:run2_data','--era':'Run2_2016','-s':'ALCA:SiPixelCalCosmics+TkAlCosmics0T+SiStripCalCosmics+SiStripCalCosmicsNano+MuAlGlobalCosmics+HcalCalHOCosmics+DQM'},steps['ALCACOSD']]) -steps['ALCACOSDRUN3']=merge([{'--conditions':'auto:run3_data_prompt','--era':'Run3','-s':'ALCA:SiPixelCalCosmics+TkAlCosmics0T+SiStripCalCosmics+MuAlGlobalCosmics+HcalCalHOCosmics+DQM'},steps['ALCACOSD']]) -steps['ALCACOSDEXPRUN3']=merge([{'--conditions':'auto:run3_data_express','--era':'Run3','-s':'ALCA:SiPixelCalCosmics+TkAlCosmics0T+SiStripCalCosmics+MuAlGlobalCosmics+HcalCalHOCosmics+DQM'},steps['ALCACOSD']]) +steps['ALCACOSDRUN3']=merge([{'--conditions':'auto:run3_data','--era':'Run3','-s':'ALCA:SiPixelCalCosmics+TkAlCosmics0T+SiStripCalCosmics+SiStripCalCosmicsNano+MuAlGlobalCosmics+HcalCalHOCosmics+DQM'},steps['ALCACOSD']]) +steps['ALCACOSDPROMPTRUN3']=merge([{'--conditions':'auto:run3_data_prompt','--era':'Run3','-s':'ALCA:SiPixelCalCosmics+TkAlCosmics0T+SiStripCalCosmics+SiStripCalCosmicsNano+MuAlGlobalCosmics+HcalCalHOCosmics+DQM'},steps['ALCACOSD']]) +steps['ALCACOSDEXPRUN3']=merge([{'--conditions':'auto:run3_data_express','--era':'Run3','-s':'ALCA:SiPixelCalCosmics+TkAlCosmics0T+SiStripCalCosmics+SiStripCalCosmicsNano+MuAlGlobalCosmics+HcalCalHOCosmics+DQM'},steps['ALCACOSD']]) steps['ALCAPROMPT']={'-s':'ALCA:PromptCalibProd', '--filein':'file:TkAlMinBias.root', @@ -2645,10 +2658,10 @@ def gen2021HiMix(fragment,howMuch): steps['ALCAHAL']=merge([{'-s':'ALCA:TkAlBeamHalo+MuAlBeamHaloOverlaps+MuAlBeamHalo'},step4Up2015Defaults]) steps['ALCACOS_UP15']=merge([{'--conditions':'auto:run2_mc_cosmics','-s':'ALCA:TkAlBeamHalo+MuAlBeamHaloOverlaps+MuAlBeamHalo'},step4Up2015Defaults]) -steps['ALCACOS_UP16']=merge([{'--conditions':'auto:run2_mc_cosmics','-s':'ALCA:TkAlCosmics0T+SiStripCalCosmics+SiPixelCalCosmics+TkAlBeamHalo+MuAlBeamHaloOverlaps+MuAlBeamHalo','--era':'Run2_2016'},step4Up2015Defaults]) -steps['ALCACOS_UP17']=merge([{'--conditions':'auto:phase1_2017_cosmics','-s':'ALCA:TkAlCosmics0T+SiStripCalCosmics+SiPixelCalCosmics+TkAlBeamHalo+MuAlBeamHaloOverlaps+MuAlBeamHalo','--era':'Run2_2017'},step4Up2015Defaults]) -steps['ALCACOS_UP18']=merge([{'--conditions':'auto:phase1_2018_cosmics','-s':'ALCA:TkAlCosmics0T+SiStripCalCosmics+SiPixelCalCosmics+TkAlBeamHalo+MuAlBeamHaloOverlaps+MuAlBeamHalo','--era':'Run2_2018'},step4Up2015Defaults]) -steps['ALCACOS_UP21']=merge([{'--conditions':'auto:phase1_2021_cosmics','-s':'ALCA:TkAlCosmics0T+SiStripCalCosmics+SiPixelCalCosmics+TkAlBeamHalo+MuAlBeamHaloOverlaps+MuAlBeamHalo','--era':'Run3'},step4Up2015Defaults]) +steps['ALCACOS_UP16']=merge([{'--conditions':'auto:run2_mc_cosmics','-s':'ALCA:TkAlCosmics0T+SiStripCalCosmics+SiStripCalCosmicsNano+SiPixelCalCosmics+TkAlBeamHalo+MuAlBeamHaloOverlaps+MuAlBeamHalo','--era':'Run2_2016'},step4Up2015Defaults]) +steps['ALCACOS_UP17']=merge([{'--conditions':'auto:phase1_2017_cosmics','-s':'ALCA:TkAlCosmics0T+SiStripCalCosmics+SiStripCalCosmicsNano+SiPixelCalCosmics+TkAlBeamHalo+MuAlBeamHaloOverlaps+MuAlBeamHalo','--era':'Run2_2017'},step4Up2015Defaults]) +steps['ALCACOS_UP18']=merge([{'--conditions':'auto:phase1_2018_cosmics','-s':'ALCA:TkAlCosmics0T+SiStripCalCosmics+SiStripCalCosmicsNano+SiPixelCalCosmics+TkAlBeamHalo+MuAlBeamHaloOverlaps+MuAlBeamHalo','--era':'Run2_2018'},step4Up2015Defaults]) +steps['ALCACOS_UP21']=merge([{'--conditions':'auto:phase1_2021_cosmics','-s':'ALCA:TkAlCosmics0T+SiStripCalCosmics+SiStripCalCosmicsNano+SiPixelCalCosmics+TkAlBeamHalo+MuAlBeamHaloOverlaps+MuAlBeamHalo','--era':'Run3'},step4Up2015Defaults]) steps['ALCACOS_UP21_0T']=merge([{'--magField':'0T','--conditions':'auto:phase1_2021_cosmics_0T'},steps['ALCACOS_UP21']]) steps['ALCAHARVD']={'-s':'ALCAHARVEST:BeamSpotByRun+BeamSpotByLumi+SiStripQuality', '--conditions':'auto:run1_data', @@ -2808,13 +2821,18 @@ def gen2021HiMix(fragment,howMuch): steps['HARVESTDCRUN2']=merge([{'--conditions':'auto:run2_data','--era':'Run2_2016'},steps['HARVESTDC']]) -steps['HARVESTDCRUN3']=merge([{'--conditions':'auto:run3_data_prompt','--era':'Run3'},steps['HARVESTDC']]) +steps['HARVESTDCRUN3']=merge([{'--conditions':'auto:run3_data','--era':'Run3'},steps['HARVESTDC']]) +steps['HARVESTDCPROMPTRUN3']=merge([{'--conditions':'auto:run3_data_prompt','--era':'Run3'},steps['HARVESTDC']]) steps['HARVESTDCEXPRUN3']=merge([{'--conditions':'auto:run3_data_express','--era':'Run3'},steps['HARVESTDC']]) steps['HARVESTDR2_REMINIAOD_data2016']=merge([{'--data':'', '-s':'HARVESTING:@miniAODDQM','--era':'Run2_2016,run2_miniAOD_80XLegacy'},steps['HARVESTDR2']]) +steps['HARVESTDR2_REMININANO_data2016']=merge([{'--data':'', '-s':'HARVESTING:@miniAODDQM+@nanoAODDQM','--era':'Run2_2016'},steps['HARVESTDR2']]) steps['HARVESTDR2_REMINIAOD_data2016_HIPM']=merge([{'--era':'Run2_2016_HIPM,run2_miniAOD_80XLegacy'},steps['HARVESTDR2_REMINIAOD_data2016']]) steps['HARVESTDR2_REMINIAOD_data2016UL']=merge([{'--era':'Run2_2016', '--procModifiers':'run2_miniAOD_UL_preSummer20'},steps['HARVESTDR2_REMINIAOD_data2016']]) +steps['HARVESTDR2_REMININANO_data2016UL']=merge([{'--era':'Run2_2016', '--procModifiers':'run2_miniAOD_UL_preSummer20'},steps['HARVESTDR2_REMININANO_data2016']]) steps['HARVESTDR2_REMINIAOD_data2016UL_HIPM']=merge([{'--era':'Run2_2016_HIPM'},steps['HARVESTDR2_REMINIAOD_data2016UL']]) +steps['HARVESTDR2_REMININANO_data2016UL_HIPM']=merge([{'--era':'Run2_2016_HIPM,run2_nanoAOD_106Xv2,run3_nanoAOD_devel'},steps['HARVESTDR2_REMININANO_data2016UL']]) +steps['HARVESTDR2_REMININANO_data2016UL_HIPM_met']=merge([{'--era':'Run2_2016_HIPM,run2_nanoAOD_106Xv1,run3_nanoAOD_devel'},steps['HARVESTDR2_REMININANO_data2016UL']]) steps['HARVEST2017_REMINIAOD_data2017']=merge([{'--era':'Run2_2017,run2_miniAOD_94XFall17'},steps['HARVESTDR2_REMINIAOD_data2016']]) steps['HARVEST2017_REMINIAOD_data2017UL']=merge([{'--era':'Run2_2017'},steps['HARVESTDR2_REMINIAOD_data2016UL']]) @@ -3096,9 +3114,22 @@ def gen2021HiMix(fragment,howMuch): '--datatier' : 'MINIAOD,DQMIO' },stepMiniAODDefaults]) +steps['REMININANO_data2016'] = merge([{'-s' : 'PAT,NANO,DQM:@miniAODDQM+@nanoAODDQM', + '--process' : 'PATnano', + '--era' : 'Run2_2016', + '--conditions' : 'auto:run2_data_relval', + '--data' : '', + '--scenario' : 'pp', + '--eventcontent' : 'MINIAOD,NANOEDMAOD,DQM', + '--datatier' : 'MINIAOD,NANOAOD,DQMIO' + }]) + steps['REMINIAOD_data2016_HIPM'] = merge([{'--era' : 'Run2_2016_HIPM,run2_miniAOD_80XLegacy'},steps['REMINIAOD_data2016']]) steps['REMINIAOD_data2016UL'] = merge([{'--era' : 'Run2_2016', '--procModifiers' : 'run2_miniAOD_UL_preSummer20'},steps['REMINIAOD_data2016']]) +steps['REMININANO_data2016UL'] = merge([{'--era' : 'Run2_2016', '--procModifiers' : 'run2_miniAOD_UL_preSummer20'},steps['REMININANO_data2016']]) steps['REMINIAOD_data2016UL_HIPM'] = merge([{'--era' : 'Run2_2016_HIPM'},steps['REMINIAOD_data2016UL']]) +steps['REMININANO_data2016UL_HIPM'] = merge([{'--era' : 'Run2_2016_HIPM,run2_nanoAOD_106Xv2,run3_nanoAOD_devel'},steps['REMININANO_data2016UL']]) +steps['REMININANO_data2016UL_HIPM_met'] = merge([{'--era' : 'Run2_2016_HIPM,run2_nanoAOD_106Xv1,run3_nanoAOD_devel'},steps['REMININANO_data2016UL']]) stepReMiniAODData17 = merge([{'--era' : 'Run2_2017,run2_miniAOD_94XFall17'},steps['REMINIAOD_data2016']]) steps['REMINIAOD_data2017'] = stepReMiniAODData17 diff --git a/Configuration/PyReleaseValidation/python/upgradeWorkflowComponents.py b/Configuration/PyReleaseValidation/python/upgradeWorkflowComponents.py index bd2a20d5e2471..f5ff92debab2c 100644 --- a/Configuration/PyReleaseValidation/python/upgradeWorkflowComponents.py +++ b/Configuration/PyReleaseValidation/python/upgradeWorkflowComponents.py @@ -415,10 +415,12 @@ def condition(self, fragment, stepList, key, hasHarvest): # - 2021 conditions, TTbar # - 2021 conditions, Z->mumu, class PatatrackWorkflow(UpgradeWorkflow): - def __init__(self, reco, harvest, **kwargs): + def __init__(self, digi = {}, reco = {}, harvest = {}, **kwargs): # adapt the parameters for the UpgradeWorkflow init method super(PatatrackWorkflow, self).__init__( steps = [ + 'Digi', + 'DigiTrigger', 'Reco', 'HARVEST', 'RecoFakeHLT', @@ -428,6 +430,7 @@ def __init__(self, reco, harvest, **kwargs): ], PU = [], **kwargs) + self.__digi = digi self.__reco = reco self.__reco.update({ '--datatier': 'GEN-SIM-RECO,DQMIO', @@ -452,13 +455,18 @@ def condition(self, fragment, stepList, key, hasHarvest): return result def setup_(self, step, stepName, stepDict, k, properties): - if 'Reco' in step: + if 'Digi' in step: + stepDict[stepName][k] = merge([self.__digi, stepDict[step][k]]) + elif 'Reco' in step: stepDict[stepName][k] = merge([self.__reco, stepDict[step][k]]) elif 'HARVEST' in step: stepDict[stepName][k] = merge([self.__harvest, stepDict[step][k]]) upgradeWFs['PatatrackPixelOnlyCPU'] = PatatrackWorkflow( + digi = { + # there is no customisation for enabling the Patatrack pixel quadruplets running only on the CPU + }, reco = { '-s': 'RAW2DIGI:RawToDigi_pixelOnly,RECO:reconstruction_pixelTrackingOnly,VALIDATION:@pixelTrackingOnlyValidation,DQM:@pixelTrackingOnlyDQM', '--procModifiers': 'pixelNtupletFit' @@ -471,6 +479,9 @@ def setup_(self, step, stepName, stepDict, k, properties): ) upgradeWFs['PatatrackPixelOnlyGPU'] = PatatrackWorkflow( + digi = { + '--procModifiers': 'gpu' + }, reco = { '-s': 'RAW2DIGI:RawToDigi_pixelOnly,RECO:reconstruction_pixelTrackingOnly,VALIDATION:@pixelTrackingOnlyValidation,DQM:@pixelTrackingOnlyDQM', '--procModifiers': 'pixelNtupletFit,gpu' @@ -483,6 +494,9 @@ def setup_(self, step, stepName, stepDict, k, properties): ) upgradeWFs['PatatrackPixelOnlyTripletsCPU'] = PatatrackWorkflow( + digi = { + # there is no customisation for enabling the Patatrack pixel triplets running only on the CPU + }, reco = { '-s': 'RAW2DIGI:RawToDigi_pixelOnly,RECO:reconstruction_pixelTrackingOnly,VALIDATION:@pixelTrackingOnlyValidation,DQM:@pixelTrackingOnlyDQM', '--procModifiers': 'pixelNtupletFit', @@ -496,6 +510,10 @@ def setup_(self, step, stepName, stepDict, k, properties): ) upgradeWFs['PatatrackPixelOnlyTripletsGPU'] = PatatrackWorkflow( + digi = { + '--procModifiers': 'gpu', + '--customise': 'HLTrigger/Configuration/customizeHLTforPatatrack.enablePatatrackPixelTriplets' + }, reco = { '-s': 'RAW2DIGI:RawToDigi_pixelOnly,RECO:reconstruction_pixelTrackingOnly,VALIDATION:@pixelTrackingOnlyValidation,DQM:@pixelTrackingOnlyDQM', '--procModifiers': 'pixelNtupletFit,gpu', @@ -520,6 +538,9 @@ def setup_(self, step, stepName, stepDict, k, properties): ) upgradeWFs['PatatrackECALOnlyGPU'] = PatatrackWorkflow( + digi = { + '--procModifiers': 'gpu' + }, reco = { '-s': 'RAW2DIGI:RawToDigi_ecalOnly,RECO:reconstruction_ecalOnly,VALIDATION:@ecalOnlyValidation,DQM:@ecalOnly', '--procModifiers': 'gpu' @@ -543,6 +564,9 @@ def setup_(self, step, stepName, stepDict, k, properties): ) upgradeWFs['PatatrackHCALOnlyGPU'] = PatatrackWorkflow( + digi = { + '--procModifiers': 'gpu' + }, reco = { '-s': 'RAW2DIGI:RawToDigi_hcalOnly,RECO:reconstruction_hcalOnly,VALIDATION:@hcalOnlyValidation,DQM:@hcalOnly+@hcal2Only', '--procModifiers': 'gpu' @@ -554,6 +578,69 @@ def setup_(self, step, stepName, stepDict, k, properties): offset = 0.522, ) +upgradeWFs['PatatrackCPU'] = PatatrackWorkflow( + digi = { + # there is no customisation for enabling the Patatrack pixel quadruplets running only on the CPU + }, + reco = { + # skip the @pixelTrackingOnlyValidation which cannot run together with the full reconstruction + '-s': 'RAW2DIGI:RawToDigi+RawToDigi_pixelOnly,L1Reco,RECO:reconstruction+reconstruction_pixelTrackingOnly,RECOSIM,EI,PAT,VALIDATION:@standardValidation+@miniAODValidation,DQM:@standardDQM+@ExtraHLT+@miniAODDQM+@pixelTrackingOnlyDQM', + '--procModifiers': 'pixelNtupletFit' + }, + harvest = { + }, + suffix = 'Patatrack_CPU', + offset = 0.591, +) + +upgradeWFs['PatatrackGPU'] = PatatrackWorkflow( + digi = { + '--procModifiers': 'gpu' + }, + reco = { + # skip the @pixelTrackingOnlyValidation which cannot run together with the full reconstruction + '-s': 'RAW2DIGI:RawToDigi+RawToDigi_pixelOnly,L1Reco,RECO:reconstruction+reconstruction_pixelTrackingOnly,RECOSIM,EI,PAT,VALIDATION:@standardValidation+@miniAODValidation,DQM:@standardDQM+@ExtraHLT+@miniAODDQM+@pixelTrackingOnlyDQM', + '--procModifiers': 'pixelNtupletFit,gpu' + }, + harvest = { + }, + suffix = 'Patatrack_GPU', + offset = 0.592, +) + +upgradeWFs['PatatrackTripletsCPU'] = PatatrackWorkflow( + digi = { + # there is no customisation for enabling the Patatrack pixel triplets running only on the CPU + }, + reco = { + # skip the @pixelTrackingOnlyValidation which cannot run together with the full reconstruction + '-s': 'RAW2DIGI:RawToDigi+RawToDigi_pixelOnly,L1Reco,RECO:reconstruction+reconstruction_pixelTrackingOnly,RECOSIM,EI,PAT,VALIDATION:@standardValidation+@miniAODValidation,DQM:@standardDQM+@ExtraHLT+@miniAODDQM+@pixelTrackingOnlyDQM', + '--procModifiers': 'pixelNtupletFit', + '--customise' : 'RecoPixelVertexing/Configuration/customizePixelTracksForTriplets.customizePixelTracksForTriplets' + }, + harvest = { + }, + suffix = 'Patatrack_TripletsCPU', + offset = 0.595, +) + +upgradeWFs['PatatrackTripletsGPU'] = PatatrackWorkflow( + digi = { + '--procModifiers': 'gpu', + '--customise': 'HLTrigger/Configuration/customizeHLTforPatatrack.enablePatatrackPixelTriplets' + }, + reco = { + # skip the @pixelTrackingOnlyValidation which cannot run together with the full reconstruction + '-s': 'RAW2DIGI:RawToDigi+RawToDigi_pixelOnly,L1Reco,RECO:reconstruction+reconstruction_pixelTrackingOnly,RECOSIM,EI,PAT,VALIDATION:@standardValidation+@miniAODValidation,DQM:@standardDQM+@ExtraHLT+@miniAODDQM+@pixelTrackingOnlyDQM', + '--procModifiers': 'pixelNtupletFit,gpu', + '--customise': 'RecoPixelVertexing/Configuration/customizePixelTracksForTriplets.customizePixelTracksForTriplets' + }, + harvest = { + }, + suffix = 'Patatrack_TripletsGPU', + offset = 0.596, +) + # end of Patatrack workflows class UpgradeWorkflow_ProdLike(UpgradeWorkflow): diff --git a/Configuration/PyReleaseValidation/scripts/runTheMatrix.py b/Configuration/PyReleaseValidation/scripts/runTheMatrix.py index 263b5f8106724..bdadf6e63259b 100755 --- a/Configuration/PyReleaseValidation/scripts/runTheMatrix.py +++ b/Configuration/PyReleaseValidation/scripts/runTheMatrix.py @@ -90,6 +90,7 @@ def runSelected(opt): 11634.911, #2021 DD4hep ttbar reading geometry from XML 11634.912, #2021 DD4hep ttbar reading geometry from the DB 11634.0, #2021 ttbar + 11634.7, #2021 ttbar mkFit 12434.0, #2023 ttbar 23234.0, #2026D49 ttbar (HLT TDR baseline w/ HGCal v11) 28234.0, #2026D60 (exercise HF nose) @@ -104,208 +105,268 @@ def runSelected(opt): } - import optparse + import argparse usage = 'usage: runTheMatrix.py --show -s ' - parser = optparse.OptionParser(usage) - - parser.add_option('-b','--batchName', - help='relval batch: suffix to be appended to Campaign name', - dest='batchName', - default='' - ) - - parser.add_option('-m','--memoryOffset', - help='memory of the wf for single core', - dest='memoryOffset', - default=3000 - ) - parser.add_option('--addMemPerCore', - help='increase of memory per each n > 1 core: memory(n_core) = memoryOffset + (n_core-1) * memPerCore', - dest='memPerCore', - default=1500 - ) - parser.add_option('-j','--nproc', - help='number of processes. 0 Will use 4 processes, not execute anything but create the wfs', - dest='nProcs', - default=4 - ) - parser.add_option('-t','--nThreads', - help='number of threads per process to use in cmsRun.', - dest='nThreads', - default=1 - ) - parser.add_option('--nStreams', - help='number of streams to use in cmsRun.', - dest='nStreams', - default=0 - ) - parser.add_option('--numberEventsInLuminosityBlock', - help='number of events in a luminosity block', - dest='numberEventsInLuminosityBlock', - default=-1 - ) - - parser.add_option('-n','--showMatrix', - help='Only show the worflows. Use --ext to show more', - dest='show', - default=False, - action='store_true' - ) - parser.add_option('-e','--extended', - help='Show details of workflows, used with --show', - dest='extended', - default=False, - action='store_true' - ) - parser.add_option('-s','--selected', - help='Run a pre-defined selected matrix of wf. Deprecated, please use -l limited', - dest='restricted', - default=False, - action='store_true' - ) - parser.add_option('-l','--list', - help='Coma separated list of workflow to be shown or ran. Possible keys are also '+str(predefinedSet.keys())+'. and wild card like muon, or mc', - dest='testList', - default=None - ) - parser.add_option('-r','--raw', - help='Temporary dump the .txt needed for prodAgent interface. To be discontinued soon. Argument must be the name of the set (standard, pileup,...)', - dest='raw' - ) - parser.add_option('-i','--useInput', - help='Use recyling where available. Either all, or a coma separated list of wf number.', - dest='useInput', - default=None - ) - parser.add_option('-w','--what', - help='Specify the set to be used. Argument must be the name of a set (standard, pileup,...) or multiple sets separated by commas (--what standard,pileup )', - dest='what', - default='all' - ) - parser.add_option('--step1', - help='Used with --raw. Limit the production to step1', - dest='step1Only', - default=False - ) - parser.add_option('--maxSteps', - help='Only run maximum on maxSteps. Used when we are only interested in first n steps.', - dest='maxSteps', - default=9999, - type="int" - ) - parser.add_option('--fromScratch', - help='Coma separated list of wf to be run without recycling. all is not supported as default.', - dest='fromScratch', - default=None - ) - parser.add_option('--refRelease', - help='Allow to modify the recycling dataset version', - dest='refRel', - default=None - ) - parser.add_option('--wmcontrol', - help='Create the workflows for injection to WMAgent. In the WORKING. -wmcontrol init will create the the workflows, -wmcontrol test will dryRun a test, -wmcontrol submit will submit to wmagent', - choices=['init','test','submit','force'], - dest='wmcontrol', - default=None, - ) - parser.add_option('--revertDqmio', - help='When submitting workflows to wmcontrol, force DQM outout to use pool and not DQMIO', - choices=['yes','no'], - dest='revertDqmio', - default='no', - ) - parser.add_option('--optionswm', - help='Specify a few things for wm injection', - default='', - dest='wmoptions') - parser.add_option('--keep', - help='allow to specify for which coma separated steps the output is needed', - default=None) - parser.add_option('--label', - help='allow to give a special label to the output dataset name', - default='') - parser.add_option('--command', - help='provide a way to add additional command to all of the cmsDriver commands in the matrix', - dest='command', - action='append', - default=None - ) - parser.add_option('--apply', - help='allow to use the --command only for 1 coma separeated', - dest='apply', - default=None) - parser.add_option('--workflow', - help='define a workflow to be created or altered from the matrix', - action='append', - dest='workflow', - default=None - ) - parser.add_option('--dryRun', - help='do not run the wf at all', - action='store_true', - dest='dryRun', - default=False - ) - parser.add_option('--testbed', - help='workflow injection to cmswebtest (you need dedicated rqmgr account)', - dest='testbed', - default=False, - action='store_true' - ) - parser.add_option('--noCafVeto', - help='Run from any source, ignoring the CAF label', - dest='cafVeto', - default=True, - action='store_false' - ) - parser.add_option('--overWrite', - help='Change the content of a step for another. List of pairs.', - dest='overWrite', - default=None - ) - parser.add_option('--noRun', - help='Remove all run list selection from wfs', - dest='noRun', - default=False, - action='store_true') - - parser.add_option('--das-options', - help='Options to be passed to dasgoclient.', - dest='dasOptions', - default="--limit 0", - action='store') - - parser.add_option('--job-reports', - help='Dump framework job reports', - dest='jobReports', - default=False, - action='store_true') - - parser.add_option('--ibeos', - help='Use IB EOS site configuration', - dest='IBEos', - default=False, - action='store_true') - - parser.add_option('--sites', - help='Run DAS query to get data from a specific site (default is T2_CH_CERN). Set it to empty string to search all sites.', - dest='dasSites', - default='T2_CH_CERN', - action='store') - parser.add_option('--interactive', - help="Open the Matrix interactive shell", - action='store_true', - default=False) - - parser.add_option('--dbs-url', - help='Overwrite DbsUrl value in JSON submitted to ReqMgr2', - dest='dbsUrl', - default=None, - action='store') - - opt,args = parser.parse_args() + parser = argparse.ArgumentParser(usage,formatter_class=argparse.ArgumentDefaultsHelpFormatter) + + parser.add_argument('-b','--batchName', + help='relval batch: suffix to be appended to Campaign name', + dest='batchName', + default='') + + parser.add_argument('-m','--memoryOffset', + help='memory of the wf for single core', + dest='memoryOffset', + type=int, + default=3000) + + parser.add_argument('--addMemPerCore', + help='increase of memory per each n > 1 core: memory(n_core) = memoryOffset + (n_core-1) * memPerCore', + dest='memPerCore', + type=int, + default=1500) + + parser.add_argument('-j','--nproc', + help='number of processes. 0 Will use 4 processes, not execute anything but create the wfs', + dest='nProcs', + type=int, + default=4) + + parser.add_argument('-t','--nThreads', + help='number of threads per process to use in cmsRun.', + dest='nThreads', + type=int, + default=1) + + parser.add_argument('--nStreams', + help='number of streams to use in cmsRun.', + dest='nStreams', + type=int, + default=0) + + parser.add_argument('--numberEventsInLuminosityBlock', + help='number of events in a luminosity block', + dest='numberEventsInLuminosityBlock', + type=int, + default=-1) + + parser.add_argument('-n','--showMatrix', + help='Only show the worflows. Use --ext to show more', + dest='show', + default=False, + action='store_true') + + parser.add_argument('-e','--extended', + help='Show details of workflows, used with --show', + dest='extended', + default=False, + action='store_true') + + parser.add_argument('-s','--selected', + help='Run a pre-defined selected matrix of wf. Deprecated, please use -l limited', + dest='restricted', + default=False, + action='store_true') + + parser.add_argument('-l','--list', + help='Comma separated list of workflow to be shown or ran. Possible keys are also '+str(predefinedSet.keys())+'. and wild card like muon, or mc', + dest='testList', + default=None) + + parser.add_argument('-r','--raw', + help='Temporary dump the .txt needed for prodAgent interface. To be discontinued soon. Argument must be the name of the set (standard, pileup,...)', + dest='raw') + + parser.add_argument('-i','--useInput', + help='Use recyling where available. Either all, or a comma separated list of wf number.', + dest='useInput', + type=lambda x: x.split(','), + default=None) + + parser.add_argument('-w','--what', + help='Specify the set to be used. Argument must be the name of a set (standard, pileup,...) or multiple sets separated by commas (--what standard,pileup )', + dest='what', + default='all') + + parser.add_argument('--step1', + help='Used with --raw. Limit the production to step1', + dest='step1Only', + default=False) + + parser.add_argument('--maxSteps', + help='Only run maximum on maxSteps. Used when we are only interested in first n steps.', + dest='maxSteps', + default=9999, + type=int) + + parser.add_argument('--fromScratch', + help='Comma separated list of wf to be run without recycling. all is not supported as default.', + dest='fromScratch', + type=lambda x: x.split(','), + default=None) + + parser.add_argument('--refRelease', + help='Allow to modify the recycling dataset version', + dest='refRel', + default=None) + + parser.add_argument('--wmcontrol', + help='Create the workflows for injection to WMAgent. In the WORKING. -wmcontrol init will create the the workflows, -wmcontrol test will dryRun a test, -wmcontrol submit will submit to wmagent', + choices=['init','test','submit','force'], + dest='wmcontrol', + default=None) + + parser.add_argument('--revertDqmio', + help='When submitting workflows to wmcontrol, force DQM outout to use pool and not DQMIO', + choices=['yes','no'], + dest='revertDqmio', + default='no') + + parser.add_argument('--optionswm', + help='Specify a few things for wm injection', + default='', + dest='wmoptions') + + parser.add_argument('--keep', + help='allow to specify for which comma separated steps the output is needed', + default=None) + + parser.add_argument('--label', + help='allow to give a special label to the output dataset name', + default='') + + parser.add_argument('--command', + help='provide a way to add additional command to all of the cmsDriver commands in the matrix', + dest='command', + action='append', + default=None) + + parser.add_argument('--apply', + help='allow to use the --command only for 1 comma separeated', + dest='apply', + default=None) + + parser.add_argument('--workflow', + help='define a workflow to be created or altered from the matrix', + action='append', + dest='workflow', + default=None) + + parser.add_argument('--dryRun', + help='do not run the wf at all', + action='store_true', + dest='dryRun', + default=False) + + parser.add_argument('--testbed', + help='workflow injection to cmswebtest (you need dedicated rqmgr account)', + dest='testbed', + default=False, + action='store_true') + + parser.add_argument('--noCafVeto', + help='Run from any source, ignoring the CAF label', + dest='cafVeto', + default=True, + action='store_false') + + parser.add_argument('--overWrite', + help='Change the content of a step for another. List of pairs.', + dest='overWrite', + default=None) + + parser.add_argument('--noRun', + help='Remove all run list selection from wfs', + dest='noRun', + default=False, + action='store_true') + + parser.add_argument('--das-options', + help='Options to be passed to dasgoclient.', + dest='dasOptions', + default="--limit 0", + action='store') + + parser.add_argument('--job-reports', + help='Dump framework job reports', + dest='jobReports', + default=False, + action='store_true') + + parser.add_argument('--ibeos', + help='Use IB EOS site configuration', + dest='IBEos', + default=False, + action='store_true') + + parser.add_argument('--sites', + help='Run DAS query to get data from a specific site. Set it to empty string to search all sites.', + dest='dasSites', + default='T2_CH_CERN', + action='store') + + parser.add_argument('--interactive', + help="Open the Matrix interactive shell", + action='store_true', + default=False) + + parser.add_argument('--dbs-url', + help='Overwrite DbsUrl value in JSON submitted to ReqMgr2', + dest='dbsUrl', + default=None, + action='store') + + gpugroup = parser.add_argument_group('GPU-related options','These options are only meaningful when --gpu is used, and is not set to forbidden.') + + gpugroup.add_argument('--gpu','--requires-gpu', + help='Enable GPU workflows. Possible options are "forbidden" (default), "required" (implied if no argument is given), or "optional".', + dest='gpu', + choices=['forbidden', 'optional', 'required'], + nargs='?', + const='required', + default='forbidden', + action='store') + + gpugroup.add_argument('--gpu-memory', + help='Specify the minimum amount of GPU memory required by the job, in MB.', + dest='GPUMemoryMB', + type=int, + default=8000) + + gpugroup.add_argument('--cuda-capabilities', + help='Specify a comma-separated list of CUDA "compute capabilities", or GPU hardware architectures, that the job can use.', + dest='CUDACapabilities', + type=lambda x: x.split(','), + default='6.0,6.1,6.2,7.0,7.2,7.5,8.0,8.6') + + # read the CUDA runtime version included in CMSSW + cudart_version = None + libcudart = os.path.realpath(os.path.expandvars('$CMSSW_RELEASE_BASE/external/$SCRAM_ARCH/lib/libcudart.so')) + if os.path.isfile(libcudart): + cudart_basename = os.path.basename(libcudart) + cudart_version = '.'.join(cudart_basename.split('.')[2:4]) + gpugroup.add_argument('--cuda-runtime', + help='Specify major and minor version of the CUDA runtime used to build the application.', + dest='CUDARuntime', + default=cudart_version) + + gpugroup.add_argument('--force-gpu-name', + help='Request a specific GPU model, e.g. "Tesla T4" or "NVIDIA GeForce RTX 2080". The default behaviour is to accept any supported GPU.', + dest='GPUName', + default='') + + gpugroup.add_argument('--force-cuda-driver-version', + help='Request a specific CUDA driver version, e.g. 470.57.02. The default behaviour is to accept any supported CUDA driver version.', + dest='CUDADriverVersion', + default='') + + gpugroup.add_argument('--force-cuda-runtime-version', + help='Request a specific CUDA runtime version, e.g. 11.4. The default behaviour is to accept any supported CUDA runtime version.', + dest='CUDARuntimeVersion', + default='') + + opt = parser.parse_args() if opt.command: opt.command = ' '.join(opt.command) os.environ["CMSSW_DAS_QUERY_SITES"]=opt.dasSites if opt.IBEos: @@ -346,8 +407,6 @@ def stepOrIndex(s): if opt.keep: opt.keep=map(stepOrIndex,opt.keep.split(',')) - - if opt.testList: testList=[] for entry in opt.testList.split(','): @@ -365,17 +424,7 @@ def stepOrIndex(s): print(entry,'is not a possible selected entry') opt.testList = list(set(testList)) - - - if opt.useInput: opt.useInput = opt.useInput.split(',') - if opt.fromScratch: opt.fromScratch = opt.fromScratch.split(',') - if opt.nProcs: opt.nProcs=int(opt.nProcs) - if opt.nThreads: opt.nThreads=int(opt.nThreads) - if opt.nStreams: opt.nStreams=int(opt.nStreams) - if (opt.numberEventsInLuminosityBlock): opt.numberEventsInLuminosityBlock=int(opt.numberEventsInLuminosityBlock) - if (opt.memoryOffset): opt.memoryOffset=int(opt.memoryOffset) - if (opt.memPerCore): opt.memPerCore=int(opt.memPerCore) - + if opt.wmcontrol: performInjectionOptionTest(opt) if opt.overWrite: diff --git a/Configuration/Skimming/BuildFile.xml b/Configuration/Skimming/BuildFile.xml index ccef0059d56f2..44376092763be 100644 --- a/Configuration/Skimming/BuildFile.xml +++ b/Configuration/Skimming/BuildFile.xml @@ -15,7 +15,6 @@ - diff --git a/Configuration/Skimming/interface/LeptonRecoSkim.h b/Configuration/Skimming/interface/LeptonRecoSkim.h index 9edb3d3fa467e..233681149dd1e 100644 --- a/Configuration/Skimming/interface/LeptonRecoSkim.h +++ b/Configuration/Skimming/interface/LeptonRecoSkim.h @@ -17,15 +17,13 @@ #include // user include files -#include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/EDFilter.h" - +#include "DataFormats/Common/interface/Handle.h" #include "FWCore/Framework/interface/Event.h" +#include "FWCore/Framework/interface/Frameworkfwd.h" #include "FWCore/Framework/interface/MakerMacros.h" - +#include "FWCore/Framework/interface/one/EDFilter.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" -#include "DataFormats/Common/interface/Handle.h" -#include "FWCore/Framework/interface/ESHandle.h" +#include "FWCore/Utilities/interface/EDGetToken.h" //includes for reco objects #include "DataFormats/EgammaCandidates/interface/GsfElectron.h" @@ -54,7 +52,7 @@ #include "DataFormats/Common/interface/TriggerResults.h" #include "FWCore/Common/interface/TriggerNames.h" -class LeptonRecoSkim : public edm::EDFilter { +class LeptonRecoSkim : public edm::one::EDFilter<> { public: explicit LeptonRecoSkim(const edm::ParameterSet&); ~LeptonRecoSkim() override; @@ -66,15 +64,20 @@ class LeptonRecoSkim : public edm::EDFilter { void handleObjects(const edm::Event&, const edm::EventSetup& iSetup); + // ----------member data --------------------------- + const edm::ESGetToken m_CaloGeoToken; + const edm::ESGetToken m_CaloTopoToken; + edm::InputTag hltLabel; std::string filterName; - edm::InputTag m_electronSrc; - edm::InputTag m_pfelectronSrc; - edm::InputTag m_muonSrc; - edm::InputTag m_jetsSrc; - edm::InputTag m_pfjetsSrc; - edm::InputTag m_ebRecHitsSrc; - edm::InputTag m_eeRecHitsSrc; + + edm::EDGetTokenT gsfElectronCollectionToken_; + edm::EDGetTokenT pfCandidateCollectionToken_; + edm::EDGetTokenT muonCollectionToken_; + edm::EDGetTokenT caloJetCollectionToken_; + edm::EDGetTokenT pfJetCollectionToken_; + edm::EDGetTokenT ebRecHitCollectionToken_; + edm::EDGetTokenT eeRecHitCollectionToken_; const reco::GsfElectronCollection* theElectronCollection; const reco::PFCandidateCollection* thePfCandidateCollection; @@ -119,5 +122,4 @@ class LeptonRecoSkim : public edm::EDFilter { int NtotalElectrons; int NmvaElectrons; - // ----------member data --------------------------- }; diff --git a/Configuration/Skimming/src/LeptonRecoSkim.cc b/Configuration/Skimming/src/LeptonRecoSkim.cc index b6f620cc33b9a..dce52f9011549 100644 --- a/Configuration/Skimming/src/LeptonRecoSkim.cc +++ b/Configuration/Skimming/src/LeptonRecoSkim.cc @@ -28,15 +28,17 @@ using namespace std; // constructors and destructor // LeptonRecoSkim::LeptonRecoSkim(const edm::ParameterSet& iConfig) - : hltLabel(iConfig.getParameter("HltLabel")), + : m_CaloGeoToken(esConsumes()), + m_CaloTopoToken(esConsumes()), + hltLabel(iConfig.getParameter("HltLabel")), filterName(iConfig.getParameter("@module_label")), - m_electronSrc(iConfig.getParameter("electronCollection")), - m_pfelectronSrc(iConfig.getParameter("pfElectronCollection")), - m_muonSrc(iConfig.getParameter("muonCollection")), - m_jetsSrc(iConfig.getParameter("caloJetCollection")), - m_pfjetsSrc(iConfig.getParameter("PFJetCollection")), - m_ebRecHitsSrc(iConfig.getParameter("ecalBarrelRecHitsCollection")), - m_eeRecHitsSrc(iConfig.getParameter("ecalEndcapRecHitsCollection")), + gsfElectronCollectionToken_(consumes(iConfig.getParameter("electronCollection"))), + pfCandidateCollectionToken_(consumes(iConfig.getParameter("pfElectronCollection"))), + muonCollectionToken_(consumes(iConfig.getParameter("muonCollection"))), + caloJetCollectionToken_(consumes(iConfig.getParameter("caloJetCollection"))), + pfJetCollectionToken_(consumes(iConfig.getParameter("PFJetCollection"))), + ebRecHitCollectionToken_(consumes(iConfig.getParameter("ecalBarrelRecHitsCollection"))), + eeRecHitCollectionToken_(consumes(iConfig.getParameter("ecalEndcapRecHitsCollection"))), useElectronSelection(iConfig.getParameter("UseElectronSelection")), usePfElectronSelection(iConfig.getParameter("UsePfElectronSelection")), useMuonSelection(iConfig.getParameter("UseMuonSelection")), @@ -204,65 +206,45 @@ void LeptonRecoSkim::beginJob() { firstEvent = true; } // ------------ method called once each job just after ending the event loop ------------ void LeptonRecoSkim::endJob() { - cout << "Filter Name = " << filterName << endl; - cout << "Total number of events = " << NeventsTotal << endl; - cout << "Total HLT_Mu9 = " << NHltMu9 << endl; - cout << "Total HLT_DoubleMu3 = " << NHltDiMu3 << endl; - cout << "Filtered events = " << NeventsFiltered << endl; - cout << "Filter Efficiency = " << (float)NeventsFiltered / (float)NeventsTotal << endl; - cout << endl; - cout << "N total electrons = " << NtotalElectrons << endl; - cout << "N mva>-0.1 electrons = " << NmvaElectrons << endl; - cout << endl; - cout << endl; + edm::LogPrint("LeptonRecoSkim") << "Filter Name = " << filterName << endl; + edm::LogPrint("LeptonRecoSkim") << "Total number of events = " << NeventsTotal << endl; + edm::LogPrint("LeptonRecoSkim") << "Total HLT_Mu9 = " << NHltMu9 << endl; + edm::LogPrint("LeptonRecoSkim") << "Total HLT_DoubleMu3 = " << NHltDiMu3 << endl; + edm::LogPrint("LeptonRecoSkim") << "Filtered events = " << NeventsFiltered << endl; + edm::LogPrint("LeptonRecoSkim") << "Filter Efficiency = " << (float)NeventsFiltered / (float)NeventsTotal + << endl; + edm::LogPrint("LeptonRecoSkim") << endl; + edm::LogPrint("LeptonRecoSkim") << "N total electrons = " << NtotalElectrons << endl; + edm::LogPrint("LeptonRecoSkim") << "N mva>-0.1 electrons = " << NmvaElectrons << endl; + edm::LogPrint("LeptonRecoSkim") << endl; + edm::LogPrint("LeptonRecoSkim") << endl; } void LeptonRecoSkim::handleObjects(const edm::Event& iEvent, const edm::EventSetup& iSetup) { //Get the electrons - Handle theElectronCollectionHandle; - iEvent.getByLabel(m_electronSrc, theElectronCollectionHandle); - theElectronCollection = theElectronCollectionHandle.product(); + theElectronCollection = &iEvent.get(gsfElectronCollectionToken_); //Get the pf electrons - Handle thePfCandidateHandle; - iEvent.getByLabel(m_pfelectronSrc, thePfCandidateHandle); - thePfCandidateCollection = thePfCandidateHandle.product(); + thePfCandidateCollection = &iEvent.get(pfCandidateCollectionToken_); //Get the Muons - Handle theMuonCollectionHandle; - iEvent.getByLabel(m_muonSrc, theMuonCollectionHandle); - theMuonCollection = theMuonCollectionHandle.product(); + theMuonCollection = &iEvent.get(muonCollectionToken_); //Get the CaloJets - Handle theCaloJetCollectionHandle; - iEvent.getByLabel(m_jetsSrc, theCaloJetCollectionHandle); - theCaloJetCollection = theCaloJetCollectionHandle.product(); + theCaloJetCollection = &iEvent.get(caloJetCollectionToken_); //Get the PfJets - Handle thePFJetCollectionHandle; - iEvent.getByLabel(m_pfjetsSrc, thePFJetCollectionHandle); - thePFJetCollection = thePFJetCollectionHandle.product(); + thePFJetCollection = &iEvent.get(pfJetCollectionToken_); - //Get the ECAL rechhits to clean the spikes + // Get the ECAL rechhits to clean the spikes // Get EB RecHits - edm::Handle ebRecHitsHandle; - iEvent.getByLabel(m_ebRecHitsSrc, ebRecHitsHandle); - theEcalBarrelCollection = ebRecHitsHandle.product(); + theEcalBarrelCollection = &iEvent.get(ebRecHitCollectionToken_); // Get EE RecHits - edm::Handle eeRecHitsHandle; - iEvent.getByLabel(m_eeRecHitsSrc, eeRecHitsHandle); - theEcalEndcapCollection = eeRecHitsHandle.product(); + theEcalEndcapCollection = &iEvent.get(eeRecHitCollectionToken_); // Get topology for spike cleaning - edm::ESHandle geometryHandle; - iSetup.get().get(geometryHandle); - theCaloGeometry = geometryHandle.product(); - // theCaloBarrelSubdetTopology = new EcalBarrelTopology(geometryHandle); - // theCaloEndcapSubdetTopology = new EcalEndcapTopology(geometryHandle); - - edm::ESHandle pTopology; - iSetup.get().get(pTopology); - theCaloTopology = pTopology.product(); + theCaloGeometry = &iSetup.getData(m_CaloGeoToken); + theCaloTopology = &iSetup.getData(m_CaloTopoToken); } //define this as a plug-in diff --git a/Configuration/Skimming/src/LeptonSkimming.cc b/Configuration/Skimming/src/LeptonSkimming.cc index 6fc1c7f3f610a..e7ffe11affd61 100644 --- a/Configuration/Skimming/src/LeptonSkimming.cc +++ b/Configuration/Skimming/src/LeptonSkimming.cc @@ -1,10 +1,10 @@ // -*- C++ -*- // -// Package: SkimmingForB/LeptonSkimming +// Package: Configuration/Skimming // Class: LeptonSkimming // -/**\class LeptonSkimming LeptonSkimming.cc SkimmingForB/LeptonSkimming/plugins/LeptonSkimming.cc +/**\class LeptonSkimming LeptonSkimming.cc Configuration/Skimming/src/LeptonSkimming.cc Description: [one line class summary] diff --git a/Configuration/StandardSequences/python/AlCaHarvesting_cff.py b/Configuration/StandardSequences/python/AlCaHarvesting_cff.py index 41604bb588ed0..3d4ced64d0675 100644 --- a/Configuration/StandardSequences/python/AlCaHarvesting_cff.py +++ b/Configuration/StandardSequences/python/AlCaHarvesting_cff.py @@ -11,6 +11,7 @@ from CalibTracker.SiPixelQuality.SiPixelStatusHarvester_cfi import * from CalibTracker.SiPixelQuality.DQMEventInfoSiPixelQuality_cff import * from CalibPPS.TimingCalibration.PPSTimingCalibrationHarvester_cff import * +from CalibPPS.TimingCalibration.ALCARECOPPSDiamondSampicTimingCalibHarvester_cff import * from Calibration.TkAlCaRecoProducers.PCLMetadataWriter_cfi import * @@ -220,9 +221,14 @@ ALCAHARVESTPPSTimingCalibration_metadata = cms.PSet(record = cms.untracked.string('PPSTimingCalibrationRcd')) ALCAHARVESTPPSTimingCalibration_dbOutput = cms.PSet(record = cms.string('PPSTimingCalibrationRcd'), tag = cms.string('PPSDiamondTimingCalibration_pcl'), - timetype = cms.untracked.string('lumiid') + timetype = cms.untracked.string('runnumber') ) +ALCAHARVESTPPSDiamondSampicTimingCalibration_metadata = cms.PSet(record = cms.untracked.string('PPSTimingCalibrationRcd_Sampic')) +ALCAHARVESTPPSDiamondSampicTimingCalibration_dbOutput = cms.PSet(record = cms.string('PPSTimingCalibrationRcd_Sampic'), + tag = cms.string('DiamondSampicCalibration'), + timetype = cms.untracked.string('runnumber')) + # define all the paths BeamSpotByRun = cms.Path(ALCAHARVESTBeamSpotByRun) BeamSpotByLumi = cms.Path(ALCAHARVESTBeamSpotByLumi) @@ -238,6 +244,7 @@ LumiPCC = cms.Path(ALCAHARVESTLumiPCC) SiPixelQuality = cms.Path(dqmEnvSiPixelQuality+ALCAHARVESTSiPixelQuality)#+siPixelPhase1DQMHarvester) PPSTimingCalibration = cms.Path(ALCAHARVESTPPSTimingCalibration) +PPSDiamondSampicTimingCalibration = cms.Path(ALCAHARVESTPPSDiamondSampicTimingCalibration) ALCAHARVESTDQMSaveAndMetadataWriter = cms.Path(dqmSaver+pclMetadataWriter) diff --git a/Configuration/StandardSequences/python/AlCaRecoStreams_cff.py b/Configuration/StandardSequences/python/AlCaRecoStreams_cff.py index d1348f9e6ae95..d2d361cb63348 100644 --- a/Configuration/StandardSequences/python/AlCaRecoStreams_cff.py +++ b/Configuration/StandardSequences/python/AlCaRecoStreams_cff.py @@ -51,6 +51,7 @@ from CalibTracker.SiPixelQuality.ALCARECOSiPixelCalZeroBias_cff import * # AlCaReco for tracker calibration using Cosmics events from Calibration.TkAlCaRecoProducers.ALCARECOSiStripCalCosmics_cff import * +from Calibration.TkAlCaRecoProducers.ALCARECOSiStripCalCosmicsNano_cff import * ############################################################### # LUMI Calibration @@ -90,6 +91,8 @@ # HCAL isotrack from Calibration.HcalAlCaRecoProducers.ALCARECOHcalCalIsoTrk_cff import * from Calibration.HcalAlCaRecoProducers.ALCARECOHcalCalIsoTrkFilter_cff import * +from Calibration.HcalAlCaRecoProducers.ALCARECOHcalCalIsoTrkFilterNoHLT_cff import * +from Calibration.HcalAlCaRecoProducers.ALCARECOHcalCalIsoTrkProducerFilter_cff import * # HCAL noise from Calibration.HcalAlCaRecoProducers.ALCARECOHcalCalNoise_cff import * #HCAL calibration iterative PhiSym @@ -101,6 +104,7 @@ from Calibration.HcalAlCaRecoProducers.ALCARECOHcalCalHBHEMuonFilter_cff import * # HCAL calibration with muons at low luminosity in HB/HE from Calibration.HcalAlCaRecoProducers.ALCARECOHcalCalLowPUHBHEMuonFilter_cff import * +from Calibration.HcalAlCaRecoProducers.ALCARECOHcalCalHBHEMuonProducerFilter_cff import * # HCAL calibration with muons in HE high eta from Calibration.HcalAlCaRecoProducers.ALCARECOHcalCalHEMuonFilter_cff import * @@ -127,6 +131,7 @@ # Timing calibration from CalibPPS.TimingCalibration.ALCARECOPPSCalTrackBasedSel_cff import * from CalibPPS.TimingCalibration.ALCARECOPPSTimingCalib_cff import * +from CalibPPS.TimingCalibration.ALCARECOPPSDiamondSampicTimingCalib_cff import * ############################################################### # nonbeam alcas @@ -182,6 +187,7 @@ pathALCARECOSiPixelCalCosmics = cms.Path(seqALCARECOSiPixelCalCosmics) pathALCARECOSiStripCalMinBias = cms.Path(seqALCARECOSiStripCalMinBias*ALCARECOSiStripCalMinBiasDQM) pathALCARECOSiStripCalCosmics = cms.Path(seqALCARECOSiStripCalCosmics) +pathALCARECOSiStripCalCosmicsNano = cms.Path(seqALCARECOSiStripCalCosmics*seqALCARECOSiStripCalCosmicsNano) pathALCARECOSiStripCalMinBiasAAG = cms.Path(seqALCARECOSiStripCalMinBiasAAG*ALCARECOSiStripCalMinBiasAAGDQM) pathALCARECOSiStripCalSmallBiasScan = cms.Path(seqALCARECOSiStripCalSmallBiasScan) pathALCARECOSiStripCalZeroBias = cms.Path(seqALCARECOSiStripCalZeroBias*ALCARECOSiStripCalZeroBiasDQM) @@ -214,11 +220,14 @@ pathALCARECOHcalCalHOCosmics = cms.Path(seqALCARECOHcalCalHOCosmics) pathALCARECOHcalCalIsoTrk = cms.Path(seqALCARECOHcalCalIsoTrk*ALCARECOHcalCalIsoTrackDQM) pathALCARECOHcalCalIsoTrkFilter = cms.Path(seqALCARECOHcalCalIsoTrkFilter) +pathALCARECOHcalCalIsoTrkFilterNoHLT = cms.Path(seqALCARECOHcalCalIsoTrkFilterNoHLT) +pathALCARECOHcalCalIsoTrkProducerFilter = cms.Path(seqALCARECOHcalCalIsoTrkProducerFilter) pathALCARECOHcalCalNoise = cms.Path(seqALCARECOHcalCalNoise) pathALCARECOHcalCalIterativePhiSym = cms.Path(seqALCARECOHcalCalIterativePhiSym*ALCARECOHcalCalIterativePhisymDQM) pathALCARECOHcalCalIsolatedBunchFilter = cms.Path(seqALCARECOHcalCalIsolatedBunchFilter) pathALCARECOHcalCalIsolatedBunchSelector = cms.Path(seqALCARECOHcalCalIsolatedBunchSelector*ALCARECOHcalCalIsolatedBunchDQM) pathALCARECOHcalCalHBHEMuonFilter = cms.Path(seqALCARECOHcalCalHBHEMuonFilter) +pathALCARECOHcalCalHBHEMuonProducerFilter = cms.Path(seqALCARECOHcalCalHBHEMuonProducerFilter) pathALCARECOHcalCalLowPUHBHEMuonFilter = cms.Path(seqALCARECOHcalCalLowPUHBHEMuonFilter) pathALCARECOHcalCalHEMuonFilter = cms.Path(seqALCARECOHcalCalHEMuonFilter) pathALCARECOMuAlCalIsolatedMu = cms.Path(seqALCARECOMuAlCalIsolatedMu) @@ -229,6 +238,7 @@ pathALCARECOMuAlOverlapsGeneralTracks = cms.Path(seqALCARECOMuAlOverlapsGeneralTracks) pathALCARECORpcCalHLT = cms.Path(seqALCARECORpcCalHLT) pathALCARECOPPSTimingCalib = cms.Path(taskALCARECOPPSTimingCalib) +pathALCARECOPPSDiamondSampicTimingCalib = cms.Path(taskALCARECOPPSDiamondSampicTimingCalib) pathALCARECOTkAlBeamHalo = cms.Path(seqALCARECOTkAlBeamHalo*ALCARECOTkAlBeamHaloDQM) pathALCARECOMuAlBeamHaloOverlaps = cms.Path(seqALCARECOMuAlBeamHaloOverlaps) pathALCARECOMuAlBeamHalo = cms.Path(seqALCARECOMuAlBeamHalo) @@ -439,6 +449,15 @@ dataTier = cms.untracked.string('ALCARECO') ) +ALCARECOStreamSiStripCalCosmicsNano = cms.FilteredStream( + responsible = "Pieter David", + name = "SiStripCalCosmicsNano", + paths = (pathALCARECOSiStripCalCosmicsNano), + content = OutALCARECOSiStripCalCosmicsNano.outputCommands, + selectEvents = OutALCARECOSiStripCalCosmicsNano.SelectEvents, + dataTier = cms.untracked.string("NANOAOD") + ) + ALCARECOStreamSiStripCalZeroBias = cms.FilteredStream( responsible = 'Gordon Kaussen', name = 'SiStripCalZeroBias', @@ -627,6 +646,24 @@ dataTier = cms.untracked.string('ALCARECO') ) +ALCARECOStreamHcalCalIsoTrkFilterNoHLT = cms.FilteredStream( + responsible = 'Sunanda Banerjee', + name = 'HcalCalIsoTrkFilterNoHLT', + paths = (pathALCARECOHcalCalIsoTrkFilterNoHLT), + content = OutALCARECOHcalCalIsoTrkFilter.outputCommands, + selectEvents = OutALCARECOHcalCalIsoTrkFilter.SelectEvents, + dataTier = cms.untracked.string('ALCARECO') + ) + +ALCARECOStreamHcalCalIsoTrkProducerFilter = cms.FilteredStream( + responsible = 'Sunanda Banerjee', + name = 'HcalCalIsoTrkProducerFilter', + paths = (pathALCARECOHcalCalIsoTrkProducerFilter), + content = OutALCARECOHcalCalIsoTrkProducerFilter.outputCommands, + selectEvents = OutALCARECOHcalCalIsoTrkProducerFilter.SelectEvents, + dataTier = cms.untracked.string('ALCARECO') + ) + ALCARECOStreamHcalCalNoise = cms.FilteredStream( responsible = 'Grigory Safronov', name = 'HcalCalNoise', @@ -672,6 +709,15 @@ dataTier = cms.untracked.string('ALCARECO') ) +ALCARECOStreamHcalCalHBHEMuonProducerFilter = cms.FilteredStream( + responsible = 'Sunanda Banerjee', + name = 'HcalCalHBHEMuonProducerFilter', + paths = (pathALCARECOHcalCalHBHEMuonProducerFilter), + content = OutALCARECOHcalCalHBHEMuonProducerFilter.outputCommands, + selectEvents = OutALCARECOHcalCalHBHEMuonProducerFilter.SelectEvents, + dataTier = cms.untracked.string('ALCARECO') + ) + ALCARECOStreamHcalCalLowPUHBHEMuonFilter = cms.FilteredStream( responsible = 'Nan Lu', name = 'HcalCalLowPUHBHEMuonFilter', @@ -833,6 +879,15 @@ selectEvents = OutALCARECOPPSTimingCalib.SelectEvents, dataTier = cms.untracked.string('ALCARECO') ) + +ALCARECOStreamPPSDiamondSampicTimingCalib = cms.FilteredStream( + responsible = 'Christopher Misan', + name = 'PPSDiamondSampicTimingCalib', + paths = (pathALCARECOPPSDiamondSampicTimingCalib), + content = OutALCARECOPPSDiamondSampicTimingCalib.outputCommands, + selectEvents = OutALCARECOPPSDiamondSampicTimingCalib.SelectEvents, + dataTier = cms.untracked.string('ALCARECO') + ) ALCARECOStreamPromptCalibProd = cms.FilteredStream( responsible = 'Gianluca Cerminara', diff --git a/Configuration/StandardSequences/python/Eras.py b/Configuration/StandardSequences/python/Eras.py index 72bc7b46fed06..03168ff128dc7 100644 --- a/Configuration/StandardSequences/python/Eras.py +++ b/Configuration/StandardSequences/python/Eras.py @@ -72,7 +72,7 @@ def __init__(self): 'trackingLowPU', 'trackingPhase1', 'ctpps', 'ctpps_2016', 'ctpps_2017', 'ctpps_2018', 'ctpps_2021', 'trackingPhase2PU140','highBetaStar_2018', 'tracker_apv_vfp30_2016', 'pf_badHcalMitigationOff', 'run2_miniAOD_80XLegacy','run2_miniAOD_94XFall17', 'run2_nanoAOD_92X', 'run2_nanoAOD_94XMiniAODv1', 'run2_nanoAOD_94XMiniAODv2', 'run2_nanoAOD_94X2016', - 'run2_miniAOD_devel', 'run2_nanoAOD_102Xv1', 'run2_nanoAOD_106Xv1', 'run2_nanoAOD_106Xv2', + 'run2_miniAOD_devel', 'run2_nanoAOD_102Xv1', 'run2_nanoAOD_106Xv1', 'run2_nanoAOD_106Xv2', 'run3_nanoAOD_devel', 'hcalHardcodeConditions', 'hcalSkipPacker', 'run2_HLTconditions_2016','run2_HLTconditions_2017','run2_HLTconditions_2018', 'bParking'] diff --git a/Configuration/StandardSequences/python/Mixing.py b/Configuration/StandardSequences/python/Mixing.py index 792d4259773df..dfd619fd64425 100644 --- a/Configuration/StandardSequences/python/Mixing.py +++ b/Configuration/StandardSequences/python/Mixing.py @@ -118,6 +118,7 @@ def addMixingScenario(label,dict): addMixingScenario("mix_2016_PoissonOOTPU_HighPUTrains_Fill5412",{'file': 'SimGeneral.MixingModule.mix_2016_PoissonOOTPU_HighPUTrains_Fill5412_cfi'}) addMixingScenario("2017_25ns_WinterMC_PUScenarioV1_PoissonOOTPU",{'file': 'SimGeneral.MixingModule.mix_2017_25ns_WinterMC_PUScenarioV1_PoissonOOTPU_cfi'}) addMixingScenario("2017_25ns_UltraLegacy_PoissonOOTPU",{'file': 'SimGeneral.MixingModule.mix_2017_25ns_UltraLegacy_PoissonOOTPU_cfi'}) +addMixingScenario("2017_5TeV_UltraLegacy_PoissonOOTPU",{'file': 'SimGeneral.MixingModule.mix_2017_5TeV_UltraLegacy_PoissonOOTPU_cfi'}) addMixingScenario("2018_25ns_ProjectedPileup_PoissonOOTPU",{'file': 'SimGeneral.MixingModule.mix_2018_25ns_ProjectedPileup_PoissonOOTPU_cfi'}) addMixingScenario("2018_25ns_JuneProjectionFull18_PoissonOOTPU",{'file': 'SimGeneral.MixingModule.mix_2018_25ns_JuneProjectionFull18_PoissonOOTPU_cfi'}) addMixingScenario("2018_25ns_UltraLegacy_PoissonOOTPU",{'file': 'SimGeneral.MixingModule.mix_2018_25ns_UltraLegacy_PoissonOOTPU_cfi'}) diff --git a/Configuration/StandardSequences/python/Services_cff.py b/Configuration/StandardSequences/python/Services_cff.py index 0949c7b8d4972..f68e2e399e9e9 100644 --- a/Configuration/StandardSequences/python/Services_cff.py +++ b/Configuration/StandardSequences/python/Services_cff.py @@ -10,7 +10,9 @@ # load CUDA services when the "gpu" or "pixelNtupletFit" modifiers are enabled def _addCUDAServices(process): - process.load("HeterogeneousCore.CUDAServices.CUDAService_cfi") + process.load("HeterogeneousCore.CUDAServices.CUDAService_cfi") + process.load("FWCore.MessageService.MessageLogger_cfi") + process.MessageLogger.CUDAService = cms.untracked.PSet() from Configuration.ProcessModifiers.gpu_cff import gpu from Configuration.ProcessModifiers.pixelNtupletFit_cff import pixelNtupletFit diff --git a/DPGAnalysis/HcalTools/interface/CMTRawAnalyzer.h b/DPGAnalysis/HcalTools/interface/CMTRawAnalyzer.h deleted file mode 100644 index 984c4139426bf..0000000000000 --- a/DPGAnalysis/HcalTools/interface/CMTRawAnalyzer.h +++ /dev/null @@ -1,487 +0,0 @@ -// -*- C++ -*- -// -// Package: CMTRawAnalyzer -#ifndef CMTRawAnalyzer_h -#define CMTRawAnalyzer_h -#include -#include -#include -#include -#include -#include -//using namespace std; -#include "FWCore/Framework/interface/ESHandle.h" -#include "FWCore/MessageLogger/interface/MessageLogger.h" -#include "FWCore/ServiceRegistry/interface/Service.h" -#include "FWCore/PluginManager/interface/ModuleDef.h" -#include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/EDAnalyzer.h" -#include "FWCore/Framework/interface/Event.h" -#include "FWCore/Framework/interface/MakerMacros.h" -#include "FWCore/ParameterSet/interface/ParameterSet.h" -//using namespace edm; -// this line is to retrieve HCAL RecHitCollections: -#include "DataFormats/HcalRecHit/interface/HcalRecHitCollections.h" -#include "DataFormats/HcalDetId/interface/HcalElectronicsId.h" -#include "DataFormats/HcalDetId/interface/HcalGenericDetId.h" -#include "DataFormats/HcalDetId/interface/HcalDetId.h" -#include "DataFormats/HcalDigi/interface/HcalQIESample.h" -#include "DataFormats/HcalDetId/interface/HcalCalibDetId.h" -#include "DataFormats/HcalDetId/interface/HcalSubdetector.h" -#include "DataFormats/HcalDigi/interface/HcalDigiCollections.h" -#include "DataFormats/HcalDigi/interface/HBHEDataFrame.h" -#include "DataFormats/HcalDigi/interface/HFDataFrame.h" -#include "DataFormats/HcalDigi/interface/HODataFrame.h" -#include "DataFormats/HcalDigi/interface/QIE10DataFrame.h" -#include "DataFormats/HcalDigi/interface/QIE11DataFrame.h" -#include "DataFormats/HcalDigi/interface/HcalCalibrationEventTypes.h" -#include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerReadoutRecord.h" -#include "CalibCalorimetry/HcalAlgos/interface/HcalLogicalMapGenerator.h" -#include "CondFormats/HcalObjects/interface/HcalLogicalMap.h" -#include "CalibFormats/HcalObjects/interface/HcalDbRecord.h" -#include "CalibFormats/HcalObjects/interface/HcalCalibrations.h" -#include "CalibFormats/HcalObjects/interface/HcalCoderDb.h" -#include "CalibFormats/HcalObjects/interface/HcalDbService.h" -#include "CondFormats/HcalObjects/interface/HcalQIECoder.h" -#include "CondFormats/HcalObjects/interface/HcalQIEShape.h" -#include "EventFilter/HcalRawToDigi/interface/HcalDCCHeader.h" -#include "CondFormats/DataRecord/interface/L1GtTriggerMaskAlgoTrigRcd.h" -#include "CondFormats/DataRecord/interface/L1GtTriggerMaskTechTrigRcd.h" -#include "DataFormats/FEDRawData/interface/FEDRawDataCollection.h" -#include "DataFormats/FEDRawData/interface/FEDHeader.h" -#include "DataFormats/FEDRawData/interface/FEDTrailer.h" -#include "DataFormats/FEDRawData/interface/FEDNumbering.h" -#include "Geometry/Records/interface/HcalGeometryRecord.h" -#include "Geometry/Records/interface/CaloGeometryRecord.h" -#include "Geometry/Records/interface/IdealGeometryRecord.h" -#include "Geometry/Records/interface/HcalRecNumberingRecord.h" -#include "Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h" -#include "Geometry/CaloGeometry/interface/CaloCellGeometry.h" -#include "Geometry/CaloGeometry/interface/CaloGeometry.h" -#include "Geometry/CaloTopology/interface/HcalTopology.h" -#include "Geometry/HcalTowerAlgo/interface/HcalGeometry.h" -#include "Geometry/HcalCommonData/interface/HcalDDDRecConstants.h" -#include "TFile.h" -#include "TTree.h" -#include "TH1.h" -#include "TH2.h" -#include "TF1.h" - -#define NUMADCS 256 -// very preliminary, NEEDS UPDATING -double adc2fC_QIE10[NUMADCS] = { - // - - - - - - - range 0 - - - - - - - - - //subrange0 - 1.58, - 4.73, - 7.88, - 11.0, - 14.2, - 17.3, - 20.5, - 23.6, - 26.8, - 29.9, - 33.1, - 36.2, - 39.4, - 42.5, - 45.7, - 48.8, - //subrange1 - 53.6, - 60.1, - 66.6, - 73.0, - 79.5, - 86.0, - 92.5, - 98.9, - 105, - 112, - 118, - 125, - 131, - 138, - 144, - 151, - //subrange2 - 157, - 164, - 170, - 177, - 186, - 199, - 212, - 225, - 238, - 251, - 264, - 277, - 289, - 302, - 315, - 328, - //subrange3 - 341, - 354, - 367, - 380, - 393, - 406, - 418, - 431, - 444, - 464, - 490, - 516, - 542, - 568, - 594, - 620, - - // - - - - - - - range 1 - - - - - - - - - //subrange0 - 569, - 594, - 619, - 645, - 670, - 695, - 720, - 745, - 771, - 796, - 821, - 846, - 871, - 897, - 922, - 947, - //subrange1 - 960, - 1010, - 1060, - 1120, - 1170, - 1220, - 1270, - 1320, - 1370, - 1430, - 1480, - 1530, - 1580, - 1630, - 1690, - 1740, - //subrange2 - 1790, - 1840, - 1890, - 1940, - 2020, - 2120, - 2230, - 2330, - 2430, - 2540, - 2640, - 2740, - 2850, - 2950, - 3050, - 3150, - //subrange3 - 3260, - 3360, - 3460, - 3570, - 3670, - 3770, - 3880, - 3980, - 4080, - 4240, - 4450, - 4650, - 4860, - 5070, - 5280, - 5490, - - // - - - - - - - range 2 - - - - - - - - - //subrange0 - 5080, - 5280, - 5480, - 5680, - 5880, - 6080, - 6280, - 6480, - 6680, - 6890, - 7090, - 7290, - 7490, - 7690, - 7890, - 8090, - //subrange1 - 8400, - 8810, - 9220, - 9630, - 10000, - 10400, - 10900, - 11300, - 11700, - 12100, - 12500, - 12900, - 13300, - 13700, - 14100, - 14500, - //subrange2 - 15000, - 15400, - 15800, - 16200, - 16800, - 17600, - 18400, - 19300, - 20100, - 20900, - 21700, - 22500, - 23400, - 24200, - 25000, - 25800, - //subrange3 - 26600, - 27500, - 28300, - 29100, - 29900, - 30700, - 31600, - 32400, - 33200, - 34400, - 36100, - 37700, - 39400, - 41000, - 42700, - 44300, - - // - - - - - - - range 3 - - - - - - - - - - //subrange0 - 41100, - 42700, - 44300, - 45900, - 47600, - 49200, - 50800, - 52500, - 54100, - 55700, - 57400, - 59000, - 60600, - 62200, - 63900, - 65500, - //subrange1 - 68000, - 71300, - 74700, - 78000, - 81400, - 84700, - 88000, - 91400, - 94700, - 98100, - 101000, - 105000, - 108000, - 111000, - 115000, - 118000, - //subrange2 - 121000, - 125000, - 128000, - 131000, - 137000, - 145000, - 152000, - 160000, - 168000, - 176000, - 183000, - 191000, - 199000, - 206000, - 214000, - 222000, - //subrange3 - 230000, - 237000, - 245000, - 253000, - 261000, - 268000, - 276000, - 284000, - 291000, - 302000, - 316000, - 329000, - 343000, - 356000, - 370000, - 384000 - -}; - -//shunt1 -double const adc2fC_QIE11_shunt1[NUMADCS] = { - 1.89, 5.07, 8.25, 11.43, 14.61, 17.78, 20.96, 24.14, 27.32, 30.50, 33.68, - 36.86, 40.04, 43.22, 46.40, 49.58, 54.35, 60.71, 67.07, 73.43, 79.79, 86.15, - 92.51, 98.87, 105.2, 111.6, 117.9, 124.3, 130.7, 137.0, 143.4, 149.7, 156.1, - 162.5, 168.8, 175.2, 184.7, 197.4, 210.2, 222.9, 235.6, 248.3, 261.0, 273.7, - 286.5, 299.2, 311.9, 324.6, 337.3, 350.1, 362.8, 375.5, 388.2, 400.9, 413.6, - 426.4, 439.1, 458.2, 483.6, 509.0, 534.5, 559.9, 585.3, 610.8, 558.9, 584.2, - 609.5, 634.7, 660.0, 685.3, 710.6, 735.9, 761.2, 786.5, 811.8, 837.1, 862.4, - 887.7, 913.0, 938.3, 976.2, 1026.8, 1077.4, 1128.0, 1178.6, 1229.1, 1279.7, 1330.3, - 1380.9, 1431.5, 1482.1, 1532.7, 1583.3, 1633.8, 1684.4, 1735.0, 1785.6, 1836.2, 1886.8, - 1937.4, 2013.2, 2114.4, 2215.6, 2316.8, 2417.9, 2519.1, 2620.3, 2721.5, 2822.6, 2923.8, - 3025.0, 3126.2, 3227.3, 3328.5, 3429.7, 3530.9, 3632.0, 3733.2, 3834.4, 3935.5, 4036.7, - 4188.5, 4390.8, 4593.2, 4795.5, 4997.9, 5200.2, 5402.6, 5057.5, 5262.3, 5467.1, 5671.8, - 5876.6, 6081.4, 6286.2, 6491.0, 6695.8, 6900.6, 7105.3, 7310.1, 7514.9, 7719.7, 7924.5, - 8129.3, 8436.4, 8846.0, 9255.6, 9665.1, 10074.7, 10484.3, 10893.9, 11303.4, 11713.0, 12122.6, - 12532.1, 12941.7, 13351.3, 13760.8, 14170.4, 14580.0, 14989.5, 15399.1, 15808.7, 16218.2, 16832.6, - 17651.7, 18470.9, 19290.0, 20109.2, 20928.3, 21747.4, 22566.6, 23385.7, 24204.8, 25024.0, 25843.1, - 26662.3, 27481.4, 28300.5, 29119.7, 29938.8, 30757.9, 31577.1, 32396.2, 33215.4, 34444.1, 36082.3, - 37720.6, 39358.9, 40997.2, 42635.4, 44273.7, 40908.7, 42542.6, 44176.5, 45810.4, 47444.3, 49078.3, - 50712.2, 52346.1, 53980.0, 55613.9, 57247.8, 58881.8, 60515.7, 62149.6, 63783.5, 65417.4, 67868.3, - 71136.1, 74404.0, 77671.8, 80939.7, 84207.5, 87475.3, 90743.2, 94011.0, 97278.8, 100546.7, 103814.5, - 107082.3, 110350.2, 113618.0, 116885.8, 120153.7, 123421.5, 126689.3, 129957.2, 134858.9, 141394.6, 147930.3, - 154465.9, 161001.6, 167537.3, 174072.9, 180608.6, 187144.3, 193679.9, 200215.6, 206751.3, 213287.0, 219822.6, - 226358.3, 232894.0, 239429.6, 245965.3, 252501.0, 259036.6, 265572.3, 275375.8, 288447.2, 301518.5, 314589.8, - 327661.2, 340732.5, 353803.8}; -//shunt6 -double const adc2fC_QIE11_shunt6[NUMADCS] = { - 9.56, 28.24, 46.91, 65.59, 84.27, 102.9, 121.6, 140.3, 159.0, 177.7, - 196.3, 215.0, 233.7, 252.4, 271.0, 289.7, 317.7, 355.1, 392.4, 429.8, - 467.1, 504.5, 541.9, 579.2, 616.6, 653.9, 691.3, 728.6, 766.0, 803.3, - 840.7, 878.0, 915.4, 952.8, 990.1, 1027.5, 1083.5, 1158.2, 1232.9, 1307.6, - 1382.3, 1457.0, 1531.7, 1606.4, 1681.2, 1755.9, 1830.6, 1905.3, 1980.0, 2054.7, - 2129.4, 2204.1, 2278.8, 2353.5, 2428.2, 2502.9, 2577.7, 2689.7, 2839.1, 2988.6, - 3138.0, 3287.4, 3436.8, 3586.2, 3263.0, 3411.3, 3559.6, 3707.9, 3856.2, 4004.5, - 4152.9, 4301.2, 4449.5, 4597.8, 4746.1, 4894.4, 5042.7, 5191.0, 5339.4, 5487.7, - 5710.1, 6006.8, 6303.4, 6600.0, 6896.6, 7193.3, 7489.9, 7786.5, 8083.1, 8379.8, - 8676.4, 8973.0, 9269.6, 9566.3, 9862.9, 10159.5, 10456.2, 10752.8, 11049.4, 11346.0, - 11791.0, 12384.2, 12977.5, 13570.7, 14164.0, 14757.2, 15350.5, 15943.7, 16537.0, 17130.2, - 17723.5, 18316.7, 18910.0, 19503.2, 20096.5, 20689.7, 21283.0, 21876.2, 22469.5, 23062.8, - 23656.0, 24545.9, 25732.4, 26918.9, 28105.4, 29291.9, 30478.4, 31664.9, 29399.4, 30590.1, - 31780.9, 32971.7, 34162.4, 35353.2, 36544.0, 37734.7, 38925.5, 40116.3, 41307.0, 42497.8, - 43688.5, 44879.3, 46070.1, 47260.8, 49047.0, 51428.5, 53810.1, 56191.6, 58573.1, 60954.6, - 63336.2, 65717.7, 68099.2, 70480.8, 72862.3, 75243.8, 77625.4, 80006.9, 82388.4, 84769.9, - 87151.5, 89533.0, 91914.5, 94296.1, 97868.4, 102631.4, 107394.5, 112157.5, 116920.6, 121683.7, - 126446.7, 131209.8, 135972.8, 140735.9, 145499.0, 150262.0, 155025.1, 159788.2, 164551.2, 169314.3, - 174077.3, 178840.4, 183603.5, 188366.5, 193129.6, 200274.2, 209800.3, 219326.4, 228852.5, 238378.7, - 247904.8, 257430.9, 237822.7, 247326.7, 256830.7, 266334.8, 275838.8, 285342.9, 294846.9, 304351.0, - 313855.0, 323359.1, 332863.1, 342367.1, 351871.2, 361375.2, 370879.3, 380383.3, 394639.4, 413647.5, - 432655.6, 451663.6, 470671.7, 489679.8, 508687.9, 527696.0, 546704.1, 565712.2, 584720.3, 603728.3, - 622736.4, 641744.5, 660752.6, 679760.7, 698768.8, 717776.9, 736785.0, 755793.0, 784305.2, 822321.3, - 860337.5, 898353.7, 936369.9, 974386.0, 1012402.2, 1050418.4, 1088434.6, 1126450.7, 1164466.9, 1202483.1, - 1240499.3, 1278515.4, 1316531.6, 1354547.8, 1392564.0, 1430580.1, 1468596.3, 1506612.5, 1544628.7, 1601652.9, - 1677685.3, 1753717.6, 1829750.0, 1905782.3, 1981814.7, 2057847.0}; -// for HPD: -static const float adc2fC[128] = { - -0.5, 0.5, 1.5, 2.5, 3.5, 4.5, 5.5, 6.5, 7.5, 8.5, 9.5, 10.5, 11.5, - 12.5, 13.5, 15., 17., 19., 21., 23., 25., 27., 29.5, 32.5, 35.5, 38.5, - 42., 46., 50., 54.5, 59.5, 64.5, 59.5, 64.5, 69.5, 74.5, 79.5, 84.5, 89.5, - 94.5, 99.5, 104.5, 109.5, 114.5, 119.5, 124.5, 129.5, 137., 147., 157., 167., 177., - 187., 197., 209.5, 224.5, 239.5, 254.5, 272., 292., 312., 334.5, 359.5, 384.5, 359.5, - 384.5, 409.5, 434.5, 459.5, 484.5, 509.5, 534.5, 559.5, 584.5, 609.5, 634.5, 659.5, 684.5, - 709.5, 747., 797., 847., 897., 947., 997., 1047., 1109.5, 1184.5, 1259.5, 1334.5, 1422., - 1522., 1622., 1734.5, 1859.5, 1984.5, 1859.5, 1984.5, 2109.5, 2234.5, 2359.5, 2484.5, 2609.5, 2734.5, - 2859.5, 2984.5, 3109.5, 3234.5, 3359.5, 3484.5, 3609.5, 3797., 4047., 4297., 4547., 4797., 5047., - 5297., 5609.5, 5984.5, 6359.5, 6734.5, 7172., 7672., 8172., 8734.5, 9359.5, 9984.5}; -const int nsub = 4; -const int ndepth = 7; -const int neta = 82; -const int nphi = 72; -float bphi = 72.; -const int zneta = 22; -const int znphi = 18; -float zbphi = 18.; -const int npfit = 220; -float anpfit = 220.; // for SiPM: - -///////////////////////////////////////////////////////////////////////// -// SERVICE FUNCTIONS -------------------------------------------------------- -/* -double CMTRawAnalyzer::dR(double eta1, double phi1, double eta2, double phi2) { - double PI = 3.1415926535898; - double deltaphi = phi1 - phi2; - if (phi2 > phi1) { - deltaphi = phi2 - phi1; - } - if (deltaphi > PI) { - deltaphi = 2. * PI - deltaphi; - } - double deltaeta = eta2 - eta1; - double tmp = sqrt(deltaeta * deltaeta + deltaphi * deltaphi); - return tmp; -} - -double CMTRawAnalyzer::phi12(double phi1, double en1, double phi2, double en2) { - // weighted mean value of phi1 and phi2 - - double tmp; - double PI = 3.1415926535898; - double a1 = phi1; - double a2 = phi2; - - if (a1 > 0.5 * PI && a2 < 0.) - a2 += 2 * PI; - if (a2 > 0.5 * PI && a1 < 0.) - a1 += 2 * PI; - tmp = (a1 * en1 + a2 * en2) / (en1 + en2); - if (tmp > PI) - tmp -= 2. * PI; - - return tmp; -} - -double CMTRawAnalyzer::dPhiWsign(double phi1, double phi2) { - // clockwise phi2 w.r.t phi1 means "+" phi distance - // anti-clockwise phi2 w.r.t phi1 means "-" phi distance - - double PI = 3.1415926535898; - double a1 = phi1; - double a2 = phi2; - double tmp = a2 - a1; - if (a1 * a2 < 0.) { - if (a1 > 0.5 * PI) - tmp += 2. * PI; - if (a2 > 0.5 * PI) - tmp -= 2. * PI; - } - return tmp; -} -*/ -///////////////////////////////////////////////////////////////////////// - -#endif diff --git a/DPGAnalysis/HcalTools/BuildFile.xml b/DPGAnalysis/HcalTools/plugins/BuildFile.xml similarity index 79% rename from DPGAnalysis/HcalTools/BuildFile.xml rename to DPGAnalysis/HcalTools/plugins/BuildFile.xml index 1799f0836c471..dd8648b74e287 100644 --- a/DPGAnalysis/HcalTools/BuildFile.xml +++ b/DPGAnalysis/HcalTools/plugins/BuildFile.xml @@ -1,3 +1,4 @@ + @@ -7,4 +8,6 @@ + + diff --git a/DPGAnalysis/HcalTools/src/CMTRawAnalyzer.cc b/DPGAnalysis/HcalTools/plugins/CMTRawAnalyzer.cc similarity index 72% rename from DPGAnalysis/HcalTools/src/CMTRawAnalyzer.cc rename to DPGAnalysis/HcalTools/plugins/CMTRawAnalyzer.cc index dd6c2bba22155..a479d0098f030 100644 --- a/DPGAnalysis/HcalTools/src/CMTRawAnalyzer.cc +++ b/DPGAnalysis/HcalTools/plugins/CMTRawAnalyzer.cc @@ -3,14 +3,434 @@ // // Package: CMTRawAnalyzer // -#include "DPGAnalysis/HcalTools/interface/CMTRawAnalyzer.h" -// -using namespace std; -// -using namespace edm; +#include +#include +#include +#include +#include +#include + +#include "FWCore/MessageLogger/interface/MessageLogger.h" +#include "FWCore/ServiceRegistry/interface/Service.h" +#include "FWCore/PluginManager/interface/ModuleDef.h" +#include "FWCore/Framework/interface/Frameworkfwd.h" +#include "FWCore/Framework/interface/one/EDAnalyzer.h" +#include "FWCore/Framework/interface/Event.h" +#include "FWCore/Framework/interface/MakerMacros.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" + +// this line is to retrieve HCAL RecHitCollections: +#include "CommonTools/UtilAlgos/interface/TFileService.h" +#include "DataFormats/HcalRecHit/interface/HcalRecHitCollections.h" +#include "DataFormats/HcalDetId/interface/HcalElectronicsId.h" +#include "DataFormats/HcalDetId/interface/HcalGenericDetId.h" +#include "DataFormats/HcalDetId/interface/HcalDetId.h" +#include "DataFormats/HcalDigi/interface/HcalQIESample.h" +#include "DataFormats/HcalDetId/interface/HcalCalibDetId.h" +#include "DataFormats/HcalDetId/interface/HcalSubdetector.h" +#include "DataFormats/HcalDigi/interface/HcalDigiCollections.h" +#include "DataFormats/HcalDigi/interface/HBHEDataFrame.h" +#include "DataFormats/HcalDigi/interface/HFDataFrame.h" +#include "DataFormats/HcalDigi/interface/HODataFrame.h" +#include "DataFormats/HcalDigi/interface/QIE10DataFrame.h" +#include "DataFormats/HcalDigi/interface/QIE11DataFrame.h" +#include "DataFormats/HcalDigi/interface/HcalCalibrationEventTypes.h" +#include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerReadoutRecord.h" +#include "CalibCalorimetry/HcalAlgos/interface/HcalLogicalMapGenerator.h" +#include "CondFormats/HcalObjects/interface/HcalLogicalMap.h" +#include "CalibFormats/HcalObjects/interface/HcalDbRecord.h" +#include "CalibFormats/HcalObjects/interface/HcalCalibrations.h" +#include "CalibFormats/HcalObjects/interface/HcalCoderDb.h" +#include "CalibFormats/HcalObjects/interface/HcalDbService.h" +#include "CondFormats/HcalObjects/interface/HcalQIECoder.h" +#include "CondFormats/HcalObjects/interface/HcalQIEShape.h" +#include "EventFilter/HcalRawToDigi/interface/HcalDCCHeader.h" +#include "CondFormats/DataRecord/interface/L1GtTriggerMaskAlgoTrigRcd.h" +#include "CondFormats/DataRecord/interface/L1GtTriggerMaskTechTrigRcd.h" +#include "DataFormats/FEDRawData/interface/FEDRawDataCollection.h" +#include "DataFormats/FEDRawData/interface/FEDHeader.h" +#include "DataFormats/FEDRawData/interface/FEDTrailer.h" +#include "DataFormats/FEDRawData/interface/FEDNumbering.h" +#include "Geometry/Records/interface/HcalGeometryRecord.h" +#include "Geometry/Records/interface/CaloGeometryRecord.h" +#include "Geometry/Records/interface/IdealGeometryRecord.h" +#include "Geometry/Records/interface/HcalRecNumberingRecord.h" +#include "Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h" +#include "Geometry/CaloGeometry/interface/CaloCellGeometry.h" +#include "Geometry/CaloGeometry/interface/CaloGeometry.h" +#include "Geometry/CaloTopology/interface/HcalTopology.h" +#include "Geometry/HcalTowerAlgo/interface/HcalGeometry.h" +#include "Geometry/HcalCommonData/interface/HcalDDDRecConstants.h" +#include "TFile.h" +#include "TTree.h" +#include "TH1.h" +#include "TH2.h" +#include "TF1.h" + +#define NUMADCS 256 +// very preliminary, NEEDS UPDATING +double adc2fC_QIE10[NUMADCS] = { + // - - - - - - - range 0 - - - - - - - - + //subrange0 + 1.58, + 4.73, + 7.88, + 11.0, + 14.2, + 17.3, + 20.5, + 23.6, + 26.8, + 29.9, + 33.1, + 36.2, + 39.4, + 42.5, + 45.7, + 48.8, + //subrange1 + 53.6, + 60.1, + 66.6, + 73.0, + 79.5, + 86.0, + 92.5, + 98.9, + 105, + 112, + 118, + 125, + 131, + 138, + 144, + 151, + //subrange2 + 157, + 164, + 170, + 177, + 186, + 199, + 212, + 225, + 238, + 251, + 264, + 277, + 289, + 302, + 315, + 328, + //subrange3 + 341, + 354, + 367, + 380, + 393, + 406, + 418, + 431, + 444, + 464, + 490, + 516, + 542, + 568, + 594, + 620, + + // - - - - - - - range 1 - - - - - - - - + //subrange0 + 569, + 594, + 619, + 645, + 670, + 695, + 720, + 745, + 771, + 796, + 821, + 846, + 871, + 897, + 922, + 947, + //subrange1 + 960, + 1010, + 1060, + 1120, + 1170, + 1220, + 1270, + 1320, + 1370, + 1430, + 1480, + 1530, + 1580, + 1630, + 1690, + 1740, + //subrange2 + 1790, + 1840, + 1890, + 1940, + 2020, + 2120, + 2230, + 2330, + 2430, + 2540, + 2640, + 2740, + 2850, + 2950, + 3050, + 3150, + //subrange3 + 3260, + 3360, + 3460, + 3570, + 3670, + 3770, + 3880, + 3980, + 4080, + 4240, + 4450, + 4650, + 4860, + 5070, + 5280, + 5490, + + // - - - - - - - range 2 - - - - - - - - + //subrange0 + 5080, + 5280, + 5480, + 5680, + 5880, + 6080, + 6280, + 6480, + 6680, + 6890, + 7090, + 7290, + 7490, + 7690, + 7890, + 8090, + //subrange1 + 8400, + 8810, + 9220, + 9630, + 10000, + 10400, + 10900, + 11300, + 11700, + 12100, + 12500, + 12900, + 13300, + 13700, + 14100, + 14500, + //subrange2 + 15000, + 15400, + 15800, + 16200, + 16800, + 17600, + 18400, + 19300, + 20100, + 20900, + 21700, + 22500, + 23400, + 24200, + 25000, + 25800, + //subrange3 + 26600, + 27500, + 28300, + 29100, + 29900, + 30700, + 31600, + 32400, + 33200, + 34400, + 36100, + 37700, + 39400, + 41000, + 42700, + 44300, + + // - - - - - - - range 3 - - - - - - - - - + //subrange0 + 41100, + 42700, + 44300, + 45900, + 47600, + 49200, + 50800, + 52500, + 54100, + 55700, + 57400, + 59000, + 60600, + 62200, + 63900, + 65500, + //subrange1 + 68000, + 71300, + 74700, + 78000, + 81400, + 84700, + 88000, + 91400, + 94700, + 98100, + 101000, + 105000, + 108000, + 111000, + 115000, + 118000, + //subrange2 + 121000, + 125000, + 128000, + 131000, + 137000, + 145000, + 152000, + 160000, + 168000, + 176000, + 183000, + 191000, + 199000, + 206000, + 214000, + 222000, + //subrange3 + 230000, + 237000, + 245000, + 253000, + 261000, + 268000, + 276000, + 284000, + 291000, + 302000, + 316000, + 329000, + 343000, + 356000, + 370000, + 384000 + +}; + +//shunt1 +double const adc2fC_QIE11_shunt1[NUMADCS] = { + 1.89, 5.07, 8.25, 11.43, 14.61, 17.78, 20.96, 24.14, 27.32, 30.50, 33.68, + 36.86, 40.04, 43.22, 46.40, 49.58, 54.35, 60.71, 67.07, 73.43, 79.79, 86.15, + 92.51, 98.87, 105.2, 111.6, 117.9, 124.3, 130.7, 137.0, 143.4, 149.7, 156.1, + 162.5, 168.8, 175.2, 184.7, 197.4, 210.2, 222.9, 235.6, 248.3, 261.0, 273.7, + 286.5, 299.2, 311.9, 324.6, 337.3, 350.1, 362.8, 375.5, 388.2, 400.9, 413.6, + 426.4, 439.1, 458.2, 483.6, 509.0, 534.5, 559.9, 585.3, 610.8, 558.9, 584.2, + 609.5, 634.7, 660.0, 685.3, 710.6, 735.9, 761.2, 786.5, 811.8, 837.1, 862.4, + 887.7, 913.0, 938.3, 976.2, 1026.8, 1077.4, 1128.0, 1178.6, 1229.1, 1279.7, 1330.3, + 1380.9, 1431.5, 1482.1, 1532.7, 1583.3, 1633.8, 1684.4, 1735.0, 1785.6, 1836.2, 1886.8, + 1937.4, 2013.2, 2114.4, 2215.6, 2316.8, 2417.9, 2519.1, 2620.3, 2721.5, 2822.6, 2923.8, + 3025.0, 3126.2, 3227.3, 3328.5, 3429.7, 3530.9, 3632.0, 3733.2, 3834.4, 3935.5, 4036.7, + 4188.5, 4390.8, 4593.2, 4795.5, 4997.9, 5200.2, 5402.6, 5057.5, 5262.3, 5467.1, 5671.8, + 5876.6, 6081.4, 6286.2, 6491.0, 6695.8, 6900.6, 7105.3, 7310.1, 7514.9, 7719.7, 7924.5, + 8129.3, 8436.4, 8846.0, 9255.6, 9665.1, 10074.7, 10484.3, 10893.9, 11303.4, 11713.0, 12122.6, + 12532.1, 12941.7, 13351.3, 13760.8, 14170.4, 14580.0, 14989.5, 15399.1, 15808.7, 16218.2, 16832.6, + 17651.7, 18470.9, 19290.0, 20109.2, 20928.3, 21747.4, 22566.6, 23385.7, 24204.8, 25024.0, 25843.1, + 26662.3, 27481.4, 28300.5, 29119.7, 29938.8, 30757.9, 31577.1, 32396.2, 33215.4, 34444.1, 36082.3, + 37720.6, 39358.9, 40997.2, 42635.4, 44273.7, 40908.7, 42542.6, 44176.5, 45810.4, 47444.3, 49078.3, + 50712.2, 52346.1, 53980.0, 55613.9, 57247.8, 58881.8, 60515.7, 62149.6, 63783.5, 65417.4, 67868.3, + 71136.1, 74404.0, 77671.8, 80939.7, 84207.5, 87475.3, 90743.2, 94011.0, 97278.8, 100546.7, 103814.5, + 107082.3, 110350.2, 113618.0, 116885.8, 120153.7, 123421.5, 126689.3, 129957.2, 134858.9, 141394.6, 147930.3, + 154465.9, 161001.6, 167537.3, 174072.9, 180608.6, 187144.3, 193679.9, 200215.6, 206751.3, 213287.0, 219822.6, + 226358.3, 232894.0, 239429.6, 245965.3, 252501.0, 259036.6, 265572.3, 275375.8, 288447.2, 301518.5, 314589.8, + 327661.2, 340732.5, 353803.8}; +//shunt6 +double const adc2fC_QIE11_shunt6[NUMADCS] = { + 9.56, 28.24, 46.91, 65.59, 84.27, 102.9, 121.6, 140.3, 159.0, 177.7, + 196.3, 215.0, 233.7, 252.4, 271.0, 289.7, 317.7, 355.1, 392.4, 429.8, + 467.1, 504.5, 541.9, 579.2, 616.6, 653.9, 691.3, 728.6, 766.0, 803.3, + 840.7, 878.0, 915.4, 952.8, 990.1, 1027.5, 1083.5, 1158.2, 1232.9, 1307.6, + 1382.3, 1457.0, 1531.7, 1606.4, 1681.2, 1755.9, 1830.6, 1905.3, 1980.0, 2054.7, + 2129.4, 2204.1, 2278.8, 2353.5, 2428.2, 2502.9, 2577.7, 2689.7, 2839.1, 2988.6, + 3138.0, 3287.4, 3436.8, 3586.2, 3263.0, 3411.3, 3559.6, 3707.9, 3856.2, 4004.5, + 4152.9, 4301.2, 4449.5, 4597.8, 4746.1, 4894.4, 5042.7, 5191.0, 5339.4, 5487.7, + 5710.1, 6006.8, 6303.4, 6600.0, 6896.6, 7193.3, 7489.9, 7786.5, 8083.1, 8379.8, + 8676.4, 8973.0, 9269.6, 9566.3, 9862.9, 10159.5, 10456.2, 10752.8, 11049.4, 11346.0, + 11791.0, 12384.2, 12977.5, 13570.7, 14164.0, 14757.2, 15350.5, 15943.7, 16537.0, 17130.2, + 17723.5, 18316.7, 18910.0, 19503.2, 20096.5, 20689.7, 21283.0, 21876.2, 22469.5, 23062.8, + 23656.0, 24545.9, 25732.4, 26918.9, 28105.4, 29291.9, 30478.4, 31664.9, 29399.4, 30590.1, + 31780.9, 32971.7, 34162.4, 35353.2, 36544.0, 37734.7, 38925.5, 40116.3, 41307.0, 42497.8, + 43688.5, 44879.3, 46070.1, 47260.8, 49047.0, 51428.5, 53810.1, 56191.6, 58573.1, 60954.6, + 63336.2, 65717.7, 68099.2, 70480.8, 72862.3, 75243.8, 77625.4, 80006.9, 82388.4, 84769.9, + 87151.5, 89533.0, 91914.5, 94296.1, 97868.4, 102631.4, 107394.5, 112157.5, 116920.6, 121683.7, + 126446.7, 131209.8, 135972.8, 140735.9, 145499.0, 150262.0, 155025.1, 159788.2, 164551.2, 169314.3, + 174077.3, 178840.4, 183603.5, 188366.5, 193129.6, 200274.2, 209800.3, 219326.4, 228852.5, 238378.7, + 247904.8, 257430.9, 237822.7, 247326.7, 256830.7, 266334.8, 275838.8, 285342.9, 294846.9, 304351.0, + 313855.0, 323359.1, 332863.1, 342367.1, 351871.2, 361375.2, 370879.3, 380383.3, 394639.4, 413647.5, + 432655.6, 451663.6, 470671.7, 489679.8, 508687.9, 527696.0, 546704.1, 565712.2, 584720.3, 603728.3, + 622736.4, 641744.5, 660752.6, 679760.7, 698768.8, 717776.9, 736785.0, 755793.0, 784305.2, 822321.3, + 860337.5, 898353.7, 936369.9, 974386.0, 1012402.2, 1050418.4, 1088434.6, 1126450.7, 1164466.9, 1202483.1, + 1240499.3, 1278515.4, 1316531.6, 1354547.8, 1392564.0, 1430580.1, 1468596.3, 1506612.5, 1544628.7, 1601652.9, + 1677685.3, 1753717.6, 1829750.0, 1905782.3, 1981814.7, 2057847.0}; +// for HPD: +static const float adc2fC[128] = { + -0.5, 0.5, 1.5, 2.5, 3.5, 4.5, 5.5, 6.5, 7.5, 8.5, 9.5, 10.5, 11.5, + 12.5, 13.5, 15., 17., 19., 21., 23., 25., 27., 29.5, 32.5, 35.5, 38.5, + 42., 46., 50., 54.5, 59.5, 64.5, 59.5, 64.5, 69.5, 74.5, 79.5, 84.5, 89.5, + 94.5, 99.5, 104.5, 109.5, 114.5, 119.5, 124.5, 129.5, 137., 147., 157., 167., 177., + 187., 197., 209.5, 224.5, 239.5, 254.5, 272., 292., 312., 334.5, 359.5, 384.5, 359.5, + 384.5, 409.5, 434.5, 459.5, 484.5, 509.5, 534.5, 559.5, 584.5, 609.5, 634.5, 659.5, 684.5, + 709.5, 747., 797., 847., 897., 947., 997., 1047., 1109.5, 1184.5, 1259.5, 1334.5, 1422., + 1522., 1622., 1734.5, 1859.5, 1984.5, 1859.5, 1984.5, 2109.5, 2234.5, 2359.5, 2484.5, 2609.5, 2734.5, + 2859.5, 2984.5, 3109.5, 3234.5, 3359.5, 3484.5, 3609.5, 3797., 4047., 4297., 4547., 4797., 5047., + 5297., 5609.5, 5984.5, 6359.5, 6734.5, 7172., 7672., 8172., 8734.5, 9359.5, 9984.5}; +const int nsub = 4; +const int ndepth = 7; +const int neta = 82; +const int nphi = 72; +const float bphi = 72.; +const int zneta = 22; +const int znphi = 18; +const int npfit = 220; +const float anpfit = 220.; // for SiPM: + // // -class CMTRawAnalyzer : public edm::EDAnalyzer { +class CMTRawAnalyzer : public edm::one::EDAnalyzer { public: explicit CMTRawAnalyzer(const edm::ParameterSet&); ~CMTRawAnalyzer() override; @@ -22,6 +442,10 @@ class CMTRawAnalyzer : public edm::EDAnalyzer { virtual void fillMAP(); private: + double phi12(double phi1, double en1, double phi2, double en2); + double dR(double eta1, double phi1, double eta2, double phi2); + double dPhiWsign(double phi1, double phi2); + edm::EDGetTokenT tok_calib_; edm::EDGetTokenT tok_hbhe_; edm::EDGetTokenT tok_ho_; @@ -33,18 +457,15 @@ class CMTRawAnalyzer : public edm::EDAnalyzer { edm::EDGetTokenT tok_hbheNoise_; edm::EDGetTokenT tok_hfSignal_; edm::EDGetTokenT tok_hfNoise_; - //////////////////////////////////// - // double dR(double eta1, double phi1, double eta2, double phi2); - // double phi12(double phi1, double en1, double phi2, double en2); - // double dPhiWsign(double phi1, double phi2); - //////////////////////////////////// + + edm::Service fs_; std::string fOutputFileName; std::string MAPOutputFileName; edm::InputTag inputTag_; - edm::ESHandle geometry; - edm::ESHandle conditions; + const edm::ESGetToken tokDB_; + const edm::ESGetToken tokTopo_; const HcalQIEShape* shape; - edm::ESHandle topo_; + const HcalDbService* conditions; const HcalTopology* topo; ///////////////////////////////////////////// int verbosity; @@ -1901,7 +2322,7 @@ class CMTRawAnalyzer : public edm::EDAnalyzer { double maxxOCCUP4; TTree* myTree; TFile* hOutputFile; - ofstream MAPfile; + std::ofstream MAPfile; ///////////////////////////////////////// // Get RBX number from 1-35 for Calibration box int getRBX(int& i, int& j, int& k); @@ -1926,6 +2347,7 @@ class CMTRawAnalyzer : public edm::EDAnalyzer { float blsmax; int nlsminmax; }; + // /////////////////////////////// ------------------------------------------------------------------- // @@ -1940,14 +2362,6 @@ void CMTRawAnalyzer::endJob() { h_nls_per_run->Fill(float(lscounterrun)); h_nls_per_run10->Fill(float(lscounterrun10)); - hOutputFile->SetCompressionLevel(2); - - hOutputFile->Write(); - hOutputFile->cd(); - - if (recordNtuples_) - myTree->Write(); - /////////////////////////////////////////////////////////////////////////////////////////////// std::cout << "===== full number of events = " << nevent << std::endl; std::cout << "===== possible max number of events in ntuple(each 50th recorded) = " << nevent50 << std::endl; @@ -1962,1724 +2376,15 @@ void CMTRawAnalyzer::endJob() { std::cout << "===== Start writing user histograms =====" << std::endl; ////////////////////////////////////////////////////////////////////// scaling of some histoes: ///////////////////////////////////////////->Write(); - h_bcnvsamplitude_HB->Write(); - h_bcnvsamplitude0_HB->Write(); - h_bcnvsamplitude_HE->Write(); - h_bcnvsamplitude0_HE->Write(); - h_bcnvsamplitude_HF->Write(); - h_bcnvsamplitude0_HF->Write(); - h_bcnvsamplitude_HO->Write(); - h_bcnvsamplitude0_HO->Write(); - - h_orbitNumvsamplitude_HB->Write(); - h_orbitNumvsamplitude0_HB->Write(); - h_orbitNumvsamplitude_HE->Write(); - h_orbitNumvsamplitude0_HE->Write(); - h_orbitNumvsamplitude_HF->Write(); - h_orbitNumvsamplitude0_HF->Write(); - h_orbitNumvsamplitude_HO->Write(); - h_orbitNumvsamplitude0_HO->Write(); - - h_2DsumADCAmplEtaPhiLs0->Write(); - h_2DsumADCAmplEtaPhiLs1->Write(); - h_2DsumADCAmplEtaPhiLs2->Write(); - h_2DsumADCAmplEtaPhiLs3->Write(); - - h_2DsumADCAmplEtaPhiLs00->Write(); - h_2DsumADCAmplEtaPhiLs10->Write(); - h_2DsumADCAmplEtaPhiLs20->Write(); - h_2DsumADCAmplEtaPhiLs30->Write(); - - h_sumADCAmplEtaPhiLs->Write(); - h_sumADCAmplEtaPhiLs_bbbc->Write(); - h_sumADCAmplEtaPhiLs_bbb1->Write(); - h_sumADCAmplEtaPhiLs_lscounterM1->Write(); - h_sumADCAmplEtaPhiLs_ietaphi->Write(); - h_sumADCAmplEtaPhiLs_lscounterM1orbitNum->Write(); - h_sumADCAmplEtaPhiLs_orbitNum->Write(); - - if (recordHistoes_) { - h_errorGeneral->Write(); - h_error1->Write(); - h_error2->Write(); - h_error3->Write(); - h_amplError->Write(); - h_amplFine->Write(); - - h_errorGeneral_HB->Write(); - h_error1_HB->Write(); - h_error2_HB->Write(); - h_error3_HB->Write(); - h_error4_HB->Write(); - h_error5_HB->Write(); - h_error6_HB->Write(); - h_error7_HB->Write(); - h_amplError_HB->Write(); - h_amplFine_HB->Write(); - h_mapDepth1Error_HB->Write(); - h_mapDepth2Error_HB->Write(); - h_mapDepth3Error_HB->Write(); - h_mapDepth4Error_HB->Write(); - h_fiber0_HB->Write(); - h_fiber1_HB->Write(); - h_fiber2_HB->Write(); - h_repetedcapid_HB->Write(); - - h_errorGeneral_HE->Write(); - h_error1_HE->Write(); - h_error2_HE->Write(); - h_error3_HE->Write(); - h_error4_HE->Write(); - h_error5_HE->Write(); - h_error6_HE->Write(); - h_error7_HE->Write(); - h_amplError_HE->Write(); - h_amplFine_HE->Write(); - h_mapDepth1Error_HE->Write(); - h_mapDepth2Error_HE->Write(); - h_mapDepth3Error_HE->Write(); - h_mapDepth4Error_HE->Write(); - h_mapDepth5Error_HE->Write(); - h_mapDepth6Error_HE->Write(); - h_mapDepth7Error_HE->Write(); - h_fiber0_HE->Write(); - h_fiber1_HE->Write(); - h_fiber2_HE->Write(); - h_repetedcapid_HE->Write(); - - h_errorGeneral_HF->Write(); - h_error1_HF->Write(); - h_error2_HF->Write(); - h_error3_HF->Write(); - h_error4_HF->Write(); - h_error5_HF->Write(); - h_error6_HF->Write(); - h_error7_HF->Write(); - h_amplError_HF->Write(); - h_amplFine_HF->Write(); - h_mapDepth1Error_HF->Write(); - h_mapDepth2Error_HF->Write(); - h_mapDepth3Error_HF->Write(); - h_mapDepth4Error_HF->Write(); - h_fiber0_HF->Write(); - h_fiber1_HF->Write(); - h_fiber2_HF->Write(); - h_repetedcapid_HF->Write(); - - h_errorGeneral_HO->Write(); - h_error1_HO->Write(); - h_error2_HO->Write(); - h_error3_HO->Write(); - h_error4_HO->Write(); - h_error5_HO->Write(); - h_error6_HO->Write(); - h_error7_HO->Write(); - h_amplError_HO->Write(); - h_amplFine_HO->Write(); - h_mapDepth4Error_HO->Write(); - h_fiber0_HO->Write(); - h_fiber1_HO->Write(); - h_fiber2_HO->Write(); - h_repetedcapid_HO->Write(); - - /////////////////////// - h_numberofhitsHBtest->Write(); - h_numberofhitsHEtest->Write(); - h_numberofhitsHFtest->Write(); - h_numberofhitsHOtest->Write(); - h_AmplitudeHBtest->Write(); - h_AmplitudeHBtest1->Write(); - h_AmplitudeHBtest6->Write(); - h_AmplitudeHEtest->Write(); - h_AmplitudeHEtest1->Write(); - h_AmplitudeHEtest6->Write(); - h_AmplitudeHFtest->Write(); - h_AmplitudeHOtest->Write(); - h_totalAmplitudeHB->Write(); - h_totalAmplitudeHE->Write(); - h_totalAmplitudeHF->Write(); - h_totalAmplitudeHO->Write(); - h_totalAmplitudeHBperEvent->Write(); - h_totalAmplitudeHEperEvent->Write(); - h_totalAmplitudeHFperEvent->Write(); - h_totalAmplitudeHOperEvent->Write(); - - h_ADCAmpl345Zoom_HB->Write(); - h_ADCAmpl345Zoom1_HB->Write(); - h_ADCAmpl345_HB->Write(); - - h_ADCAmpl_HBCapIdNoError->Write(); - h_ADCAmpl345_HBCapIdNoError->Write(); - h_ADCAmpl_HBCapIdError->Write(); - h_ADCAmpl345_HBCapIdError->Write(); - - h_ADCAmplZoom_HB->Write(); - h_ADCAmplZoom1_HB->Write(); - h_ADCAmpl_HB->Write(); - - h_AmplitudeHBrest->Write(); - h_AmplitudeHBrest1->Write(); - h_AmplitudeHBrest6->Write(); - - h_mapDepth1ADCAmpl225_HB->Write(); - h_mapDepth2ADCAmpl225_HB->Write(); - h_mapDepth1ADCAmpl_HB->Write(); - h_mapDepth2ADCAmpl_HB->Write(); - h_mapDepth1ADCAmpl12_HB->Write(); - h_mapDepth2ADCAmpl12_HB->Write(); - - h_mapDepth3ADCAmpl225_HB->Write(); - h_mapDepth4ADCAmpl225_HB->Write(); - h_mapDepth3ADCAmpl_HB->Write(); - h_mapDepth4ADCAmpl_HB->Write(); - h_mapDepth3ADCAmpl12_HB->Write(); - h_mapDepth4ADCAmpl12_HB->Write(); - - h_TSmeanA_HB->Write(); - h_mapDepth1TSmeanA225_HB->Write(); - h_mapDepth2TSmeanA225_HB->Write(); - h_mapDepth1TSmeanA_HB->Write(); - h_mapDepth2TSmeanA_HB->Write(); - h_mapDepth3TSmeanA225_HB->Write(); - h_mapDepth4TSmeanA225_HB->Write(); - h_mapDepth3TSmeanA_HB->Write(); - h_mapDepth4TSmeanA_HB->Write(); - - h_TSmaxA_HB->Write(); - h_mapDepth1TSmaxA225_HB->Write(); - h_mapDepth2TSmaxA225_HB->Write(); - h_mapDepth1TSmaxA_HB->Write(); - h_mapDepth2TSmaxA_HB->Write(); - h_mapDepth3TSmaxA225_HB->Write(); - h_mapDepth4TSmaxA225_HB->Write(); - h_mapDepth3TSmaxA_HB->Write(); - h_mapDepth4TSmaxA_HB->Write(); - - h_Amplitude_HB->Write(); - h_mapDepth1Amplitude225_HB->Write(); - h_mapDepth2Amplitude225_HB->Write(); - h_mapDepth1Amplitude_HB->Write(); - h_mapDepth2Amplitude_HB->Write(); - h_mapDepth3Amplitude225_HB->Write(); - h_mapDepth4Amplitude225_HB->Write(); - h_mapDepth3Amplitude_HB->Write(); - h_mapDepth4Amplitude_HB->Write(); - - h_Ampl_HB->Write(); - h_mapDepth1Ampl047_HB->Write(); - h_mapDepth2Ampl047_HB->Write(); - h_mapDepth1Ampl_HB->Write(); - h_mapDepth2Ampl_HB->Write(); - h_mapDepth1AmplE34_HB->Write(); - h_mapDepth2AmplE34_HB->Write(); - h_mapDepth1_HB->Write(); - h_mapDepth2_HB->Write(); - h_mapDepth3Ampl047_HB->Write(); - h_mapDepth4Ampl047_HB->Write(); - h_mapDepth3Ampl_HB->Write(); - h_mapDepth4Ampl_HB->Write(); - h_mapDepth3AmplE34_HB->Write(); - h_mapDepth4AmplE34_HB->Write(); - h_mapDepth3_HB->Write(); - h_mapDepth4_HB->Write(); - - h_mapDepth1ADCAmpl225Copy_HB->Write(); - h_mapDepth2ADCAmpl225Copy_HB->Write(); - h_mapDepth3ADCAmpl225Copy_HB->Write(); - h_mapDepth4ADCAmpl225Copy_HB->Write(); - h_mapDepth1ADCAmpl225Copy_HE->Write(); - h_mapDepth2ADCAmpl225Copy_HE->Write(); - h_mapDepth3ADCAmpl225Copy_HE->Write(); - h_mapDepth4ADCAmpl225Copy_HE->Write(); - h_mapDepth5ADCAmpl225Copy_HE->Write(); - h_mapDepth6ADCAmpl225Copy_HE->Write(); - h_mapDepth7ADCAmpl225Copy_HE->Write(); - h_mapDepth1ADCAmpl225Copy_HF->Write(); - h_mapDepth2ADCAmpl225Copy_HF->Write(); - h_mapDepth3ADCAmpl225Copy_HF->Write(); - h_mapDepth4ADCAmpl225Copy_HF->Write(); - h_mapDepth4ADCAmpl225Copy_HO->Write(); - /////////////////////// - h_ADCAmpl_HF->Write(); - h_ADCAmplrest1_HF->Write(); - h_ADCAmplrest6_HF->Write(); - - h_ADCAmplZoom1_HF->Write(); - h_mapDepth1ADCAmpl225_HF->Write(); - h_mapDepth2ADCAmpl225_HF->Write(); - h_mapDepth1ADCAmpl_HF->Write(); - h_mapDepth2ADCAmpl_HF->Write(); - h_mapDepth1ADCAmpl12_HF->Write(); - h_mapDepth2ADCAmpl12_HF->Write(); - h_mapDepth3ADCAmpl225_HF->Write(); - h_mapDepth4ADCAmpl225_HF->Write(); - h_mapDepth3ADCAmpl_HF->Write(); - h_mapDepth4ADCAmpl_HF->Write(); - h_mapDepth3ADCAmpl12_HF->Write(); - h_mapDepth4ADCAmpl12_HF->Write(); - - h_TSmeanA_HF->Write(); - h_mapDepth1TSmeanA225_HF->Write(); - h_mapDepth2TSmeanA225_HF->Write(); - h_mapDepth1TSmeanA_HF->Write(); - h_mapDepth2TSmeanA_HF->Write(); - h_mapDepth3TSmeanA225_HF->Write(); - h_mapDepth4TSmeanA225_HF->Write(); - h_mapDepth3TSmeanA_HF->Write(); - h_mapDepth4TSmeanA_HF->Write(); - - h_TSmaxA_HF->Write(); - h_mapDepth1TSmaxA225_HF->Write(); - h_mapDepth2TSmaxA225_HF->Write(); - h_mapDepth1TSmaxA_HF->Write(); - h_mapDepth2TSmaxA_HF->Write(); - h_mapDepth3TSmaxA225_HF->Write(); - h_mapDepth4TSmaxA225_HF->Write(); - h_mapDepth3TSmaxA_HF->Write(); - h_mapDepth4TSmaxA_HF->Write(); - - h_Amplitude_HF->Write(); - h_mapDepth1Amplitude225_HF->Write(); - h_mapDepth2Amplitude225_HF->Write(); - h_mapDepth1Amplitude_HF->Write(); - h_mapDepth2Amplitude_HF->Write(); - h_mapDepth3Amplitude225_HF->Write(); - h_mapDepth4Amplitude225_HF->Write(); - h_mapDepth3Amplitude_HF->Write(); - h_mapDepth4Amplitude_HF->Write(); - - h_Ampl_HF->Write(); - h_mapDepth1Ampl047_HF->Write(); - h_mapDepth2Ampl047_HF->Write(); - h_mapDepth3Ampl047_HF->Write(); - h_mapDepth4Ampl047_HF->Write(); - - h_mapDepth1Ampl_HF->Write(); - h_mapDepth2Ampl_HF->Write(); - h_mapDepth1AmplE34_HF->Write(); - h_mapDepth2AmplE34_HF->Write(); - h_mapDepth1_HF->Write(); - h_mapDepth2_HF->Write(); - h_mapDepth3Ampl_HF->Write(); - h_mapDepth4Ampl_HF->Write(); - h_mapDepth3AmplE34_HF->Write(); - h_mapDepth4AmplE34_HF->Write(); - h_mapDepth3_HF->Write(); - h_mapDepth4_HF->Write(); - - /////////////////////// - h_ADCAmpl_HO->Write(); - h_ADCAmplrest1_HO->Write(); - h_ADCAmplrest6_HO->Write(); - - h_ADCAmplZoom1_HO->Write(); - h_ADCAmpl_HO_copy->Write(); - h_mapDepth4ADCAmpl225_HO->Write(); - h_mapDepth4ADCAmpl_HO->Write(); - h_mapDepth4ADCAmpl12_HO->Write(); - - h_TSmeanA_HO->Write(); - h_mapDepth4TSmeanA225_HO->Write(); - h_mapDepth4TSmeanA_HO->Write(); - - h_TSmaxA_HO->Write(); - h_mapDepth4TSmaxA225_HO->Write(); - h_mapDepth4TSmaxA_HO->Write(); - - h_Amplitude_HO->Write(); - h_mapDepth4Amplitude225_HO->Write(); - h_mapDepth4Amplitude_HO->Write(); - h_Ampl_HO->Write(); - h_mapDepth4Ampl047_HO->Write(); - h_mapDepth4Ampl_HO->Write(); - h_mapDepth4AmplE34_HO->Write(); - h_mapDepth4_HO->Write(); - - ////////////////////////////////////////// - - h_ADCAmpl345Zoom_HE->Write(); - h_ADCAmpl345Zoom1_HE->Write(); - h_ADCAmpl345_HE->Write(); - h_ADCAmpl_HE->Write(); - h_ADCAmplrest_HE->Write(); - h_ADCAmplrest1_HE->Write(); - h_ADCAmplrest6_HE->Write(); - - h_ADCAmplZoom1_HE->Write(); - - h_corrforxaMAIN_HE->Write(); - h_corrforxaMAIN0_HE->Write(); - h_corrforxaADDI_HE->Write(); - h_corrforxaADDI0_HE->Write(); - - h_mapDepth1ADCAmpl225_HE->Write(); - h_mapDepth2ADCAmpl225_HE->Write(); - h_mapDepth3ADCAmpl225_HE->Write(); - h_mapDepth4ADCAmpl225_HE->Write(); - h_mapDepth5ADCAmpl225_HE->Write(); - h_mapDepth6ADCAmpl225_HE->Write(); - h_mapDepth7ADCAmpl225_HE->Write(); - - h_mapADCAmplfirstpeak_HE->Write(); - h_mapADCAmplfirstpeak0_HE->Write(); - h_mapADCAmplsecondpeak_HE->Write(); - h_mapADCAmplsecondpeak0_HE->Write(); - h_mapADCAmpl11firstpeak_HE->Write(); - h_mapADCAmpl11firstpeak0_HE->Write(); - h_mapADCAmpl11secondpeak_HE->Write(); - h_mapADCAmpl11secondpeak0_HE->Write(); - h_mapADCAmpl12firstpeak_HE->Write(); - h_mapADCAmpl12firstpeak0_HE->Write(); - h_mapADCAmpl12secondpeak_HE->Write(); - h_mapADCAmpl12secondpeak0_HE->Write(); - - h_gsmdifferencefit1_HE->Write(); - h_gsmdifferencefit2_HE->Write(); - h_gsmdifferencefit3_HE->Write(); - h_gsmdifferencefit4_HE->Write(); - h_gsmdifferencefit5_HE->Write(); - h_gsmdifferencefit6_HE->Write(); - - h_mapDepth1ADCAmpl_HE->Write(); - h_mapDepth2ADCAmpl_HE->Write(); - h_mapDepth3ADCAmpl_HE->Write(); - h_mapDepth4ADCAmpl_HE->Write(); - h_mapDepth5ADCAmpl_HE->Write(); - h_mapDepth6ADCAmpl_HE->Write(); - h_mapDepth7ADCAmpl_HE->Write(); - h_mapDepth1ADCAmpl12_HE->Write(); - h_mapDepth2ADCAmpl12_HE->Write(); - h_mapDepth3ADCAmpl12_HE->Write(); - h_mapDepth4ADCAmpl12_HE->Write(); - h_mapDepth5ADCAmpl12_HE->Write(); - h_mapDepth6ADCAmpl12_HE->Write(); - h_mapDepth7ADCAmpl12_HE->Write(); - - h_mapDepth1ADCAmplSiPM_HE->Write(); - h_mapDepth2ADCAmplSiPM_HE->Write(); - h_mapDepth3ADCAmplSiPM_HE->Write(); - h_mapDepth1ADCAmpl12SiPM_HE->Write(); - h_mapDepth2ADCAmpl12SiPM_HE->Write(); - h_mapDepth3ADCAmpl12SiPM_HE->Write(); - - h_mapDepth1linADCAmpl12_HE->Write(); - h_mapDepth2linADCAmpl12_HE->Write(); - h_mapDepth3linADCAmpl12_HE->Write(); - - h_TSmeanA_HE->Write(); - h_mapDepth1TSmeanA225_HE->Write(); - h_mapDepth2TSmeanA225_HE->Write(); - h_mapDepth3TSmeanA225_HE->Write(); - h_mapDepth4TSmeanA225_HE->Write(); - h_mapDepth5TSmeanA225_HE->Write(); - h_mapDepth6TSmeanA225_HE->Write(); - h_mapDepth7TSmeanA225_HE->Write(); - h_mapDepth1TSmeanA_HE->Write(); - h_mapDepth2TSmeanA_HE->Write(); - h_mapDepth3TSmeanA_HE->Write(); - h_mapDepth4TSmeanA_HE->Write(); - h_mapDepth5TSmeanA_HE->Write(); - h_mapDepth6TSmeanA_HE->Write(); - h_mapDepth7TSmeanA_HE->Write(); - - h_TSmaxA_HE->Write(); - h_mapDepth1TSmaxA225_HE->Write(); - h_mapDepth2TSmaxA225_HE->Write(); - h_mapDepth3TSmaxA225_HE->Write(); - h_mapDepth4TSmaxA225_HE->Write(); - h_mapDepth5TSmaxA225_HE->Write(); - h_mapDepth6TSmaxA225_HE->Write(); - h_mapDepth7TSmaxA225_HE->Write(); - h_mapDepth1TSmaxA_HE->Write(); - h_mapDepth2TSmaxA_HE->Write(); - h_mapDepth3TSmaxA_HE->Write(); - h_mapDepth4TSmaxA_HE->Write(); - h_mapDepth5TSmaxA_HE->Write(); - h_mapDepth6TSmaxA_HE->Write(); - h_mapDepth7TSmaxA_HE->Write(); - - h_Amplitude_HE->Write(); - h_mapDepth1Amplitude225_HE->Write(); - h_mapDepth2Amplitude225_HE->Write(); - h_mapDepth3Amplitude225_HE->Write(); - h_mapDepth4Amplitude225_HE->Write(); - h_mapDepth5Amplitude225_HE->Write(); - h_mapDepth6Amplitude225_HE->Write(); - h_mapDepth7Amplitude225_HE->Write(); - h_mapDepth1Amplitude_HE->Write(); - h_mapDepth2Amplitude_HE->Write(); - h_mapDepth3Amplitude_HE->Write(); - h_mapDepth4Amplitude_HE->Write(); - h_mapDepth5Amplitude_HE->Write(); - h_mapDepth6Amplitude_HE->Write(); - h_mapDepth7Amplitude_HE->Write(); - - h_Ampl_HE->Write(); - h_mapDepth1Ampl047_HE->Write(); - h_mapDepth2Ampl047_HE->Write(); - h_mapDepth3Ampl047_HE->Write(); - h_mapDepth4Ampl047_HE->Write(); - h_mapDepth5Ampl047_HE->Write(); - h_mapDepth6Ampl047_HE->Write(); - h_mapDepth7Ampl047_HE->Write(); - h_mapDepth1Ampl_HE->Write(); - h_mapDepth2Ampl_HE->Write(); - h_mapDepth3Ampl_HE->Write(); - h_mapDepth4Ampl_HE->Write(); - h_mapDepth5Ampl_HE->Write(); - h_mapDepth6Ampl_HE->Write(); - h_mapDepth7Ampl_HE->Write(); - h_mapDepth1AmplE34_HE->Write(); - h_mapDepth2AmplE34_HE->Write(); - h_mapDepth3AmplE34_HE->Write(); - h_mapDepth4AmplE34_HE->Write(); - h_mapDepth5AmplE34_HE->Write(); - h_mapDepth6AmplE34_HE->Write(); - h_mapDepth7AmplE34_HE->Write(); - h_mapDepth1_HE->Write(); - h_mapDepth2_HE->Write(); - h_mapDepth3_HE->Write(); - h_mapDepth4_HE->Write(); - h_mapDepth5_HE->Write(); - h_mapDepth6_HE->Write(); - h_mapDepth7_HE->Write(); - - /////////////////////// - - h_FullSignal3D_HB->Write(); - h_FullSignal3D0_HB->Write(); - h_FullSignal3D_HE->Write(); - h_FullSignal3D0_HE->Write(); - h_FullSignal3D_HO->Write(); - h_FullSignal3D0_HO->Write(); - h_FullSignal3D_HF->Write(); - h_FullSignal3D0_HF->Write(); - - h_nbadchannels_depth1_HB->Write(); - h_runnbadchannels_depth1_HB->Write(); - h_runnbadchannelsC_depth1_HB->Write(); - h_runbadrate_depth1_HB->Write(); - h_runbadrateC_depth1_HB->Write(); - h_runbadrate0_depth1_HB->Write(); - - h_nbadchannels_depth2_HB->Write(); - h_runnbadchannels_depth2_HB->Write(); - h_runnbadchannelsC_depth2_HB->Write(); - h_runbadrate_depth2_HB->Write(); - h_runbadrateC_depth2_HB->Write(); - h_runbadrate0_depth2_HB->Write(); - - h_nbadchannels_depth1_HE->Write(); - h_runnbadchannels_depth1_HE->Write(); - h_runnbadchannelsC_depth1_HE->Write(); - h_runbadrate_depth1_HE->Write(); - h_runbadrateC_depth1_HE->Write(); - h_runbadrate0_depth1_HE->Write(); - - h_nbadchannels_depth2_HE->Write(); - h_runnbadchannels_depth2_HE->Write(); - h_runnbadchannelsC_depth2_HE->Write(); - h_runbadrate_depth2_HE->Write(); - h_runbadrateC_depth2_HE->Write(); - h_runbadrate0_depth2_HE->Write(); - - h_nbadchannels_depth3_HE->Write(); - h_runnbadchannels_depth3_HE->Write(); - h_runnbadchannelsC_depth3_HE->Write(); - h_runbadrate_depth3_HE->Write(); - h_runbadrateC_depth3_HE->Write(); - h_runbadrate0_depth3_HE->Write(); - - h_nbadchannels_depth1_HF->Write(); - h_runnbadchannels_depth1_HF->Write(); - h_runnbadchannelsC_depth1_HF->Write(); - h_runbadrate_depth1_HF->Write(); - h_runbadrateC_depth1_HF->Write(); - h_runbadrate0_depth1_HF->Write(); - - h_nbadchannels_depth2_HF->Write(); - h_runnbadchannels_depth2_HF->Write(); - h_runnbadchannelsC_depth2_HF->Write(); - h_runbadrate_depth2_HF->Write(); - h_runbadrateC_depth2_HF->Write(); - h_runbadrate0_depth2_HF->Write(); - - h_nbadchannels_depth4_HO->Write(); - h_runnbadchannels_depth4_HO->Write(); - h_runnbadchannelsC_depth4_HO->Write(); - h_runbadrate_depth4_HO->Write(); - h_runbadrateC_depth4_HO->Write(); - h_runbadrate0_depth4_HO->Write(); - - /////////////////////// - h_mapCapCalib047_HB->Write(); - h_mapCapCalib047_HE->Write(); - h_mapCapCalib047_HO->Write(); - h_mapCapCalib047_HF->Write(); - - h_ADCCalib_HB->Write(); - h_ADCCalib1_HB->Write(); - h_mapADCCalib047_HB->Write(); - h_mapADCCalib_HB->Write(); - h_RatioCalib_HB->Write(); - h_mapRatioCalib047_HB->Write(); - h_mapRatioCalib_HB->Write(); - h_TSmaxCalib_HB->Write(); - h_mapTSmaxCalib047_HB->Write(); - h_mapTSmaxCalib_HB->Write(); - h_TSmeanCalib_HB->Write(); - h_mapTSmeanCalib047_HB->Write(); - h_mapTSmeanCalib_HB->Write(); - h_WidthCalib_HB->Write(); - h_mapWidthCalib047_HB->Write(); - h_mapWidthCalib_HB->Write(); - h_map_HB->Write(); - h_ADCCalib_HE->Write(); - h_ADCCalib1_HE->Write(); - h_mapADCCalib047_HE->Write(); - h_mapADCCalib_HE->Write(); - h_RatioCalib_HE->Write(); - h_mapRatioCalib047_HE->Write(); - h_mapRatioCalib_HE->Write(); - h_TSmaxCalib_HE->Write(); - h_mapTSmaxCalib047_HE->Write(); - h_mapTSmaxCalib_HE->Write(); - h_TSmeanCalib_HE->Write(); - h_mapTSmeanCalib047_HE->Write(); - h_mapTSmeanCalib_HE->Write(); - h_WidthCalib_HE->Write(); - h_mapWidthCalib047_HE->Write(); - h_mapWidthCalib_HE->Write(); - h_map_HE->Write(); - h_ADCCalib_HO->Write(); - h_ADCCalib1_HO->Write(); - h_mapADCCalib047_HO->Write(); - h_mapADCCalib_HO->Write(); - h_RatioCalib_HO->Write(); - h_mapRatioCalib047_HO->Write(); - h_mapRatioCalib_HO->Write(); - h_TSmaxCalib_HO->Write(); - h_mapTSmaxCalib047_HO->Write(); - h_mapTSmaxCalib_HO->Write(); - h_TSmeanCalib_HO->Write(); - h_mapTSmeanCalib047_HO->Write(); - h_mapTSmeanCalib_HO->Write(); - h_WidthCalib_HO->Write(); - h_mapWidthCalib047_HO->Write(); - h_mapWidthCalib_HO->Write(); - h_map_HO->Write(); - h_ADCCalib_HF->Write(); - h_ADCCalib1_HF->Write(); - h_mapADCCalib047_HF->Write(); - h_mapADCCalib_HF->Write(); - h_RatioCalib_HF->Write(); - h_mapRatioCalib047_HF->Write(); - h_mapRatioCalib_HF->Write(); - h_TSmaxCalib_HF->Write(); - h_mapTSmaxCalib047_HF->Write(); - h_mapTSmaxCalib_HF->Write(); - h_TSmeanCalib_HF->Write(); - h_mapTSmeanCalib047_HF->Write(); - h_mapTSmeanCalib_HF->Write(); - h_WidthCalib_HF->Write(); - h_mapWidthCalib047_HF->Write(); - h_mapWidthCalib_HF->Write(); - h_map_HF->Write(); - - h_nls_per_run->Write(); - h_nls_per_run10->Write(); - h_nevents_per_LS->Write(); - h_nevents_per_LSzoom->Write(); - h_nevents_per_eachRealLS->Write(); - h_nevents_per_eachLS->Write(); - h_lsnumber_per_eachLS->Write(); - - // for estimator0: - h_sumPedestalLS1->Write(); - h_2DsumPedestalLS1->Write(); - h_sumPedestalperLS1->Write(); - h_2D0sumPedestalLS1->Write(); - h_sum0PedestalperLS1->Write(); - - h_sumPedestalLS2->Write(); - h_2DsumPedestalLS2->Write(); - h_sumPedestalperLS2->Write(); - h_2D0sumPedestalLS2->Write(); - h_sum0PedestalperLS2->Write(); - - h_sumPedestalLS3->Write(); - h_2DsumPedestalLS3->Write(); - h_sumPedestalperLS3->Write(); - h_2D0sumPedestalLS3->Write(); - h_sum0PedestalperLS3->Write(); - - h_sumPedestalLS4->Write(); - h_2DsumPedestalLS4->Write(); - h_sumPedestalperLS4->Write(); - h_2D0sumPedestalLS4->Write(); - h_sum0PedestalperLS4->Write(); - - h_sumPedestalLS5->Write(); - h_2DsumPedestalLS5->Write(); - h_sumPedestalperLS5->Write(); - h_2D0sumPedestalLS5->Write(); - h_sum0PedestalperLS5->Write(); - - h_sumPedestalLS6->Write(); - h_2DsumPedestalLS6->Write(); - h_sumPedestalperLS6->Write(); - h_2D0sumPedestalLS6->Write(); - h_sum0PedestalperLS6->Write(); - - h_sumPedestalLS7->Write(); - h_2DsumPedestalLS7->Write(); - h_sumPedestalperLS7->Write(); - h_2D0sumPedestalLS7->Write(); - h_sum0PedestalperLS7->Write(); - - h_sumPedestalLS8->Write(); - h_2DsumPedestalLS8->Write(); - h_sumPedestalperLS8->Write(); - h_2D0sumPedestalLS8->Write(); - h_sum0PedestalperLS8->Write(); - - // for estimator1: - - // for HE gain stability vs LS: - h_2DsumADCAmplLSdepth4HEu->Write(); - h_2D0sumADCAmplLSdepth4HEu->Write(); - h_2DsumADCAmplLSdepth5HEu->Write(); - h_2D0sumADCAmplLSdepth5HEu->Write(); - h_2DsumADCAmplLSdepth6HEu->Write(); - h_2D0sumADCAmplLSdepth6HEu->Write(); - h_2DsumADCAmplLSdepth7HEu->Write(); - h_2D0sumADCAmplLSdepth7HEu->Write(); - h_2DsumADCAmplLSdepth3HFu->Write(); - h_2D0sumADCAmplLSdepth3HFu->Write(); - h_2DsumADCAmplLSdepth4HFu->Write(); - h_2D0sumADCAmplLSdepth4HFu->Write(); - // for HB gain stability vs LS: - h_2DsumADCAmplLSdepth3HBu->Write(); - h_2D0sumADCAmplLSdepth3HBu->Write(); - h_2DsumADCAmplLSdepth4HBu->Write(); - h_2D0sumADCAmplLSdepth4HBu->Write(); - - h_sumADCAmplLS1copy1->Write(); - h_sumADCAmplLS1copy2->Write(); - h_sumADCAmplLS1copy3->Write(); - h_sumADCAmplLS1copy4->Write(); - h_sumADCAmplLS1copy5->Write(); - h_sumADCAmplLS1->Write(); - h_2DsumADCAmplLS1->Write(); - h_2DsumADCAmplLS1_LSselected->Write(); - h_sumADCAmplperLS1->Write(); - h_sumCutADCAmplperLS1->Write(); - h_2D0sumADCAmplLS1->Write(); - h_sum0ADCAmplperLS1->Write(); - - h_sumADCAmplLS2->Write(); - h_2DsumADCAmplLS2->Write(); - h_2DsumADCAmplLS2_LSselected->Write(); - h_sumADCAmplperLS2->Write(); - h_sumCutADCAmplperLS2->Write(); - h_2D0sumADCAmplLS2->Write(); - h_sum0ADCAmplperLS2->Write(); - - h_sumADCAmplLS3->Write(); - h_2DsumADCAmplLS3->Write(); - h_2DsumADCAmplLS3_LSselected->Write(); - h_sumADCAmplperLS3->Write(); - h_sumCutADCAmplperLS3->Write(); - h_2D0sumADCAmplLS3->Write(); - h_sum0ADCAmplperLS3->Write(); - - h_sumADCAmplLS4->Write(); - h_2DsumADCAmplLS4->Write(); - h_2DsumADCAmplLS4_LSselected->Write(); - h_sumADCAmplperLS4->Write(); - h_sumCutADCAmplperLS4->Write(); - h_2D0sumADCAmplLS4->Write(); - h_sum0ADCAmplperLS4->Write(); - - h_sumADCAmplLS5->Write(); - h_2DsumADCAmplLS5->Write(); - h_2DsumADCAmplLS5_LSselected->Write(); - h_sumADCAmplperLS5->Write(); - h_sumCutADCAmplperLS5->Write(); - h_2D0sumADCAmplLS5->Write(); - h_sum0ADCAmplperLS5->Write(); - - h_sumADCAmplLS6->Write(); - h_2DsumADCAmplLS6->Write(); - h_2DsumADCAmplLS6_LSselected->Write(); - h_2D0sumADCAmplLS6->Write(); - h_sumADCAmplperLS6->Write(); - h_sumCutADCAmplperLS6->Write(); - h_sum0ADCAmplperLS6->Write(); - h_sumADCAmplperLS6u->Write(); - h_sumCutADCAmplperLS6u->Write(); - h_sum0ADCAmplperLS6u->Write(); - - h_sumADCAmplperLSdepth4HEu->Write(); - h_sumADCAmplperLSdepth5HEu->Write(); - h_sumADCAmplperLSdepth6HEu->Write(); - h_sumADCAmplperLSdepth7HEu->Write(); - h_sumCutADCAmplperLSdepth4HEu->Write(); - h_sumCutADCAmplperLSdepth5HEu->Write(); - h_sumCutADCAmplperLSdepth6HEu->Write(); - h_sumCutADCAmplperLSdepth7HEu->Write(); - h_sum0ADCAmplperLSdepth4HEu->Write(); - h_sum0ADCAmplperLSdepth5HEu->Write(); - h_sum0ADCAmplperLSdepth6HEu->Write(); - h_sum0ADCAmplperLSdepth7HEu->Write(); - - h_sumADCAmplperLSdepth3HBu->Write(); - h_sumADCAmplperLSdepth4HBu->Write(); - h_sumCutADCAmplperLSdepth3HBu->Write(); - h_sumCutADCAmplperLSdepth4HBu->Write(); - h_sum0ADCAmplperLSdepth3HBu->Write(); - h_sum0ADCAmplperLSdepth4HBu->Write(); - - h_sumADCAmplperLS1_P1->Write(); - h_sum0ADCAmplperLS1_P1->Write(); - h_sumADCAmplperLS1_P2->Write(); - h_sum0ADCAmplperLS1_P2->Write(); - h_sumADCAmplperLS1_M1->Write(); - h_sum0ADCAmplperLS1_M1->Write(); - h_sumADCAmplperLS1_M2->Write(); - h_sum0ADCAmplperLS1_M2->Write(); - - h_sumADCAmplperLS3_P1->Write(); - h_sum0ADCAmplperLS3_P1->Write(); - h_sumADCAmplperLS3_P2->Write(); - h_sum0ADCAmplperLS3_P2->Write(); - h_sumADCAmplperLS3_M1->Write(); - h_sum0ADCAmplperLS3_M1->Write(); - h_sumADCAmplperLS3_M2->Write(); - h_sum0ADCAmplperLS3_M2->Write(); - - h_sumADCAmplperLS6_P1->Write(); - h_sum0ADCAmplperLS6_P1->Write(); - h_sumADCAmplperLS6_P2->Write(); - h_sum0ADCAmplperLS6_P2->Write(); - h_sumADCAmplperLS6_M1->Write(); - h_sum0ADCAmplperLS6_M1->Write(); - h_sumADCAmplperLS6_M2->Write(); - h_sum0ADCAmplperLS6_M2->Write(); - - h_sumADCAmplperLS8_P1->Write(); - h_sum0ADCAmplperLS8_P1->Write(); - h_sumADCAmplperLS8_P2->Write(); - h_sum0ADCAmplperLS8_P2->Write(); - h_sumADCAmplperLS8_M1->Write(); - h_sum0ADCAmplperLS8_M1->Write(); - h_sumADCAmplperLS8_M2->Write(); - h_sum0ADCAmplperLS8_M2->Write(); - - h_sumADCAmplLS7->Write(); - h_2DsumADCAmplLS7->Write(); - h_2DsumADCAmplLS7_LSselected->Write(); - h_2D0sumADCAmplLS7->Write(); - h_sumADCAmplperLS7->Write(); - h_sumCutADCAmplperLS7->Write(); - h_sum0ADCAmplperLS7->Write(); - h_sumADCAmplperLS7u->Write(); - h_sumCutADCAmplperLS7u->Write(); - h_sum0ADCAmplperLS7u->Write(); - - h_sumADCAmplLS8->Write(); - h_2DsumADCAmplLS8->Write(); - h_2DsumADCAmplLS8_LSselected->Write(); - h_sumADCAmplperLS8->Write(); - h_sumCutADCAmplperLS8->Write(); - h_2D0sumADCAmplLS8->Write(); - h_sum0ADCAmplperLS8->Write(); - - // for estimator2: - h_sumTSmeanALS1->Write(); - h_2DsumTSmeanALS1->Write(); - h_sumTSmeanAperLS1->Write(); - h_sumTSmeanAperLS1_LSselected->Write(); - h_sumCutTSmeanAperLS1->Write(); - h_2D0sumTSmeanALS1->Write(); - h_sum0TSmeanAperLS1->Write(); - - h_sumTSmeanALS2->Write(); - h_2DsumTSmeanALS2->Write(); - h_sumTSmeanAperLS2->Write(); - h_sumCutTSmeanAperLS2->Write(); - h_2D0sumTSmeanALS2->Write(); - h_sum0TSmeanAperLS2->Write(); - - h_sumTSmeanALS3->Write(); - h_2DsumTSmeanALS3->Write(); - h_sumTSmeanAperLS3->Write(); - h_sumCutTSmeanAperLS3->Write(); - h_2D0sumTSmeanALS3->Write(); - h_sum0TSmeanAperLS3->Write(); - - h_sumTSmeanALS4->Write(); - h_2DsumTSmeanALS4->Write(); - h_sumTSmeanAperLS4->Write(); - h_sumCutTSmeanAperLS4->Write(); - h_2D0sumTSmeanALS4->Write(); - h_sum0TSmeanAperLS4->Write(); - - h_sumTSmeanALS5->Write(); - h_2DsumTSmeanALS5->Write(); - h_sumTSmeanAperLS5->Write(); - h_sumCutTSmeanAperLS5->Write(); - h_2D0sumTSmeanALS5->Write(); - h_sum0TSmeanAperLS5->Write(); - - h_sumTSmeanALS6->Write(); - h_2DsumTSmeanALS6->Write(); - h_sumTSmeanAperLS6->Write(); - h_sumCutTSmeanAperLS6->Write(); - h_2D0sumTSmeanALS6->Write(); - h_sum0TSmeanAperLS6->Write(); - - h_sumTSmeanALS7->Write(); - h_2DsumTSmeanALS7->Write(); - h_sumTSmeanAperLS7->Write(); - h_sumCutTSmeanAperLS7->Write(); - h_2D0sumTSmeanALS7->Write(); - h_sum0TSmeanAperLS7->Write(); - - h_sumTSmeanALS8->Write(); - h_2DsumTSmeanALS8->Write(); - h_sumTSmeanAperLS8->Write(); - h_sumCutTSmeanAperLS8->Write(); - h_2D0sumTSmeanALS8->Write(); - h_sum0TSmeanAperLS8->Write(); - - // for estimator3: - h_sumTSmaxALS1->Write(); - h_2DsumTSmaxALS1->Write(); - h_sumTSmaxAperLS1->Write(); - h_sumTSmaxAperLS1_LSselected->Write(); - h_sumCutTSmaxAperLS1->Write(); - h_2D0sumTSmaxALS1->Write(); - h_sum0TSmaxAperLS1->Write(); - - h_sumTSmaxALS2->Write(); - h_2DsumTSmaxALS2->Write(); - h_sumTSmaxAperLS2->Write(); - h_sumCutTSmaxAperLS2->Write(); - h_2D0sumTSmaxALS2->Write(); - h_sum0TSmaxAperLS2->Write(); - - h_sumTSmaxALS3->Write(); - h_2DsumTSmaxALS3->Write(); - h_sumTSmaxAperLS3->Write(); - h_sumCutTSmaxAperLS3->Write(); - h_2D0sumTSmaxALS3->Write(); - h_sum0TSmaxAperLS3->Write(); - - h_sumTSmaxALS4->Write(); - h_2DsumTSmaxALS4->Write(); - h_sumTSmaxAperLS4->Write(); - h_sumCutTSmaxAperLS4->Write(); - h_2D0sumTSmaxALS4->Write(); - h_sum0TSmaxAperLS4->Write(); - - h_sumTSmaxALS5->Write(); - h_2DsumTSmaxALS5->Write(); - h_sumTSmaxAperLS5->Write(); - h_sumCutTSmaxAperLS5->Write(); - h_2D0sumTSmaxALS5->Write(); - h_sum0TSmaxAperLS5->Write(); - - h_sumTSmaxALS6->Write(); - h_2DsumTSmaxALS6->Write(); - h_sumTSmaxAperLS6->Write(); - h_sumCutTSmaxAperLS6->Write(); - h_2D0sumTSmaxALS6->Write(); - h_sum0TSmaxAperLS6->Write(); - - h_sumTSmaxALS7->Write(); - h_2DsumTSmaxALS7->Write(); - h_sumTSmaxAperLS7->Write(); - h_sumCutTSmaxAperLS7->Write(); - h_2D0sumTSmaxALS7->Write(); - h_sum0TSmaxAperLS7->Write(); - - h_sumTSmaxALS8->Write(); - h_2DsumTSmaxALS8->Write(); - h_sumTSmaxAperLS8->Write(); - h_sumCutTSmaxAperLS8->Write(); - h_2D0sumTSmaxALS8->Write(); - h_sum0TSmaxAperLS8->Write(); - - // for estimator4: - h_sumAmplitudeLS1->Write(); - h_2DsumAmplitudeLS1->Write(); - h_sumAmplitudeperLS1->Write(); - h_sumAmplitudeperLS1_LSselected->Write(); - h_sumCutAmplitudeperLS1->Write(); - h_2D0sumAmplitudeLS1->Write(); - h_sum0AmplitudeperLS1->Write(); - - h_sumAmplitudeLS2->Write(); - h_2DsumAmplitudeLS2->Write(); - h_sumAmplitudeperLS2->Write(); - h_sumCutAmplitudeperLS2->Write(); - h_2D0sumAmplitudeLS2->Write(); - h_sum0AmplitudeperLS2->Write(); - - h_sumAmplitudeLS3->Write(); - h_2DsumAmplitudeLS3->Write(); - h_sumAmplitudeperLS3->Write(); - h_sumCutAmplitudeperLS3->Write(); - h_2D0sumAmplitudeLS3->Write(); - h_sum0AmplitudeperLS3->Write(); - - h_sumAmplitudeLS4->Write(); - h_2DsumAmplitudeLS4->Write(); - h_sumAmplitudeperLS4->Write(); - h_sumCutAmplitudeperLS4->Write(); - h_2D0sumAmplitudeLS4->Write(); - h_sum0AmplitudeperLS4->Write(); - - h_sumAmplitudeLS5->Write(); - h_2DsumAmplitudeLS5->Write(); - h_sumAmplitudeperLS5->Write(); - h_sumCutAmplitudeperLS5->Write(); - h_2D0sumAmplitudeLS5->Write(); - h_sum0AmplitudeperLS5->Write(); - - h_sumAmplitudeLS6->Write(); - h_2DsumAmplitudeLS6->Write(); - h_sumAmplitudeperLS6->Write(); - h_sumCutAmplitudeperLS6->Write(); - h_2D0sumAmplitudeLS6->Write(); - h_sum0AmplitudeperLS6->Write(); - - h_sumAmplitudeLS7->Write(); - h_2DsumAmplitudeLS7->Write(); - h_sumAmplitudeperLS7->Write(); - h_sumCutAmplitudeperLS7->Write(); - h_2D0sumAmplitudeLS7->Write(); - h_sum0AmplitudeperLS7->Write(); - - h_sumAmplitudeLS8->Write(); - h_2DsumAmplitudeLS8->Write(); - h_sumAmplitudeperLS8->Write(); - h_sumCutAmplitudeperLS8->Write(); - h_2D0sumAmplitudeLS8->Write(); - h_sum0AmplitudeperLS8->Write(); - - // for estimator6: - h_sumErrorBLS1->Write(); - h_sumErrorBperLS1->Write(); - h_sum0ErrorBperLS1->Write(); - h_2D0sumErrorBLS1->Write(); - h_2DsumErrorBLS1->Write(); - h_sumErrorBLS2->Write(); - h_sumErrorBperLS2->Write(); - h_sum0ErrorBperLS2->Write(); - h_2D0sumErrorBLS2->Write(); - h_2DsumErrorBLS2->Write(); - - h_sumErrorBLS3->Write(); - h_sumErrorBperLS3->Write(); - h_sum0ErrorBperLS3->Write(); - h_2D0sumErrorBLS3->Write(); - h_2DsumErrorBLS3->Write(); - h_sumErrorBLS4->Write(); - h_sumErrorBperLS4->Write(); - h_sum0ErrorBperLS4->Write(); - h_2D0sumErrorBLS4->Write(); - h_2DsumErrorBLS4->Write(); - h_sumErrorBLS5->Write(); - h_sumErrorBperLS5->Write(); - h_sum0ErrorBperLS5->Write(); - h_2D0sumErrorBLS5->Write(); - h_2DsumErrorBLS5->Write(); - - h_sumErrorBLS6->Write(); - h_sumErrorBperLS6->Write(); - h_sum0ErrorBperLS6->Write(); - h_2D0sumErrorBLS6->Write(); - h_2DsumErrorBLS6->Write(); - h_sumErrorBLS7->Write(); - h_sumErrorBperLS7->Write(); - h_sum0ErrorBperLS7->Write(); - h_2D0sumErrorBLS7->Write(); - h_2DsumErrorBLS7->Write(); - - h_sumErrorBLS8->Write(); - h_sumErrorBperLS8->Write(); - h_sum0ErrorBperLS8->Write(); - h_2D0sumErrorBLS8->Write(); - h_2DsumErrorBLS8->Write(); - - // for estimator5: - h_sumAmplLS1->Write(); - h_2DsumAmplLS1->Write(); - h_sumAmplperLS1->Write(); - h_sumAmplperLS1_LSselected->Write(); - h_sumCutAmplperLS1->Write(); - h_2D0sumAmplLS1->Write(); - h_sum0AmplperLS1->Write(); - - h_sumAmplLS2->Write(); - h_2DsumAmplLS2->Write(); - h_sumAmplperLS2->Write(); - h_sumCutAmplperLS2->Write(); - h_2D0sumAmplLS2->Write(); - h_sum0AmplperLS2->Write(); - - h_sumAmplLS3->Write(); - h_2DsumAmplLS3->Write(); - h_sumAmplperLS3->Write(); - h_sumCutAmplperLS3->Write(); - h_2D0sumAmplLS3->Write(); - h_sum0AmplperLS3->Write(); - - h_sumAmplLS4->Write(); - h_2DsumAmplLS4->Write(); - h_sumAmplperLS4->Write(); - h_sumCutAmplperLS4->Write(); - h_2D0sumAmplLS4->Write(); - h_sum0AmplperLS4->Write(); - - h_sumAmplLS5->Write(); - h_2DsumAmplLS5->Write(); - h_sumAmplperLS5->Write(); - h_sumCutAmplperLS5->Write(); - h_2D0sumAmplLS5->Write(); - h_sum0AmplperLS5->Write(); - - h_sumAmplLS6->Write(); - h_2DsumAmplLS6->Write(); - h_sumAmplperLS6->Write(); - h_sumCutAmplperLS6->Write(); - h_2D0sumAmplLS6->Write(); - h_sum0AmplperLS6->Write(); - - h_RatioOccupancy_HBP->Write(); - h_RatioOccupancy_HBM->Write(); - h_RatioOccupancy_HEP->Write(); - h_RatioOccupancy_HEM->Write(); - h_RatioOccupancy_HOP->Write(); - h_RatioOccupancy_HOM->Write(); - h_RatioOccupancy_HFP->Write(); - h_RatioOccupancy_HFM->Write(); - - h_sumAmplLS7->Write(); - h_2DsumAmplLS7->Write(); - h_sumAmplperLS7->Write(); - h_sumCutAmplperLS7->Write(); - h_2D0sumAmplLS7->Write(); - h_sum0AmplperLS7->Write(); - - h_sumAmplLS8->Write(); - h_2DsumAmplLS8->Write(); - h_sumAmplperLS8->Write(); - h_sumCutAmplperLS8->Write(); - h_2D0sumAmplLS8->Write(); - h_sum0AmplperLS8->Write(); - - h_pedestal0_HB->Write(); - h_pedestal1_HB->Write(); - h_pedestal2_HB->Write(); - h_pedestal3_HB->Write(); - h_pedestalaver4_HB->Write(); - h_pedestalaver9_HB->Write(); - h_pedestalw0_HB->Write(); - h_pedestalw1_HB->Write(); - h_pedestalw2_HB->Write(); - h_pedestalw3_HB->Write(); - h_pedestalwaver4_HB->Write(); - h_pedestalwaver9_HB->Write(); - - h_pedestal0_HE->Write(); - h_pedestal1_HE->Write(); - h_pedestal2_HE->Write(); - h_pedestal3_HE->Write(); - h_pedestalaver4_HE->Write(); - h_pedestalaver9_HE->Write(); - h_pedestalw0_HE->Write(); - h_pedestalw1_HE->Write(); - h_pedestalw2_HE->Write(); - h_pedestalw3_HE->Write(); - h_pedestalwaver4_HE->Write(); - h_pedestalwaver9_HE->Write(); - - h_pedestal0_HF->Write(); - h_pedestal1_HF->Write(); - h_pedestal2_HF->Write(); - h_pedestal3_HF->Write(); - h_pedestalaver4_HF->Write(); - h_pedestalaver9_HF->Write(); - h_pedestalw0_HF->Write(); - h_pedestalw1_HF->Write(); - h_pedestalw2_HF->Write(); - h_pedestalw3_HF->Write(); - h_pedestalwaver4_HF->Write(); - h_pedestalwaver9_HF->Write(); - - h_pedestal0_HO->Write(); - h_pedestal1_HO->Write(); - h_pedestal2_HO->Write(); - h_pedestal3_HO->Write(); - h_pedestalaver4_HO->Write(); - h_pedestalaver9_HO->Write(); - h_pedestalw0_HO->Write(); - h_pedestalw1_HO->Write(); - h_pedestalw2_HO->Write(); - h_pedestalw3_HO->Write(); - h_pedestalwaver4_HO->Write(); - h_pedestalwaver9_HO->Write(); - - h_mapDepth1pedestalw_HB->Write(); - h_mapDepth2pedestalw_HB->Write(); - h_mapDepth3pedestalw_HB->Write(); - h_mapDepth4pedestalw_HB->Write(); - h_mapDepth1pedestalw_HE->Write(); - h_mapDepth2pedestalw_HE->Write(); - h_mapDepth3pedestalw_HE->Write(); - h_mapDepth4pedestalw_HE->Write(); - h_mapDepth5pedestalw_HE->Write(); - h_mapDepth6pedestalw_HE->Write(); - h_mapDepth7pedestalw_HE->Write(); - h_mapDepth1pedestalw_HF->Write(); - h_mapDepth2pedestalw_HF->Write(); - h_mapDepth3pedestalw_HF->Write(); - h_mapDepth4pedestalw_HF->Write(); - h_mapDepth4pedestalw_HO->Write(); - - h_mapDepth1pedestal_HB->Write(); - h_mapDepth2pedestal_HB->Write(); - h_mapDepth3pedestal_HB->Write(); - h_mapDepth4pedestal_HB->Write(); - h_mapDepth1pedestal_HE->Write(); - h_mapDepth2pedestal_HE->Write(); - h_mapDepth3pedestal_HE->Write(); - h_mapDepth4pedestal_HE->Write(); - h_mapDepth5pedestal_HE->Write(); - h_mapDepth6pedestal_HE->Write(); - h_mapDepth7pedestal_HE->Write(); - h_mapDepth1pedestal_HF->Write(); - h_mapDepth2pedestal_HF->Write(); - h_mapDepth3pedestal_HF->Write(); - h_mapDepth4pedestal_HF->Write(); - h_mapDepth4pedestal_HO->Write(); - - h_pedestal00_HB->Write(); - h_gain_HB->Write(); - h_respcorr_HB->Write(); - h_timecorr_HB->Write(); - h_lutcorr_HB->Write(); - h_difpedestal0_HB->Write(); - h_difpedestal1_HB->Write(); - h_difpedestal2_HB->Write(); - h_difpedestal3_HB->Write(); - - h_pedestal00_HE->Write(); - h_gain_HE->Write(); - h_respcorr_HE->Write(); - h_timecorr_HE->Write(); - h_lutcorr_HE->Write(); - - h_pedestal00_HF->Write(); - h_gain_HF->Write(); - h_respcorr_HF->Write(); - h_timecorr_HF->Write(); - h_lutcorr_HF->Write(); - - h_pedestal00_HO->Write(); - h_gain_HO->Write(); - h_respcorr_HO->Write(); - h_timecorr_HO->Write(); - h_lutcorr_HO->Write(); - - h2_pedvsampl_HB->Write(); - h2_pedwvsampl_HB->Write(); - h_pedvsampl_HB->Write(); - h_pedwvsampl_HB->Write(); - h_pedvsampl0_HB->Write(); - h_pedwvsampl0_HB->Write(); - h2_amplvsped_HB->Write(); - h2_amplvspedw_HB->Write(); - h_amplvsped_HB->Write(); - h_amplvspedw_HB->Write(); - h_amplvsped0_HB->Write(); - - h2_pedvsampl_HE->Write(); - h2_pedwvsampl_HE->Write(); - h_pedvsampl_HE->Write(); - h_pedwvsampl_HE->Write(); - h_pedvsampl0_HE->Write(); - h_pedwvsampl0_HE->Write(); - h2_pedvsampl_HF->Write(); - h2_pedwvsampl_HF->Write(); - h_pedvsampl_HF->Write(); - h_pedwvsampl_HF->Write(); - h_pedvsampl0_HF->Write(); - h_pedwvsampl0_HF->Write(); - h2_pedvsampl_HO->Write(); - h2_pedwvsampl_HO->Write(); - h_pedvsampl_HO->Write(); - h_pedwvsampl_HO->Write(); - h_pedvsampl0_HO->Write(); - h_pedwvsampl0_HO->Write(); - - h_mapDepth1Ped0_HB->Write(); - h_mapDepth1Ped1_HB->Write(); - h_mapDepth1Ped2_HB->Write(); - h_mapDepth1Ped3_HB->Write(); - h_mapDepth1Pedw0_HB->Write(); - h_mapDepth1Pedw1_HB->Write(); - h_mapDepth1Pedw2_HB->Write(); - h_mapDepth1Pedw3_HB->Write(); - h_mapDepth2Ped0_HB->Write(); - h_mapDepth2Ped1_HB->Write(); - h_mapDepth2Ped2_HB->Write(); - h_mapDepth2Ped3_HB->Write(); - h_mapDepth2Pedw0_HB->Write(); - h_mapDepth2Pedw1_HB->Write(); - h_mapDepth2Pedw2_HB->Write(); - h_mapDepth2Pedw3_HB->Write(); - - h_mapDepth1Ped0_HE->Write(); - h_mapDepth1Ped1_HE->Write(); - h_mapDepth1Ped2_HE->Write(); - h_mapDepth1Ped3_HE->Write(); - h_mapDepth1Pedw0_HE->Write(); - h_mapDepth1Pedw1_HE->Write(); - h_mapDepth1Pedw2_HE->Write(); - h_mapDepth1Pedw3_HE->Write(); - h_mapDepth2Ped0_HE->Write(); - h_mapDepth2Ped1_HE->Write(); - h_mapDepth2Ped2_HE->Write(); - h_mapDepth2Ped3_HE->Write(); - h_mapDepth2Pedw0_HE->Write(); - h_mapDepth2Pedw1_HE->Write(); - h_mapDepth2Pedw2_HE->Write(); - h_mapDepth2Pedw3_HE->Write(); - h_mapDepth3Ped0_HE->Write(); - h_mapDepth3Ped1_HE->Write(); - h_mapDepth3Ped2_HE->Write(); - h_mapDepth3Ped3_HE->Write(); - h_mapDepth3Pedw0_HE->Write(); - h_mapDepth3Pedw1_HE->Write(); - h_mapDepth3Pedw2_HE->Write(); - h_mapDepth3Pedw3_HE->Write(); - - h_mapDepth1Ped0_HF->Write(); - h_mapDepth1Ped1_HF->Write(); - h_mapDepth1Ped2_HF->Write(); - h_mapDepth1Ped3_HF->Write(); - h_mapDepth1Pedw0_HF->Write(); - h_mapDepth1Pedw1_HF->Write(); - h_mapDepth1Pedw2_HF->Write(); - h_mapDepth1Pedw3_HF->Write(); - h_mapDepth2Ped0_HF->Write(); - h_mapDepth2Ped1_HF->Write(); - h_mapDepth2Ped2_HF->Write(); - h_mapDepth2Ped3_HF->Write(); - h_mapDepth2Pedw0_HF->Write(); - h_mapDepth2Pedw1_HF->Write(); - h_mapDepth2Pedw2_HF->Write(); - h_mapDepth2Pedw3_HF->Write(); - - h_mapDepth4Ped0_HO->Write(); - h_mapDepth4Ped1_HO->Write(); - h_mapDepth4Ped2_HO->Write(); - h_mapDepth4Ped3_HO->Write(); - h_mapDepth4Pedw0_HO->Write(); - h_mapDepth4Pedw1_HO->Write(); - h_mapDepth4Pedw2_HO->Write(); - h_mapDepth4Pedw3_HO->Write(); - - h_mapGetRMSOverNormalizedSignal_HB->Write(); - h_mapGetRMSOverNormalizedSignal0_HB->Write(); - h_mapGetRMSOverNormalizedSignal_HE->Write(); - h_mapGetRMSOverNormalizedSignal0_HE->Write(); - h_mapGetRMSOverNormalizedSignal_HF->Write(); - h_mapGetRMSOverNormalizedSignal0_HF->Write(); - h_mapGetRMSOverNormalizedSignal_HO->Write(); - h_mapGetRMSOverNormalizedSignal0_HO->Write(); - - h_shape_Ahigh_HB0->Write(); - h_shape0_Ahigh_HB0->Write(); - h_shape_Alow_HB0->Write(); - h_shape0_Alow_HB0->Write(); - h_shape_Ahigh_HB1->Write(); - h_shape0_Ahigh_HB1->Write(); - h_shape_Alow_HB1->Write(); - h_shape0_Alow_HB1->Write(); - h_shape_Ahigh_HB2->Write(); - h_shape0_Ahigh_HB2->Write(); - h_shape_Alow_HB2->Write(); - h_shape0_Alow_HB2->Write(); - h_shape_Ahigh_HB3->Write(); - h_shape0_Ahigh_HB3->Write(); - h_shape_Alow_HB3->Write(); - h_shape0_Alow_HB3->Write(); - - h_shape_bad_channels_HB->Write(); - h_shape0_bad_channels_HB->Write(); - h_shape_good_channels_HB->Write(); - h_shape0_good_channels_HB->Write(); - h_shape_bad_channels_HE->Write(); - h_shape0_bad_channels_HE->Write(); - h_shape_good_channels_HE->Write(); - h_shape0_good_channels_HE->Write(); - h_shape_bad_channels_HF->Write(); - h_shape0_bad_channels_HF->Write(); - h_shape_good_channels_HF->Write(); - h_shape0_good_channels_HF->Write(); - h_shape_bad_channels_HO->Write(); - h_shape0_bad_channels_HO->Write(); - h_shape_good_channels_HO->Write(); - h_shape0_good_channels_HO->Write(); - - h_sumamplitude_depth1_HB->Write(); - h_sumamplitude_depth2_HB->Write(); - h_sumamplitude_depth1_HE->Write(); - h_sumamplitude_depth2_HE->Write(); - h_sumamplitude_depth3_HE->Write(); - h_sumamplitude_depth1_HF->Write(); - h_sumamplitude_depth2_HF->Write(); - h_sumamplitude_depth4_HO->Write(); - - h_sumamplitude_depth1_HB0->Write(); - h_sumamplitude_depth2_HB0->Write(); - h_sumamplitude_depth1_HE0->Write(); - h_sumamplitude_depth2_HE0->Write(); - h_sumamplitude_depth3_HE0->Write(); - h_sumamplitude_depth1_HF0->Write(); - h_sumamplitude_depth2_HF0->Write(); - h_sumamplitude_depth4_HO0->Write(); - - h_sumamplitude_depth1_HB1->Write(); - h_sumamplitude_depth2_HB1->Write(); - h_sumamplitude_depth1_HE1->Write(); - h_sumamplitude_depth2_HE1->Write(); - h_sumamplitude_depth3_HE1->Write(); - h_sumamplitude_depth1_HF1->Write(); - h_sumamplitude_depth2_HF1->Write(); - h_sumamplitude_depth4_HO1->Write(); - h_bcnnbadchannels_depth1_HB->Write(); - h_bcnnbadchannels_depth2_HB->Write(); - h_bcnnbadchannels_depth1_HE->Write(); - h_bcnnbadchannels_depth2_HE->Write(); - h_bcnnbadchannels_depth3_HE->Write(); - h_bcnnbadchannels_depth4_HO->Write(); - h_bcnnbadchannels_depth1_HF->Write(); - h_bcnnbadchannels_depth2_HF->Write(); - h_bcnbadrate0_depth1_HB->Write(); - h_bcnbadrate0_depth2_HB->Write(); - h_bcnbadrate0_depth1_HE->Write(); - h_bcnbadrate0_depth2_HE->Write(); - h_bcnbadrate0_depth3_HE->Write(); - h_bcnbadrate0_depth4_HO->Write(); - h_bcnbadrate0_depth1_HF->Write(); - h_bcnbadrate0_depth2_HF->Write(); - - h_Amplitude_forCapIdErrors_HB1->Write(); - h_Amplitude_forCapIdErrors_HB2->Write(); - h_Amplitude_forCapIdErrors_HE1->Write(); - h_Amplitude_forCapIdErrors_HE2->Write(); - h_Amplitude_forCapIdErrors_HE3->Write(); - h_Amplitude_forCapIdErrors_HF1->Write(); - h_Amplitude_forCapIdErrors_HF2->Write(); - h_Amplitude_forCapIdErrors_HO4->Write(); - - h_Amplitude_notCapIdErrors_HB1->Write(); - h_Amplitude_notCapIdErrors_HB2->Write(); - h_Amplitude_notCapIdErrors_HE1->Write(); - h_Amplitude_notCapIdErrors_HE2->Write(); - h_Amplitude_notCapIdErrors_HE3->Write(); - h_Amplitude_notCapIdErrors_HF1->Write(); - h_Amplitude_notCapIdErrors_HF2->Write(); - h_Amplitude_notCapIdErrors_HO4->Write(); - - h_averSIGNALoccupancy_HB->Write(); - h_averSIGNALoccupancy_HE->Write(); - h_averSIGNALoccupancy_HF->Write(); - h_averSIGNALoccupancy_HO->Write(); - - h_averSIGNALsumamplitude_HB->Write(); - h_averSIGNALsumamplitude_HE->Write(); - h_averSIGNALsumamplitude_HF->Write(); - h_averSIGNALsumamplitude_HO->Write(); - - h_averNOSIGNALoccupancy_HB->Write(); - h_averNOSIGNALoccupancy_HE->Write(); - h_averNOSIGNALoccupancy_HF->Write(); - h_averNOSIGNALoccupancy_HO->Write(); - - h_averNOSIGNALsumamplitude_HB->Write(); - h_averNOSIGNALsumamplitude_HE->Write(); - h_averNOSIGNALsumamplitude_HF->Write(); - h_averNOSIGNALsumamplitude_HO->Write(); - - h_maxxSUMAmpl_HB->Write(); - h_maxxSUMAmpl_HE->Write(); - h_maxxSUMAmpl_HF->Write(); - h_maxxSUMAmpl_HO->Write(); - - h_maxxOCCUP_HB->Write(); - h_maxxOCCUP_HE->Write(); - h_maxxOCCUP_HF->Write(); - h_maxxOCCUP_HO->Write(); - - h_sumamplitudechannel_HB->Write(); - h_sumamplitudechannel_HE->Write(); - h_sumamplitudechannel_HF->Write(); - h_sumamplitudechannel_HO->Write(); - - h_eventamplitude_HB->Write(); - h_eventamplitude_HE->Write(); - h_eventamplitude_HF->Write(); - h_eventamplitude_HO->Write(); - - h_eventoccupancy_HB->Write(); - h_eventoccupancy_HE->Write(); - h_eventoccupancy_HF->Write(); - h_eventoccupancy_HO->Write(); - - h_2DAtaildepth1_HB->Write(); - h_2D0Ataildepth1_HB->Write(); - h_2DAtaildepth2_HB->Write(); - h_2D0Ataildepth2_HB->Write(); - - h_mapenophinorm_HE1->Write(); - h_mapenophinorm_HE2->Write(); - h_mapenophinorm_HE3->Write(); - h_mapenophinorm_HE4->Write(); - h_mapenophinorm_HE5->Write(); - h_mapenophinorm_HE6->Write(); - h_mapenophinorm_HE7->Write(); - h_mapenophinorm2_HE1->Write(); - h_mapenophinorm2_HE2->Write(); - h_mapenophinorm2_HE3->Write(); - h_mapenophinorm2_HE4->Write(); - h_mapenophinorm2_HE5->Write(); - h_mapenophinorm2_HE6->Write(); - h_mapenophinorm2_HE7->Write(); - - h_maprphinorm_HE1->Write(); - h_maprphinorm_HE2->Write(); - h_maprphinorm_HE3->Write(); - h_maprphinorm_HE4->Write(); - h_maprphinorm_HE5->Write(); - h_maprphinorm_HE6->Write(); - h_maprphinorm_HE7->Write(); - h_maprphinorm2_HE1->Write(); - h_maprphinorm2_HE2->Write(); - h_maprphinorm2_HE3->Write(); - h_maprphinorm2_HE4->Write(); - h_maprphinorm2_HE5->Write(); - h_maprphinorm2_HE6->Write(); - h_maprphinorm2_HE7->Write(); - - h_maprphinorm0_HE1->Write(); - h_maprphinorm0_HE2->Write(); - h_maprphinorm0_HE3->Write(); - h_maprphinorm0_HE4->Write(); - h_maprphinorm0_HE5->Write(); - h_maprphinorm0_HE6->Write(); - h_maprphinorm0_HE7->Write(); - - //// phi-symmetry phy-symmetry: - h_energyhitSignal_HB->Write(); - h_energyhitSignal_HE->Write(); - h_energyhitSignal_HF->Write(); - h_energyhitNoise_HB->Write(); - h_energyhitNoise_HE->Write(); - h_energyhitNoise_HF->Write(); - //HB - h_recSignalEnergy0_HB1->Write(); - h_recSignalEnergy1_HB1->Write(); - h_recSignalEnergy2_HB1->Write(); - h_recSignalEnergy0_HB2->Write(); - h_recSignalEnergy1_HB2->Write(); - h_recSignalEnergy2_HB2->Write(); - h_recSignalEnergy0_HB3->Write(); - h_recSignalEnergy1_HB3->Write(); - h_recSignalEnergy2_HB3->Write(); - h_recSignalEnergy0_HB4->Write(); - h_recSignalEnergy1_HB4->Write(); - h_recSignalEnergy2_HB4->Write(); - - h_recNoiseEnergy0_HB1->Write(); - h_recNoiseEnergy1_HB1->Write(); - h_recNoiseEnergy2_HB1->Write(); - h_recNoiseEnergy0_HB2->Write(); - h_recNoiseEnergy1_HB2->Write(); - h_recNoiseEnergy2_HB2->Write(); - h_recNoiseEnergy0_HB3->Write(); - h_recNoiseEnergy1_HB3->Write(); - h_recNoiseEnergy2_HB3->Write(); - h_recNoiseEnergy0_HB4->Write(); - h_recNoiseEnergy1_HB4->Write(); - h_recNoiseEnergy2_HB4->Write(); - - //HE - h_recSignalEnergy0_HE1->Write(); - h_recSignalEnergy1_HE1->Write(); - h_recSignalEnergy2_HE1->Write(); - h_recSignalEnergy0_HE2->Write(); - h_recSignalEnergy1_HE2->Write(); - h_recSignalEnergy2_HE2->Write(); - h_recSignalEnergy0_HE3->Write(); - h_recSignalEnergy1_HE3->Write(); - h_recSignalEnergy2_HE3->Write(); - h_recSignalEnergy0_HE4->Write(); - h_recSignalEnergy1_HE4->Write(); - h_recSignalEnergy2_HE4->Write(); - h_recSignalEnergy0_HE5->Write(); - h_recSignalEnergy1_HE5->Write(); - h_recSignalEnergy2_HE5->Write(); - h_recSignalEnergy0_HE6->Write(); - h_recSignalEnergy1_HE6->Write(); - h_recSignalEnergy2_HE6->Write(); - h_recSignalEnergy0_HE7->Write(); - h_recSignalEnergy1_HE7->Write(); - h_recSignalEnergy2_HE7->Write(); - - h_recNoiseEnergy0_HE1->Write(); - h_recNoiseEnergy1_HE1->Write(); - h_recNoiseEnergy2_HE1->Write(); - h_recNoiseEnergy0_HE2->Write(); - h_recNoiseEnergy1_HE2->Write(); - h_recNoiseEnergy2_HE2->Write(); - h_recNoiseEnergy0_HE3->Write(); - h_recNoiseEnergy1_HE3->Write(); - h_recNoiseEnergy2_HE3->Write(); - h_recNoiseEnergy0_HE4->Write(); - h_recNoiseEnergy1_HE4->Write(); - h_recNoiseEnergy2_HE4->Write(); - h_recNoiseEnergy0_HE5->Write(); - h_recNoiseEnergy1_HE5->Write(); - h_recNoiseEnergy2_HE5->Write(); - h_recNoiseEnergy0_HE6->Write(); - h_recNoiseEnergy1_HE6->Write(); - h_recNoiseEnergy2_HE6->Write(); - h_recNoiseEnergy0_HE7->Write(); - h_recNoiseEnergy1_HE7->Write(); - h_recNoiseEnergy2_HE7->Write(); - - //HF - h_recSignalEnergy0_HF1->Write(); - h_recSignalEnergy1_HF1->Write(); - h_recSignalEnergy2_HF1->Write(); - h_recSignalEnergy0_HF2->Write(); - h_recSignalEnergy1_HF2->Write(); - h_recSignalEnergy2_HF2->Write(); - - h_recNoiseEnergy0_HF1->Write(); - h_recNoiseEnergy1_HF1->Write(); - h_recNoiseEnergy2_HF1->Write(); - h_recNoiseEnergy0_HF2->Write(); - h_recNoiseEnergy1_HF2->Write(); - h_recNoiseEnergy2_HF2->Write(); - - // Digi as Reco: - //HB: - h_amplitudechannel0_HB1->Write(); - h_amplitudechannel1_HB1->Write(); - h_amplitudechannel2_HB1->Write(); - h_amplitudechannel0_HB2->Write(); - h_amplitudechannel1_HB2->Write(); - h_amplitudechannel2_HB2->Write(); - h_amplitudechannel0_HB3->Write(); - h_amplitudechannel1_HB3->Write(); - h_amplitudechannel2_HB3->Write(); - h_amplitudechannel0_HB4->Write(); - h_amplitudechannel1_HB4->Write(); - h_amplitudechannel2_HB4->Write(); - - h_amplitudechannel0_HE1->Write(); - h_amplitudechannel1_HE1->Write(); - h_amplitudechannel2_HE1->Write(); - h_amplitudechannel0_HE2->Write(); - h_amplitudechannel1_HE2->Write(); - h_amplitudechannel2_HE2->Write(); - h_amplitudechannel0_HE3->Write(); - h_amplitudechannel1_HE3->Write(); - h_amplitudechannel2_HE3->Write(); - h_amplitudechannel0_HE4->Write(); - h_amplitudechannel1_HE4->Write(); - h_amplitudechannel2_HE4->Write(); - h_amplitudechannel0_HE5->Write(); - h_amplitudechannel1_HE5->Write(); - h_amplitudechannel2_HE5->Write(); - h_amplitudechannel0_HE6->Write(); - h_amplitudechannel1_HE6->Write(); - h_amplitudechannel2_HE6->Write(); - h_amplitudechannel0_HE7->Write(); - h_amplitudechannel1_HE7->Write(); - h_amplitudechannel2_HE7->Write(); - - h_amplitudechannel0_HF1->Write(); - h_amplitudechannel1_HF1->Write(); - h_amplitudechannel2_HF1->Write(); - h_amplitudechannel0_HF2->Write(); - h_amplitudechannel1_HF2->Write(); - h_amplitudechannel2_HF2->Write(); - h_amplitudechannel0_HF3->Write(); - h_amplitudechannel1_HF3->Write(); - h_amplitudechannel2_HF3->Write(); - h_amplitudechannel0_HF4->Write(); - h_amplitudechannel1_HF4->Write(); - h_amplitudechannel2_HF4->Write(); - - // RADDAM: - h_mapDepth1RADDAM_HE->Write(); - h_mapDepth2RADDAM_HE->Write(); - h_mapDepth3RADDAM_HE->Write(); - h_mapDepth1RADDAM0_HE->Write(); - h_mapDepth2RADDAM0_HE->Write(); - h_mapDepth3RADDAM0_HE->Write(); - h_AamplitudewithPedSubtr_RADDAM_HE->Write(); - h_AamplitudewithPedSubtr_RADDAM_HEzoom0->Write(); - h_AamplitudewithPedSubtr_RADDAM_HEzoom1->Write(); - h_A_Depth1RADDAM_HE->Write(); - h_A_Depth2RADDAM_HE->Write(); - h_A_Depth3RADDAM_HE->Write(); - h_sumphiEta16Depth3RADDAM_HED2->Write(); - h_Eta16Depth3RADDAM_HED2->Write(); - h_NphiForEta16Depth3RADDAM_HED2->Write(); - h_sumphiEta16Depth3RADDAM_HED2P->Write(); - h_Eta16Depth3RADDAM_HED2P->Write(); - h_NphiForEta16Depth3RADDAM_HED2P->Write(); - h_sumphiEta16Depth3RADDAM_HED2ALL->Write(); - h_Eta16Depth3RADDAM_HED2ALL->Write(); - h_NphiForEta16Depth3RADDAM_HED2ALL->Write(); - h_sigLayer1RADDAM_HE->Write(); - h_sigLayer2RADDAM_HE->Write(); - h_sigLayer1RADDAM0_HE->Write(); - h_sigLayer2RADDAM0_HE->Write(); - h_sigLayer1RADDAM5_HE->Write(); - h_sigLayer2RADDAM5_HE->Write(); - h_sigLayer1RADDAM6_HE->Write(); - h_sigLayer2RADDAM6_HE->Write(); - h_sigLayer1RADDAM5_HED2->Write(); - h_sigLayer1RADDAM6_HED2->Write(); - h_sigLayer2RADDAM5_HED2->Write(); - h_sigLayer2RADDAM6_HED2->Write(); - h_mapDepth3RADDAM16_HE->Write(); - - h_amplitudeaveragedbydepthes_HE->Write(); - h_ndepthesperamplitudebins_HE->Write(); - /////////////////////// - } //if - /////////////////////// - hOutputFile->Close(); - std::cout << "===== Finish writing user histograms and ntuple =====" << std::endl; - /////////////////////// } // // // -CMTRawAnalyzer::CMTRawAnalyzer(const edm::ParameterSet& iConfig) { +CMTRawAnalyzer::CMTRawAnalyzer(const edm::ParameterSet& iConfig) + : tokDB_(esConsumes()), + tokTopo_(edm::ESGetToken()) { + usesResource(TFileService::kSharedResource); verbosity = iConfig.getUntrackedParameter("Verbosity"); MAPcreation = iConfig.getUntrackedParameter("MapCreation"); recordNtuples_ = iConfig.getUntrackedParameter("recordNtuples"); @@ -3956,10 +2661,9 @@ CMTRawAnalyzer::CMTRawAnalyzer(const edm::ParameterSet& iConfig) { } CMTRawAnalyzer::~CMTRawAnalyzer() {} void CMTRawAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) { - iSetup.get().get(conditions); - iSetup.get().get(topo_); + conditions = &iSetup.getData(tokDB_); + topo = &iSetup.getData(tokTopo_); if (MAPcreation > 0) { - topo = &*topo_; if (flagupgradeqie1011_ == 1) fillMAP(); MAPcreation = 0; @@ -3981,18 +2685,19 @@ void CMTRawAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSetup& iS ++runcounter; if (runcounter != 1) { nevcounter00 = eventcounter; - cout << " --------------------------------------- " << endl; - cout << " for Run = " << run0 << " with runcounter = " << runcounter - 1 << " #ev = " << eventcounter << endl; - cout << " #LS = " << lscounterrun << " #LS10 = " << lscounterrun10 << " Last LS = " << ls0 << endl; - cout << " --------------------------------------------- " << endl; + std::cout << " --------------------------------------- " << std::endl; + std::cout << " for Run = " << run0 << " with runcounter = " << runcounter - 1 << " #ev = " << eventcounter + << std::endl; + std::cout << " #LS = " << lscounterrun << " #LS10 = " << lscounterrun10 << " Last LS = " << ls0 << std::endl; + std::cout << " --------------------------------------------- " << std::endl; h_nls_per_run->Fill(float(lscounterrun)); h_nls_per_run10->Fill(float(lscounterrun10)); lscounterrun = 0; lscounterrun10 = 0; } // runcounter > 1 - cout << " ---------***********************------------- " << endl; - cout << " New Run = " << Run << " runcounter = " << runcounter << endl; - cout << " ------- " << endl; + std::cout << " ---------***********************------------- " << std::endl; + std::cout << " New Run = " << Run << " runcounter = " << runcounter << std::endl; + std::cout << " ------- " << std::endl; run0 = Run; eventcounter = 0; ls0 = -1; @@ -5463,7 +4168,8 @@ void CMTRawAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSetup& iS gotHFDigis = false; } //if it is not there, leave it false if (!gotHFDigis) { - cout << " ****************************** =========================== No HFDigiCollection found " << endl; + std::cout << " ****************************** =========================== No HFDigiCollection found " + << std::endl; } else { //////////////////////////////////////////////////////////////////// qie8 QIE8 : for (HFDigiCollection::const_iterator digi = hf->begin(); digi != hf->end(); digi++) { @@ -5513,7 +4219,7 @@ void CMTRawAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSetup& iS gotQIE10Digis = false; } //if it is not there, leave it false if (!gotQIE10Digis) { - cout << " No QIE10DigiCollection collection is found " << endl; + std::cout << " No QIE10DigiCollection collection is found " << std::endl; } else { //////////////////////////////////////////////////////////////////// qie10 QIE10 : double totalAmplitudeHF = 0.; @@ -5584,7 +4290,7 @@ void CMTRawAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSetup& iS if (!(hbhe.isValid())) gotHBHEDigis = false; //if it is not there, leave it false if (!gotHBHEDigis) { - cout << " No HBHEDigiCollection collection is found " << endl; + std::cout << " No HBHEDigiCollection collection is found " << std::endl; } else { // unsigned int NHBHEDigiCollectionsize = hbhe->size(); double totalAmplitudeHB = 0.; @@ -5694,7 +4400,7 @@ void CMTRawAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSetup& iS if (!(heqie11.isValid())) gotQIE11Digis = false; //if it is not there, leave it false if (!gotQIE11Digis) { - cout << " No QIE11DigiCollection collection is found " << endl; + std::cout << " No QIE11DigiCollection collection is found " << std::endl; } else { //////////////////////////////////////////////////////////////////// qie11 QIE11 : double totalAmplitudeHBQIE11 = 0.; @@ -5818,7 +4524,7 @@ void CMTRawAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSetup& iS gotHODigis = false; //if it is not there, leave it false if (!gotHODigis) { // if(!ho.isValid()) { - cout << " No HO collection is found " << endl; + std::cout << " No HO collection is found " << std::endl; } else { int qwert6 = 0; double totalAmplitudeHO = 0.; @@ -5891,7 +4597,7 @@ void CMTRawAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSetup& iS gotHBHERecHitsNoise = false; //if it is not there, leave it false if (!gotHBHERecHitsNoise) { // if(!hbheNoise.isValid()) { - std::cout << " No RecHits HBHENoise collection is found " << endl; + std::cout << " No RecHits HBHENoise collection is found " << std::endl; } else { for (HBHERecHitCollection::const_iterator hbheItr = hbheNoise->begin(); hbheItr != hbheNoise->end(); hbheItr++) { @@ -5950,7 +4656,7 @@ void CMTRawAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSetup& iS gotHFRecHitsNoise = false; //if it is not there, leave it false if (!gotHFRecHitsNoise) { // if(!hfNoise.isValid()) { - std::cout << " No RecHits HFNoise collection is found " << endl; + std::cout << " No RecHits HFNoise collection is found " << std::endl; } else { for (HFRecHitCollection::const_iterator hfItr = hfNoise->begin(); hfItr != hfNoise->end(); hfItr++) { // Recalibration of energy @@ -6004,7 +4710,7 @@ void CMTRawAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSetup& iS gotHBHERecHitsSignal = false; //if it is not there, leave it false if (!gotHBHERecHitsSignal) { // if(!hbheSignal.isValid()) { - std::cout << " No RecHits HBHESignal collection is found " << endl; + std::cout << " No RecHits HBHESignal collection is found " << std::endl; } else { for (HBHERecHitCollection::const_iterator hbheItr = hbheSignal->begin(); hbheItr != hbheSignal->end(); hbheItr++) { @@ -6062,7 +4768,7 @@ void CMTRawAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSetup& iS gotHFRecHitsSignal = false; //if it is not there, leave it false if (!gotHFRecHitsSignal) { // if(!hfSignal.isValid()) { - std::cout << " No RecHits HFSignal collection is found " << endl; + std::cout << " No RecHits HFSignal collection is found " << std::endl; } else { for (HFRecHitCollection::const_iterator hfItr = hfSignal->begin(); hfItr != hfSignal->end(); hfItr++) { // Recalibration of energy @@ -6144,7 +4850,7 @@ void CMTRawAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSetup& iS if (verbosity == -9504) std::cout << "nsumoverphi= " << nsumoverphi << " sumoverphi= " << sumoverphi << " k1= " << k1 << " k2= " << k2 << " kkk= " << kkk << " k3= " << k3 - << " maprphinorm= " << maprphinorm[k0][k1][k2][k3] << endl; + << " maprphinorm= " << maprphinorm[k0][k1][k2][k3] << std::endl; if (k1 == 0) { h_mapenophinorm_HE1->Fill(double(kkk), double(k3), tocamplchannel[k0][k1][k2][k3]); h_mapenophinorm2_HE1->Fill( @@ -7360,8 +6066,8 @@ void CMTRawAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSetup& iS /////////////////////////////////////////////////// if (++local_event % 100 == 0) { if (verbosity == -22) - cout << "run " << Run << " processing events " << local_event << " ok, " - << ", lumi " << lumi << ", numOfLaserEv " << numOfLaserEv << endl; + std::cout << "run " << Run << " processing events " << local_event << " ok, " + << ", lumi " << lumi << ", numOfLaserEv " << numOfLaserEv << std::endl; } } // bcn @@ -7371,8 +6077,8 @@ void CMTRawAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSetup& iS // ------------ method called once each job just before starting event loop ----------- void CMTRawAnalyzer::beginJob() { if (verbosity > 0) - cout << "======================== beignJob START +++++++++++++++++++++++++++" << endl; - hOutputFile = new TFile(fOutputFileName.c_str(), "RECREATE"); + std::cout << "======================== beignJob START +++++++++++++++++++++++++++" << std::endl; + // hOutputFile = new TFile(fOutputFileName.c_str(), "RECREATE"); //////////////////////////////////////////////////////////////////////////////////////////////////////// nnnnnn = 0; nnnnnnhbhe = 0; @@ -7394,532 +6100,543 @@ void CMTRawAnalyzer::beginJob() { ////////////////////////////////////////////////////////////////////////////////// book histoes if (recordHistoes_) { - // ha2 = new TH2F("ha2"," ", neta, -41., 41., nphi, 0., bphi); - - h_errorGeneral = new TH1F("h_errorGeneral", " ", 5, 0., 5.); - h_error1 = new TH1F("h_error1", " ", 5, 0., 5.); - h_error2 = new TH1F("h_error2", " ", 5, 0., 5.); - h_error3 = new TH1F("h_error3", " ", 5, 0., 5.); - h_amplError = new TH1F("h_amplError", " ", 100, -2., 98.); - h_amplFine = new TH1F("h_amplFine", " ", 100, -2., 98.); - - h_errorGeneral_HB = new TH1F("h_errorGeneral_HB", " ", 5, 0., 5.); - h_error1_HB = new TH1F("h_error1_HB", " ", 5, 0., 5.); - h_error2_HB = new TH1F("h_error2_HB", " ", 5, 0., 5.); - h_error3_HB = new TH1F("h_error3_HB", " ", 5, 0., 5.); - h_error4_HB = new TH1F("h_error4_HB", " ", 5, 0., 5.); - h_error5_HB = new TH1F("h_error5_HB", " ", 5, 0., 5.); - h_error6_HB = new TH1F("h_error6_HB", " ", 5, 0., 5.); - h_error7_HB = new TH1F("h_error7_HB", " ", 5, 0., 5.); - h_amplError_HB = new TH1F("h_amplError_HB", " ", 100, -2., 98.); - h_amplFine_HB = new TH1F("h_amplFine_HB", " ", 100, -2., 98.); - h_mapDepth1Error_HB = new TH2F("h_mapDepth1Error_HB", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth2Error_HB = new TH2F("h_mapDepth2Error_HB", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth3Error_HB = new TH2F("h_mapDepth3Error_HB", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth4Error_HB = new TH2F("h_mapDepth4Error_HB", " ", neta, -41., 41., nphi, 0., bphi); - h_fiber0_HB = new TH1F("h_fiber0_HB", " ", 10, 0., 10.); - h_fiber1_HB = new TH1F("h_fiber1_HB", " ", 10, 0., 10.); - h_fiber2_HB = new TH1F("h_fiber2_HB", " ", 40, 0., 40.); - h_repetedcapid_HB = new TH1F("h_repetedcapid_HB", " ", 5, 0., 5.); - - h_errorGeneral_HE = new TH1F("h_errorGeneral_HE", " ", 5, 0., 5.); - h_error1_HE = new TH1F("h_error1_HE", " ", 5, 0., 5.); - h_error2_HE = new TH1F("h_error2_HE", " ", 5, 0., 5.); - h_error3_HE = new TH1F("h_error3_HE", " ", 5, 0., 5.); - h_error4_HE = new TH1F("h_error4_HE", " ", 5, 0., 5.); - h_error5_HE = new TH1F("h_error5_HE", " ", 5, 0., 5.); - h_error6_HE = new TH1F("h_error6_HE", " ", 5, 0., 5.); - h_error7_HE = new TH1F("h_error7_HE", " ", 5, 0., 5.); - h_amplError_HE = new TH1F("h_amplError_HE", " ", 100, -2., 98.); - h_amplFine_HE = new TH1F("h_amplFine_HE", " ", 100, -2., 98.); - h_mapDepth1Error_HE = new TH2F("h_mapDepth1Error_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth2Error_HE = new TH2F("h_mapDepth2Error_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth3Error_HE = new TH2F("h_mapDepth3Error_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth4Error_HE = new TH2F("h_mapDepth4Error_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth5Error_HE = new TH2F("h_mapDepth5Error_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth6Error_HE = new TH2F("h_mapDepth6Error_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth7Error_HE = new TH2F("h_mapDepth7Error_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_fiber0_HE = new TH1F("h_fiber0_HE", " ", 10, 0., 10.); - h_fiber1_HE = new TH1F("h_fiber1_HE", " ", 10, 0., 10.); - h_fiber2_HE = new TH1F("h_fiber2_HE", " ", 40, 0., 40.); - h_repetedcapid_HE = new TH1F("h_repetedcapid_HE", " ", 5, 0., 5.); - - h_errorGeneral_HF = new TH1F("h_errorGeneral_HF", " ", 5, 0., 5.); - h_error1_HF = new TH1F("h_error1_HF", " ", 5, 0., 5.); - h_error2_HF = new TH1F("h_error2_HF", " ", 5, 0., 5.); - h_error3_HF = new TH1F("h_error3_HF", " ", 5, 0., 5.); - h_error4_HF = new TH1F("h_error4_HF", " ", 5, 0., 5.); - h_error5_HF = new TH1F("h_error5_HF", " ", 5, 0., 5.); - h_error6_HF = new TH1F("h_error6_HF", " ", 5, 0., 5.); - h_error7_HF = new TH1F("h_error7_HF", " ", 5, 0., 5.); - h_amplError_HF = new TH1F("h_amplError_HF", " ", 100, -2., 98.); - h_amplFine_HF = new TH1F("h_amplFine_HF", " ", 100, -2., 98.); - h_mapDepth1Error_HF = new TH2F("h_mapDepth1Error_HF", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth2Error_HF = new TH2F("h_mapDepth2Error_HF", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth3Error_HF = new TH2F("h_mapDepth3Error_HF", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth4Error_HF = new TH2F("h_mapDepth4Error_HF", " ", neta, -41., 41., nphi, 0., bphi); - h_fiber0_HF = new TH1F("h_fiber0_HF", " ", 10, 0., 10.); - h_fiber1_HF = new TH1F("h_fiber1_HF", " ", 10, 0., 10.); - h_fiber2_HF = new TH1F("h_fiber2_HF", " ", 40, 0., 40.); - h_repetedcapid_HF = new TH1F("h_repetedcapid_HF", " ", 5, 0., 5.); - - h_errorGeneral_HO = new TH1F("h_errorGeneral_HO", " ", 5, 0., 5.); - h_error1_HO = new TH1F("h_error1_HO", " ", 5, 0., 5.); - h_error2_HO = new TH1F("h_error2_HO", " ", 5, 0., 5.); - h_error3_HO = new TH1F("h_error3_HO", " ", 5, 0., 5.); - h_error4_HO = new TH1F("h_error4_HO", " ", 5, 0., 5.); - h_error5_HO = new TH1F("h_error5_HO", " ", 5, 0., 5.); - h_error6_HO = new TH1F("h_error6_HO", " ", 5, 0., 5.); - h_error7_HO = new TH1F("h_error7_HO", " ", 5, 0., 5.); - h_amplError_HO = new TH1F("h_amplError_HO", " ", 100, -2., 98.); - h_amplFine_HO = new TH1F("h_amplFine_HO", " ", 100, -2., 98.); - h_mapDepth4Error_HO = new TH2F("h_mapDepth4Error_HO", " ", neta, -41., 41., nphi, 0., bphi); - h_fiber0_HO = new TH1F("h_fiber0_HO", " ", 10, 0., 10.); - h_fiber1_HO = new TH1F("h_fiber1_HO", " ", 10, 0., 10.); - h_fiber2_HO = new TH1F("h_fiber2_HO", " ", 40, 0., 40.); - h_repetedcapid_HO = new TH1F("h_repetedcapid_HO", " ", 5, 0., 5.); + // ha2 = fs_->make("ha2"," ", neta, -41., 41., nphi, 0., bphi); + + h_errorGeneral = fs_->make("h_errorGeneral", " ", 5, 0., 5.); + h_error1 = fs_->make("h_error1", " ", 5, 0., 5.); + h_error2 = fs_->make("h_error2", " ", 5, 0., 5.); + h_error3 = fs_->make("h_error3", " ", 5, 0., 5.); + h_amplError = fs_->make("h_amplError", " ", 100, -2., 98.); + h_amplFine = fs_->make("h_amplFine", " ", 100, -2., 98.); + + h_errorGeneral_HB = fs_->make("h_errorGeneral_HB", " ", 5, 0., 5.); + h_error1_HB = fs_->make("h_error1_HB", " ", 5, 0., 5.); + h_error2_HB = fs_->make("h_error2_HB", " ", 5, 0., 5.); + h_error3_HB = fs_->make("h_error3_HB", " ", 5, 0., 5.); + h_error4_HB = fs_->make("h_error4_HB", " ", 5, 0., 5.); + h_error5_HB = fs_->make("h_error5_HB", " ", 5, 0., 5.); + h_error6_HB = fs_->make("h_error6_HB", " ", 5, 0., 5.); + h_error7_HB = fs_->make("h_error7_HB", " ", 5, 0., 5.); + h_amplError_HB = fs_->make("h_amplError_HB", " ", 100, -2., 98.); + h_amplFine_HB = fs_->make("h_amplFine_HB", " ", 100, -2., 98.); + h_mapDepth1Error_HB = fs_->make("h_mapDepth1Error_HB", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth2Error_HB = fs_->make("h_mapDepth2Error_HB", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth3Error_HB = fs_->make("h_mapDepth3Error_HB", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth4Error_HB = fs_->make("h_mapDepth4Error_HB", " ", neta, -41., 41., nphi, 0., bphi); + h_fiber0_HB = fs_->make("h_fiber0_HB", " ", 10, 0., 10.); + h_fiber1_HB = fs_->make("h_fiber1_HB", " ", 10, 0., 10.); + h_fiber2_HB = fs_->make("h_fiber2_HB", " ", 40, 0., 40.); + h_repetedcapid_HB = fs_->make("h_repetedcapid_HB", " ", 5, 0., 5.); + + h_errorGeneral_HE = fs_->make("h_errorGeneral_HE", " ", 5, 0., 5.); + h_error1_HE = fs_->make("h_error1_HE", " ", 5, 0., 5.); + h_error2_HE = fs_->make("h_error2_HE", " ", 5, 0., 5.); + h_error3_HE = fs_->make("h_error3_HE", " ", 5, 0., 5.); + h_error4_HE = fs_->make("h_error4_HE", " ", 5, 0., 5.); + h_error5_HE = fs_->make("h_error5_HE", " ", 5, 0., 5.); + h_error6_HE = fs_->make("h_error6_HE", " ", 5, 0., 5.); + h_error7_HE = fs_->make("h_error7_HE", " ", 5, 0., 5.); + h_amplError_HE = fs_->make("h_amplError_HE", " ", 100, -2., 98.); + h_amplFine_HE = fs_->make("h_amplFine_HE", " ", 100, -2., 98.); + h_mapDepth1Error_HE = fs_->make("h_mapDepth1Error_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth2Error_HE = fs_->make("h_mapDepth2Error_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth3Error_HE = fs_->make("h_mapDepth3Error_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth4Error_HE = fs_->make("h_mapDepth4Error_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth5Error_HE = fs_->make("h_mapDepth5Error_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth6Error_HE = fs_->make("h_mapDepth6Error_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth7Error_HE = fs_->make("h_mapDepth7Error_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_fiber0_HE = fs_->make("h_fiber0_HE", " ", 10, 0., 10.); + h_fiber1_HE = fs_->make("h_fiber1_HE", " ", 10, 0., 10.); + h_fiber2_HE = fs_->make("h_fiber2_HE", " ", 40, 0., 40.); + h_repetedcapid_HE = fs_->make("h_repetedcapid_HE", " ", 5, 0., 5.); + + h_errorGeneral_HF = fs_->make("h_errorGeneral_HF", " ", 5, 0., 5.); + h_error1_HF = fs_->make("h_error1_HF", " ", 5, 0., 5.); + h_error2_HF = fs_->make("h_error2_HF", " ", 5, 0., 5.); + h_error3_HF = fs_->make("h_error3_HF", " ", 5, 0., 5.); + h_error4_HF = fs_->make("h_error4_HF", " ", 5, 0., 5.); + h_error5_HF = fs_->make("h_error5_HF", " ", 5, 0., 5.); + h_error6_HF = fs_->make("h_error6_HF", " ", 5, 0., 5.); + h_error7_HF = fs_->make("h_error7_HF", " ", 5, 0., 5.); + h_amplError_HF = fs_->make("h_amplError_HF", " ", 100, -2., 98.); + h_amplFine_HF = fs_->make("h_amplFine_HF", " ", 100, -2., 98.); + h_mapDepth1Error_HF = fs_->make("h_mapDepth1Error_HF", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth2Error_HF = fs_->make("h_mapDepth2Error_HF", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth3Error_HF = fs_->make("h_mapDepth3Error_HF", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth4Error_HF = fs_->make("h_mapDepth4Error_HF", " ", neta, -41., 41., nphi, 0., bphi); + h_fiber0_HF = fs_->make("h_fiber0_HF", " ", 10, 0., 10.); + h_fiber1_HF = fs_->make("h_fiber1_HF", " ", 10, 0., 10.); + h_fiber2_HF = fs_->make("h_fiber2_HF", " ", 40, 0., 40.); + h_repetedcapid_HF = fs_->make("h_repetedcapid_HF", " ", 5, 0., 5.); + + h_errorGeneral_HO = fs_->make("h_errorGeneral_HO", " ", 5, 0., 5.); + h_error1_HO = fs_->make("h_error1_HO", " ", 5, 0., 5.); + h_error2_HO = fs_->make("h_error2_HO", " ", 5, 0., 5.); + h_error3_HO = fs_->make("h_error3_HO", " ", 5, 0., 5.); + h_error4_HO = fs_->make("h_error4_HO", " ", 5, 0., 5.); + h_error5_HO = fs_->make("h_error5_HO", " ", 5, 0., 5.); + h_error6_HO = fs_->make("h_error6_HO", " ", 5, 0., 5.); + h_error7_HO = fs_->make("h_error7_HO", " ", 5, 0., 5.); + h_amplError_HO = fs_->make("h_amplError_HO", " ", 100, -2., 98.); + h_amplFine_HO = fs_->make("h_amplFine_HO", " ", 100, -2., 98.); + h_mapDepth4Error_HO = fs_->make("h_mapDepth4Error_HO", " ", neta, -41., 41., nphi, 0., bphi); + h_fiber0_HO = fs_->make("h_fiber0_HO", " ", 10, 0., 10.); + h_fiber1_HO = fs_->make("h_fiber1_HO", " ", 10, 0., 10.); + h_fiber2_HO = fs_->make("h_fiber2_HO", " ", 40, 0., 40.); + h_repetedcapid_HO = fs_->make("h_repetedcapid_HO", " ", 5, 0., 5.); ///////////////////////////////////////////////////////////////////////////////////////////////// HB - h_numberofhitsHBtest = new TH1F("h_numberofhitsHBtest", " ", 100, 0., 100.); - h_AmplitudeHBtest = new TH1F("h_AmplitudeHBtest", " ", 100, 0., 10000.); - h_AmplitudeHBtest1 = new TH1F("h_AmplitudeHBtest1", " ", 100, 0., 1000000.); - h_AmplitudeHBtest6 = new TH1F("h_AmplitudeHBtest6", " ", 100, 0., 2000000.); - h_totalAmplitudeHB = new TH1F("h_totalAmplitudeHB", " ", 100, 0., 3000000.); - h_totalAmplitudeHBperEvent = new TH1F("h_totalAmplitudeHBperEvent", " ", 1000, 1., 1001.); + h_numberofhitsHBtest = fs_->make("h_numberofhitsHBtest", " ", 100, 0., 100.); + h_AmplitudeHBtest = fs_->make("h_AmplitudeHBtest", " ", 100, 0., 10000.); + h_AmplitudeHBtest1 = fs_->make("h_AmplitudeHBtest1", " ", 100, 0., 1000000.); + h_AmplitudeHBtest6 = fs_->make("h_AmplitudeHBtest6", " ", 100, 0., 2000000.); + h_totalAmplitudeHB = fs_->make("h_totalAmplitudeHB", " ", 100, 0., 3000000.); + h_totalAmplitudeHBperEvent = fs_->make("h_totalAmplitudeHBperEvent", " ", 1000, 1., 1001.); // fullAmplitude: - h_ADCAmpl345Zoom_HB = new TH1F("h_ADCAmpl345Zoom_HB", " ", 100, 0., 400.); - h_ADCAmpl345Zoom1_HB = new TH1F("h_ADCAmpl345Zoom1_HB", " ", 100, 0., 100.); - h_ADCAmpl345_HB = new TH1F("h_ADCAmpl345_HB", " ", 100, 10., 3000.); - - h_AmplitudeHBrest = new TH1F("h_AmplitudeHBrest", " ", 100, 0., 10000.); - h_AmplitudeHBrest1 = new TH1F("h_AmplitudeHBrest1", " ", 100, 0., 1000000.); - h_AmplitudeHBrest6 = new TH1F("h_AmplitudeHBrest6", " ", 100, 0., 2000000.); - - h_ADCAmpl345_HBCapIdError = new TH1F("h_ADCAmpl345_HBCapIdError", " ", 100, 10., 3000.); - h_ADCAmpl345_HBCapIdNoError = new TH1F("h_ADCAmpl345_HBCapIdNoError", " ", 100, 10., 3000.); - h_ADCAmpl_HBCapIdError = new TH1F("h_ADCAmpl_HBCapIdError", " ", 100, 10., 3000.); - h_ADCAmpl_HBCapIdNoError = new TH1F("h_ADCAmpl_HBCapIdNoError", " ", 100, 10., 3000.); - - h_ADCAmplZoom_HB = new TH1F("h_ADCAmplZoom_HB", " ", 100, 0., 400.); - h_ADCAmplZoom1_HB = new TH1F("h_ADCAmplZoom1_HB", " ", 100, -20., 80.); - h_ADCAmpl_HB = new TH1F("h_ADCAmpl_HB", " ", 100, 10., 5000.); - h_mapDepth1ADCAmpl225_HB = new TH2F("h_mapDepth1ADCAmpl225_HB", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth2ADCAmpl225_HB = new TH2F("h_mapDepth2ADCAmpl225_HB", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth3ADCAmpl225_HB = new TH2F("h_mapDepth3ADCAmpl225_HB", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth4ADCAmpl225_HB = new TH2F("h_mapDepth4ADCAmpl225_HB", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth1ADCAmpl225Copy_HB = new TH2F("h_mapDepth1ADCAmpl225Copy_HB", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth2ADCAmpl225Copy_HB = new TH2F("h_mapDepth2ADCAmpl225Copy_HB", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth3ADCAmpl225Copy_HB = new TH2F("h_mapDepth3ADCAmpl225Copy_HB", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth4ADCAmpl225Copy_HB = new TH2F("h_mapDepth4ADCAmpl225Copy_HB", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth1ADCAmpl_HB = new TH2F("h_mapDepth1ADCAmpl_HB", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth2ADCAmpl_HB = new TH2F("h_mapDepth2ADCAmpl_HB", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth3ADCAmpl_HB = new TH2F("h_mapDepth3ADCAmpl_HB", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth4ADCAmpl_HB = new TH2F("h_mapDepth4ADCAmpl_HB", " ", neta, -41., 41., nphi, 0., bphi); - h_TSmeanA_HB = new TH1F("h_TSmeanA_HB", " ", 100, -1., 11.); - h_mapDepth1TSmeanA225_HB = new TH2F("h_mapDepth1TSmeanA225_HB", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth2TSmeanA225_HB = new TH2F("h_mapDepth2TSmeanA225_HB", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth3TSmeanA225_HB = new TH2F("h_mapDepth3TSmeanA225_HB", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth4TSmeanA225_HB = new TH2F("h_mapDepth4TSmeanA225_HB", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth1TSmeanA_HB = new TH2F("h_mapDepth1TSmeanA_HB", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth2TSmeanA_HB = new TH2F("h_mapDepth2TSmeanA_HB", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth3TSmeanA_HB = new TH2F("h_mapDepth3TSmeanA_HB", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth4TSmeanA_HB = new TH2F("h_mapDepth4TSmeanA_HB", " ", neta, -41., 41., nphi, 0., bphi); - h_TSmaxA_HB = new TH1F("h_TSmaxA_HB", " ", 100, -1., 11.); - h_mapDepth1TSmaxA225_HB = new TH2F("h_mapDepth1TSmaxA225_HB", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth2TSmaxA225_HB = new TH2F("h_mapDepth2TSmaxA225_HB", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth3TSmaxA225_HB = new TH2F("h_mapDepth3TSmaxA225_HB", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth4TSmaxA225_HB = new TH2F("h_mapDepth4TSmaxA225_HB", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth1TSmaxA_HB = new TH2F("h_mapDepth1TSmaxA_HB", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth2TSmaxA_HB = new TH2F("h_mapDepth2TSmaxA_HB", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth3TSmaxA_HB = new TH2F("h_mapDepth3TSmaxA_HB", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth4TSmaxA_HB = new TH2F("h_mapDepth4TSmaxA_HB", " ", neta, -41., 41., nphi, 0., bphi); + h_ADCAmpl345Zoom_HB = fs_->make("h_ADCAmpl345Zoom_HB", " ", 100, 0., 400.); + h_ADCAmpl345Zoom1_HB = fs_->make("h_ADCAmpl345Zoom1_HB", " ", 100, 0., 100.); + h_ADCAmpl345_HB = fs_->make("h_ADCAmpl345_HB", " ", 100, 10., 3000.); + + h_AmplitudeHBrest = fs_->make("h_AmplitudeHBrest", " ", 100, 0., 10000.); + h_AmplitudeHBrest1 = fs_->make("h_AmplitudeHBrest1", " ", 100, 0., 1000000.); + h_AmplitudeHBrest6 = fs_->make("h_AmplitudeHBrest6", " ", 100, 0., 2000000.); + + h_ADCAmpl345_HBCapIdError = fs_->make("h_ADCAmpl345_HBCapIdError", " ", 100, 10., 3000.); + h_ADCAmpl345_HBCapIdNoError = fs_->make("h_ADCAmpl345_HBCapIdNoError", " ", 100, 10., 3000.); + h_ADCAmpl_HBCapIdError = fs_->make("h_ADCAmpl_HBCapIdError", " ", 100, 10., 3000.); + h_ADCAmpl_HBCapIdNoError = fs_->make("h_ADCAmpl_HBCapIdNoError", " ", 100, 10., 3000.); + + h_ADCAmplZoom_HB = fs_->make("h_ADCAmplZoom_HB", " ", 100, 0., 400.); + h_ADCAmplZoom1_HB = fs_->make("h_ADCAmplZoom1_HB", " ", 100, -20., 80.); + h_ADCAmpl_HB = fs_->make("h_ADCAmpl_HB", " ", 100, 10., 5000.); + h_mapDepth1ADCAmpl225_HB = fs_->make("h_mapDepth1ADCAmpl225_HB", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth2ADCAmpl225_HB = fs_->make("h_mapDepth2ADCAmpl225_HB", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth3ADCAmpl225_HB = fs_->make("h_mapDepth3ADCAmpl225_HB", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth4ADCAmpl225_HB = fs_->make("h_mapDepth4ADCAmpl225_HB", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth1ADCAmpl225Copy_HB = + fs_->make("h_mapDepth1ADCAmpl225Copy_HB", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth2ADCAmpl225Copy_HB = + fs_->make("h_mapDepth2ADCAmpl225Copy_HB", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth3ADCAmpl225Copy_HB = + fs_->make("h_mapDepth3ADCAmpl225Copy_HB", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth4ADCAmpl225Copy_HB = + fs_->make("h_mapDepth4ADCAmpl225Copy_HB", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth1ADCAmpl_HB = fs_->make("h_mapDepth1ADCAmpl_HB", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth2ADCAmpl_HB = fs_->make("h_mapDepth2ADCAmpl_HB", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth3ADCAmpl_HB = fs_->make("h_mapDepth3ADCAmpl_HB", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth4ADCAmpl_HB = fs_->make("h_mapDepth4ADCAmpl_HB", " ", neta, -41., 41., nphi, 0., bphi); + h_TSmeanA_HB = fs_->make("h_TSmeanA_HB", " ", 100, -1., 11.); + h_mapDepth1TSmeanA225_HB = fs_->make("h_mapDepth1TSmeanA225_HB", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth2TSmeanA225_HB = fs_->make("h_mapDepth2TSmeanA225_HB", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth3TSmeanA225_HB = fs_->make("h_mapDepth3TSmeanA225_HB", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth4TSmeanA225_HB = fs_->make("h_mapDepth4TSmeanA225_HB", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth1TSmeanA_HB = fs_->make("h_mapDepth1TSmeanA_HB", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth2TSmeanA_HB = fs_->make("h_mapDepth2TSmeanA_HB", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth3TSmeanA_HB = fs_->make("h_mapDepth3TSmeanA_HB", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth4TSmeanA_HB = fs_->make("h_mapDepth4TSmeanA_HB", " ", neta, -41., 41., nphi, 0., bphi); + h_TSmaxA_HB = fs_->make("h_TSmaxA_HB", " ", 100, -1., 11.); + h_mapDepth1TSmaxA225_HB = fs_->make("h_mapDepth1TSmaxA225_HB", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth2TSmaxA225_HB = fs_->make("h_mapDepth2TSmaxA225_HB", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth3TSmaxA225_HB = fs_->make("h_mapDepth3TSmaxA225_HB", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth4TSmaxA225_HB = fs_->make("h_mapDepth4TSmaxA225_HB", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth1TSmaxA_HB = fs_->make("h_mapDepth1TSmaxA_HB", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth2TSmaxA_HB = fs_->make("h_mapDepth2TSmaxA_HB", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth3TSmaxA_HB = fs_->make("h_mapDepth3TSmaxA_HB", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth4TSmaxA_HB = fs_->make("h_mapDepth4TSmaxA_HB", " ", neta, -41., 41., nphi, 0., bphi); // RMS: - h_Amplitude_HB = new TH1F("h_Amplitude_HB", " ", 100, 0., 5.); - h_mapDepth1Amplitude225_HB = new TH2F("h_mapDepth1Amplitude225_HB", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth2Amplitude225_HB = new TH2F("h_mapDepth2Amplitude225_HB", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth3Amplitude225_HB = new TH2F("h_mapDepth3Amplitude225_HB", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth4Amplitude225_HB = new TH2F("h_mapDepth4Amplitude225_HB", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth1Amplitude_HB = new TH2F("h_mapDepth1Amplitude_HB", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth2Amplitude_HB = new TH2F("h_mapDepth2Amplitude_HB", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth3Amplitude_HB = new TH2F("h_mapDepth3Amplitude_HB", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth4Amplitude_HB = new TH2F("h_mapDepth4Amplitude_HB", " ", neta, -41., 41., nphi, 0., bphi); + h_Amplitude_HB = fs_->make("h_Amplitude_HB", " ", 100, 0., 5.); + h_mapDepth1Amplitude225_HB = fs_->make("h_mapDepth1Amplitude225_HB", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth2Amplitude225_HB = fs_->make("h_mapDepth2Amplitude225_HB", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth3Amplitude225_HB = fs_->make("h_mapDepth3Amplitude225_HB", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth4Amplitude225_HB = fs_->make("h_mapDepth4Amplitude225_HB", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth1Amplitude_HB = fs_->make("h_mapDepth1Amplitude_HB", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth2Amplitude_HB = fs_->make("h_mapDepth2Amplitude_HB", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth3Amplitude_HB = fs_->make("h_mapDepth3Amplitude_HB", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth4Amplitude_HB = fs_->make("h_mapDepth4Amplitude_HB", " ", neta, -41., 41., nphi, 0., bphi); // Ratio: - h_Ampl_HB = new TH1F("h_Ampl_HB", " ", 100, 0., 1.1); - h_mapDepth1Ampl047_HB = new TH2F("h_mapDepth1Ampl047_HB", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth2Ampl047_HB = new TH2F("h_mapDepth2Ampl047_HB", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth3Ampl047_HB = new TH2F("h_mapDepth3Ampl047_HB", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth4Ampl047_HB = new TH2F("h_mapDepth4Ampl047_HB", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth1Ampl_HB = new TH2F("h_mapDepth1Ampl_HB", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth2Ampl_HB = new TH2F("h_mapDepth2Ampl_HB", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth3Ampl_HB = new TH2F("h_mapDepth3Ampl_HB", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth4Ampl_HB = new TH2F("h_mapDepth4Ampl_HB", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth1AmplE34_HB = new TH2F("h_mapDepth1AmplE34_HB", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth2AmplE34_HB = new TH2F("h_mapDepth2AmplE34_HB", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth3AmplE34_HB = new TH2F("h_mapDepth3AmplE34_HB", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth4AmplE34_HB = new TH2F("h_mapDepth4AmplE34_HB", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth1_HB = new TH2F("h_mapDepth1_HB", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth2_HB = new TH2F("h_mapDepth2_HB", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth3_HB = new TH2F("h_mapDepth3_HB", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth4_HB = new TH2F("h_mapDepth4_HB", " ", neta, -41., 41., nphi, 0., bphi); + h_Ampl_HB = fs_->make("h_Ampl_HB", " ", 100, 0., 1.1); + h_mapDepth1Ampl047_HB = fs_->make("h_mapDepth1Ampl047_HB", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth2Ampl047_HB = fs_->make("h_mapDepth2Ampl047_HB", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth3Ampl047_HB = fs_->make("h_mapDepth3Ampl047_HB", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth4Ampl047_HB = fs_->make("h_mapDepth4Ampl047_HB", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth1Ampl_HB = fs_->make("h_mapDepth1Ampl_HB", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth2Ampl_HB = fs_->make("h_mapDepth2Ampl_HB", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth3Ampl_HB = fs_->make("h_mapDepth3Ampl_HB", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth4Ampl_HB = fs_->make("h_mapDepth4Ampl_HB", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth1AmplE34_HB = fs_->make("h_mapDepth1AmplE34_HB", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth2AmplE34_HB = fs_->make("h_mapDepth2AmplE34_HB", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth3AmplE34_HB = fs_->make("h_mapDepth3AmplE34_HB", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth4AmplE34_HB = fs_->make("h_mapDepth4AmplE34_HB", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth1_HB = fs_->make("h_mapDepth1_HB", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth2_HB = fs_->make("h_mapDepth2_HB", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth3_HB = fs_->make("h_mapDepth3_HB", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth4_HB = fs_->make("h_mapDepth4_HB", " ", neta, -41., 41., nphi, 0., bphi); ////////////////////////////////////////////////////////////////////////////////////////////// HE // stuff regarding summed(total) Amplitude vs iEvent (histo-name is h_totalAmplitudeHEperEvent) // to see from which event ALL channels are available(related to quality of the run) - h_numberofhitsHEtest = new TH1F("h_numberofhitsHEtest", " ", 100, 0., 10000.); - h_AmplitudeHEtest = new TH1F("h_AmplitudeHEtest", " ", 100, 0., 1000000.); - h_AmplitudeHEtest1 = new TH1F("h_AmplitudeHEtest1", " ", 100, 0., 1000000.); - h_AmplitudeHEtest6 = new TH1F("h_AmplitudeHEtest6", " ", 100, 0., 2000000.); - h_totalAmplitudeHE = new TH1F("h_totalAmplitudeHE", " ", 100, 0., 10000000000.); - h_totalAmplitudeHEperEvent = new TH1F("h_totalAmplitudeHEperEvent", " ", 1000, 1., 1001.); + h_numberofhitsHEtest = fs_->make("h_numberofhitsHEtest", " ", 100, 0., 10000.); + h_AmplitudeHEtest = fs_->make("h_AmplitudeHEtest", " ", 100, 0., 1000000.); + h_AmplitudeHEtest1 = fs_->make("h_AmplitudeHEtest1", " ", 100, 0., 1000000.); + h_AmplitudeHEtest6 = fs_->make("h_AmplitudeHEtest6", " ", 100, 0., 2000000.); + h_totalAmplitudeHE = fs_->make("h_totalAmplitudeHE", " ", 100, 0., 10000000000.); + h_totalAmplitudeHEperEvent = fs_->make("h_totalAmplitudeHEperEvent", " ", 1000, 1., 1001.); // Aijk Amplitude: - h_ADCAmplZoom1_HE = new TH1F("h_ADCAmplZoom1_HE", " ", npfit, 0., anpfit); // for amplmaxts 1TS w/ max - h_ADCAmpl345Zoom1_HE = new TH1F("h_ADCAmpl345Zoom1_HE", " ", npfit, 0., anpfit); // for ampl3ts 3TSs - h_ADCAmpl345Zoom_HE = new TH1F("h_ADCAmpl345Zoom_HE", " ", npfit, 0., anpfit); // for ampl 4TSs + h_ADCAmplZoom1_HE = fs_->make("h_ADCAmplZoom1_HE", " ", npfit, 0., anpfit); // for amplmaxts 1TS w/ max + h_ADCAmpl345Zoom1_HE = fs_->make("h_ADCAmpl345Zoom1_HE", " ", npfit, 0., anpfit); // for ampl3ts 3TSs + h_ADCAmpl345Zoom_HE = fs_->make("h_ADCAmpl345Zoom_HE", " ", npfit, 0., anpfit); // for ampl 4TSs h_amplitudeaveragedbydepthes_HE = - new TH1F("h_amplitudeaveragedbydepthes_HE", " ", npfit, 0., anpfit); // for cross-check: A spectrum + fs_->make("h_amplitudeaveragedbydepthes_HE", " ", npfit, 0., anpfit); // for cross-check: A spectrum h_ndepthesperamplitudebins_HE = - new TH1F("h_ndepthesperamplitudebins_HE", " ", 10, 0., 10.); // for cross-check: ndepthes + fs_->make("h_ndepthesperamplitudebins_HE", " ", 10, 0., 10.); // for cross-check: ndepthes // Ampl12 4TSs to work with "ped-Gsel0" or "led-low-intensity" to clarify gain diff peak2-peak1 h_mapADCAmplfirstpeak_HE = - new TH2F("h_mapADCAmplfirstpeak_HE", " ", neta, -41., 41., nphi, 0., bphi); // for amplmaxts 1TS w/ max + fs_->make("h_mapADCAmplfirstpeak_HE", " ", neta, -41., 41., nphi, 0., bphi); // for amplmaxts 1TS w/ max h_mapADCAmplfirstpeak0_HE = - new TH2F("h_mapADCAmplfirstpeak0_HE", " ", neta, -41., 41., nphi, 0., bphi); // for amplmaxts 1TS w/ max + fs_->make("h_mapADCAmplfirstpeak0_HE", " ", neta, -41., 41., nphi, 0., bphi); // for amplmaxts 1TS w/ max h_mapADCAmplsecondpeak_HE = - new TH2F("h_mapADCAmplsecondpeak_HE", " ", neta, -41., 41., nphi, 0., bphi); // for amplmaxts 1TS w/ max - h_mapADCAmplsecondpeak0_HE = - new TH2F("h_mapADCAmplsecondpeak0_HE", " ", neta, -41., 41., nphi, 0., bphi); // for amplmaxts 1TS w/ max + fs_->make("h_mapADCAmplsecondpeak_HE", " ", neta, -41., 41., nphi, 0., bphi); // for amplmaxts 1TS w/ max + h_mapADCAmplsecondpeak0_HE = fs_->make( + "h_mapADCAmplsecondpeak0_HE", " ", neta, -41., 41., nphi, 0., bphi); // for amplmaxts 1TS w/ max h_mapADCAmpl11firstpeak_HE = - new TH2F("h_mapADCAmpl11firstpeak_HE", " ", neta, -41., 41., nphi, 0., bphi); // for ampl3ts 3TSs + fs_->make("h_mapADCAmpl11firstpeak_HE", " ", neta, -41., 41., nphi, 0., bphi); // for ampl3ts 3TSs h_mapADCAmpl11firstpeak0_HE = - new TH2F("h_mapADCAmpl11firstpeak0_HE", " ", neta, -41., 41., nphi, 0., bphi); // for ampl3ts 3TSs + fs_->make("h_mapADCAmpl11firstpeak0_HE", " ", neta, -41., 41., nphi, 0., bphi); // for ampl3ts 3TSs h_mapADCAmpl11secondpeak_HE = - new TH2F("h_mapADCAmpl11secondpeak_HE", " ", neta, -41., 41., nphi, 0., bphi); // for ampl3ts 3TSs + fs_->make("h_mapADCAmpl11secondpeak_HE", " ", neta, -41., 41., nphi, 0., bphi); // for ampl3ts 3TSs h_mapADCAmpl11secondpeak0_HE = - new TH2F("h_mapADCAmpl11secondpeak0_HE", " ", neta, -41., 41., nphi, 0., bphi); // for ampl3ts 3TSs + fs_->make("h_mapADCAmpl11secondpeak0_HE", " ", neta, -41., 41., nphi, 0., bphi); // for ampl3ts 3TSs h_mapADCAmpl12firstpeak_HE = - new TH2F("h_mapADCAmpl12firstpeak_HE", " ", neta, -41., 41., nphi, 0., bphi); // for ampl 4TSs + fs_->make("h_mapADCAmpl12firstpeak_HE", " ", neta, -41., 41., nphi, 0., bphi); // for ampl 4TSs h_mapADCAmpl12firstpeak0_HE = - new TH2F("h_mapADCAmpl12firstpeak0_HE", " ", neta, -41., 41., nphi, 0., bphi); // for ampl 4TSs + fs_->make("h_mapADCAmpl12firstpeak0_HE", " ", neta, -41., 41., nphi, 0., bphi); // for ampl 4TSs h_mapADCAmpl12secondpeak_HE = - new TH2F("h_mapADCAmpl12secondpeak_HE", " ", neta, -41., 41., nphi, 0., bphi); // for ampl 4TSs + fs_->make("h_mapADCAmpl12secondpeak_HE", " ", neta, -41., 41., nphi, 0., bphi); // for ampl 4TSs h_mapADCAmpl12secondpeak0_HE = - new TH2F("h_mapADCAmpl12secondpeak0_HE", " ", neta, -41., 41., nphi, 0., bphi); // for ampl 4TSs + fs_->make("h_mapADCAmpl12secondpeak0_HE", " ", neta, -41., 41., nphi, 0., bphi); // for ampl 4TSs // Ampl12 4TSs to work with "ped-Gsel0" or "led-low-intensity" to clarify gain diff peak2-peak1 fit results: - h_gsmdifferencefit1_HE = new TH1F("h_gsmdifferencefit1_HE", " ", 80, 20., 60.); - h_gsmdifferencefit2_HE = new TH1F("h_gsmdifferencefit2_HE", " ", 80, 20., 60.); - h_gsmdifferencefit3_HE = new TH1F("h_gsmdifferencefit3_HE", " ", 80, 20., 60.); - h_gsmdifferencefit4_HE = new TH1F("h_gsmdifferencefit4_HE", " ", 80, 20., 60.); - h_gsmdifferencefit5_HE = new TH1F("h_gsmdifferencefit5_HE", " ", 80, 20., 60.); - h_gsmdifferencefit6_HE = new TH1F("h_gsmdifferencefit6_HE", " ", 80, 20., 60.); + h_gsmdifferencefit1_HE = fs_->make("h_gsmdifferencefit1_HE", " ", 80, 20., 60.); + h_gsmdifferencefit2_HE = fs_->make("h_gsmdifferencefit2_HE", " ", 80, 20., 60.); + h_gsmdifferencefit3_HE = fs_->make("h_gsmdifferencefit3_HE", " ", 80, 20., 60.); + h_gsmdifferencefit4_HE = fs_->make("h_gsmdifferencefit4_HE", " ", 80, 20., 60.); + h_gsmdifferencefit5_HE = fs_->make("h_gsmdifferencefit5_HE", " ", 80, 20., 60.); + h_gsmdifferencefit6_HE = fs_->make("h_gsmdifferencefit6_HE", " ", 80, 20., 60.); // Aijk Amplitude: - h_ADCAmpl_HE = new TH1F("h_ADCAmpl_HE", " ", 200, 0., 2000000.); - h_ADCAmplrest_HE = new TH1F("h_ADCAmplrest_HE", " ", 100, 0., 500.); - h_ADCAmplrest1_HE = new TH1F("h_ADCAmplrest1_HE", " ", 100, 0., 100.); - h_ADCAmplrest6_HE = new TH1F("h_ADCAmplrest6_HE", " ", 100, 0., 10000.); + h_ADCAmpl_HE = fs_->make("h_ADCAmpl_HE", " ", 200, 0., 2000000.); + h_ADCAmplrest_HE = fs_->make("h_ADCAmplrest_HE", " ", 100, 0., 500.); + h_ADCAmplrest1_HE = fs_->make("h_ADCAmplrest1_HE", " ", 100, 0., 100.); + h_ADCAmplrest6_HE = fs_->make("h_ADCAmplrest6_HE", " ", 100, 0., 10000.); - h_ADCAmpl345_HE = new TH1F("h_ADCAmpl345_HE", " ", 70, 0., 700000.); + h_ADCAmpl345_HE = fs_->make("h_ADCAmpl345_HE", " ", 70, 0., 700000.); // SiPM corrections: - h_corrforxaMAIN_HE = new TH1F("h_corrforxaMAIN_HE", " ", 70, 0., 700000.); - h_corrforxaMAIN0_HE = new TH1F("h_corrforxaMAIN0_HE", " ", 70, 0., 700000.); - h_corrforxaADDI_HE = new TH1F("h_corrforxaADDI_HE", " ", 70, 0., 700000.); - h_corrforxaADDI0_HE = new TH1F("h_corrforxaADDI0_HE", " ", 70, 0., 700000.); - - h_mapDepth1ADCAmpl225_HE = new TH2F("h_mapDepth1ADCAmpl225_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth2ADCAmpl225_HE = new TH2F("h_mapDepth2ADCAmpl225_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth3ADCAmpl225_HE = new TH2F("h_mapDepth3ADCAmpl225_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth4ADCAmpl225_HE = new TH2F("h_mapDepth4ADCAmpl225_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth5ADCAmpl225_HE = new TH2F("h_mapDepth5ADCAmpl225_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth6ADCAmpl225_HE = new TH2F("h_mapDepth6ADCAmpl225_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth7ADCAmpl225_HE = new TH2F("h_mapDepth7ADCAmpl225_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth1ADCAmpl225Copy_HE = new TH2F("h_mapDepth1ADCAmpl225Copy_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth2ADCAmpl225Copy_HE = new TH2F("h_mapDepth2ADCAmpl225Copy_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth3ADCAmpl225Copy_HE = new TH2F("h_mapDepth3ADCAmpl225Copy_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth4ADCAmpl225Copy_HE = new TH2F("h_mapDepth4ADCAmpl225Copy_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth5ADCAmpl225Copy_HE = new TH2F("h_mapDepth5ADCAmpl225Copy_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth6ADCAmpl225Copy_HE = new TH2F("h_mapDepth6ADCAmpl225Copy_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth7ADCAmpl225Copy_HE = new TH2F("h_mapDepth7ADCAmpl225Copy_HE", " ", neta, -41., 41., nphi, 0., bphi); - - h_mapDepth1ADCAmpl_HE = new TH2F("h_mapDepth1ADCAmpl_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth2ADCAmpl_HE = new TH2F("h_mapDepth2ADCAmpl_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth3ADCAmpl_HE = new TH2F("h_mapDepth3ADCAmpl_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth4ADCAmpl_HE = new TH2F("h_mapDepth4ADCAmpl_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth5ADCAmpl_HE = new TH2F("h_mapDepth5ADCAmpl_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth6ADCAmpl_HE = new TH2F("h_mapDepth6ADCAmpl_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth7ADCAmpl_HE = new TH2F("h_mapDepth7ADCAmpl_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth1ADCAmplSiPM_HE = new TH2F("h_mapDepth1ADCAmplSiPM_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth2ADCAmplSiPM_HE = new TH2F("h_mapDepth2ADCAmplSiPM_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth3ADCAmplSiPM_HE = new TH2F("h_mapDepth3ADCAmplSiPM_HE", " ", neta, -41., 41., nphi, 0., bphi); - - h_TSmeanA_HE = new TH1F("h_TSmeanA_HE", " ", 100, -2., 8.); - h_mapDepth1TSmeanA225_HE = new TH2F("h_mapDepth1TSmeanA225_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth2TSmeanA225_HE = new TH2F("h_mapDepth2TSmeanA225_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth3TSmeanA225_HE = new TH2F("h_mapDepth3TSmeanA225_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth4TSmeanA225_HE = new TH2F("h_mapDepth4TSmeanA225_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth5TSmeanA225_HE = new TH2F("h_mapDepth5TSmeanA225_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth6TSmeanA225_HE = new TH2F("h_mapDepth6TSmeanA225_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth7TSmeanA225_HE = new TH2F("h_mapDepth7TSmeanA225_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth1TSmeanA_HE = new TH2F("h_mapDepth1TSmeanA_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth2TSmeanA_HE = new TH2F("h_mapDepth2TSmeanA_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth3TSmeanA_HE = new TH2F("h_mapDepth3TSmeanA_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth4TSmeanA_HE = new TH2F("h_mapDepth4TSmeanA_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth5TSmeanA_HE = new TH2F("h_mapDepth5TSmeanA_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth6TSmeanA_HE = new TH2F("h_mapDepth6TSmeanA_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth7TSmeanA_HE = new TH2F("h_mapDepth7TSmeanA_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_TSmaxA_HE = new TH1F("h_TSmaxA_HE", " ", 100, -1., 11.); - h_mapDepth1TSmaxA225_HE = new TH2F("h_mapDepth1TSmaxA225_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth2TSmaxA225_HE = new TH2F("h_mapDepth2TSmaxA225_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth3TSmaxA225_HE = new TH2F("h_mapDepth3TSmaxA225_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth4TSmaxA225_HE = new TH2F("h_mapDepth4TSmaxA225_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth5TSmaxA225_HE = new TH2F("h_mapDepth5TSmaxA225_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth6TSmaxA225_HE = new TH2F("h_mapDepth6TSmaxA225_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth7TSmaxA225_HE = new TH2F("h_mapDepth7TSmaxA225_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth1TSmaxA_HE = new TH2F("h_mapDepth1TSmaxA_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth2TSmaxA_HE = new TH2F("h_mapDepth2TSmaxA_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth3TSmaxA_HE = new TH2F("h_mapDepth3TSmaxA_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth4TSmaxA_HE = new TH2F("h_mapDepth4TSmaxA_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth5TSmaxA_HE = new TH2F("h_mapDepth5TSmaxA_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth6TSmaxA_HE = new TH2F("h_mapDepth6TSmaxA_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth7TSmaxA_HE = new TH2F("h_mapDepth7TSmaxA_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_corrforxaMAIN_HE = fs_->make("h_corrforxaMAIN_HE", " ", 70, 0., 700000.); + h_corrforxaMAIN0_HE = fs_->make("h_corrforxaMAIN0_HE", " ", 70, 0., 700000.); + h_corrforxaADDI_HE = fs_->make("h_corrforxaADDI_HE", " ", 70, 0., 700000.); + h_corrforxaADDI0_HE = fs_->make("h_corrforxaADDI0_HE", " ", 70, 0., 700000.); + + h_mapDepth1ADCAmpl225_HE = fs_->make("h_mapDepth1ADCAmpl225_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth2ADCAmpl225_HE = fs_->make("h_mapDepth2ADCAmpl225_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth3ADCAmpl225_HE = fs_->make("h_mapDepth3ADCAmpl225_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth4ADCAmpl225_HE = fs_->make("h_mapDepth4ADCAmpl225_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth5ADCAmpl225_HE = fs_->make("h_mapDepth5ADCAmpl225_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth6ADCAmpl225_HE = fs_->make("h_mapDepth6ADCAmpl225_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth7ADCAmpl225_HE = fs_->make("h_mapDepth7ADCAmpl225_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth1ADCAmpl225Copy_HE = + fs_->make("h_mapDepth1ADCAmpl225Copy_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth2ADCAmpl225Copy_HE = + fs_->make("h_mapDepth2ADCAmpl225Copy_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth3ADCAmpl225Copy_HE = + fs_->make("h_mapDepth3ADCAmpl225Copy_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth4ADCAmpl225Copy_HE = + fs_->make("h_mapDepth4ADCAmpl225Copy_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth5ADCAmpl225Copy_HE = + fs_->make("h_mapDepth5ADCAmpl225Copy_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth6ADCAmpl225Copy_HE = + fs_->make("h_mapDepth6ADCAmpl225Copy_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth7ADCAmpl225Copy_HE = + fs_->make("h_mapDepth7ADCAmpl225Copy_HE", " ", neta, -41., 41., nphi, 0., bphi); + + h_mapDepth1ADCAmpl_HE = fs_->make("h_mapDepth1ADCAmpl_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth2ADCAmpl_HE = fs_->make("h_mapDepth2ADCAmpl_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth3ADCAmpl_HE = fs_->make("h_mapDepth3ADCAmpl_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth4ADCAmpl_HE = fs_->make("h_mapDepth4ADCAmpl_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth5ADCAmpl_HE = fs_->make("h_mapDepth5ADCAmpl_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth6ADCAmpl_HE = fs_->make("h_mapDepth6ADCAmpl_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth7ADCAmpl_HE = fs_->make("h_mapDepth7ADCAmpl_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth1ADCAmplSiPM_HE = fs_->make("h_mapDepth1ADCAmplSiPM_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth2ADCAmplSiPM_HE = fs_->make("h_mapDepth2ADCAmplSiPM_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth3ADCAmplSiPM_HE = fs_->make("h_mapDepth3ADCAmplSiPM_HE", " ", neta, -41., 41., nphi, 0., bphi); + + h_TSmeanA_HE = fs_->make("h_TSmeanA_HE", " ", 100, -2., 8.); + h_mapDepth1TSmeanA225_HE = fs_->make("h_mapDepth1TSmeanA225_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth2TSmeanA225_HE = fs_->make("h_mapDepth2TSmeanA225_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth3TSmeanA225_HE = fs_->make("h_mapDepth3TSmeanA225_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth4TSmeanA225_HE = fs_->make("h_mapDepth4TSmeanA225_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth5TSmeanA225_HE = fs_->make("h_mapDepth5TSmeanA225_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth6TSmeanA225_HE = fs_->make("h_mapDepth6TSmeanA225_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth7TSmeanA225_HE = fs_->make("h_mapDepth7TSmeanA225_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth1TSmeanA_HE = fs_->make("h_mapDepth1TSmeanA_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth2TSmeanA_HE = fs_->make("h_mapDepth2TSmeanA_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth3TSmeanA_HE = fs_->make("h_mapDepth3TSmeanA_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth4TSmeanA_HE = fs_->make("h_mapDepth4TSmeanA_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth5TSmeanA_HE = fs_->make("h_mapDepth5TSmeanA_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth6TSmeanA_HE = fs_->make("h_mapDepth6TSmeanA_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth7TSmeanA_HE = fs_->make("h_mapDepth7TSmeanA_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_TSmaxA_HE = fs_->make("h_TSmaxA_HE", " ", 100, -1., 11.); + h_mapDepth1TSmaxA225_HE = fs_->make("h_mapDepth1TSmaxA225_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth2TSmaxA225_HE = fs_->make("h_mapDepth2TSmaxA225_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth3TSmaxA225_HE = fs_->make("h_mapDepth3TSmaxA225_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth4TSmaxA225_HE = fs_->make("h_mapDepth4TSmaxA225_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth5TSmaxA225_HE = fs_->make("h_mapDepth5TSmaxA225_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth6TSmaxA225_HE = fs_->make("h_mapDepth6TSmaxA225_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth7TSmaxA225_HE = fs_->make("h_mapDepth7TSmaxA225_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth1TSmaxA_HE = fs_->make("h_mapDepth1TSmaxA_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth2TSmaxA_HE = fs_->make("h_mapDepth2TSmaxA_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth3TSmaxA_HE = fs_->make("h_mapDepth3TSmaxA_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth4TSmaxA_HE = fs_->make("h_mapDepth4TSmaxA_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth5TSmaxA_HE = fs_->make("h_mapDepth5TSmaxA_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth6TSmaxA_HE = fs_->make("h_mapDepth6TSmaxA_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth7TSmaxA_HE = fs_->make("h_mapDepth7TSmaxA_HE", " ", neta, -41., 41., nphi, 0., bphi); // RMS: - h_Amplitude_HE = new TH1F("h_Amplitude_HE", " ", 100, 0., 5.5); - h_mapDepth1Amplitude225_HE = new TH2F("h_mapDepth1Amplitude225_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth2Amplitude225_HE = new TH2F("h_mapDepth2Amplitude225_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth3Amplitude225_HE = new TH2F("h_mapDepth3Amplitude225_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth4Amplitude225_HE = new TH2F("h_mapDepth4Amplitude225_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth5Amplitude225_HE = new TH2F("h_mapDepth5Amplitude225_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth6Amplitude225_HE = new TH2F("h_mapDepth6Amplitude225_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth7Amplitude225_HE = new TH2F("h_mapDepth7Amplitude225_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth1Amplitude_HE = new TH2F("h_mapDepth1Amplitude_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth2Amplitude_HE = new TH2F("h_mapDepth2Amplitude_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth3Amplitude_HE = new TH2F("h_mapDepth3Amplitude_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth4Amplitude_HE = new TH2F("h_mapDepth4Amplitude_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth5Amplitude_HE = new TH2F("h_mapDepth5Amplitude_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth6Amplitude_HE = new TH2F("h_mapDepth6Amplitude_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth7Amplitude_HE = new TH2F("h_mapDepth7Amplitude_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_Amplitude_HE = fs_->make("h_Amplitude_HE", " ", 100, 0., 5.5); + h_mapDepth1Amplitude225_HE = fs_->make("h_mapDepth1Amplitude225_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth2Amplitude225_HE = fs_->make("h_mapDepth2Amplitude225_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth3Amplitude225_HE = fs_->make("h_mapDepth3Amplitude225_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth4Amplitude225_HE = fs_->make("h_mapDepth4Amplitude225_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth5Amplitude225_HE = fs_->make("h_mapDepth5Amplitude225_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth6Amplitude225_HE = fs_->make("h_mapDepth6Amplitude225_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth7Amplitude225_HE = fs_->make("h_mapDepth7Amplitude225_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth1Amplitude_HE = fs_->make("h_mapDepth1Amplitude_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth2Amplitude_HE = fs_->make("h_mapDepth2Amplitude_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth3Amplitude_HE = fs_->make("h_mapDepth3Amplitude_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth4Amplitude_HE = fs_->make("h_mapDepth4Amplitude_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth5Amplitude_HE = fs_->make("h_mapDepth5Amplitude_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth6Amplitude_HE = fs_->make("h_mapDepth6Amplitude_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth7Amplitude_HE = fs_->make("h_mapDepth7Amplitude_HE", " ", neta, -41., 41., nphi, 0., bphi); // Ratio: - h_Ampl_HE = new TH1F("h_Ampl_HE", " ", 100, 0., 1.1); - h_mapDepth1Ampl047_HE = new TH2F("h_mapDepth1Ampl047_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth2Ampl047_HE = new TH2F("h_mapDepth2Ampl047_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth3Ampl047_HE = new TH2F("h_mapDepth3Ampl047_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth4Ampl047_HE = new TH2F("h_mapDepth4Ampl047_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth5Ampl047_HE = new TH2F("h_mapDepth5Ampl047_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth6Ampl047_HE = new TH2F("h_mapDepth6Ampl047_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth7Ampl047_HE = new TH2F("h_mapDepth7Ampl047_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth1Ampl_HE = new TH2F("h_mapDepth1Ampl_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth2Ampl_HE = new TH2F("h_mapDepth2Ampl_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth3Ampl_HE = new TH2F("h_mapDepth3Ampl_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth4Ampl_HE = new TH2F("h_mapDepth4Ampl_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth5Ampl_HE = new TH2F("h_mapDepth5Ampl_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth6Ampl_HE = new TH2F("h_mapDepth6Ampl_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth7Ampl_HE = new TH2F("h_mapDepth7Ampl_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth1AmplE34_HE = new TH2F("h_mapDepth1AmplE34_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth2AmplE34_HE = new TH2F("h_mapDepth2AmplE34_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth3AmplE34_HE = new TH2F("h_mapDepth3AmplE34_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth4AmplE34_HE = new TH2F("h_mapDepth4AmplE34_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth5AmplE34_HE = new TH2F("h_mapDepth5AmplE34_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth6AmplE34_HE = new TH2F("h_mapDepth6AmplE34_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth7AmplE34_HE = new TH2F("h_mapDepth7AmplE34_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth1_HE = new TH2F("h_mapDepth1_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth2_HE = new TH2F("h_mapDepth2_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth3_HE = new TH2F("h_mapDepth3_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth4_HE = new TH2F("h_mapDepth4_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth5_HE = new TH2F("h_mapDepth5_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth6_HE = new TH2F("h_mapDepth6_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth7_HE = new TH2F("h_mapDepth7_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_Ampl_HE = fs_->make("h_Ampl_HE", " ", 100, 0., 1.1); + h_mapDepth1Ampl047_HE = fs_->make("h_mapDepth1Ampl047_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth2Ampl047_HE = fs_->make("h_mapDepth2Ampl047_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth3Ampl047_HE = fs_->make("h_mapDepth3Ampl047_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth4Ampl047_HE = fs_->make("h_mapDepth4Ampl047_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth5Ampl047_HE = fs_->make("h_mapDepth5Ampl047_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth6Ampl047_HE = fs_->make("h_mapDepth6Ampl047_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth7Ampl047_HE = fs_->make("h_mapDepth7Ampl047_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth1Ampl_HE = fs_->make("h_mapDepth1Ampl_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth2Ampl_HE = fs_->make("h_mapDepth2Ampl_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth3Ampl_HE = fs_->make("h_mapDepth3Ampl_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth4Ampl_HE = fs_->make("h_mapDepth4Ampl_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth5Ampl_HE = fs_->make("h_mapDepth5Ampl_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth6Ampl_HE = fs_->make("h_mapDepth6Ampl_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth7Ampl_HE = fs_->make("h_mapDepth7Ampl_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth1AmplE34_HE = fs_->make("h_mapDepth1AmplE34_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth2AmplE34_HE = fs_->make("h_mapDepth2AmplE34_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth3AmplE34_HE = fs_->make("h_mapDepth3AmplE34_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth4AmplE34_HE = fs_->make("h_mapDepth4AmplE34_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth5AmplE34_HE = fs_->make("h_mapDepth5AmplE34_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth6AmplE34_HE = fs_->make("h_mapDepth6AmplE34_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth7AmplE34_HE = fs_->make("h_mapDepth7AmplE34_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth1_HE = fs_->make("h_mapDepth1_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth2_HE = fs_->make("h_mapDepth2_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth3_HE = fs_->make("h_mapDepth3_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth4_HE = fs_->make("h_mapDepth4_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth5_HE = fs_->make("h_mapDepth5_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth6_HE = fs_->make("h_mapDepth6_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth7_HE = fs_->make("h_mapDepth7_HE", " ", neta, -41., 41., nphi, 0., bphi); /////////////////////////////////////////////////////////////////////////////////////////////////// IterativeMethodCalibrationGroup - h_mapenophinorm_HE1 = new TH2F("h_mapenophinorm_HE1", " ", neta, -41., 41., nphi, 0., bphi); - h_mapenophinorm_HE2 = new TH2F("h_mapenophinorm_HE2", " ", neta, -41., 41., nphi, 0., bphi); - h_mapenophinorm_HE3 = new TH2F("h_mapenophinorm_HE3", " ", neta, -41., 41., nphi, 0., bphi); - h_mapenophinorm_HE4 = new TH2F("h_mapenophinorm_HE4", " ", neta, -41., 41., nphi, 0., bphi); - h_mapenophinorm_HE5 = new TH2F("h_mapenophinorm_HE5", " ", neta, -41., 41., nphi, 0., bphi); - h_mapenophinorm_HE6 = new TH2F("h_mapenophinorm_HE6", " ", neta, -41., 41., nphi, 0., bphi); - h_mapenophinorm_HE7 = new TH2F("h_mapenophinorm_HE7", " ", neta, -41., 41., nphi, 0., bphi); - h_mapenophinorm2_HE1 = new TH2F("h_mapenophinorm2_HE1", " ", neta, -41., 41., nphi, 0., bphi); - h_mapenophinorm2_HE2 = new TH2F("h_mapenophinorm2_HE2", " ", neta, -41., 41., nphi, 0., bphi); - h_mapenophinorm2_HE3 = new TH2F("h_mapenophinorm2_HE3", " ", neta, -41., 41., nphi, 0., bphi); - h_mapenophinorm2_HE4 = new TH2F("h_mapenophinorm2_HE4", " ", neta, -41., 41., nphi, 0., bphi); - h_mapenophinorm2_HE5 = new TH2F("h_mapenophinorm2_HE5", " ", neta, -41., 41., nphi, 0., bphi); - h_mapenophinorm2_HE6 = new TH2F("h_mapenophinorm2_HE6", " ", neta, -41., 41., nphi, 0., bphi); - h_mapenophinorm2_HE7 = new TH2F("h_mapenophinorm2_HE7", " ", neta, -41., 41., nphi, 0., bphi); - - h_maprphinorm_HE1 = new TH2F("h_maprphinorm_HE1", " ", neta, -41., 41., nphi, 0., bphi); - h_maprphinorm_HE2 = new TH2F("h_maprphinorm_HE2", " ", neta, -41., 41., nphi, 0., bphi); - h_maprphinorm_HE3 = new TH2F("h_maprphinorm_HE3", " ", neta, -41., 41., nphi, 0., bphi); - h_maprphinorm_HE4 = new TH2F("h_maprphinorm_HE4", " ", neta, -41., 41., nphi, 0., bphi); - h_maprphinorm_HE5 = new TH2F("h_maprphinorm_HE5", " ", neta, -41., 41., nphi, 0., bphi); - h_maprphinorm_HE6 = new TH2F("h_maprphinorm_HE6", " ", neta, -41., 41., nphi, 0., bphi); - h_maprphinorm_HE7 = new TH2F("h_maprphinorm_HE7", " ", neta, -41., 41., nphi, 0., bphi); - h_maprphinorm2_HE1 = new TH2F("h_maprphinorm2_HE1", " ", neta, -41., 41., nphi, 0., bphi); - h_maprphinorm2_HE2 = new TH2F("h_maprphinorm2_HE2", " ", neta, -41., 41., nphi, 0., bphi); - h_maprphinorm2_HE3 = new TH2F("h_maprphinorm2_HE3", " ", neta, -41., 41., nphi, 0., bphi); - h_maprphinorm2_HE4 = new TH2F("h_maprphinorm2_HE4", " ", neta, -41., 41., nphi, 0., bphi); - h_maprphinorm2_HE5 = new TH2F("h_maprphinorm2_HE5", " ", neta, -41., 41., nphi, 0., bphi); - h_maprphinorm2_HE6 = new TH2F("h_maprphinorm2_HE6", " ", neta, -41., 41., nphi, 0., bphi); - h_maprphinorm2_HE7 = new TH2F("h_maprphinorm2_HE7", " ", neta, -41., 41., nphi, 0., bphi); - - h_maprphinorm0_HE1 = new TH2F("h_maprphinorm0_HE1", " ", neta, -41., 41., nphi, 0., bphi); - h_maprphinorm0_HE2 = new TH2F("h_maprphinorm0_HE2", " ", neta, -41., 41., nphi, 0., bphi); - h_maprphinorm0_HE3 = new TH2F("h_maprphinorm0_HE3", " ", neta, -41., 41., nphi, 0., bphi); - h_maprphinorm0_HE4 = new TH2F("h_maprphinorm0_HE4", " ", neta, -41., 41., nphi, 0., bphi); - h_maprphinorm0_HE5 = new TH2F("h_maprphinorm0_HE5", " ", neta, -41., 41., nphi, 0., bphi); - h_maprphinorm0_HE6 = new TH2F("h_maprphinorm0_HE6", " ", neta, -41., 41., nphi, 0., bphi); - h_maprphinorm0_HE7 = new TH2F("h_maprphinorm0_HE7", " ", neta, -41., 41., nphi, 0., bphi); + h_mapenophinorm_HE1 = fs_->make("h_mapenophinorm_HE1", " ", neta, -41., 41., nphi, 0., bphi); + h_mapenophinorm_HE2 = fs_->make("h_mapenophinorm_HE2", " ", neta, -41., 41., nphi, 0., bphi); + h_mapenophinorm_HE3 = fs_->make("h_mapenophinorm_HE3", " ", neta, -41., 41., nphi, 0., bphi); + h_mapenophinorm_HE4 = fs_->make("h_mapenophinorm_HE4", " ", neta, -41., 41., nphi, 0., bphi); + h_mapenophinorm_HE5 = fs_->make("h_mapenophinorm_HE5", " ", neta, -41., 41., nphi, 0., bphi); + h_mapenophinorm_HE6 = fs_->make("h_mapenophinorm_HE6", " ", neta, -41., 41., nphi, 0., bphi); + h_mapenophinorm_HE7 = fs_->make("h_mapenophinorm_HE7", " ", neta, -41., 41., nphi, 0., bphi); + h_mapenophinorm2_HE1 = fs_->make("h_mapenophinorm2_HE1", " ", neta, -41., 41., nphi, 0., bphi); + h_mapenophinorm2_HE2 = fs_->make("h_mapenophinorm2_HE2", " ", neta, -41., 41., nphi, 0., bphi); + h_mapenophinorm2_HE3 = fs_->make("h_mapenophinorm2_HE3", " ", neta, -41., 41., nphi, 0., bphi); + h_mapenophinorm2_HE4 = fs_->make("h_mapenophinorm2_HE4", " ", neta, -41., 41., nphi, 0., bphi); + h_mapenophinorm2_HE5 = fs_->make("h_mapenophinorm2_HE5", " ", neta, -41., 41., nphi, 0., bphi); + h_mapenophinorm2_HE6 = fs_->make("h_mapenophinorm2_HE6", " ", neta, -41., 41., nphi, 0., bphi); + h_mapenophinorm2_HE7 = fs_->make("h_mapenophinorm2_HE7", " ", neta, -41., 41., nphi, 0., bphi); + + h_maprphinorm_HE1 = fs_->make("h_maprphinorm_HE1", " ", neta, -41., 41., nphi, 0., bphi); + h_maprphinorm_HE2 = fs_->make("h_maprphinorm_HE2", " ", neta, -41., 41., nphi, 0., bphi); + h_maprphinorm_HE3 = fs_->make("h_maprphinorm_HE3", " ", neta, -41., 41., nphi, 0., bphi); + h_maprphinorm_HE4 = fs_->make("h_maprphinorm_HE4", " ", neta, -41., 41., nphi, 0., bphi); + h_maprphinorm_HE5 = fs_->make("h_maprphinorm_HE5", " ", neta, -41., 41., nphi, 0., bphi); + h_maprphinorm_HE6 = fs_->make("h_maprphinorm_HE6", " ", neta, -41., 41., nphi, 0., bphi); + h_maprphinorm_HE7 = fs_->make("h_maprphinorm_HE7", " ", neta, -41., 41., nphi, 0., bphi); + h_maprphinorm2_HE1 = fs_->make("h_maprphinorm2_HE1", " ", neta, -41., 41., nphi, 0., bphi); + h_maprphinorm2_HE2 = fs_->make("h_maprphinorm2_HE2", " ", neta, -41., 41., nphi, 0., bphi); + h_maprphinorm2_HE3 = fs_->make("h_maprphinorm2_HE3", " ", neta, -41., 41., nphi, 0., bphi); + h_maprphinorm2_HE4 = fs_->make("h_maprphinorm2_HE4", " ", neta, -41., 41., nphi, 0., bphi); + h_maprphinorm2_HE5 = fs_->make("h_maprphinorm2_HE5", " ", neta, -41., 41., nphi, 0., bphi); + h_maprphinorm2_HE6 = fs_->make("h_maprphinorm2_HE6", " ", neta, -41., 41., nphi, 0., bphi); + h_maprphinorm2_HE7 = fs_->make("h_maprphinorm2_HE7", " ", neta, -41., 41., nphi, 0., bphi); + + h_maprphinorm0_HE1 = fs_->make("h_maprphinorm0_HE1", " ", neta, -41., 41., nphi, 0., bphi); + h_maprphinorm0_HE2 = fs_->make("h_maprphinorm0_HE2", " ", neta, -41., 41., nphi, 0., bphi); + h_maprphinorm0_HE3 = fs_->make("h_maprphinorm0_HE3", " ", neta, -41., 41., nphi, 0., bphi); + h_maprphinorm0_HE4 = fs_->make("h_maprphinorm0_HE4", " ", neta, -41., 41., nphi, 0., bphi); + h_maprphinorm0_HE5 = fs_->make("h_maprphinorm0_HE5", " ", neta, -41., 41., nphi, 0., bphi); + h_maprphinorm0_HE6 = fs_->make("h_maprphinorm0_HE6", " ", neta, -41., 41., nphi, 0., bphi); + h_maprphinorm0_HE7 = fs_->make("h_maprphinorm0_HE7", " ", neta, -41., 41., nphi, 0., bphi); // // Didi as done in Reco //HB: - h_amplitudechannel0_HB1 = new TH2F("h_amplitudechannel0_HB1", " ", neta, -41., 41., nphi, 0., bphi); - h_amplitudechannel1_HB1 = new TH2F("h_amplitudechannel1_HB1", " ", neta, -41., 41., nphi, 0., bphi); - h_amplitudechannel2_HB1 = new TH2F("h_amplitudechannel2_HB1", " ", neta, -41., 41., nphi, 0., bphi); - h_amplitudechannel0_HB2 = new TH2F("h_amplitudechannel0_HB2", " ", neta, -41., 41., nphi, 0., bphi); - h_amplitudechannel1_HB2 = new TH2F("h_amplitudechannel1_HB2", " ", neta, -41., 41., nphi, 0., bphi); - h_amplitudechannel2_HB2 = new TH2F("h_amplitudechannel2_HB2", " ", neta, -41., 41., nphi, 0., bphi); - h_amplitudechannel0_HB3 = new TH2F("h_amplitudechannel0_HB3", " ", neta, -41., 41., nphi, 0., bphi); - h_amplitudechannel1_HB3 = new TH2F("h_amplitudechannel1_HB3", " ", neta, -41., 41., nphi, 0., bphi); - h_amplitudechannel2_HB3 = new TH2F("h_amplitudechannel2_HB3", " ", neta, -41., 41., nphi, 0., bphi); - h_amplitudechannel0_HB4 = new TH2F("h_amplitudechannel0_HB4", " ", neta, -41., 41., nphi, 0., bphi); - h_amplitudechannel1_HB4 = new TH2F("h_amplitudechannel1_HB4", " ", neta, -41., 41., nphi, 0., bphi); - h_amplitudechannel2_HB4 = new TH2F("h_amplitudechannel2_HB4", " ", neta, -41., 41., nphi, 0., bphi); + h_amplitudechannel0_HB1 = fs_->make("h_amplitudechannel0_HB1", " ", neta, -41., 41., nphi, 0., bphi); + h_amplitudechannel1_HB1 = fs_->make("h_amplitudechannel1_HB1", " ", neta, -41., 41., nphi, 0., bphi); + h_amplitudechannel2_HB1 = fs_->make("h_amplitudechannel2_HB1", " ", neta, -41., 41., nphi, 0., bphi); + h_amplitudechannel0_HB2 = fs_->make("h_amplitudechannel0_HB2", " ", neta, -41., 41., nphi, 0., bphi); + h_amplitudechannel1_HB2 = fs_->make("h_amplitudechannel1_HB2", " ", neta, -41., 41., nphi, 0., bphi); + h_amplitudechannel2_HB2 = fs_->make("h_amplitudechannel2_HB2", " ", neta, -41., 41., nphi, 0., bphi); + h_amplitudechannel0_HB3 = fs_->make("h_amplitudechannel0_HB3", " ", neta, -41., 41., nphi, 0., bphi); + h_amplitudechannel1_HB3 = fs_->make("h_amplitudechannel1_HB3", " ", neta, -41., 41., nphi, 0., bphi); + h_amplitudechannel2_HB3 = fs_->make("h_amplitudechannel2_HB3", " ", neta, -41., 41., nphi, 0., bphi); + h_amplitudechannel0_HB4 = fs_->make("h_amplitudechannel0_HB4", " ", neta, -41., 41., nphi, 0., bphi); + h_amplitudechannel1_HB4 = fs_->make("h_amplitudechannel1_HB4", " ", neta, -41., 41., nphi, 0., bphi); + h_amplitudechannel2_HB4 = fs_->make("h_amplitudechannel2_HB4", " ", neta, -41., 41., nphi, 0., bphi); //HE: - h_amplitudechannel0_HE1 = new TH2F("h_amplitudechannel0_HE1", " ", neta, -41., 41., nphi, 0., bphi); - h_amplitudechannel1_HE1 = new TH2F("h_amplitudechannel1_HE1", " ", neta, -41., 41., nphi, 0., bphi); - h_amplitudechannel2_HE1 = new TH2F("h_amplitudechannel2_HE1", " ", neta, -41., 41., nphi, 0., bphi); - h_amplitudechannel0_HE2 = new TH2F("h_amplitudechannel0_HE2", " ", neta, -41., 41., nphi, 0., bphi); - h_amplitudechannel1_HE2 = new TH2F("h_amplitudechannel1_HE2", " ", neta, -41., 41., nphi, 0., bphi); - h_amplitudechannel2_HE2 = new TH2F("h_amplitudechannel2_HE2", " ", neta, -41., 41., nphi, 0., bphi); - h_amplitudechannel0_HE3 = new TH2F("h_amplitudechannel0_HE3", " ", neta, -41., 41., nphi, 0., bphi); - h_amplitudechannel1_HE3 = new TH2F("h_amplitudechannel1_HE3", " ", neta, -41., 41., nphi, 0., bphi); - h_amplitudechannel2_HE3 = new TH2F("h_amplitudechannel2_HE3", " ", neta, -41., 41., nphi, 0., bphi); - h_amplitudechannel0_HE4 = new TH2F("h_amplitudechannel0_HE4", " ", neta, -41., 41., nphi, 0., bphi); - h_amplitudechannel1_HE4 = new TH2F("h_amplitudechannel1_HE4", " ", neta, -41., 41., nphi, 0., bphi); - h_amplitudechannel2_HE4 = new TH2F("h_amplitudechannel2_HE4", " ", neta, -41., 41., nphi, 0., bphi); - h_amplitudechannel0_HE5 = new TH2F("h_amplitudechannel0_HE5", " ", neta, -41., 41., nphi, 0., bphi); - h_amplitudechannel1_HE5 = new TH2F("h_amplitudechannel1_HE5", " ", neta, -41., 41., nphi, 0., bphi); - h_amplitudechannel2_HE5 = new TH2F("h_amplitudechannel2_HE5", " ", neta, -41., 41., nphi, 0., bphi); - h_amplitudechannel0_HE6 = new TH2F("h_amplitudechannel0_HE6", " ", neta, -41., 41., nphi, 0., bphi); - h_amplitudechannel1_HE6 = new TH2F("h_amplitudechannel1_HE6", " ", neta, -41., 41., nphi, 0., bphi); - h_amplitudechannel2_HE6 = new TH2F("h_amplitudechannel2_HE6", " ", neta, -41., 41., nphi, 0., bphi); - h_amplitudechannel0_HE7 = new TH2F("h_amplitudechannel0_HE7", " ", neta, -41., 41., nphi, 0., bphi); - h_amplitudechannel1_HE7 = new TH2F("h_amplitudechannel1_HE7", " ", neta, -41., 41., nphi, 0., bphi); - h_amplitudechannel2_HE7 = new TH2F("h_amplitudechannel2_HE7", " ", neta, -41., 41., nphi, 0., bphi); + h_amplitudechannel0_HE1 = fs_->make("h_amplitudechannel0_HE1", " ", neta, -41., 41., nphi, 0., bphi); + h_amplitudechannel1_HE1 = fs_->make("h_amplitudechannel1_HE1", " ", neta, -41., 41., nphi, 0., bphi); + h_amplitudechannel2_HE1 = fs_->make("h_amplitudechannel2_HE1", " ", neta, -41., 41., nphi, 0., bphi); + h_amplitudechannel0_HE2 = fs_->make("h_amplitudechannel0_HE2", " ", neta, -41., 41., nphi, 0., bphi); + h_amplitudechannel1_HE2 = fs_->make("h_amplitudechannel1_HE2", " ", neta, -41., 41., nphi, 0., bphi); + h_amplitudechannel2_HE2 = fs_->make("h_amplitudechannel2_HE2", " ", neta, -41., 41., nphi, 0., bphi); + h_amplitudechannel0_HE3 = fs_->make("h_amplitudechannel0_HE3", " ", neta, -41., 41., nphi, 0., bphi); + h_amplitudechannel1_HE3 = fs_->make("h_amplitudechannel1_HE3", " ", neta, -41., 41., nphi, 0., bphi); + h_amplitudechannel2_HE3 = fs_->make("h_amplitudechannel2_HE3", " ", neta, -41., 41., nphi, 0., bphi); + h_amplitudechannel0_HE4 = fs_->make("h_amplitudechannel0_HE4", " ", neta, -41., 41., nphi, 0., bphi); + h_amplitudechannel1_HE4 = fs_->make("h_amplitudechannel1_HE4", " ", neta, -41., 41., nphi, 0., bphi); + h_amplitudechannel2_HE4 = fs_->make("h_amplitudechannel2_HE4", " ", neta, -41., 41., nphi, 0., bphi); + h_amplitudechannel0_HE5 = fs_->make("h_amplitudechannel0_HE5", " ", neta, -41., 41., nphi, 0., bphi); + h_amplitudechannel1_HE5 = fs_->make("h_amplitudechannel1_HE5", " ", neta, -41., 41., nphi, 0., bphi); + h_amplitudechannel2_HE5 = fs_->make("h_amplitudechannel2_HE5", " ", neta, -41., 41., nphi, 0., bphi); + h_amplitudechannel0_HE6 = fs_->make("h_amplitudechannel0_HE6", " ", neta, -41., 41., nphi, 0., bphi); + h_amplitudechannel1_HE6 = fs_->make("h_amplitudechannel1_HE6", " ", neta, -41., 41., nphi, 0., bphi); + h_amplitudechannel2_HE6 = fs_->make("h_amplitudechannel2_HE6", " ", neta, -41., 41., nphi, 0., bphi); + h_amplitudechannel0_HE7 = fs_->make("h_amplitudechannel0_HE7", " ", neta, -41., 41., nphi, 0., bphi); + h_amplitudechannel1_HE7 = fs_->make("h_amplitudechannel1_HE7", " ", neta, -41., 41., nphi, 0., bphi); + h_amplitudechannel2_HE7 = fs_->make("h_amplitudechannel2_HE7", " ", neta, -41., 41., nphi, 0., bphi); //HF: - h_amplitudechannel0_HF1 = new TH2F("h_amplitudechannel0_HF1", " ", neta, -41., 41., nphi, 0., bphi); - h_amplitudechannel1_HF1 = new TH2F("h_amplitudechannel1_HF1", " ", neta, -41., 41., nphi, 0., bphi); - h_amplitudechannel2_HF1 = new TH2F("h_amplitudechannel2_HF1", " ", neta, -41., 41., nphi, 0., bphi); - h_amplitudechannel0_HF2 = new TH2F("h_amplitudechannel0_HF2", " ", neta, -41., 41., nphi, 0., bphi); - h_amplitudechannel1_HF2 = new TH2F("h_amplitudechannel1_HF2", " ", neta, -41., 41., nphi, 0., bphi); - h_amplitudechannel2_HF2 = new TH2F("h_amplitudechannel2_HF2", " ", neta, -41., 41., nphi, 0., bphi); - h_amplitudechannel0_HF3 = new TH2F("h_amplitudechannel0_HF3", " ", neta, -41., 41., nphi, 0., bphi); - h_amplitudechannel1_HF3 = new TH2F("h_amplitudechannel1_HF3", " ", neta, -41., 41., nphi, 0., bphi); - h_amplitudechannel2_HF3 = new TH2F("h_amplitudechannel2_HF3", " ", neta, -41., 41., nphi, 0., bphi); - h_amplitudechannel0_HF4 = new TH2F("h_amplitudechannel0_HF4", " ", neta, -41., 41., nphi, 0., bphi); - h_amplitudechannel1_HF4 = new TH2F("h_amplitudechannel1_HF4", " ", neta, -41., 41., nphi, 0., bphi); - h_amplitudechannel2_HF4 = new TH2F("h_amplitudechannel2_HF4", " ", neta, -41., 41., nphi, 0., bphi); + h_amplitudechannel0_HF1 = fs_->make("h_amplitudechannel0_HF1", " ", neta, -41., 41., nphi, 0., bphi); + h_amplitudechannel1_HF1 = fs_->make("h_amplitudechannel1_HF1", " ", neta, -41., 41., nphi, 0., bphi); + h_amplitudechannel2_HF1 = fs_->make("h_amplitudechannel2_HF1", " ", neta, -41., 41., nphi, 0., bphi); + h_amplitudechannel0_HF2 = fs_->make("h_amplitudechannel0_HF2", " ", neta, -41., 41., nphi, 0., bphi); + h_amplitudechannel1_HF2 = fs_->make("h_amplitudechannel1_HF2", " ", neta, -41., 41., nphi, 0., bphi); + h_amplitudechannel2_HF2 = fs_->make("h_amplitudechannel2_HF2", " ", neta, -41., 41., nphi, 0., bphi); + h_amplitudechannel0_HF3 = fs_->make("h_amplitudechannel0_HF3", " ", neta, -41., 41., nphi, 0., bphi); + h_amplitudechannel1_HF3 = fs_->make("h_amplitudechannel1_HF3", " ", neta, -41., 41., nphi, 0., bphi); + h_amplitudechannel2_HF3 = fs_->make("h_amplitudechannel2_HF3", " ", neta, -41., 41., nphi, 0., bphi); + h_amplitudechannel0_HF4 = fs_->make("h_amplitudechannel0_HF4", " ", neta, -41., 41., nphi, 0., bphi); + h_amplitudechannel1_HF4 = fs_->make("h_amplitudechannel1_HF4", " ", neta, -41., 41., nphi, 0., bphi); + h_amplitudechannel2_HF4 = fs_->make("h_amplitudechannel2_HF4", " ", neta, -41., 41., nphi, 0., bphi); // Reco - h_energyhitSignal_HB = new TH1F("h_energyhitSignal_HB", " ", npfit, 0., 0.); // - h_energyhitSignal_HE = new TH1F("h_energyhitSignal_HE", " ", npfit, 0., 0.); // - h_energyhitSignal_HF = new TH1F("h_energyhitSignal_HF", " ", npfit, 0., 0.); // - h_energyhitNoise_HB = new TH1F("h_energyhitNoise_HB", " ", npfit, 0., 0.); // - h_energyhitNoise_HE = new TH1F("h_energyhitNoise_HE", " ", npfit, 0., 0.); // - h_energyhitNoise_HF = new TH1F("h_energyhitNoise_HF", " ", npfit, 0., 0.); // + h_energyhitSignal_HB = fs_->make("h_energyhitSignal_HB", " ", npfit, 0., 0.); // + h_energyhitSignal_HE = fs_->make("h_energyhitSignal_HE", " ", npfit, 0., 0.); // + h_energyhitSignal_HF = fs_->make("h_energyhitSignal_HF", " ", npfit, 0., 0.); // + h_energyhitNoise_HB = fs_->make("h_energyhitNoise_HB", " ", npfit, 0., 0.); // + h_energyhitNoise_HE = fs_->make("h_energyhitNoise_HE", " ", npfit, 0., 0.); // + h_energyhitNoise_HF = fs_->make("h_energyhitNoise_HF", " ", npfit, 0., 0.); // //HB: - h_recSignalEnergy0_HB1 = new TH2F("h_recSignalEnergy0_HB1", " ", neta, -41., 41., nphi, 0., bphi); - h_recSignalEnergy1_HB1 = new TH2F("h_recSignalEnergy1_HB1", " ", neta, -41., 41., nphi, 0., bphi); - h_recSignalEnergy2_HB1 = new TH2F("h_recSignalEnergy2_HB1", " ", neta, -41., 41., nphi, 0., bphi); - h_recSignalEnergy0_HB2 = new TH2F("h_recSignalEnergy0_HB2", " ", neta, -41., 41., nphi, 0., bphi); - h_recSignalEnergy1_HB2 = new TH2F("h_recSignalEnergy1_HB2", " ", neta, -41., 41., nphi, 0., bphi); - h_recSignalEnergy2_HB2 = new TH2F("h_recSignalEnergy2_HB2", " ", neta, -41., 41., nphi, 0., bphi); - h_recSignalEnergy0_HB3 = new TH2F("h_recSignalEnergy0_HB3", " ", neta, -41., 41., nphi, 0., bphi); - h_recSignalEnergy1_HB3 = new TH2F("h_recSignalEnergy1_HB3", " ", neta, -41., 41., nphi, 0., bphi); - h_recSignalEnergy2_HB3 = new TH2F("h_recSignalEnergy2_HB3", " ", neta, -41., 41., nphi, 0., bphi); - h_recSignalEnergy0_HB4 = new TH2F("h_recSignalEnergy0_HB4", " ", neta, -41., 41., nphi, 0., bphi); - h_recSignalEnergy1_HB4 = new TH2F("h_recSignalEnergy1_HB4", " ", neta, -41., 41., nphi, 0., bphi); - h_recSignalEnergy2_HB4 = new TH2F("h_recSignalEnergy2_HB4", " ", neta, -41., 41., nphi, 0., bphi); - - h_recNoiseEnergy0_HB1 = new TH2F("h_recNoiseEnergy0_HB1", " ", neta, -41., 41., nphi, 0., bphi); - h_recNoiseEnergy1_HB1 = new TH2F("h_recNoiseEnergy1_HB1", " ", neta, -41., 41., nphi, 0., bphi); - h_recNoiseEnergy2_HB1 = new TH2F("h_recNoiseEnergy2_HB1", " ", neta, -41., 41., nphi, 0., bphi); - h_recNoiseEnergy0_HB2 = new TH2F("h_recNoiseEnergy0_HB2", " ", neta, -41., 41., nphi, 0., bphi); - h_recNoiseEnergy1_HB2 = new TH2F("h_recNoiseEnergy1_HB2", " ", neta, -41., 41., nphi, 0., bphi); - h_recNoiseEnergy2_HB2 = new TH2F("h_recNoiseEnergy2_HB2", " ", neta, -41., 41., nphi, 0., bphi); - h_recNoiseEnergy0_HB3 = new TH2F("h_recNoiseEnergy0_HB3", " ", neta, -41., 41., nphi, 0., bphi); - h_recNoiseEnergy1_HB3 = new TH2F("h_recNoiseEnergy1_HB3", " ", neta, -41., 41., nphi, 0., bphi); - h_recNoiseEnergy2_HB3 = new TH2F("h_recNoiseEnergy2_HB3", " ", neta, -41., 41., nphi, 0., bphi); - h_recNoiseEnergy0_HB4 = new TH2F("h_recNoiseEnergy0_HB4", " ", neta, -41., 41., nphi, 0., bphi); - h_recNoiseEnergy1_HB4 = new TH2F("h_recNoiseEnergy1_HB4", " ", neta, -41., 41., nphi, 0., bphi); - h_recNoiseEnergy2_HB4 = new TH2F("h_recNoiseEnergy2_HB4", " ", neta, -41., 41., nphi, 0., bphi); + h_recSignalEnergy0_HB1 = fs_->make("h_recSignalEnergy0_HB1", " ", neta, -41., 41., nphi, 0., bphi); + h_recSignalEnergy1_HB1 = fs_->make("h_recSignalEnergy1_HB1", " ", neta, -41., 41., nphi, 0., bphi); + h_recSignalEnergy2_HB1 = fs_->make("h_recSignalEnergy2_HB1", " ", neta, -41., 41., nphi, 0., bphi); + h_recSignalEnergy0_HB2 = fs_->make("h_recSignalEnergy0_HB2", " ", neta, -41., 41., nphi, 0., bphi); + h_recSignalEnergy1_HB2 = fs_->make("h_recSignalEnergy1_HB2", " ", neta, -41., 41., nphi, 0., bphi); + h_recSignalEnergy2_HB2 = fs_->make("h_recSignalEnergy2_HB2", " ", neta, -41., 41., nphi, 0., bphi); + h_recSignalEnergy0_HB3 = fs_->make("h_recSignalEnergy0_HB3", " ", neta, -41., 41., nphi, 0., bphi); + h_recSignalEnergy1_HB3 = fs_->make("h_recSignalEnergy1_HB3", " ", neta, -41., 41., nphi, 0., bphi); + h_recSignalEnergy2_HB3 = fs_->make("h_recSignalEnergy2_HB3", " ", neta, -41., 41., nphi, 0., bphi); + h_recSignalEnergy0_HB4 = fs_->make("h_recSignalEnergy0_HB4", " ", neta, -41., 41., nphi, 0., bphi); + h_recSignalEnergy1_HB4 = fs_->make("h_recSignalEnergy1_HB4", " ", neta, -41., 41., nphi, 0., bphi); + h_recSignalEnergy2_HB4 = fs_->make("h_recSignalEnergy2_HB4", " ", neta, -41., 41., nphi, 0., bphi); + + h_recNoiseEnergy0_HB1 = fs_->make("h_recNoiseEnergy0_HB1", " ", neta, -41., 41., nphi, 0., bphi); + h_recNoiseEnergy1_HB1 = fs_->make("h_recNoiseEnergy1_HB1", " ", neta, -41., 41., nphi, 0., bphi); + h_recNoiseEnergy2_HB1 = fs_->make("h_recNoiseEnergy2_HB1", " ", neta, -41., 41., nphi, 0., bphi); + h_recNoiseEnergy0_HB2 = fs_->make("h_recNoiseEnergy0_HB2", " ", neta, -41., 41., nphi, 0., bphi); + h_recNoiseEnergy1_HB2 = fs_->make("h_recNoiseEnergy1_HB2", " ", neta, -41., 41., nphi, 0., bphi); + h_recNoiseEnergy2_HB2 = fs_->make("h_recNoiseEnergy2_HB2", " ", neta, -41., 41., nphi, 0., bphi); + h_recNoiseEnergy0_HB3 = fs_->make("h_recNoiseEnergy0_HB3", " ", neta, -41., 41., nphi, 0., bphi); + h_recNoiseEnergy1_HB3 = fs_->make("h_recNoiseEnergy1_HB3", " ", neta, -41., 41., nphi, 0., bphi); + h_recNoiseEnergy2_HB3 = fs_->make("h_recNoiseEnergy2_HB3", " ", neta, -41., 41., nphi, 0., bphi); + h_recNoiseEnergy0_HB4 = fs_->make("h_recNoiseEnergy0_HB4", " ", neta, -41., 41., nphi, 0., bphi); + h_recNoiseEnergy1_HB4 = fs_->make("h_recNoiseEnergy1_HB4", " ", neta, -41., 41., nphi, 0., bphi); + h_recNoiseEnergy2_HB4 = fs_->make("h_recNoiseEnergy2_HB4", " ", neta, -41., 41., nphi, 0., bphi); //HE: - h_recSignalEnergy0_HE1 = new TH2F("h_recSignalEnergy0_HE1", " ", neta, -41., 41., nphi, 0., bphi); - h_recSignalEnergy1_HE1 = new TH2F("h_recSignalEnergy1_HE1", " ", neta, -41., 41., nphi, 0., bphi); - h_recSignalEnergy2_HE1 = new TH2F("h_recSignalEnergy2_HE1", " ", neta, -41., 41., nphi, 0., bphi); - h_recSignalEnergy0_HE2 = new TH2F("h_recSignalEnergy0_HE2", " ", neta, -41., 41., nphi, 0., bphi); - h_recSignalEnergy1_HE2 = new TH2F("h_recSignalEnergy1_HE2", " ", neta, -41., 41., nphi, 0., bphi); - h_recSignalEnergy2_HE2 = new TH2F("h_recSignalEnergy2_HE2", " ", neta, -41., 41., nphi, 0., bphi); - h_recSignalEnergy0_HE3 = new TH2F("h_recSignalEnergy0_HE3", " ", neta, -41., 41., nphi, 0., bphi); - h_recSignalEnergy1_HE3 = new TH2F("h_recSignalEnergy1_HE3", " ", neta, -41., 41., nphi, 0., bphi); - h_recSignalEnergy2_HE3 = new TH2F("h_recSignalEnergy2_HE3", " ", neta, -41., 41., nphi, 0., bphi); - h_recSignalEnergy0_HE4 = new TH2F("h_recSignalEnergy0_HE4", " ", neta, -41., 41., nphi, 0., bphi); - h_recSignalEnergy1_HE4 = new TH2F("h_recSignalEnergy1_HE4", " ", neta, -41., 41., nphi, 0., bphi); - h_recSignalEnergy2_HE4 = new TH2F("h_recSignalEnergy2_HE4", " ", neta, -41., 41., nphi, 0., bphi); - h_recSignalEnergy0_HE5 = new TH2F("h_recSignalEnergy0_HE5", " ", neta, -41., 41., nphi, 0., bphi); - h_recSignalEnergy1_HE5 = new TH2F("h_recSignalEnergy1_HE5", " ", neta, -41., 41., nphi, 0., bphi); - h_recSignalEnergy2_HE5 = new TH2F("h_recSignalEnergy2_HE5", " ", neta, -41., 41., nphi, 0., bphi); - h_recSignalEnergy0_HE6 = new TH2F("h_recSignalEnergy0_HE6", " ", neta, -41., 41., nphi, 0., bphi); - h_recSignalEnergy1_HE6 = new TH2F("h_recSignalEnergy1_HE6", " ", neta, -41., 41., nphi, 0., bphi); - h_recSignalEnergy2_HE6 = new TH2F("h_recSignalEnergy2_HE6", " ", neta, -41., 41., nphi, 0., bphi); - h_recSignalEnergy0_HE7 = new TH2F("h_recSignalEnergy0_HE7", " ", neta, -41., 41., nphi, 0., bphi); - h_recSignalEnergy1_HE7 = new TH2F("h_recSignalEnergy1_HE7", " ", neta, -41., 41., nphi, 0., bphi); - h_recSignalEnergy2_HE7 = new TH2F("h_recSignalEnergy2_HE7", " ", neta, -41., 41., nphi, 0., bphi); - - h_recNoiseEnergy0_HE1 = new TH2F("h_recNoiseEnergy0_HE1", " ", neta, -41., 41., nphi, 0., bphi); - h_recNoiseEnergy1_HE1 = new TH2F("h_recNoiseEnergy1_HE1", " ", neta, -41., 41., nphi, 0., bphi); - h_recNoiseEnergy2_HE1 = new TH2F("h_recNoiseEnergy2_HE1", " ", neta, -41., 41., nphi, 0., bphi); - h_recNoiseEnergy0_HE2 = new TH2F("h_recNoiseEnergy0_HE2", " ", neta, -41., 41., nphi, 0., bphi); - h_recNoiseEnergy1_HE2 = new TH2F("h_recNoiseEnergy1_HE2", " ", neta, -41., 41., nphi, 0., bphi); - h_recNoiseEnergy2_HE2 = new TH2F("h_recNoiseEnergy2_HE2", " ", neta, -41., 41., nphi, 0., bphi); - h_recNoiseEnergy0_HE3 = new TH2F("h_recNoiseEnergy0_HE3", " ", neta, -41., 41., nphi, 0., bphi); - h_recNoiseEnergy1_HE3 = new TH2F("h_recNoiseEnergy1_HE3", " ", neta, -41., 41., nphi, 0., bphi); - h_recNoiseEnergy2_HE3 = new TH2F("h_recNoiseEnergy2_HE3", " ", neta, -41., 41., nphi, 0., bphi); - h_recNoiseEnergy0_HE4 = new TH2F("h_recNoiseEnergy0_HE4", " ", neta, -41., 41., nphi, 0., bphi); - h_recNoiseEnergy1_HE4 = new TH2F("h_recNoiseEnergy1_HE4", " ", neta, -41., 41., nphi, 0., bphi); - h_recNoiseEnergy2_HE4 = new TH2F("h_recNoiseEnergy2_HE4", " ", neta, -41., 41., nphi, 0., bphi); - h_recNoiseEnergy0_HE5 = new TH2F("h_recNoiseEnergy0_HE5", " ", neta, -41., 41., nphi, 0., bphi); - h_recNoiseEnergy1_HE5 = new TH2F("h_recNoiseEnergy1_HE5", " ", neta, -41., 41., nphi, 0., bphi); - h_recNoiseEnergy2_HE5 = new TH2F("h_recNoiseEnergy2_HE5", " ", neta, -41., 41., nphi, 0., bphi); - h_recNoiseEnergy0_HE6 = new TH2F("h_recNoiseEnergy0_HE6", " ", neta, -41., 41., nphi, 0., bphi); - h_recNoiseEnergy1_HE6 = new TH2F("h_recNoiseEnergy1_HE6", " ", neta, -41., 41., nphi, 0., bphi); - h_recNoiseEnergy2_HE6 = new TH2F("h_recNoiseEnergy2_HE6", " ", neta, -41., 41., nphi, 0., bphi); - h_recNoiseEnergy0_HE7 = new TH2F("h_recNoiseEnergy0_HE7", " ", neta, -41., 41., nphi, 0., bphi); - h_recNoiseEnergy1_HE7 = new TH2F("h_recNoiseEnergy1_HE7", " ", neta, -41., 41., nphi, 0., bphi); - h_recNoiseEnergy2_HE7 = new TH2F("h_recNoiseEnergy2_HE7", " ", neta, -41., 41., nphi, 0., bphi); + h_recSignalEnergy0_HE1 = fs_->make("h_recSignalEnergy0_HE1", " ", neta, -41., 41., nphi, 0., bphi); + h_recSignalEnergy1_HE1 = fs_->make("h_recSignalEnergy1_HE1", " ", neta, -41., 41., nphi, 0., bphi); + h_recSignalEnergy2_HE1 = fs_->make("h_recSignalEnergy2_HE1", " ", neta, -41., 41., nphi, 0., bphi); + h_recSignalEnergy0_HE2 = fs_->make("h_recSignalEnergy0_HE2", " ", neta, -41., 41., nphi, 0., bphi); + h_recSignalEnergy1_HE2 = fs_->make("h_recSignalEnergy1_HE2", " ", neta, -41., 41., nphi, 0., bphi); + h_recSignalEnergy2_HE2 = fs_->make("h_recSignalEnergy2_HE2", " ", neta, -41., 41., nphi, 0., bphi); + h_recSignalEnergy0_HE3 = fs_->make("h_recSignalEnergy0_HE3", " ", neta, -41., 41., nphi, 0., bphi); + h_recSignalEnergy1_HE3 = fs_->make("h_recSignalEnergy1_HE3", " ", neta, -41., 41., nphi, 0., bphi); + h_recSignalEnergy2_HE3 = fs_->make("h_recSignalEnergy2_HE3", " ", neta, -41., 41., nphi, 0., bphi); + h_recSignalEnergy0_HE4 = fs_->make("h_recSignalEnergy0_HE4", " ", neta, -41., 41., nphi, 0., bphi); + h_recSignalEnergy1_HE4 = fs_->make("h_recSignalEnergy1_HE4", " ", neta, -41., 41., nphi, 0., bphi); + h_recSignalEnergy2_HE4 = fs_->make("h_recSignalEnergy2_HE4", " ", neta, -41., 41., nphi, 0., bphi); + h_recSignalEnergy0_HE5 = fs_->make("h_recSignalEnergy0_HE5", " ", neta, -41., 41., nphi, 0., bphi); + h_recSignalEnergy1_HE5 = fs_->make("h_recSignalEnergy1_HE5", " ", neta, -41., 41., nphi, 0., bphi); + h_recSignalEnergy2_HE5 = fs_->make("h_recSignalEnergy2_HE5", " ", neta, -41., 41., nphi, 0., bphi); + h_recSignalEnergy0_HE6 = fs_->make("h_recSignalEnergy0_HE6", " ", neta, -41., 41., nphi, 0., bphi); + h_recSignalEnergy1_HE6 = fs_->make("h_recSignalEnergy1_HE6", " ", neta, -41., 41., nphi, 0., bphi); + h_recSignalEnergy2_HE6 = fs_->make("h_recSignalEnergy2_HE6", " ", neta, -41., 41., nphi, 0., bphi); + h_recSignalEnergy0_HE7 = fs_->make("h_recSignalEnergy0_HE7", " ", neta, -41., 41., nphi, 0., bphi); + h_recSignalEnergy1_HE7 = fs_->make("h_recSignalEnergy1_HE7", " ", neta, -41., 41., nphi, 0., bphi); + h_recSignalEnergy2_HE7 = fs_->make("h_recSignalEnergy2_HE7", " ", neta, -41., 41., nphi, 0., bphi); + + h_recNoiseEnergy0_HE1 = fs_->make("h_recNoiseEnergy0_HE1", " ", neta, -41., 41., nphi, 0., bphi); + h_recNoiseEnergy1_HE1 = fs_->make("h_recNoiseEnergy1_HE1", " ", neta, -41., 41., nphi, 0., bphi); + h_recNoiseEnergy2_HE1 = fs_->make("h_recNoiseEnergy2_HE1", " ", neta, -41., 41., nphi, 0., bphi); + h_recNoiseEnergy0_HE2 = fs_->make("h_recNoiseEnergy0_HE2", " ", neta, -41., 41., nphi, 0., bphi); + h_recNoiseEnergy1_HE2 = fs_->make("h_recNoiseEnergy1_HE2", " ", neta, -41., 41., nphi, 0., bphi); + h_recNoiseEnergy2_HE2 = fs_->make("h_recNoiseEnergy2_HE2", " ", neta, -41., 41., nphi, 0., bphi); + h_recNoiseEnergy0_HE3 = fs_->make("h_recNoiseEnergy0_HE3", " ", neta, -41., 41., nphi, 0., bphi); + h_recNoiseEnergy1_HE3 = fs_->make("h_recNoiseEnergy1_HE3", " ", neta, -41., 41., nphi, 0., bphi); + h_recNoiseEnergy2_HE3 = fs_->make("h_recNoiseEnergy2_HE3", " ", neta, -41., 41., nphi, 0., bphi); + h_recNoiseEnergy0_HE4 = fs_->make("h_recNoiseEnergy0_HE4", " ", neta, -41., 41., nphi, 0., bphi); + h_recNoiseEnergy1_HE4 = fs_->make("h_recNoiseEnergy1_HE4", " ", neta, -41., 41., nphi, 0., bphi); + h_recNoiseEnergy2_HE4 = fs_->make("h_recNoiseEnergy2_HE4", " ", neta, -41., 41., nphi, 0., bphi); + h_recNoiseEnergy0_HE5 = fs_->make("h_recNoiseEnergy0_HE5", " ", neta, -41., 41., nphi, 0., bphi); + h_recNoiseEnergy1_HE5 = fs_->make("h_recNoiseEnergy1_HE5", " ", neta, -41., 41., nphi, 0., bphi); + h_recNoiseEnergy2_HE5 = fs_->make("h_recNoiseEnergy2_HE5", " ", neta, -41., 41., nphi, 0., bphi); + h_recNoiseEnergy0_HE6 = fs_->make("h_recNoiseEnergy0_HE6", " ", neta, -41., 41., nphi, 0., bphi); + h_recNoiseEnergy1_HE6 = fs_->make("h_recNoiseEnergy1_HE6", " ", neta, -41., 41., nphi, 0., bphi); + h_recNoiseEnergy2_HE6 = fs_->make("h_recNoiseEnergy2_HE6", " ", neta, -41., 41., nphi, 0., bphi); + h_recNoiseEnergy0_HE7 = fs_->make("h_recNoiseEnergy0_HE7", " ", neta, -41., 41., nphi, 0., bphi); + h_recNoiseEnergy1_HE7 = fs_->make("h_recNoiseEnergy1_HE7", " ", neta, -41., 41., nphi, 0., bphi); + h_recNoiseEnergy2_HE7 = fs_->make("h_recNoiseEnergy2_HE7", " ", neta, -41., 41., nphi, 0., bphi); //HF: - h_recSignalEnergy0_HF1 = new TH2F("h_recSignalEnergy0_HF1", " ", neta, -41., 41., nphi, 0., bphi); - h_recSignalEnergy1_HF1 = new TH2F("h_recSignalEnergy1_HF1", " ", neta, -41., 41., nphi, 0., bphi); - h_recSignalEnergy2_HF1 = new TH2F("h_recSignalEnergy2_HF1", " ", neta, -41., 41., nphi, 0., bphi); - h_recSignalEnergy0_HF2 = new TH2F("h_recSignalEnergy0_HF2", " ", neta, -41., 41., nphi, 0., bphi); - h_recSignalEnergy1_HF2 = new TH2F("h_recSignalEnergy1_HF2", " ", neta, -41., 41., nphi, 0., bphi); - h_recSignalEnergy2_HF2 = new TH2F("h_recSignalEnergy2_HF2", " ", neta, -41., 41., nphi, 0., bphi); - - h_recNoiseEnergy0_HF1 = new TH2F("h_recNoiseEnergy0_HF1", " ", neta, -41., 41., nphi, 0., bphi); - h_recNoiseEnergy1_HF1 = new TH2F("h_recNoiseEnergy1_HF1", " ", neta, -41., 41., nphi, 0., bphi); - h_recNoiseEnergy2_HF1 = new TH2F("h_recNoiseEnergy2_HF1", " ", neta, -41., 41., nphi, 0., bphi); - h_recNoiseEnergy0_HF2 = new TH2F("h_recNoiseEnergy0_HF2", " ", neta, -41., 41., nphi, 0., bphi); - h_recNoiseEnergy1_HF2 = new TH2F("h_recNoiseEnergy1_HF2", " ", neta, -41., 41., nphi, 0., bphi); - h_recNoiseEnergy2_HF2 = new TH2F("h_recNoiseEnergy2_HF2", " ", neta, -41., 41., nphi, 0., bphi); + h_recSignalEnergy0_HF1 = fs_->make("h_recSignalEnergy0_HF1", " ", neta, -41., 41., nphi, 0., bphi); + h_recSignalEnergy1_HF1 = fs_->make("h_recSignalEnergy1_HF1", " ", neta, -41., 41., nphi, 0., bphi); + h_recSignalEnergy2_HF1 = fs_->make("h_recSignalEnergy2_HF1", " ", neta, -41., 41., nphi, 0., bphi); + h_recSignalEnergy0_HF2 = fs_->make("h_recSignalEnergy0_HF2", " ", neta, -41., 41., nphi, 0., bphi); + h_recSignalEnergy1_HF2 = fs_->make("h_recSignalEnergy1_HF2", " ", neta, -41., 41., nphi, 0., bphi); + h_recSignalEnergy2_HF2 = fs_->make("h_recSignalEnergy2_HF2", " ", neta, -41., 41., nphi, 0., bphi); + + h_recNoiseEnergy0_HF1 = fs_->make("h_recNoiseEnergy0_HF1", " ", neta, -41., 41., nphi, 0., bphi); + h_recNoiseEnergy1_HF1 = fs_->make("h_recNoiseEnergy1_HF1", " ", neta, -41., 41., nphi, 0., bphi); + h_recNoiseEnergy2_HF1 = fs_->make("h_recNoiseEnergy2_HF1", " ", neta, -41., 41., nphi, 0., bphi); + h_recNoiseEnergy0_HF2 = fs_->make("h_recNoiseEnergy0_HF2", " ", neta, -41., 41., nphi, 0., bphi); + h_recNoiseEnergy1_HF2 = fs_->make("h_recNoiseEnergy1_HF2", " ", neta, -41., 41., nphi, 0., bphi); + h_recNoiseEnergy2_HF2 = fs_->make("h_recNoiseEnergy2_HF2", " ", neta, -41., 41., nphi, 0., bphi); /////////////////////////////////////////////////////////////////////////////////////////////////// raddam: // RADDAM: @@ -7928,213 +6645,220 @@ void CMTRawAnalyzer::beginJob() { int min80 = -100.; int max80 = 9000.; // fill for each digi (=each event, each channel) - h_mapDepth1RADDAM_HE = new TH2F("h_mapDepth1RADDAM_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth2RADDAM_HE = new TH2F("h_mapDepth2RADDAM_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth3RADDAM_HE = new TH2F("h_mapDepth3RADDAM_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth1RADDAM0_HE = new TH2F("h_mapDepth1RADDAM0_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth2RADDAM0_HE = new TH2F("h_mapDepth2RADDAM0_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth3RADDAM0_HE = new TH2F("h_mapDepth3RADDAM0_HE", " ", neta, -41., 41., nphi, 0., bphi); - - h_sigLayer1RADDAM_HE = new TH1F("h_sigLayer1RADDAM_HE", " ", neta, -41., 41.); - h_sigLayer2RADDAM_HE = new TH1F("h_sigLayer2RADDAM_HE", " ", neta, -41., 41.); - h_sigLayer1RADDAM0_HE = new TH1F("h_sigLayer1RADDAM0_HE", " ", neta, -41., 41.); - h_sigLayer2RADDAM0_HE = new TH1F("h_sigLayer2RADDAM0_HE", " ", neta, -41., 41.); - h_AamplitudewithPedSubtr_RADDAM_HE = new TH1F("h_AamplitudewithPedSubtr_RADDAM_HE", " ", 100, min80, max80); + h_mapDepth1RADDAM_HE = fs_->make("h_mapDepth1RADDAM_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth2RADDAM_HE = fs_->make("h_mapDepth2RADDAM_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth3RADDAM_HE = fs_->make("h_mapDepth3RADDAM_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth1RADDAM0_HE = fs_->make("h_mapDepth1RADDAM0_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth2RADDAM0_HE = fs_->make("h_mapDepth2RADDAM0_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth3RADDAM0_HE = fs_->make("h_mapDepth3RADDAM0_HE", " ", neta, -41., 41., nphi, 0., bphi); + + h_sigLayer1RADDAM_HE = fs_->make("h_sigLayer1RADDAM_HE", " ", neta, -41., 41.); + h_sigLayer2RADDAM_HE = fs_->make("h_sigLayer2RADDAM_HE", " ", neta, -41., 41.); + h_sigLayer1RADDAM0_HE = fs_->make("h_sigLayer1RADDAM0_HE", " ", neta, -41., 41.); + h_sigLayer2RADDAM0_HE = fs_->make("h_sigLayer2RADDAM0_HE", " ", neta, -41., 41.); + h_AamplitudewithPedSubtr_RADDAM_HE = fs_->make("h_AamplitudewithPedSubtr_RADDAM_HE", " ", 100, min80, max80); h_AamplitudewithPedSubtr_RADDAM_HEzoom0 = - new TH1F("h_AamplitudewithPedSubtr_RADDAM_HEzoom0", " ", 100, min80, 4000.); + fs_->make("h_AamplitudewithPedSubtr_RADDAM_HEzoom0", " ", 100, min80, 4000.); h_AamplitudewithPedSubtr_RADDAM_HEzoom1 = - new TH1F("h_AamplitudewithPedSubtr_RADDAM_HEzoom1", " ", 100, min80, 1000.); - h_mapDepth3RADDAM16_HE = new TH1F("h_mapDepth3RADDAM16_HE", " ", 100, min80, max80); - h_A_Depth1RADDAM_HE = new TH1F("h_A_Depth1RADDAM_HE", " ", 100, min80, max80); - h_A_Depth2RADDAM_HE = new TH1F("h_A_Depth2RADDAM_HE", " ", 100, min80, max80); - h_A_Depth3RADDAM_HE = new TH1F("h_A_Depth3RADDAM_HE", " ", 100, min80, max80); + fs_->make("h_AamplitudewithPedSubtr_RADDAM_HEzoom1", " ", 100, min80, 1000.); + h_mapDepth3RADDAM16_HE = fs_->make("h_mapDepth3RADDAM16_HE", " ", 100, min80, max80); + h_A_Depth1RADDAM_HE = fs_->make("h_A_Depth1RADDAM_HE", " ", 100, min80, max80); + h_A_Depth2RADDAM_HE = fs_->make("h_A_Depth2RADDAM_HE", " ", 100, min80, max80); + h_A_Depth3RADDAM_HE = fs_->make("h_A_Depth3RADDAM_HE", " ", 100, min80, max80); int min90 = 0.; int max90 = 5000.; - h_sumphiEta16Depth3RADDAM_HED2 = new TH1F("h_sumphiEta16Depth3RADDAM_HED2", " ", 100, min90, 70. * max90); - h_Eta16Depth3RADDAM_HED2 = new TH1F("h_Eta16Depth3RADDAM_HED2", " ", 100, min90, max90); - h_NphiForEta16Depth3RADDAM_HED2 = new TH1F("h_NphiForEta16Depth3RADDAM_HED2", " ", 100, 0, 100.); - h_sumphiEta16Depth3RADDAM_HED2P = new TH1F("h_sumphiEta16Depth3RADDAM_HED2P", " ", 100, min90, 70. * max90); - h_Eta16Depth3RADDAM_HED2P = new TH1F("h_Eta16Depth3RADDAM_HED2P", " ", 100, min90, max90); - h_NphiForEta16Depth3RADDAM_HED2P = new TH1F("h_NphiForEta16Depth3RADDAM_HED2P", " ", 100, 0, 100.); - h_sumphiEta16Depth3RADDAM_HED2ALL = new TH1F("h_sumphiEta16Depth3RADDAM_HED2ALL", " ", 100, min90, 70. * max90); - h_Eta16Depth3RADDAM_HED2ALL = new TH1F("h_Eta16Depth3RADDAM_HED2ALL", " ", 100, min90, max90); - h_NphiForEta16Depth3RADDAM_HED2ALL = new TH1F("h_NphiForEta16Depth3RADDAM_HED2ALL", " ", 100, 0, 100.); - h_sigLayer1RADDAM5_HE = new TH1F("h_sigLayer1RADDAM5_HE", " ", neta, -41., 41.); - h_sigLayer2RADDAM5_HE = new TH1F("h_sigLayer2RADDAM5_HE", " ", neta, -41., 41.); - h_sigLayer1RADDAM6_HE = new TH1F("h_sigLayer1RADDAM6_HE", " ", neta, -41., 41.); - h_sigLayer2RADDAM6_HE = new TH1F("h_sigLayer2RADDAM6_HE", " ", neta, -41., 41.); - h_sigLayer1RADDAM5_HED2 = new TH1F("h_sigLayer1RADDAM5_HED2", " ", neta, -41., 41.); - h_sigLayer2RADDAM5_HED2 = new TH1F("h_sigLayer2RADDAM5_HED2", " ", neta, -41., 41.); - h_sigLayer1RADDAM6_HED2 = new TH1F("h_sigLayer1RADDAM6_HED2", " ", neta, -41., 41.); - h_sigLayer2RADDAM6_HED2 = new TH1F("h_sigLayer2RADDAM6_HED2", " ", neta, -41., 41.); - - h_numberofhitsHFtest = new TH1F("h_numberofhitsHFtest", " ", 100, 0., 30000.); - h_AmplitudeHFtest = new TH1F("h_AmplitudeHFtest", " ", 100, 0., 300000.); - h_totalAmplitudeHF = new TH1F("h_totalAmplitudeHF", " ", 100, 0., 100000000000.); - h_totalAmplitudeHFperEvent = new TH1F("h_totalAmplitudeHFperEvent", " ", 1000, 1., 1001.); + h_sumphiEta16Depth3RADDAM_HED2 = fs_->make("h_sumphiEta16Depth3RADDAM_HED2", " ", 100, min90, 70. * max90); + h_Eta16Depth3RADDAM_HED2 = fs_->make("h_Eta16Depth3RADDAM_HED2", " ", 100, min90, max90); + h_NphiForEta16Depth3RADDAM_HED2 = fs_->make("h_NphiForEta16Depth3RADDAM_HED2", " ", 100, 0, 100.); + h_sumphiEta16Depth3RADDAM_HED2P = fs_->make("h_sumphiEta16Depth3RADDAM_HED2P", " ", 100, min90, 70. * max90); + h_Eta16Depth3RADDAM_HED2P = fs_->make("h_Eta16Depth3RADDAM_HED2P", " ", 100, min90, max90); + h_NphiForEta16Depth3RADDAM_HED2P = fs_->make("h_NphiForEta16Depth3RADDAM_HED2P", " ", 100, 0, 100.); + h_sumphiEta16Depth3RADDAM_HED2ALL = + fs_->make("h_sumphiEta16Depth3RADDAM_HED2ALL", " ", 100, min90, 70. * max90); + h_Eta16Depth3RADDAM_HED2ALL = fs_->make("h_Eta16Depth3RADDAM_HED2ALL", " ", 100, min90, max90); + h_NphiForEta16Depth3RADDAM_HED2ALL = fs_->make("h_NphiForEta16Depth3RADDAM_HED2ALL", " ", 100, 0, 100.); + h_sigLayer1RADDAM5_HE = fs_->make("h_sigLayer1RADDAM5_HE", " ", neta, -41., 41.); + h_sigLayer2RADDAM5_HE = fs_->make("h_sigLayer2RADDAM5_HE", " ", neta, -41., 41.); + h_sigLayer1RADDAM6_HE = fs_->make("h_sigLayer1RADDAM6_HE", " ", neta, -41., 41.); + h_sigLayer2RADDAM6_HE = fs_->make("h_sigLayer2RADDAM6_HE", " ", neta, -41., 41.); + h_sigLayer1RADDAM5_HED2 = fs_->make("h_sigLayer1RADDAM5_HED2", " ", neta, -41., 41.); + h_sigLayer2RADDAM5_HED2 = fs_->make("h_sigLayer2RADDAM5_HED2", " ", neta, -41., 41.); + h_sigLayer1RADDAM6_HED2 = fs_->make("h_sigLayer1RADDAM6_HED2", " ", neta, -41., 41.); + h_sigLayer2RADDAM6_HED2 = fs_->make("h_sigLayer2RADDAM6_HED2", " ", neta, -41., 41.); + + h_numberofhitsHFtest = fs_->make("h_numberofhitsHFtest", " ", 100, 0., 30000.); + h_AmplitudeHFtest = fs_->make("h_AmplitudeHFtest", " ", 100, 0., 300000.); + h_totalAmplitudeHF = fs_->make("h_totalAmplitudeHF", " ", 100, 0., 100000000000.); + h_totalAmplitudeHFperEvent = fs_->make("h_totalAmplitudeHFperEvent", " ", 1000, 1., 1001.); // fullAmplitude: - h_ADCAmplZoom1_HF = new TH1F("h_ADCAmplZoom1_HF", " ", 100, 0., 1000000.); - h_ADCAmpl_HF = new TH1F("h_ADCAmpl_HF", " ", 250, 0., 500000.); - h_ADCAmplrest1_HF = new TH1F("h_ADCAmplrest1_HF", " ", 100, 0., 1000.); - h_ADCAmplrest6_HF = new TH1F("h_ADCAmplrest6_HF", " ", 100, 0., 10000.); - - h_mapDepth1ADCAmpl225_HF = new TH2F("h_mapDepth1ADCAmpl225_HF", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth2ADCAmpl225_HF = new TH2F("h_mapDepth2ADCAmpl225_HF", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth1ADCAmpl225Copy_HF = new TH2F("h_mapDepth1ADCAmpl225Copy_HF", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth2ADCAmpl225Copy_HF = new TH2F("h_mapDepth2ADCAmpl225Copy_HF", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth1ADCAmpl_HF = new TH2F("h_mapDepth1ADCAmpl_HF", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth2ADCAmpl_HF = new TH2F("h_mapDepth2ADCAmpl_HF", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth3ADCAmpl225_HF = new TH2F("h_mapDepth3ADCAmpl225_HF", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth4ADCAmpl225_HF = new TH2F("h_mapDepth4ADCAmpl225_HF", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth3ADCAmpl225Copy_HF = new TH2F("h_mapDepth3ADCAmpl225Copy_HF", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth4ADCAmpl225Copy_HF = new TH2F("h_mapDepth4ADCAmpl225Copy_HF", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth3ADCAmpl_HF = new TH2F("h_mapDepth3ADCAmpl_HF", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth4ADCAmpl_HF = new TH2F("h_mapDepth4ADCAmpl_HF", " ", neta, -41., 41., nphi, 0., bphi); - h_TSmeanA_HF = new TH1F("h_TSmeanA_HF", " ", 100, -1., 11.); - h_mapDepth1TSmeanA225_HF = new TH2F("h_mapDepth1TSmeanA225_HF", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth2TSmeanA225_HF = new TH2F("h_mapDepth2TSmeanA225_HF", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth1TSmeanA_HF = new TH2F("h_mapDepth1TSmeanA_HF", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth2TSmeanA_HF = new TH2F("h_mapDepth2TSmeanA_HF", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth3TSmeanA225_HF = new TH2F("h_mapDepth3TSmeanA225_HF", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth4TSmeanA225_HF = new TH2F("h_mapDepth4TSmeanA225_HF", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth3TSmeanA_HF = new TH2F("h_mapDepth3TSmeanA_HF", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth4TSmeanA_HF = new TH2F("h_mapDepth4TSmeanA_HF", " ", neta, -41., 41., nphi, 0., bphi); - h_Amplitude_HF = new TH1F("h_Amplitude_HF", " ", 100, 0., 5.); - h_TSmaxA_HF = new TH1F("h_TSmaxA_HF", " ", 100, -1., 11.); - h_mapDepth1TSmaxA225_HF = new TH2F("h_mapDepth1TSmaxA225_HF", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth2TSmaxA225_HF = new TH2F("h_mapDepth2TSmaxA225_HF", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth1TSmaxA_HF = new TH2F("h_mapDepth1TSmaxA_HF", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth2TSmaxA_HF = new TH2F("h_mapDepth2TSmaxA_HF", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth3TSmaxA225_HF = new TH2F("h_mapDepth3TSmaxA225_HF", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth4TSmaxA225_HF = new TH2F("h_mapDepth4TSmaxA225_HF", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth3TSmaxA_HF = new TH2F("h_mapDepth3TSmaxA_HF", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth4TSmaxA_HF = new TH2F("h_mapDepth4TSmaxA_HF", " ", neta, -41., 41., nphi, 0., bphi); - h_Amplitude_HF = new TH1F("h_Amplitude_HF", " ", 100, 0., 5.); - h_mapDepth1Amplitude225_HF = new TH2F("h_mapDepth1Amplitude225_HF", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth2Amplitude225_HF = new TH2F("h_mapDepth2Amplitude225_HF", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth1Amplitude_HF = new TH2F("h_mapDepth1Amplitude_HF", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth2Amplitude_HF = new TH2F("h_mapDepth2Amplitude_HF", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth3Amplitude225_HF = new TH2F("h_mapDepth3Amplitude225_HF", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth4Amplitude225_HF = new TH2F("h_mapDepth4Amplitude225_HF", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth3Amplitude_HF = new TH2F("h_mapDepth3Amplitude_HF", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth4Amplitude_HF = new TH2F("h_mapDepth4Amplitude_HF", " ", neta, -41., 41., nphi, 0., bphi); + h_ADCAmplZoom1_HF = fs_->make("h_ADCAmplZoom1_HF", " ", 100, 0., 1000000.); + h_ADCAmpl_HF = fs_->make("h_ADCAmpl_HF", " ", 250, 0., 500000.); + h_ADCAmplrest1_HF = fs_->make("h_ADCAmplrest1_HF", " ", 100, 0., 1000.); + h_ADCAmplrest6_HF = fs_->make("h_ADCAmplrest6_HF", " ", 100, 0., 10000.); + + h_mapDepth1ADCAmpl225_HF = fs_->make("h_mapDepth1ADCAmpl225_HF", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth2ADCAmpl225_HF = fs_->make("h_mapDepth2ADCAmpl225_HF", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth1ADCAmpl225Copy_HF = + fs_->make("h_mapDepth1ADCAmpl225Copy_HF", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth2ADCAmpl225Copy_HF = + fs_->make("h_mapDepth2ADCAmpl225Copy_HF", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth1ADCAmpl_HF = fs_->make("h_mapDepth1ADCAmpl_HF", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth2ADCAmpl_HF = fs_->make("h_mapDepth2ADCAmpl_HF", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth3ADCAmpl225_HF = fs_->make("h_mapDepth3ADCAmpl225_HF", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth4ADCAmpl225_HF = fs_->make("h_mapDepth4ADCAmpl225_HF", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth3ADCAmpl225Copy_HF = + fs_->make("h_mapDepth3ADCAmpl225Copy_HF", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth4ADCAmpl225Copy_HF = + fs_->make("h_mapDepth4ADCAmpl225Copy_HF", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth3ADCAmpl_HF = fs_->make("h_mapDepth3ADCAmpl_HF", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth4ADCAmpl_HF = fs_->make("h_mapDepth4ADCAmpl_HF", " ", neta, -41., 41., nphi, 0., bphi); + h_TSmeanA_HF = fs_->make("h_TSmeanA_HF", " ", 100, -1., 11.); + h_mapDepth1TSmeanA225_HF = fs_->make("h_mapDepth1TSmeanA225_HF", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth2TSmeanA225_HF = fs_->make("h_mapDepth2TSmeanA225_HF", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth1TSmeanA_HF = fs_->make("h_mapDepth1TSmeanA_HF", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth2TSmeanA_HF = fs_->make("h_mapDepth2TSmeanA_HF", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth3TSmeanA225_HF = fs_->make("h_mapDepth3TSmeanA225_HF", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth4TSmeanA225_HF = fs_->make("h_mapDepth4TSmeanA225_HF", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth3TSmeanA_HF = fs_->make("h_mapDepth3TSmeanA_HF", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth4TSmeanA_HF = fs_->make("h_mapDepth4TSmeanA_HF", " ", neta, -41., 41., nphi, 0., bphi); + h_Amplitude_HF = fs_->make("h_Amplitude_HF", " ", 100, 0., 5.); + h_TSmaxA_HF = fs_->make("h_TSmaxA_HF", " ", 100, -1., 11.); + h_mapDepth1TSmaxA225_HF = fs_->make("h_mapDepth1TSmaxA225_HF", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth2TSmaxA225_HF = fs_->make("h_mapDepth2TSmaxA225_HF", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth1TSmaxA_HF = fs_->make("h_mapDepth1TSmaxA_HF", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth2TSmaxA_HF = fs_->make("h_mapDepth2TSmaxA_HF", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth3TSmaxA225_HF = fs_->make("h_mapDepth3TSmaxA225_HF", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth4TSmaxA225_HF = fs_->make("h_mapDepth4TSmaxA225_HF", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth3TSmaxA_HF = fs_->make("h_mapDepth3TSmaxA_HF", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth4TSmaxA_HF = fs_->make("h_mapDepth4TSmaxA_HF", " ", neta, -41., 41., nphi, 0., bphi); + h_Amplitude_HF = fs_->make("h_Amplitude_HF", " ", 100, 0., 5.); + h_mapDepth1Amplitude225_HF = fs_->make("h_mapDepth1Amplitude225_HF", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth2Amplitude225_HF = fs_->make("h_mapDepth2Amplitude225_HF", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth1Amplitude_HF = fs_->make("h_mapDepth1Amplitude_HF", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth2Amplitude_HF = fs_->make("h_mapDepth2Amplitude_HF", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth3Amplitude225_HF = fs_->make("h_mapDepth3Amplitude225_HF", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth4Amplitude225_HF = fs_->make("h_mapDepth4Amplitude225_HF", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth3Amplitude_HF = fs_->make("h_mapDepth3Amplitude_HF", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth4Amplitude_HF = fs_->make("h_mapDepth4Amplitude_HF", " ", neta, -41., 41., nphi, 0., bphi); // Ratio: - h_Ampl_HF = new TH1F("h_Ampl_HF", " ", 100, 0., 1.1); - h_mapDepth1Ampl047_HF = new TH2F("h_mapDepth1Ampl047_HF", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth2Ampl047_HF = new TH2F("h_mapDepth2Ampl047_HF", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth1Ampl_HF = new TH2F("h_mapDepth1Ampl_HF", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth2Ampl_HF = new TH2F("h_mapDepth2Ampl_HF", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth1AmplE34_HF = new TH2F("h_mapDepth1AmplE34_HF", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth2AmplE34_HF = new TH2F("h_mapDepth2AmplE34_HF", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth1_HF = new TH2F("h_mapDepth1_HF", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth2_HF = new TH2F("h_mapDepth2_HF", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth3Ampl047_HF = new TH2F("h_mapDepth3Ampl047_HF", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth4Ampl047_HF = new TH2F("h_mapDepth4Ampl047_HF", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth3Ampl_HF = new TH2F("h_mapDepth3Ampl_HF", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth4Ampl_HF = new TH2F("h_mapDepth4Ampl_HF", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth3AmplE34_HF = new TH2F("h_mapDepth3AmplE34_HF", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth4AmplE34_HF = new TH2F("h_mapDepth4AmplE34_HF", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth3_HF = new TH2F("h_mapDepth3_HF", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth4_HF = new TH2F("h_mapDepth4_HF", " ", neta, -41., 41., nphi, 0., bphi); + h_Ampl_HF = fs_->make("h_Ampl_HF", " ", 100, 0., 1.1); + h_mapDepth1Ampl047_HF = fs_->make("h_mapDepth1Ampl047_HF", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth2Ampl047_HF = fs_->make("h_mapDepth2Ampl047_HF", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth1Ampl_HF = fs_->make("h_mapDepth1Ampl_HF", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth2Ampl_HF = fs_->make("h_mapDepth2Ampl_HF", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth1AmplE34_HF = fs_->make("h_mapDepth1AmplE34_HF", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth2AmplE34_HF = fs_->make("h_mapDepth2AmplE34_HF", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth1_HF = fs_->make("h_mapDepth1_HF", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth2_HF = fs_->make("h_mapDepth2_HF", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth3Ampl047_HF = fs_->make("h_mapDepth3Ampl047_HF", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth4Ampl047_HF = fs_->make("h_mapDepth4Ampl047_HF", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth3Ampl_HF = fs_->make("h_mapDepth3Ampl_HF", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth4Ampl_HF = fs_->make("h_mapDepth4Ampl_HF", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth3AmplE34_HF = fs_->make("h_mapDepth3AmplE34_HF", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth4AmplE34_HF = fs_->make("h_mapDepth4AmplE34_HF", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth3_HF = fs_->make("h_mapDepth3_HF", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth4_HF = fs_->make("h_mapDepth4_HF", " ", neta, -41., 41., nphi, 0., bphi); //////////////////////////////////////////////////////////////////////////////////////////////// HO - h_numberofhitsHOtest = new TH1F("h_numberofhitsHOtest", " ", 100, 0., 30000.); - h_AmplitudeHOtest = new TH1F("h_AmplitudeHOtest", " ", 100, 0., 300000.); - h_totalAmplitudeHO = new TH1F("h_totalAmplitudeHO", " ", 100, 0., 100000000.); - h_totalAmplitudeHOperEvent = new TH1F("h_totalAmplitudeHOperEvent", " ", 1000, 1., 1001.); + h_numberofhitsHOtest = fs_->make("h_numberofhitsHOtest", " ", 100, 0., 30000.); + h_AmplitudeHOtest = fs_->make("h_AmplitudeHOtest", " ", 100, 0., 300000.); + h_totalAmplitudeHO = fs_->make("h_totalAmplitudeHO", " ", 100, 0., 100000000.); + h_totalAmplitudeHOperEvent = fs_->make("h_totalAmplitudeHOperEvent", " ", 1000, 1., 1001.); // fullAmplitude: - h_ADCAmpl_HO = new TH1F("h_ADCAmpl_HO", " ", 100, 0., 7000.); - h_ADCAmplrest1_HO = new TH1F("h_ADCAmplrest1_HO", " ", 100, 0., 150.); - h_ADCAmplrest6_HO = new TH1F("h_ADCAmplrest6_HO", " ", 100, 0., 500.); - - h_ADCAmplZoom1_HO = new TH1F("h_ADCAmplZoom1_HO", " ", 100, -20., 280.); - h_ADCAmpl_HO_copy = new TH1F("h_ADCAmpl_HO_copy", " ", 100, 0., 30000.); - h_mapDepth4ADCAmpl225_HO = new TH2F("h_mapDepth4ADCAmpl225_HO", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth4ADCAmpl225Copy_HO = new TH2F("h_mapDepth4ADCAmpl225Copy_HO", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth4ADCAmpl_HO = new TH2F("h_mapDepth4ADCAmpl_HO", " ", neta, -41., 41., nphi, 0., bphi); - h_TSmeanA_HO = new TH1F("h_TSmeanA_HO", " ", 100, 0., 10.); - h_mapDepth4TSmeanA225_HO = new TH2F("h_mapDepth4TSmeanA225_HO", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth4TSmeanA_HO = new TH2F("h_mapDepth4TSmeanA_HO", " ", neta, -41., 41., nphi, 0., bphi); - h_TSmaxA_HO = new TH1F("h_TSmaxA_HO", " ", 100, 0., 10.); - h_mapDepth4TSmaxA225_HO = new TH2F("h_mapDepth4TSmaxA225_HO", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth4TSmaxA_HO = new TH2F("h_mapDepth4TSmaxA_HO", " ", neta, -41., 41., nphi, 0., bphi); - h_Amplitude_HO = new TH1F("h_Amplitude_HO", " ", 100, 0., 5.); - h_mapDepth4Amplitude225_HO = new TH2F("h_mapDepth4Amplitude225_HO", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth4Amplitude_HO = new TH2F("h_mapDepth4Amplitude_HO", " ", neta, -41., 41., nphi, 0., bphi); + h_ADCAmpl_HO = fs_->make("h_ADCAmpl_HO", " ", 100, 0., 7000.); + h_ADCAmplrest1_HO = fs_->make("h_ADCAmplrest1_HO", " ", 100, 0., 150.); + h_ADCAmplrest6_HO = fs_->make("h_ADCAmplrest6_HO", " ", 100, 0., 500.); + + h_ADCAmplZoom1_HO = fs_->make("h_ADCAmplZoom1_HO", " ", 100, -20., 280.); + h_ADCAmpl_HO_copy = fs_->make("h_ADCAmpl_HO_copy", " ", 100, 0., 30000.); + h_mapDepth4ADCAmpl225_HO = fs_->make("h_mapDepth4ADCAmpl225_HO", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth4ADCAmpl225Copy_HO = + fs_->make("h_mapDepth4ADCAmpl225Copy_HO", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth4ADCAmpl_HO = fs_->make("h_mapDepth4ADCAmpl_HO", " ", neta, -41., 41., nphi, 0., bphi); + h_TSmeanA_HO = fs_->make("h_TSmeanA_HO", " ", 100, 0., 10.); + h_mapDepth4TSmeanA225_HO = fs_->make("h_mapDepth4TSmeanA225_HO", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth4TSmeanA_HO = fs_->make("h_mapDepth4TSmeanA_HO", " ", neta, -41., 41., nphi, 0., bphi); + h_TSmaxA_HO = fs_->make("h_TSmaxA_HO", " ", 100, 0., 10.); + h_mapDepth4TSmaxA225_HO = fs_->make("h_mapDepth4TSmaxA225_HO", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth4TSmaxA_HO = fs_->make("h_mapDepth4TSmaxA_HO", " ", neta, -41., 41., nphi, 0., bphi); + h_Amplitude_HO = fs_->make("h_Amplitude_HO", " ", 100, 0., 5.); + h_mapDepth4Amplitude225_HO = fs_->make("h_mapDepth4Amplitude225_HO", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth4Amplitude_HO = fs_->make("h_mapDepth4Amplitude_HO", " ", neta, -41., 41., nphi, 0., bphi); // Ratio: - h_Ampl_HO = new TH1F("h_Ampl_HO", " ", 100, 0., 1.1); - h_mapDepth4Ampl047_HO = new TH2F("h_mapDepth4Ampl047_HO", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth4Ampl_HO = new TH2F("h_mapDepth4Ampl_HO", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth4AmplE34_HO = new TH2F("h_mapDepth4AmplE34_HO", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth4_HO = new TH2F("h_mapDepth4_HO", " ", neta, -41., 41., nphi, 0., bphi); + h_Ampl_HO = fs_->make("h_Ampl_HO", " ", 100, 0., 1.1); + h_mapDepth4Ampl047_HO = fs_->make("h_mapDepth4Ampl047_HO", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth4Ampl_HO = fs_->make("h_mapDepth4Ampl_HO", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth4AmplE34_HO = fs_->make("h_mapDepth4AmplE34_HO", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth4_HO = fs_->make("h_mapDepth4_HO", " ", neta, -41., 41., nphi, 0., bphi); ////////////////////////////////////////////////////////////////////////////////////// int baP = 4000; float baR = 0.; float baR2 = baP; - h_bcnnbadchannels_depth1_HB = new TH1F("h_bcnnbadchannels_depth1_HB", " ", baP, baR, baR2); - h_bcnnbadchannels_depth2_HB = new TH1F("h_bcnnbadchannels_depth2_HB", " ", baP, baR, baR2); - h_bcnnbadchannels_depth1_HE = new TH1F("h_bcnnbadchannels_depth1_HE", " ", baP, baR, baR2); - h_bcnnbadchannels_depth2_HE = new TH1F("h_bcnnbadchannels_depth2_HE", " ", baP, baR, baR2); - h_bcnnbadchannels_depth3_HE = new TH1F("h_bcnnbadchannels_depth3_HE", " ", baP, baR, baR2); - h_bcnnbadchannels_depth4_HO = new TH1F("h_bcnnbadchannels_depth4_HO", " ", baP, baR, baR2); - h_bcnnbadchannels_depth1_HF = new TH1F("h_bcnnbadchannels_depth1_HF", " ", baP, baR, baR2); - h_bcnnbadchannels_depth2_HF = new TH1F("h_bcnnbadchannels_depth2_HF", " ", baP, baR, baR2); - h_bcnbadrate0_depth1_HB = new TH1F("h_bcnbadrate0_depth1_HB", " ", baP, baR, baR2); - h_bcnbadrate0_depth2_HB = new TH1F("h_bcnbadrate0_depth2_HB", " ", baP, baR, baR2); - h_bcnbadrate0_depth1_HE = new TH1F("h_bcnbadrate0_depth1_HE", " ", baP, baR, baR2); - h_bcnbadrate0_depth2_HE = new TH1F("h_bcnbadrate0_depth2_HE", " ", baP, baR, baR2); - h_bcnbadrate0_depth3_HE = new TH1F("h_bcnbadrate0_depth3_HE", " ", baP, baR, baR2); - h_bcnbadrate0_depth4_HO = new TH1F("h_bcnbadrate0_depth4_HO", " ", baP, baR, baR2); - h_bcnbadrate0_depth1_HF = new TH1F("h_bcnbadrate0_depth1_HF", " ", baP, baR, baR2); - h_bcnbadrate0_depth2_HF = new TH1F("h_bcnbadrate0_depth2_HF", " ", baP, baR, baR2); - - h_bcnvsamplitude_HB = new TH1F("h_bcnvsamplitude_HB", " ", baP, baR, baR2); - h_bcnvsamplitude_HE = new TH1F("h_bcnvsamplitude_HE", " ", baP, baR, baR2); - h_bcnvsamplitude_HF = new TH1F("h_bcnvsamplitude_HF", " ", baP, baR, baR2); - h_bcnvsamplitude_HO = new TH1F("h_bcnvsamplitude_HO", " ", baP, baR, baR2); - h_bcnvsamplitude0_HB = new TH1F("h_bcnvsamplitude0_HB", " ", baP, baR, baR2); - h_bcnvsamplitude0_HE = new TH1F("h_bcnvsamplitude0_HE", " ", baP, baR, baR2); - h_bcnvsamplitude0_HF = new TH1F("h_bcnvsamplitude0_HF", " ", baP, baR, baR2); - h_bcnvsamplitude0_HO = new TH1F("h_bcnvsamplitude0_HO", " ", baP, baR, baR2); + h_bcnnbadchannels_depth1_HB = fs_->make("h_bcnnbadchannels_depth1_HB", " ", baP, baR, baR2); + h_bcnnbadchannels_depth2_HB = fs_->make("h_bcnnbadchannels_depth2_HB", " ", baP, baR, baR2); + h_bcnnbadchannels_depth1_HE = fs_->make("h_bcnnbadchannels_depth1_HE", " ", baP, baR, baR2); + h_bcnnbadchannels_depth2_HE = fs_->make("h_bcnnbadchannels_depth2_HE", " ", baP, baR, baR2); + h_bcnnbadchannels_depth3_HE = fs_->make("h_bcnnbadchannels_depth3_HE", " ", baP, baR, baR2); + h_bcnnbadchannels_depth4_HO = fs_->make("h_bcnnbadchannels_depth4_HO", " ", baP, baR, baR2); + h_bcnnbadchannels_depth1_HF = fs_->make("h_bcnnbadchannels_depth1_HF", " ", baP, baR, baR2); + h_bcnnbadchannels_depth2_HF = fs_->make("h_bcnnbadchannels_depth2_HF", " ", baP, baR, baR2); + h_bcnbadrate0_depth1_HB = fs_->make("h_bcnbadrate0_depth1_HB", " ", baP, baR, baR2); + h_bcnbadrate0_depth2_HB = fs_->make("h_bcnbadrate0_depth2_HB", " ", baP, baR, baR2); + h_bcnbadrate0_depth1_HE = fs_->make("h_bcnbadrate0_depth1_HE", " ", baP, baR, baR2); + h_bcnbadrate0_depth2_HE = fs_->make("h_bcnbadrate0_depth2_HE", " ", baP, baR, baR2); + h_bcnbadrate0_depth3_HE = fs_->make("h_bcnbadrate0_depth3_HE", " ", baP, baR, baR2); + h_bcnbadrate0_depth4_HO = fs_->make("h_bcnbadrate0_depth4_HO", " ", baP, baR, baR2); + h_bcnbadrate0_depth1_HF = fs_->make("h_bcnbadrate0_depth1_HF", " ", baP, baR, baR2); + h_bcnbadrate0_depth2_HF = fs_->make("h_bcnbadrate0_depth2_HF", " ", baP, baR, baR2); + + h_bcnvsamplitude_HB = fs_->make("h_bcnvsamplitude_HB", " ", baP, baR, baR2); + h_bcnvsamplitude_HE = fs_->make("h_bcnvsamplitude_HE", " ", baP, baR, baR2); + h_bcnvsamplitude_HF = fs_->make("h_bcnvsamplitude_HF", " ", baP, baR, baR2); + h_bcnvsamplitude_HO = fs_->make("h_bcnvsamplitude_HO", " ", baP, baR, baR2); + h_bcnvsamplitude0_HB = fs_->make("h_bcnvsamplitude0_HB", " ", baP, baR, baR2); + h_bcnvsamplitude0_HE = fs_->make("h_bcnvsamplitude0_HE", " ", baP, baR, baR2); + h_bcnvsamplitude0_HF = fs_->make("h_bcnvsamplitude0_HF", " ", baP, baR, baR2); + h_bcnvsamplitude0_HO = fs_->make("h_bcnvsamplitude0_HO", " ", baP, baR, baR2); int zaP = 1000; float zaR = 10000000.; float zaR2 = 50000000.; - h_orbitNumvsamplitude_HB = new TH1F("h_orbitNumvsamplitude_HB", " ", zaP, zaR, zaR2); - h_orbitNumvsamplitude_HE = new TH1F("h_orbitNumvsamplitude_HE", " ", zaP, zaR, zaR2); - h_orbitNumvsamplitude_HF = new TH1F("h_orbitNumvsamplitude_HF", " ", zaP, zaR, zaR2); - h_orbitNumvsamplitude_HO = new TH1F("h_orbitNumvsamplitude_HO", " ", zaP, zaR, zaR2); - h_orbitNumvsamplitude0_HB = new TH1F("h_orbitNumvsamplitude0_HB", " ", zaP, zaR, zaR2); - h_orbitNumvsamplitude0_HE = new TH1F("h_orbitNumvsamplitude0_HE", " ", zaP, zaR, zaR2); - h_orbitNumvsamplitude0_HF = new TH1F("h_orbitNumvsamplitude0_HF", " ", zaP, zaR, zaR2); - h_orbitNumvsamplitude0_HO = new TH1F("h_orbitNumvsamplitude0_HO", " ", zaP, zaR, zaR2); - - h_2DsumADCAmplEtaPhiLs0 = - new TH2F("h_2DsumADCAmplEtaPhiLs0", " ", nlsminmax, alsmin, blsmax, znphi * zneta, 1., znphi * zneta + 1.); - h_2DsumADCAmplEtaPhiLs1 = - new TH2F("h_2DsumADCAmplEtaPhiLs1", " ", nlsminmax, alsmin, blsmax, znphi * zneta, 1., znphi * zneta + 1.); - h_2DsumADCAmplEtaPhiLs2 = - new TH2F("h_2DsumADCAmplEtaPhiLs2", " ", nlsminmax, alsmin, blsmax, znphi * zneta, 1., znphi * zneta + 1.); - h_2DsumADCAmplEtaPhiLs3 = - new TH2F("h_2DsumADCAmplEtaPhiLs3", " ", nlsminmax, alsmin, blsmax, znphi * zneta, 1., znphi * zneta + 1.); - - h_2DsumADCAmplEtaPhiLs00 = - new TH2F("h_2DsumADCAmplEtaPhiLs00", " ", nlsminmax, alsmin, blsmax, znphi * zneta, 1., znphi * zneta + 1.); - h_2DsumADCAmplEtaPhiLs10 = - new TH2F("h_2DsumADCAmplEtaPhiLs10", " ", nlsminmax, alsmin, blsmax, znphi * zneta, 1., znphi * zneta + 1.); - h_2DsumADCAmplEtaPhiLs20 = - new TH2F("h_2DsumADCAmplEtaPhiLs20", " ", nlsminmax, alsmin, blsmax, znphi * zneta, 1., znphi * zneta + 1.); - h_2DsumADCAmplEtaPhiLs30 = - new TH2F("h_2DsumADCAmplEtaPhiLs30", " ", nlsminmax, alsmin, blsmax, znphi * zneta, 1., znphi * zneta + 1.); - - h_sumADCAmplEtaPhiLs = new TH1F("h_sumADCAmplEtaPhiLs", " ", 1000, 0., 14000.); - h_sumADCAmplEtaPhiLs_bbbc = new TH1F("h_sumADCAmplEtaPhiLs_bbbc", " ", 1000, 0., 300000.); - h_sumADCAmplEtaPhiLs_bbb1 = new TH1F("h_sumADCAmplEtaPhiLs_bbb1", " ", 100, 0., 3000.); - h_sumADCAmplEtaPhiLs_lscounterM1 = new TH1F("h_sumADCAmplEtaPhiLs_lscounterM1", " ", 600, 1., 601.); - h_sumADCAmplEtaPhiLs_ietaphi = new TH1F("h_sumADCAmplEtaPhiLs_ietaphi", " ", 400, 0., 400.); - h_sumADCAmplEtaPhiLs_lscounterM1orbitNum = new TH1F("h_sumADCAmplEtaPhiLs_lscounterM1orbitNum", " ", 600, 1., 601.); - h_sumADCAmplEtaPhiLs_orbitNum = new TH1F("h_sumADCAmplEtaPhiLs_orbitNum", " ", 1000, 25000000., 40000000.); + h_orbitNumvsamplitude_HB = fs_->make("h_orbitNumvsamplitude_HB", " ", zaP, zaR, zaR2); + h_orbitNumvsamplitude_HE = fs_->make("h_orbitNumvsamplitude_HE", " ", zaP, zaR, zaR2); + h_orbitNumvsamplitude_HF = fs_->make("h_orbitNumvsamplitude_HF", " ", zaP, zaR, zaR2); + h_orbitNumvsamplitude_HO = fs_->make("h_orbitNumvsamplitude_HO", " ", zaP, zaR, zaR2); + h_orbitNumvsamplitude0_HB = fs_->make("h_orbitNumvsamplitude0_HB", " ", zaP, zaR, zaR2); + h_orbitNumvsamplitude0_HE = fs_->make("h_orbitNumvsamplitude0_HE", " ", zaP, zaR, zaR2); + h_orbitNumvsamplitude0_HF = fs_->make("h_orbitNumvsamplitude0_HF", " ", zaP, zaR, zaR2); + h_orbitNumvsamplitude0_HO = fs_->make("h_orbitNumvsamplitude0_HO", " ", zaP, zaR, zaR2); + + h_2DsumADCAmplEtaPhiLs0 = fs_->make( + "h_2DsumADCAmplEtaPhiLs0", " ", nlsminmax, alsmin, blsmax, znphi * zneta, 1., znphi * zneta + 1.); + h_2DsumADCAmplEtaPhiLs1 = fs_->make( + "h_2DsumADCAmplEtaPhiLs1", " ", nlsminmax, alsmin, blsmax, znphi * zneta, 1., znphi * zneta + 1.); + h_2DsumADCAmplEtaPhiLs2 = fs_->make( + "h_2DsumADCAmplEtaPhiLs2", " ", nlsminmax, alsmin, blsmax, znphi * zneta, 1., znphi * zneta + 1.); + h_2DsumADCAmplEtaPhiLs3 = fs_->make( + "h_2DsumADCAmplEtaPhiLs3", " ", nlsminmax, alsmin, blsmax, znphi * zneta, 1., znphi * zneta + 1.); + + h_2DsumADCAmplEtaPhiLs00 = fs_->make( + "h_2DsumADCAmplEtaPhiLs00", " ", nlsminmax, alsmin, blsmax, znphi * zneta, 1., znphi * zneta + 1.); + h_2DsumADCAmplEtaPhiLs10 = fs_->make( + "h_2DsumADCAmplEtaPhiLs10", " ", nlsminmax, alsmin, blsmax, znphi * zneta, 1., znphi * zneta + 1.); + h_2DsumADCAmplEtaPhiLs20 = fs_->make( + "h_2DsumADCAmplEtaPhiLs20", " ", nlsminmax, alsmin, blsmax, znphi * zneta, 1., znphi * zneta + 1.); + h_2DsumADCAmplEtaPhiLs30 = fs_->make( + "h_2DsumADCAmplEtaPhiLs30", " ", nlsminmax, alsmin, blsmax, znphi * zneta, 1., znphi * zneta + 1.); + + h_sumADCAmplEtaPhiLs = fs_->make("h_sumADCAmplEtaPhiLs", " ", 1000, 0., 14000.); + h_sumADCAmplEtaPhiLs_bbbc = fs_->make("h_sumADCAmplEtaPhiLs_bbbc", " ", 1000, 0., 300000.); + h_sumADCAmplEtaPhiLs_bbb1 = fs_->make("h_sumADCAmplEtaPhiLs_bbb1", " ", 100, 0., 3000.); + h_sumADCAmplEtaPhiLs_lscounterM1 = fs_->make("h_sumADCAmplEtaPhiLs_lscounterM1", " ", 600, 1., 601.); + h_sumADCAmplEtaPhiLs_ietaphi = fs_->make("h_sumADCAmplEtaPhiLs_ietaphi", " ", 400, 0., 400.); + h_sumADCAmplEtaPhiLs_lscounterM1orbitNum = + fs_->make("h_sumADCAmplEtaPhiLs_lscounterM1orbitNum", " ", 600, 1., 601.); + h_sumADCAmplEtaPhiLs_orbitNum = fs_->make("h_sumADCAmplEtaPhiLs_orbitNum", " ", 1000, 25000000., 40000000.); // for LS : @@ -8144,1080 +6868,1088 @@ void CMTRawAnalyzer::beginJob() { float bac2 = bac + 1.; // bac, 1., bac2 ); - h_nbadchannels_depth1_HB = new TH1F("h_nbadchannels_depth1_HB", " ", 100, 1., 3001.); - h_runnbadchannels_depth1_HB = new TH1F("h_runnbadchannels_depth1_HB", " ", bac, 1., bac2); - h_runnbadchannelsC_depth1_HB = new TH1F("h_runnbadchannelsC_depth1_HB", " ", bac, 1., bac2); - h_runbadrate_depth1_HB = new TH1F("h_runbadrate_depth1_HB", " ", bac, 1., bac2); - h_runbadrateC_depth1_HB = new TH1F("h_runbadrateC_depth1_HB", " ", bac, 1., bac2); - h_runbadrate0_depth1_HB = new TH1F("h_runbadrate0_depth1_HB", " ", bac, 1., bac2); - - h_nbadchannels_depth2_HB = new TH1F("h_nbadchannels_depth2_HB", " ", 100, 1., 501.); - h_runnbadchannels_depth2_HB = new TH1F("h_runnbadchannels_depth2_HB", " ", bac, 1., bac2); - h_runnbadchannelsC_depth2_HB = new TH1F("h_runnbadchannelsC_depth2_HB", " ", bac, 1., bac2); - h_runbadrate_depth2_HB = new TH1F("h_runbadrate_depth2_HB", " ", bac, 1., bac2); - h_runbadrateC_depth2_HB = new TH1F("h_runbadrateC_depth2_HB", " ", bac, 1., bac2); - h_runbadrate0_depth2_HB = new TH1F("h_runbadrate0_depth2_HB", " ", bac, 1., bac2); - - h_nbadchannels_depth1_HE = new TH1F("h_nbadchannels_depth1_HE", " ", 100, 1., 3001.); - h_runnbadchannels_depth1_HE = new TH1F("h_runnbadchannels_depth1_HE", " ", bac, 1., bac2); - h_runnbadchannelsC_depth1_HE = new TH1F("h_runnbadchannelsC_depth1_HE", " ", bac, 1., bac2); - h_runbadrate_depth1_HE = new TH1F("h_runbadrate_depth1_HE", " ", bac, 1., bac2); - h_runbadrateC_depth1_HE = new TH1F("h_runbadrateC_depth1_HE", " ", bac, 1., bac2); - h_runbadrate0_depth1_HE = new TH1F("h_runbadrate0_depth1_HE", " ", bac, 1., bac2); - - h_nbadchannels_depth2_HE = new TH1F("h_nbadchannels_depth2_HE", " ", 100, 1., 3001.); - h_runnbadchannels_depth2_HE = new TH1F("h_runnbadchannels_depth2_HE", " ", bac, 1., bac2); - h_runnbadchannelsC_depth2_HE = new TH1F("h_runnbadchannelsC_depth2_HE", " ", bac, 1., bac2); - h_runbadrate_depth2_HE = new TH1F("h_runbadrate_depth2_HE", " ", bac, 1., bac2); - h_runbadrateC_depth2_HE = new TH1F("h_runbadrateC_depth2_HE", " ", bac, 1., bac2); - h_runbadrate0_depth2_HE = new TH1F("h_runbadrate0_depth2_HE", " ", bac, 1., bac2); - - h_nbadchannels_depth3_HE = new TH1F("h_nbadchannels_depth3_HE", " ", 100, 1., 501.); - h_runnbadchannels_depth3_HE = new TH1F("h_runnbadchannels_depth3_HE", " ", bac, 1., bac2); - h_runnbadchannelsC_depth3_HE = new TH1F("h_runnbadchannelsC_depth3_HE", " ", bac, 1., bac2); - h_runbadrate_depth3_HE = new TH1F("h_runbadrate_depth3_HE", " ", bac, 1., bac2); - h_runbadrateC_depth3_HE = new TH1F("h_runbadrateC_depth3_HE", " ", bac, 1., bac2); - h_runbadrate0_depth3_HE = new TH1F("h_runbadrate0_depth3_HE", " ", bac, 1., bac2); - - h_nbadchannels_depth1_HF = new TH1F("h_nbadchannels_depth1_HF", " ", 100, 1., 3001.); - h_runnbadchannels_depth1_HF = new TH1F("h_runnbadchannels_depth1_HF", " ", bac, 1., bac2); - h_runnbadchannelsC_depth1_HF = new TH1F("h_runnbadchannelsC_depth1_HF", " ", bac, 1., bac2); - h_runbadrate_depth1_HF = new TH1F("h_runbadrate_depth1_HF", " ", bac, 1., bac2); - h_runbadrateC_depth1_HF = new TH1F("h_runbadrateC_depth1_HF", " ", bac, 1., bac2); - h_runbadrate0_depth1_HF = new TH1F("h_runbadrate0_depth1_HF", " ", bac, 1., bac2); - - h_nbadchannels_depth2_HF = new TH1F("h_nbadchannels_depth2_HF", " ", 100, 1., 501.); - h_runnbadchannels_depth2_HF = new TH1F("h_runnbadchannels_depth2_HF", " ", bac, 1., bac2); - h_runnbadchannelsC_depth2_HF = new TH1F("h_runnbadchannelsC_depth2_HF", " ", bac, 1., bac2); - h_runbadrate_depth2_HF = new TH1F("h_runbadrate_depth2_HF", " ", bac, 1., bac2); - h_runbadrateC_depth2_HF = new TH1F("h_runbadrateC_depth2_HF", " ", bac, 1., bac2); - h_runbadrate0_depth2_HF = new TH1F("h_runbadrate0_depth2_HF", " ", bac, 1., bac2); - - h_nbadchannels_depth4_HO = new TH1F("h_nbadchannels_depth4_HO", " ", 100, 1., 3001.); - h_runnbadchannels_depth4_HO = new TH1F("h_runnbadchannels_depth4_HO", " ", bac, 1., bac2); - h_runnbadchannelsC_depth4_HO = new TH1F("h_runnbadchannelsC_depth4_HO", " ", bac, 1., bac2); - h_runbadrate_depth4_HO = new TH1F("h_runbadrate_depth4_HO", " ", bac, 1., bac2); - h_runbadrateC_depth4_HO = new TH1F("h_runbadrateC_depth4_HO", " ", bac, 1., bac2); - h_runbadrate0_depth4_HO = new TH1F("h_runbadrate0_depth4_HO", " ", bac, 1., bac2); + h_nbadchannels_depth1_HB = fs_->make("h_nbadchannels_depth1_HB", " ", 100, 1., 3001.); + h_runnbadchannels_depth1_HB = fs_->make("h_runnbadchannels_depth1_HB", " ", bac, 1., bac2); + h_runnbadchannelsC_depth1_HB = fs_->make("h_runnbadchannelsC_depth1_HB", " ", bac, 1., bac2); + h_runbadrate_depth1_HB = fs_->make("h_runbadrate_depth1_HB", " ", bac, 1., bac2); + h_runbadrateC_depth1_HB = fs_->make("h_runbadrateC_depth1_HB", " ", bac, 1., bac2); + h_runbadrate0_depth1_HB = fs_->make("h_runbadrate0_depth1_HB", " ", bac, 1., bac2); + + h_nbadchannels_depth2_HB = fs_->make("h_nbadchannels_depth2_HB", " ", 100, 1., 501.); + h_runnbadchannels_depth2_HB = fs_->make("h_runnbadchannels_depth2_HB", " ", bac, 1., bac2); + h_runnbadchannelsC_depth2_HB = fs_->make("h_runnbadchannelsC_depth2_HB", " ", bac, 1., bac2); + h_runbadrate_depth2_HB = fs_->make("h_runbadrate_depth2_HB", " ", bac, 1., bac2); + h_runbadrateC_depth2_HB = fs_->make("h_runbadrateC_depth2_HB", " ", bac, 1., bac2); + h_runbadrate0_depth2_HB = fs_->make("h_runbadrate0_depth2_HB", " ", bac, 1., bac2); + + h_nbadchannels_depth1_HE = fs_->make("h_nbadchannels_depth1_HE", " ", 100, 1., 3001.); + h_runnbadchannels_depth1_HE = fs_->make("h_runnbadchannels_depth1_HE", " ", bac, 1., bac2); + h_runnbadchannelsC_depth1_HE = fs_->make("h_runnbadchannelsC_depth1_HE", " ", bac, 1., bac2); + h_runbadrate_depth1_HE = fs_->make("h_runbadrate_depth1_HE", " ", bac, 1., bac2); + h_runbadrateC_depth1_HE = fs_->make("h_runbadrateC_depth1_HE", " ", bac, 1., bac2); + h_runbadrate0_depth1_HE = fs_->make("h_runbadrate0_depth1_HE", " ", bac, 1., bac2); + + h_nbadchannels_depth2_HE = fs_->make("h_nbadchannels_depth2_HE", " ", 100, 1., 3001.); + h_runnbadchannels_depth2_HE = fs_->make("h_runnbadchannels_depth2_HE", " ", bac, 1., bac2); + h_runnbadchannelsC_depth2_HE = fs_->make("h_runnbadchannelsC_depth2_HE", " ", bac, 1., bac2); + h_runbadrate_depth2_HE = fs_->make("h_runbadrate_depth2_HE", " ", bac, 1., bac2); + h_runbadrateC_depth2_HE = fs_->make("h_runbadrateC_depth2_HE", " ", bac, 1., bac2); + h_runbadrate0_depth2_HE = fs_->make("h_runbadrate0_depth2_HE", " ", bac, 1., bac2); + + h_nbadchannels_depth3_HE = fs_->make("h_nbadchannels_depth3_HE", " ", 100, 1., 501.); + h_runnbadchannels_depth3_HE = fs_->make("h_runnbadchannels_depth3_HE", " ", bac, 1., bac2); + h_runnbadchannelsC_depth3_HE = fs_->make("h_runnbadchannelsC_depth3_HE", " ", bac, 1., bac2); + h_runbadrate_depth3_HE = fs_->make("h_runbadrate_depth3_HE", " ", bac, 1., bac2); + h_runbadrateC_depth3_HE = fs_->make("h_runbadrateC_depth3_HE", " ", bac, 1., bac2); + h_runbadrate0_depth3_HE = fs_->make("h_runbadrate0_depth3_HE", " ", bac, 1., bac2); + + h_nbadchannels_depth1_HF = fs_->make("h_nbadchannels_depth1_HF", " ", 100, 1., 3001.); + h_runnbadchannels_depth1_HF = fs_->make("h_runnbadchannels_depth1_HF", " ", bac, 1., bac2); + h_runnbadchannelsC_depth1_HF = fs_->make("h_runnbadchannelsC_depth1_HF", " ", bac, 1., bac2); + h_runbadrate_depth1_HF = fs_->make("h_runbadrate_depth1_HF", " ", bac, 1., bac2); + h_runbadrateC_depth1_HF = fs_->make("h_runbadrateC_depth1_HF", " ", bac, 1., bac2); + h_runbadrate0_depth1_HF = fs_->make("h_runbadrate0_depth1_HF", " ", bac, 1., bac2); + + h_nbadchannels_depth2_HF = fs_->make("h_nbadchannels_depth2_HF", " ", 100, 1., 501.); + h_runnbadchannels_depth2_HF = fs_->make("h_runnbadchannels_depth2_HF", " ", bac, 1., bac2); + h_runnbadchannelsC_depth2_HF = fs_->make("h_runnbadchannelsC_depth2_HF", " ", bac, 1., bac2); + h_runbadrate_depth2_HF = fs_->make("h_runbadrate_depth2_HF", " ", bac, 1., bac2); + h_runbadrateC_depth2_HF = fs_->make("h_runbadrateC_depth2_HF", " ", bac, 1., bac2); + h_runbadrate0_depth2_HF = fs_->make("h_runbadrate0_depth2_HF", " ", bac, 1., bac2); + + h_nbadchannels_depth4_HO = fs_->make("h_nbadchannels_depth4_HO", " ", 100, 1., 3001.); + h_runnbadchannels_depth4_HO = fs_->make("h_runnbadchannels_depth4_HO", " ", bac, 1., bac2); + h_runnbadchannelsC_depth4_HO = fs_->make("h_runnbadchannelsC_depth4_HO", " ", bac, 1., bac2); + h_runbadrate_depth4_HO = fs_->make("h_runbadrate_depth4_HO", " ", bac, 1., bac2); + h_runbadrateC_depth4_HO = fs_->make("h_runbadrateC_depth4_HO", " ", bac, 1., bac2); + h_runbadrate0_depth4_HO = fs_->make("h_runbadrate0_depth4_HO", " ", bac, 1., bac2); /////////////////////////////////////////////////////////////////////////////////////////////// - h_FullSignal3D_HB = new TH2F("h_FullSignal3D_HB", " ", neta, -41., 41., nphi, 0., bphi); - h_FullSignal3D0_HB = new TH2F("h_FullSignal3D0_HB", " ", neta, -41., 41., nphi, 0., bphi); - h_FullSignal3D_HE = new TH2F("h_FullSignal3D_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_FullSignal3D0_HE = new TH2F("h_FullSignal3D0_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_FullSignal3D_HO = new TH2F("h_FullSignal3D_HO", " ", neta, -41., 41., nphi, 0., bphi); - h_FullSignal3D0_HO = new TH2F("h_FullSignal3D0_HO", " ", neta, -41., 41., nphi, 0., bphi); - h_FullSignal3D_HF = new TH2F("h_FullSignal3D_HF", " ", neta, -41., 41., nphi, 0., bphi); - h_FullSignal3D0_HF = new TH2F("h_FullSignal3D0_HF", " ", neta, -41., 41., nphi, 0., bphi); + h_FullSignal3D_HB = fs_->make("h_FullSignal3D_HB", " ", neta, -41., 41., nphi, 0., bphi); + h_FullSignal3D0_HB = fs_->make("h_FullSignal3D0_HB", " ", neta, -41., 41., nphi, 0., bphi); + h_FullSignal3D_HE = fs_->make("h_FullSignal3D_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_FullSignal3D0_HE = fs_->make("h_FullSignal3D0_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_FullSignal3D_HO = fs_->make("h_FullSignal3D_HO", " ", neta, -41., 41., nphi, 0., bphi); + h_FullSignal3D0_HO = fs_->make("h_FullSignal3D0_HO", " ", neta, -41., 41., nphi, 0., bphi); + h_FullSignal3D_HF = fs_->make("h_FullSignal3D_HF", " ", neta, -41., 41., nphi, 0., bphi); + h_FullSignal3D0_HF = fs_->make("h_FullSignal3D0_HF", " ", neta, -41., 41., nphi, 0., bphi); ////////////////////////////////////////////////////////////////////////////////////////////////// - h_ADCCalib_HB = new TH1F("h_ADCCalib_HB", " ", 100, 10., 10000.); - h_ADCCalib1_HB = new TH1F("h_ADCCalib1_HB", " ", 100, 0.1, 100.1); - h_mapADCCalib047_HB = new TH2F("h_mapADCCalib047_HB", " ", neta, -41., 41., nphi, 0., bphi); - h_mapADCCalib_HB = new TH2F("h_mapADCCalib_HB", " ", neta, -41., 41., nphi, 0., bphi); - h_RatioCalib_HB = new TH1F("h_RatioCalib_HB", " ", 100, 0., 1.); - h_mapRatioCalib047_HB = new TH2F("h_mapRatioCalib047_HB", " ", neta, -41., 41., nphi, 0., bphi); - h_mapRatioCalib_HB = new TH2F("h_mapRatioCalib_HB", " ", neta, -41., 41., nphi, 0., bphi); - h_TSmaxCalib_HB = new TH1F("h_TSmaxCalib_HB", " ", 100, 0., 10.); - h_mapTSmaxCalib047_HB = new TH2F("h_mapTSmaxCalib047_HB", " ", neta, -41., 41., nphi, 0., bphi); - h_mapTSmaxCalib_HB = new TH2F("h_mapTSmaxCalib_HB", " ", neta, -41., 41., nphi, 0., bphi); - h_TSmeanCalib_HB = new TH1F("h_TSmeanCalib_HB", " ", 100, 0., 10.); - h_mapTSmeanCalib047_HB = new TH2F("h_mapTSmeanCalib047_HB", " ", neta, -41., 41., nphi, 0., bphi); - h_mapTSmeanCalib_HB = new TH2F("h_mapTSmeanCalib_HB", " ", neta, -41., 41., nphi, 0., bphi); - h_WidthCalib_HB = new TH1F("h_WidthCalib_HB", " ", 100, 0., 5.); - h_mapWidthCalib047_HB = new TH2F("h_mapWidthCalib047_HB", " ", neta, -41., 41., nphi, 0., bphi); - h_mapCapCalib047_HB = new TH2F("h_mapCapCalib047_HB", " ", neta, -41., 41., nphi, 0., bphi); - h_mapWidthCalib_HB = new TH2F("h_mapWidthCalib_HB", " ", neta, -41., 41., nphi, 0., bphi); - h_map_HB = new TH2F("h_map_HB", " ", neta, -41., 41., nphi, 0., bphi); - h_ADCCalib_HE = new TH1F("h_ADCCalib_HE", " ", 100, 10., 10000.); - h_ADCCalib1_HE = new TH1F("h_ADCCalib1_HE", " ", 100, 0.1, 100.1); - h_mapADCCalib047_HE = new TH2F("h_mapADCCalib047_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapADCCalib_HE = new TH2F("h_mapADCCalib_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_RatioCalib_HE = new TH1F("h_RatioCalib_HE", " ", 100, 0., 1.); - h_mapRatioCalib047_HE = new TH2F("h_mapRatioCalib047_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapRatioCalib_HE = new TH2F("h_mapRatioCalib_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_TSmaxCalib_HE = new TH1F("h_TSmaxCalib_HE", " ", 100, 0., 10.); - h_mapTSmaxCalib047_HE = new TH2F("h_mapTSmaxCalib047_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapTSmaxCalib_HE = new TH2F("h_mapTSmaxCalib_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_TSmeanCalib_HE = new TH1F("h_TSmeanCalib_HE", " ", 100, 0., 10.); - h_mapTSmeanCalib047_HE = new TH2F("h_mapTSmeanCalib047_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapTSmeanCalib_HE = new TH2F("h_mapTSmeanCalib_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_WidthCalib_HE = new TH1F("h_WidthCalib_HE", " ", 100, 0., 5.); - h_mapWidthCalib047_HE = new TH2F("h_mapWidthCalib047_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapCapCalib047_HE = new TH2F("h_mapCapCalib047_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapWidthCalib_HE = new TH2F("h_mapWidthCalib_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_map_HE = new TH2F("h_map_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_ADCCalib_HO = new TH1F("h_ADCCalib_HO", " ", 100, 10., 10000.); - h_ADCCalib1_HO = new TH1F("h_ADCCalib1_HO", " ", 100, 0.1, 100.1); - h_mapADCCalib047_HO = new TH2F("h_mapADCCalib047_HO", " ", neta, -41., 41., nphi, 0., bphi); - h_mapADCCalib_HO = new TH2F("h_mapADCCalib_HO", " ", neta, -41., 41., nphi, 0., bphi); - h_RatioCalib_HO = new TH1F("h_RatioCalib_HO", " ", 100, 0., 1.); - h_mapRatioCalib047_HO = new TH2F("h_mapRatioCalib047_HO", " ", neta, -41., 41., nphi, 0., bphi); - h_mapRatioCalib_HO = new TH2F("h_mapRatioCalib_HO", " ", neta, -41., 41., nphi, 0., bphi); - h_TSmaxCalib_HO = new TH1F("h_TSmaxCalib_HO", " ", 100, 0., 10.); - h_mapTSmaxCalib047_HO = new TH2F("h_mapTSmaxCalib047_HO", " ", neta, -41., 41., nphi, 0., bphi); - h_mapTSmaxCalib_HO = new TH2F("h_mapTSmaxCalib_HO", " ", neta, -41., 41., nphi, 0., bphi); - h_TSmeanCalib_HO = new TH1F("h_TSmeanCalib_HO", " ", 100, 0., 10.); - h_mapTSmeanCalib047_HO = new TH2F("h_mapTSmeanCalib047_HO", " ", neta, -41., 41., nphi, 0., bphi); - h_mapTSmeanCalib_HO = new TH2F("h_mapTSmeanCalib_HO", " ", neta, -41., 41., nphi, 0., bphi); - h_WidthCalib_HO = new TH1F("h_WidthCalib_HO", " ", 100, 0., 5.); - h_mapWidthCalib047_HO = new TH2F("h_mapWidthCalib047_HO", " ", neta, -41., 41., nphi, 0., bphi); - h_mapCapCalib047_HO = new TH2F("h_mapCapCalib047_HO", " ", neta, -41., 41., nphi, 0., bphi); - h_mapWidthCalib_HO = new TH2F("h_mapWidthCalib_HO", " ", neta, -41., 41., nphi, 0., bphi); - h_map_HO = new TH2F("h_map_HO", " ", neta, -41., 41., nphi, 0., bphi); - h_ADCCalib_HF = new TH1F("h_ADCCalib_HF", " ", 100, 10., 2000.); - h_ADCCalib1_HF = new TH1F("h_ADCCalib1_HF", " ", 100, 0.1, 100.1); - h_mapADCCalib047_HF = new TH2F("h_mapADCCalib047_HF", " ", neta, -41., 41., nphi, 0., bphi); - h_mapADCCalib_HF = new TH2F("h_mapADCCalib_HF", " ", neta, -41., 41., nphi, 0., bphi); - h_RatioCalib_HF = new TH1F("h_RatioCalib_HF", " ", 100, 0., 1.); - h_mapRatioCalib047_HF = new TH2F("h_mapRatioCalib047_HF", " ", neta, -41., 41., nphi, 0., bphi); - h_mapRatioCalib_HF = new TH2F("h_mapRatioCalib_HF", " ", neta, -41., 41., nphi, 0., bphi); - h_TSmaxCalib_HF = new TH1F("h_TSmaxCalib_HF", " ", 100, 0., 10.); - h_mapTSmaxCalib047_HF = new TH2F("h_mapTSmaxCalib047_HF", " ", neta, -41., 41., nphi, 0., bphi); - h_mapTSmaxCalib_HF = new TH2F("h_mapTSmaxCalib_HF", " ", neta, -41., 41., nphi, 0., bphi); - h_TSmeanCalib_HF = new TH1F("h_TSmeanCalib_HF", " ", 100, 0., 10.); - h_mapTSmeanCalib047_HF = new TH2F("h_mapTSmeanCalib047_HF", " ", neta, -41., 41., nphi, 0., bphi); - h_mapTSmeanCalib_HF = new TH2F("h_mapTSmeanCalib_HF", " ", neta, -41., 41., nphi, 0., bphi); - h_WidthCalib_HF = new TH1F("h_WidthCalib_HF", " ", 100, 0., 5.); - h_mapWidthCalib047_HF = new TH2F("h_mapWidthCalib047_HF", " ", neta, -41., 41., nphi, 0., bphi); - h_mapCapCalib047_HF = new TH2F("h_mapCapCalib047_HF", " ", neta, -41., 41., nphi, 0., bphi); - h_mapWidthCalib_HF = new TH2F("h_mapWidthCalib_HF", " ", neta, -41., 41., nphi, 0., bphi); - h_map_HF = new TH2F("h_map_HF", " ", neta, -41., 41., nphi, 0., bphi); - - h_nls_per_run = new TH1F("h_nls_per_run", " ", 100, 0., 800.); - h_nls_per_run10 = new TH1F("h_nls_per_run10", " ", 100, 0., 60.); - h_nevents_per_LS = new TH1F("h_nevents_per_LS", " ", 100, 0., 600.); - h_nevents_per_LSzoom = new TH1F("h_nevents_per_LSzoom", " ", 50, 0., 50.); - h_nevents_per_eachLS = new TH1F("h_nevents_per_eachLS", " ", bac, 1., bac2); - h_nevents_per_eachRealLS = new TH1F("h_nevents_per_eachRealLS", " ", bac, 1., bac2); - h_lsnumber_per_eachLS = new TH1F("h_lsnumber_per_eachLS", " ", bac, 1., bac2); + h_ADCCalib_HB = fs_->make("h_ADCCalib_HB", " ", 100, 10., 10000.); + h_ADCCalib1_HB = fs_->make("h_ADCCalib1_HB", " ", 100, 0.1, 100.1); + h_mapADCCalib047_HB = fs_->make("h_mapADCCalib047_HB", " ", neta, -41., 41., nphi, 0., bphi); + h_mapADCCalib_HB = fs_->make("h_mapADCCalib_HB", " ", neta, -41., 41., nphi, 0., bphi); + h_RatioCalib_HB = fs_->make("h_RatioCalib_HB", " ", 100, 0., 1.); + h_mapRatioCalib047_HB = fs_->make("h_mapRatioCalib047_HB", " ", neta, -41., 41., nphi, 0., bphi); + h_mapRatioCalib_HB = fs_->make("h_mapRatioCalib_HB", " ", neta, -41., 41., nphi, 0., bphi); + h_TSmaxCalib_HB = fs_->make("h_TSmaxCalib_HB", " ", 100, 0., 10.); + h_mapTSmaxCalib047_HB = fs_->make("h_mapTSmaxCalib047_HB", " ", neta, -41., 41., nphi, 0., bphi); + h_mapTSmaxCalib_HB = fs_->make("h_mapTSmaxCalib_HB", " ", neta, -41., 41., nphi, 0., bphi); + h_TSmeanCalib_HB = fs_->make("h_TSmeanCalib_HB", " ", 100, 0., 10.); + h_mapTSmeanCalib047_HB = fs_->make("h_mapTSmeanCalib047_HB", " ", neta, -41., 41., nphi, 0., bphi); + h_mapTSmeanCalib_HB = fs_->make("h_mapTSmeanCalib_HB", " ", neta, -41., 41., nphi, 0., bphi); + h_WidthCalib_HB = fs_->make("h_WidthCalib_HB", " ", 100, 0., 5.); + h_mapWidthCalib047_HB = fs_->make("h_mapWidthCalib047_HB", " ", neta, -41., 41., nphi, 0., bphi); + h_mapCapCalib047_HB = fs_->make("h_mapCapCalib047_HB", " ", neta, -41., 41., nphi, 0., bphi); + h_mapWidthCalib_HB = fs_->make("h_mapWidthCalib_HB", " ", neta, -41., 41., nphi, 0., bphi); + h_map_HB = fs_->make("h_map_HB", " ", neta, -41., 41., nphi, 0., bphi); + h_ADCCalib_HE = fs_->make("h_ADCCalib_HE", " ", 100, 10., 10000.); + h_ADCCalib1_HE = fs_->make("h_ADCCalib1_HE", " ", 100, 0.1, 100.1); + h_mapADCCalib047_HE = fs_->make("h_mapADCCalib047_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapADCCalib_HE = fs_->make("h_mapADCCalib_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_RatioCalib_HE = fs_->make("h_RatioCalib_HE", " ", 100, 0., 1.); + h_mapRatioCalib047_HE = fs_->make("h_mapRatioCalib047_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapRatioCalib_HE = fs_->make("h_mapRatioCalib_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_TSmaxCalib_HE = fs_->make("h_TSmaxCalib_HE", " ", 100, 0., 10.); + h_mapTSmaxCalib047_HE = fs_->make("h_mapTSmaxCalib047_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapTSmaxCalib_HE = fs_->make("h_mapTSmaxCalib_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_TSmeanCalib_HE = fs_->make("h_TSmeanCalib_HE", " ", 100, 0., 10.); + h_mapTSmeanCalib047_HE = fs_->make("h_mapTSmeanCalib047_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapTSmeanCalib_HE = fs_->make("h_mapTSmeanCalib_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_WidthCalib_HE = fs_->make("h_WidthCalib_HE", " ", 100, 0., 5.); + h_mapWidthCalib047_HE = fs_->make("h_mapWidthCalib047_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapCapCalib047_HE = fs_->make("h_mapCapCalib047_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapWidthCalib_HE = fs_->make("h_mapWidthCalib_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_map_HE = fs_->make("h_map_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_ADCCalib_HO = fs_->make("h_ADCCalib_HO", " ", 100, 10., 10000.); + h_ADCCalib1_HO = fs_->make("h_ADCCalib1_HO", " ", 100, 0.1, 100.1); + h_mapADCCalib047_HO = fs_->make("h_mapADCCalib047_HO", " ", neta, -41., 41., nphi, 0., bphi); + h_mapADCCalib_HO = fs_->make("h_mapADCCalib_HO", " ", neta, -41., 41., nphi, 0., bphi); + h_RatioCalib_HO = fs_->make("h_RatioCalib_HO", " ", 100, 0., 1.); + h_mapRatioCalib047_HO = fs_->make("h_mapRatioCalib047_HO", " ", neta, -41., 41., nphi, 0., bphi); + h_mapRatioCalib_HO = fs_->make("h_mapRatioCalib_HO", " ", neta, -41., 41., nphi, 0., bphi); + h_TSmaxCalib_HO = fs_->make("h_TSmaxCalib_HO", " ", 100, 0., 10.); + h_mapTSmaxCalib047_HO = fs_->make("h_mapTSmaxCalib047_HO", " ", neta, -41., 41., nphi, 0., bphi); + h_mapTSmaxCalib_HO = fs_->make("h_mapTSmaxCalib_HO", " ", neta, -41., 41., nphi, 0., bphi); + h_TSmeanCalib_HO = fs_->make("h_TSmeanCalib_HO", " ", 100, 0., 10.); + h_mapTSmeanCalib047_HO = fs_->make("h_mapTSmeanCalib047_HO", " ", neta, -41., 41., nphi, 0., bphi); + h_mapTSmeanCalib_HO = fs_->make("h_mapTSmeanCalib_HO", " ", neta, -41., 41., nphi, 0., bphi); + h_WidthCalib_HO = fs_->make("h_WidthCalib_HO", " ", 100, 0., 5.); + h_mapWidthCalib047_HO = fs_->make("h_mapWidthCalib047_HO", " ", neta, -41., 41., nphi, 0., bphi); + h_mapCapCalib047_HO = fs_->make("h_mapCapCalib047_HO", " ", neta, -41., 41., nphi, 0., bphi); + h_mapWidthCalib_HO = fs_->make("h_mapWidthCalib_HO", " ", neta, -41., 41., nphi, 0., bphi); + h_map_HO = fs_->make("h_map_HO", " ", neta, -41., 41., nphi, 0., bphi); + h_ADCCalib_HF = fs_->make("h_ADCCalib_HF", " ", 100, 10., 2000.); + h_ADCCalib1_HF = fs_->make("h_ADCCalib1_HF", " ", 100, 0.1, 100.1); + h_mapADCCalib047_HF = fs_->make("h_mapADCCalib047_HF", " ", neta, -41., 41., nphi, 0., bphi); + h_mapADCCalib_HF = fs_->make("h_mapADCCalib_HF", " ", neta, -41., 41., nphi, 0., bphi); + h_RatioCalib_HF = fs_->make("h_RatioCalib_HF", " ", 100, 0., 1.); + h_mapRatioCalib047_HF = fs_->make("h_mapRatioCalib047_HF", " ", neta, -41., 41., nphi, 0., bphi); + h_mapRatioCalib_HF = fs_->make("h_mapRatioCalib_HF", " ", neta, -41., 41., nphi, 0., bphi); + h_TSmaxCalib_HF = fs_->make("h_TSmaxCalib_HF", " ", 100, 0., 10.); + h_mapTSmaxCalib047_HF = fs_->make("h_mapTSmaxCalib047_HF", " ", neta, -41., 41., nphi, 0., bphi); + h_mapTSmaxCalib_HF = fs_->make("h_mapTSmaxCalib_HF", " ", neta, -41., 41., nphi, 0., bphi); + h_TSmeanCalib_HF = fs_->make("h_TSmeanCalib_HF", " ", 100, 0., 10.); + h_mapTSmeanCalib047_HF = fs_->make("h_mapTSmeanCalib047_HF", " ", neta, -41., 41., nphi, 0., bphi); + h_mapTSmeanCalib_HF = fs_->make("h_mapTSmeanCalib_HF", " ", neta, -41., 41., nphi, 0., bphi); + h_WidthCalib_HF = fs_->make("h_WidthCalib_HF", " ", 100, 0., 5.); + h_mapWidthCalib047_HF = fs_->make("h_mapWidthCalib047_HF", " ", neta, -41., 41., nphi, 0., bphi); + h_mapCapCalib047_HF = fs_->make("h_mapCapCalib047_HF", " ", neta, -41., 41., nphi, 0., bphi); + h_mapWidthCalib_HF = fs_->make("h_mapWidthCalib_HF", " ", neta, -41., 41., nphi, 0., bphi); + h_map_HF = fs_->make("h_map_HF", " ", neta, -41., 41., nphi, 0., bphi); + + h_nls_per_run = fs_->make("h_nls_per_run", " ", 100, 0., 800.); + h_nls_per_run10 = fs_->make("h_nls_per_run10", " ", 100, 0., 60.); + h_nevents_per_LS = fs_->make("h_nevents_per_LS", " ", 100, 0., 600.); + h_nevents_per_LSzoom = fs_->make("h_nevents_per_LSzoom", " ", 50, 0., 50.); + h_nevents_per_eachLS = fs_->make("h_nevents_per_eachLS", " ", bac, 1., bac2); + h_nevents_per_eachRealLS = fs_->make("h_nevents_per_eachRealLS", " ", bac, 1., bac2); + h_lsnumber_per_eachLS = fs_->make("h_lsnumber_per_eachLS", " ", bac, 1., bac2); //-------------------------------------------------- // for estimator0: float pst1 = 30.; - h_sumPedestalLS1 = new TH1F("h_sumPedestalLS1", " ", 100, 0., pst1); - h_2DsumPedestalLS1 = new TH2F("h_2DsumPedestalLS1", " ", neta, -41., 41., nphi, 0., bphi); - h_sumPedestalperLS1 = new TH1F("h_sumPedestalperLS1", " ", bac, 1., bac2); - h_2D0sumPedestalLS1 = new TH2F("h_2D0sumPedestalLS1", " ", neta, -41., 41., nphi, 0., bphi); - h_sum0PedestalperLS1 = new TH1F("h_sum0PedestalperLS1", " ", bac, 1., bac2); - - h_sumPedestalLS2 = new TH1F("h_sumPedestalLS2", " ", 100, 0., pst1); - h_2DsumPedestalLS2 = new TH2F("h_2DsumPedestalLS2", " ", neta, -41., 41., nphi, 0., bphi); - h_sumPedestalperLS2 = new TH1F("h_sumPedestalperLS2", " ", bac, 1., bac2); - h_2D0sumPedestalLS2 = new TH2F("h_2D0sumPedestalLS2", " ", neta, -41., 41., nphi, 0., bphi); - h_sum0PedestalperLS2 = new TH1F("h_sum0PedestalperLS2", " ", bac, 1., bac2); - - h_sumPedestalLS3 = new TH1F("h_sumPedestalLS3", " ", 100, 0., pst1); - h_2DsumPedestalLS3 = new TH2F("h_2DsumPedestalLS3", " ", neta, -41., 41., nphi, 0., bphi); - h_sumPedestalperLS3 = new TH1F("h_sumPedestalperLS3", " ", bac, 1., bac2); - h_2D0sumPedestalLS3 = new TH2F("h_2D0sumPedestalLS3", " ", neta, -41., 41., nphi, 0., bphi); - h_sum0PedestalperLS3 = new TH1F("h_sum0PedestalperLS3", " ", bac, 1., bac2); - - h_sumPedestalLS4 = new TH1F("h_sumPedestalLS4", " ", 100, 0., pst1); - h_2DsumPedestalLS4 = new TH2F("h_2DsumPedestalLS4", " ", neta, -41., 41., nphi, 0., bphi); - h_sumPedestalperLS4 = new TH1F("h_sumPedestalperLS4", " ", bac, 1., bac2); - h_2D0sumPedestalLS4 = new TH2F("h_2D0sumPedestalLS4", " ", neta, -41., 41., nphi, 0., bphi); - h_sum0PedestalperLS4 = new TH1F("h_sum0PedestalperLS4", " ", bac, 1., bac2); - - h_sumPedestalLS5 = new TH1F("h_sumPedestalLS5", " ", 100, 0., pst1); - h_2DsumPedestalLS5 = new TH2F("h_2DsumPedestalLS5", " ", neta, -41., 41., nphi, 0., bphi); - h_sumPedestalperLS5 = new TH1F("h_sumPedestalperLS5", " ", bac, 1., bac2); - h_2D0sumPedestalLS5 = new TH2F("h_2D0sumPedestalLS5", " ", neta, -41., 41., nphi, 0., bphi); - h_sum0PedestalperLS5 = new TH1F("h_sum0PedestalperLS5", " ", bac, 1., bac2); - - h_sumPedestalLS6 = new TH1F("h_sumPedestalLS6", " ", 100, 0., pst1); - h_2DsumPedestalLS6 = new TH2F("h_2DsumPedestalLS6", " ", neta, -41., 41., nphi, 0., bphi); - h_sumPedestalperLS6 = new TH1F("h_sumPedestalperLS6", " ", bac, 1., bac2); - h_2D0sumPedestalLS6 = new TH2F("h_2D0sumPedestalLS6", " ", neta, -41., 41., nphi, 0., bphi); - h_sum0PedestalperLS6 = new TH1F("h_sum0PedestalperLS6", " ", bac, 1., bac2); - - h_sumPedestalLS7 = new TH1F("h_sumPedestalLS7", " ", 100, 0., pst1); - h_2DsumPedestalLS7 = new TH2F("h_2DsumPedestalLS7", " ", neta, -41., 41., nphi, 0., bphi); - h_sumPedestalperLS7 = new TH1F("h_sumPedestalperLS7", " ", bac, 1., bac2); - h_2D0sumPedestalLS7 = new TH2F("h_2D0sumPedestalLS7", " ", neta, -41., 41., nphi, 0., bphi); - h_sum0PedestalperLS7 = new TH1F("h_sum0PedestalperLS7", " ", bac, 1., bac2); - - h_sumPedestalLS8 = new TH1F("h_sumPedestalLS8", " ", 100, 0., pst1); - h_2DsumPedestalLS8 = new TH2F("h_2DsumPedestalLS8", " ", neta, -41., 41., nphi, 0., bphi); - h_sumPedestalperLS8 = new TH1F("h_sumPedestalperLS8", " ", bac, 1., bac2); - h_2D0sumPedestalLS8 = new TH2F("h_2D0sumPedestalLS8", " ", neta, -41., 41., nphi, 0., bphi); - h_sum0PedestalperLS8 = new TH1F("h_sum0PedestalperLS8", " ", bac, 1., bac2); + h_sumPedestalLS1 = fs_->make("h_sumPedestalLS1", " ", 100, 0., pst1); + h_2DsumPedestalLS1 = fs_->make("h_2DsumPedestalLS1", " ", neta, -41., 41., nphi, 0., bphi); + h_sumPedestalperLS1 = fs_->make("h_sumPedestalperLS1", " ", bac, 1., bac2); + h_2D0sumPedestalLS1 = fs_->make("h_2D0sumPedestalLS1", " ", neta, -41., 41., nphi, 0., bphi); + h_sum0PedestalperLS1 = fs_->make("h_sum0PedestalperLS1", " ", bac, 1., bac2); + + h_sumPedestalLS2 = fs_->make("h_sumPedestalLS2", " ", 100, 0., pst1); + h_2DsumPedestalLS2 = fs_->make("h_2DsumPedestalLS2", " ", neta, -41., 41., nphi, 0., bphi); + h_sumPedestalperLS2 = fs_->make("h_sumPedestalperLS2", " ", bac, 1., bac2); + h_2D0sumPedestalLS2 = fs_->make("h_2D0sumPedestalLS2", " ", neta, -41., 41., nphi, 0., bphi); + h_sum0PedestalperLS2 = fs_->make("h_sum0PedestalperLS2", " ", bac, 1., bac2); + + h_sumPedestalLS3 = fs_->make("h_sumPedestalLS3", " ", 100, 0., pst1); + h_2DsumPedestalLS3 = fs_->make("h_2DsumPedestalLS3", " ", neta, -41., 41., nphi, 0., bphi); + h_sumPedestalperLS3 = fs_->make("h_sumPedestalperLS3", " ", bac, 1., bac2); + h_2D0sumPedestalLS3 = fs_->make("h_2D0sumPedestalLS3", " ", neta, -41., 41., nphi, 0., bphi); + h_sum0PedestalperLS3 = fs_->make("h_sum0PedestalperLS3", " ", bac, 1., bac2); + + h_sumPedestalLS4 = fs_->make("h_sumPedestalLS4", " ", 100, 0., pst1); + h_2DsumPedestalLS4 = fs_->make("h_2DsumPedestalLS4", " ", neta, -41., 41., nphi, 0., bphi); + h_sumPedestalperLS4 = fs_->make("h_sumPedestalperLS4", " ", bac, 1., bac2); + h_2D0sumPedestalLS4 = fs_->make("h_2D0sumPedestalLS4", " ", neta, -41., 41., nphi, 0., bphi); + h_sum0PedestalperLS4 = fs_->make("h_sum0PedestalperLS4", " ", bac, 1., bac2); + + h_sumPedestalLS5 = fs_->make("h_sumPedestalLS5", " ", 100, 0., pst1); + h_2DsumPedestalLS5 = fs_->make("h_2DsumPedestalLS5", " ", neta, -41., 41., nphi, 0., bphi); + h_sumPedestalperLS5 = fs_->make("h_sumPedestalperLS5", " ", bac, 1., bac2); + h_2D0sumPedestalLS5 = fs_->make("h_2D0sumPedestalLS5", " ", neta, -41., 41., nphi, 0., bphi); + h_sum0PedestalperLS5 = fs_->make("h_sum0PedestalperLS5", " ", bac, 1., bac2); + + h_sumPedestalLS6 = fs_->make("h_sumPedestalLS6", " ", 100, 0., pst1); + h_2DsumPedestalLS6 = fs_->make("h_2DsumPedestalLS6", " ", neta, -41., 41., nphi, 0., bphi); + h_sumPedestalperLS6 = fs_->make("h_sumPedestalperLS6", " ", bac, 1., bac2); + h_2D0sumPedestalLS6 = fs_->make("h_2D0sumPedestalLS6", " ", neta, -41., 41., nphi, 0., bphi); + h_sum0PedestalperLS6 = fs_->make("h_sum0PedestalperLS6", " ", bac, 1., bac2); + + h_sumPedestalLS7 = fs_->make("h_sumPedestalLS7", " ", 100, 0., pst1); + h_2DsumPedestalLS7 = fs_->make("h_2DsumPedestalLS7", " ", neta, -41., 41., nphi, 0., bphi); + h_sumPedestalperLS7 = fs_->make("h_sumPedestalperLS7", " ", bac, 1., bac2); + h_2D0sumPedestalLS7 = fs_->make("h_2D0sumPedestalLS7", " ", neta, -41., 41., nphi, 0., bphi); + h_sum0PedestalperLS7 = fs_->make("h_sum0PedestalperLS7", " ", bac, 1., bac2); + + h_sumPedestalLS8 = fs_->make("h_sumPedestalLS8", " ", 100, 0., pst1); + h_2DsumPedestalLS8 = fs_->make("h_2DsumPedestalLS8", " ", neta, -41., 41., nphi, 0., bphi); + h_sumPedestalperLS8 = fs_->make("h_sumPedestalperLS8", " ", bac, 1., bac2); + h_2D0sumPedestalLS8 = fs_->make("h_2D0sumPedestalLS8", " ", neta, -41., 41., nphi, 0., bphi); + h_sum0PedestalperLS8 = fs_->make("h_sum0PedestalperLS8", " ", bac, 1., bac2); //-------------------------------------------------- // for estimator1: - h_sumADCAmplLS1copy1 = new TH1F("h_sumADCAmplLS1copy1", " ", 100, 0., 10000); - h_sumADCAmplLS1copy2 = new TH1F("h_sumADCAmplLS1copy2", " ", 100, 0., 20000); - h_sumADCAmplLS1copy3 = new TH1F("h_sumADCAmplLS1copy3", " ", 100, 0., 50000); - h_sumADCAmplLS1copy4 = new TH1F("h_sumADCAmplLS1copy4", " ", 100, 0., 100000); - h_sumADCAmplLS1copy5 = new TH1F("h_sumADCAmplLS1copy5", " ", 100, 0., 150000); - h_sumADCAmplLS1 = new TH1F("h_sumADCAmplLS1", " ", 100, 0., lsdep_estimator1_HBdepth1_); - h_2DsumADCAmplLS1 = new TH2F("h_2DsumADCAmplLS1", " ", neta, -41., 41., nphi, 0., bphi); - h_2DsumADCAmplLS1_LSselected = new TH2F("h_2DsumADCAmplLS1_LSselected", " ", neta, -41., 41., nphi, 0., bphi); - h_sumADCAmplperLS1 = new TH1F("h_sumADCAmplperLS1", " ", bac, 1., bac2); - h_sumCutADCAmplperLS1 = new TH1F("h_sumCutADCAmplperLS1", " ", bac, 1., bac2); - h_2D0sumADCAmplLS1 = new TH2F("h_2D0sumADCAmplLS1", " ", neta, -41., 41., nphi, 0., bphi); - h_sum0ADCAmplperLS1 = new TH1F("h_sum0ADCAmplperLS1", " ", bac, 1., bac2); - - h_sumADCAmplLS2 = new TH1F("h_sumADCAmplLS2", " ", 100, 0., lsdep_estimator1_HBdepth2_); - h_2DsumADCAmplLS2 = new TH2F("h_2DsumADCAmplLS2", " ", neta, -41., 41., nphi, 0., bphi); - h_2DsumADCAmplLS2_LSselected = new TH2F("h_2DsumADCAmplLS2_LSselected", " ", neta, -41., 41., nphi, 0., bphi); - h_sumADCAmplperLS2 = new TH1F("h_sumADCAmplperLS2", " ", bac, 1., bac2); - h_sumCutADCAmplperLS2 = new TH1F("h_sumCutADCAmplperLS2", " ", bac, 1., bac2); - h_2D0sumADCAmplLS2 = new TH2F("h_2D0sumADCAmplLS2", " ", neta, -41., 41., nphi, 0., bphi); - h_sum0ADCAmplperLS2 = new TH1F("h_sum0ADCAmplperLS2", " ", bac, 1., bac2); - - h_sumADCAmplLS3 = new TH1F("h_sumADCAmplLS3", " ", 100, 0., lsdep_estimator1_HEdepth1_); - h_2DsumADCAmplLS3 = new TH2F("h_2DsumADCAmplLS3", " ", neta, -41., 41., nphi, 0., bphi); - h_2DsumADCAmplLS3_LSselected = new TH2F("h_2DsumADCAmplLS3_LSselected", " ", neta, -41., 41., nphi, 0., bphi); - h_sumADCAmplperLS3 = new TH1F("h_sumADCAmplperLS3", " ", bac, 1., bac2); - h_sumCutADCAmplperLS3 = new TH1F("h_sumCutADCAmplperLS3", " ", bac, 1., bac2); - h_2D0sumADCAmplLS3 = new TH2F("h_2D0sumADCAmplLS3", " ", neta, -41., 41., nphi, 0., bphi); - h_sum0ADCAmplperLS3 = new TH1F("h_sum0ADCAmplperLS3", " ", bac, 1., bac2); - - h_sumADCAmplLS4 = new TH1F("h_sumADCAmplLS4", " ", 100, 0., lsdep_estimator1_HEdepth2_); - h_2DsumADCAmplLS4 = new TH2F("h_2DsumADCAmplLS4", " ", neta, -41., 41., nphi, 0., bphi); - h_2DsumADCAmplLS4_LSselected = new TH2F("h_2DsumADCAmplLS4_LSselected", " ", neta, -41., 41., nphi, 0., bphi); - h_sumADCAmplperLS4 = new TH1F("h_sumADCAmplperLS4", " ", bac, 1., bac2); - h_sumCutADCAmplperLS4 = new TH1F("h_sumCutADCAmplperLS4", " ", bac, 1., bac2); - h_2D0sumADCAmplLS4 = new TH2F("h_2D0sumADCAmplLS4", " ", neta, -41., 41., nphi, 0., bphi); - h_sum0ADCAmplperLS4 = new TH1F("h_sum0ADCAmplperLS4", " ", bac, 1., bac2); - - h_sumADCAmplLS5 = new TH1F("h_sumADCAmplLS5", " ", 100, 0., lsdep_estimator1_HEdepth3_); - h_2DsumADCAmplLS5 = new TH2F("h_2DsumADCAmplLS5", " ", neta, -41., 41., nphi, 0., bphi); - h_2DsumADCAmplLS5_LSselected = new TH2F("h_2DsumADCAmplLS5_LSselected", " ", neta, -41., 41., nphi, 0., bphi); - h_sumADCAmplperLS5 = new TH1F("h_sumADCAmplperLS5", " ", bac, 1., bac2); - h_sumCutADCAmplperLS5 = new TH1F("h_sumCutADCAmplperLS5", " ", bac, 1., bac2); - h_2D0sumADCAmplLS5 = new TH2F("h_2D0sumADCAmplLS5", " ", neta, -41., 41., nphi, 0., bphi); - h_sum0ADCAmplperLS5 = new TH1F("h_sum0ADCAmplperLS5", " ", bac, 1., bac2); + h_sumADCAmplLS1copy1 = fs_->make("h_sumADCAmplLS1copy1", " ", 100, 0., 10000); + h_sumADCAmplLS1copy2 = fs_->make("h_sumADCAmplLS1copy2", " ", 100, 0., 20000); + h_sumADCAmplLS1copy3 = fs_->make("h_sumADCAmplLS1copy3", " ", 100, 0., 50000); + h_sumADCAmplLS1copy4 = fs_->make("h_sumADCAmplLS1copy4", " ", 100, 0., 100000); + h_sumADCAmplLS1copy5 = fs_->make("h_sumADCAmplLS1copy5", " ", 100, 0., 150000); + h_sumADCAmplLS1 = fs_->make("h_sumADCAmplLS1", " ", 100, 0., lsdep_estimator1_HBdepth1_); + h_2DsumADCAmplLS1 = fs_->make("h_2DsumADCAmplLS1", " ", neta, -41., 41., nphi, 0., bphi); + h_2DsumADCAmplLS1_LSselected = + fs_->make("h_2DsumADCAmplLS1_LSselected", " ", neta, -41., 41., nphi, 0., bphi); + h_sumADCAmplperLS1 = fs_->make("h_sumADCAmplperLS1", " ", bac, 1., bac2); + h_sumCutADCAmplperLS1 = fs_->make("h_sumCutADCAmplperLS1", " ", bac, 1., bac2); + h_2D0sumADCAmplLS1 = fs_->make("h_2D0sumADCAmplLS1", " ", neta, -41., 41., nphi, 0., bphi); + h_sum0ADCAmplperLS1 = fs_->make("h_sum0ADCAmplperLS1", " ", bac, 1., bac2); + + h_sumADCAmplLS2 = fs_->make("h_sumADCAmplLS2", " ", 100, 0., lsdep_estimator1_HBdepth2_); + h_2DsumADCAmplLS2 = fs_->make("h_2DsumADCAmplLS2", " ", neta, -41., 41., nphi, 0., bphi); + h_2DsumADCAmplLS2_LSselected = + fs_->make("h_2DsumADCAmplLS2_LSselected", " ", neta, -41., 41., nphi, 0., bphi); + h_sumADCAmplperLS2 = fs_->make("h_sumADCAmplperLS2", " ", bac, 1., bac2); + h_sumCutADCAmplperLS2 = fs_->make("h_sumCutADCAmplperLS2", " ", bac, 1., bac2); + h_2D0sumADCAmplLS2 = fs_->make("h_2D0sumADCAmplLS2", " ", neta, -41., 41., nphi, 0., bphi); + h_sum0ADCAmplperLS2 = fs_->make("h_sum0ADCAmplperLS2", " ", bac, 1., bac2); + + h_sumADCAmplLS3 = fs_->make("h_sumADCAmplLS3", " ", 100, 0., lsdep_estimator1_HEdepth1_); + h_2DsumADCAmplLS3 = fs_->make("h_2DsumADCAmplLS3", " ", neta, -41., 41., nphi, 0., bphi); + h_2DsumADCAmplLS3_LSselected = + fs_->make("h_2DsumADCAmplLS3_LSselected", " ", neta, -41., 41., nphi, 0., bphi); + h_sumADCAmplperLS3 = fs_->make("h_sumADCAmplperLS3", " ", bac, 1., bac2); + h_sumCutADCAmplperLS3 = fs_->make("h_sumCutADCAmplperLS3", " ", bac, 1., bac2); + h_2D0sumADCAmplLS3 = fs_->make("h_2D0sumADCAmplLS3", " ", neta, -41., 41., nphi, 0., bphi); + h_sum0ADCAmplperLS3 = fs_->make("h_sum0ADCAmplperLS3", " ", bac, 1., bac2); + + h_sumADCAmplLS4 = fs_->make("h_sumADCAmplLS4", " ", 100, 0., lsdep_estimator1_HEdepth2_); + h_2DsumADCAmplLS4 = fs_->make("h_2DsumADCAmplLS4", " ", neta, -41., 41., nphi, 0., bphi); + h_2DsumADCAmplLS4_LSselected = + fs_->make("h_2DsumADCAmplLS4_LSselected", " ", neta, -41., 41., nphi, 0., bphi); + h_sumADCAmplperLS4 = fs_->make("h_sumADCAmplperLS4", " ", bac, 1., bac2); + h_sumCutADCAmplperLS4 = fs_->make("h_sumCutADCAmplperLS4", " ", bac, 1., bac2); + h_2D0sumADCAmplLS4 = fs_->make("h_2D0sumADCAmplLS4", " ", neta, -41., 41., nphi, 0., bphi); + h_sum0ADCAmplperLS4 = fs_->make("h_sum0ADCAmplperLS4", " ", bac, 1., bac2); + + h_sumADCAmplLS5 = fs_->make("h_sumADCAmplLS5", " ", 100, 0., lsdep_estimator1_HEdepth3_); + h_2DsumADCAmplLS5 = fs_->make("h_2DsumADCAmplLS5", " ", neta, -41., 41., nphi, 0., bphi); + h_2DsumADCAmplLS5_LSselected = + fs_->make("h_2DsumADCAmplLS5_LSselected", " ", neta, -41., 41., nphi, 0., bphi); + h_sumADCAmplperLS5 = fs_->make("h_sumADCAmplperLS5", " ", bac, 1., bac2); + h_sumCutADCAmplperLS5 = fs_->make("h_sumCutADCAmplperLS5", " ", bac, 1., bac2); + h_2D0sumADCAmplLS5 = fs_->make("h_2D0sumADCAmplLS5", " ", neta, -41., 41., nphi, 0., bphi); + h_sum0ADCAmplperLS5 = fs_->make("h_sum0ADCAmplperLS5", " ", bac, 1., bac2); // HE upgrade depth4 - h_sumADCAmplperLSdepth4HEu = new TH1F("h_sumADCAmplperLSdepth4HEu", " ", bac, 1., bac2); - h_sumCutADCAmplperLSdepth4HEu = new TH1F("h_sumCutADCAmplperLSdepth4HEu", " ", bac, 1., bac2); - h_sum0ADCAmplperLSdepth4HEu = new TH1F("h_sum0ADCAmplperLSdepth4HEu", " ", bac, 1., bac2); + h_sumADCAmplperLSdepth4HEu = fs_->make("h_sumADCAmplperLSdepth4HEu", " ", bac, 1., bac2); + h_sumCutADCAmplperLSdepth4HEu = fs_->make("h_sumCutADCAmplperLSdepth4HEu", " ", bac, 1., bac2); + h_sum0ADCAmplperLSdepth4HEu = fs_->make("h_sum0ADCAmplperLSdepth4HEu", " ", bac, 1., bac2); // HE upgrade depth5 - h_sumADCAmplperLSdepth5HEu = new TH1F("h_sumADCAmplperLSdepth5HEu", " ", bac, 1., bac2); - h_sumCutADCAmplperLSdepth5HEu = new TH1F("h_sumCutADCAmplperLSdepth5HEu", " ", bac, 1., bac2); - h_sum0ADCAmplperLSdepth5HEu = new TH1F("h_sum0ADCAmplperLSdepth5HEu", " ", bac, 1., bac2); + h_sumADCAmplperLSdepth5HEu = fs_->make("h_sumADCAmplperLSdepth5HEu", " ", bac, 1., bac2); + h_sumCutADCAmplperLSdepth5HEu = fs_->make("h_sumCutADCAmplperLSdepth5HEu", " ", bac, 1., bac2); + h_sum0ADCAmplperLSdepth5HEu = fs_->make("h_sum0ADCAmplperLSdepth5HEu", " ", bac, 1., bac2); // HE upgrade depth6 - h_sumADCAmplperLSdepth6HEu = new TH1F("h_sumADCAmplperLSdepth6HEu", " ", bac, 1., bac2); - h_sumCutADCAmplperLSdepth6HEu = new TH1F("h_sumCutADCAmplperLSdepth6HEu", " ", bac, 1., bac2); - h_sum0ADCAmplperLSdepth6HEu = new TH1F("h_sum0ADCAmplperLSdepth6HEu", " ", bac, 1., bac2); + h_sumADCAmplperLSdepth6HEu = fs_->make("h_sumADCAmplperLSdepth6HEu", " ", bac, 1., bac2); + h_sumCutADCAmplperLSdepth6HEu = fs_->make("h_sumCutADCAmplperLSdepth6HEu", " ", bac, 1., bac2); + h_sum0ADCAmplperLSdepth6HEu = fs_->make("h_sum0ADCAmplperLSdepth6HEu", " ", bac, 1., bac2); // HE upgrade depth7 - h_sumADCAmplperLSdepth7HEu = new TH1F("h_sumADCAmplperLSdepth7HEu", " ", bac, 1., bac2); - h_sumCutADCAmplperLSdepth7HEu = new TH1F("h_sumCutADCAmplperLSdepth7HEu", " ", bac, 1., bac2); - h_sum0ADCAmplperLSdepth7HEu = new TH1F("h_sum0ADCAmplperLSdepth7HEu", " ", bac, 1., bac2); + h_sumADCAmplperLSdepth7HEu = fs_->make("h_sumADCAmplperLSdepth7HEu", " ", bac, 1., bac2); + h_sumCutADCAmplperLSdepth7HEu = fs_->make("h_sumCutADCAmplperLSdepth7HEu", " ", bac, 1., bac2); + h_sum0ADCAmplperLSdepth7HEu = fs_->make("h_sum0ADCAmplperLSdepth7HEu", " ", bac, 1., bac2); // for HE gain stability vs LS: - h_2DsumADCAmplLSdepth4HEu = new TH2F("h_2DsumADCAmplLSdepth4HEu", " ", neta, -41., 41., nphi, 0., bphi); - h_2D0sumADCAmplLSdepth4HEu = new TH2F("h_2D0sumADCAmplLSdepth4HEu", " ", neta, -41., 41., nphi, 0., bphi); - h_2DsumADCAmplLSdepth5HEu = new TH2F("h_2DsumADCAmplLSdepth5HEu", " ", neta, -41., 41., nphi, 0., bphi); - h_2D0sumADCAmplLSdepth5HEu = new TH2F("h_2D0sumADCAmplLSdepth5HEu", " ", neta, -41., 41., nphi, 0., bphi); - h_2DsumADCAmplLSdepth6HEu = new TH2F("h_2DsumADCAmplLSdepth6HEu", " ", neta, -41., 41., nphi, 0., bphi); - h_2D0sumADCAmplLSdepth6HEu = new TH2F("h_2D0sumADCAmplLSdepth6HEu", " ", neta, -41., 41., nphi, 0., bphi); - h_2DsumADCAmplLSdepth7HEu = new TH2F("h_2DsumADCAmplLSdepth7HEu", " ", neta, -41., 41., nphi, 0., bphi); - h_2D0sumADCAmplLSdepth7HEu = new TH2F("h_2D0sumADCAmplLSdepth7HEu", " ", neta, -41., 41., nphi, 0., bphi); - h_2DsumADCAmplLSdepth3HFu = new TH2F("h_2DsumADCAmplLSdepth3HFu", " ", neta, -41., 41., nphi, 0., bphi); - h_2D0sumADCAmplLSdepth3HFu = new TH2F("h_2D0sumADCAmplLSdepth3HFu", " ", neta, -41., 41., nphi, 0., bphi); - h_2DsumADCAmplLSdepth4HFu = new TH2F("h_2DsumADCAmplLSdepth4HFu", " ", neta, -41., 41., nphi, 0., bphi); - h_2D0sumADCAmplLSdepth4HFu = new TH2F("h_2D0sumADCAmplLSdepth4HFu", " ", neta, -41., 41., nphi, 0., bphi); - - h_sumADCAmplLS6 = new TH1F("h_sumADCAmplLS6", " ", 100, 0., lsdep_estimator1_HFdepth1_); - h_2DsumADCAmplLS6 = new TH2F("h_2DsumADCAmplLS6", " ", neta, -41., 41., nphi, 0., bphi); - h_2DsumADCAmplLS6_LSselected = new TH2F("h_2DsumADCAmplLS6_LSselected", " ", neta, -41., 41., nphi, 0., bphi); - h_2D0sumADCAmplLS6 = new TH2F("h_2D0sumADCAmplLS6", " ", neta, -41., 41., nphi, 0., bphi); - h_sumADCAmplperLS6 = new TH1F("h_sumADCAmplperLS6", " ", bac, 1., bac2); - h_sumCutADCAmplperLS6 = new TH1F("h_sumCutADCAmplperLS6", " ", bac, 1., bac2); - h_sum0ADCAmplperLS6 = new TH1F("h_sum0ADCAmplperLS6", " ", bac, 1., bac2); + h_2DsumADCAmplLSdepth4HEu = fs_->make("h_2DsumADCAmplLSdepth4HEu", " ", neta, -41., 41., nphi, 0., bphi); + h_2D0sumADCAmplLSdepth4HEu = fs_->make("h_2D0sumADCAmplLSdepth4HEu", " ", neta, -41., 41., nphi, 0., bphi); + h_2DsumADCAmplLSdepth5HEu = fs_->make("h_2DsumADCAmplLSdepth5HEu", " ", neta, -41., 41., nphi, 0., bphi); + h_2D0sumADCAmplLSdepth5HEu = fs_->make("h_2D0sumADCAmplLSdepth5HEu", " ", neta, -41., 41., nphi, 0., bphi); + h_2DsumADCAmplLSdepth6HEu = fs_->make("h_2DsumADCAmplLSdepth6HEu", " ", neta, -41., 41., nphi, 0., bphi); + h_2D0sumADCAmplLSdepth6HEu = fs_->make("h_2D0sumADCAmplLSdepth6HEu", " ", neta, -41., 41., nphi, 0., bphi); + h_2DsumADCAmplLSdepth7HEu = fs_->make("h_2DsumADCAmplLSdepth7HEu", " ", neta, -41., 41., nphi, 0., bphi); + h_2D0sumADCAmplLSdepth7HEu = fs_->make("h_2D0sumADCAmplLSdepth7HEu", " ", neta, -41., 41., nphi, 0., bphi); + h_2DsumADCAmplLSdepth3HFu = fs_->make("h_2DsumADCAmplLSdepth3HFu", " ", neta, -41., 41., nphi, 0., bphi); + h_2D0sumADCAmplLSdepth3HFu = fs_->make("h_2D0sumADCAmplLSdepth3HFu", " ", neta, -41., 41., nphi, 0., bphi); + h_2DsumADCAmplLSdepth4HFu = fs_->make("h_2DsumADCAmplLSdepth4HFu", " ", neta, -41., 41., nphi, 0., bphi); + h_2D0sumADCAmplLSdepth4HFu = fs_->make("h_2D0sumADCAmplLSdepth4HFu", " ", neta, -41., 41., nphi, 0., bphi); + + h_sumADCAmplLS6 = fs_->make("h_sumADCAmplLS6", " ", 100, 0., lsdep_estimator1_HFdepth1_); + h_2DsumADCAmplLS6 = fs_->make("h_2DsumADCAmplLS6", " ", neta, -41., 41., nphi, 0., bphi); + h_2DsumADCAmplLS6_LSselected = + fs_->make("h_2DsumADCAmplLS6_LSselected", " ", neta, -41., 41., nphi, 0., bphi); + h_2D0sumADCAmplLS6 = fs_->make("h_2D0sumADCAmplLS6", " ", neta, -41., 41., nphi, 0., bphi); + h_sumADCAmplperLS6 = fs_->make("h_sumADCAmplperLS6", " ", bac, 1., bac2); + h_sumCutADCAmplperLS6 = fs_->make("h_sumCutADCAmplperLS6", " ", bac, 1., bac2); + h_sum0ADCAmplperLS6 = fs_->make("h_sum0ADCAmplperLS6", " ", bac, 1., bac2); // HF upgrade depth3 - h_sumADCAmplperLS6u = new TH1F("h_sumADCAmplperLS6u", " ", bac, 1., bac2); - h_sumCutADCAmplperLS6u = new TH1F("h_sumCutADCAmplperLS6u", " ", bac, 1., bac2); - h_sum0ADCAmplperLS6u = new TH1F("h_sum0ADCAmplperLS6u", " ", bac, 1., bac2); - - h_sumADCAmplLS7 = new TH1F("h_sumADCAmplLS7", " ", 100, 0., lsdep_estimator1_HFdepth2_); - h_2DsumADCAmplLS7 = new TH2F("h_2DsumADCAmplLS7", " ", neta, -41., 41., nphi, 0., bphi); - h_2DsumADCAmplLS7_LSselected = new TH2F("h_2DsumADCAmplLS7_LSselected", " ", neta, -41., 41., nphi, 0., bphi); - h_2D0sumADCAmplLS7 = new TH2F("h_2D0sumADCAmplLS7", " ", neta, -41., 41., nphi, 0., bphi); - h_sumADCAmplperLS7 = new TH1F("h_sumADCAmplperLS7", " ", bac, 1., bac2); - h_sumCutADCAmplperLS7 = new TH1F("h_sumCutADCAmplperLS7", " ", bac, 1., bac2); - h_sum0ADCAmplperLS7 = new TH1F("h_sum0ADCAmplperLS7", " ", bac, 1., bac2); + h_sumADCAmplperLS6u = fs_->make("h_sumADCAmplperLS6u", " ", bac, 1., bac2); + h_sumCutADCAmplperLS6u = fs_->make("h_sumCutADCAmplperLS6u", " ", bac, 1., bac2); + h_sum0ADCAmplperLS6u = fs_->make("h_sum0ADCAmplperLS6u", " ", bac, 1., bac2); + + h_sumADCAmplLS7 = fs_->make("h_sumADCAmplLS7", " ", 100, 0., lsdep_estimator1_HFdepth2_); + h_2DsumADCAmplLS7 = fs_->make("h_2DsumADCAmplLS7", " ", neta, -41., 41., nphi, 0., bphi); + h_2DsumADCAmplLS7_LSselected = + fs_->make("h_2DsumADCAmplLS7_LSselected", " ", neta, -41., 41., nphi, 0., bphi); + h_2D0sumADCAmplLS7 = fs_->make("h_2D0sumADCAmplLS7", " ", neta, -41., 41., nphi, 0., bphi); + h_sumADCAmplperLS7 = fs_->make("h_sumADCAmplperLS7", " ", bac, 1., bac2); + h_sumCutADCAmplperLS7 = fs_->make("h_sumCutADCAmplperLS7", " ", bac, 1., bac2); + h_sum0ADCAmplperLS7 = fs_->make("h_sum0ADCAmplperLS7", " ", bac, 1., bac2); // HF upgrade depth4 - h_sumADCAmplperLS7u = new TH1F("h_sumADCAmplperLS7u", " ", bac, 1., bac2); - h_sumCutADCAmplperLS7u = new TH1F("h_sumCutADCAmplperLS7u", " ", bac, 1., bac2); - h_sum0ADCAmplperLS7u = new TH1F("h_sum0ADCAmplperLS7u", " ", bac, 1., bac2); - - h_sumADCAmplLS8 = new TH1F("h_sumADCAmplLS8", " ", 100, 0., lsdep_estimator1_HOdepth4_); - h_2DsumADCAmplLS8 = new TH2F("h_2DsumADCAmplLS8", " ", neta, -41., 41., nphi, 0., bphi); - h_2DsumADCAmplLS8_LSselected = new TH2F("h_2DsumADCAmplLS8_LSselected", " ", neta, -41., 41., nphi, 0., bphi); - h_sumADCAmplperLS8 = new TH1F("h_sumADCAmplperLS8", " ", bac, 1., bac2); - h_sumCutADCAmplperLS8 = new TH1F("h_sumCutADCAmplperLS8", " ", bac, 1., bac2); - h_2D0sumADCAmplLS8 = new TH2F("h_2D0sumADCAmplLS8", " ", neta, -41., 41., nphi, 0., bphi); - h_sum0ADCAmplperLS8 = new TH1F("h_sum0ADCAmplperLS8", " ", bac, 1., bac2); + h_sumADCAmplperLS7u = fs_->make("h_sumADCAmplperLS7u", " ", bac, 1., bac2); + h_sumCutADCAmplperLS7u = fs_->make("h_sumCutADCAmplperLS7u", " ", bac, 1., bac2); + h_sum0ADCAmplperLS7u = fs_->make("h_sum0ADCAmplperLS7u", " ", bac, 1., bac2); + + h_sumADCAmplLS8 = fs_->make("h_sumADCAmplLS8", " ", 100, 0., lsdep_estimator1_HOdepth4_); + h_2DsumADCAmplLS8 = fs_->make("h_2DsumADCAmplLS8", " ", neta, -41., 41., nphi, 0., bphi); + h_2DsumADCAmplLS8_LSselected = + fs_->make("h_2DsumADCAmplLS8_LSselected", " ", neta, -41., 41., nphi, 0., bphi); + h_sumADCAmplperLS8 = fs_->make("h_sumADCAmplperLS8", " ", bac, 1., bac2); + h_sumCutADCAmplperLS8 = fs_->make("h_sumCutADCAmplperLS8", " ", bac, 1., bac2); + h_2D0sumADCAmplLS8 = fs_->make("h_2D0sumADCAmplLS8", " ", neta, -41., 41., nphi, 0., bphi); + h_sum0ADCAmplperLS8 = fs_->make("h_sum0ADCAmplperLS8", " ", bac, 1., bac2); // HB upgrade depth3 - h_sumADCAmplperLSdepth3HBu = new TH1F("h_sumADCAmplperLSdepth3HBu", " ", bac, 1., bac2); - h_sumCutADCAmplperLSdepth3HBu = new TH1F("h_sumCutADCAmplperLSdepth3HBu", " ", bac, 1., bac2); - h_sum0ADCAmplperLSdepth3HBu = new TH1F("h_sum0ADCAmplperLSdepth3HBu", " ", bac, 1., bac2); + h_sumADCAmplperLSdepth3HBu = fs_->make("h_sumADCAmplperLSdepth3HBu", " ", bac, 1., bac2); + h_sumCutADCAmplperLSdepth3HBu = fs_->make("h_sumCutADCAmplperLSdepth3HBu", " ", bac, 1., bac2); + h_sum0ADCAmplperLSdepth3HBu = fs_->make("h_sum0ADCAmplperLSdepth3HBu", " ", bac, 1., bac2); // HB upgrade depth4 - h_sumADCAmplperLSdepth4HBu = new TH1F("h_sumADCAmplperLSdepth4HBu", " ", bac, 1., bac2); - h_sumCutADCAmplperLSdepth4HBu = new TH1F("h_sumCutADCAmplperLSdepth4HBu", " ", bac, 1., bac2); - h_sum0ADCAmplperLSdepth4HBu = new TH1F("h_sum0ADCAmplperLSdepth4HBu", " ", bac, 1., bac2); + h_sumADCAmplperLSdepth4HBu = fs_->make("h_sumADCAmplperLSdepth4HBu", " ", bac, 1., bac2); + h_sumCutADCAmplperLSdepth4HBu = fs_->make("h_sumCutADCAmplperLSdepth4HBu", " ", bac, 1., bac2); + h_sum0ADCAmplperLSdepth4HBu = fs_->make("h_sum0ADCAmplperLSdepth4HBu", " ", bac, 1., bac2); // for HB gain stability vs LS: - h_2DsumADCAmplLSdepth3HBu = new TH2F("h_2DsumADCAmplLSdepth3HBu", " ", neta, -41., 41., nphi, 0., bphi); - h_2D0sumADCAmplLSdepth3HBu = new TH2F("h_2D0sumADCAmplLSdepth3HBu", " ", neta, -41., 41., nphi, 0., bphi); - h_2DsumADCAmplLSdepth4HBu = new TH2F("h_2DsumADCAmplLSdepth4HBu", " ", neta, -41., 41., nphi, 0., bphi); - h_2D0sumADCAmplLSdepth4HBu = new TH2F("h_2D0sumADCAmplLSdepth4HBu", " ", neta, -41., 41., nphi, 0., bphi); + h_2DsumADCAmplLSdepth3HBu = fs_->make("h_2DsumADCAmplLSdepth3HBu", " ", neta, -41., 41., nphi, 0., bphi); + h_2D0sumADCAmplLSdepth3HBu = fs_->make("h_2D0sumADCAmplLSdepth3HBu", " ", neta, -41., 41., nphi, 0., bphi); + h_2DsumADCAmplLSdepth4HBu = fs_->make("h_2DsumADCAmplLSdepth4HBu", " ", neta, -41., 41., nphi, 0., bphi); + h_2D0sumADCAmplLSdepth4HBu = fs_->make("h_2D0sumADCAmplLSdepth4HBu", " ", neta, -41., 41., nphi, 0., bphi); // error-A for HB( depth1 only) - h_sumADCAmplperLS1_P1 = new TH1F("h_sumADCAmplperLS1_P1", " ", bac, 1., bac2); - h_sum0ADCAmplperLS1_P1 = new TH1F("h_sum0ADCAmplperLS1_P1", " ", bac, 1., bac2); - h_sumADCAmplperLS1_P2 = new TH1F("h_sumADCAmplperLS1_P2", " ", bac, 1., bac2); - h_sum0ADCAmplperLS1_P2 = new TH1F("h_sum0ADCAmplperLS1_P2", " ", bac, 1., bac2); - h_sumADCAmplperLS1_M1 = new TH1F("h_sumADCAmplperLS1_M1", " ", bac, 1., bac2); - h_sum0ADCAmplperLS1_M1 = new TH1F("h_sum0ADCAmplperLS1_M1", " ", bac, 1., bac2); - h_sumADCAmplperLS1_M2 = new TH1F("h_sumADCAmplperLS1_M2", " ", bac, 1., bac2); - h_sum0ADCAmplperLS1_M2 = new TH1F("h_sum0ADCAmplperLS1_M2", " ", bac, 1., bac2); + h_sumADCAmplperLS1_P1 = fs_->make("h_sumADCAmplperLS1_P1", " ", bac, 1., bac2); + h_sum0ADCAmplperLS1_P1 = fs_->make("h_sum0ADCAmplperLS1_P1", " ", bac, 1., bac2); + h_sumADCAmplperLS1_P2 = fs_->make("h_sumADCAmplperLS1_P2", " ", bac, 1., bac2); + h_sum0ADCAmplperLS1_P2 = fs_->make("h_sum0ADCAmplperLS1_P2", " ", bac, 1., bac2); + h_sumADCAmplperLS1_M1 = fs_->make("h_sumADCAmplperLS1_M1", " ", bac, 1., bac2); + h_sum0ADCAmplperLS1_M1 = fs_->make("h_sum0ADCAmplperLS1_M1", " ", bac, 1., bac2); + h_sumADCAmplperLS1_M2 = fs_->make("h_sumADCAmplperLS1_M2", " ", bac, 1., bac2); + h_sum0ADCAmplperLS1_M2 = fs_->make("h_sum0ADCAmplperLS1_M2", " ", bac, 1., bac2); // error-A for HE( depth1 only) - h_sumADCAmplperLS3_P1 = new TH1F("h_sumADCAmplperLS3_P1", " ", bac, 1., bac2); - h_sum0ADCAmplperLS3_P1 = new TH1F("h_sum0ADCAmplperLS3_P1", " ", bac, 1., bac2); - h_sumADCAmplperLS3_P2 = new TH1F("h_sumADCAmplperLS3_P2", " ", bac, 1., bac2); - h_sum0ADCAmplperLS3_P2 = new TH1F("h_sum0ADCAmplperLS3_P2", " ", bac, 1., bac2); - h_sumADCAmplperLS3_M1 = new TH1F("h_sumADCAmplperLS3_M1", " ", bac, 1., bac2); - h_sum0ADCAmplperLS3_M1 = new TH1F("h_sum0ADCAmplperLS3_M1", " ", bac, 1., bac2); - h_sumADCAmplperLS3_M2 = new TH1F("h_sumADCAmplperLS3_M2", " ", bac, 1., bac2); - h_sum0ADCAmplperLS3_M2 = new TH1F("h_sum0ADCAmplperLS3_M2", " ", bac, 1., bac2); + h_sumADCAmplperLS3_P1 = fs_->make("h_sumADCAmplperLS3_P1", " ", bac, 1., bac2); + h_sum0ADCAmplperLS3_P1 = fs_->make("h_sum0ADCAmplperLS3_P1", " ", bac, 1., bac2); + h_sumADCAmplperLS3_P2 = fs_->make("h_sumADCAmplperLS3_P2", " ", bac, 1., bac2); + h_sum0ADCAmplperLS3_P2 = fs_->make("h_sum0ADCAmplperLS3_P2", " ", bac, 1., bac2); + h_sumADCAmplperLS3_M1 = fs_->make("h_sumADCAmplperLS3_M1", " ", bac, 1., bac2); + h_sum0ADCAmplperLS3_M1 = fs_->make("h_sum0ADCAmplperLS3_M1", " ", bac, 1., bac2); + h_sumADCAmplperLS3_M2 = fs_->make("h_sumADCAmplperLS3_M2", " ", bac, 1., bac2); + h_sum0ADCAmplperLS3_M2 = fs_->make("h_sum0ADCAmplperLS3_M2", " ", bac, 1., bac2); // error-A for HF( depth1 only) - h_sumADCAmplperLS6_P1 = new TH1F("h_sumADCAmplperLS6_P1", " ", bac, 1., bac2); - h_sum0ADCAmplperLS6_P1 = new TH1F("h_sum0ADCAmplperLS6_P1", " ", bac, 1., bac2); - h_sumADCAmplperLS6_P2 = new TH1F("h_sumADCAmplperLS6_P2", " ", bac, 1., bac2); - h_sum0ADCAmplperLS6_P2 = new TH1F("h_sum0ADCAmplperLS6_P2", " ", bac, 1., bac2); - h_sumADCAmplperLS6_M1 = new TH1F("h_sumADCAmplperLS6_M1", " ", bac, 1., bac2); - h_sum0ADCAmplperLS6_M1 = new TH1F("h_sum0ADCAmplperLS6_M1", " ", bac, 1., bac2); - h_sumADCAmplperLS6_M2 = new TH1F("h_sumADCAmplperLS6_M2", " ", bac, 1., bac2); - h_sum0ADCAmplperLS6_M2 = new TH1F("h_sum0ADCAmplperLS6_M2", " ", bac, 1., bac2); + h_sumADCAmplperLS6_P1 = fs_->make("h_sumADCAmplperLS6_P1", " ", bac, 1., bac2); + h_sum0ADCAmplperLS6_P1 = fs_->make("h_sum0ADCAmplperLS6_P1", " ", bac, 1., bac2); + h_sumADCAmplperLS6_P2 = fs_->make("h_sumADCAmplperLS6_P2", " ", bac, 1., bac2); + h_sum0ADCAmplperLS6_P2 = fs_->make("h_sum0ADCAmplperLS6_P2", " ", bac, 1., bac2); + h_sumADCAmplperLS6_M1 = fs_->make("h_sumADCAmplperLS6_M1", " ", bac, 1., bac2); + h_sum0ADCAmplperLS6_M1 = fs_->make("h_sum0ADCAmplperLS6_M1", " ", bac, 1., bac2); + h_sumADCAmplperLS6_M2 = fs_->make("h_sumADCAmplperLS6_M2", " ", bac, 1., bac2); + h_sum0ADCAmplperLS6_M2 = fs_->make("h_sum0ADCAmplperLS6_M2", " ", bac, 1., bac2); // error-A for HO( depth4 only) - h_sumADCAmplperLS8_P1 = new TH1F("h_sumADCAmplperLS8_P1", " ", bac, 1., bac2); - h_sum0ADCAmplperLS8_P1 = new TH1F("h_sum0ADCAmplperLS8_P1", " ", bac, 1., bac2); - h_sumADCAmplperLS8_P2 = new TH1F("h_sumADCAmplperLS8_P2", " ", bac, 1., bac2); - h_sum0ADCAmplperLS8_P2 = new TH1F("h_sum0ADCAmplperLS8_P2", " ", bac, 1., bac2); - h_sumADCAmplperLS8_M1 = new TH1F("h_sumADCAmplperLS8_M1", " ", bac, 1., bac2); - h_sum0ADCAmplperLS8_M1 = new TH1F("h_sum0ADCAmplperLS8_M1", " ", bac, 1., bac2); - h_sumADCAmplperLS8_M2 = new TH1F("h_sumADCAmplperLS8_M2", " ", bac, 1., bac2); - h_sum0ADCAmplperLS8_M2 = new TH1F("h_sum0ADCAmplperLS8_M2", " ", bac, 1., bac2); + h_sumADCAmplperLS8_P1 = fs_->make("h_sumADCAmplperLS8_P1", " ", bac, 1., bac2); + h_sum0ADCAmplperLS8_P1 = fs_->make("h_sum0ADCAmplperLS8_P1", " ", bac, 1., bac2); + h_sumADCAmplperLS8_P2 = fs_->make("h_sumADCAmplperLS8_P2", " ", bac, 1., bac2); + h_sum0ADCAmplperLS8_P2 = fs_->make("h_sum0ADCAmplperLS8_P2", " ", bac, 1., bac2); + h_sumADCAmplperLS8_M1 = fs_->make("h_sumADCAmplperLS8_M1", " ", bac, 1., bac2); + h_sum0ADCAmplperLS8_M1 = fs_->make("h_sum0ADCAmplperLS8_M1", " ", bac, 1., bac2); + h_sumADCAmplperLS8_M2 = fs_->make("h_sumADCAmplperLS8_M2", " ", bac, 1., bac2); + h_sum0ADCAmplperLS8_M2 = fs_->make("h_sum0ADCAmplperLS8_M2", " ", bac, 1., bac2); //-------------------------------------------------- - h_sumTSmeanALS1 = new TH1F("h_sumTSmeanALS1", " ", 100, 0., lsdep_estimator2_HBdepth1_); - h_2DsumTSmeanALS1 = new TH2F("h_2DsumTSmeanALS1", " ", neta, -41., 41., nphi, 0., bphi); - h_sumTSmeanAperLS1 = new TH1F("h_sumTSmeanAperLS1", " ", bac, 1., bac2); - h_sumTSmeanAperLS1_LSselected = new TH1F("h_sumTSmeanAperLS1_LSselected", " ", bac, 1., bac2); - h_sumCutTSmeanAperLS1 = new TH1F("h_sumCutTSmeanAperLS1", " ", bac, 1., bac2); - h_2D0sumTSmeanALS1 = new TH2F("h_2D0sumTSmeanALS1", " ", neta, -41., 41., nphi, 0., bphi); - h_sum0TSmeanAperLS1 = new TH1F("h_sum0TSmeanAperLS1", " ", bac, 1., bac2); - - h_sumTSmeanALS2 = new TH1F("h_sumTSmeanALS2", " ", 100, 0., lsdep_estimator2_HBdepth2_); - h_2DsumTSmeanALS2 = new TH2F("h_2DsumTSmeanALS2", " ", neta, -41., 41., nphi, 0., bphi); - h_sumTSmeanAperLS2 = new TH1F("h_sumTSmeanAperLS2", " ", bac, 1., bac2); - h_sumCutTSmeanAperLS2 = new TH1F("h_sumCutTSmeanAperLS2", " ", bac, 1., bac2); - h_2D0sumTSmeanALS2 = new TH2F("h_2D0sumTSmeanALS2", " ", neta, -41., 41., nphi, 0., bphi); - h_sum0TSmeanAperLS2 = new TH1F("h_sum0TSmeanAperLS2", " ", bac, 1., bac2); - - h_sumTSmeanALS3 = new TH1F("h_sumTSmeanALS3", " ", 100, 0., lsdep_estimator2_HEdepth1_); - h_2DsumTSmeanALS3 = new TH2F("h_2DsumTSmeanALS3", " ", neta, -41., 41., nphi, 0., bphi); - h_sumTSmeanAperLS3 = new TH1F("h_sumTSmeanAperLS3", " ", bac, 1., bac2); - h_sumCutTSmeanAperLS3 = new TH1F("h_sumCutTSmeanAperLS3", " ", bac, 1., bac2); - h_2D0sumTSmeanALS3 = new TH2F("h_2D0sumTSmeanALS3", " ", neta, -41., 41., nphi, 0., bphi); - h_sum0TSmeanAperLS3 = new TH1F("h_sum0TSmeanAperLS3", " ", bac, 1., bac2); - - h_sumTSmeanALS4 = new TH1F("h_sumTSmeanALS4", " ", 100, 0., lsdep_estimator2_HEdepth2_); - h_2DsumTSmeanALS4 = new TH2F("h_2DsumTSmeanALS4", " ", neta, -41., 41., nphi, 0., bphi); - h_sumTSmeanAperLS4 = new TH1F("h_sumTSmeanAperLS4", " ", bac, 1., bac2); - h_sumCutTSmeanAperLS4 = new TH1F("h_sumCutTSmeanAperLS4", " ", bac, 1., bac2); - h_2D0sumTSmeanALS4 = new TH2F("h_2D0sumTSmeanALS4", " ", neta, -41., 41., nphi, 0., bphi); - h_sum0TSmeanAperLS4 = new TH1F("h_sum0TSmeanAperLS4", " ", bac, 1., bac2); - - h_sumTSmeanALS5 = new TH1F("h_sumTSmeanALS5", " ", 100, 0., lsdep_estimator2_HEdepth3_); - h_2DsumTSmeanALS5 = new TH2F("h_2DsumTSmeanALS5", " ", neta, -41., 41., nphi, 0., bphi); - h_sumTSmeanAperLS5 = new TH1F("h_sumTSmeanAperLS5", " ", bac, 1., bac2); - h_sumCutTSmeanAperLS5 = new TH1F("h_sumCutTSmeanAperLS5", " ", bac, 1., bac2); - h_2D0sumTSmeanALS5 = new TH2F("h_2D0sumTSmeanALS5", " ", neta, -41., 41., nphi, 0., bphi); - h_sum0TSmeanAperLS5 = new TH1F("h_sum0TSmeanAperLS5", " ", bac, 1., bac2); - - h_sumTSmeanALS6 = new TH1F("h_sumTSmeanALS6", " ", 100, 0., lsdep_estimator2_HFdepth1_); - h_2DsumTSmeanALS6 = new TH2F("h_2DsumTSmeanALS6", " ", neta, -41., 41., nphi, 0., bphi); - h_sumTSmeanAperLS6 = new TH1F("h_sumTSmeanAperLS6", " ", bac, 1., bac2); - h_sumCutTSmeanAperLS6 = new TH1F("h_sumCutTSmeanAperLS6", " ", bac, 1., bac2); - h_2D0sumTSmeanALS6 = new TH2F("h_2D0sumTSmeanALS6", " ", neta, -41., 41., nphi, 0., bphi); - h_sum0TSmeanAperLS6 = new TH1F("h_sum0TSmeanAperLS6", " ", bac, 1., bac2); - - h_sumTSmeanALS7 = new TH1F("h_sumTSmeanALS7", " ", 100, 0., lsdep_estimator2_HFdepth2_); - h_2DsumTSmeanALS7 = new TH2F("h_2DsumTSmeanALS7", " ", neta, -41., 41., nphi, 0., bphi); - h_sumTSmeanAperLS7 = new TH1F("h_sumTSmeanAperLS7", " ", bac, 1., bac2); - h_sumCutTSmeanAperLS7 = new TH1F("h_sumCutTSmeanAperLS7", " ", bac, 1., bac2); - h_2D0sumTSmeanALS7 = new TH2F("h_2D0sumTSmeanALS7", " ", neta, -41., 41., nphi, 0., bphi); - h_sum0TSmeanAperLS7 = new TH1F("h_sum0TSmeanAperLS7", " ", bac, 1., bac2); - - h_sumTSmeanALS8 = new TH1F("h_sumTSmeanALS8", " ", 100, 0., lsdep_estimator2_HOdepth4_); - h_2DsumTSmeanALS8 = new TH2F("h_2DsumTSmeanALS8", " ", neta, -41., 41., nphi, 0., bphi); - h_sumTSmeanAperLS8 = new TH1F("h_sumTSmeanAperLS8", " ", bac, 1., bac2); - h_sumCutTSmeanAperLS8 = new TH1F("h_sumCutTSmeanAperLS8", " ", bac, 1., bac2); - h_2D0sumTSmeanALS8 = new TH2F("h_2D0sumTSmeanALS8", " ", neta, -41., 41., nphi, 0., bphi); - h_sum0TSmeanAperLS8 = new TH1F("h_sum0TSmeanAperLS8", " ", bac, 1., bac2); + h_sumTSmeanALS1 = fs_->make("h_sumTSmeanALS1", " ", 100, 0., lsdep_estimator2_HBdepth1_); + h_2DsumTSmeanALS1 = fs_->make("h_2DsumTSmeanALS1", " ", neta, -41., 41., nphi, 0., bphi); + h_sumTSmeanAperLS1 = fs_->make("h_sumTSmeanAperLS1", " ", bac, 1., bac2); + h_sumTSmeanAperLS1_LSselected = fs_->make("h_sumTSmeanAperLS1_LSselected", " ", bac, 1., bac2); + h_sumCutTSmeanAperLS1 = fs_->make("h_sumCutTSmeanAperLS1", " ", bac, 1., bac2); + h_2D0sumTSmeanALS1 = fs_->make("h_2D0sumTSmeanALS1", " ", neta, -41., 41., nphi, 0., bphi); + h_sum0TSmeanAperLS1 = fs_->make("h_sum0TSmeanAperLS1", " ", bac, 1., bac2); + + h_sumTSmeanALS2 = fs_->make("h_sumTSmeanALS2", " ", 100, 0., lsdep_estimator2_HBdepth2_); + h_2DsumTSmeanALS2 = fs_->make("h_2DsumTSmeanALS2", " ", neta, -41., 41., nphi, 0., bphi); + h_sumTSmeanAperLS2 = fs_->make("h_sumTSmeanAperLS2", " ", bac, 1., bac2); + h_sumCutTSmeanAperLS2 = fs_->make("h_sumCutTSmeanAperLS2", " ", bac, 1., bac2); + h_2D0sumTSmeanALS2 = fs_->make("h_2D0sumTSmeanALS2", " ", neta, -41., 41., nphi, 0., bphi); + h_sum0TSmeanAperLS2 = fs_->make("h_sum0TSmeanAperLS2", " ", bac, 1., bac2); + + h_sumTSmeanALS3 = fs_->make("h_sumTSmeanALS3", " ", 100, 0., lsdep_estimator2_HEdepth1_); + h_2DsumTSmeanALS3 = fs_->make("h_2DsumTSmeanALS3", " ", neta, -41., 41., nphi, 0., bphi); + h_sumTSmeanAperLS3 = fs_->make("h_sumTSmeanAperLS3", " ", bac, 1., bac2); + h_sumCutTSmeanAperLS3 = fs_->make("h_sumCutTSmeanAperLS3", " ", bac, 1., bac2); + h_2D0sumTSmeanALS3 = fs_->make("h_2D0sumTSmeanALS3", " ", neta, -41., 41., nphi, 0., bphi); + h_sum0TSmeanAperLS3 = fs_->make("h_sum0TSmeanAperLS3", " ", bac, 1., bac2); + + h_sumTSmeanALS4 = fs_->make("h_sumTSmeanALS4", " ", 100, 0., lsdep_estimator2_HEdepth2_); + h_2DsumTSmeanALS4 = fs_->make("h_2DsumTSmeanALS4", " ", neta, -41., 41., nphi, 0., bphi); + h_sumTSmeanAperLS4 = fs_->make("h_sumTSmeanAperLS4", " ", bac, 1., bac2); + h_sumCutTSmeanAperLS4 = fs_->make("h_sumCutTSmeanAperLS4", " ", bac, 1., bac2); + h_2D0sumTSmeanALS4 = fs_->make("h_2D0sumTSmeanALS4", " ", neta, -41., 41., nphi, 0., bphi); + h_sum0TSmeanAperLS4 = fs_->make("h_sum0TSmeanAperLS4", " ", bac, 1., bac2); + + h_sumTSmeanALS5 = fs_->make("h_sumTSmeanALS5", " ", 100, 0., lsdep_estimator2_HEdepth3_); + h_2DsumTSmeanALS5 = fs_->make("h_2DsumTSmeanALS5", " ", neta, -41., 41., nphi, 0., bphi); + h_sumTSmeanAperLS5 = fs_->make("h_sumTSmeanAperLS5", " ", bac, 1., bac2); + h_sumCutTSmeanAperLS5 = fs_->make("h_sumCutTSmeanAperLS5", " ", bac, 1., bac2); + h_2D0sumTSmeanALS5 = fs_->make("h_2D0sumTSmeanALS5", " ", neta, -41., 41., nphi, 0., bphi); + h_sum0TSmeanAperLS5 = fs_->make("h_sum0TSmeanAperLS5", " ", bac, 1., bac2); + + h_sumTSmeanALS6 = fs_->make("h_sumTSmeanALS6", " ", 100, 0., lsdep_estimator2_HFdepth1_); + h_2DsumTSmeanALS6 = fs_->make("h_2DsumTSmeanALS6", " ", neta, -41., 41., nphi, 0., bphi); + h_sumTSmeanAperLS6 = fs_->make("h_sumTSmeanAperLS6", " ", bac, 1., bac2); + h_sumCutTSmeanAperLS6 = fs_->make("h_sumCutTSmeanAperLS6", " ", bac, 1., bac2); + h_2D0sumTSmeanALS6 = fs_->make("h_2D0sumTSmeanALS6", " ", neta, -41., 41., nphi, 0., bphi); + h_sum0TSmeanAperLS6 = fs_->make("h_sum0TSmeanAperLS6", " ", bac, 1., bac2); + + h_sumTSmeanALS7 = fs_->make("h_sumTSmeanALS7", " ", 100, 0., lsdep_estimator2_HFdepth2_); + h_2DsumTSmeanALS7 = fs_->make("h_2DsumTSmeanALS7", " ", neta, -41., 41., nphi, 0., bphi); + h_sumTSmeanAperLS7 = fs_->make("h_sumTSmeanAperLS7", " ", bac, 1., bac2); + h_sumCutTSmeanAperLS7 = fs_->make("h_sumCutTSmeanAperLS7", " ", bac, 1., bac2); + h_2D0sumTSmeanALS7 = fs_->make("h_2D0sumTSmeanALS7", " ", neta, -41., 41., nphi, 0., bphi); + h_sum0TSmeanAperLS7 = fs_->make("h_sum0TSmeanAperLS7", " ", bac, 1., bac2); + + h_sumTSmeanALS8 = fs_->make("h_sumTSmeanALS8", " ", 100, 0., lsdep_estimator2_HOdepth4_); + h_2DsumTSmeanALS8 = fs_->make("h_2DsumTSmeanALS8", " ", neta, -41., 41., nphi, 0., bphi); + h_sumTSmeanAperLS8 = fs_->make("h_sumTSmeanAperLS8", " ", bac, 1., bac2); + h_sumCutTSmeanAperLS8 = fs_->make("h_sumCutTSmeanAperLS8", " ", bac, 1., bac2); + h_2D0sumTSmeanALS8 = fs_->make("h_2D0sumTSmeanALS8", " ", neta, -41., 41., nphi, 0., bphi); + h_sum0TSmeanAperLS8 = fs_->make("h_sum0TSmeanAperLS8", " ", bac, 1., bac2); //-------------------------------------------------- // for estimator3: // float est3 = 10.0; - h_sumTSmaxALS1 = new TH1F("h_sumTSmaxALS1", " ", 100, 0., lsdep_estimator3_HBdepth1_); - h_2DsumTSmaxALS1 = new TH2F("h_2DsumTSmaxALS1", " ", neta, -41., 41., nphi, 0., bphi); - h_sumTSmaxAperLS1 = new TH1F("h_sumTSmaxAperLS1", " ", bac, 1., bac2); - h_sumTSmaxAperLS1_LSselected = new TH1F("h_sumTSmaxAperLS1_LSselected", " ", bac, 1., bac2); - h_sumCutTSmaxAperLS1 = new TH1F("h_sumCutTSmaxAperLS1", " ", bac, 1., bac2); - h_2D0sumTSmaxALS1 = new TH2F("h_2D0sumTSmaxALS1", " ", neta, -41., 41., nphi, 0., bphi); - h_sum0TSmaxAperLS1 = new TH1F("h_sum0TSmaxAperLS1", " ", bac, 1., bac2); - - h_sumTSmaxALS2 = new TH1F("h_sumTSmaxALS2", " ", 100, 0., lsdep_estimator3_HBdepth2_); - h_2DsumTSmaxALS2 = new TH2F("h_2DsumTSmaxALS2", " ", neta, -41., 41., nphi, 0., bphi); - h_sumTSmaxAperLS2 = new TH1F("h_sumTSmaxAperLS2", " ", bac, 1., bac2); - h_sumCutTSmaxAperLS2 = new TH1F("h_sumCutTSmaxAperLS2", " ", bac, 1., bac2); - h_2D0sumTSmaxALS2 = new TH2F("h_2D0sumTSmaxALS2", " ", neta, -41., 41., nphi, 0., bphi); - h_sum0TSmaxAperLS2 = new TH1F("h_sum0TSmaxAperLS2", " ", bac, 1., bac2); - - h_sumTSmaxALS3 = new TH1F("h_sumTSmaxALS3", " ", 100, 0., lsdep_estimator3_HEdepth1_); - h_2DsumTSmaxALS3 = new TH2F("h_2DsumTSmaxALS3", " ", neta, -41., 41., nphi, 0., bphi); - h_sumTSmaxAperLS3 = new TH1F("h_sumTSmaxAperLS3", " ", bac, 1., bac2); - h_sumCutTSmaxAperLS3 = new TH1F("h_sumCutTSmaxAperLS3", " ", bac, 1., bac2); - h_2D0sumTSmaxALS3 = new TH2F("h_2D0sumTSmaxALS3", " ", neta, -41., 41., nphi, 0., bphi); - h_sum0TSmaxAperLS3 = new TH1F("h_sum0TSmaxAperLS3", " ", bac, 1., bac2); - - h_sumTSmaxALS4 = new TH1F("h_sumTSmaxALS4", " ", 100, 0., lsdep_estimator3_HEdepth2_); - h_2DsumTSmaxALS4 = new TH2F("h_2DsumTSmaxALS4", " ", neta, -41., 41., nphi, 0., bphi); - h_sumTSmaxAperLS4 = new TH1F("h_sumTSmaxAperLS4", " ", bac, 1., bac2); - h_sumCutTSmaxAperLS4 = new TH1F("h_sumCutTSmaxAperLS4", " ", bac, 1., bac2); - h_2D0sumTSmaxALS4 = new TH2F("h_2D0sumTSmaxALS4", " ", neta, -41., 41., nphi, 0., bphi); - h_sum0TSmaxAperLS4 = new TH1F("h_sum0TSmaxAperLS4", " ", bac, 1., bac2); - - h_sumTSmaxALS5 = new TH1F("h_sumTSmaxALS5", " ", 100, 0., lsdep_estimator3_HEdepth3_); - h_2DsumTSmaxALS5 = new TH2F("h_2DsumTSmaxALS5", " ", neta, -41., 41., nphi, 0., bphi); - h_sumTSmaxAperLS5 = new TH1F("h_sumTSmaxAperLS5", " ", bac, 1., bac2); - h_sumCutTSmaxAperLS5 = new TH1F("h_sumCutTSmaxAperLS5", " ", bac, 1., bac2); - h_2D0sumTSmaxALS5 = new TH2F("h_2D0sumTSmaxALS5", " ", neta, -41., 41., nphi, 0., bphi); - h_sum0TSmaxAperLS5 = new TH1F("h_sum0TSmaxAperLS5", " ", bac, 1., bac2); - - h_sumTSmaxALS6 = new TH1F("h_sumTSmaxALS6", " ", 100, 0., lsdep_estimator3_HFdepth1_); - h_2DsumTSmaxALS6 = new TH2F("h_2DsumTSmaxALS6", " ", neta, -41., 41., nphi, 0., bphi); - h_sumTSmaxAperLS6 = new TH1F("h_sumTSmaxAperLS6", " ", bac, 1., bac2); - h_sumCutTSmaxAperLS6 = new TH1F("h_sumCutTSmaxAperLS6", " ", bac, 1., bac2); - h_2D0sumTSmaxALS6 = new TH2F("h_2D0sumTSmaxALS6", " ", neta, -41., 41., nphi, 0., bphi); - h_sum0TSmaxAperLS6 = new TH1F("h_sum0TSmaxAperLS6", " ", bac, 1., bac2); - - h_sumTSmaxALS7 = new TH1F("h_sumTSmaxALS7", " ", 100, 0., lsdep_estimator3_HFdepth2_); - h_2DsumTSmaxALS7 = new TH2F("h_2DsumTSmaxALS7", " ", neta, -41., 41., nphi, 0., bphi); - h_sumTSmaxAperLS7 = new TH1F("h_sumTSmaxAperLS7", " ", bac, 1., bac2); - h_sumCutTSmaxAperLS7 = new TH1F("h_sumCutTSmaxAperLS7", " ", bac, 1., bac2); - h_2D0sumTSmaxALS7 = new TH2F("h_2D0sumTSmaxALS7", " ", neta, -41., 41., nphi, 0., bphi); - h_sum0TSmaxAperLS7 = new TH1F("h_sum0TSmaxAperLS7", " ", bac, 1., bac2); - - h_sumTSmaxALS8 = new TH1F("h_sumTSmaxALS8", " ", 100, 0., lsdep_estimator3_HOdepth4_); - h_2DsumTSmaxALS8 = new TH2F("h_2DsumTSmaxALS8", " ", neta, -41., 41., nphi, 0., bphi); - h_sumTSmaxAperLS8 = new TH1F("h_sumTSmaxAperLS8", " ", bac, 1., bac2); - h_sumCutTSmaxAperLS8 = new TH1F("h_sumCutTSmaxAperLS8", " ", bac, 1., bac2); - h_2D0sumTSmaxALS8 = new TH2F("h_2D0sumTSmaxALS8", " ", neta, -41., 41., nphi, 0., bphi); - h_sum0TSmaxAperLS8 = new TH1F("h_sum0TSmaxAperLS8", " ", bac, 1., bac2); + h_sumTSmaxALS1 = fs_->make("h_sumTSmaxALS1", " ", 100, 0., lsdep_estimator3_HBdepth1_); + h_2DsumTSmaxALS1 = fs_->make("h_2DsumTSmaxALS1", " ", neta, -41., 41., nphi, 0., bphi); + h_sumTSmaxAperLS1 = fs_->make("h_sumTSmaxAperLS1", " ", bac, 1., bac2); + h_sumTSmaxAperLS1_LSselected = fs_->make("h_sumTSmaxAperLS1_LSselected", " ", bac, 1., bac2); + h_sumCutTSmaxAperLS1 = fs_->make("h_sumCutTSmaxAperLS1", " ", bac, 1., bac2); + h_2D0sumTSmaxALS1 = fs_->make("h_2D0sumTSmaxALS1", " ", neta, -41., 41., nphi, 0., bphi); + h_sum0TSmaxAperLS1 = fs_->make("h_sum0TSmaxAperLS1", " ", bac, 1., bac2); + + h_sumTSmaxALS2 = fs_->make("h_sumTSmaxALS2", " ", 100, 0., lsdep_estimator3_HBdepth2_); + h_2DsumTSmaxALS2 = fs_->make("h_2DsumTSmaxALS2", " ", neta, -41., 41., nphi, 0., bphi); + h_sumTSmaxAperLS2 = fs_->make("h_sumTSmaxAperLS2", " ", bac, 1., bac2); + h_sumCutTSmaxAperLS2 = fs_->make("h_sumCutTSmaxAperLS2", " ", bac, 1., bac2); + h_2D0sumTSmaxALS2 = fs_->make("h_2D0sumTSmaxALS2", " ", neta, -41., 41., nphi, 0., bphi); + h_sum0TSmaxAperLS2 = fs_->make("h_sum0TSmaxAperLS2", " ", bac, 1., bac2); + + h_sumTSmaxALS3 = fs_->make("h_sumTSmaxALS3", " ", 100, 0., lsdep_estimator3_HEdepth1_); + h_2DsumTSmaxALS3 = fs_->make("h_2DsumTSmaxALS3", " ", neta, -41., 41., nphi, 0., bphi); + h_sumTSmaxAperLS3 = fs_->make("h_sumTSmaxAperLS3", " ", bac, 1., bac2); + h_sumCutTSmaxAperLS3 = fs_->make("h_sumCutTSmaxAperLS3", " ", bac, 1., bac2); + h_2D0sumTSmaxALS3 = fs_->make("h_2D0sumTSmaxALS3", " ", neta, -41., 41., nphi, 0., bphi); + h_sum0TSmaxAperLS3 = fs_->make("h_sum0TSmaxAperLS3", " ", bac, 1., bac2); + + h_sumTSmaxALS4 = fs_->make("h_sumTSmaxALS4", " ", 100, 0., lsdep_estimator3_HEdepth2_); + h_2DsumTSmaxALS4 = fs_->make("h_2DsumTSmaxALS4", " ", neta, -41., 41., nphi, 0., bphi); + h_sumTSmaxAperLS4 = fs_->make("h_sumTSmaxAperLS4", " ", bac, 1., bac2); + h_sumCutTSmaxAperLS4 = fs_->make("h_sumCutTSmaxAperLS4", " ", bac, 1., bac2); + h_2D0sumTSmaxALS4 = fs_->make("h_2D0sumTSmaxALS4", " ", neta, -41., 41., nphi, 0., bphi); + h_sum0TSmaxAperLS4 = fs_->make("h_sum0TSmaxAperLS4", " ", bac, 1., bac2); + + h_sumTSmaxALS5 = fs_->make("h_sumTSmaxALS5", " ", 100, 0., lsdep_estimator3_HEdepth3_); + h_2DsumTSmaxALS5 = fs_->make("h_2DsumTSmaxALS5", " ", neta, -41., 41., nphi, 0., bphi); + h_sumTSmaxAperLS5 = fs_->make("h_sumTSmaxAperLS5", " ", bac, 1., bac2); + h_sumCutTSmaxAperLS5 = fs_->make("h_sumCutTSmaxAperLS5", " ", bac, 1., bac2); + h_2D0sumTSmaxALS5 = fs_->make("h_2D0sumTSmaxALS5", " ", neta, -41., 41., nphi, 0., bphi); + h_sum0TSmaxAperLS5 = fs_->make("h_sum0TSmaxAperLS5", " ", bac, 1., bac2); + + h_sumTSmaxALS6 = fs_->make("h_sumTSmaxALS6", " ", 100, 0., lsdep_estimator3_HFdepth1_); + h_2DsumTSmaxALS6 = fs_->make("h_2DsumTSmaxALS6", " ", neta, -41., 41., nphi, 0., bphi); + h_sumTSmaxAperLS6 = fs_->make("h_sumTSmaxAperLS6", " ", bac, 1., bac2); + h_sumCutTSmaxAperLS6 = fs_->make("h_sumCutTSmaxAperLS6", " ", bac, 1., bac2); + h_2D0sumTSmaxALS6 = fs_->make("h_2D0sumTSmaxALS6", " ", neta, -41., 41., nphi, 0., bphi); + h_sum0TSmaxAperLS6 = fs_->make("h_sum0TSmaxAperLS6", " ", bac, 1., bac2); + + h_sumTSmaxALS7 = fs_->make("h_sumTSmaxALS7", " ", 100, 0., lsdep_estimator3_HFdepth2_); + h_2DsumTSmaxALS7 = fs_->make("h_2DsumTSmaxALS7", " ", neta, -41., 41., nphi, 0., bphi); + h_sumTSmaxAperLS7 = fs_->make("h_sumTSmaxAperLS7", " ", bac, 1., bac2); + h_sumCutTSmaxAperLS7 = fs_->make("h_sumCutTSmaxAperLS7", " ", bac, 1., bac2); + h_2D0sumTSmaxALS7 = fs_->make("h_2D0sumTSmaxALS7", " ", neta, -41., 41., nphi, 0., bphi); + h_sum0TSmaxAperLS7 = fs_->make("h_sum0TSmaxAperLS7", " ", bac, 1., bac2); + + h_sumTSmaxALS8 = fs_->make("h_sumTSmaxALS8", " ", 100, 0., lsdep_estimator3_HOdepth4_); + h_2DsumTSmaxALS8 = fs_->make("h_2DsumTSmaxALS8", " ", neta, -41., 41., nphi, 0., bphi); + h_sumTSmaxAperLS8 = fs_->make("h_sumTSmaxAperLS8", " ", bac, 1., bac2); + h_sumCutTSmaxAperLS8 = fs_->make("h_sumCutTSmaxAperLS8", " ", bac, 1., bac2); + h_2D0sumTSmaxALS8 = fs_->make("h_2D0sumTSmaxALS8", " ", neta, -41., 41., nphi, 0., bphi); + h_sum0TSmaxAperLS8 = fs_->make("h_sum0TSmaxAperLS8", " ", bac, 1., bac2); //-------------------------------------------------- // for estimator4: // float est4 = 3.4; // float est41= 2.0; - h_sumAmplitudeLS1 = new TH1F("h_sumAmplitudeLS1", " ", 100, 0.0, lsdep_estimator4_HBdepth1_); - h_2DsumAmplitudeLS1 = new TH2F("h_2DsumAmplitudeLS1", " ", neta, -41., 41., nphi, 0., bphi); - h_sumAmplitudeperLS1 = new TH1F("h_sumAmplitudeperLS1", " ", bac, 1., bac2); - h_sumAmplitudeperLS1_LSselected = new TH1F("h_sumAmplitudeperLS1_LSselected", " ", bac, 1., bac2); - h_sumCutAmplitudeperLS1 = new TH1F("h_sumCutAmplitudeperLS1", " ", bac, 1., bac2); - h_2D0sumAmplitudeLS1 = new TH2F("h_2D0sumAmplitudeLS1", " ", neta, -41., 41., nphi, 0., bphi); - h_sum0AmplitudeperLS1 = new TH1F("h_sum0AmplitudeperLS1", " ", bac, 1., bac2); - - h_sumAmplitudeLS2 = new TH1F("h_sumAmplitudeLS2", " ", 100, 0.0, lsdep_estimator4_HBdepth2_); - h_2DsumAmplitudeLS2 = new TH2F("h_2DsumAmplitudeLS2", " ", neta, -41., 41., nphi, 0., bphi); - h_sumAmplitudeperLS2 = new TH1F("h_sumAmplitudeperLS2", " ", bac, 1., bac2); - h_sumCutAmplitudeperLS2 = new TH1F("h_sumCutAmplitudeperLS2", " ", bac, 1., bac2); - h_2D0sumAmplitudeLS2 = new TH2F("h_2D0sumAmplitudeLS2", " ", neta, -41., 41., nphi, 0., bphi); - h_sum0AmplitudeperLS2 = new TH1F("h_sum0AmplitudeperLS2", " ", bac, 1., bac2); - - h_sumAmplitudeLS3 = new TH1F("h_sumAmplitudeLS3", " ", 100, 0.0, lsdep_estimator4_HEdepth1_); - h_2DsumAmplitudeLS3 = new TH2F("h_2DsumAmplitudeLS3", " ", neta, -41., 41., nphi, 0., bphi); - h_sumAmplitudeperLS3 = new TH1F("h_sumAmplitudeperLS3", " ", bac, 1., bac2); - h_sumCutAmplitudeperLS3 = new TH1F("h_sumCutAmplitudeperLS3", " ", bac, 1., bac2); - h_2D0sumAmplitudeLS3 = new TH2F("h_2D0sumAmplitudeLS3", " ", neta, -41., 41., nphi, 0., bphi); - h_sum0AmplitudeperLS3 = new TH1F("h_sum0AmplitudeperLS3", " ", bac, 1., bac2); - - h_sumAmplitudeLS4 = new TH1F("h_sumAmplitudeLS4", " ", 100, 0.0, lsdep_estimator4_HEdepth2_); - h_2DsumAmplitudeLS4 = new TH2F("h_2DsumAmplitudeLS4", " ", neta, -41., 41., nphi, 0., bphi); - h_sumAmplitudeperLS4 = new TH1F("h_sumAmplitudeperLS4", " ", bac, 1., bac2); - h_sumCutAmplitudeperLS4 = new TH1F("h_sumCutAmplitudeperLS4", " ", bac, 1., bac2); - h_2D0sumAmplitudeLS4 = new TH2F("h_2D0sumAmplitudeLS4", " ", neta, -41., 41., nphi, 0., bphi); - h_sum0AmplitudeperLS4 = new TH1F("h_sum0AmplitudeperLS4", " ", bac, 1., bac2); - - h_sumAmplitudeLS5 = new TH1F("h_sumAmplitudeLS5", " ", 100, 0.0, lsdep_estimator4_HEdepth3_); - h_2DsumAmplitudeLS5 = new TH2F("h_2DsumAmplitudeLS5", " ", neta, -41., 41., nphi, 0., bphi); - h_sumAmplitudeperLS5 = new TH1F("h_sumAmplitudeperLS5", " ", bac, 1., bac2); - h_sumCutAmplitudeperLS5 = new TH1F("h_sumCutAmplitudeperLS5", " ", bac, 1., bac2); - h_2D0sumAmplitudeLS5 = new TH2F("h_2D0sumAmplitudeLS5", " ", neta, -41., 41., nphi, 0., bphi); - h_sum0AmplitudeperLS5 = new TH1F("h_sum0AmplitudeperLS5", " ", bac, 1., bac2); - - h_sumAmplitudeLS6 = new TH1F("h_sumAmplitudeLS6", " ", 100, 0., lsdep_estimator4_HFdepth1_); - h_2DsumAmplitudeLS6 = new TH2F("h_2DsumAmplitudeLS6", " ", neta, -41., 41., nphi, 0., bphi); - h_sumAmplitudeperLS6 = new TH1F("h_sumAmplitudeperLS6", " ", bac, 1., bac2); - h_sumCutAmplitudeperLS6 = new TH1F("h_sumCutAmplitudeperLS6", " ", bac, 1., bac2); - h_2D0sumAmplitudeLS6 = new TH2F("h_2D0sumAmplitudeLS6", " ", neta, -41., 41., nphi, 0., bphi); - h_sum0AmplitudeperLS6 = new TH1F("h_sum0AmplitudeperLS6", " ", bac, 1., bac2); - - h_sumAmplitudeLS7 = new TH1F("h_sumAmplitudeLS7", " ", 100, 0., lsdep_estimator4_HFdepth2_); - h_2DsumAmplitudeLS7 = new TH2F("h_2DsumAmplitudeLS7", " ", neta, -41., 41., nphi, 0., bphi); - h_sumAmplitudeperLS7 = new TH1F("h_sumAmplitudeperLS7", " ", bac, 1., bac2); - h_sumCutAmplitudeperLS7 = new TH1F("h_sumCutAmplitudeperLS7", " ", bac, 1., bac2); - h_2D0sumAmplitudeLS7 = new TH2F("h_2D0sumAmplitudeLS7", " ", neta, -41., 41., nphi, 0., bphi); - h_sum0AmplitudeperLS7 = new TH1F("h_sum0AmplitudeperLS7", " ", bac, 1., bac2); - - h_sumAmplitudeLS8 = new TH1F("h_sumAmplitudeLS8", " ", 100, 0., lsdep_estimator4_HOdepth4_); - h_2DsumAmplitudeLS8 = new TH2F("h_2DsumAmplitudeLS8", " ", neta, -41., 41., nphi, 0., bphi); - h_sumAmplitudeperLS8 = new TH1F("h_sumAmplitudeperLS8", " ", bac, 1., bac2); - h_sumCutAmplitudeperLS8 = new TH1F("h_sumCutAmplitudeperLS8", " ", bac, 1., bac2); - h_2D0sumAmplitudeLS8 = new TH2F("h_2D0sumAmplitudeLS8", " ", neta, -41., 41., nphi, 0., bphi); - h_sum0AmplitudeperLS8 = new TH1F("h_sum0AmplitudeperLS8", " ", bac, 1., bac2); + h_sumAmplitudeLS1 = fs_->make("h_sumAmplitudeLS1", " ", 100, 0.0, lsdep_estimator4_HBdepth1_); + h_2DsumAmplitudeLS1 = fs_->make("h_2DsumAmplitudeLS1", " ", neta, -41., 41., nphi, 0., bphi); + h_sumAmplitudeperLS1 = fs_->make("h_sumAmplitudeperLS1", " ", bac, 1., bac2); + h_sumAmplitudeperLS1_LSselected = fs_->make("h_sumAmplitudeperLS1_LSselected", " ", bac, 1., bac2); + h_sumCutAmplitudeperLS1 = fs_->make("h_sumCutAmplitudeperLS1", " ", bac, 1., bac2); + h_2D0sumAmplitudeLS1 = fs_->make("h_2D0sumAmplitudeLS1", " ", neta, -41., 41., nphi, 0., bphi); + h_sum0AmplitudeperLS1 = fs_->make("h_sum0AmplitudeperLS1", " ", bac, 1., bac2); + + h_sumAmplitudeLS2 = fs_->make("h_sumAmplitudeLS2", " ", 100, 0.0, lsdep_estimator4_HBdepth2_); + h_2DsumAmplitudeLS2 = fs_->make("h_2DsumAmplitudeLS2", " ", neta, -41., 41., nphi, 0., bphi); + h_sumAmplitudeperLS2 = fs_->make("h_sumAmplitudeperLS2", " ", bac, 1., bac2); + h_sumCutAmplitudeperLS2 = fs_->make("h_sumCutAmplitudeperLS2", " ", bac, 1., bac2); + h_2D0sumAmplitudeLS2 = fs_->make("h_2D0sumAmplitudeLS2", " ", neta, -41., 41., nphi, 0., bphi); + h_sum0AmplitudeperLS2 = fs_->make("h_sum0AmplitudeperLS2", " ", bac, 1., bac2); + + h_sumAmplitudeLS3 = fs_->make("h_sumAmplitudeLS3", " ", 100, 0.0, lsdep_estimator4_HEdepth1_); + h_2DsumAmplitudeLS3 = fs_->make("h_2DsumAmplitudeLS3", " ", neta, -41., 41., nphi, 0., bphi); + h_sumAmplitudeperLS3 = fs_->make("h_sumAmplitudeperLS3", " ", bac, 1., bac2); + h_sumCutAmplitudeperLS3 = fs_->make("h_sumCutAmplitudeperLS3", " ", bac, 1., bac2); + h_2D0sumAmplitudeLS3 = fs_->make("h_2D0sumAmplitudeLS3", " ", neta, -41., 41., nphi, 0., bphi); + h_sum0AmplitudeperLS3 = fs_->make("h_sum0AmplitudeperLS3", " ", bac, 1., bac2); + + h_sumAmplitudeLS4 = fs_->make("h_sumAmplitudeLS4", " ", 100, 0.0, lsdep_estimator4_HEdepth2_); + h_2DsumAmplitudeLS4 = fs_->make("h_2DsumAmplitudeLS4", " ", neta, -41., 41., nphi, 0., bphi); + h_sumAmplitudeperLS4 = fs_->make("h_sumAmplitudeperLS4", " ", bac, 1., bac2); + h_sumCutAmplitudeperLS4 = fs_->make("h_sumCutAmplitudeperLS4", " ", bac, 1., bac2); + h_2D0sumAmplitudeLS4 = fs_->make("h_2D0sumAmplitudeLS4", " ", neta, -41., 41., nphi, 0., bphi); + h_sum0AmplitudeperLS4 = fs_->make("h_sum0AmplitudeperLS4", " ", bac, 1., bac2); + + h_sumAmplitudeLS5 = fs_->make("h_sumAmplitudeLS5", " ", 100, 0.0, lsdep_estimator4_HEdepth3_); + h_2DsumAmplitudeLS5 = fs_->make("h_2DsumAmplitudeLS5", " ", neta, -41., 41., nphi, 0., bphi); + h_sumAmplitudeperLS5 = fs_->make("h_sumAmplitudeperLS5", " ", bac, 1., bac2); + h_sumCutAmplitudeperLS5 = fs_->make("h_sumCutAmplitudeperLS5", " ", bac, 1., bac2); + h_2D0sumAmplitudeLS5 = fs_->make("h_2D0sumAmplitudeLS5", " ", neta, -41., 41., nphi, 0., bphi); + h_sum0AmplitudeperLS5 = fs_->make("h_sum0AmplitudeperLS5", " ", bac, 1., bac2); + + h_sumAmplitudeLS6 = fs_->make("h_sumAmplitudeLS6", " ", 100, 0., lsdep_estimator4_HFdepth1_); + h_2DsumAmplitudeLS6 = fs_->make("h_2DsumAmplitudeLS6", " ", neta, -41., 41., nphi, 0., bphi); + h_sumAmplitudeperLS6 = fs_->make("h_sumAmplitudeperLS6", " ", bac, 1., bac2); + h_sumCutAmplitudeperLS6 = fs_->make("h_sumCutAmplitudeperLS6", " ", bac, 1., bac2); + h_2D0sumAmplitudeLS6 = fs_->make("h_2D0sumAmplitudeLS6", " ", neta, -41., 41., nphi, 0., bphi); + h_sum0AmplitudeperLS6 = fs_->make("h_sum0AmplitudeperLS6", " ", bac, 1., bac2); + + h_sumAmplitudeLS7 = fs_->make("h_sumAmplitudeLS7", " ", 100, 0., lsdep_estimator4_HFdepth2_); + h_2DsumAmplitudeLS7 = fs_->make("h_2DsumAmplitudeLS7", " ", neta, -41., 41., nphi, 0., bphi); + h_sumAmplitudeperLS7 = fs_->make("h_sumAmplitudeperLS7", " ", bac, 1., bac2); + h_sumCutAmplitudeperLS7 = fs_->make("h_sumCutAmplitudeperLS7", " ", bac, 1., bac2); + h_2D0sumAmplitudeLS7 = fs_->make("h_2D0sumAmplitudeLS7", " ", neta, -41., 41., nphi, 0., bphi); + h_sum0AmplitudeperLS7 = fs_->make("h_sum0AmplitudeperLS7", " ", bac, 1., bac2); + + h_sumAmplitudeLS8 = fs_->make("h_sumAmplitudeLS8", " ", 100, 0., lsdep_estimator4_HOdepth4_); + h_2DsumAmplitudeLS8 = fs_->make("h_2DsumAmplitudeLS8", " ", neta, -41., 41., nphi, 0., bphi); + h_sumAmplitudeperLS8 = fs_->make("h_sumAmplitudeperLS8", " ", bac, 1., bac2); + h_sumCutAmplitudeperLS8 = fs_->make("h_sumCutAmplitudeperLS8", " ", bac, 1., bac2); + h_2D0sumAmplitudeLS8 = fs_->make("h_2D0sumAmplitudeLS8", " ", neta, -41., 41., nphi, 0., bphi); + h_sum0AmplitudeperLS8 = fs_->make("h_sum0AmplitudeperLS8", " ", bac, 1., bac2); //-------------------------------------------------- // for estimator5: // float est5 = 0.6; // float est51= 1.0; // float est52= 0.8; - h_sumAmplLS1 = new TH1F("h_sumAmplLS1", " ", 100, 0.0, lsdep_estimator5_HBdepth1_); - h_2DsumAmplLS1 = new TH2F("h_2DsumAmplLS1", " ", neta, -41., 41., nphi, 0., bphi); - h_sumAmplperLS1 = new TH1F("h_sumAmplperLS1", " ", bac, 1., bac2); - h_sumAmplperLS1_LSselected = new TH1F("h_sumAmplperLS1_LSselected", " ", bac, 1., bac2); - h_sumCutAmplperLS1 = new TH1F("h_sumCutAmplperLS1", " ", bac, 1., bac2); - h_2D0sumAmplLS1 = new TH2F("h_2D0sumAmplLS1", " ", neta, -41., 41., nphi, 0., bphi); - h_sum0AmplperLS1 = new TH1F("h_sum0AmplperLS1", " ", bac, 1., bac2); - - h_sumAmplLS2 = new TH1F("h_sumAmplLS2", " ", 100, 0.0, lsdep_estimator5_HBdepth2_); - h_2DsumAmplLS2 = new TH2F("h_2DsumAmplLS2", " ", neta, -41., 41., nphi, 0., bphi); - h_sumAmplperLS2 = new TH1F("h_sumAmplperLS2", " ", bac, 1., bac2); - h_sumCutAmplperLS2 = new TH1F("h_sumCutAmplperLS2", " ", bac, 1., bac2); - h_2D0sumAmplLS2 = new TH2F("h_2D0sumAmplLS2", " ", neta, -41., 41., nphi, 0., bphi); - h_sum0AmplperLS2 = new TH1F("h_sum0AmplperLS2", " ", bac, 1., bac2); - - h_sumAmplLS3 = new TH1F("h_sumAmplLS3", " ", 100, 0.0, lsdep_estimator5_HEdepth1_); - h_2DsumAmplLS3 = new TH2F("h_2DsumAmplLS3", " ", neta, -41., 41., nphi, 0., bphi); - h_sumAmplperLS3 = new TH1F("h_sumAmplperLS3", " ", bac, 1., bac2); - h_sumCutAmplperLS3 = new TH1F("h_sumCutAmplperLS3", " ", bac, 1., bac2); - h_2D0sumAmplLS3 = new TH2F("h_2D0sumAmplLS3", " ", neta, -41., 41., nphi, 0., bphi); - h_sum0AmplperLS3 = new TH1F("h_sum0AmplperLS3", " ", bac, 1., bac2); - - h_sumAmplLS4 = new TH1F("h_sumAmplLS4", " ", 100, 0.0, lsdep_estimator5_HEdepth2_); - h_2DsumAmplLS4 = new TH2F("h_2DsumAmplLS4", " ", neta, -41., 41., nphi, 0., bphi); - h_sumAmplperLS4 = new TH1F("h_sumAmplperLS4", " ", bac, 1., bac2); - h_sumCutAmplperLS4 = new TH1F("h_sumCutAmplperLS4", " ", bac, 1., bac2); - h_2D0sumAmplLS4 = new TH2F("h_2D0sumAmplLS4", " ", neta, -41., 41., nphi, 0., bphi); - h_sum0AmplperLS4 = new TH1F("h_sum0AmplperLS4", " ", bac, 1., bac2); - - h_sumAmplLS5 = new TH1F("h_sumAmplLS5", " ", 100, 0.0, lsdep_estimator5_HEdepth3_); - h_2DsumAmplLS5 = new TH2F("h_2DsumAmplLS5", " ", neta, -41., 41., nphi, 0., bphi); - h_sumAmplperLS5 = new TH1F("h_sumAmplperLS5", " ", bac, 1., bac2); - h_sumCutAmplperLS5 = new TH1F("h_sumCutAmplperLS5", " ", bac, 1., bac2); - h_2D0sumAmplLS5 = new TH2F("h_2D0sumAmplLS5", " ", neta, -41., 41., nphi, 0., bphi); - h_sum0AmplperLS5 = new TH1F("h_sum0AmplperLS5", " ", bac, 1., bac2); - - h_sumAmplLS6 = new TH1F("h_sumAmplLS6", " ", 100, 0.0, lsdep_estimator5_HFdepth1_); - h_2DsumAmplLS6 = new TH2F("h_2DsumAmplLS6", " ", neta, -41., 41., nphi, 0., bphi); - h_sumAmplperLS6 = new TH1F("h_sumAmplperLS6", " ", bac, 1., bac2); - h_sumCutAmplperLS6 = new TH1F("h_sumCutAmplperLS6", " ", bac, 1., bac2); - h_2D0sumAmplLS6 = new TH2F("h_2D0sumAmplLS6", " ", neta, -41., 41., nphi, 0., bphi); - h_sum0AmplperLS6 = new TH1F("h_sum0AmplperLS6", " ", bac, 1., bac2); - - h_RatioOccupancy_HBP = new TH1F("h_RatioOccupancy_HBP", " ", bac, 1., bac2); - h_RatioOccupancy_HBM = new TH1F("h_RatioOccupancy_HBM", " ", bac, 1., bac2); - h_RatioOccupancy_HEP = new TH1F("h_RatioOccupancy_HEP", " ", bac, 1., bac2); - h_RatioOccupancy_HEM = new TH1F("h_RatioOccupancy_HEM", " ", bac, 1., bac2); - h_RatioOccupancy_HOP = new TH1F("h_RatioOccupancy_HOP", " ", bac, 1., bac2); - h_RatioOccupancy_HOM = new TH1F("h_RatioOccupancy_HOM", " ", bac, 1., bac2); - h_RatioOccupancy_HFP = new TH1F("h_RatioOccupancy_HFP", " ", bac, 1., bac2); - h_RatioOccupancy_HFM = new TH1F("h_RatioOccupancy_HFM", " ", bac, 1., bac2); - - h_sumAmplLS7 = new TH1F("h_sumAmplLS7", " ", 100, 0.0, lsdep_estimator5_HFdepth2_); - h_2DsumAmplLS7 = new TH2F("h_2DsumAmplLS7", " ", neta, -41., 41., nphi, 0., bphi); - h_sumAmplperLS7 = new TH1F("h_sumAmplperLS7", " ", bac, 1., bac2); - h_sumCutAmplperLS7 = new TH1F("h_sumCutAmplperLS7", " ", bac, 1., bac2); - h_2D0sumAmplLS7 = new TH2F("h_2D0sumAmplLS7", " ", neta, -41., 41., nphi, 0., bphi); - h_sum0AmplperLS7 = new TH1F("h_sum0AmplperLS7", " ", bac, 1., bac2); - - h_sumAmplLS8 = new TH1F("h_sumAmplLS8", " ", 100, 0.0, lsdep_estimator5_HOdepth4_); - h_2DsumAmplLS8 = new TH2F("h_2DsumAmplLS8", " ", neta, -41., 41., nphi, 0., bphi); - h_sumAmplperLS8 = new TH1F("h_sumAmplperLS8", " ", bac, 1., bac2); - h_sumCutAmplperLS8 = new TH1F("h_sumCutAmplperLS8", " ", bac, 1., bac2); - h_2D0sumAmplLS8 = new TH2F("h_2D0sumAmplLS8", " ", neta, -41., 41., nphi, 0., bphi); - h_sum0AmplperLS8 = new TH1F("h_sum0AmplperLS8", " ", bac, 1., bac2); + h_sumAmplLS1 = fs_->make("h_sumAmplLS1", " ", 100, 0.0, lsdep_estimator5_HBdepth1_); + h_2DsumAmplLS1 = fs_->make("h_2DsumAmplLS1", " ", neta, -41., 41., nphi, 0., bphi); + h_sumAmplperLS1 = fs_->make("h_sumAmplperLS1", " ", bac, 1., bac2); + h_sumAmplperLS1_LSselected = fs_->make("h_sumAmplperLS1_LSselected", " ", bac, 1., bac2); + h_sumCutAmplperLS1 = fs_->make("h_sumCutAmplperLS1", " ", bac, 1., bac2); + h_2D0sumAmplLS1 = fs_->make("h_2D0sumAmplLS1", " ", neta, -41., 41., nphi, 0., bphi); + h_sum0AmplperLS1 = fs_->make("h_sum0AmplperLS1", " ", bac, 1., bac2); + + h_sumAmplLS2 = fs_->make("h_sumAmplLS2", " ", 100, 0.0, lsdep_estimator5_HBdepth2_); + h_2DsumAmplLS2 = fs_->make("h_2DsumAmplLS2", " ", neta, -41., 41., nphi, 0., bphi); + h_sumAmplperLS2 = fs_->make("h_sumAmplperLS2", " ", bac, 1., bac2); + h_sumCutAmplperLS2 = fs_->make("h_sumCutAmplperLS2", " ", bac, 1., bac2); + h_2D0sumAmplLS2 = fs_->make("h_2D0sumAmplLS2", " ", neta, -41., 41., nphi, 0., bphi); + h_sum0AmplperLS2 = fs_->make("h_sum0AmplperLS2", " ", bac, 1., bac2); + + h_sumAmplLS3 = fs_->make("h_sumAmplLS3", " ", 100, 0.0, lsdep_estimator5_HEdepth1_); + h_2DsumAmplLS3 = fs_->make("h_2DsumAmplLS3", " ", neta, -41., 41., nphi, 0., bphi); + h_sumAmplperLS3 = fs_->make("h_sumAmplperLS3", " ", bac, 1., bac2); + h_sumCutAmplperLS3 = fs_->make("h_sumCutAmplperLS3", " ", bac, 1., bac2); + h_2D0sumAmplLS3 = fs_->make("h_2D0sumAmplLS3", " ", neta, -41., 41., nphi, 0., bphi); + h_sum0AmplperLS3 = fs_->make("h_sum0AmplperLS3", " ", bac, 1., bac2); + + h_sumAmplLS4 = fs_->make("h_sumAmplLS4", " ", 100, 0.0, lsdep_estimator5_HEdepth2_); + h_2DsumAmplLS4 = fs_->make("h_2DsumAmplLS4", " ", neta, -41., 41., nphi, 0., bphi); + h_sumAmplperLS4 = fs_->make("h_sumAmplperLS4", " ", bac, 1., bac2); + h_sumCutAmplperLS4 = fs_->make("h_sumCutAmplperLS4", " ", bac, 1., bac2); + h_2D0sumAmplLS4 = fs_->make("h_2D0sumAmplLS4", " ", neta, -41., 41., nphi, 0., bphi); + h_sum0AmplperLS4 = fs_->make("h_sum0AmplperLS4", " ", bac, 1., bac2); + + h_sumAmplLS5 = fs_->make("h_sumAmplLS5", " ", 100, 0.0, lsdep_estimator5_HEdepth3_); + h_2DsumAmplLS5 = fs_->make("h_2DsumAmplLS5", " ", neta, -41., 41., nphi, 0., bphi); + h_sumAmplperLS5 = fs_->make("h_sumAmplperLS5", " ", bac, 1., bac2); + h_sumCutAmplperLS5 = fs_->make("h_sumCutAmplperLS5", " ", bac, 1., bac2); + h_2D0sumAmplLS5 = fs_->make("h_2D0sumAmplLS5", " ", neta, -41., 41., nphi, 0., bphi); + h_sum0AmplperLS5 = fs_->make("h_sum0AmplperLS5", " ", bac, 1., bac2); + + h_sumAmplLS6 = fs_->make("h_sumAmplLS6", " ", 100, 0.0, lsdep_estimator5_HFdepth1_); + h_2DsumAmplLS6 = fs_->make("h_2DsumAmplLS6", " ", neta, -41., 41., nphi, 0., bphi); + h_sumAmplperLS6 = fs_->make("h_sumAmplperLS6", " ", bac, 1., bac2); + h_sumCutAmplperLS6 = fs_->make("h_sumCutAmplperLS6", " ", bac, 1., bac2); + h_2D0sumAmplLS6 = fs_->make("h_2D0sumAmplLS6", " ", neta, -41., 41., nphi, 0., bphi); + h_sum0AmplperLS6 = fs_->make("h_sum0AmplperLS6", " ", bac, 1., bac2); + + h_RatioOccupancy_HBP = fs_->make("h_RatioOccupancy_HBP", " ", bac, 1., bac2); + h_RatioOccupancy_HBM = fs_->make("h_RatioOccupancy_HBM", " ", bac, 1., bac2); + h_RatioOccupancy_HEP = fs_->make("h_RatioOccupancy_HEP", " ", bac, 1., bac2); + h_RatioOccupancy_HEM = fs_->make("h_RatioOccupancy_HEM", " ", bac, 1., bac2); + h_RatioOccupancy_HOP = fs_->make("h_RatioOccupancy_HOP", " ", bac, 1., bac2); + h_RatioOccupancy_HOM = fs_->make("h_RatioOccupancy_HOM", " ", bac, 1., bac2); + h_RatioOccupancy_HFP = fs_->make("h_RatioOccupancy_HFP", " ", bac, 1., bac2); + h_RatioOccupancy_HFM = fs_->make("h_RatioOccupancy_HFM", " ", bac, 1., bac2); + + h_sumAmplLS7 = fs_->make("h_sumAmplLS7", " ", 100, 0.0, lsdep_estimator5_HFdepth2_); + h_2DsumAmplLS7 = fs_->make("h_2DsumAmplLS7", " ", neta, -41., 41., nphi, 0., bphi); + h_sumAmplperLS7 = fs_->make("h_sumAmplperLS7", " ", bac, 1., bac2); + h_sumCutAmplperLS7 = fs_->make("h_sumCutAmplperLS7", " ", bac, 1., bac2); + h_2D0sumAmplLS7 = fs_->make("h_2D0sumAmplLS7", " ", neta, -41., 41., nphi, 0., bphi); + h_sum0AmplperLS7 = fs_->make("h_sum0AmplperLS7", " ", bac, 1., bac2); + + h_sumAmplLS8 = fs_->make("h_sumAmplLS8", " ", 100, 0.0, lsdep_estimator5_HOdepth4_); + h_2DsumAmplLS8 = fs_->make("h_2DsumAmplLS8", " ", neta, -41., 41., nphi, 0., bphi); + h_sumAmplperLS8 = fs_->make("h_sumAmplperLS8", " ", bac, 1., bac2); + h_sumCutAmplperLS8 = fs_->make("h_sumCutAmplperLS8", " ", bac, 1., bac2); + h_2D0sumAmplLS8 = fs_->make("h_2D0sumAmplLS8", " ", neta, -41., 41., nphi, 0., bphi); + h_sum0AmplperLS8 = fs_->make("h_sum0AmplperLS8", " ", bac, 1., bac2); //-------------------------------------------------- // for estimator6: - h_sumErrorBLS1 = new TH1F("h_sumErrorBLS1", " ", 10, 0., 10.); - h_sumErrorBperLS1 = new TH1F("h_sumErrorBperLS1", " ", bac, 1., bac2); - h_sum0ErrorBperLS1 = new TH1F("h_sum0ErrorBperLS1", " ", bac, 1., bac2); - h_2D0sumErrorBLS1 = new TH2F("h_2D0sumErrorBLS1", " ", neta, -41., 41., nphi, 0., bphi); - h_2DsumErrorBLS1 = new TH2F("h_2DsumErrorBLS1", " ", neta, -41., 41., nphi, 0., bphi); - h_sumErrorBLS2 = new TH1F("h_sumErrorBLS2", " ", 10, 0., 10.); - h_sumErrorBperLS2 = new TH1F("h_sumErrorBperLS2", " ", bac, 1., bac2); - h_sum0ErrorBperLS2 = new TH1F("h_sum0ErrorBperLS2", " ", bac, 1., bac2); - h_2D0sumErrorBLS2 = new TH2F("h_2D0sumErrorBLS2", " ", neta, -41., 41., nphi, 0., bphi); - h_2DsumErrorBLS2 = new TH2F("h_2DsumErrorBLS2", " ", neta, -41., 41., nphi, 0., bphi); - - h_sumErrorBLS3 = new TH1F("h_sumErrorBLS3", " ", 10, 0., 10.); - h_sumErrorBperLS3 = new TH1F("h_sumErrorBperLS3", " ", bac, 1., bac2); - h_sum0ErrorBperLS3 = new TH1F("h_sum0ErrorBperLS3", " ", bac, 1., bac2); - h_2D0sumErrorBLS3 = new TH2F("h_2D0sumErrorBLS3", " ", neta, -41., 41., nphi, 0., bphi); - h_2DsumErrorBLS3 = new TH2F("h_2DsumErrorBLS3", " ", neta, -41., 41., nphi, 0., bphi); - h_sumErrorBLS4 = new TH1F("h_sumErrorBLS4", " ", 10, 0., 10.); - h_sumErrorBperLS4 = new TH1F("h_sumErrorBperLS4", " ", bac, 1., bac2); - h_sum0ErrorBperLS4 = new TH1F("h_sum0ErrorBperLS4", " ", bac, 1., bac2); - h_2D0sumErrorBLS4 = new TH2F("h_2D0sumErrorBLS4", " ", neta, -41., 41., nphi, 0., bphi); - h_2DsumErrorBLS4 = new TH2F("h_2DsumErrorBLS4", " ", neta, -41., 41., nphi, 0., bphi); - h_sumErrorBLS5 = new TH1F("h_sumErrorBLS5", " ", 10, 0., 10.); - h_sumErrorBperLS5 = new TH1F("h_sumErrorBperLS5", " ", bac, 1., bac2); - h_sum0ErrorBperLS5 = new TH1F("h_sum0ErrorBperLS5", " ", bac, 1., bac2); - h_2D0sumErrorBLS5 = new TH2F("h_2D0sumErrorBLS5", " ", neta, -41., 41., nphi, 0., bphi); - h_2DsumErrorBLS5 = new TH2F("h_2DsumErrorBLS5", " ", neta, -41., 41., nphi, 0., bphi); - - h_sumErrorBLS6 = new TH1F("h_sumErrorBLS6", " ", 10, 0., 10.); - h_sumErrorBperLS6 = new TH1F("h_sumErrorBperLS6", " ", bac, 1., bac2); - h_sum0ErrorBperLS6 = new TH1F("h_sum0ErrorBperLS6", " ", bac, 1., bac2); - h_2D0sumErrorBLS6 = new TH2F("h_2D0sumErrorBLS6", " ", neta, -41., 41., nphi, 0., bphi); - h_2DsumErrorBLS6 = new TH2F("h_2DsumErrorBLS6", " ", neta, -41., 41., nphi, 0., bphi); - h_sumErrorBLS7 = new TH1F("h_sumErrorBLS7", " ", 10, 0., 10.); - h_sumErrorBperLS7 = new TH1F("h_sumErrorBperLS7", " ", bac, 1., bac2); - h_sum0ErrorBperLS7 = new TH1F("h_sum0ErrorBperLS7", " ", bac, 1., bac2); - h_2D0sumErrorBLS7 = new TH2F("h_2D0sumErrorBLS7", " ", neta, -41., 41., nphi, 0., bphi); - h_2DsumErrorBLS7 = new TH2F("h_2DsumErrorBLS7", " ", neta, -41., 41., nphi, 0., bphi); - - h_sumErrorBLS8 = new TH1F("h_sumErrorBLS8", " ", 10, 0., 10.); - h_sumErrorBperLS8 = new TH1F("h_sumErrorBperLS8", " ", bac, 1., bac2); - h_sum0ErrorBperLS8 = new TH1F("h_sum0ErrorBperLS8", " ", bac, 1., bac2); - h_2D0sumErrorBLS8 = new TH2F("h_2D0sumErrorBLS8", " ", neta, -41., 41., nphi, 0., bphi); - h_2DsumErrorBLS8 = new TH2F("h_2DsumErrorBLS8", " ", neta, -41., 41., nphi, 0., bphi); + h_sumErrorBLS1 = fs_->make("h_sumErrorBLS1", " ", 10, 0., 10.); + h_sumErrorBperLS1 = fs_->make("h_sumErrorBperLS1", " ", bac, 1., bac2); + h_sum0ErrorBperLS1 = fs_->make("h_sum0ErrorBperLS1", " ", bac, 1., bac2); + h_2D0sumErrorBLS1 = fs_->make("h_2D0sumErrorBLS1", " ", neta, -41., 41., nphi, 0., bphi); + h_2DsumErrorBLS1 = fs_->make("h_2DsumErrorBLS1", " ", neta, -41., 41., nphi, 0., bphi); + h_sumErrorBLS2 = fs_->make("h_sumErrorBLS2", " ", 10, 0., 10.); + h_sumErrorBperLS2 = fs_->make("h_sumErrorBperLS2", " ", bac, 1., bac2); + h_sum0ErrorBperLS2 = fs_->make("h_sum0ErrorBperLS2", " ", bac, 1., bac2); + h_2D0sumErrorBLS2 = fs_->make("h_2D0sumErrorBLS2", " ", neta, -41., 41., nphi, 0., bphi); + h_2DsumErrorBLS2 = fs_->make("h_2DsumErrorBLS2", " ", neta, -41., 41., nphi, 0., bphi); + + h_sumErrorBLS3 = fs_->make("h_sumErrorBLS3", " ", 10, 0., 10.); + h_sumErrorBperLS3 = fs_->make("h_sumErrorBperLS3", " ", bac, 1., bac2); + h_sum0ErrorBperLS3 = fs_->make("h_sum0ErrorBperLS3", " ", bac, 1., bac2); + h_2D0sumErrorBLS3 = fs_->make("h_2D0sumErrorBLS3", " ", neta, -41., 41., nphi, 0., bphi); + h_2DsumErrorBLS3 = fs_->make("h_2DsumErrorBLS3", " ", neta, -41., 41., nphi, 0., bphi); + h_sumErrorBLS4 = fs_->make("h_sumErrorBLS4", " ", 10, 0., 10.); + h_sumErrorBperLS4 = fs_->make("h_sumErrorBperLS4", " ", bac, 1., bac2); + h_sum0ErrorBperLS4 = fs_->make("h_sum0ErrorBperLS4", " ", bac, 1., bac2); + h_2D0sumErrorBLS4 = fs_->make("h_2D0sumErrorBLS4", " ", neta, -41., 41., nphi, 0., bphi); + h_2DsumErrorBLS4 = fs_->make("h_2DsumErrorBLS4", " ", neta, -41., 41., nphi, 0., bphi); + h_sumErrorBLS5 = fs_->make("h_sumErrorBLS5", " ", 10, 0., 10.); + h_sumErrorBperLS5 = fs_->make("h_sumErrorBperLS5", " ", bac, 1., bac2); + h_sum0ErrorBperLS5 = fs_->make("h_sum0ErrorBperLS5", " ", bac, 1., bac2); + h_2D0sumErrorBLS5 = fs_->make("h_2D0sumErrorBLS5", " ", neta, -41., 41., nphi, 0., bphi); + h_2DsumErrorBLS5 = fs_->make("h_2DsumErrorBLS5", " ", neta, -41., 41., nphi, 0., bphi); + + h_sumErrorBLS6 = fs_->make("h_sumErrorBLS6", " ", 10, 0., 10.); + h_sumErrorBperLS6 = fs_->make("h_sumErrorBperLS6", " ", bac, 1., bac2); + h_sum0ErrorBperLS6 = fs_->make("h_sum0ErrorBperLS6", " ", bac, 1., bac2); + h_2D0sumErrorBLS6 = fs_->make("h_2D0sumErrorBLS6", " ", neta, -41., 41., nphi, 0., bphi); + h_2DsumErrorBLS6 = fs_->make("h_2DsumErrorBLS6", " ", neta, -41., 41., nphi, 0., bphi); + h_sumErrorBLS7 = fs_->make("h_sumErrorBLS7", " ", 10, 0., 10.); + h_sumErrorBperLS7 = fs_->make("h_sumErrorBperLS7", " ", bac, 1., bac2); + h_sum0ErrorBperLS7 = fs_->make("h_sum0ErrorBperLS7", " ", bac, 1., bac2); + h_2D0sumErrorBLS7 = fs_->make("h_2D0sumErrorBLS7", " ", neta, -41., 41., nphi, 0., bphi); + h_2DsumErrorBLS7 = fs_->make("h_2DsumErrorBLS7", " ", neta, -41., 41., nphi, 0., bphi); + + h_sumErrorBLS8 = fs_->make("h_sumErrorBLS8", " ", 10, 0., 10.); + h_sumErrorBperLS8 = fs_->make("h_sumErrorBperLS8", " ", bac, 1., bac2); + h_sum0ErrorBperLS8 = fs_->make("h_sum0ErrorBperLS8", " ", bac, 1., bac2); + h_2D0sumErrorBLS8 = fs_->make("h_2D0sumErrorBLS8", " ", neta, -41., 41., nphi, 0., bphi); + h_2DsumErrorBLS8 = fs_->make("h_2DsumErrorBLS8", " ", neta, -41., 41., nphi, 0., bphi); //-------------------------------------------------- // for averSIGNALOCCUPANCY : - h_averSIGNALoccupancy_HB = new TH1F("h_averSIGNALoccupancy_HB", " ", bac, 1., bac2); - h_averSIGNALoccupancy_HE = new TH1F("h_averSIGNALoccupancy_HE", " ", bac, 1., bac2); - h_averSIGNALoccupancy_HF = new TH1F("h_averSIGNALoccupancy_HF", " ", bac, 1., bac2); - h_averSIGNALoccupancy_HO = new TH1F("h_averSIGNALoccupancy_HO", " ", bac, 1., bac2); + h_averSIGNALoccupancy_HB = fs_->make("h_averSIGNALoccupancy_HB", " ", bac, 1., bac2); + h_averSIGNALoccupancy_HE = fs_->make("h_averSIGNALoccupancy_HE", " ", bac, 1., bac2); + h_averSIGNALoccupancy_HF = fs_->make("h_averSIGNALoccupancy_HF", " ", bac, 1., bac2); + h_averSIGNALoccupancy_HO = fs_->make("h_averSIGNALoccupancy_HO", " ", bac, 1., bac2); // for averSIGNALsumamplitude : - h_averSIGNALsumamplitude_HB = new TH1F("h_averSIGNALsumamplitude_HB", " ", bac, 1., bac2); - h_averSIGNALsumamplitude_HE = new TH1F("h_averSIGNALsumamplitude_HE", " ", bac, 1., bac2); - h_averSIGNALsumamplitude_HF = new TH1F("h_averSIGNALsumamplitude_HF", " ", bac, 1., bac2); - h_averSIGNALsumamplitude_HO = new TH1F("h_averSIGNALsumamplitude_HO", " ", bac, 1., bac2); + h_averSIGNALsumamplitude_HB = fs_->make("h_averSIGNALsumamplitude_HB", " ", bac, 1., bac2); + h_averSIGNALsumamplitude_HE = fs_->make("h_averSIGNALsumamplitude_HE", " ", bac, 1., bac2); + h_averSIGNALsumamplitude_HF = fs_->make("h_averSIGNALsumamplitude_HF", " ", bac, 1., bac2); + h_averSIGNALsumamplitude_HO = fs_->make("h_averSIGNALsumamplitude_HO", " ", bac, 1., bac2); // for averNOSIGNALOCCUPANCY : - h_averNOSIGNALoccupancy_HB = new TH1F("h_averNOSIGNALoccupancy_HB", " ", bac, 1., bac2); - h_averNOSIGNALoccupancy_HE = new TH1F("h_averNOSIGNALoccupancy_HE", " ", bac, 1., bac2); - h_averNOSIGNALoccupancy_HF = new TH1F("h_averNOSIGNALoccupancy_HF", " ", bac, 1., bac2); - h_averNOSIGNALoccupancy_HO = new TH1F("h_averNOSIGNALoccupancy_HO", " ", bac, 1., bac2); + h_averNOSIGNALoccupancy_HB = fs_->make("h_averNOSIGNALoccupancy_HB", " ", bac, 1., bac2); + h_averNOSIGNALoccupancy_HE = fs_->make("h_averNOSIGNALoccupancy_HE", " ", bac, 1., bac2); + h_averNOSIGNALoccupancy_HF = fs_->make("h_averNOSIGNALoccupancy_HF", " ", bac, 1., bac2); + h_averNOSIGNALoccupancy_HO = fs_->make("h_averNOSIGNALoccupancy_HO", " ", bac, 1., bac2); // for averNOSIGNALsumamplitude : - h_averNOSIGNALsumamplitude_HB = new TH1F("h_averNOSIGNALsumamplitude_HB", " ", bac, 1., bac2); - h_averNOSIGNALsumamplitude_HE = new TH1F("h_averNOSIGNALsumamplitude_HE", " ", bac, 1., bac2); - h_averNOSIGNALsumamplitude_HF = new TH1F("h_averNOSIGNALsumamplitude_HF", " ", bac, 1., bac2); - h_averNOSIGNALsumamplitude_HO = new TH1F("h_averNOSIGNALsumamplitude_HO", " ", bac, 1., bac2); + h_averNOSIGNALsumamplitude_HB = fs_->make("h_averNOSIGNALsumamplitude_HB", " ", bac, 1., bac2); + h_averNOSIGNALsumamplitude_HE = fs_->make("h_averNOSIGNALsumamplitude_HE", " ", bac, 1., bac2); + h_averNOSIGNALsumamplitude_HF = fs_->make("h_averNOSIGNALsumamplitude_HF", " ", bac, 1., bac2); + h_averNOSIGNALsumamplitude_HO = fs_->make("h_averNOSIGNALsumamplitude_HO", " ", bac, 1., bac2); // for channel SUM over depthes Amplitudes for each sub-detector - h_sumamplitudechannel_HB = new TH1F("h_sumamplitudechannel_HB", " ", 100, 0., 2000.); - h_sumamplitudechannel_HE = new TH1F("h_sumamplitudechannel_HE", " ", 100, 0., 3000.); - h_sumamplitudechannel_HF = new TH1F("h_sumamplitudechannel_HF", " ", 100, 0., 7000.); - h_sumamplitudechannel_HO = new TH1F("h_sumamplitudechannel_HO", " ", 100, 0., 10000.); + h_sumamplitudechannel_HB = fs_->make("h_sumamplitudechannel_HB", " ", 100, 0., 2000.); + h_sumamplitudechannel_HE = fs_->make("h_sumamplitudechannel_HE", " ", 100, 0., 3000.); + h_sumamplitudechannel_HF = fs_->make("h_sumamplitudechannel_HF", " ", 100, 0., 7000.); + h_sumamplitudechannel_HO = fs_->make("h_sumamplitudechannel_HO", " ", 100, 0., 10000.); // for event Amplitudes for each sub-detector - h_eventamplitude_HB = new TH1F("h_eventamplitude_HB", " ", 100, 0., 80000.); - h_eventamplitude_HE = new TH1F("h_eventamplitude_HE", " ", 100, 0., 100000.); - h_eventamplitude_HF = new TH1F("h_eventamplitude_HF", " ", 100, 0., 150000.); - h_eventamplitude_HO = new TH1F("h_eventamplitude_HO", " ", 100, 0., 250000.); + h_eventamplitude_HB = fs_->make("h_eventamplitude_HB", " ", 100, 0., 80000.); + h_eventamplitude_HE = fs_->make("h_eventamplitude_HE", " ", 100, 0., 100000.); + h_eventamplitude_HF = fs_->make("h_eventamplitude_HF", " ", 100, 0., 150000.); + h_eventamplitude_HO = fs_->make("h_eventamplitude_HO", " ", 100, 0., 250000.); // for event Occupancy for each sub-detector - h_eventoccupancy_HB = new TH1F("h_eventoccupancy_HB", " ", 100, 0., 3000.); - h_eventoccupancy_HE = new TH1F("h_eventoccupancy_HE", " ", 100, 0., 2000.); - h_eventoccupancy_HF = new TH1F("h_eventoccupancy_HF", " ", 100, 0., 1000.); - h_eventoccupancy_HO = new TH1F("h_eventoccupancy_HO", " ", 100, 0., 2500.); + h_eventoccupancy_HB = fs_->make("h_eventoccupancy_HB", " ", 100, 0., 3000.); + h_eventoccupancy_HE = fs_->make("h_eventoccupancy_HE", " ", 100, 0., 2000.); + h_eventoccupancy_HF = fs_->make("h_eventoccupancy_HF", " ", 100, 0., 1000.); + h_eventoccupancy_HO = fs_->make("h_eventoccupancy_HO", " ", 100, 0., 2500.); // for maxxSUMAmplitude - h_maxxSUMAmpl_HB = new TH1F("h_maxxSUMAmpl_HB", " ", bac, 1., bac2); - h_maxxSUMAmpl_HE = new TH1F("h_maxxSUMAmpl_HE", " ", bac, 1., bac2); - h_maxxSUMAmpl_HF = new TH1F("h_maxxSUMAmpl_HF", " ", bac, 1., bac2); - h_maxxSUMAmpl_HO = new TH1F("h_maxxSUMAmpl_HO", " ", bac, 1., bac2); + h_maxxSUMAmpl_HB = fs_->make("h_maxxSUMAmpl_HB", " ", bac, 1., bac2); + h_maxxSUMAmpl_HE = fs_->make("h_maxxSUMAmpl_HE", " ", bac, 1., bac2); + h_maxxSUMAmpl_HF = fs_->make("h_maxxSUMAmpl_HF", " ", bac, 1., bac2); + h_maxxSUMAmpl_HO = fs_->make("h_maxxSUMAmpl_HO", " ", bac, 1., bac2); // for maxxOCCUP - h_maxxOCCUP_HB = new TH1F("h_maxxOCCUP_HB", " ", bac, 1., bac2); - h_maxxOCCUP_HE = new TH1F("h_maxxOCCUP_HE", " ", bac, 1., bac2); - h_maxxOCCUP_HF = new TH1F("h_maxxOCCUP_HF", " ", bac, 1., bac2); - h_maxxOCCUP_HO = new TH1F("h_maxxOCCUP_HO", " ", bac, 1., bac2); + h_maxxOCCUP_HB = fs_->make("h_maxxOCCUP_HB", " ", bac, 1., bac2); + h_maxxOCCUP_HE = fs_->make("h_maxxOCCUP_HE", " ", bac, 1., bac2); + h_maxxOCCUP_HF = fs_->make("h_maxxOCCUP_HF", " ", bac, 1., bac2); + h_maxxOCCUP_HO = fs_->make("h_maxxOCCUP_HO", " ", bac, 1., bac2); //-------------------------------------------------- // pedestals - h_pedestal0_HB = new TH1F("h_pedestal0_HB", " ", 100, 0., 10.); - h_pedestal1_HB = new TH1F("h_pedestal1_HB", " ", 100, 0., 10.); - h_pedestal2_HB = new TH1F("h_pedestal2_HB", " ", 100, 0., 10.); - h_pedestal3_HB = new TH1F("h_pedestal3_HB", " ", 100, 0., 10.); - h_pedestalaver4_HB = new TH1F("h_pedestalaver4_HB", " ", 100, 0., 10.); - h_pedestalaver9_HB = new TH1F("h_pedestalaver9_HB", " ", 100, 0., 10.); - h_pedestalw0_HB = new TH1F("h_pedestalw0_HB", " ", 100, 0., 2.5); - h_pedestalw1_HB = new TH1F("h_pedestalw1_HB", " ", 100, 0., 2.5); - h_pedestalw2_HB = new TH1F("h_pedestalw2_HB", " ", 100, 0., 2.5); - h_pedestalw3_HB = new TH1F("h_pedestalw3_HB", " ", 100, 0., 2.5); - h_pedestalwaver4_HB = new TH1F("h_pedestalwaver4_HB", " ", 100, 0., 2.5); - h_pedestalwaver9_HB = new TH1F("h_pedestalwaver9_HB", " ", 100, 0., 2.5); - - h_pedestal0_HE = new TH1F("h_pedestal0_HE", " ", 100, 0., 10.); - h_pedestal1_HE = new TH1F("h_pedestal1_HE", " ", 100, 0., 10.); - h_pedestal2_HE = new TH1F("h_pedestal2_HE", " ", 100, 0., 10.); - h_pedestal3_HE = new TH1F("h_pedestal3_HE", " ", 100, 0., 10.); - h_pedestalaver4_HE = new TH1F("h_pedestalaver4_HE", " ", 100, 0., 10.); - h_pedestalaver9_HE = new TH1F("h_pedestalaver9_HE", " ", 100, 0., 10.); - h_pedestalw0_HE = new TH1F("h_pedestalw0_HE", " ", 100, 0., 2.5); - h_pedestalw1_HE = new TH1F("h_pedestalw1_HE", " ", 100, 0., 2.5); - h_pedestalw2_HE = new TH1F("h_pedestalw2_HE", " ", 100, 0., 2.5); - h_pedestalw3_HE = new TH1F("h_pedestalw3_HE", " ", 100, 0., 2.5); - h_pedestalwaver4_HE = new TH1F("h_pedestalwaver4_HE", " ", 100, 0., 2.5); - h_pedestalwaver9_HE = new TH1F("h_pedestalwaver9_HE", " ", 100, 0., 2.5); - - h_pedestal0_HF = new TH1F("h_pedestal0_HF", " ", 100, 0., 20.); - h_pedestal1_HF = new TH1F("h_pedestal1_HF", " ", 100, 0., 20.); - h_pedestal2_HF = new TH1F("h_pedestal2_HF", " ", 100, 0., 20.); - h_pedestal3_HF = new TH1F("h_pedestal3_HF", " ", 100, 0., 20.); - h_pedestalaver4_HF = new TH1F("h_pedestalaver4_HF", " ", 100, 0., 20.); - h_pedestalaver9_HF = new TH1F("h_pedestalaver9_HF", " ", 100, 0., 20.); - h_pedestalw0_HF = new TH1F("h_pedestalw0_HF", " ", 100, 0., 2.5); - h_pedestalw1_HF = new TH1F("h_pedestalw1_HF", " ", 100, 0., 2.5); - h_pedestalw2_HF = new TH1F("h_pedestalw2_HF", " ", 100, 0., 2.5); - h_pedestalw3_HF = new TH1F("h_pedestalw3_HF", " ", 100, 0., 2.5); - h_pedestalwaver4_HF = new TH1F("h_pedestalwaver4_HF", " ", 100, 0., 2.5); - h_pedestalwaver9_HF = new TH1F("h_pedestalwaver9_HF", " ", 100, 0., 2.5); - - h_pedestal0_HO = new TH1F("h_pedestal0_HO", " ", 100, 0., 20.); - h_pedestal1_HO = new TH1F("h_pedestal1_HO", " ", 100, 0., 20.); - h_pedestal2_HO = new TH1F("h_pedestal2_HO", " ", 100, 0., 20.); - h_pedestal3_HO = new TH1F("h_pedestal3_HO", " ", 100, 0., 20.); - h_pedestalaver4_HO = new TH1F("h_pedestalaver4_HO", " ", 100, 0., 20.); - h_pedestalaver9_HO = new TH1F("h_pedestalaver9_HO", " ", 100, 0., 20.); - h_pedestalw0_HO = new TH1F("h_pedestalw0_HO", " ", 100, 0., 2.5); - h_pedestalw1_HO = new TH1F("h_pedestalw1_HO", " ", 100, 0., 2.5); - h_pedestalw2_HO = new TH1F("h_pedestalw2_HO", " ", 100, 0., 2.5); - h_pedestalw3_HO = new TH1F("h_pedestalw3_HO", " ", 100, 0., 2.5); - h_pedestalwaver4_HO = new TH1F("h_pedestalwaver4_HO", " ", 100, 0., 2.5); - h_pedestalwaver9_HO = new TH1F("h_pedestalwaver9_HO", " ", 100, 0., 2.5); + h_pedestal0_HB = fs_->make("h_pedestal0_HB", " ", 100, 0., 10.); + h_pedestal1_HB = fs_->make("h_pedestal1_HB", " ", 100, 0., 10.); + h_pedestal2_HB = fs_->make("h_pedestal2_HB", " ", 100, 0., 10.); + h_pedestal3_HB = fs_->make("h_pedestal3_HB", " ", 100, 0., 10.); + h_pedestalaver4_HB = fs_->make("h_pedestalaver4_HB", " ", 100, 0., 10.); + h_pedestalaver9_HB = fs_->make("h_pedestalaver9_HB", " ", 100, 0., 10.); + h_pedestalw0_HB = fs_->make("h_pedestalw0_HB", " ", 100, 0., 2.5); + h_pedestalw1_HB = fs_->make("h_pedestalw1_HB", " ", 100, 0., 2.5); + h_pedestalw2_HB = fs_->make("h_pedestalw2_HB", " ", 100, 0., 2.5); + h_pedestalw3_HB = fs_->make("h_pedestalw3_HB", " ", 100, 0., 2.5); + h_pedestalwaver4_HB = fs_->make("h_pedestalwaver4_HB", " ", 100, 0., 2.5); + h_pedestalwaver9_HB = fs_->make("h_pedestalwaver9_HB", " ", 100, 0., 2.5); + + h_pedestal0_HE = fs_->make("h_pedestal0_HE", " ", 100, 0., 10.); + h_pedestal1_HE = fs_->make("h_pedestal1_HE", " ", 100, 0., 10.); + h_pedestal2_HE = fs_->make("h_pedestal2_HE", " ", 100, 0., 10.); + h_pedestal3_HE = fs_->make("h_pedestal3_HE", " ", 100, 0., 10.); + h_pedestalaver4_HE = fs_->make("h_pedestalaver4_HE", " ", 100, 0., 10.); + h_pedestalaver9_HE = fs_->make("h_pedestalaver9_HE", " ", 100, 0., 10.); + h_pedestalw0_HE = fs_->make("h_pedestalw0_HE", " ", 100, 0., 2.5); + h_pedestalw1_HE = fs_->make("h_pedestalw1_HE", " ", 100, 0., 2.5); + h_pedestalw2_HE = fs_->make("h_pedestalw2_HE", " ", 100, 0., 2.5); + h_pedestalw3_HE = fs_->make("h_pedestalw3_HE", " ", 100, 0., 2.5); + h_pedestalwaver4_HE = fs_->make("h_pedestalwaver4_HE", " ", 100, 0., 2.5); + h_pedestalwaver9_HE = fs_->make("h_pedestalwaver9_HE", " ", 100, 0., 2.5); + + h_pedestal0_HF = fs_->make("h_pedestal0_HF", " ", 100, 0., 20.); + h_pedestal1_HF = fs_->make("h_pedestal1_HF", " ", 100, 0., 20.); + h_pedestal2_HF = fs_->make("h_pedestal2_HF", " ", 100, 0., 20.); + h_pedestal3_HF = fs_->make("h_pedestal3_HF", " ", 100, 0., 20.); + h_pedestalaver4_HF = fs_->make("h_pedestalaver4_HF", " ", 100, 0., 20.); + h_pedestalaver9_HF = fs_->make("h_pedestalaver9_HF", " ", 100, 0., 20.); + h_pedestalw0_HF = fs_->make("h_pedestalw0_HF", " ", 100, 0., 2.5); + h_pedestalw1_HF = fs_->make("h_pedestalw1_HF", " ", 100, 0., 2.5); + h_pedestalw2_HF = fs_->make("h_pedestalw2_HF", " ", 100, 0., 2.5); + h_pedestalw3_HF = fs_->make("h_pedestalw3_HF", " ", 100, 0., 2.5); + h_pedestalwaver4_HF = fs_->make("h_pedestalwaver4_HF", " ", 100, 0., 2.5); + h_pedestalwaver9_HF = fs_->make("h_pedestalwaver9_HF", " ", 100, 0., 2.5); + + h_pedestal0_HO = fs_->make("h_pedestal0_HO", " ", 100, 0., 20.); + h_pedestal1_HO = fs_->make("h_pedestal1_HO", " ", 100, 0., 20.); + h_pedestal2_HO = fs_->make("h_pedestal2_HO", " ", 100, 0., 20.); + h_pedestal3_HO = fs_->make("h_pedestal3_HO", " ", 100, 0., 20.); + h_pedestalaver4_HO = fs_->make("h_pedestalaver4_HO", " ", 100, 0., 20.); + h_pedestalaver9_HO = fs_->make("h_pedestalaver9_HO", " ", 100, 0., 20.); + h_pedestalw0_HO = fs_->make("h_pedestalw0_HO", " ", 100, 0., 2.5); + h_pedestalw1_HO = fs_->make("h_pedestalw1_HO", " ", 100, 0., 2.5); + h_pedestalw2_HO = fs_->make("h_pedestalw2_HO", " ", 100, 0., 2.5); + h_pedestalw3_HO = fs_->make("h_pedestalw3_HO", " ", 100, 0., 2.5); + h_pedestalwaver4_HO = fs_->make("h_pedestalwaver4_HO", " ", 100, 0., 2.5); + h_pedestalwaver9_HO = fs_->make("h_pedestalwaver9_HO", " ", 100, 0., 2.5); //-------------------------------------------------- - h_mapDepth1pedestalw_HB = new TH2F("h_mapDepth1pedestalw_HB", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth2pedestalw_HB = new TH2F("h_mapDepth2pedestalw_HB", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth3pedestalw_HB = new TH2F("h_mapDepth3pedestalw_HB", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth4pedestalw_HB = new TH2F("h_mapDepth4pedestalw_HB", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth1pedestalw_HE = new TH2F("h_mapDepth1pedestalw_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth2pedestalw_HE = new TH2F("h_mapDepth2pedestalw_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth3pedestalw_HE = new TH2F("h_mapDepth3pedestalw_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth4pedestalw_HE = new TH2F("h_mapDepth4pedestalw_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth5pedestalw_HE = new TH2F("h_mapDepth5pedestalw_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth6pedestalw_HE = new TH2F("h_mapDepth6pedestalw_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth7pedestalw_HE = new TH2F("h_mapDepth7pedestalw_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth1pedestalw_HF = new TH2F("h_mapDepth1pedestalw_HF", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth2pedestalw_HF = new TH2F("h_mapDepth2pedestalw_HF", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth3pedestalw_HF = new TH2F("h_mapDepth3pedestalw_HF", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth4pedestalw_HF = new TH2F("h_mapDepth4pedestalw_HF", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth4pedestalw_HO = new TH2F("h_mapDepth4pedestalw_HO", " ", neta, -41., 41., nphi, 0., bphi); - - h_mapDepth1pedestal_HB = new TH2F("h_mapDepth1pedestal_HB", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth2pedestal_HB = new TH2F("h_mapDepth2pedestal_HB", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth3pedestal_HB = new TH2F("h_mapDepth3pedestal_HB", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth4pedestal_HB = new TH2F("h_mapDepth4pedestal_HB", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth1pedestal_HE = new TH2F("h_mapDepth1pedestal_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth2pedestal_HE = new TH2F("h_mapDepth2pedestal_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth3pedestal_HE = new TH2F("h_mapDepth3pedestal_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth4pedestal_HE = new TH2F("h_mapDepth4pedestal_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth5pedestal_HE = new TH2F("h_mapDepth5pedestal_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth6pedestal_HE = new TH2F("h_mapDepth6pedestal_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth7pedestal_HE = new TH2F("h_mapDepth7pedestal_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth1pedestal_HF = new TH2F("h_mapDepth1pedestal_HF", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth2pedestal_HF = new TH2F("h_mapDepth2pedestal_HF", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth3pedestal_HF = new TH2F("h_mapDepth3pedestal_HF", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth4pedestal_HF = new TH2F("h_mapDepth4pedestal_HF", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth4pedestal_HO = new TH2F("h_mapDepth4pedestal_HO", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth1pedestalw_HB = fs_->make("h_mapDepth1pedestalw_HB", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth2pedestalw_HB = fs_->make("h_mapDepth2pedestalw_HB", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth3pedestalw_HB = fs_->make("h_mapDepth3pedestalw_HB", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth4pedestalw_HB = fs_->make("h_mapDepth4pedestalw_HB", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth1pedestalw_HE = fs_->make("h_mapDepth1pedestalw_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth2pedestalw_HE = fs_->make("h_mapDepth2pedestalw_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth3pedestalw_HE = fs_->make("h_mapDepth3pedestalw_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth4pedestalw_HE = fs_->make("h_mapDepth4pedestalw_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth5pedestalw_HE = fs_->make("h_mapDepth5pedestalw_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth6pedestalw_HE = fs_->make("h_mapDepth6pedestalw_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth7pedestalw_HE = fs_->make("h_mapDepth7pedestalw_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth1pedestalw_HF = fs_->make("h_mapDepth1pedestalw_HF", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth2pedestalw_HF = fs_->make("h_mapDepth2pedestalw_HF", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth3pedestalw_HF = fs_->make("h_mapDepth3pedestalw_HF", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth4pedestalw_HF = fs_->make("h_mapDepth4pedestalw_HF", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth4pedestalw_HO = fs_->make("h_mapDepth4pedestalw_HO", " ", neta, -41., 41., nphi, 0., bphi); + + h_mapDepth1pedestal_HB = fs_->make("h_mapDepth1pedestal_HB", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth2pedestal_HB = fs_->make("h_mapDepth2pedestal_HB", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth3pedestal_HB = fs_->make("h_mapDepth3pedestal_HB", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth4pedestal_HB = fs_->make("h_mapDepth4pedestal_HB", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth1pedestal_HE = fs_->make("h_mapDepth1pedestal_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth2pedestal_HE = fs_->make("h_mapDepth2pedestal_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth3pedestal_HE = fs_->make("h_mapDepth3pedestal_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth4pedestal_HE = fs_->make("h_mapDepth4pedestal_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth5pedestal_HE = fs_->make("h_mapDepth5pedestal_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth6pedestal_HE = fs_->make("h_mapDepth6pedestal_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth7pedestal_HE = fs_->make("h_mapDepth7pedestal_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth1pedestal_HF = fs_->make("h_mapDepth1pedestal_HF", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth2pedestal_HF = fs_->make("h_mapDepth2pedestal_HF", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth3pedestal_HF = fs_->make("h_mapDepth3pedestal_HF", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth4pedestal_HF = fs_->make("h_mapDepth4pedestal_HF", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth4pedestal_HO = fs_->make("h_mapDepth4pedestal_HO", " ", neta, -41., 41., nphi, 0., bphi); //-------------------------------------------------- - h_pedestal00_HB = new TH1F("h_pedestal00_HB", " ", 100, 0., 10.); - h_gain_HB = new TH1F("h_gain_HB", " ", 100, 0., 1.); - h_respcorr_HB = new TH1F("h_respcorr_HB", " ", 100, 0., 2.5); - h_timecorr_HB = new TH1F("h_timecorr_HB", " ", 100, 0., 30.); - h_lutcorr_HB = new TH1F("h_lutcorr_HB", " ", 100, 0., 10.); - h_difpedestal0_HB = new TH1F("h_difpedestal0_HB", " ", 100, -3., 3.); - h_difpedestal1_HB = new TH1F("h_difpedestal1_HB", " ", 100, -3., 3.); - h_difpedestal2_HB = new TH1F("h_difpedestal2_HB", " ", 100, -3., 3.); - h_difpedestal3_HB = new TH1F("h_difpedestal3_HB", " ", 100, -3., 3.); - - h_pedestal00_HE = new TH1F("h_pedestal00_HE", " ", 100, 0., 10.); - h_gain_HE = new TH1F("h_gain_HE", " ", 100, 0., 1.); - h_respcorr_HE = new TH1F("h_respcorr_HE", " ", 100, 0., 2.5); - h_timecorr_HE = new TH1F("h_timecorr_HE", " ", 100, 0., 30.); - h_lutcorr_HE = new TH1F("h_lutcorr_HE", " ", 100, 0., 10.); - - h_pedestal00_HF = new TH1F("h_pedestal00_HF", " ", 100, 0., 10.); - h_gain_HF = new TH1F("h_gain_HF", " ", 100, 0., 1.); - h_respcorr_HF = new TH1F("h_respcorr_HF", " ", 100, 0., 2.5); - h_timecorr_HF = new TH1F("h_timecorr_HF", " ", 100, 0., 30.); - h_lutcorr_HF = new TH1F("h_lutcorr_HF", " ", 100, 0., 10.); - - h_pedestal00_HO = new TH1F("h_pedestal00_HO", " ", 100, 0., 10.); - h_gain_HO = new TH1F("h_gain_HO", " ", 100, 0., 1.); - h_respcorr_HO = new TH1F("h_respcorr_HO", " ", 100, 0., 2.5); - h_timecorr_HO = new TH1F("h_timecorr_HO", " ", 100, 0., 30.); - h_lutcorr_HO = new TH1F("h_lutcorr_HO", " ", 100, 0., 10.); + h_pedestal00_HB = fs_->make("h_pedestal00_HB", " ", 100, 0., 10.); + h_gain_HB = fs_->make("h_gain_HB", " ", 100, 0., 1.); + h_respcorr_HB = fs_->make("h_respcorr_HB", " ", 100, 0., 2.5); + h_timecorr_HB = fs_->make("h_timecorr_HB", " ", 100, 0., 30.); + h_lutcorr_HB = fs_->make("h_lutcorr_HB", " ", 100, 0., 10.); + h_difpedestal0_HB = fs_->make("h_difpedestal0_HB", " ", 100, -3., 3.); + h_difpedestal1_HB = fs_->make("h_difpedestal1_HB", " ", 100, -3., 3.); + h_difpedestal2_HB = fs_->make("h_difpedestal2_HB", " ", 100, -3., 3.); + h_difpedestal3_HB = fs_->make("h_difpedestal3_HB", " ", 100, -3., 3.); + + h_pedestal00_HE = fs_->make("h_pedestal00_HE", " ", 100, 0., 10.); + h_gain_HE = fs_->make("h_gain_HE", " ", 100, 0., 1.); + h_respcorr_HE = fs_->make("h_respcorr_HE", " ", 100, 0., 2.5); + h_timecorr_HE = fs_->make("h_timecorr_HE", " ", 100, 0., 30.); + h_lutcorr_HE = fs_->make("h_lutcorr_HE", " ", 100, 0., 10.); + + h_pedestal00_HF = fs_->make("h_pedestal00_HF", " ", 100, 0., 10.); + h_gain_HF = fs_->make("h_gain_HF", " ", 100, 0., 1.); + h_respcorr_HF = fs_->make("h_respcorr_HF", " ", 100, 0., 2.5); + h_timecorr_HF = fs_->make("h_timecorr_HF", " ", 100, 0., 30.); + h_lutcorr_HF = fs_->make("h_lutcorr_HF", " ", 100, 0., 10.); + + h_pedestal00_HO = fs_->make("h_pedestal00_HO", " ", 100, 0., 10.); + h_gain_HO = fs_->make("h_gain_HO", " ", 100, 0., 1.); + h_respcorr_HO = fs_->make("h_respcorr_HO", " ", 100, 0., 2.5); + h_timecorr_HO = fs_->make("h_timecorr_HO", " ", 100, 0., 30.); + h_lutcorr_HO = fs_->make("h_lutcorr_HO", " ", 100, 0., 10.); //-------------------------------------------------- float est6 = 2500.; int ist6 = 30; int ist2 = 60; - h2_pedvsampl_HB = new TH2F("h2_pedvsampl_HB", " ", ist2, 0., 7.0, ist2, 0., est6); - h2_pedwvsampl_HB = new TH2F("h2_pedwvsampl_HB", " ", ist2, 0., 2.5, ist2, 0., est6); - h_pedvsampl_HB = new TH1F("h_pedvsampl_HB", " ", ist6, 0., 7.0); - h_pedwvsampl_HB = new TH1F("h_pedwvsampl_HB", " ", ist6, 0., 2.5); - h_pedvsampl0_HB = new TH1F("h_pedvsampl0_HB", " ", ist6, 0., 7.); - h_pedwvsampl0_HB = new TH1F("h_pedwvsampl0_HB", " ", ist6, 0., 2.5); - h2_amplvsped_HB = new TH2F("h2_amplvsped_HB", " ", ist2, 0., est6, ist2, 0., 7.0); - h2_amplvspedw_HB = new TH2F("h2_amplvspedw_HB", " ", ist2, 0., est6, ist2, 0., 2.5); - h_amplvsped_HB = new TH1F("h_amplvsped_HB", " ", ist6, 0., est6); - h_amplvspedw_HB = new TH1F("h_amplvspedw_HB", " ", ist6, 0., est6); - h_amplvsped0_HB = new TH1F("h_amplvsped0_HB", " ", ist6, 0., est6); - - h2_pedvsampl_HE = new TH2F("h2_pedvsampl_HE", " ", ist2, 0., 7.0, ist2, 0., est6); - h2_pedwvsampl_HE = new TH2F("h2_pedwvsampl_HE", " ", ist2, 0., 2.5, ist2, 0., est6); - h_pedvsampl_HE = new TH1F("h_pedvsampl_HE", " ", ist6, 0., 7.0); - h_pedwvsampl_HE = new TH1F("h_pedwvsampl_HE", " ", ist6, 0., 2.5); - h_pedvsampl0_HE = new TH1F("h_pedvsampl0_HE", " ", ist6, 0., 7.); - h_pedwvsampl0_HE = new TH1F("h_pedwvsampl0_HE", " ", ist6, 0., 2.5); - - h2_pedvsampl_HF = new TH2F("h2_pedvsampl_HF", " ", ist2, 0., 20.0, ist2, 0., est6); - h2_pedwvsampl_HF = new TH2F("h2_pedwvsampl_HF", " ", ist2, 0., 2.0, ist2, 0., est6); - h_pedvsampl_HF = new TH1F("h_pedvsampl_HF", " ", ist6, 0., 20.0); - h_pedwvsampl_HF = new TH1F("h_pedwvsampl_HF", " ", ist6, 0., 2.0); - h_pedvsampl0_HF = new TH1F("h_pedvsampl0_HF", " ", ist6, 0., 20.); - h_pedwvsampl0_HF = new TH1F("h_pedwvsampl0_HF", " ", ist6, 0., 2.0); - - h2_pedvsampl_HO = new TH2F("h2_pedvsampl_HO", " ", ist2, 0., 20.0, ist2, 0., est6); - h2_pedwvsampl_HO = new TH2F("h2_pedwvsampl_HO", " ", ist2, 0., 2.5, ist2, 0., est6); - h_pedvsampl_HO = new TH1F("h_pedvsampl_HO", " ", ist6, 0., 20.0); - h_pedwvsampl_HO = new TH1F("h_pedwvsampl_HO", " ", ist6, 0., 2.5); - h_pedvsampl0_HO = new TH1F("h_pedvsampl0_HO", " ", ist6, 0., 20.); - h_pedwvsampl0_HO = new TH1F("h_pedwvsampl0_HO", " ", ist6, 0., 2.5); + h2_pedvsampl_HB = fs_->make("h2_pedvsampl_HB", " ", ist2, 0., 7.0, ist2, 0., est6); + h2_pedwvsampl_HB = fs_->make("h2_pedwvsampl_HB", " ", ist2, 0., 2.5, ist2, 0., est6); + h_pedvsampl_HB = fs_->make("h_pedvsampl_HB", " ", ist6, 0., 7.0); + h_pedwvsampl_HB = fs_->make("h_pedwvsampl_HB", " ", ist6, 0., 2.5); + h_pedvsampl0_HB = fs_->make("h_pedvsampl0_HB", " ", ist6, 0., 7.); + h_pedwvsampl0_HB = fs_->make("h_pedwvsampl0_HB", " ", ist6, 0., 2.5); + h2_amplvsped_HB = fs_->make("h2_amplvsped_HB", " ", ist2, 0., est6, ist2, 0., 7.0); + h2_amplvspedw_HB = fs_->make("h2_amplvspedw_HB", " ", ist2, 0., est6, ist2, 0., 2.5); + h_amplvsped_HB = fs_->make("h_amplvsped_HB", " ", ist6, 0., est6); + h_amplvspedw_HB = fs_->make("h_amplvspedw_HB", " ", ist6, 0., est6); + h_amplvsped0_HB = fs_->make("h_amplvsped0_HB", " ", ist6, 0., est6); + + h2_pedvsampl_HE = fs_->make("h2_pedvsampl_HE", " ", ist2, 0., 7.0, ist2, 0., est6); + h2_pedwvsampl_HE = fs_->make("h2_pedwvsampl_HE", " ", ist2, 0., 2.5, ist2, 0., est6); + h_pedvsampl_HE = fs_->make("h_pedvsampl_HE", " ", ist6, 0., 7.0); + h_pedwvsampl_HE = fs_->make("h_pedwvsampl_HE", " ", ist6, 0., 2.5); + h_pedvsampl0_HE = fs_->make("h_pedvsampl0_HE", " ", ist6, 0., 7.); + h_pedwvsampl0_HE = fs_->make("h_pedwvsampl0_HE", " ", ist6, 0., 2.5); + + h2_pedvsampl_HF = fs_->make("h2_pedvsampl_HF", " ", ist2, 0., 20.0, ist2, 0., est6); + h2_pedwvsampl_HF = fs_->make("h2_pedwvsampl_HF", " ", ist2, 0., 2.0, ist2, 0., est6); + h_pedvsampl_HF = fs_->make("h_pedvsampl_HF", " ", ist6, 0., 20.0); + h_pedwvsampl_HF = fs_->make("h_pedwvsampl_HF", " ", ist6, 0., 2.0); + h_pedvsampl0_HF = fs_->make("h_pedvsampl0_HF", " ", ist6, 0., 20.); + h_pedwvsampl0_HF = fs_->make("h_pedwvsampl0_HF", " ", ist6, 0., 2.0); + + h2_pedvsampl_HO = fs_->make("h2_pedvsampl_HO", " ", ist2, 0., 20.0, ist2, 0., est6); + h2_pedwvsampl_HO = fs_->make("h2_pedwvsampl_HO", " ", ist2, 0., 2.5, ist2, 0., est6); + h_pedvsampl_HO = fs_->make("h_pedvsampl_HO", " ", ist6, 0., 20.0); + h_pedwvsampl_HO = fs_->make("h_pedwvsampl_HO", " ", ist6, 0., 2.5); + h_pedvsampl0_HO = fs_->make("h_pedvsampl0_HO", " ", ist6, 0., 20.); + h_pedwvsampl0_HO = fs_->make("h_pedwvsampl0_HO", " ", ist6, 0., 2.5); //-------------------------------------------------- - h_mapDepth1Ped0_HB = new TH2F("h_mapDepth1Ped0_HB", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth1Ped1_HB = new TH2F("h_mapDepth1Ped1_HB", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth1Ped2_HB = new TH2F("h_mapDepth1Ped2_HB", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth1Ped3_HB = new TH2F("h_mapDepth1Ped3_HB", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth1Pedw0_HB = new TH2F("h_mapDepth1Pedw0_HB", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth1Pedw1_HB = new TH2F("h_mapDepth1Pedw1_HB", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth1Pedw2_HB = new TH2F("h_mapDepth1Pedw2_HB", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth1Pedw3_HB = new TH2F("h_mapDepth1Pedw3_HB", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth2Ped0_HB = new TH2F("h_mapDepth2Ped0_HB", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth2Ped1_HB = new TH2F("h_mapDepth2Ped1_HB", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth2Ped2_HB = new TH2F("h_mapDepth2Ped2_HB", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth2Ped3_HB = new TH2F("h_mapDepth2Ped3_HB", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth2Pedw0_HB = new TH2F("h_mapDepth2Pedw0_HB", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth2Pedw1_HB = new TH2F("h_mapDepth2Pedw1_HB", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth2Pedw2_HB = new TH2F("h_mapDepth2Pedw2_HB", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth2Pedw3_HB = new TH2F("h_mapDepth2Pedw3_HB", " ", neta, -41., 41., nphi, 0., bphi); - - h_mapDepth1Ped0_HE = new TH2F("h_mapDepth1Ped0_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth1Ped1_HE = new TH2F("h_mapDepth1Ped1_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth1Ped2_HE = new TH2F("h_mapDepth1Ped2_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth1Ped3_HE = new TH2F("h_mapDepth1Ped3_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth1Pedw0_HE = new TH2F("h_mapDepth1Pedw0_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth1Pedw1_HE = new TH2F("h_mapDepth1Pedw1_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth1Pedw2_HE = new TH2F("h_mapDepth1Pedw2_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth1Pedw3_HE = new TH2F("h_mapDepth1Pedw3_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth2Ped0_HE = new TH2F("h_mapDepth2Ped0_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth2Ped1_HE = new TH2F("h_mapDepth2Ped1_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth2Ped2_HE = new TH2F("h_mapDepth2Ped2_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth2Ped3_HE = new TH2F("h_mapDepth2Ped3_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth2Pedw0_HE = new TH2F("h_mapDepth2Pedw0_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth2Pedw1_HE = new TH2F("h_mapDepth2Pedw1_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth2Pedw2_HE = new TH2F("h_mapDepth2Pedw2_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth2Pedw3_HE = new TH2F("h_mapDepth2Pedw3_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth3Ped0_HE = new TH2F("h_mapDepth3Ped0_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth3Ped1_HE = new TH2F("h_mapDepth3Ped1_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth3Ped2_HE = new TH2F("h_mapDepth3Ped2_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth3Ped3_HE = new TH2F("h_mapDepth3Ped3_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth3Pedw0_HE = new TH2F("h_mapDepth3Pedw0_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth3Pedw1_HE = new TH2F("h_mapDepth3Pedw1_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth3Pedw2_HE = new TH2F("h_mapDepth3Pedw2_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth3Pedw3_HE = new TH2F("h_mapDepth3Pedw3_HE", " ", neta, -41., 41., nphi, 0., bphi); - - h_mapDepth1Ped0_HF = new TH2F("h_mapDepth1Ped0_HF", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth1Ped1_HF = new TH2F("h_mapDepth1Ped1_HF", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth1Ped2_HF = new TH2F("h_mapDepth1Ped2_HF", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth1Ped3_HF = new TH2F("h_mapDepth1Ped3_HF", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth1Pedw0_HF = new TH2F("h_mapDepth1Pedw0_HF", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth1Pedw1_HF = new TH2F("h_mapDepth1Pedw1_HF", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth1Pedw2_HF = new TH2F("h_mapDepth1Pedw2_HF", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth1Pedw3_HF = new TH2F("h_mapDepth1Pedw3_HF", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth2Ped0_HF = new TH2F("h_mapDepth2Ped0_HF", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth2Ped1_HF = new TH2F("h_mapDepth2Ped1_HF", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth2Ped2_HF = new TH2F("h_mapDepth2Ped2_HF", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth2Ped3_HF = new TH2F("h_mapDepth2Ped3_HF", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth2Pedw0_HF = new TH2F("h_mapDepth2Pedw0_HF", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth2Pedw1_HF = new TH2F("h_mapDepth2Pedw1_HF", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth2Pedw2_HF = new TH2F("h_mapDepth2Pedw2_HF", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth2Pedw3_HF = new TH2F("h_mapDepth2Pedw3_HF", " ", neta, -41., 41., nphi, 0., bphi); - - h_mapDepth4Ped0_HO = new TH2F("h_mapDepth4Ped0_HO", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth4Ped1_HO = new TH2F("h_mapDepth4Ped1_HO", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth4Ped2_HO = new TH2F("h_mapDepth4Ped2_HO", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth4Ped3_HO = new TH2F("h_mapDepth4Ped3_HO", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth4Pedw0_HO = new TH2F("h_mapDepth4Pedw0_HO", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth4Pedw1_HO = new TH2F("h_mapDepth4Pedw1_HO", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth4Pedw2_HO = new TH2F("h_mapDepth4Pedw2_HO", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth4Pedw3_HO = new TH2F("h_mapDepth4Pedw3_HO", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth1Ped0_HB = fs_->make("h_mapDepth1Ped0_HB", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth1Ped1_HB = fs_->make("h_mapDepth1Ped1_HB", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth1Ped2_HB = fs_->make("h_mapDepth1Ped2_HB", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth1Ped3_HB = fs_->make("h_mapDepth1Ped3_HB", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth1Pedw0_HB = fs_->make("h_mapDepth1Pedw0_HB", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth1Pedw1_HB = fs_->make("h_mapDepth1Pedw1_HB", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth1Pedw2_HB = fs_->make("h_mapDepth1Pedw2_HB", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth1Pedw3_HB = fs_->make("h_mapDepth1Pedw3_HB", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth2Ped0_HB = fs_->make("h_mapDepth2Ped0_HB", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth2Ped1_HB = fs_->make("h_mapDepth2Ped1_HB", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth2Ped2_HB = fs_->make("h_mapDepth2Ped2_HB", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth2Ped3_HB = fs_->make("h_mapDepth2Ped3_HB", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth2Pedw0_HB = fs_->make("h_mapDepth2Pedw0_HB", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth2Pedw1_HB = fs_->make("h_mapDepth2Pedw1_HB", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth2Pedw2_HB = fs_->make("h_mapDepth2Pedw2_HB", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth2Pedw3_HB = fs_->make("h_mapDepth2Pedw3_HB", " ", neta, -41., 41., nphi, 0., bphi); + + h_mapDepth1Ped0_HE = fs_->make("h_mapDepth1Ped0_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth1Ped1_HE = fs_->make("h_mapDepth1Ped1_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth1Ped2_HE = fs_->make("h_mapDepth1Ped2_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth1Ped3_HE = fs_->make("h_mapDepth1Ped3_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth1Pedw0_HE = fs_->make("h_mapDepth1Pedw0_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth1Pedw1_HE = fs_->make("h_mapDepth1Pedw1_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth1Pedw2_HE = fs_->make("h_mapDepth1Pedw2_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth1Pedw3_HE = fs_->make("h_mapDepth1Pedw3_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth2Ped0_HE = fs_->make("h_mapDepth2Ped0_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth2Ped1_HE = fs_->make("h_mapDepth2Ped1_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth2Ped2_HE = fs_->make("h_mapDepth2Ped2_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth2Ped3_HE = fs_->make("h_mapDepth2Ped3_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth2Pedw0_HE = fs_->make("h_mapDepth2Pedw0_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth2Pedw1_HE = fs_->make("h_mapDepth2Pedw1_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth2Pedw2_HE = fs_->make("h_mapDepth2Pedw2_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth2Pedw3_HE = fs_->make("h_mapDepth2Pedw3_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth3Ped0_HE = fs_->make("h_mapDepth3Ped0_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth3Ped1_HE = fs_->make("h_mapDepth3Ped1_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth3Ped2_HE = fs_->make("h_mapDepth3Ped2_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth3Ped3_HE = fs_->make("h_mapDepth3Ped3_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth3Pedw0_HE = fs_->make("h_mapDepth3Pedw0_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth3Pedw1_HE = fs_->make("h_mapDepth3Pedw1_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth3Pedw2_HE = fs_->make("h_mapDepth3Pedw2_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth3Pedw3_HE = fs_->make("h_mapDepth3Pedw3_HE", " ", neta, -41., 41., nphi, 0., bphi); + + h_mapDepth1Ped0_HF = fs_->make("h_mapDepth1Ped0_HF", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth1Ped1_HF = fs_->make("h_mapDepth1Ped1_HF", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth1Ped2_HF = fs_->make("h_mapDepth1Ped2_HF", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth1Ped3_HF = fs_->make("h_mapDepth1Ped3_HF", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth1Pedw0_HF = fs_->make("h_mapDepth1Pedw0_HF", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth1Pedw1_HF = fs_->make("h_mapDepth1Pedw1_HF", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth1Pedw2_HF = fs_->make("h_mapDepth1Pedw2_HF", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth1Pedw3_HF = fs_->make("h_mapDepth1Pedw3_HF", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth2Ped0_HF = fs_->make("h_mapDepth2Ped0_HF", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth2Ped1_HF = fs_->make("h_mapDepth2Ped1_HF", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth2Ped2_HF = fs_->make("h_mapDepth2Ped2_HF", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth2Ped3_HF = fs_->make("h_mapDepth2Ped3_HF", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth2Pedw0_HF = fs_->make("h_mapDepth2Pedw0_HF", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth2Pedw1_HF = fs_->make("h_mapDepth2Pedw1_HF", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth2Pedw2_HF = fs_->make("h_mapDepth2Pedw2_HF", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth2Pedw3_HF = fs_->make("h_mapDepth2Pedw3_HF", " ", neta, -41., 41., nphi, 0., bphi); + + h_mapDepth4Ped0_HO = fs_->make("h_mapDepth4Ped0_HO", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth4Ped1_HO = fs_->make("h_mapDepth4Ped1_HO", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth4Ped2_HO = fs_->make("h_mapDepth4Ped2_HO", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth4Ped3_HO = fs_->make("h_mapDepth4Ped3_HO", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth4Pedw0_HO = fs_->make("h_mapDepth4Pedw0_HO", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth4Pedw1_HO = fs_->make("h_mapDepth4Pedw1_HO", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth4Pedw2_HO = fs_->make("h_mapDepth4Pedw2_HO", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth4Pedw3_HO = fs_->make("h_mapDepth4Pedw3_HO", " ", neta, -41., 41., nphi, 0., bphi); //-------------------------------------------------- - h_mapDepth1ADCAmpl12_HB = new TH2F("h_mapDepth1ADCAmpl12_HB", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth2ADCAmpl12_HB = new TH2F("h_mapDepth2ADCAmpl12_HB", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth3ADCAmpl12_HB = new TH2F("h_mapDepth3ADCAmpl12_HB", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth4ADCAmpl12_HB = new TH2F("h_mapDepth4ADCAmpl12_HB", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth1ADCAmpl12_HE = new TH2F("h_mapDepth1ADCAmpl12_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth2ADCAmpl12_HE = new TH2F("h_mapDepth2ADCAmpl12_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth3ADCAmpl12_HE = new TH2F("h_mapDepth3ADCAmpl12_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth4ADCAmpl12_HE = new TH2F("h_mapDepth4ADCAmpl12_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth5ADCAmpl12_HE = new TH2F("h_mapDepth5ADCAmpl12_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth6ADCAmpl12_HE = new TH2F("h_mapDepth6ADCAmpl12_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth7ADCAmpl12_HE = new TH2F("h_mapDepth7ADCAmpl12_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth1ADCAmpl12SiPM_HE = new TH2F("h_mapDepth1ADCAmpl12SiPM_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth2ADCAmpl12SiPM_HE = new TH2F("h_mapDepth2ADCAmpl12SiPM_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth3ADCAmpl12SiPM_HE = new TH2F("h_mapDepth3ADCAmpl12SiPM_HE", " ", neta, -41., 41., nphi, 0., bphi); - - h_mapDepth1ADCAmpl12_HF = new TH2F("h_mapDepth1ADCAmpl12_HF", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth2ADCAmpl12_HF = new TH2F("h_mapDepth2ADCAmpl12_HF", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth3ADCAmpl12_HF = new TH2F("h_mapDepth3ADCAmpl12_HF", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth4ADCAmpl12_HF = new TH2F("h_mapDepth4ADCAmpl12_HF", " ", neta, -41., 41., nphi, 0., bphi); - - h_mapDepth4ADCAmpl12_HO = new TH2F("h_mapDepth4ADCAmpl12_HO", " ", neta, -41., 41., nphi, 0., bphi); - - h_mapDepth1linADCAmpl12_HE = new TH2F("h_mapDepth1linADCAmpl12_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth2linADCAmpl12_HE = new TH2F("h_mapDepth2linADCAmpl12_HE", " ", neta, -41., 41., nphi, 0., bphi); - h_mapDepth3linADCAmpl12_HE = new TH2F("h_mapDepth3linADCAmpl12_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth1ADCAmpl12_HB = fs_->make("h_mapDepth1ADCAmpl12_HB", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth2ADCAmpl12_HB = fs_->make("h_mapDepth2ADCAmpl12_HB", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth3ADCAmpl12_HB = fs_->make("h_mapDepth3ADCAmpl12_HB", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth4ADCAmpl12_HB = fs_->make("h_mapDepth4ADCAmpl12_HB", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth1ADCAmpl12_HE = fs_->make("h_mapDepth1ADCAmpl12_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth2ADCAmpl12_HE = fs_->make("h_mapDepth2ADCAmpl12_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth3ADCAmpl12_HE = fs_->make("h_mapDepth3ADCAmpl12_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth4ADCAmpl12_HE = fs_->make("h_mapDepth4ADCAmpl12_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth5ADCAmpl12_HE = fs_->make("h_mapDepth5ADCAmpl12_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth6ADCAmpl12_HE = fs_->make("h_mapDepth6ADCAmpl12_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth7ADCAmpl12_HE = fs_->make("h_mapDepth7ADCAmpl12_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth1ADCAmpl12SiPM_HE = fs_->make("h_mapDepth1ADCAmpl12SiPM_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth2ADCAmpl12SiPM_HE = fs_->make("h_mapDepth2ADCAmpl12SiPM_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth3ADCAmpl12SiPM_HE = fs_->make("h_mapDepth3ADCAmpl12SiPM_HE", " ", neta, -41., 41., nphi, 0., bphi); + + h_mapDepth1ADCAmpl12_HF = fs_->make("h_mapDepth1ADCAmpl12_HF", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth2ADCAmpl12_HF = fs_->make("h_mapDepth2ADCAmpl12_HF", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth3ADCAmpl12_HF = fs_->make("h_mapDepth3ADCAmpl12_HF", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth4ADCAmpl12_HF = fs_->make("h_mapDepth4ADCAmpl12_HF", " ", neta, -41., 41., nphi, 0., bphi); + + h_mapDepth4ADCAmpl12_HO = fs_->make("h_mapDepth4ADCAmpl12_HO", " ", neta, -41., 41., nphi, 0., bphi); + + h_mapDepth1linADCAmpl12_HE = fs_->make("h_mapDepth1linADCAmpl12_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth2linADCAmpl12_HE = fs_->make("h_mapDepth2linADCAmpl12_HE", " ", neta, -41., 41., nphi, 0., bphi); + h_mapDepth3linADCAmpl12_HE = fs_->make("h_mapDepth3linADCAmpl12_HE", " ", neta, -41., 41., nphi, 0., bphi); //-------------------------------------------------- h_mapGetRMSOverNormalizedSignal_HB = - new TH2F("h_mapGetRMSOverNormalizedSignal_HB", " ", neta, -41., 41., nphi, 0., bphi); + fs_->make("h_mapGetRMSOverNormalizedSignal_HB", " ", neta, -41., 41., nphi, 0., bphi); h_mapGetRMSOverNormalizedSignal0_HB = - new TH2F("h_mapGetRMSOverNormalizedSignal0_HB", " ", neta, -41., 41., nphi, 0., bphi); + fs_->make("h_mapGetRMSOverNormalizedSignal0_HB", " ", neta, -41., 41., nphi, 0., bphi); h_mapGetRMSOverNormalizedSignal_HE = - new TH2F("h_mapGetRMSOverNormalizedSignal_HE", " ", neta, -41., 41., nphi, 0., bphi); + fs_->make("h_mapGetRMSOverNormalizedSignal_HE", " ", neta, -41., 41., nphi, 0., bphi); h_mapGetRMSOverNormalizedSignal0_HE = - new TH2F("h_mapGetRMSOverNormalizedSignal0_HE", " ", neta, -41., 41., nphi, 0., bphi); + fs_->make("h_mapGetRMSOverNormalizedSignal0_HE", " ", neta, -41., 41., nphi, 0., bphi); h_mapGetRMSOverNormalizedSignal_HF = - new TH2F("h_mapGetRMSOverNormalizedSignal_HF", " ", neta, -41., 41., nphi, 0., bphi); + fs_->make("h_mapGetRMSOverNormalizedSignal_HF", " ", neta, -41., 41., nphi, 0., bphi); h_mapGetRMSOverNormalizedSignal0_HF = - new TH2F("h_mapGetRMSOverNormalizedSignal0_HF", " ", neta, -41., 41., nphi, 0., bphi); + fs_->make("h_mapGetRMSOverNormalizedSignal0_HF", " ", neta, -41., 41., nphi, 0., bphi); h_mapGetRMSOverNormalizedSignal_HO = - new TH2F("h_mapGetRMSOverNormalizedSignal_HO", " ", neta, -41., 41., nphi, 0., bphi); + fs_->make("h_mapGetRMSOverNormalizedSignal_HO", " ", neta, -41., 41., nphi, 0., bphi); h_mapGetRMSOverNormalizedSignal0_HO = - new TH2F("h_mapGetRMSOverNormalizedSignal0_HO", " ", neta, -41., 41., nphi, 0., bphi); + fs_->make("h_mapGetRMSOverNormalizedSignal0_HO", " ", neta, -41., 41., nphi, 0., bphi); //-------------------------------------------------- - h_shape_Ahigh_HB0 = new TH1F("h_shape_Ahigh_HB0", " ", 10, 0., 10.); - h_shape0_Ahigh_HB0 = new TH1F("h_shape0_Ahigh_HB0", " ", 10, 0., 10.); - h_shape_Alow_HB0 = new TH1F("h_shape_Alow_HB0", " ", 10, 0., 10.); - h_shape0_Alow_HB0 = new TH1F("h_shape0_Alow_HB0", " ", 10, 0., 10.); - h_shape_Ahigh_HB1 = new TH1F("h_shape_Ahigh_HB1", " ", 10, 0., 10.); - h_shape0_Ahigh_HB1 = new TH1F("h_shape0_Ahigh_HB1", " ", 10, 0., 10.); - h_shape_Alow_HB1 = new TH1F("h_shape_Alow_HB1", " ", 10, 0., 10.); - h_shape0_Alow_HB1 = new TH1F("h_shape0_Alow_HB1", " ", 10, 0., 10.); - h_shape_Ahigh_HB2 = new TH1F("h_shape_Ahigh_HB2", " ", 10, 0., 10.); - h_shape0_Ahigh_HB2 = new TH1F("h_shape0_Ahigh_HB2", " ", 10, 0., 10.); - h_shape_Alow_HB2 = new TH1F("h_shape_Alow_HB2", " ", 10, 0., 10.); - h_shape0_Alow_HB2 = new TH1F("h_shape0_Alow_HB2", " ", 10, 0., 10.); - h_shape_Ahigh_HB3 = new TH1F("h_shape_Ahigh_HB3", " ", 10, 0., 10.); - h_shape0_Ahigh_HB3 = new TH1F("h_shape0_Ahigh_HB3", " ", 10, 0., 10.); - h_shape_Alow_HB3 = new TH1F("h_shape_Alow_HB3", " ", 10, 0., 10.); - h_shape0_Alow_HB3 = new TH1F("h_shape0_Alow_HB3", " ", 10, 0., 10.); + h_shape_Ahigh_HB0 = fs_->make("h_shape_Ahigh_HB0", " ", 10, 0., 10.); + h_shape0_Ahigh_HB0 = fs_->make("h_shape0_Ahigh_HB0", " ", 10, 0., 10.); + h_shape_Alow_HB0 = fs_->make("h_shape_Alow_HB0", " ", 10, 0., 10.); + h_shape0_Alow_HB0 = fs_->make("h_shape0_Alow_HB0", " ", 10, 0., 10.); + h_shape_Ahigh_HB1 = fs_->make("h_shape_Ahigh_HB1", " ", 10, 0., 10.); + h_shape0_Ahigh_HB1 = fs_->make("h_shape0_Ahigh_HB1", " ", 10, 0., 10.); + h_shape_Alow_HB1 = fs_->make("h_shape_Alow_HB1", " ", 10, 0., 10.); + h_shape0_Alow_HB1 = fs_->make("h_shape0_Alow_HB1", " ", 10, 0., 10.); + h_shape_Ahigh_HB2 = fs_->make("h_shape_Ahigh_HB2", " ", 10, 0., 10.); + h_shape0_Ahigh_HB2 = fs_->make("h_shape0_Ahigh_HB2", " ", 10, 0., 10.); + h_shape_Alow_HB2 = fs_->make("h_shape_Alow_HB2", " ", 10, 0., 10.); + h_shape0_Alow_HB2 = fs_->make("h_shape0_Alow_HB2", " ", 10, 0., 10.); + h_shape_Ahigh_HB3 = fs_->make("h_shape_Ahigh_HB3", " ", 10, 0., 10.); + h_shape0_Ahigh_HB3 = fs_->make("h_shape0_Ahigh_HB3", " ", 10, 0., 10.); + h_shape_Alow_HB3 = fs_->make("h_shape_Alow_HB3", " ", 10, 0., 10.); + h_shape0_Alow_HB3 = fs_->make("h_shape0_Alow_HB3", " ", 10, 0., 10.); //-------------------------------------------------- - h_shape_bad_channels_HB = new TH1F("h_shape_bad_channels_HB", " ", 10, 0., 10.); - h_shape0_bad_channels_HB = new TH1F("h_shape0_bad_channels_HB", " ", 10, 0., 10.); - h_shape_good_channels_HB = new TH1F("h_shape_good_channels_HB", " ", 10, 0., 10.); - h_shape0_good_channels_HB = new TH1F("h_shape0_good_channels_HB", " ", 10, 0., 10.); - h_shape_bad_channels_HE = new TH1F("h_shape_bad_channels_HE", " ", 10, 0., 10.); - h_shape0_bad_channels_HE = new TH1F("h_shape0_bad_channels_HE", " ", 10, 0., 10.); - h_shape_good_channels_HE = new TH1F("h_shape_good_channels_HE", " ", 10, 0., 10.); - h_shape0_good_channels_HE = new TH1F("h_shape0_good_channels_HE", " ", 10, 0., 10.); - h_shape_bad_channels_HF = new TH1F("h_shape_bad_channels_HF", " ", 10, 0., 10.); - h_shape0_bad_channels_HF = new TH1F("h_shape0_bad_channels_HF", " ", 10, 0., 10.); - h_shape_good_channels_HF = new TH1F("h_shape_good_channels_HF", " ", 10, 0., 10.); - h_shape0_good_channels_HF = new TH1F("h_shape0_good_channels_HF", " ", 10, 0., 10.); - h_shape_bad_channels_HO = new TH1F("h_shape_bad_channels_HO", " ", 10, 0., 10.); - h_shape0_bad_channels_HO = new TH1F("h_shape0_bad_channels_HO", " ", 10, 0., 10.); - h_shape_good_channels_HO = new TH1F("h_shape_good_channels_HO", " ", 10, 0., 10.); - h_shape0_good_channels_HO = new TH1F("h_shape0_good_channels_HO", " ", 10, 0., 10.); + h_shape_bad_channels_HB = fs_->make("h_shape_bad_channels_HB", " ", 10, 0., 10.); + h_shape0_bad_channels_HB = fs_->make("h_shape0_bad_channels_HB", " ", 10, 0., 10.); + h_shape_good_channels_HB = fs_->make("h_shape_good_channels_HB", " ", 10, 0., 10.); + h_shape0_good_channels_HB = fs_->make("h_shape0_good_channels_HB", " ", 10, 0., 10.); + h_shape_bad_channels_HE = fs_->make("h_shape_bad_channels_HE", " ", 10, 0., 10.); + h_shape0_bad_channels_HE = fs_->make("h_shape0_bad_channels_HE", " ", 10, 0., 10.); + h_shape_good_channels_HE = fs_->make("h_shape_good_channels_HE", " ", 10, 0., 10.); + h_shape0_good_channels_HE = fs_->make("h_shape0_good_channels_HE", " ", 10, 0., 10.); + h_shape_bad_channels_HF = fs_->make("h_shape_bad_channels_HF", " ", 10, 0., 10.); + h_shape0_bad_channels_HF = fs_->make("h_shape0_bad_channels_HF", " ", 10, 0., 10.); + h_shape_good_channels_HF = fs_->make("h_shape_good_channels_HF", " ", 10, 0., 10.); + h_shape0_good_channels_HF = fs_->make("h_shape0_good_channels_HF", " ", 10, 0., 10.); + h_shape_bad_channels_HO = fs_->make("h_shape_bad_channels_HO", " ", 10, 0., 10.); + h_shape0_bad_channels_HO = fs_->make("h_shape0_bad_channels_HO", " ", 10, 0., 10.); + h_shape_good_channels_HO = fs_->make("h_shape_good_channels_HO", " ", 10, 0., 10.); + h_shape0_good_channels_HO = fs_->make("h_shape0_good_channels_HO", " ", 10, 0., 10.); //-------------------------------------------------- // if(flagcpuoptimization_== 0 ) { int spl = 1000; float spls = 5000; - h_sumamplitude_depth1_HB = new TH1F("h_sumamplitude_depth1_HB", " ", spl, 0., spls); - h_sumamplitude_depth2_HB = new TH1F("h_sumamplitude_depth2_HB", " ", spl, 0., spls); - h_sumamplitude_depth1_HE = new TH1F("h_sumamplitude_depth1_HE", " ", spl, 0., spls); - h_sumamplitude_depth2_HE = new TH1F("h_sumamplitude_depth2_HE", " ", spl, 0., spls); - h_sumamplitude_depth3_HE = new TH1F("h_sumamplitude_depth3_HE", " ", spl, 0., spls); - h_sumamplitude_depth1_HF = new TH1F("h_sumamplitude_depth1_HF", " ", spl, 0., spls); - h_sumamplitude_depth2_HF = new TH1F("h_sumamplitude_depth2_HF", " ", spl, 0., spls); - h_sumamplitude_depth4_HO = new TH1F("h_sumamplitude_depth4_HO", " ", spl, 0., spls); + h_sumamplitude_depth1_HB = fs_->make("h_sumamplitude_depth1_HB", " ", spl, 0., spls); + h_sumamplitude_depth2_HB = fs_->make("h_sumamplitude_depth2_HB", " ", spl, 0., spls); + h_sumamplitude_depth1_HE = fs_->make("h_sumamplitude_depth1_HE", " ", spl, 0., spls); + h_sumamplitude_depth2_HE = fs_->make("h_sumamplitude_depth2_HE", " ", spl, 0., spls); + h_sumamplitude_depth3_HE = fs_->make("h_sumamplitude_depth3_HE", " ", spl, 0., spls); + h_sumamplitude_depth1_HF = fs_->make("h_sumamplitude_depth1_HF", " ", spl, 0., spls); + h_sumamplitude_depth2_HF = fs_->make("h_sumamplitude_depth2_HF", " ", spl, 0., spls); + h_sumamplitude_depth4_HO = fs_->make("h_sumamplitude_depth4_HO", " ", spl, 0., spls); int spl0 = 1000; float spls0 = 10000; - h_sumamplitude_depth1_HB0 = new TH1F("h_sumamplitude_depth1_HB0", " ", spl0, 0., spls0); - h_sumamplitude_depth2_HB0 = new TH1F("h_sumamplitude_depth2_HB0", " ", spl0, 0., spls0); - h_sumamplitude_depth1_HE0 = new TH1F("h_sumamplitude_depth1_HE0", " ", spl0, 0., spls0); - h_sumamplitude_depth2_HE0 = new TH1F("h_sumamplitude_depth2_HE0", " ", spl0, 0., spls0); - h_sumamplitude_depth3_HE0 = new TH1F("h_sumamplitude_depth3_HE0", " ", spl0, 0., spls0); - h_sumamplitude_depth1_HF0 = new TH1F("h_sumamplitude_depth1_HF0", " ", spl0, 0., spls0); - h_sumamplitude_depth2_HF0 = new TH1F("h_sumamplitude_depth2_HF0", " ", spl0, 0., spls0); - h_sumamplitude_depth4_HO0 = new TH1F("h_sumamplitude_depth4_HO0", " ", spl0, 0., spls0); + h_sumamplitude_depth1_HB0 = fs_->make("h_sumamplitude_depth1_HB0", " ", spl0, 0., spls0); + h_sumamplitude_depth2_HB0 = fs_->make("h_sumamplitude_depth2_HB0", " ", spl0, 0., spls0); + h_sumamplitude_depth1_HE0 = fs_->make("h_sumamplitude_depth1_HE0", " ", spl0, 0., spls0); + h_sumamplitude_depth2_HE0 = fs_->make("h_sumamplitude_depth2_HE0", " ", spl0, 0., spls0); + h_sumamplitude_depth3_HE0 = fs_->make("h_sumamplitude_depth3_HE0", " ", spl0, 0., spls0); + h_sumamplitude_depth1_HF0 = fs_->make("h_sumamplitude_depth1_HF0", " ", spl0, 0., spls0); + h_sumamplitude_depth2_HF0 = fs_->make("h_sumamplitude_depth2_HF0", " ", spl0, 0., spls0); + h_sumamplitude_depth4_HO0 = fs_->make("h_sumamplitude_depth4_HO0", " ", spl0, 0., spls0); int spl1 = 1000; float spls1 = 100000; - h_sumamplitude_depth1_HB1 = new TH1F("h_sumamplitude_depth1_HB1", " ", spl1, 0., spls1); - h_sumamplitude_depth2_HB1 = new TH1F("h_sumamplitude_depth2_HB1", " ", spl1, 0., spls1); - h_sumamplitude_depth1_HE1 = new TH1F("h_sumamplitude_depth1_HE1", " ", spl1, 0., spls1); - h_sumamplitude_depth2_HE1 = new TH1F("h_sumamplitude_depth2_HE1", " ", spl1, 0., spls1); - h_sumamplitude_depth3_HE1 = new TH1F("h_sumamplitude_depth3_HE1", " ", spl1, 0., spls1); - h_sumamplitude_depth1_HF1 = new TH1F("h_sumamplitude_depth1_HF1", " ", spl1, 0., spls1); - h_sumamplitude_depth2_HF1 = new TH1F("h_sumamplitude_depth2_HF1", " ", spl1, 0., spls1); - h_sumamplitude_depth4_HO1 = new TH1F("h_sumamplitude_depth4_HO1", " ", spl1, 0., spls1); - - h_Amplitude_forCapIdErrors_HB1 = new TH1F("h_Amplitude_forCapIdErrors_HB1", " ", 100, 0., 30000.); - h_Amplitude_forCapIdErrors_HB2 = new TH1F("h_Amplitude_forCapIdErrors_HB2", " ", 100, 0., 30000.); - h_Amplitude_forCapIdErrors_HE1 = new TH1F("h_Amplitude_forCapIdErrors_HE1", " ", 100, 0., 30000.); - h_Amplitude_forCapIdErrors_HE2 = new TH1F("h_Amplitude_forCapIdErrors_HE2", " ", 100, 0., 30000.); - h_Amplitude_forCapIdErrors_HE3 = new TH1F("h_Amplitude_forCapIdErrors_HE3", " ", 100, 0., 30000.); - h_Amplitude_forCapIdErrors_HF1 = new TH1F("h_Amplitude_forCapIdErrors_HF1", " ", 100, 0., 30000.); - h_Amplitude_forCapIdErrors_HF2 = new TH1F("h_Amplitude_forCapIdErrors_HF2", " ", 100, 0., 30000.); - h_Amplitude_forCapIdErrors_HO4 = new TH1F("h_Amplitude_forCapIdErrors_HO4", " ", 100, 0., 30000.); - - h_Amplitude_notCapIdErrors_HB1 = new TH1F("h_Amplitude_notCapIdErrors_HB1", " ", 100, 0., 30000.); - h_Amplitude_notCapIdErrors_HB2 = new TH1F("h_Amplitude_notCapIdErrors_HB2", " ", 100, 0., 30000.); - h_Amplitude_notCapIdErrors_HE1 = new TH1F("h_Amplitude_notCapIdErrors_HE1", " ", 100, 0., 30000.); - h_Amplitude_notCapIdErrors_HE2 = new TH1F("h_Amplitude_notCapIdErrors_HE2", " ", 100, 0., 30000.); - h_Amplitude_notCapIdErrors_HE3 = new TH1F("h_Amplitude_notCapIdErrors_HE3", " ", 100, 0., 30000.); - h_Amplitude_notCapIdErrors_HF1 = new TH1F("h_Amplitude_notCapIdErrors_HF1", " ", 100, 0., 30000.); - h_Amplitude_notCapIdErrors_HF2 = new TH1F("h_Amplitude_notCapIdErrors_HF2", " ", 100, 0., 30000.); - h_Amplitude_notCapIdErrors_HO4 = new TH1F("h_Amplitude_notCapIdErrors_HO4", " ", 100, 0., 30000.); - - h_2DAtaildepth1_HB = new TH2F("h_2DAtaildepth1_HB", " ", neta, -41., 41., nphi, 0., bphi); - h_2D0Ataildepth1_HB = new TH2F("h_2D0Ataildepth1_HB", " ", neta, -41., 41., nphi, 0., bphi); - h_2DAtaildepth2_HB = new TH2F("h_2DAtaildepth2_HB", " ", neta, -41., 41., nphi, 0., bphi); - h_2D0Ataildepth2_HB = new TH2F("h_2D0Ataildepth2_HB", " ", neta, -41., 41., nphi, 0., bphi); + h_sumamplitude_depth1_HB1 = fs_->make("h_sumamplitude_depth1_HB1", " ", spl1, 0., spls1); + h_sumamplitude_depth2_HB1 = fs_->make("h_sumamplitude_depth2_HB1", " ", spl1, 0., spls1); + h_sumamplitude_depth1_HE1 = fs_->make("h_sumamplitude_depth1_HE1", " ", spl1, 0., spls1); + h_sumamplitude_depth2_HE1 = fs_->make("h_sumamplitude_depth2_HE1", " ", spl1, 0., spls1); + h_sumamplitude_depth3_HE1 = fs_->make("h_sumamplitude_depth3_HE1", " ", spl1, 0., spls1); + h_sumamplitude_depth1_HF1 = fs_->make("h_sumamplitude_depth1_HF1", " ", spl1, 0., spls1); + h_sumamplitude_depth2_HF1 = fs_->make("h_sumamplitude_depth2_HF1", " ", spl1, 0., spls1); + h_sumamplitude_depth4_HO1 = fs_->make("h_sumamplitude_depth4_HO1", " ", spl1, 0., spls1); + + h_Amplitude_forCapIdErrors_HB1 = fs_->make("h_Amplitude_forCapIdErrors_HB1", " ", 100, 0., 30000.); + h_Amplitude_forCapIdErrors_HB2 = fs_->make("h_Amplitude_forCapIdErrors_HB2", " ", 100, 0., 30000.); + h_Amplitude_forCapIdErrors_HE1 = fs_->make("h_Amplitude_forCapIdErrors_HE1", " ", 100, 0., 30000.); + h_Amplitude_forCapIdErrors_HE2 = fs_->make("h_Amplitude_forCapIdErrors_HE2", " ", 100, 0., 30000.); + h_Amplitude_forCapIdErrors_HE3 = fs_->make("h_Amplitude_forCapIdErrors_HE3", " ", 100, 0., 30000.); + h_Amplitude_forCapIdErrors_HF1 = fs_->make("h_Amplitude_forCapIdErrors_HF1", " ", 100, 0., 30000.); + h_Amplitude_forCapIdErrors_HF2 = fs_->make("h_Amplitude_forCapIdErrors_HF2", " ", 100, 0., 30000.); + h_Amplitude_forCapIdErrors_HO4 = fs_->make("h_Amplitude_forCapIdErrors_HO4", " ", 100, 0., 30000.); + + h_Amplitude_notCapIdErrors_HB1 = fs_->make("h_Amplitude_notCapIdErrors_HB1", " ", 100, 0., 30000.); + h_Amplitude_notCapIdErrors_HB2 = fs_->make("h_Amplitude_notCapIdErrors_HB2", " ", 100, 0., 30000.); + h_Amplitude_notCapIdErrors_HE1 = fs_->make("h_Amplitude_notCapIdErrors_HE1", " ", 100, 0., 30000.); + h_Amplitude_notCapIdErrors_HE2 = fs_->make("h_Amplitude_notCapIdErrors_HE2", " ", 100, 0., 30000.); + h_Amplitude_notCapIdErrors_HE3 = fs_->make("h_Amplitude_notCapIdErrors_HE3", " ", 100, 0., 30000.); + h_Amplitude_notCapIdErrors_HF1 = fs_->make("h_Amplitude_notCapIdErrors_HF1", " ", 100, 0., 30000.); + h_Amplitude_notCapIdErrors_HF2 = fs_->make("h_Amplitude_notCapIdErrors_HF2", " ", 100, 0., 30000.); + h_Amplitude_notCapIdErrors_HO4 = fs_->make("h_Amplitude_notCapIdErrors_HO4", " ", 100, 0., 30000.); + + h_2DAtaildepth1_HB = fs_->make("h_2DAtaildepth1_HB", " ", neta, -41., 41., nphi, 0., bphi); + h_2D0Ataildepth1_HB = fs_->make("h_2D0Ataildepth1_HB", " ", neta, -41., 41., nphi, 0., bphi); + h_2DAtaildepth2_HB = fs_->make("h_2DAtaildepth2_HB", " ", neta, -41., 41., nphi, 0., bphi); + h_2D0Ataildepth2_HB = fs_->make("h_2D0Ataildepth2_HB", " ", neta, -41., 41., nphi, 0., bphi); //////////////////////////////////////////////////////////////////////////////////// } //if(recordHistoes_ if (verbosity > 0) - cout << "======================== booking DONE +++++++++++++++++++++++++++" << endl; + std::cout << "======================== booking DONE +++++++++++++++++++++++++++" << std::endl; /////////////////////////////////////////////////////// ntuples: if (recordNtuples_) { - myTree = new TTree("Hcal", "Hcal Tree"); + myTree = fs_->make("Hcal", "Hcal Tree"); myTree->Branch("Nevent", &Nevent, "Nevent/I"); myTree->Branch("Run", &Run, "Run/I"); } //if(recordNtuples_ if (verbosity > 0) - cout << "======================== beignJob finish +++++++++++++++++++++++++++" << endl; + std::cout << "======================== beignJob finish +++++++++++++++++++++++++++" << std::endl; ////////////////////////////////////////////////////////////////// } @@ -12452,10 +11184,8 @@ void CMTRawAnalyzer::fillDigiAmplitudeHFQIE10(QIE10DataFrame qie10df) { if (mdepth > 2 && flagupgradeqie1011_ == 9) return; ///////////////////////////////////////////////////////////////// - // HcalCalibrations calib = conditions->getHcalCalibrations(hcaldetid); const HcalPedestal* pedestal00 = conditions->getPedestal(hcaldetid); const HcalGain* gain = conditions->getGain(hcaldetid); - // const HcalGainWidth* gainWidth = conditions->getGainWidth(hcaldetid); const HcalRespCorr* respcorr = conditions->getHcalRespCorr(hcaldetid); const HcalTimeCorr* timecorr = conditions->getHcalTimeCorr(hcaldetid); const HcalLUTCorr* lutcorr = conditions->getHcalLUTCorr(hcaldetid); @@ -14687,6 +13417,52 @@ void CMTRawAnalyzer::fillMAP() { std::cout << "===== Finish writing Channel MAP =====" << std::endl; } +double CMTRawAnalyzer::dR(double eta1, double phi1, double eta2, double phi2) { + double deltaphi = phi1 - phi2; + if (phi2 > phi1) { + deltaphi = phi2 - phi1; + } + if (deltaphi > M_PI) { + deltaphi = 2. * M_PI - deltaphi; + } + double deltaeta = eta2 - eta1; + double tmp = sqrt(deltaeta * deltaeta + deltaphi * deltaphi); + return tmp; +} + +double CMTRawAnalyzer::phi12(double phi1, double en1, double phi2, double en2) { + // weighted mean value of phi1 and phi2 + + double a1 = phi1; + double a2 = phi2; + + if (a1 > 0.5 * M_PI && a2 < 0.) + a2 += 2 * M_PI; + if (a2 > 0.5 * M_PI && a1 < 0.) + a1 += 2 * M_PI; + double tmp = (a1 * en1 + a2 * en2) / (en1 + en2); + if (tmp > M_PI) + tmp -= 2. * M_PI; + + return tmp; +} + +double CMTRawAnalyzer::dPhiWsign(double phi1, double phi2) { + // clockwise phi2 w.r.t phi1 means "+" phi distance + // anti-clockwise phi2 w.r.t phi1 means "-" phi distance + + double a1 = phi1; + double a2 = phi2; + double tmp = a2 - a1; + if (a1 * a2 < 0.) { + if (a1 > 0.5 * M_PI) + tmp += 2. * M_PI; + if (a2 > 0.5 * M_PI) + tmp -= 2. * M_PI; + } + return tmp; +} + /////////////////////////////// ------------------------------------------------------------------- /////////////////////////////// ------------------------------------------------------------------- //define this as a plug-in diff --git a/DPGAnalysis/HcalTools/test/remoteMonitoring_LED_eraTEST2019_cfg.py b/DPGAnalysis/HcalTools/test/remoteMonitoring_LED_eraTEST2019_cfg.py index b871d7ab03e5a..e9f12c0043c6d 100644 --- a/DPGAnalysis/HcalTools/test/remoteMonitoring_LED_eraTEST2019_cfg.py +++ b/DPGAnalysis/HcalTools/test/remoteMonitoring_LED_eraTEST2019_cfg.py @@ -379,6 +379,10 @@ 'RespCorrs') ) +process.TFileService = cms.Service("TFileService", + fileName = cms.string(histodir+'/LED_'+runnumber+'.root') + ) + process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff") from Configuration.AlCa.autoCond import autoCond # 2018: diff --git a/DPGAnalysis/Skims/interface/BeamSplash.h b/DPGAnalysis/Skims/interface/BeamSplash.h index 1b76149e447e0..d2ed149274934 100644 --- a/DPGAnalysis/Skims/interface/BeamSplash.h +++ b/DPGAnalysis/Skims/interface/BeamSplash.h @@ -17,7 +17,7 @@ // user include files #include "FWCore/Utilities/interface/InputTag.h" #include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/EDFilter.h" +#include "FWCore/Framework/interface/stream/EDFilter.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/MakerMacros.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" @@ -28,7 +28,7 @@ // class declaration // -class BeamSplash : public edm::EDFilter { +class BeamSplash : public edm::stream::EDFilter<> { public: explicit BeamSplash(const edm::ParameterSet &); ~BeamSplash() override; diff --git a/DPGAnalysis/Skims/interface/CSCSkim.h b/DPGAnalysis/Skims/interface/CSCSkim.h index b303c4caba8a2..16c5424463854 100644 --- a/DPGAnalysis/Skims/interface/CSCSkim.h +++ b/DPGAnalysis/Skims/interface/CSCSkim.h @@ -20,7 +20,7 @@ #include "FWCore/Framework/interface/MakerMacros.h" #include "FWCore/Framework/interface/Frameworkfwd.h" #include "FWCore/Framework/interface/EDAnalyzer.h" -#include "FWCore/Framework/interface/EDFilter.h" +#include "FWCore/Framework/interface/one/EDFilter.h" #include "FWCore/Framework/interface/Event.h" #include "DataFormats/Common/interface/Handle.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" @@ -69,7 +69,7 @@ #include "TString.h" #include "TTree.h" -class CSCSkim : public edm::EDFilter { +class CSCSkim : public edm::one::EDFilter<> { public: // Constructor explicit CSCSkim(const edm::ParameterSet &pset); @@ -137,6 +137,9 @@ class CSCSkim : public edm::EDFilter { std::string outputFileName; std::string histogramFileName; + // es token names + const edm::ESGetToken m_CSCGeomToken; + // token names edm::EDGetTokenT wds_token; edm::EDGetTokenT sds_token; diff --git a/DPGAnalysis/Skims/interface/ECALActivity.h b/DPGAnalysis/Skims/interface/ECALActivity.h index 3d43bae77cf0c..89a4620c56dfc 100644 --- a/DPGAnalysis/Skims/interface/ECALActivity.h +++ b/DPGAnalysis/Skims/interface/ECALActivity.h @@ -17,7 +17,7 @@ // user include files #include "FWCore/Utilities/interface/InputTag.h" #include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/EDFilter.h" +#include "FWCore/Framework/interface/stream/EDFilter.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/MakerMacros.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" @@ -28,7 +28,7 @@ // class declaration // -class ECALActivity : public edm::EDFilter { +class ECALActivity : public edm::stream::EDFilter<> { public: explicit ECALActivity(const edm::ParameterSet &); ~ECALActivity() override; diff --git a/DPGAnalysis/Skims/interface/EcalSkim.h b/DPGAnalysis/Skims/interface/EcalSkim.h index 5012e9f976de7..e4680e20d0573 100644 --- a/DPGAnalysis/Skims/interface/EcalSkim.h +++ b/DPGAnalysis/Skims/interface/EcalSkim.h @@ -22,7 +22,7 @@ // user include files #include "FWCore/Utilities/interface/InputTag.h" #include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/EDFilter.h" +#include "FWCore/Framework/interface/stream/EDFilter.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/MakerMacros.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" @@ -41,7 +41,7 @@ class TFile; -class EcalSkim : public edm::EDFilter { +class EcalSkim : public edm::stream::EDFilter<> { public: explicit EcalSkim(const edm::ParameterSet &); ~EcalSkim() override; diff --git a/DPGAnalysis/Skims/interface/EcalTangentFilter.h b/DPGAnalysis/Skims/interface/EcalTangentFilter.h index a55fd1cdccc15..cbcdc7ceaed76 100644 --- a/DPGAnalysis/Skims/interface/EcalTangentFilter.h +++ b/DPGAnalysis/Skims/interface/EcalTangentFilter.h @@ -3,31 +3,29 @@ // user include files #include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/EDFilter.h" +#include "FWCore/Framework/interface/stream/EDFilter.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/MakerMacros.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" -#include -#include -#include -#include +#include "DataFormats/TrackReco/interface/Track.h" +#include "DataFormats/TrackReco/interface/TrackBase.h" +#include "DataFormats/MuonReco/interface/Muon.h" +#include "DataFormats/MuonReco/interface/MuonFwd.h" // // class declaration // -class EcalTangentFilter : public edm::EDFilter { +class EcalTangentFilter : public edm::stream::EDFilter<> { public: explicit EcalTangentFilter(const edm::ParameterSet&); ~EcalTangentFilter() override; private: - void beginJob() override; bool filter(edm::Event&, const edm::EventSetup&) override; - void endJob() override; // ----------member data --------------------------- int fNgood, fNtot, fEvt; diff --git a/DPGAnalysis/Skims/interface/FilterOutScraping.h b/DPGAnalysis/Skims/interface/FilterOutScraping.h index c48ab634c8773..673bbe9c9f70e 100644 --- a/DPGAnalysis/Skims/interface/FilterOutScraping.h +++ b/DPGAnalysis/Skims/interface/FilterOutScraping.h @@ -17,7 +17,7 @@ // user include files #include "FWCore/Utilities/interface/InputTag.h" #include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/EDFilter.h" +#include "FWCore/Framework/interface/stream/EDFilter.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/MakerMacros.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" @@ -30,7 +30,7 @@ // class declaration // -class FilterOutScraping : public edm::EDFilter { +class FilterOutScraping : public edm::stream::EDFilter<> { public: explicit FilterOutScraping(const edm::ParameterSet &); ~FilterOutScraping() override; diff --git a/DPGAnalysis/Skims/interface/FilterScrapingPixelProbability.h b/DPGAnalysis/Skims/interface/FilterScrapingPixelProbability.h index cf3075f9cbe10..c3494050cd43c 100644 --- a/DPGAnalysis/Skims/interface/FilterScrapingPixelProbability.h +++ b/DPGAnalysis/Skims/interface/FilterScrapingPixelProbability.h @@ -27,7 +27,7 @@ // user include files #include "FWCore/Utilities/interface/InputTag.h" #include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/EDFilter.h" +#include "FWCore/Framework/interface/stream/EDFilter.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/MakerMacros.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" @@ -39,7 +39,7 @@ #include "DataFormats/TrackerRecHit2D/interface/SiPixelRecHit.h" #include "DataFormats/SiPixelDetId/interface/PixelSubdetector.h" -class FilterScrapingPixelProbability : public edm::EDFilter { +class FilterScrapingPixelProbability : public edm::stream::EDFilter<> { public: explicit FilterScrapingPixelProbability(const edm::ParameterSet &); ~FilterScrapingPixelProbability() override; diff --git a/DPGAnalysis/Skims/interface/HLTInspect.h b/DPGAnalysis/Skims/interface/HLTInspect.h index 4ad12849c9ee4..18ec2753b6ec9 100644 --- a/DPGAnalysis/Skims/interface/HLTInspect.h +++ b/DPGAnalysis/Skims/interface/HLTInspect.h @@ -17,7 +17,7 @@ // user include files #include "FWCore/Utilities/interface/InputTag.h" #include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/EDAnalyzer.h" +#include "FWCore/Framework/interface/one/EDAnalyzer.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/MakerMacros.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" @@ -28,7 +28,7 @@ // class declaration // -class HLTInspect : public edm::EDAnalyzer { +class HLTInspect : public edm::one::EDAnalyzer<> { public: explicit HLTInspect(const edm::ParameterSet&); ~HLTInspect() override; diff --git a/DPGAnalysis/Skims/interface/MatchedProbeMaker.h b/DPGAnalysis/Skims/interface/MatchedProbeMaker.h index 7698a64111b40..97ac94e95cb2a 100644 --- a/DPGAnalysis/Skims/interface/MatchedProbeMaker.h +++ b/DPGAnalysis/Skims/interface/MatchedProbeMaker.h @@ -16,7 +16,7 @@ #include "DataFormats/Candidate/interface/Candidate.h" #include "DataFormats/Candidate/interface/CandMatchMap.h" #include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/EDProducer.h" +#include "FWCore/Framework/interface/one/EDProducer.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" @@ -27,7 +27,7 @@ // template -class MatchedProbeMaker : public edm::EDProducer { +class MatchedProbeMaker : public edm::one::EDProducer<> { public: typedef std::vector collection; diff --git a/DPGAnalysis/Skims/interface/MuonPtFilter.h b/DPGAnalysis/Skims/interface/MuonPtFilter.h index 74cfbe361ccee..d5b857d81ea36 100644 --- a/DPGAnalysis/Skims/interface/MuonPtFilter.h +++ b/DPGAnalysis/Skims/interface/MuonPtFilter.h @@ -13,7 +13,7 @@ /* Base Class Headers */ #include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/EDFilter.h" +#include "FWCore/Framework/interface/stream/EDFilter.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" @@ -27,7 +27,7 @@ class Propagator; /* Class MuonPtFilter Interface */ -class MuonPtFilter : public edm::EDFilter { +class MuonPtFilter : public edm::stream::EDFilter<> { public: /// Constructor MuonPtFilter(const edm::ParameterSet &); diff --git a/DPGAnalysis/Skims/interface/PhysDecl.h b/DPGAnalysis/Skims/interface/PhysDecl.h index 0cfed4703c990..98062df9abe5c 100644 --- a/DPGAnalysis/Skims/interface/PhysDecl.h +++ b/DPGAnalysis/Skims/interface/PhysDecl.h @@ -17,7 +17,7 @@ // user include files #include "FWCore/Utilities/interface/InputTag.h" #include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/EDFilter.h" +#include "FWCore/Framework/interface/one/EDFilter.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/MakerMacros.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" @@ -31,7 +31,7 @@ // class declaration // -class PhysDecl : public edm::EDFilter { +class PhysDecl : public edm::one::EDFilter<> { public: explicit PhysDecl(const edm::ParameterSet &); ~PhysDecl() override; diff --git a/DPGAnalysis/Skims/interface/SelectHFMinBias.h b/DPGAnalysis/Skims/interface/SelectHFMinBias.h index 6176bbdf3848c..a5abfe139568f 100644 --- a/DPGAnalysis/Skims/interface/SelectHFMinBias.h +++ b/DPGAnalysis/Skims/interface/SelectHFMinBias.h @@ -17,20 +17,17 @@ // user include files #include "FWCore/Utilities/interface/InputTag.h" #include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/EDFilter.h" +#include "FWCore/Framework/interface/stream/EDFilter.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/MakerMacros.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" -#include "FWCore/Framework/interface/ESHandle.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" -#include "DataFormats/TrackReco/interface/Track.h" -#include "DataFormats/TrackReco/interface/TrackFwd.h" // // class declaration // -class SelectHFMinBias : public edm::EDFilter { +class SelectHFMinBias : public edm::stream::EDFilter<> { public: explicit SelectHFMinBias(const edm::ParameterSet &); ~SelectHFMinBias() override; diff --git a/DPGAnalysis/Skims/interface/TagProbeMassEDMFilter.h b/DPGAnalysis/Skims/interface/TagProbeMassEDMFilter.h index a2eb52c657304..83c16a601c395 100644 --- a/DPGAnalysis/Skims/interface/TagProbeMassEDMFilter.h +++ b/DPGAnalysis/Skims/interface/TagProbeMassEDMFilter.h @@ -24,7 +24,7 @@ // user include files #include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/EDFilter.h" +#include "FWCore/Framework/interface/one/EDFilter.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/MakerMacros.h" @@ -35,7 +35,7 @@ // class declaration // -class TagProbeMassEDMFilter : public edm::EDFilter { +class TagProbeMassEDMFilter : public edm::one::EDFilter<> { public: explicit TagProbeMassEDMFilter(const edm::ParameterSet&); ~TagProbeMassEDMFilter() override; diff --git a/DPGAnalysis/Skims/interface/TagProbeMassProducer.h b/DPGAnalysis/Skims/interface/TagProbeMassProducer.h index 468ff474d793f..26caba3bf5143 100644 --- a/DPGAnalysis/Skims/interface/TagProbeMassProducer.h +++ b/DPGAnalysis/Skims/interface/TagProbeMassProducer.h @@ -24,22 +24,20 @@ // user include files #include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/EDProducer.h" +#include "FWCore/Framework/interface/stream/EDProducer.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "DataFormats/Candidate/interface/CandidateFwd.h" // forward declarations -class TagProbeMassProducer : public edm::EDProducer { +class TagProbeMassProducer : public edm::stream::EDProducer<> { public: explicit TagProbeMassProducer(const edm::ParameterSet&); ~TagProbeMassProducer() override; private: - void beginJob() override; void produce(edm::Event&, const edm::EventSetup&) override; - void endJob() override; bool isPassingProbe(const unsigned int iprobe) const; diff --git a/DPGAnalysis/Skims/src/CSCSkim.cc b/DPGAnalysis/Skims/src/CSCSkim.cc index 4762965ac2bae..9e91ded30c630 100644 --- a/DPGAnalysis/Skims/src/CSCSkim.cc +++ b/DPGAnalysis/Skims/src/CSCSkim.cc @@ -48,7 +48,7 @@ using namespace edm; //=================== // CONSTRUCTOR //=================== -CSCSkim::CSCSkim(const edm::ParameterSet& pset) { +CSCSkim::CSCSkim(const edm::ParameterSet& pset) : m_CSCGeomToken(esConsumes()) { // tokens from tags // Really should define the wire and digi tags in config, but for now, to avoid having to modify @@ -222,8 +222,7 @@ bool CSCSkim::filter(edm::Event& event, const edm::EventSetup& eventSetup) { LogDebug("[CSCSkim] EventInfo") << "Run: " << iRun << "\tEvent: " << iEvent << "\tn Analyzed: " << nEventsAnalyzed; // Get the CSC Geometry : - ESHandle cscGeom; - eventSetup.get().get(cscGeom); + ESHandle cscGeom = eventSetup.getHandle(m_CSCGeomToken); // Get the DIGI collections edm::Handle wires; diff --git a/DPGAnalysis/Skims/src/DetStatus.cc b/DPGAnalysis/Skims/src/DetStatus.cc index 36cd5a432dbd3..3ce8232333cf8 100644 --- a/DPGAnalysis/Skims/src/DetStatus.cc +++ b/DPGAnalysis/Skims/src/DetStatus.cc @@ -70,7 +70,7 @@ DetStatus::DetStatus(const edm::ParameterSet& pset) { // // -- Destructor // -DetStatus::~DetStatus() {} +DetStatus::~DetStatus() = default; //*********************************************************************// bool DetStatus::checkForDCSStatus(const DcsStatusCollection& dcsStatus) @@ -116,9 +116,15 @@ bool DetStatus::checkForDCSRecord(const DCSRecord& dcsRecord) } for (unsigned int detlist = 0; detlist < DcsStatus::nPartitions; detlist++) { + if (verbose_) + edm::LogInfo("DetStatus") << "testing " << DcsStatus::partitionName[detlist]; if (requestedPartitions_.test(detlist)) { + if (verbose_) + edm::LogInfo("DetStatus") << " " << DcsStatus::partitionName[detlist] << "in the requested list" << std::endl; if (AndOr_) { - accepted = (accepted & dcsRecord.highVoltageReady(detlist)); + accepted = dcsRecord.highVoltageReady(detlist); + if (!accepted) + break; } else { accepted = (accepted || dcsRecord.highVoltageReady(detlist)); } @@ -126,7 +132,7 @@ bool DetStatus::checkForDCSRecord(const DCSRecord& dcsRecord) } if (verbose_) { - edm::LogInfo("DetStatus") << "DCSStatus filter: " << accepted << "( AndOr: " << AndOr_ << ")" << std::endl; + edm::LogInfo("DetStatus") << "DCSStatus filter: " << accepted << " ( AndOr: " << AndOr_ << ")" << std::endl; edm::LogVerbatim("DetStatus") << "Partitions ON: "; for (unsigned int detlist = 0; detlist < DcsStatus::nPartitions; detlist++) { if ((dcsRecord.highVoltageReady(detlist))) { @@ -154,11 +160,12 @@ bool DetStatus::filter(edm::Event& evt, edm::EventSetup const& es) edm::Handle dcsRecord; evt.getByToken(dcsRecordToken_, dcsRecord); + // if the old style DCS status is valid (Run1 + Run2) if (dcsStatus.isValid() && !dcsStatus->empty()) { accepted = checkForDCSStatus(*dcsStatus); } else if (dcsRecord.isValid()) { if (evt.eventAuxiliary().isRealData()) { - // in case of real data check for DCS + // in case of real data check for DCSRecord content (Run >=3) accepted = checkForDCSRecord(*dcsRecord); } else { // in case of MC accept in any case diff --git a/DPGAnalysis/Skims/src/EcalTangentFilter.cc b/DPGAnalysis/Skims/src/EcalTangentFilter.cc index 3586e00025ae1..fd579e64e697e 100644 --- a/DPGAnalysis/Skims/src/EcalTangentFilter.cc +++ b/DPGAnalysis/Skims/src/EcalTangentFilter.cc @@ -49,11 +49,5 @@ bool EcalTangentFilter::filter(edm::Event& iEvent, const edm::EventSetup& iSetup return goodEvent; } -// ------------ method called once each job just before starting event loop ------------ -void EcalTangentFilter::beginJob() {} - -// ------------ method called once each job just after ending the event loop ------------ -void EcalTangentFilter::endJob() {} - //define this as a plug-in DEFINE_FWK_MODULE(EcalTangentFilter); diff --git a/DPGAnalysis/Skims/src/HCALHighEnergyFilter.cc b/DPGAnalysis/Skims/src/HCALHighEnergyFilter.cc index 696e100c9cfde..9b0875b0859cd 100644 --- a/DPGAnalysis/Skims/src/HCALHighEnergyFilter.cc +++ b/DPGAnalysis/Skims/src/HCALHighEnergyFilter.cc @@ -22,7 +22,7 @@ // user include files #include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/EDFilter.h" +#include "FWCore/Framework/interface/stream/EDFilter.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/MakerMacros.h" @@ -45,15 +45,13 @@ using namespace edm; //using namespace l1extra; -class HCALHighEnergyFilter : public edm::EDFilter { +class HCALHighEnergyFilter : public edm::stream::EDFilter<> { public: explicit HCALHighEnergyFilter(const edm::ParameterSet&); ~HCALHighEnergyFilter() override; private: - void beginJob() override; bool filter(edm::Event&, const edm::EventSetup&) override; - void endJob() override; // bool jetGood(L1JetParticleCollection::const_iterator &); bool jetGood(reco::CaloJetCollection::const_iterator&); // ----------member data --------------------------- @@ -134,11 +132,5 @@ bool HCALHighEnergyFilter::filter(edm::Event& iEvent, const edm::EventSetup& iSe return false; } -// ------------ method called once each job just before starting event loop ------------ -void HCALHighEnergyFilter::beginJob() {} - -// ------------ method called once each job just after ending the event loop ------------ -void HCALHighEnergyFilter::endJob() {} - //define this as a plug-in DEFINE_FWK_MODULE(HCALHighEnergyFilter); diff --git a/DPGAnalysis/Skims/src/HcalHPDFilter.cc b/DPGAnalysis/Skims/src/HcalHPDFilter.cc index 1ce6f455727f3..2780cd2509305 100644 --- a/DPGAnalysis/Skims/src/HcalHPDFilter.cc +++ b/DPGAnalysis/Skims/src/HcalHPDFilter.cc @@ -22,7 +22,7 @@ // user include files #include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/EDFilter.h" +#include "FWCore/Framework/interface/stream/EDFilter.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/MakerMacros.h" @@ -35,27 +35,17 @@ // class declaration // -class HcalHPDFilter : public edm::EDFilter { +class HcalHPDFilter : public edm::stream::EDFilter<> { public: explicit HcalHPDFilter(const edm::ParameterSet&); ~HcalHPDFilter() override; private: - void beginJob() override; bool filter(edm::Event&, const edm::EventSetup&) override; - void endJob() override; // ----------member data --------------------------- }; -// -// constants, enums and typedefs -// - -// -// static data member definitions -// - // // constructors and destructor // @@ -84,11 +74,5 @@ bool HcalHPDFilter::filter(edm::Event& iEvent, const edm::EventSetup& iSetup) { return false; } -// ------------ method called once each job just before starting event loop ------------ -void HcalHPDFilter::beginJob() {} - -// ------------ method called once each job just after ending the event loop ------------ -void HcalHPDFilter::endJob() {} - //define this as a plug-in DEFINE_FWK_MODULE(HcalHPDFilter); diff --git a/DPGAnalysis/Skims/src/NMaxPerLumi.cc b/DPGAnalysis/Skims/src/NMaxPerLumi.cc index 89426ad92f6a5..bb39fddeb753e 100644 --- a/DPGAnalysis/Skims/src/NMaxPerLumi.cc +++ b/DPGAnalysis/Skims/src/NMaxPerLumi.cc @@ -22,7 +22,7 @@ // user include files #include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/EDFilter.h" +#include "FWCore/Framework/interface/stream/EDFilter.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/MakerMacros.h" @@ -33,15 +33,13 @@ // class declaration // -class NMaxPerLumi : public edm::EDFilter { +class NMaxPerLumi : public edm::stream::EDFilter<> { public: explicit NMaxPerLumi(const edm::ParameterSet&); ~NMaxPerLumi() override; private: - void beginJob() override; bool filter(edm::Event&, const edm::EventSetup&) override; - void endJob() override; // ----------member data --------------------------- std::map > counters; @@ -86,11 +84,5 @@ bool NMaxPerLumi::filter(edm::Event& iEvent, const edm::EventSetup& iSetup) { } } -// ------------ method called once each job just before starting event loop ------------ -void NMaxPerLumi::beginJob() {} - -// ------------ method called once each job just after ending the event loop ------------ -void NMaxPerLumi::endJob() {} - //define this as a plug-in DEFINE_FWK_MODULE(NMaxPerLumi); diff --git a/DPGAnalysis/Skims/src/PickEvents.cc b/DPGAnalysis/Skims/src/PickEvents.cc index 850f09c0853f0..1ce402347a99d 100644 --- a/DPGAnalysis/Skims/src/PickEvents.cc +++ b/DPGAnalysis/Skims/src/PickEvents.cc @@ -32,7 +32,7 @@ // user include files #include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/EDFilter.h" +#include "FWCore/Framework/interface/one/EDFilter.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/MakerMacros.h" @@ -51,7 +51,7 @@ bool orderLuminosityBlockRange(edm::LuminosityBlockRange u, edm::LuminosityBlock // class declaration // -class PickEvents : public edm::EDFilter { +class PickEvents : public edm::one::EDFilter<> { public: explicit PickEvents(const edm::ParameterSet&); ~PickEvents() override; diff --git a/DPGAnalysis/Skims/src/RPCNoise.cc b/DPGAnalysis/Skims/src/RPCNoise.cc index 88ea0a3255791..cb49f4efc96ae 100644 --- a/DPGAnalysis/Skims/src/RPCNoise.cc +++ b/DPGAnalysis/Skims/src/RPCNoise.cc @@ -28,7 +28,7 @@ // user include files #include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/EDFilter.h" +#include "FWCore/Framework/interface/one/EDFilter.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/MakerMacros.h" @@ -84,7 +84,7 @@ using namespace edm; // class declaration // -class RPCNoise : public edm::EDFilter { +class RPCNoise : public edm::one::EDFilter<> { public: explicit RPCNoise(const edm::ParameterSet &); ~RPCNoise() override; diff --git a/DPGAnalysis/Skims/src/RPCRecHitFilter.cc b/DPGAnalysis/Skims/src/RPCRecHitFilter.cc index 513313cd53a9e..138a0580f5a4e 100644 --- a/DPGAnalysis/Skims/src/RPCRecHitFilter.cc +++ b/DPGAnalysis/Skims/src/RPCRecHitFilter.cc @@ -4,11 +4,8 @@ // #include "DPGAnalysis/Skims/src/RPCRecHitFilter.h" -//#include "../interface/RecHitFilter.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" -//#include "DataFormats/RPCDigi/interface/RPCDigi.h" -//#include "DataFormats/RPCDigi/interface/RPCDigiCollection.h" #include "FWCore/Framework/interface/Frameworkfwd.h" #include "FWCore/Framework/interface/MakerMacros.h" @@ -17,7 +14,6 @@ #include "DataFormats/RPCRecHit/interface/RPCRecHitCollection.h" #include -#include #include "Geometry/RPCGeometry/interface/RPCGeomServ.h" #include "MagneticField/Engine/interface/MagneticField.h" #include "MagneticField/Records/interface/IdealMagneticFieldRecord.h" @@ -40,14 +36,6 @@ #include "CondFormats/L1TObjects/interface/L1GtParameters.h" #include "CondFormats/DataRecord/interface/L1GtParametersRcd.h" -/*#include "DataFormats/L1Trigger/interface/L1MuonParticleFwd.h" -#include "DataFormats/L1GlobalMuonTrigger/interface/L1MuRegionalCand.h" - -#include "DataFormats/L1GlobalMuonTrigger/interface/L1MuGMTReadoutCollection.h" - -#include "DataFormats/L1GlobalMuonTrigger/interface/L1MuGMTCand.h" -*/ - using namespace reco; typedef std::vector L1MuRegionalCandCollection; @@ -75,12 +63,12 @@ using namespace edm; using namespace reco; using namespace std; -RPCRecHitFilter::RPCRecHitFilter(const edm::ParameterSet& iConfig) { - LogTrace("RPCEffTrackExtrapolation") << "Dentro Costruttore" << std::endl; +RPCRecHitFilter::RPCRecHitFilter(const edm::ParameterSet& iConfig) + : rpcGeomToken_(esConsumes()), trackingGeoToken_(esConsumes()) { + LogTrace("RPCEffTrackExtrapolation") << "inside constructor" << std::endl; - RPCDataLabel = iConfig.getUntrackedParameter("rpcRecHitLabel"); - - // RPCRecHits = iConfig.getParameter< edm::InputTag >("RPCRecHits"); + RPCDataLabel_ = iConfig.getUntrackedParameter("rpcRecHitLabel"); + rpcRecHitToken_ = consumes(edm::InputTag(RPCDataLabel_)); centralBX_ = iConfig.getUntrackedParameter("CentralBunchCrossing", 0); BXWindow_ = iConfig.getUntrackedParameter("BunchCrossingWindow", 9999); @@ -99,14 +87,10 @@ RPCRecHitFilter::RPCRecHitFilter(const edm::ParameterSet& iConfig) { } bool RPCRecHitFilter::filter(edm::Event& iEvent, const edm::EventSetup& iSetup) { - edm::ESHandle rpcGeo; - iSetup.get().get(rpcGeo); - - edm::Handle rpcHits; - iEvent.getByLabel(RPCDataLabel, rpcHits); + edm::ESHandle rpcGeo = iSetup.getHandle(rpcGeomToken_); + edm::ESHandle theTrackingGeometry = iSetup.getHandle(trackingGeoToken_); - ESHandle theTrackingGeometry; - iSetup.get().get(theTrackingGeometry); + edm::Handle rpcHits = iEvent.getHandle(rpcRecHitToken_); std::map numberOfRecHitsBarrel; std::map numberOfDigisBarrel; diff --git a/DPGAnalysis/Skims/src/RPCRecHitFilter.h b/DPGAnalysis/Skims/src/RPCRecHitFilter.h index 30a900d8e7a14..bb7d10b21ea88 100644 --- a/DPGAnalysis/Skims/src/RPCRecHitFilter.h +++ b/DPGAnalysis/Skims/src/RPCRecHitFilter.h @@ -42,7 +42,8 @@ #include "TrackingTools/TrajectoryState/interface/TrajectoryStateOnSurface.h" #include "RecoMuon/TransientTrackingRecHit/interface/MuonTransientTrackingRecHit.h" -#include "FWCore/Framework/interface/EDFilter.h" +#include "Geometry/RPCGeometry/interface/RPCGeometry.h" +#include "FWCore/Framework/interface/stream/EDFilter.h" #include "TDirectory.h" #include "TFile.h" @@ -58,7 +59,7 @@ typedef std::vector MeasurementContainer; typedef std::pair DetWithState; typedef std::vector Trajectories; -class RPCRecHitFilter : public edm::EDFilter { +class RPCRecHitFilter : public edm::stream::EDFilter<> { public: explicit RPCRecHitFilter(const edm::ParameterSet &); ~RPCRecHitFilter() override {} @@ -66,7 +67,14 @@ class RPCRecHitFilter : public edm::EDFilter { private: bool filter(edm::Event &, const edm::EventSetup &) override; - std::string RPCDataLabel; + // es token + const edm::ESGetToken rpcGeomToken_; + const edm::ESGetToken trackingGeoToken_; + + // event token + edm::EDGetTokenT rpcRecHitToken_; + + std::string RPCDataLabel_; int centralBX_, BXWindow_, minHits_, hitsInStations_; diff --git a/DPGAnalysis/Skims/src/RecHitEnergyFilter.cc b/DPGAnalysis/Skims/src/RecHitEnergyFilter.cc index 0ecad4a2dcea9..8f5ff55b53de6 100644 --- a/DPGAnalysis/Skims/src/RecHitEnergyFilter.cc +++ b/DPGAnalysis/Skims/src/RecHitEnergyFilter.cc @@ -22,7 +22,7 @@ // user include files #include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/EDFilter.h" +#include "FWCore/Framework/interface/stream/EDFilter.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/MakerMacros.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" @@ -32,15 +32,13 @@ // class declaration // -class RecHitEnergyFilter : public edm::EDFilter { +class RecHitEnergyFilter : public edm::stream::EDFilter<> { public: explicit RecHitEnergyFilter(const edm::ParameterSet&); ~RecHitEnergyFilter() override; private: - void beginJob() override; bool filter(edm::Event&, const edm::EventSetup&) override; - void endJob() override; // RecHit input tags edm::InputTag ebRecHitsTag_; @@ -103,11 +101,5 @@ bool RecHitEnergyFilter::filter(edm::Event& evt, const edm::EventSetup& iSetup) return false; } -// ------------ method called once each job just before starting event loop ------------ -void RecHitEnergyFilter::beginJob() {} - -// ------------ method called once each job just after ending the event loop ------------ -void RecHitEnergyFilter::endJob() {} - //define this as a plug-in DEFINE_FWK_MODULE(RecHitEnergyFilter); diff --git a/DPGAnalysis/Skims/src/SecondaryVertexFilter.cc b/DPGAnalysis/Skims/src/SecondaryVertexFilter.cc index e0782f0d8c74e..5b25597186137 100644 --- a/DPGAnalysis/Skims/src/SecondaryVertexFilter.cc +++ b/DPGAnalysis/Skims/src/SecondaryVertexFilter.cc @@ -22,7 +22,7 @@ // user include files #include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/EDFilter.h" +#include "FWCore/Framework/interface/stream/EDFilter.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/MakerMacros.h" @@ -36,7 +36,7 @@ // class declaration // -class SecondaryVertexFilter : public edm::EDFilter { +class SecondaryVertexFilter : public edm::stream::EDFilter<> { public: explicit SecondaryVertexFilter(const edm::ParameterSet&); ~SecondaryVertexFilter() override; diff --git a/DPGAnalysis/Skims/src/SelectHFMinBias.cc b/DPGAnalysis/Skims/src/SelectHFMinBias.cc index fa6eea0b1d291..b1728ee558fdc 100644 --- a/DPGAnalysis/Skims/src/SelectHFMinBias.cc +++ b/DPGAnalysis/Skims/src/SelectHFMinBias.cc @@ -15,11 +15,9 @@ #include "FWCore/Utilities/interface/InputTag.h" #include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/EDFilter.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/MakerMacros.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" -#include "FWCore/Framework/interface/ESHandle.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" #include "DPGAnalysis/Skims/interface/SelectHFMinBias.h" diff --git a/DPGAnalysis/Skims/src/SimpleJetFilter.cc b/DPGAnalysis/Skims/src/SimpleJetFilter.cc index 3e8654921b583..3a519c25ce9ed 100644 --- a/DPGAnalysis/Skims/src/SimpleJetFilter.cc +++ b/DPGAnalysis/Skims/src/SimpleJetFilter.cc @@ -22,7 +22,7 @@ // user include files #include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/EDFilter.h" +#include "FWCore/Framework/interface/stream/EDFilter.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/MakerMacros.h" @@ -45,15 +45,13 @@ // class declaration // -class SimpleJetFilter : public edm::EDFilter { +class SimpleJetFilter : public edm::stream::EDFilter<> { public: explicit SimpleJetFilter(const edm::ParameterSet&); ~SimpleJetFilter() override; private: - void beginJob() override; bool filter(edm::Event&, const edm::EventSetup&) override; - void endJob() override; // ----------member data --------------------------- @@ -65,14 +63,6 @@ class SimpleJetFilter : public edm::EDFilter { JetIDSelectionFunctor m_jetIDfunc; }; -// -// constants, enums and typedefs -// - -// -// static data member definitions -// - // // constructors and destructor // @@ -139,11 +129,5 @@ bool SimpleJetFilter::filter(edm::Event& iEvent, const edm::EventSetup& iSetup) return selected; } -// ------------ method called once each job just before starting event loop ------------ -void SimpleJetFilter::beginJob() {} - -// ------------ method called once each job just after ending the event loop ------------ -void SimpleJetFilter::endJob() {} - //define this as a plug-in DEFINE_FWK_MODULE(SimpleJetFilter); diff --git a/DPGAnalysis/Skims/src/TagProbeMassProducer.cc b/DPGAnalysis/Skims/src/TagProbeMassProducer.cc index ab5b84bae6e1d..69f86ea8a2387 100644 --- a/DPGAnalysis/Skims/src/TagProbeMassProducer.cc +++ b/DPGAnalysis/Skims/src/TagProbeMassProducer.cc @@ -119,12 +119,6 @@ void TagProbeMassProducer::produce(edm::Event& iEvent, const edm::EventSetup& iS iEvent.put(std::move(TPmass), "TPmass"); } -// ------------ method called once each job just before starting event loop ------------ -void TagProbeMassProducer::beginJob() {} - -// ------------ method called once each job just after ending the event loop ------------ -void TagProbeMassProducer::endJob() {} - bool TagProbeMassProducer::isPassingProbe(const unsigned int iProbe) const { if (iProbe > probes->size()) return false; diff --git a/DPGAnalysis/Skims/src/WZInterestingEventSelector.cc b/DPGAnalysis/Skims/src/WZInterestingEventSelector.cc index 355428018afe6..f6bb4da82a547 100644 --- a/DPGAnalysis/Skims/src/WZInterestingEventSelector.cc +++ b/DPGAnalysis/Skims/src/WZInterestingEventSelector.cc @@ -14,7 +14,7 @@ #include // user include files #include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/EDFilter.h" +#include "FWCore/Framework/interface/one/EDFilter.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/MakerMacros.h" @@ -41,7 +41,7 @@ using namespace reco; -class WZInterestingEventSelector : public edm::EDFilter { +class WZInterestingEventSelector : public edm::one::EDFilter<> { public: struct event { long run; diff --git a/DQM/CTPPS/plugins/BuildFile.xml b/DQM/CTPPS/plugins/BuildFile.xml index f82346cffcbd3..6e804109707e8 100644 --- a/DQM/CTPPS/plugins/BuildFile.xml +++ b/DQM/CTPPS/plugins/BuildFile.xml @@ -13,4 +13,5 @@ + diff --git a/DQM/CTPPS/plugins/DiamondSampicCalibrationDQMSource.cc b/DQM/CTPPS/plugins/DiamondSampicCalibrationDQMSource.cc new file mode 100644 index 0000000000000..81a5cf0e4ba71 --- /dev/null +++ b/DQM/CTPPS/plugins/DiamondSampicCalibrationDQMSource.cc @@ -0,0 +1,300 @@ +// -*- C++ -*- +// +// Package: DQM/CTPPS/DiamondSampicCalibrationDQMSource +// Class: DiamondSampicCalibrationDQMSource +// +/**\class DiamondSampicCalibrationDQMSource DiamondSampicCalibrationDQMSource.cc SampicDigi/DiamondSampicCalibrationDQMSource/plugins/DiamondSampicCalibrationDQMSource.cc + + Description: DQM module for the diamond sampic offset calibration + + Implementation: + [Notes on implementation] +*/ +// +// Original Author: Christopher Misan +// Created: Mon, 24 Aug 2021 14:21:17 GMT +// +// + +#include "FWCore/Framework/interface/ESHandle.h" +#include "FWCore/Framework/interface/Event.h" +#include "FWCore/Framework/interface/EventSetup.h" +#include "FWCore/Framework/interface/MakerMacros.h" +#include "FWCore/Framework/interface/Run.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/Utilities/interface/InputTag.h" + +#include "DQMServices/Core/interface/DQMOneEDAnalyzer.h" +#include "DQMServices/Core/interface/DQMStore.h" + +#include "DataFormats/CTPPSDigi/interface/TotemFEDInfo.h" +#include "DataFormats/CTPPSDigi/interface/TotemVFATStatus.h" +#include "DataFormats/CTPPSReco/interface/TotemRPLocalTrack.h" +#include "DataFormats/Common/interface/DetSetVector.h" +#include "DataFormats/FEDRawData/interface/FEDNumbering.h" +#include "DataFormats/Provenance/interface/EventRange.h" + +#include "DataFormats/CTPPSDetId/interface/CTPPSDiamondDetId.h" +#include "DataFormats/CTPPSDigi/interface/TotemTimingDigi.h" +#include "DataFormats/CTPPSReco/interface/TotemTimingRecHit.h" + +#include "DataFormats/CTPPSDetId/interface/TotemRPDetId.h" +#include "DataFormats/CTPPSReco/interface/TotemTimingLocalTrack.h" +#include "Geometry/Records/interface/VeryForwardRealGeometryRecord.h" +#include "Geometry/VeryForwardGeometryBuilder/interface/CTPPSGeometry.h" +#include "CondFormats/PPSObjects/interface/PPSTimingCalibration.h" +#include "CondFormats/DataRecord/interface/PPSTimingCalibrationRcd.h" + +#include + +//---------------------------------------------------------------------------------------------------- + +class DiamondSampicCalibrationDQMSource : public DQMOneEDAnalyzer<> { +public: + DiamondSampicCalibrationDQMSource(const edm::ParameterSet &); + ~DiamondSampicCalibrationDQMSource() override; + +protected: + void dqmBeginRun(const edm::Run &, const edm::EventSetup &) override; + void bookHistograms(DQMStore::IBooker &, const edm::Run &, const edm::EventSetup &) override; + void analyze(const edm::Event &, const edm::EventSetup &) override; + +private: + // Constants + static const double DISPLAY_RESOLUTION_FOR_HITS_MM; // Bin width of histograms + // showing hits and tracks + // (in mm) + static const double INV_DISPLAY_RESOLUTION_FOR_HITS_MM; + + edm::EDGetTokenT> totemTimingDigiToken_; + edm::EDGetTokenT> tokenRecHit_; + edm::ESGetToken timingCalibrationToken_; + edm::ESGetToken geomEsToken_; + unsigned int verbosity_; + edm::TimeValue_t timeOfPreviousEvent_; + + float verticalShiftBot_, verticalShiftTop_; + std::unordered_map horizontalShiftOfDiamond_; + + /// plots related to the whole system + struct GlobalPlots { + GlobalPlots() {} + GlobalPlots(DQMStore::IBooker &ibooker); + }; + + GlobalPlots globalPlot_; + + /// plots related to one Diamond detector package + struct PotPlots { + // RecHits + MonitorElement *hitDistribution2d = nullptr; + MonitorElement *recHitTime = nullptr; + + PotPlots(){}; + PotPlots(DQMStore::IBooker &ibooker, unsigned int id); + }; + + std::unordered_map potPlots_; + + /// plots related to one Diamond plane + struct PlanePlots { + PlanePlots() {} + PlanePlots(DQMStore::IBooker &ibooker, unsigned int id); + }; + + std::unordered_map planePlots_; + + /// plots related to one Diamond channel + struct ChannelPlots { + // RecHits + MonitorElement *recHitTime = nullptr; + + ChannelPlots() {} + ChannelPlots(DQMStore::IBooker &ibooker, unsigned int id); + }; + + edm::ESHandle hTimingCalib_; + std::unordered_map channelPlots_; +}; + +//---------------------------------------------------------------------------------------------------- + +// Values for all constants +const double DiamondSampicCalibrationDQMSource::DISPLAY_RESOLUTION_FOR_HITS_MM = 0.05; +const double DiamondSampicCalibrationDQMSource::INV_DISPLAY_RESOLUTION_FOR_HITS_MM = + 1. / DISPLAY_RESOLUTION_FOR_HITS_MM; + +//---------------------------------------------------------------------------------------------------- + +DiamondSampicCalibrationDQMSource::GlobalPlots::GlobalPlots(DQMStore::IBooker &ibooker) { + ibooker.setCurrentFolder("CTPPS/TimingFastSilicon"); +} + +//---------------------------------------------------------------------------------------------------- + +DiamondSampicCalibrationDQMSource::PotPlots::PotPlots(DQMStore::IBooker &ibooker, unsigned int id) { + std::string path, title; + CTPPSDiamondDetId(id).rpName(path, CTPPSDiamondDetId::nPath); + ibooker.setCurrentFolder(path); + + CTPPSDiamondDetId(id).rpName(title, CTPPSDiamondDetId::nFull); + + hitDistribution2d = ibooker.book2D("hits in planes", + title + " hits in planes;plane number;x (mm)", + 10, + -0.5, + 4.5, + 19. * INV_DISPLAY_RESOLUTION_FOR_HITS_MM, + -0.5, + 18.5); + + recHitTime = ibooker.book1D("recHit time", title + " time in the recHits; t (ns)", 500, -25, 25); +} + +//---------------------------------------------------------------------------------------------------- + +DiamondSampicCalibrationDQMSource::PlanePlots::PlanePlots(DQMStore::IBooker &ibooker, unsigned int id) { + std::string path, title; + CTPPSDiamondDetId(id).planeName(path, CTPPSDiamondDetId::nPath); + ibooker.setCurrentFolder(path); +} + +//---------------------------------------------------------------------------------------------------- + +DiamondSampicCalibrationDQMSource::ChannelPlots::ChannelPlots(DQMStore::IBooker &ibooker, unsigned int id) { + std::string path, title; + CTPPSDiamondDetId(id).channelName(path, CTPPSDiamondDetId::nPath); + ibooker.setCurrentFolder(path); + + CTPPSDiamondDetId(id).channelName(title, CTPPSDiamondDetId::nFull); + recHitTime = ibooker.book1D("recHit Time", title + " recHit Time; t (ns)", 500, -25, 25); +} + +//---------------------------------------------------------------------------------------------------- + +DiamondSampicCalibrationDQMSource::DiamondSampicCalibrationDQMSource(const edm::ParameterSet &ps) + : totemTimingDigiToken_( + consumes>(ps.getParameter("totemTimingDigiTag"))), + tokenRecHit_(consumes>(ps.getParameter("tagRecHits"))), + timingCalibrationToken_(esConsumes()), + geomEsToken_(esConsumes()), + verbosity_(ps.getUntrackedParameter("verbosity", 0)), + timeOfPreviousEvent_(0) {} + +//---------------------------------------------------------------------------------------------------- + +DiamondSampicCalibrationDQMSource::~DiamondSampicCalibrationDQMSource() {} + +//---------------------------------------------------------------------------------------------------- + +void DiamondSampicCalibrationDQMSource::dqmBeginRun(const edm::Run &iRun, const edm::EventSetup &iSetup) { + // Get detector shifts from the geometry (if present) + const auto &geom = iSetup.getData(geomEsToken_); + for (auto it = geom.beginSensor(); it != geom.endSensor(); it++) { + if (!CTPPSDiamondDetId::check(it->first)) + continue; + const CTPPSDiamondDetId detid(it->first); + + const DetGeomDesc *det = geom.sensorNoThrow(detid); + if (det) + horizontalShiftOfDiamond_[detid.rpId()] = det->translation().x() - det->getDiamondDimensions().xHalfWidth; + else + edm::LogProblem("DiamondSampicCalibrationDQMSource") << "ERROR: no descriptor for detId"; + } +} + +//---------------------------------------------------------------------------------------------------- + +void DiamondSampicCalibrationDQMSource::bookHistograms(DQMStore::IBooker &ibooker, + const edm::Run &, + const edm::EventSetup &iSetup) { + ibooker.cd(); + ibooker.setCurrentFolder("CTPPS"); + + globalPlot_ = GlobalPlots(ibooker); + const auto &geom = iSetup.getData(geomEsToken_); + for (auto it = geom.beginSensor(); it != geom.endSensor(); ++it) { + if (!CTPPSDiamondDetId::check(it->first)) + continue; + const CTPPSDiamondDetId detid(it->first); + + const CTPPSDiamondDetId rpId(detid.arm(), detid.station(), detid.rp()); + potPlots_[rpId] = PotPlots(ibooker, rpId); + + const CTPPSDiamondDetId plId(detid.arm(), detid.station(), detid.rp(), detid.plane()); + planePlots_[plId] = PlanePlots(ibooker, plId); + + const CTPPSDiamondDetId chId(detid.arm(), detid.station(), detid.rp(), detid.plane(), detid.channel()); + channelPlots_[chId] = ChannelPlots(ibooker, chId); + } + hTimingCalib_ = iSetup.getHandle(timingCalibrationToken_); +} + +//---------------------------------------------------------------------------------------------------- + +void DiamondSampicCalibrationDQMSource::analyze(const edm::Event &event, const edm::EventSetup &eventSetup) { + PPSTimingCalibration calib = *hTimingCalib_; + // get event setup data + edm::Handle> timingRecHits; + event.getByToken(tokenRecHit_, timingRecHits); + + edm::Handle> timingDigi; + event.getByToken(totemTimingDigiToken_, timingDigi); + + std::unordered_map detIdToHw; + + for (const auto &digis : *timingDigi) { + const CTPPSDiamondDetId detId(digis.detId()); + for (const auto &digi : digis) + detIdToHw[detId] = digi.hardwareId(); + } + + // Using TotemTimingDigi + std::set boardSet; + std::unordered_map channelsPerPlane; + std::unordered_map channelsPerPlaneWithTime; + + // End digis + + for (const auto &rechits : *timingRecHits) { + const CTPPSDiamondDetId detId(rechits.detId()); + CTPPSDiamondDetId detId_pot(rechits.detId()); + detId_pot.setPlane(0); + detId_pot.setChannel(0); + CTPPSDiamondDetId detId_plane(rechits.detId()); + detId_plane.setChannel(0); + + for (const auto &rechit : rechits) { + if (potPlots_.find(detId_pot) != potPlots_.end()) { + float UFSDShift = 0.0; + if (rechit.yWidth() < 3) + UFSDShift = 0.5; + + TH2F *hitHistoTmp = potPlots_[detId_pot].hitDistribution2d->getTH2F(); + TAxis *hitHistoTmpYAxis = hitHistoTmp->GetYaxis(); + int startBin = + hitHistoTmpYAxis->FindBin(rechit.x() - horizontalShiftOfDiamond_[detId_pot] - 0.5 * rechit.xWidth()); + int numOfBins = rechit.xWidth() * INV_DISPLAY_RESOLUTION_FOR_HITS_MM; + for (int i = 0; i < numOfBins; ++i) + potPlots_[detId_pot].hitDistribution2d->Fill(detId.plane() + UFSDShift, + hitHistoTmpYAxis->GetBinCenter(startBin + i)); + + //All plots with Time + if (rechit.time() != TotemTimingRecHit::NO_T_AVAILABLE) { + int db = (detIdToHw[detId] & 0xE0) >> 5; + int sampic = (detIdToHw[detId] & 0x10) >> 4; + int channel = (detIdToHw[detId] & 0x0F); + double offset = calib.timeOffset(db, sampic, channel); + potPlots_[detId_pot].recHitTime->Fill(rechit.time() + offset); + if (channelPlots_.find(detId) != channelPlots_.end()) + channelPlots_[detId].recHitTime->Fill(rechit.time() + offset); + } + } + } + } + // End RecHits + + timeOfPreviousEvent_ = event.time().value(); +} + +DEFINE_FWK_MODULE(DiamondSampicCalibrationDQMSource); diff --git a/DQM/CastorMonitor/interface/CastorRecHitMonitor.h b/DQM/CastorMonitor/interface/CastorRecHitMonitor.h index 460c7302e2cb5..dbb6a930d09bc 100644 --- a/DQM/CastorMonitor/interface/CastorRecHitMonitor.h +++ b/DQM/CastorMonitor/interface/CastorRecHitMonitor.h @@ -13,7 +13,6 @@ #include "DataFormats/JetReco/interface/CastorJetID.h" #include "DataFormats/JetReco/interface/Jet.h" #include "RecoJets/JetProducers/interface/CastorJetIDHelper.h" -#include "RecoJets/JetProducers/plugins/CastorJetIDProducer.h" #include "DataFormats/Common/interface/TriggerResults.h" diff --git a/DQM/DTMonitorClient/python/dtRunConditionVarClient_cfi.py b/DQM/DTMonitorClient/python/dtRunConditionVarClient_cfi.py index a9f2a64f60cc6..a1cca0c6d1b6b 100644 --- a/DQM/DTMonitorClient/python/dtRunConditionVarClient_cfi.py +++ b/DQM/DTMonitorClient/python/dtRunConditionVarClient_cfi.py @@ -20,4 +20,6 @@ maxGoodT0Sigma = cms.untracked.double(2.), minBadT0Sigma = cms.untracked.double(4.), + readLegacyVDriftDB =cms.bool(True), + ) diff --git a/DQM/DTMonitorClient/src/DTRunConditionVarClient.cc b/DQM/DTMonitorClient/src/DTRunConditionVarClient.cc index 5025d3ee88058..161c09d01400b 100644 --- a/DQM/DTMonitorClient/src/DTRunConditionVarClient.cc +++ b/DQM/DTMonitorClient/src/DTRunConditionVarClient.cc @@ -30,8 +30,7 @@ using namespace edm; using namespace std; -DTRunConditionVarClient::DTRunConditionVarClient(const ParameterSet& pSet) - : mTimeMapToken_(esConsumes()) { +DTRunConditionVarClient::DTRunConditionVarClient(const ParameterSet& pSet) { LogVerbatim("DTDQM|DTMonitorClient|DTRunConditionVarClient") << "DTRunConditionVarClient: Constructor called"; minRangeVDrift = pSet.getUntrackedParameter("minRangeVDrift"); @@ -49,9 +48,17 @@ DTRunConditionVarClient::DTRunConditionVarClient(const ParameterSet& pSet) maxGoodT0Sigma = pSet.getUntrackedParameter("maxGoodT0Sigma"); minBadT0Sigma = pSet.getUntrackedParameter("minBadT0Sigma"); + readLegacyVDriftDB = pSet.getParameter("readLegacyVDriftDB"); + nevents = 0; bookingdone = false; + + if (readLegacyVDriftDB) { + mTimeMapToken_ = esConsumes(); + } else { + vDriftToken_ = esConsumes(); + } } DTRunConditionVarClient::~DTRunConditionVarClient() { @@ -61,7 +68,18 @@ DTRunConditionVarClient::~DTRunConditionVarClient() { void DTRunConditionVarClient::beginRun(const Run& run, const EventSetup& context) { LogTrace("DTDQM|DTMonitorClient|DTResolutionAnalysisTest") << "[DTRunConditionVarClient]: BeginRun"; // Get the map of vdrift from the setup - mTimeMap_ = &context.getData(mTimeMapToken_); + if (readLegacyVDriftDB) { + mTimeMap_ = &context.getData(mTimeMapToken_); + vDriftMap_ = nullptr; + } else { + vDriftMap_ = &context.getData(vDriftToken_); + mTimeMap_ = nullptr; + // Consistency check: no parametrization is implemented for the time being + int version = vDriftMap_->version(); + if (version != 1) { + throw cms::Exception("Configuration") << "only version 1 is presently supported for VDriftDB"; + } + } } void DTRunConditionVarClient::dqmEndLuminosityBlock(DQMStore::IBooker& ibooker, @@ -251,12 +269,17 @@ void DTRunConditionVarClient::percDevVDrift( float vDriftPhi1(0.), vDriftPhi2(0.); float ResPhi1(0.), ResPhi2(0.); - int status1 = mTimeMap_->get(indexSLPhi1, vDriftPhi1, ResPhi1, DTVelocityUnits::cm_per_ns); - int status2 = mTimeMap_->get(indexSLPhi2, vDriftPhi2, ResPhi2, DTVelocityUnits::cm_per_ns); + if (readLegacyVDriftDB) { // Legacy format + int status1 = mTimeMap_->get(indexSLPhi1, vDriftPhi1, ResPhi1, DTVelocityUnits::cm_per_ns); + int status2 = mTimeMap_->get(indexSLPhi2, vDriftPhi2, ResPhi2, DTVelocityUnits::cm_per_ns); - if (status1 != 0 || status2 != 0) { - DTSuperLayerId sl = (status1 != 0) ? indexSLPhi1 : indexSLPhi2; - throw cms::Exception("DTRunConditionVarClient") << "Could not find vDrift entry in DB for" << sl << endl; + if (status1 != 0 || status2 != 0) { + DTSuperLayerId sl = (status1 != 0) ? indexSLPhi1 : indexSLPhi2; + throw cms::Exception("DTRunConditionVarClient") << "Could not find vDrift entry in DB for" << sl << endl; + } + } else { + vDriftPhi1 = vDriftMap_->get(DTWireId(indexSLPhi1.rawId())); + vDriftPhi2 = vDriftMap_->get(DTWireId(indexSLPhi2.rawId())); } float vDriftMed = (vDriftPhi1 + vDriftPhi2) / 2.; diff --git a/DQM/DTMonitorClient/src/DTRunConditionVarClient.h b/DQM/DTMonitorClient/src/DTRunConditionVarClient.h index e9a35f7da9118..5327cec4b9b9a 100644 --- a/DQM/DTMonitorClient/src/DTRunConditionVarClient.h +++ b/DQM/DTMonitorClient/src/DTRunConditionVarClient.h @@ -27,6 +27,8 @@ #include "CondFormats/DTObjects/interface/DTMtime.h" #include "CondFormats/DataRecord/interface/DTMtimeRcd.h" +#include "CondFormats/DTObjects/interface/DTRecoConditions.h" +#include "CondFormats/DataRecord/interface/DTRecoConditionsVdriftRcd.h" #include "DQMServices/Core/interface/DQMStore.h" #include "FWCore/ServiceRegistry/interface/Service.h" @@ -43,6 +45,8 @@ class DTGeometry; class DTChamberId; class DTLayerId; +class DTMtime; +class DTRecoConditions; class DTRunConditionVarClient : public DQMEDHarvester { public: @@ -99,7 +103,11 @@ class DTRunConditionVarClient : public DQMEDHarvester { float minBadT0Sigma; edm::ESGetToken mTimeMapToken_; - const DTMtime* mTimeMap_; + const DTMtime* mTimeMap_; // legacy DB object + + edm::ESGetToken vDriftToken_; + const DTRecoConditions* vDriftMap_; // DB object in new format + bool readLegacyVDriftDB; // which one to use bool bookingdone; diff --git a/DQM/DTMonitorModule/python/dtRunConditionVar_cfi.py b/DQM/DTMonitorModule/python/dtRunConditionVar_cfi.py index 4f32437642974..766b8a36637b4 100644 --- a/DQM/DTMonitorModule/python/dtRunConditionVar_cfi.py +++ b/DQM/DTMonitorModule/python/dtRunConditionVar_cfi.py @@ -5,6 +5,7 @@ debug = cms.untracked.bool(False), nMinHitsPhi = cms.untracked.int32(5), maxAnglePhiSegm = cms.untracked.double(30.), - recoSegments = cms.InputTag('dt4DSegments'), + recoSegments = cms.InputTag('dt4DSegments'), + readLegacyVDriftDB =cms.bool(True), ) diff --git a/DQM/DTMonitorModule/src/DTLocalTriggerSynchTask.cc b/DQM/DTMonitorModule/src/DTLocalTriggerSynchTask.cc index 79ff423d6acb6..d87827426097f 100644 --- a/DQM/DTMonitorModule/src/DTLocalTriggerSynchTask.cc +++ b/DQM/DTMonitorModule/src/DTLocalTriggerSynchTask.cc @@ -9,6 +9,7 @@ // Framework #include "FWCore/Framework/interface/EventSetup.h" +#include "FWCore/Framework/interface/ConsumesCollector.h" #include "FWCore/Utilities/interface/InputTag.h" // Geometry @@ -40,7 +41,8 @@ using namespace std; DTLocalTriggerSynchTask::DTLocalTriggerSynchTask(const edm::ParameterSet& ps) : nevents(0), tTrigSync{DTTTrigSyncFactory::get()->create(ps.getParameter("tTrigMode"), - ps.getParameter("tTrigModeConfig"))}, + ps.getParameter("tTrigModeConfig"), + consumesCollector())}, muonGeomToken_(esConsumes()) { edm::LogVerbatim("DTLocalTriggerSynchTask") << "[DTLocalTriggerSynchTask]: Constructor" << endl; tm_Token_ = consumes(ps.getParameter("TMInputTag")); diff --git a/DQM/DTMonitorModule/src/DTRunConditionVar.cc b/DQM/DTMonitorModule/src/DTRunConditionVar.cc index 3833f965f7a28..163ff0e8e085c 100644 --- a/DQM/DTMonitorModule/src/DTRunConditionVar.cc +++ b/DQM/DTMonitorModule/src/DTRunConditionVar.cc @@ -46,7 +46,13 @@ DTRunConditionVar::DTRunConditionVar(const ParameterSet& pSet) maxAnglePhiSegm(pSet.getUntrackedParameter("maxAnglePhiSegm")), dt4DSegmentsToken_(consumes(pSet.getParameter("recoSegments"))), muonGeomToken_(esConsumes()), - mTimeToken_(esConsumes()) {} + readLegacyVDriftDB(pSet.getParameter("readLegacyVDriftDB")) { + if (readLegacyVDriftDB) { + mTimeToken_ = esConsumes(); + } else { + vDriftToken_ = esConsumes(); + } +} DTRunConditionVar::~DTRunConditionVar() { LogTrace("DTDQM|DTMonitorModule|DTRunConditionVar") << "DTRunConditionVar: destructor called"; @@ -83,8 +89,18 @@ void DTRunConditionVar::analyze(const Event& event, const EventSetup& eventSetup << endl; // Get the map of vdrift from the setup - mTime = &eventSetup.getData(mTimeToken_); - mTimeMap_ = &*mTime; + if (readLegacyVDriftDB) { + mTimeMap_ = &eventSetup.getData(mTimeToken_); + vDriftMap_ = nullptr; + } else { + vDriftMap_ = &eventSetup.getData(vDriftToken_); + mTimeMap_ = nullptr; + // Consistency check: no parametrization is implemented for the time being + int version = vDriftMap_->version(); + if (version != 1) { + throw cms::Exception("Configuration") << "only version 1 is presently supported for VDriftDB"; + } + } // Get the segment collection from the event Handle all4DSegments; @@ -113,12 +129,17 @@ void DTRunConditionVar::analyze(const Event& event, const EventSetup& eventSetup float vDriftPhi1(0.), vDriftPhi2(0.); float ResPhi1(0.), ResPhi2(0.); - int status1 = mTimeMap_->get(indexSLPhi1, vDriftPhi1, ResPhi1, DTVelocityUnits::cm_per_ns); - int status2 = mTimeMap_->get(indexSLPhi2, vDriftPhi2, ResPhi2, DTVelocityUnits::cm_per_ns); - - if (status1 != 0 || status2 != 0) { - DTSuperLayerId sl = (status1 != 0) ? indexSLPhi1 : indexSLPhi2; - throw cms::Exception("DTRunConditionVarClient") << "Could not find vDrift entry in DB for" << sl << endl; + if (readLegacyVDriftDB) { // Legacy format + int status1 = mTimeMap_->get(indexSLPhi1, vDriftPhi1, ResPhi1, DTVelocityUnits::cm_per_ns); + int status2 = mTimeMap_->get(indexSLPhi2, vDriftPhi2, ResPhi2, DTVelocityUnits::cm_per_ns); + + if (status1 != 0 || status2 != 0) { + DTSuperLayerId sl = (status1 != 0) ? indexSLPhi1 : indexSLPhi2; + throw cms::Exception("DTRunConditionVarClient") << "Could not find vDrift entry in DB for" << sl << endl; + } + } else { + vDriftPhi1 = vDriftMap_->get(DTWireId(indexSLPhi1.rawId())); + vDriftPhi2 = vDriftMap_->get(DTWireId(indexSLPhi2.rawId())); } float vDriftMed = (vDriftPhi1 + vDriftPhi2) / 2.; diff --git a/DQM/DTMonitorModule/src/DTRunConditionVar.h b/DQM/DTMonitorModule/src/DTRunConditionVar.h index d16ada1a5d206..a8e5d87c7a8cb 100644 --- a/DQM/DTMonitorModule/src/DTRunConditionVar.h +++ b/DQM/DTMonitorModule/src/DTRunConditionVar.h @@ -33,6 +33,8 @@ #include "MagneticField/Engine/interface/MagneticField.h" #include "CondFormats/DTObjects/interface/DTMtime.h" #include "CondFormats/DataRecord/interface/DTMtimeRcd.h" +#include "CondFormats/DTObjects/interface/DTRecoConditions.h" +#include "CondFormats/DataRecord/interface/DTRecoConditionsVdriftRcd.h" #include "RecoMuon/MeasurementDet/interface/MuonDetLayerMeasurements.h" #include "DQMServices/Core/interface/DQMStore.h" @@ -71,8 +73,11 @@ class DTRunConditionVar : public DQMEDAnalyzer { const DTGeometry* dtGeom; edm::ESGetToken mTimeToken_; - const DTMtime* mTime; - const DTMtime* mTimeMap_; + const DTMtime* mTimeMap_; // legacy DB object + + edm::ESGetToken vDriftToken_; + const DTRecoConditions* vDriftMap_; // DB object in new format + bool readLegacyVDriftDB; // which one to use std::map > chamberHistos; diff --git a/DQM/EcalMonitorDbModule/interface/EcalCondDBReader.h b/DQM/EcalMonitorDbModule/interface/EcalCondDBReader.h index 5a47624e56afe..09370dbf65098 100644 --- a/DQM/EcalMonitorDbModule/interface/EcalCondDBReader.h +++ b/DQM/EcalMonitorDbModule/interface/EcalCondDBReader.h @@ -5,6 +5,7 @@ #include "DQM/EcalCommon/interface/MESet.h" #include "DQMServices/Core/interface/DQMEDHarvester.h" #include "OnlineDB/EcalCondDB/interface/EcalCondDBInterface.h" +#include "Geometry/EcalMapping/interface/EcalMappingRcd.h" class EcalCondDBReader : public DQMEDHarvester { public: @@ -46,6 +47,7 @@ class EcalCondDBReader : public DQMEDHarvester { int verbosity_; bool executed_; + edm::ESGetToken elecMapHandle; }; #endif diff --git a/DQM/EcalMonitorDbModule/interface/EcalDQMStatusWriter.h b/DQM/EcalMonitorDbModule/interface/EcalDQMStatusWriter.h index 0b58719e6846a..56ee6decfeabb 100644 --- a/DQM/EcalMonitorDbModule/interface/EcalDQMStatusWriter.h +++ b/DQM/EcalMonitorDbModule/interface/EcalDQMStatusWriter.h @@ -1,7 +1,7 @@ #ifndef EcalDQMStatusWriter_H #define EcalDQMStatusWriter_H -#include "FWCore/Framework/interface/EDAnalyzer.h" +#include "FWCore/Framework/interface/one/EDAnalyzer.h" #include "CondFormats/EcalObjects/interface/EcalDQMChannelStatus.h" #include "CondFormats/EcalObjects/interface/EcalDQMTowerStatus.h" @@ -11,14 +11,14 @@ #include -class EcalDQMStatusWriter : public edm::EDAnalyzer { +class EcalDQMStatusWriter : public edm::one::EDAnalyzer<> { public: EcalDQMStatusWriter(edm::ParameterSet const &); ~EcalDQMStatusWriter() override {} private: void analyze(edm::Event const &, edm::EventSetup const &) override; - void beginRun(edm::Run const &, edm::EventSetup const &) override; + void beginRun(edm::Run const &, edm::EventSetup const &); EcalDQMChannelStatus channelStatus_; EcalDQMTowerStatus towerStatus_; @@ -28,6 +28,7 @@ class EcalDQMStatusWriter : public edm::EDAnalyzer { EcalElectronicsMapping const *electronicsMap; void setElectronicsMap(edm::EventSetup const &); EcalElectronicsMapping const *GetElectronicsMap(); + edm::ESGetToken elecMapHandle; }; #endif diff --git a/DQM/EcalMonitorDbModule/plugins/EcalCondDBReader.cc b/DQM/EcalMonitorDbModule/plugins/EcalCondDBReader.cc index 0fa79be46288a..e5cfcd3e301dd 100644 --- a/DQM/EcalMonitorDbModule/plugins/EcalCondDBReader.cc +++ b/DQM/EcalMonitorDbModule/plugins/EcalCondDBReader.cc @@ -9,15 +9,14 @@ #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "FWCore/ServiceRegistry/interface/Service.h" -#include "Geometry/EcalMapping/interface/EcalMappingRcd.h" - EcalCondDBReader::EcalCondDBReader(edm::ParameterSet const &_ps) : db_(nullptr), monIOV_(), worker_(nullptr), formula_(_ps.getUntrackedParameter("formula")), meSet_(ecaldqm::createMESet(_ps.getUntrackedParameterSet("plot"))), - verbosity_(_ps.getUntrackedParameter("verbosity")) { + verbosity_(_ps.getUntrackedParameter("verbosity")), + elecMapHandle(esConsumes()) { std::string table(_ps.getUntrackedParameter("table")); edm::ParameterSet const &workerParams(_ps.getUntrackedParameterSet("workerParams")); @@ -159,11 +158,7 @@ void EcalCondDBReader::dqmEndRun(DQMStore::IBooker &_ibooker, meSet_->setBinContent(getEcalDQMSetupObjects(), vItr->first, vItr->second); } -void EcalCondDBReader::setElectronicsMap(edm::EventSetup const &_es) { - edm::ESHandle elecMapHandle; - _es.get().get(elecMapHandle); - electronicsMap = elecMapHandle.product(); -} +void EcalCondDBReader::setElectronicsMap(edm::EventSetup const &_es) { electronicsMap = &_es.getData(elecMapHandle); } EcalElectronicsMapping const *EcalCondDBReader::GetElectronicsMap() { if (!electronicsMap) diff --git a/DQM/EcalMonitorDbModule/plugins/EcalDQMStatusWriter.cc b/DQM/EcalMonitorDbModule/plugins/EcalDQMStatusWriter.cc index 7808034340355..84e3377f925e6 100644 --- a/DQM/EcalMonitorDbModule/plugins/EcalDQMStatusWriter.cc +++ b/DQM/EcalMonitorDbModule/plugins/EcalDQMStatusWriter.cc @@ -15,7 +15,8 @@ EcalDQMStatusWriter::EcalDQMStatusWriter(edm::ParameterSet const &_ps) : channelStatus_(), towerStatus_(), firstRun_(_ps.getUntrackedParameter("firstRun")), - inputFile_(_ps.getUntrackedParameter("inputFile")) { + inputFile_(_ps.getUntrackedParameter("inputFile")), + elecMapHandle(esConsumes()) { if (!inputFile_.is_open()) throw cms::Exception("Invalid input for EcalDQMStatusWriter"); } @@ -41,9 +42,7 @@ void EcalDQMStatusWriter::analyze(edm::Event const &, edm::EventSetup const &_es } void EcalDQMStatusWriter::setElectronicsMap(edm::EventSetup const &_es) { - edm::ESHandle elecMapHandle; - _es.get().get(elecMapHandle); - electronicsMap = elecMapHandle.product(); + electronicsMap = &_es.getData(elecMapHandle); } EcalElectronicsMapping const *EcalDQMStatusWriter::GetElectronicsMap() { diff --git a/DQM/EcalMonitorTasks/interface/OccupancyTask.h b/DQM/EcalMonitorTasks/interface/OccupancyTask.h index bd4cd4e9d0a48..d58a0f1172fcd 100644 --- a/DQM/EcalMonitorTasks/interface/OccupancyTask.h +++ b/DQM/EcalMonitorTasks/interface/OccupancyTask.h @@ -29,7 +29,6 @@ namespace ecaldqm { void runOnDigis(DigiCollection const&, Collections); void runOnTPDigis(EcalTrigPrimDigiCollection const&); void runOnRecHits(EcalRecHitCollection const&, Collections); - void setEventTime(const edm::TimeValue_t& iTime); void setTokens(edm::ConsumesCollector&) override; private: diff --git a/DQM/EcalMonitorTasks/python/TrigPrimTask_cfi.py b/DQM/EcalMonitorTasks/python/TrigPrimTask_cfi.py index 940c0121324a9..be022a7fbba80 100644 --- a/DQM/EcalMonitorTasks/python/TrigPrimTask_cfi.py +++ b/DQM/EcalMonitorTasks/python/TrigPrimTask_cfi.py @@ -267,14 +267,14 @@ ), RealvEmulEt = cms.untracked.PSet( kind = cms.untracked.string('TH2F'), - yaxis = cms.untracked.PSet( + xaxis = cms.untracked.PSet( high = cms.untracked.double(256.0), nbins = cms.untracked.int32(128), low = cms.untracked.double(0.0), title = cms.untracked.string('Real data TP Et (ADC)') ), otype = cms.untracked.string('Ecal3P'), - xaxis = cms.untracked.PSet( + yaxis = cms.untracked.PSet( high = cms.untracked.double(256.0), nbins = cms.untracked.int32(128), low = cms.untracked.double(0.0), diff --git a/DQM/EcalMonitorTasks/src/OccupancyTask.cc b/DQM/EcalMonitorTasks/src/OccupancyTask.cc index 83571c22458f2..f89cdf7016d5c 100644 --- a/DQM/EcalMonitorTasks/src/OccupancyTask.cc +++ b/DQM/EcalMonitorTasks/src/OccupancyTask.cc @@ -1,5 +1,5 @@ #include "DQM/EcalMonitorTasks/interface/OccupancyTask.h" - +#include "FWCore/Framework/interface/Event.h" #include "DQM/EcalCommon/interface/EcalDQMCommonUtils.h" #include "DataFormats/EcalRawData/interface/EcalDCCHeaderBlock.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" @@ -28,7 +28,6 @@ namespace ecaldqm { } void OccupancyTask::beginRun(edm::Run const&, edm::EventSetup const& _es) { FillLaser = true; } - void OccupancyTask::setEventTime(const edm::TimeValue_t& iTime) { m_iTime = iTime; } void OccupancyTask::beginEvent(edm::Event const& _evt, edm::EventSetup const& _es, bool const& ByLumiResetSwitch, @@ -39,6 +38,7 @@ namespace ecaldqm { MEs_.at("RecHitThrAllByLumi").reset(GetElectronicsMap()); } MESet& meLaserCorrProjEta(MEs_.at("LaserCorrProjEta")); + m_iTime = _evt.time().value(); if (FillLaser) { float lasercalib = 1.; auto const& laser = &_es.getData(lasertoken_); diff --git a/DQM/GEM/interface/GEMDigiSource.h b/DQM/GEM/interface/GEMDigiSource.h index 0e8f2192b7284..fa89c01dfa2fd 100644 --- a/DQM/GEM/interface/GEMDigiSource.h +++ b/DQM/GEM/interface/GEMDigiSource.h @@ -40,6 +40,7 @@ class GEMDigiSource : public GEMDQMBase { private: int ProcessWithMEMap2WithEta(BookingHelper& bh, ME3IdsKey key) override; + int ProcessWithMEMap2(BookingHelper& bh, ME2IdsKey key) override; int ProcessWithMEMap3(BookingHelper& bh, ME3IdsKey key) override; int ProcessWithMEMap3WithChamber(BookingHelper& bh, ME4IdsKey key) override; @@ -52,7 +53,7 @@ class GEMDigiSource : public GEMDQMBase { MEMap3Inf mapDigiOcc_phi_; MEMap3Inf mapTotalDigiPerEvtLayer_; MEMap3Inf mapTotalDigiPerEvtIEta_; - MEMap3Inf mapBX_iEta_; + MEMap2Inf mapBX_; MEMap4Inf mapDigiOccPerCh_; diff --git a/DQM/GEM/plugins/BuildFile.xml b/DQM/GEM/plugins/BuildFile.xml index a469275194e23..b811f938f2f7d 100644 --- a/DQM/GEM/plugins/BuildFile.xml +++ b/DQM/GEM/plugins/BuildFile.xml @@ -2,10 +2,6 @@ - - - - diff --git a/DQM/GEM/plugins/GEMDigiSource.cc b/DQM/GEM/plugins/GEMDigiSource.cc index db97a4b4845a1..34ae5d5d6e4d2 100644 --- a/DQM/GEM/plugins/GEMDigiSource.cc +++ b/DQM/GEM/plugins/GEMDigiSource.cc @@ -48,7 +48,7 @@ void GEMDigiSource::bookHistograms(DQMStore::IBooker& ibooker, edm::Run const&, "Number of fired digis", "Events"); - mapBX_iEta_ = MEMap3Inf(this, "bx", "Digi Bunch Crossing", 21, nBXMin_ - 0.5, nBXMax_ + 0.5, "Bunch crossing"); + mapBX_ = MEMap2Inf(this, "bx", "Digi Bunch Crossing", 21, nBXMin_ - 0.5, nBXMax_ + 0.5, "Bunch crossing"); mapDigiOccPerCh_ = MEMap4Inf(this, "occ", "Digi Occupancy", 1, -0.5, 1.5, 1, 0.5, 1.5, "Digi", "iEta"); @@ -69,8 +69,13 @@ void GEMDigiSource::bookHistograms(DQMStore::IBooker& ibooker, edm::Run const&, } } +int GEMDigiSource::ProcessWithMEMap2(BookingHelper& bh, ME2IdsKey key) { + mapBX_.bookND(bh, key); + + return 0; +} + int GEMDigiSource::ProcessWithMEMap2WithEta(BookingHelper& bh, ME3IdsKey key) { - mapBX_iEta_.bookND(bh, key); mapTotalDigiPerEvtIEta_.bookND(bh, key); return 0; @@ -157,7 +162,7 @@ void GEMDigiSource::analyze(edm::Event const& event, edm::EventSetup const& even // Filling of bx Int_t nBX = std::min(std::max((Int_t)d->bx(), nBXMin_), nBXMax_); // For under/overflow if (bTagVFAT.find(nIdxVFAT) == bTagVFAT.end()) { - mapBX_iEta_.Fill(key3IEta, nBX); + mapBX_.Fill(key2, nBX); } // Occupancy on a chamber diff --git a/DQM/GEM/python/GEMDQM_cff.py b/DQM/GEM/python/GEMDQM_cff.py index 61f49aec52acf..48a09b0413584 100644 --- a/DQM/GEM/python/GEMDQM_cff.py +++ b/DQM/GEM/python/GEMDQM_cff.py @@ -16,3 +16,6 @@ GEMDigiSource *GEMRecHitSource ) + +from Configuration.Eras.Modifier_phase2_GEM_cff import phase2_GEM +phase2_GEM.toModify(GEMDigiSource, digisInputLabel = "simMuonGEMDigis") diff --git a/DQM/GEM/src/GEMDQMBase.cc b/DQM/GEM/src/GEMDQMBase.cc index 2ef57115190ad..c2aa3349b4fea 100644 --- a/DQM/GEM/src/GEMDQMBase.cc +++ b/DQM/GEM/src/GEMDQMBase.cc @@ -211,8 +211,8 @@ int GEMDQMBase::GenerateMEPerChamber(DQMStore::IBooker& ibooker) { MEMap2WithEtaCheck_[key2WithEta] = true; } if (!MEMap2AbsReWithEtaCheck_[key2AbsReWithEta]) { - auto strSuffixName = Form("_GE%i%i-E%02i", std::abs(gid.region()), gid.station(), eId.ieta()); - auto strSuffixTitle = Form(" GE%i%i-E%02i", std::abs(gid.region()), gid.station(), eId.ieta()); + auto strSuffixName = Form("_GE%d1-E%02i", gid.station(), eId.ieta()); + auto strSuffixTitle = Form(" GE%d1-E%02i", gid.station(), eId.ieta()); BookingHelper bh3(ibooker, strSuffixName, strSuffixTitle); ProcessWithMEMap2AbsReWithEta(bh3, key2AbsReWithEta); MEMap2AbsReWithEtaCheck_[key2AbsReWithEta] = true; diff --git a/DQM/HcalCommon/interface/HcalCommonHeaders.h b/DQM/HcalCommon/interface/HcalCommonHeaders.h index a6031be0f859d..bee231c8dda9a 100644 --- a/DQM/HcalCommon/interface/HcalCommonHeaders.h +++ b/DQM/HcalCommon/interface/HcalCommonHeaders.h @@ -56,7 +56,6 @@ #include "DQM/HcalCommon/interface/Constants.h" -#include "boost/lexical_cast.hpp" #include #include #include diff --git a/DQM/HcalCommon/src/DQClient.cc b/DQM/HcalCommon/src/DQClient.cc index b611a4800cd82..8d04c4072140e 100644 --- a/DQM/HcalCommon/src/DQClient.cc +++ b/DQM/HcalCommon/src/DQClient.cc @@ -8,6 +8,7 @@ namespace hcaldqm { edm::ConsumesCollector &iC) : DQModule(ps), _taskname(taskname), + _totalLS(0), _maxProcessedLS(0), hcalDbServiceToken_(iC.esConsumes()), runInfoToken_(iC.esConsumes()), diff --git a/DQM/Integration/python/clients/beamfake_dqm_sourceclient-live_cfg.py b/DQM/Integration/python/clients/beamfake_dqm_sourceclient-live_cfg.py index 44e6495d057ba..04a7e29e5b94f 100644 --- a/DQM/Integration/python/clients/beamfake_dqm_sourceclient-live_cfg.py +++ b/DQM/Integration/python/clients/beamfake_dqm_sourceclient-live_cfg.py @@ -198,6 +198,11 @@ #--------- # Final path +print("Final Source settings:", process.source) + process.p = cms.Path(process.dqmcommon * process.monitor ) + + + diff --git a/DQM/Integration/python/clients/beamhltfake_dqm_sourceclient-live_cfg.py b/DQM/Integration/python/clients/beamhltfake_dqm_sourceclient-live_cfg.py index 4edc1310160c1..c93032d5031ce 100644 --- a/DQM/Integration/python/clients/beamhltfake_dqm_sourceclient-live_cfg.py +++ b/DQM/Integration/python/clients/beamhltfake_dqm_sourceclient-live_cfg.py @@ -167,5 +167,10 @@ ) print("Configured frontierKey", options.runUniqueKey) +#--------- +# Final path +print("Final Source settings:", process.source) + process.p = cms.Path(process.dqmcommon * process.monitor ) + diff --git a/DQM/Integration/python/clients/castor_dqm_sourceclient-live_cfg.py b/DQM/Integration/python/clients/castor_dqm_sourceclient-live_cfg.py index 21c7ba5d03802..3c9ba334c2c96 100644 --- a/DQM/Integration/python/clients/castor_dqm_sourceclient-live_cfg.py +++ b/DQM/Integration/python/clients/castor_dqm_sourceclient-live_cfg.py @@ -143,4 +143,7 @@ ### process customizations included here from DQM.Integration.config.online_customizations_cfi import * +print("Final Source settings:", process.source) process = customise(process) + + diff --git a/DQM/Integration/python/clients/csc_dqm_sourceclient-live_cfg.py b/DQM/Integration/python/clients/csc_dqm_sourceclient-live_cfg.py index 03a0947379fcb..0a2915a1be984 100644 --- a/DQM/Integration/python/clients/csc_dqm_sourceclient-live_cfg.py +++ b/DQM/Integration/python/clients/csc_dqm_sourceclient-live_cfg.py @@ -222,4 +222,6 @@ ### process customizations included here from DQM.Integration.config.online_customizations_cfi import * +print("Final Source settings:", process.source) process = customise(process) + diff --git a/DQM/Integration/python/clients/ctpps_dqm_sourceclient-live_cfg.py b/DQM/Integration/python/clients/ctpps_dqm_sourceclient-live_cfg.py index ca590a35ef5ab..8d490dcc7b3b1 100644 --- a/DQM/Integration/python/clients/ctpps_dqm_sourceclient-live_cfg.py +++ b/DQM/Integration/python/clients/ctpps_dqm_sourceclient-live_cfg.py @@ -104,4 +104,5 @@ # Process customizations included here from DQM.Integration.config.online_customizations_cfi import * +print("Final Source settings:", process.source) process = customise(process) diff --git a/DQM/Integration/python/clients/dt4ml_dqm_sourceclient-live_cfg.py b/DQM/Integration/python/clients/dt4ml_dqm_sourceclient-live_cfg.py index a775a8debe554..f68e01817f44d 100644 --- a/DQM/Integration/python/clients/dt4ml_dqm_sourceclient-live_cfg.py +++ b/DQM/Integration/python/clients/dt4ml_dqm_sourceclient-live_cfg.py @@ -123,4 +123,5 @@ ### process customizations included here from DQM.Integration.config.online_customizations_cfi import * +print("Final Source settings:", process.source) process = customise(process) diff --git a/DQM/Integration/python/clients/dt_dqm_sourceclient-live_cfg.py b/DQM/Integration/python/clients/dt_dqm_sourceclient-live_cfg.py index 33708fd2b40f7..0001acf61064b 100644 --- a/DQM/Integration/python/clients/dt_dqm_sourceclient-live_cfg.py +++ b/DQM/Integration/python/clients/dt_dqm_sourceclient-live_cfg.py @@ -104,4 +104,5 @@ ### process customizations included here from DQM.Integration.config.online_customizations_cfi import * +print("Final Source settings:", process.source) process = customise(process) diff --git a/DQM/Integration/python/clients/ecal_dqm_sourceclient-live_cfg.py b/DQM/Integration/python/clients/ecal_dqm_sourceclient-live_cfg.py index 8409881dd6e62..350732160fbb1 100644 --- a/DQM/Integration/python/clients/ecal_dqm_sourceclient-live_cfg.py +++ b/DQM/Integration/python/clients/ecal_dqm_sourceclient-live_cfg.py @@ -171,4 +171,5 @@ ### process customizations included here from DQM.Integration.config.online_customizations_cfi import * +print("Final Source settings:", process.source) process = customise(process) diff --git a/DQM/Integration/python/clients/ecalcalib_dqm_sourceclient-live_cfg.py b/DQM/Integration/python/clients/ecalcalib_dqm_sourceclient-live_cfg.py index 4b8508fb3023b..27588bd4156f1 100644 --- a/DQM/Integration/python/clients/ecalcalib_dqm_sourceclient-live_cfg.py +++ b/DQM/Integration/python/clients/ecalcalib_dqm_sourceclient-live_cfg.py @@ -213,4 +213,5 @@ ### process customizations included here from DQM.Integration.config.online_customizations_cfi import * +print("Final Source settings:", process.source) process = customise(process) diff --git a/DQM/Integration/python/clients/es_dqm_sourceclient-live_cfg.py b/DQM/Integration/python/clients/es_dqm_sourceclient-live_cfg.py index 50821b2842190..868f9119170f6 100644 --- a/DQM/Integration/python/clients/es_dqm_sourceclient-live_cfg.py +++ b/DQM/Integration/python/clients/es_dqm_sourceclient-live_cfg.py @@ -96,4 +96,5 @@ ### process customizations included here from DQM.Integration.config.online_customizations_cfi import * +print("Final Source settings:", process.source) process = customise(process) diff --git a/DQM/Integration/python/clients/fed_dqm_sourceclient-live_cfg.py b/DQM/Integration/python/clients/fed_dqm_sourceclient-live_cfg.py index 7cb5cb5900b7c..4264ac93ab9d5 100644 --- a/DQM/Integration/python/clients/fed_dqm_sourceclient-live_cfg.py +++ b/DQM/Integration/python/clients/fed_dqm_sourceclient-live_cfg.py @@ -156,4 +156,5 @@ # Finaly: DQM process customizations from DQM.Integration.config.online_customizations_cfi import * +print("Final Source settings:", process.source) process = customise(process) diff --git a/DQM/Integration/python/clients/gem_dqm_sourceclient-live_cfg.py b/DQM/Integration/python/clients/gem_dqm_sourceclient-live_cfg.py index 087c80024c1d7..8729da504bc58 100644 --- a/DQM/Integration/python/clients/gem_dqm_sourceclient-live_cfg.py +++ b/DQM/Integration/python/clients/gem_dqm_sourceclient-live_cfg.py @@ -58,4 +58,5 @@ process.dqmProvInfo.runType = process.runType.getRunTypeName() from DQM.Integration.config.online_customizations_cfi import * +print("Final Source settings:", process.source) process = customise(process) diff --git a/DQM/Integration/python/clients/hcal_dqm_sourceclient-live_cfg.py b/DQM/Integration/python/clients/hcal_dqm_sourceclient-live_cfg.py index 346786f8f9476..95a51c5c2ccf2 100644 --- a/DQM/Integration/python/clients/hcal_dqm_sourceclient-live_cfg.py +++ b/DQM/Integration/python/clients/hcal_dqm_sourceclient-live_cfg.py @@ -59,8 +59,9 @@ process.dqmSaverPB.runNumber = options.runNumber process = customise(process) process.DQMStore.verbose = 0 -if not useFileInput and not unitTest: - process.source.minEventsPerLumi = 100 +if not unitTest and not useFileInput : + if not options.BeamSplashRun : + process.source.minEventsPerLumi = 100 #------------------------------------- # CMSSW/Hcal non-DQM Related Module import @@ -256,4 +257,5 @@ # tracer #process.Tracer = cms.Service("Tracer") +print("Final Source settings:", process.source) process = customise(process) diff --git a/DQM/Integration/python/clients/hcalcalib_dqm_sourceclient-live_cfg.py b/DQM/Integration/python/clients/hcalcalib_dqm_sourceclient-live_cfg.py index 0910e080f8185..11ca9f357b3bf 100644 --- a/DQM/Integration/python/clients/hcalcalib_dqm_sourceclient-live_cfg.py +++ b/DQM/Integration/python/clients/hcalcalib_dqm_sourceclient-live_cfg.py @@ -52,7 +52,8 @@ process.dqmSaverPB.runNumber = options.runNumber process = customise(process) if not useFileInput: - process.source.minEventsPerLumi=100 + if not options.BeamSplashRun : + process.source.minEventsPerLumi=100 #------------------------------------- @@ -236,6 +237,7 @@ #------------------------------------- # Scheduling #------------------------------------- +print("Final Source settings:", process.source) process.options = cms.untracked.PSet( Rethrow = cms.untracked.vstring( # "ProductNotFound", diff --git a/DQM/Integration/python/clients/hcalreco_dqm_sourceclient-live_cfg.py b/DQM/Integration/python/clients/hcalreco_dqm_sourceclient-live_cfg.py index 8e37ecc6756b4..a0367c856fc72 100644 --- a/DQM/Integration/python/clients/hcalreco_dqm_sourceclient-live_cfg.py +++ b/DQM/Integration/python/clients/hcalreco_dqm_sourceclient-live_cfg.py @@ -68,8 +68,9 @@ process.dqmSaverPB.runNumber = options.runNumber process = customise(process) process.DQMStore.verbose = 0 -if not useFileInput and not unitTest: - process.source.minEventsPerLumi = 5 +if not unitTest and not useFileInput: + if not options.BeamSplashRun : + process.source.minEventsPerLumi = 5 # Note, runType is obtained after importing DQM-related modules # => DQM-dependent @@ -196,4 +197,7 @@ "TooFewProducts" ) ) + process.options.wantSummary = True +print("Final Source settings:", process.source) + diff --git a/DQM/Integration/python/clients/hlt_dqm_clientPB-live_cfg.py b/DQM/Integration/python/clients/hlt_dqm_clientPB-live_cfg.py index 047c9b1924722..d76880246ec3b 100644 --- a/DQM/Integration/python/clients/hlt_dqm_clientPB-live_cfg.py +++ b/DQM/Integration/python/clients/hlt_dqm_clientPB-live_cfg.py @@ -85,5 +85,5 @@ process.load('DQM.HLTEvF.psMonitorClient_cfi') process.psChecker = process.psMonitorClient.clone() - +print("Final Source settings:", process.source) process.p = cms.EndPath( process.fastTimerServiceClient + process.throughputServiceClient + process.psColumnVsLumi + process.psChecker + process.dqmEnv + process.dqmSaver + process.dqmSaverPB ) diff --git a/DQM/Integration/python/clients/hlt_dqm_sourceclient-live_cfg.py b/DQM/Integration/python/clients/hlt_dqm_sourceclient-live_cfg.py index c2203f1eeb50b..19d4a18a757bb 100644 --- a/DQM/Integration/python/clients/hlt_dqm_sourceclient-live_cfg.py +++ b/DQM/Integration/python/clients/hlt_dqm_sourceclient-live_cfg.py @@ -136,3 +136,4 @@ ### process customizations included here from DQM.Integration.config.online_customizations_cfi import * process = customise(process) +print("Final Source settings:", process.source) diff --git a/DQM/Integration/python/clients/info_dqm_sourceclient-live_cfg.py b/DQM/Integration/python/clients/info_dqm_sourceclient-live_cfg.py index 6f1666f2313cd..bab64c29a006e 100644 --- a/DQM/Integration/python/clients/info_dqm_sourceclient-live_cfg.py +++ b/DQM/Integration/python/clients/info_dqm_sourceclient-live_cfg.py @@ -79,3 +79,4 @@ # Process customizations included here from DQM.Integration.config.online_customizations_cfi import * process = customise(process) +print("Final Source settings:", process.source) diff --git a/DQM/Integration/python/clients/l1tstage2_dqm_sourceclient-live_cfg.py b/DQM/Integration/python/clients/l1tstage2_dqm_sourceclient-live_cfg.py index 8f95e2b1b8fa4..cc0aae145ff1e 100644 --- a/DQM/Integration/python/clients/l1tstage2_dqm_sourceclient-live_cfg.py +++ b/DQM/Integration/python/clients/l1tstage2_dqm_sourceclient-live_cfg.py @@ -184,4 +184,4 @@ from DQM.Integration.config.online_customizations_cfi import * process = customise(process) - +print("Final Source settings:", process.source) diff --git a/DQM/Integration/python/clients/l1tstage2emulator_dqm_sourceclient-live_cfg.py b/DQM/Integration/python/clients/l1tstage2emulator_dqm_sourceclient-live_cfg.py index 6c660e08e7249..f1b7a69c79d23 100644 --- a/DQM/Integration/python/clients/l1tstage2emulator_dqm_sourceclient-live_cfg.py +++ b/DQM/Integration/python/clients/l1tstage2emulator_dqm_sourceclient-live_cfg.py @@ -180,3 +180,4 @@ from DQM.Integration.config.online_customizations_cfi import * process = customise(process) +print("Final Source settings:", process.source) diff --git a/DQM/Integration/python/clients/mutracking_dqm_sourceclient-live_cfg.py b/DQM/Integration/python/clients/mutracking_dqm_sourceclient-live_cfg.py index fc7262569776e..def262433037a 100644 --- a/DQM/Integration/python/clients/mutracking_dqm_sourceclient-live_cfg.py +++ b/DQM/Integration/python/clients/mutracking_dqm_sourceclient-live_cfg.py @@ -188,5 +188,6 @@ from DQM.Integration.config.online_customizations_cfi import * process = customise(process) - +process.options.wantSummary = cms.untracked.bool(True) +print("Final Source settings:", process.source) diff --git a/DQM/Integration/python/clients/onlinebeammonitor_dqm_sourceclient-live_cfg.py b/DQM/Integration/python/clients/onlinebeammonitor_dqm_sourceclient-live_cfg.py index c2082f42ccfaf..46e579f65fd74 100644 --- a/DQM/Integration/python/clients/onlinebeammonitor_dqm_sourceclient-live_cfg.py +++ b/DQM/Integration/python/clients/onlinebeammonitor_dqm_sourceclient-live_cfg.py @@ -171,4 +171,4 @@ process.p = cms.Path( process.dqmcommon * process.monitor ) - +print("Final Source settings:", process.source) diff --git a/DQM/Integration/python/clients/pixel_dqm_sourceclient-live_cfg.py b/DQM/Integration/python/clients/pixel_dqm_sourceclient-live_cfg.py index ed4e66d3a889e..1662356049622 100644 --- a/DQM/Integration/python/clients/pixel_dqm_sourceclient-live_cfg.py +++ b/DQM/Integration/python/clients/pixel_dqm_sourceclient-live_cfg.py @@ -252,3 +252,4 @@ #-------------------------------------------------- print("Running with run type = ", process.runType.getRunType()) +print("Final Source settings:", process.source) diff --git a/DQM/Integration/python/clients/pixellumi_dqm_sourceclient-live_cfg.py b/DQM/Integration/python/clients/pixellumi_dqm_sourceclient-live_cfg.py index f7e4ee9fdf91e..d7efdcfe9544d 100644 --- a/DQM/Integration/python/clients/pixellumi_dqm_sourceclient-live_cfg.py +++ b/DQM/Integration/python/clients/pixellumi_dqm_sourceclient-live_cfg.py @@ -142,3 +142,4 @@ ### process customizations included here from DQM.Integration.config.online_customizations_cfi import * process = customise(process) +print("Final Source settings:", process.source) diff --git a/DQM/Integration/python/clients/rpc_dqm_sourceclient-live_cfg.py b/DQM/Integration/python/clients/rpc_dqm_sourceclient-live_cfg.py index b0c99a3130971..0c84f0ca17f36 100644 --- a/DQM/Integration/python/clients/rpc_dqm_sourceclient-live_cfg.py +++ b/DQM/Integration/python/clients/rpc_dqm_sourceclient-live_cfg.py @@ -190,3 +190,6 @@ ### process customizations included here from DQM.Integration.config.online_customizations_cfi import * process = customise(process) +print("Final Source settings:", process.source) + + diff --git a/DQM/Integration/python/clients/scal_dqm_sourceclient-live_cfg.py b/DQM/Integration/python/clients/scal_dqm_sourceclient-live_cfg.py index 96d0368af11a4..3aca30e0fa20d 100644 --- a/DQM/Integration/python/clients/scal_dqm_sourceclient-live_cfg.py +++ b/DQM/Integration/python/clients/scal_dqm_sourceclient-live_cfg.py @@ -107,3 +107,4 @@ ### process customizations included here from DQM.Integration.config.online_customizations_cfi import * process = customise(process) +print("Final Source settings:", process.source) diff --git a/DQM/Integration/python/clients/sistrip_dqm_sourceclient-live_cfg.py b/DQM/Integration/python/clients/sistrip_dqm_sourceclient-live_cfg.py index 7b074f7ad715a..afac4d725764c 100644 --- a/DQM/Integration/python/clients/sistrip_dqm_sourceclient-live_cfg.py +++ b/DQM/Integration/python/clients/sistrip_dqm_sourceclient-live_cfg.py @@ -288,6 +288,17 @@ ) +### COMMISSIONING RUN SETTINGS +if (process.runType.getRunType() == process.runType.commissioning_run): + #event selection for commissioning runs + if ((process.runType.getRunType() == process.runType.commissioning_run) and live): + process.source.SelectEvents = ['HLT_*'] + + process.SiStripFedMonitor = cms.Sequence(process.siStripFEDMonitor) + process.p = cms.Path( + process.siStripFEDCheck * + process.SiStripFedMonitor + ) #else : ### pp COLLISION SETTING @@ -648,3 +659,4 @@ ### process customizations included here from DQM.Integration.config.online_customizations_cfi import * process = customise(process) +print("Final Source settings:", process.source) diff --git a/DQM/Integration/python/clients/visualization-live-secondInstance_cfg.py b/DQM/Integration/python/clients/visualization-live-secondInstance_cfg.py index 38273da9aaf35..be6aff821d2e9 100644 --- a/DQM/Integration/python/clients/visualization-live-secondInstance_cfg.py +++ b/DQM/Integration/python/clients/visualization-live-secondInstance_cfg.py @@ -14,7 +14,7 @@ if unitTest: from DQM.Integration.config.unittestinputsource_cfi import options, runType, source else: - from DQM.Integration.config.inputsource_cfi import options, runType, source + from DQM.Integration.config.inputsource_cfi import options, runType, source, set_BeamSplashRun_settings # this is needed to map the names of the run-types chosen by DQM to the scenarios, ideally we could converge to the same names #scenarios = {'pp_run': 'ppEra_Run2_2016','cosmic_run':'cosmicsEra_Run2_2016','hi_run':'HeavyIons'} @@ -27,6 +27,11 @@ scenarioName = scenarios[runType.getRunTypeName()] +if not unitTest : + if options.BeamSplashRun : + # scenarioName = 'ppEra_Run3' FIXME + pass + print("Using scenario:",scenarioName) try: @@ -68,6 +73,8 @@ process.source.minEventsPerLumi = 0 process.source.nextLumiTimeoutMillis = 10000 process.source.streamLabel = 'streamDQMEventDisplay' + if options.BeamSplashRun : + set_BeamSplashRun_settings( process.source ) m = re.search(r"\((\w+)\)", str(source.runNumber)) runno = str(m.group(1)) @@ -118,3 +125,4 @@ psetFile.close() cmsRun = "cmsRun -e RunVisualizationProcessingCfg.py" print("Now do:\n%s" % cmsRun) +print("Final Source settings:", process.source) diff --git a/DQM/Integration/python/clients/visualization-live_cfg.py b/DQM/Integration/python/clients/visualization-live_cfg.py index 621c3b595cf98..698ae619b5aa6 100644 --- a/DQM/Integration/python/clients/visualization-live_cfg.py +++ b/DQM/Integration/python/clients/visualization-live_cfg.py @@ -14,7 +14,7 @@ if unitTest: from DQM.Integration.config.unittestinputsource_cfi import options, runType, source else: - from DQM.Integration.config.inputsource_cfi import options, runType, source + from DQM.Integration.config.inputsource_cfi import options, runType, source, set_BeamSplashRun_settings # this is needed to map the names of the run-types chosen by DQM to the scenarios, ideally we could converge to the same names #scenarios = {'pp_run': 'ppEra_Run2_2016','cosmic_run':'cosmicsEra_Run2_2016','hi_run':'HeavyIons'} @@ -27,6 +27,11 @@ scenarioName = scenarios[runType.getRunTypeName()] +if not unitTest : + if options.BeamSplashRun : + # scenarioName = 'ppEra_Run3' #FIXME + pass + print("Using scenario:",scenarioName) try: @@ -66,6 +71,8 @@ process.source.minEventsPerLumi = 0 process.source.nextLumiTimeoutMillis = 10000 process.source.streamLabel = 'streamDQM' + if options.BeamSplashRun : + set_BeamSplashRun_settings( process.source ) m = re.search(r"\((\w+)\)", str(source.runNumber)) runno = str(m.group(1)) @@ -113,3 +120,4 @@ psetFile.close() cmsRun = "cmsRun -e RunVisualizationProcessingCfg.py" print("Now do:\n%s" % cmsRun) +print("Final Source settings:", process.source) diff --git a/DQM/Integration/python/config/dqmPythonTypes.py b/DQM/Integration/python/config/dqmPythonTypes.py index c12f2757a05a8..79fc6e2a8594d 100644 --- a/DQM/Integration/python/config/dqmPythonTypes.py +++ b/DQM/Integration/python/config/dqmPythonTypes.py @@ -2,7 +2,7 @@ from FWCore.ParameterSet.Types import PSet import FWCore.ParameterSet.Config as cms class RunType(PSet): - def __init__(self,types=['pp_run','pp_run_stage1','cosmic_run','cosmic_run_stage1','hi_run','hpu_run']): + def __init__(self,types=['pp_run','pp_run_stage1','cosmic_run','cosmic_run_stage1','hi_run','hpu_run','commissioning_run']): PSet.__init__(self) self.__runTypesDict = {} t=[(x,types.index(x)) for x in types ] diff --git a/DQM/Integration/python/config/inputsource_cfi.py b/DQM/Integration/python/config/inputsource_cfi.py index ebc4a3036d526..8fbbdc218e491 100644 --- a/DQM/Integration/python/config/inputsource_cfi.py +++ b/DQM/Integration/python/config/inputsource_cfi.py @@ -45,6 +45,12 @@ VarParsing.VarParsing.varType.bool, "Don't upload the BeamSpot conditions to the DB") +options.register('BeamSplashRun', + False, # default value + VarParsing.VarParsing.multiplicity.singleton, + VarParsing.VarParsing.varType.bool, + "Set client source settings for beam SPLASH run") + # Parameters for runType options.register ('runkey', @@ -110,4 +116,17 @@ # secondaryFileNames = cms.untracked.vstring() #) -print("Source:", source) +# https://twiki.cern.ch/twiki/bin/viewauth/CMS/CMSBeamSplash2017 +def set_BeamSplashRun_settings( source ): + source.minEventsPerLumi = 1000000 + source.nextLumiTimeoutMillis = 15000 + +if options.BeamSplashRun : set_BeamSplashRun_settings( source ) + +print("Initial Source settings:", source) + + + + + + diff --git a/DQM/Integration/python/config/pbsource_cfi.py b/DQM/Integration/python/config/pbsource_cfi.py index b3ba96c4aafa4..127df864e5ed8 100644 --- a/DQM/Integration/python/config/pbsource_cfi.py +++ b/DQM/Integration/python/config/pbsource_cfi.py @@ -32,6 +32,12 @@ VarParsing.VarParsing.varType.bool, "Skip (and ignore the minEventsPerLumi parameter) for the files which have been available at the begining of the processing. ") +options.register('BeamSplashRun', + False, # default value + VarParsing.VarParsing.multiplicity.singleton, + VarParsing.VarParsing.varType.bool, + "Set client source settings for beam SPLASH run") + # Parameters for runType options.register ('runkey', @@ -83,4 +89,13 @@ endOfRunKills = cms.untracked.bool(endOfRunKills), ) -print("Source:", source) +# https://twiki.cern.ch/twiki/bin/viewauth/CMS/CMSBeamSplash2017 +def set_BeamSplashRun_settings( source ): + # source.minEventsPerLumi = 1000000 + source.nextLumiTimeoutMillis = 15000 + +if options.BeamSplashRun : set_BeamSplashRun_settings( source ) + +print("Initial Source settings:", source) + + diff --git a/DQM/L1TMonitor/interface/L1ExtraDQM.h b/DQM/L1TMonitor/interface/L1ExtraDQM.h index 69311a3f12f00..ca298444d70fd 100644 --- a/DQM/L1TMonitor/interface/L1ExtraDQM.h +++ b/DQM/L1TMonitor/interface/L1ExtraDQM.h @@ -65,7 +65,6 @@ #include "DQMServices/Core/interface/DQMStore.h" -#include "boost/lexical_cast.hpp" #include "DQMServices/Core/interface/DQMOneEDAnalyzer.h" // forward declarations diff --git a/DQM/L1TMonitor/interface/L1TdeCSCTPG.h b/DQM/L1TMonitor/interface/L1TdeCSCTPG.h index 9d45e16b63b23..2f1e0bc0918e5 100644 --- a/DQM/L1TMonitor/interface/L1TdeCSCTPG.h +++ b/DQM/L1TMonitor/interface/L1TdeCSCTPG.h @@ -61,9 +61,12 @@ class L1TdeCSCTPG : public DQMEDAnalyzer { /* When set to True, we assume that the data comes from the Building 904 CSC test-stand. This test-stand is a single - ME1/1 chamber. + ME1/1 chamber or ME4/2 chamber. */ - bool B904Setup_; + bool useB904_; + bool useB904ME11_; + bool useB904ME21_; + bool useB904ME234s2_; bool isRun3_; diff --git a/DQM/L1TMonitor/python/L1TStage2Emulator_cff.py b/DQM/L1TMonitor/python/L1TStage2Emulator_cff.py index f22f2b69497c3..1e88818c06ab6 100644 --- a/DQM/L1TMonitor/python/L1TStage2Emulator_cff.py +++ b/DQM/L1TMonitor/python/L1TStage2Emulator_cff.py @@ -55,6 +55,8 @@ valMuonGEMPadDigis = simMuonGEMPadDigis.clone(InputCollection = "muonGEMDigis") valMuonGEMPadDigiClusters = simMuonGEMPadDigiClusters.clone(InputCollection = "valMuonGEMPadDigis") +# Lookup tables for the CSC TP emulator +from CalibMuon.CSCCalibration.CSCL1TPLookupTableEP_cff import * # CSC TPG from L1Trigger.CSCTriggerPrimitives.cscTriggerPrimitiveDigis_cfi import * valCscStage2Digis = cscTriggerPrimitiveDigis.clone( diff --git a/DQM/L1TMonitor/python/L1TdeCSCTPG_cfi.py b/DQM/L1TMonitor/python/L1TdeCSCTPG_cfi.py index 0e5980f5513ac..c7c91ecc0f514 100644 --- a/DQM/L1TMonitor/python/L1TdeCSCTPG_cfi.py +++ b/DQM/L1TMonitor/python/L1TdeCSCTPG_cfi.py @@ -28,7 +28,9 @@ lctNBin = cms.vuint32(16, 116, 224, 16, 2, 448, 896, 5, 16, 2, 2), lctMinBin = cms.vdouble(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), lctMaxBin = cms.vdouble(16, 116, 224, 16, 2, 448, 896, 5, 16, 2, 2), - B904Setup = cms.bool(False), + useB904ME11 = cms.bool(False), + useB904ME21 = cms.bool(False), + useB904ME234s2 = cms.bool(False), isRun3 = cms.bool(False), preTriggerAnalysis = cms.bool(False) ) diff --git a/DQM/L1TMonitor/src/L1TdeCSCTPG.cc b/DQM/L1TMonitor/src/L1TdeCSCTPG.cc index 0fce802af66b2..f0f7e0f9e4970 100644 --- a/DQM/L1TMonitor/src/L1TdeCSCTPG.cc +++ b/DQM/L1TMonitor/src/L1TdeCSCTPG.cc @@ -30,9 +30,13 @@ L1TdeCSCTPG::L1TdeCSCTPG(const edm::ParameterSet& ps) alctMaxBin_(ps.getParameter>("alctMaxBin")), clctMaxBin_(ps.getParameter>("clctMaxBin")), lctMaxBin_(ps.getParameter>("lctMaxBin")), - B904Setup_(ps.getParameter("B904Setup")), + useB904ME11_(ps.getParameter("useB904ME11")), + useB904ME21_(ps.getParameter("useB904ME21")), + useB904ME234s2_(ps.getParameter("useB904ME234s2")), isRun3_(ps.getParameter("isRun3")), - preTriggerAnalysis_(ps.getParameter("preTriggerAnalysis")) {} + preTriggerAnalysis_(ps.getParameter("preTriggerAnalysis")) { + useB904_ = useB904ME11_ or useB904ME21_ or useB904ME234s2_; +} L1TdeCSCTPG::~L1TdeCSCTPG() {} @@ -45,10 +49,23 @@ void L1TdeCSCTPG::bookHistograms(DQMStore::IBooker& iBooker, const edm::Run&, co lctVars_.resize(5); } - // remove the non-ME1/1 chambers from the list when B904Setup is set to true - if (B904Setup_) { + // remove the non-ME1/1 chambers from the list when useB904ME11 is set to true + if (useB904ME11_) { + chambers_.resize(1); + } + // similar for ME2/1 + else if (useB904ME21_) { + auto temp = chambers_[3]; + chambers_.resize(1); + chambers_[0] = temp; + } + // similar for ME4/2 + else if (useB904ME234s2_) { + auto temp = chambers_.back(); chambers_.resize(1); + chambers_[0] = temp; } + // do not analyze the 1/4-strip bit, 1/8-strip bit else { clctVars_.resize(9); @@ -109,15 +126,23 @@ void L1TdeCSCTPG::analyze(const edm::Event& e, const edm::EventSetup& c) { e.getByToken(dataLCT_token_, dataLCTs); e.getByToken(emulLCT_token_, emulLCTs); // only do pre-trigger analysis when B904 setup is used - if (B904Setup_) + if (useB904_) e.getByToken(emulpreCLCT_token_, emulpreCLCTs); for (auto it = dataALCTs->begin(); it != dataALCTs->end(); it++) { auto range = dataALCTs->get((*it).first); - const int type = ((*it).first).iChamberType() - 2; + const CSCDetId& detid((*it).first); + int type = ((*it).first).iChamberType() - 2; // ignore non-ME1/1 chambers when using B904 test-stand data - if (B904Setup_ and !((*it).first).isME11()) + if (useB904ME11_ and !(detid.isME11())) + continue; + if (useB904ME21_ and !(detid.isME21())) + continue; + if (useB904ME234s2_ and !(detid.isME22() or detid.isME32() or detid.isME42())) continue; + // to prevent crashes because you are booking histos for single b904 chamber + if (useB904ME234s2_ or useB904ME21_) + type = 0; for (auto alct = range.first; alct != range.second; alct++) { if (alct->isValid()) { chamberHistos[type]["alct_quality_data"]->Fill(alct->getQuality()); @@ -129,10 +154,18 @@ void L1TdeCSCTPG::analyze(const edm::Event& e, const edm::EventSetup& c) { for (auto it = emulALCTs->begin(); it != emulALCTs->end(); it++) { auto range = emulALCTs->get((*it).first); - const int type = ((*it).first).iChamberType() - 2; + const CSCDetId& detid((*it).first); + int type = ((*it).first).iChamberType() - 2; // ignore non-ME1/1 chambers when using B904 test-stand data - if (B904Setup_ and !((*it).first).isME11()) + if (useB904ME11_ and !(detid.isME11())) + continue; + if (useB904ME21_ and !(detid.isME21())) + continue; + if (useB904ME234s2_ and !(detid.isME22() or detid.isME32() or detid.isME42())) continue; + // to prevent crashes because you are booking histos for single b904 chamber + if (useB904ME234s2_ or useB904ME21_) + type = 0; for (auto alct = range.first; alct != range.second; alct++) { if (alct->isValid()) { chamberHistos[type]["alct_quality_emul"]->Fill(alct->getQuality()); @@ -148,10 +181,18 @@ void L1TdeCSCTPG::analyze(const edm::Event& e, const edm::EventSetup& c) { for (auto it = dataCLCTs->begin(); it != dataCLCTs->end(); it++) { auto range = dataCLCTs->get((*it).first); - const int type = ((*it).first).iChamberType() - 2; + const CSCDetId& detid((*it).first); + int type = ((*it).first).iChamberType() - 2; // ignore non-ME1/1 chambers when using B904 test-stand data - if (B904Setup_ and !((*it).first).isME11()) + if (useB904ME11_ and !(detid.isME11())) continue; + if (useB904ME21_ and !(detid.isME21())) + continue; + if (useB904ME234s2_ and !(detid.isME22() or detid.isME32() or detid.isME42())) + continue; + // to prevent crashes because you are booking histos for single b904 chamber + if (useB904ME234s2_ or useB904ME21_) + type = 0; for (auto clct = range.first; clct != range.second; clct++) { if (clct->isValid()) { if (preTriggerAnalysis_) { @@ -167,7 +208,7 @@ void L1TdeCSCTPG::analyze(const edm::Event& e, const edm::EventSetup& c) { chamberHistos[type]["clct_eighthstrip_data"]->Fill(clct->getKeyStrip(8)); chamberHistos[type]["clct_slope_data"]->Fill(clct->getSlope()); chamberHistos[type]["clct_compcode_data"]->Fill(clct->getCompCode()); - if (B904Setup_) { + if (useB904_) { chamberHistos[type]["clct_quartstripbit_data"]->Fill(clct->getQuartStripBit()); chamberHistos[type]["clct_eighthstripbit_data"]->Fill(clct->getEighthStripBit()); } @@ -178,10 +219,18 @@ void L1TdeCSCTPG::analyze(const edm::Event& e, const edm::EventSetup& c) { for (auto it = emulCLCTs->begin(); it != emulCLCTs->end(); it++) { auto range = emulCLCTs->get((*it).first); - const int type = ((*it).first).iChamberType() - 2; + const CSCDetId& detid((*it).first); + int type = ((*it).first).iChamberType() - 2; // ignore non-ME1/1 chambers when using B904 test-stand data - if (B904Setup_ and !((*it).first).isME11()) + if (useB904ME11_ and !(detid.isME11())) + continue; + if (useB904ME21_ and !(detid.isME21())) continue; + if (useB904ME234s2_ and !(detid.isME22() or detid.isME32() or detid.isME42())) + continue; + // to prevent crashes because you are booking histos for single b904 chamber + if (useB904ME234s2_ or useB904ME21_) + type = 0; // remove the duplicate CLCTs // these are CLCTs that have the same properties as CLCTs found // before by the emulator, except for the BX, which is off by +1 @@ -205,7 +254,7 @@ void L1TdeCSCTPG::analyze(const edm::Event& e, const edm::EventSetup& c) { chamberHistos[type]["clct_eighthstrip_emul"]->Fill(clct.getKeyStrip(8)); chamberHistos[type]["clct_slope_emul"]->Fill(clct.getSlope()); chamberHistos[type]["clct_compcode_emul"]->Fill(clct.getCompCode()); - if (B904Setup_) { + if (useB904_) { chamberHistos[type]["clct_quartstripbit_emul"]->Fill(clct.getQuartStripBit()); chamberHistos[type]["clct_eighthstripbit_emul"]->Fill(clct.getEighthStripBit()); } @@ -234,10 +283,18 @@ void L1TdeCSCTPG::analyze(const edm::Event& e, const edm::EventSetup& c) { for (auto it = dataLCTs->begin(); it != dataLCTs->end(); it++) { auto range = dataLCTs->get((*it).first); - const int type = ((*it).first).iChamberType() - 2; + const CSCDetId& detid((*it).first); + int type = ((*it).first).iChamberType() - 2; // ignore non-ME1/1 chambers when using B904 test-stand data - if (B904Setup_ and !((*it).first).isME11()) + if (useB904ME11_ and !(detid.isME11())) + continue; + if (useB904ME21_ and !(detid.isME21())) continue; + if (useB904ME234s2_ and !(detid.isME22() or detid.isME32() or detid.isME42())) + continue; + // to prevent crashes because you are booking histos for single b904 chamber + if (useB904ME234s2_ or useB904ME21_) + type = 0; for (auto lct = range.first; lct != range.second; lct++) { if (lct->isValid()) { chamberHistos[type]["lct_pattern_data"]->Fill(lct->getPattern()); @@ -250,7 +307,7 @@ void L1TdeCSCTPG::analyze(const edm::Event& e, const edm::EventSetup& c) { chamberHistos[type]["lct_slope_data"]->Fill(lct->getSlope()); chamberHistos[type]["lct_quartstrip_data"]->Fill(lct->getStrip(4)); chamberHistos[type]["lct_eighthstrip_data"]->Fill(lct->getStrip(8)); - if (B904Setup_) { + if (useB904_) { chamberHistos[type]["lct_quartstripbit_data"]->Fill(lct->getQuartStripBit()); chamberHistos[type]["lct_eighthstripbit_data"]->Fill(lct->getEighthStripBit()); } @@ -261,11 +318,18 @@ void L1TdeCSCTPG::analyze(const edm::Event& e, const edm::EventSetup& c) { for (auto it = emulLCTs->begin(); it != emulLCTs->end(); it++) { auto range = emulLCTs->get((*it).first); - const int type = ((*it).first).iChamberType() - 2; + const CSCDetId& detid((*it).first); + int type = ((*it).first).iChamberType() - 2; // ignore non-ME1/1 chambers when using B904 test-stand data - if (B904Setup_ and !((*it).first).isME11()) + if (useB904ME11_ and !(detid.isME11())) continue; - + if (useB904ME21_ and !(detid.isME21())) + continue; + if (useB904ME234s2_ and !(detid.isME22() or detid.isME32() or detid.isME42())) + continue; + // to prevent crashes because you are booking histos for single b904 chamber + if (useB904ME234s2_ or useB904ME21_) + type = 0; // remove the duplicate LCTs // these are LCTs that have the same properties as LCTs found // before by the emulator, except for the BX, which is off by +1 @@ -287,7 +351,7 @@ void L1TdeCSCTPG::analyze(const edm::Event& e, const edm::EventSetup& c) { chamberHistos[type]["lct_slope_emul"]->Fill(lct.getSlope()); chamberHistos[type]["lct_quartstrip_emul"]->Fill(lct.getStrip(4)); chamberHistos[type]["lct_eighthstrip_emul"]->Fill(lct.getStrip(8)); - if (B904Setup_) { + if (useB904_) { chamberHistos[type]["lct_quartstripbit_emul"]->Fill(lct.getQuartStripBit()); chamberHistos[type]["lct_eighthstripbit_emul"]->Fill(lct.getEighthStripBit()); } diff --git a/DQM/L1TMonitorClient/interface/L1TdeCSCTPGClient.h b/DQM/L1TMonitorClient/interface/L1TdeCSCTPGClient.h index dad9dced6b1a7..4f5a2cdbc7870 100644 --- a/DQM/L1TMonitorClient/interface/L1TdeCSCTPGClient.h +++ b/DQM/L1TMonitorClient/interface/L1TdeCSCTPGClient.h @@ -53,7 +53,10 @@ class L1TdeCSCTPGClient : public DQMEDHarvester { the Building 904 CSC test-stand. This test-stand is a single ME1/1 chamber. */ - bool B904Setup_; + bool useB904_; + bool useB904ME11_; + bool useB904ME21_; + bool useB904ME234s2_; bool isRun3_; diff --git a/DQM/L1TMonitorClient/src/L1TdeCSCTPGClient.cc b/DQM/L1TMonitorClient/src/L1TdeCSCTPGClient.cc index 9240368f9026c..7e724d9919d44 100644 --- a/DQM/L1TMonitorClient/src/L1TdeCSCTPGClient.cc +++ b/DQM/L1TMonitorClient/src/L1TdeCSCTPGClient.cc @@ -27,8 +27,12 @@ L1TdeCSCTPGClient::L1TdeCSCTPGClient(const edm::ParameterSet &ps) alctMaxBin_(ps.getParameter>("alctMaxBin")), clctMaxBin_(ps.getParameter>("clctMaxBin")), lctMaxBin_(ps.getParameter>("lctMaxBin")), - B904Setup_(ps.getParameter("B904Setup")), - isRun3_(ps.getParameter("isRun3")) {} + useB904ME11_(ps.getParameter("useB904ME11")), + useB904ME21_(ps.getParameter("useB904ME21")), + useB904ME234s2_(ps.getParameter("useB904ME234s2")), + isRun3_(ps.getParameter("isRun3")) { + useB904_ = useB904ME11_ or useB904ME21_ or useB904ME234s2_; +} L1TdeCSCTPGClient::~L1TdeCSCTPGClient() {} @@ -55,9 +59,21 @@ void L1TdeCSCTPGClient::book(DQMStore::IBooker &iBooker) { lctVars_.resize(5); } - // remove the non-ME1/1 chambers from the list when B904Setup is set to true - if (B904Setup_) { + // remove the non-ME1/1 chambers from the list when useB904ME11 is set to true + if (useB904ME11_) { + chambers_.resize(1); + } + // similar for ME2/1 + else if (useB904ME21_) { + auto temp = chambers_[3]; + chambers_.resize(1); + chambers_[0] = temp; + } + // similar for ME4/2 + else if (useB904ME234s2_) { + auto temp = chambers_.back(); chambers_.resize(1); + chambers_[0] = temp; } // do not analyze the 1/4-strip bit, 1/8-strip bit else { diff --git a/DQM/Physics/BuildFile.xml b/DQM/Physics/BuildFile.xml index 5d68d7f2833d8..5fda1b5441f7b 100644 --- a/DQM/Physics/BuildFile.xml +++ b/DQM/Physics/BuildFile.xml @@ -24,5 +24,4 @@ - diff --git a/DQM/Physics/src/QcdUeDQM.cc b/DQM/Physics/src/QcdUeDQM.cc index cf42e21baf121..9fe3cb09d7158 100644 --- a/DQM/Physics/src/QcdUeDQM.cc +++ b/DQM/Physics/src/QcdUeDQM.cc @@ -17,7 +17,6 @@ #include "FWCore/MessageLogger/interface/MessageLogger.h" #include "FWCore/ServiceRegistry/interface/Service.h" #include "Geometry/CommonDetUnit/interface/GeomDet.h" -#include "CommonTools/RecoAlgos/interface/TrackToRefCandidate.h" #include "Geometry/Records/interface/TrackerDigiGeometryRecord.h" #include "Geometry/CommonDetUnit/interface/PixelGeomDetType.h" #include "Geometry/CommonDetUnit/interface/PixelGeomDetUnit.h" diff --git a/DQM/SiPixelMonitorClient/src/SiPixelActionExecutor.cc b/DQM/SiPixelMonitorClient/src/SiPixelActionExecutor.cc index dfb1bfadf7273..f7ed01fdb6462 100644 --- a/DQM/SiPixelMonitorClient/src/SiPixelActionExecutor.cc +++ b/DQM/SiPixelMonitorClient/src/SiPixelActionExecutor.cc @@ -1875,9 +1875,9 @@ void SiPixelActionExecutor::normaliseAvDigiOcc(DQMStore::IBooker &iBooker, DQMSt float averageFPIXOcc = totalDigisFPIX / 8.; for (int i = 1; i != 41; i++) { if (i < 33) - roccupancyPlot->setBinContent(i, roccupancyPlot->getBinContent(i) / averageBPIXOcc); + roccupancyPlot->setBinContent(i, averageBPIXOcc != 0. ? roccupancyPlot->getBinContent(i) / averageBPIXOcc : 0.); else - roccupancyPlot->setBinContent(i, roccupancyPlot->getBinContent(i) / averageFPIXOcc); + roccupancyPlot->setBinContent(i, averageFPIXOcc != 0. ? roccupancyPlot->getBinContent(i) / averageFPIXOcc : 0.); } iGetter.setCurrentFolder(iBooker.pwd()); @@ -1903,10 +1903,13 @@ void SiPixelActionExecutor::normaliseAvDigiOccVsLumi(DQMStore::IBooker &iBooker, float averageBPIXOcc = totalDigisBPIX / 32.; float averageFPIXOcc = totalDigisFPIX / 8.; for (int i = 1; i != 41; i++) { - if (i < 33) - avgfedDigiOccvsLumi->setBinContent(lumisec, i, avgfedDigiOccvsLumi->getBinContent(lumisec, i) / averageBPIXOcc); - else - avgfedDigiOccvsLumi->setBinContent(lumisec, i, avgfedDigiOccvsLumi->getBinContent(lumisec, i) / averageFPIXOcc); + if (i < 33) { + avgfedDigiOccvsLumi->setBinContent( + lumisec, i, averageBPIXOcc != 0. ? avgfedDigiOccvsLumi->getBinContent(lumisec, i) / averageBPIXOcc : 0.); + } else { + avgfedDigiOccvsLumi->setBinContent( + lumisec, i, averageFPIXOcc != 0. ? avgfedDigiOccvsLumi->getBinContent(lumisec, i) / averageFPIXOcc : 0.); + } } iGetter.setCurrentFolder(iBooker.pwd()); diff --git a/DQM/SiPixelMonitorDigi/src/SiPixelDigiSource.cc b/DQM/SiPixelMonitorDigi/src/SiPixelDigiSource.cc index e8f3903623e19..cff88ed7e3327 100644 --- a/DQM/SiPixelMonitorDigi/src/SiPixelDigiSource.cc +++ b/DQM/SiPixelMonitorDigi/src/SiPixelDigiSource.cc @@ -137,11 +137,12 @@ void SiPixelDigiSource::globalEndLuminosityBlock(const edm::LuminosityBlock& lb, averageDigiOccupancy->Fill( i, averageOcc); // "modOn" basically mean Online DQM, in this case fill histos with actual value of digi fraction per fed for each ten lumisections - if (avgfedDigiOccvsLumi && thisls % 5 == 0) + if (avgfedDigiOccvsLumi && thisls % 5 == 0) { avgfedDigiOccvsLumi->setBinContent( int(thisls / 5), i + 1, averageOcc); //fill with the mean over 5 lumisections, previous code was filling this histo only with last event of each 10th lumisection + } } } diff --git a/DQM/SiPixelPhase1Config/python/SiPixelPhase1OfflineDQM_harvesting_cff.py b/DQM/SiPixelPhase1Config/python/SiPixelPhase1OfflineDQM_harvesting_cff.py index 8fa1f33308eb0..0e23e659b60bd 100644 --- a/DQM/SiPixelPhase1Config/python/SiPixelPhase1OfflineDQM_harvesting_cff.py +++ b/DQM/SiPixelPhase1Config/python/SiPixelPhase1OfflineDQM_harvesting_cff.py @@ -16,10 +16,12 @@ + SiPixelPhase1SummaryOffline + SiPixelBarycenterOffline + SiPixelPhase1ResidualsExtra + + SiPixelPhase1EfficiencyExtras ) siPixelPhase1OfflineDQM_harvesting_cosmics = siPixelPhase1OfflineDQM_harvesting.copyAndExclude([ - SiPixelPhase1TrackEfficiencyHarvester, + SiPixelPhase1TrackEfficiencyHarvester, + SiPixelPhase1EfficiencyExtras, ]) siPixelPhase1OfflineDQM_harvesting_cosmics.replace(RunQTests_offline, RunQTests_cosmics) diff --git a/DQM/SiPixelPhase1Config/python/SiPixelPhase1OfflineDQM_source_cff.py b/DQM/SiPixelPhase1Config/python/SiPixelPhase1OfflineDQM_source_cff.py index a4131f6752cb0..21d7470e345d9 100644 --- a/DQM/SiPixelPhase1Config/python/SiPixelPhase1OfflineDQM_source_cff.py +++ b/DQM/SiPixelPhase1Config/python/SiPixelPhase1OfflineDQM_source_cff.py @@ -27,6 +27,7 @@ from RecoPixelVertexing.PixelLowPtUtilities.ClusterShapeHitFilterESProducer_cfi import * from RecoLocalTracker.SiStripClusterizer.SiStripClusterChargeCut_cfi import * +from DQM.SiPixelPhase1Track.SiPixelPhase1EfficiencyExtras_cfi import * PerModule.enabled = False IsOffline.enabled=True diff --git a/DQM/SiPixelPhase1Track/plugins/SiPixelPhase1EfficiencyExtras.cc b/DQM/SiPixelPhase1Track/plugins/SiPixelPhase1EfficiencyExtras.cc new file mode 100644 index 0000000000000..806caf980429c --- /dev/null +++ b/DQM/SiPixelPhase1Track/plugins/SiPixelPhase1EfficiencyExtras.cc @@ -0,0 +1,238 @@ +// -*- C++ -*- +// +// Package: SiPixelPhase1EfficiencyExtras +// Class: SiPixelPhase1EfficiencyExtras +// +/**\class + + Description: Create the Phase 1 extra efficiency trend plots + + Implementation: + +*/ +// +// Original Author: Jack Sisson, Julie Hogan +// Created: 7 July, 2021 +// +// + +// Framework +#include "FWCore/ServiceRegistry/interface/Service.h" +#include "FWCore/MessageLogger/interface/MessageLogger.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/Framework/interface/Frameworkfwd.h" +#include "FWCore/Framework/interface/MakerMacros.h" +#include "FWCore/Framework/interface/Event.h" +#include "FWCore/Framework/interface/EventSetup.h" + +// DQM Framework +#include "DQMServices/Core/interface/DQMStore.h" +#include "DQMServices/Core/interface/DQMEDHarvester.h" + +using namespace std; +using namespace edm; + +class SiPixelPhase1EfficiencyExtras : public DQMEDHarvester { +public: + explicit SiPixelPhase1EfficiencyExtras(const edm::ParameterSet& conf); + ~SiPixelPhase1EfficiencyExtras() override; + +protected: + void beginRun(edm::Run const& run, edm::EventSetup const& eSetup) override; + + void dqmEndJob(DQMStore::IBooker& iBooker, DQMStore::IGetter& iGetter) override; + + const std::string effFolderName_; + const std::string vtxFolderName_; + const std::string instLumiFolderName_; +}; + +SiPixelPhase1EfficiencyExtras::SiPixelPhase1EfficiencyExtras(const edm::ParameterSet& iConfig) + : effFolderName_(iConfig.getParameter("EffFolderName")), + vtxFolderName_(iConfig.getParameter("VtxFolderName")), + instLumiFolderName_(iConfig.getParameter("InstLumiFolderName")) { + LogInfo("PixelDQM") << "SiPixelPhase1EfficiencyExtras::SiPixelPhase1EfficiencyExtras: Hello!" << endl; +} + +SiPixelPhase1EfficiencyExtras::~SiPixelPhase1EfficiencyExtras() { + LogInfo("PixelDQM") << "SiPixelPhase1EfficiencyExtras::~SiPixelPhase1EfficiencyExtras: Destructor" << endl; +} + +void SiPixelPhase1EfficiencyExtras::beginRun(edm::Run const& run, edm::EventSetup const& eSetup) {} + +//------------------------------------------------------------------ +// Method called for every event +//------------------------------------------------------------------ +void SiPixelPhase1EfficiencyExtras::dqmEndJob(DQMStore::IBooker& iBooker, DQMStore::IGetter& iGetter) { + iBooker.setCurrentFolder(effFolderName_); + + //Get the existing histos + MonitorElement* vtx_v_lumi = iGetter.get(vtxFolderName_ + "/NumberOfGoodPVtxVsLS_GenTk"); + + MonitorElement* scalLumi_v_lumi = iGetter.get(instLumiFolderName_ + "/lumiVsLS"); + + MonitorElement* eff_v_lumi_forward = + iGetter.get(effFolderName_ + "/hitefficiency_per_Lumisection_per_PXDisk_PXForward"); + + MonitorElement* eff_v_lumi_barrel = + iGetter.get(effFolderName_ + "/hitefficiency_per_Lumisection_per_PXLayer_PXBarrel"); + + //set up some booleans that will tell us which graphs to create + bool createNvtx = true; + bool createInstLumi = true; + + //check which of the MEs exist and respond appropriately + if (!eff_v_lumi_forward) { + edm::LogWarning("SiPixelPhase1EfficiencyExtras") + << "no hitefficiency_per_Lumisection_per_PXDisk_PXForward ME is available in " << effFolderName_ << std::endl; + return; + } + if (!eff_v_lumi_barrel) { + edm::LogWarning("SiPixelPhase1EfficiencyExtras") + << "no hitefficiency_per_Lumisection_per_PXLayer_PXBarrel ME is available in " << effFolderName_ << std::endl; + return; + } + if (!vtx_v_lumi) { + edm::LogWarning("SiPixelPhase1EfficiencyExtras") + << "no NumberOfGoodPVtxVsLS_GenTK ME is available in " << vtxFolderName_ << std::endl; + createNvtx = false; + } + if (!scalLumi_v_lumi) { + edm::LogWarning("SiPixelPhase1EfficiencyExtras") + << "no lumiVsLS ME is available in " << instLumiFolderName_ << std::endl; + createInstLumi = false; + } + + //If the existing MEs are empty, set the boolean to skip booking + if (vtx_v_lumi && vtx_v_lumi->getEntries() == 0) + createNvtx = false; + if (scalLumi_v_lumi && scalLumi_v_lumi->getEntries() == 0) + createInstLumi = false; + + double eff = 0.0; + + //Will pass if nvtx ME exists and is not empty + if (createNvtx) { + //Book new histos + MonitorElement* eff_v_vtx_barrel = + iBooker.book2D("hitefficiency_per_meanNvtx_per_PXLayer_PXBarrel", + "hitefficiency_per_meanNvtx_per_PXLayer_PXBarrel; meanNvtx; PXLayer", + 500, + 0, + 100, + 3, + .5, + 3.5); + + MonitorElement* eff_v_vtx_forward = + iBooker.book2D("hitefficiency_per_meanNvtx_per_PXDisk_PXForward", + "hitefficiency_per_meanNvtx_per_PXDisk_PXForward; meanNvtx; PXDisk", + 500, + 0, + 100, + 7, + -3.5, + 3.5); + + //initialize variables + int numLumiNvtx = int(vtx_v_lumi->getNbinsX()); + double nvtx = 0.0; + int binNumVtx = 0; + + //For loop to loop through lumisections + for (int iLumi = 1; iLumi < numLumiNvtx - 1; iLumi++) { + //get the meanNvtx for each lumi + nvtx = vtx_v_lumi->getBinContent(iLumi); + + //Filter out useless iterations + if (nvtx != 0) { + //Grab the bin number for the nvtx + binNumVtx = eff_v_vtx_barrel->getTH2F()->FindBin(nvtx); + + //loop through the layers + for (int iLayer = 1; iLayer < 8; iLayer++) { + //get the eff at the lumisection and layer + eff = eff_v_lumi_forward->getBinContent(iLumi - 1, iLayer); + + //set the efficiency in the new histo + eff_v_vtx_forward->setBinContent(binNumVtx, iLayer, eff); + } + + //loop through the layers + for (int iLayer = 1; iLayer < 5; iLayer++) { + //get the efficiency for each lumi at each layer + eff = eff_v_lumi_barrel->getBinContent(iLumi - 1, iLayer); + + //set the efficiency + eff_v_vtx_barrel->setBinContent(binNumVtx, iLayer, eff); + } + } + } + } + // Will pass if InstLumi ME exists and is not empty + if (createInstLumi) { + //Get the max value of inst lumi for plot + int yMax2 = scalLumi_v_lumi->getTProfile()->GetMaximum(); + yMax2 = yMax2 + yMax2 * .1; + + //Book new histos + MonitorElement* eff_v_scalLumi_barrel = + iBooker.book2D("hitefficiency_per_scalLumi_per_PXLayer_PXBarrel", + "hitefficiency_per_scalLumi_per_PXLayer_PXBarrel; scal inst lumi E30; PXLayer", + 500, + 0, + yMax2, + 3, + .5, + 3.5); + + MonitorElement* eff_v_scalLumi_forward = + iBooker.book2D("hitefficiency_per_scalLumi_per_PXDisk_PXForward", + "hitefficiency_per_scalLumi_per_PXDisk_PXForward; scal inst lumi E30; PXDisk", + 500, + 0, + yMax2, + 7, + -3.5, + 3.5); + + //initialize variables + int numLumiScal = int(scalLumi_v_lumi->getNbinsX()); + double scalLumi = 0.0; + int binNumScal = 0; + + //For loop to loop through lumisections + for (int iLumi = 1; iLumi < numLumiScal - 1; iLumi++) { + //get the inst lumi for each lumi + scalLumi = scalLumi_v_lumi->getBinContent(iLumi); + + //Filter out useless iterations + if (scalLumi != 0) { + //Grab the bin number for the inst lumi + binNumScal = eff_v_scalLumi_barrel->getTH2F()->FindBin(scalLumi); + + //loop through the layers + for (int iLayer = 1; iLayer < 8; iLayer++) { + //get the eff at the lumisection and layer + eff = eff_v_lumi_forward->getBinContent(iLumi - 1, iLayer); + + //set the efficiency in the new histo + eff_v_scalLumi_forward->setBinContent(binNumScal, iLayer, eff); + } + + //loop through the layers + for (int iLayer = 1; iLayer < 5; iLayer++) { + //get the eff at the lumisection and layer + eff = eff_v_lumi_barrel->getBinContent(iLumi - 1, iLayer); + + //set the efficiency in the new histo + eff_v_scalLumi_barrel->setBinContent(binNumScal, iLayer, eff); + } + } + } + } else + return; +} + +//define this as a plug-in +DEFINE_FWK_MODULE(SiPixelPhase1EfficiencyExtras); diff --git a/DQM/SiPixelPhase1Track/python/SiPixelPhase1EfficiencyExtras_cfi.py b/DQM/SiPixelPhase1Track/python/SiPixelPhase1EfficiencyExtras_cfi.py new file mode 100644 index 0000000000000..ae66b29b0a15e --- /dev/null +++ b/DQM/SiPixelPhase1Track/python/SiPixelPhase1EfficiencyExtras_cfi.py @@ -0,0 +1,9 @@ +import FWCore.ParameterSet.Config as cms +from DQMServices.Core.DQMEDHarvester import DQMEDHarvester + + +SiPixelPhase1EfficiencyExtras = DQMEDHarvester("SiPixelPhase1EfficiencyExtras", + EffFolderName = cms.string('PixelPhase1/Tracks/'), + VtxFolderName = cms.string('Tracking/TrackParameters/generalTracks/GeneralProperties/'), + InstLumiFolderName = cms.string('HLT/LumiMonitoring/') +) diff --git a/DQM/SiPixelPhase1Track/python/SiPixelPhase1TrackEfficiency_cfi.py b/DQM/SiPixelPhase1Track/python/SiPixelPhase1TrackEfficiency_cfi.py index 9c2fa7ce0aec6..2b43529e72d7f 100644 --- a/DQM/SiPixelPhase1Track/python/SiPixelPhase1TrackEfficiency_cfi.py +++ b/DQM/SiPixelPhase1Track/python/SiPixelPhase1TrackEfficiency_cfi.py @@ -74,9 +74,8 @@ xlabel = "#valid/(#valid+#missing)", dimensions = 1, specs = VPSet( - #2D profile maps per layer StandardSpecification2DProfile, - + #profiles per layer and shell Specification(PerLadder).groupBy("PXBarrel/Shell/PXLayer/SignedLadder") .reduce("MEAN") @@ -94,9 +93,20 @@ Specification().groupBy("PXForward/PXDisk") .reduce("MEAN") .groupBy("PXForward", "EXTEND_X") - .save() + .save(), - #StandardSpecificationPixelmapProfile + Specification(PerLayer2D) + .groupBy("PXBarrel/PXLayer/Lumisection") + .groupBy("PXBarrel/PXLayer", "EXTEND_X") + .groupBy("PXBarrel", "EXTEND_Y") + .reduce("MEAN") + .save(), + Specification(PerLayer2D) + .groupBy("PXForward/PXDisk/Lumisection") + .groupBy("PXForward/PXDisk", "EXTEND_X") + .groupBy("PXForward", "EXTEND_Y") + .reduce("MEAN") + .save(), ) ) diff --git a/DQM/SiStripCommissioningSources/src/PedsFullNoiseTask.cc b/DQM/SiStripCommissioningSources/src/PedsFullNoiseTask.cc index 5137b2f3adc64..b2c6bc2e97dd6 100644 --- a/DQM/SiStripCommissioningSources/src/PedsFullNoiseTask.cc +++ b/DQM/SiStripCommissioningSources/src/PedsFullNoiseTask.cc @@ -9,8 +9,6 @@ #include "FWCore/MessageLogger/interface/MessageLogger.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" -#include "boost/lexical_cast.hpp" - // ----------------------------------------------------------------------------- // PedsFullNoiseTask::PedsFullNoiseTask(DQMStore* dqm, const FedChannelConnection& conn, const edm::ParameterSet& pset) diff --git a/DQM/SiStripMonitorClient/bin/ls_cert.cc b/DQM/SiStripMonitorClient/bin/ls_cert.cc index 7dce64c99767c..8dc3baf63bf08 100644 --- a/DQM/SiStripMonitorClient/bin/ls_cert.cc +++ b/DQM/SiStripMonitorClient/bin/ls_cert.cc @@ -244,7 +244,6 @@ void ls_cert_type(string iDir, lsd[i] = templs; TDirectory* tempDir = dynamic_cast(file->Get(lsdir.str().c_str())); tempDir->cd(); - int j = 0; TIter nextTemp(tempDir->GetListOfKeys()); TKey* keyTemp; while ((keyTemp = dynamic_cast(nextTemp()))) { @@ -261,14 +260,13 @@ void ls_cert_type(string iDir, std::cout << typecert.c_str() << std::endl; tempvalue = atof(detvalue.c_str()); - for (j = 0; j < smax; j++) { + for (int j = 0; j < smax; j++) { if (strstr(typecert.c_str(), certflag[j].c_str()) != nullptr) v[j][i] = tempvalue; if (debug) std::cout << "Entering value " << tempvalue << " " << v[j][i] << " for " << certflag[j].c_str() << std::endl; } - j = j + 1; } } } diff --git a/DQM/SiStripMonitorClient/plugins/SiStripOfflineDQM.cc b/DQM/SiStripMonitorClient/plugins/SiStripOfflineDQM.cc index e3b51fcba6dfa..6c9c29a82de8e 100644 --- a/DQM/SiStripMonitorClient/plugins/SiStripOfflineDQM.cc +++ b/DQM/SiStripMonitorClient/plugins/SiStripOfflineDQM.cc @@ -37,6 +37,7 @@ //Run Info #include "CondFormats/RunInfo/interface/RunInfo.h" +#include "DQMServices/Core/interface/LegacyIOHelper.h" #include #include @@ -199,11 +200,13 @@ void SiStripOfflineDQM::endJob() { } bool SiStripOfflineDQM::openInputFile(DQMStore& dqm_store) { - if (inputFileName_.empty()) + if (inputFileName_.empty()) { return false; + } edm::LogInfo("OpenFile") << "SiStripOfflineDQM::openInputFile: Accessing root File" << inputFileName_; - dqm_store.open(inputFileName_, false); - return true; + dqm::harvesting::DQMStore* temp = dynamic_cast(&dqm_store); + LegacyIOHelper leo(temp); + return leo.open(inputFileName_); } #include "FWCore/Framework/interface/MakerMacros.h" diff --git a/DQM/SiStripMonitorClient/src/SiStripQualityChecker.cc b/DQM/SiStripMonitorClient/src/SiStripQualityChecker.cc index fb3b6885196d6..ac55780183d9f 100644 --- a/DQM/SiStripMonitorClient/src/SiStripQualityChecker.cc +++ b/DQM/SiStripMonitorClient/src/SiStripQualityChecker.cc @@ -230,7 +230,7 @@ void SiStripQualityChecker::fillDetectorStatus(DQMStore& dqm_store, const SiStri continue; dqm_store.cd(dname); ++xbin; - float flag; + float flag = 0; fillSubDetStatus(dqm_store, cabling, local_mes, xbin, flag); global_flag += flag; } diff --git a/DQM/SiStripMonitorClient/src/SiStripTrackerMapCreator.cc b/DQM/SiStripMonitorClient/src/SiStripTrackerMapCreator.cc index d9da603bbc8fc..c31818d04f2ff 100644 --- a/DQM/SiStripMonitorClient/src/SiStripTrackerMapCreator.cc +++ b/DQM/SiStripMonitorClient/src/SiStripTrackerMapCreator.cc @@ -150,6 +150,9 @@ void SiStripTrackerMapCreator::createForOffline(const edm::ParameterSet& tkmapPs << " with range set to 0.0 - 1.0"; trackerMap_->save(true, 0.0, 1.0, map_type + namesuffix + ".svg"); trackerMap_->save(true, 0.0, 1.0, map_type + namesuffix + ".png", 4500, 2400); + // reset the map name to ResidualsMean to restore the + // correct behaviour for the summary file creation + map_type = "ResidualsMean"; } else { edm::LogInfo("TkMapToBeSaved") << "Ready to save TkMap " << map_type << namesuffix << " with range set to " << tkMapMin_ << " - " << tkMapMax_; diff --git a/DQM/SiStripMonitorClient/test/BuildFile.xml b/DQM/SiStripMonitorClient/test/BuildFile.xml new file mode 100644 index 0000000000000..9d51043d4d848 --- /dev/null +++ b/DQM/SiStripMonitorClient/test/BuildFile.xml @@ -0,0 +1,4 @@ + + + + diff --git a/DQM/SiStripMonitorClient/test/TestDriver.cpp b/DQM/SiStripMonitorClient/test/TestDriver.cpp new file mode 100644 index 0000000000000..2f0e0c40064da --- /dev/null +++ b/DQM/SiStripMonitorClient/test/TestDriver.cpp @@ -0,0 +1,2 @@ +#include "FWCore/Utilities/interface/TestHelper.h" +RUNTEST() diff --git a/DQM/SiStripMonitorClient/test/test_SiStripDQM_OfflineTkMap.sh b/DQM/SiStripMonitorClient/test/test_SiStripDQM_OfflineTkMap.sh new file mode 100755 index 0000000000000..8d71811739e19 --- /dev/null +++ b/DQM/SiStripMonitorClient/test/test_SiStripDQM_OfflineTkMap.sh @@ -0,0 +1,14 @@ +#!/bin/bash +function die { echo $1: status $2; exit $2; } +GT=`echo ${@} | python3 -c 'import Configuration.AlCa.autoCond as AC;print(AC.autoCond["run3_data_prompt"])'` +RUN="319176" +DQMFILE="/store/group/comm_dqm/DQMGUI_data/Run2018/ZeroBias/R0003191xx/DQM_V0001_R000319176__ZeroBias__Run2018B-PromptReco-v2__DQMIO.root" +COMMMAND=`xrdfs cms-xrd-global.cern.ch locate $DQMFILE` +STATUS=$? +echo "xrdfs command status = "$STATUS +if [ $STATUS -eq 0 ]; then + echo "Using file ${DQMFILE} and run ${RUN}. Running in ${LOCAL_TEST_DIR}." + (cmsRun "${LOCAL_TEST_DIR}/SiStripDQM_OfflineTkMap_Template_cfg_DB.py" globalTag="$GT" runNumber="$RUN" dqmFile=" root://cms-xrd-global.cern.ch//$DQMFILE" detIdInfoFile="file.root") || die 'failed running SiStripDQM_OfflineTkMap_Template_cfg_DB.py' $? +else + die "SKIPPING test, file ${DQMFILE} not found" 0 +fi diff --git a/DQM/SiStripMonitorHardware/src/SiStripSpyEventMatcher.cc b/DQM/SiStripMonitorHardware/src/SiStripSpyEventMatcher.cc index 40edaf5ed2f0d..241003a5b4d25 100644 --- a/DQM/SiStripMonitorHardware/src/SiStripSpyEventMatcher.cc +++ b/DQM/SiStripMonitorHardware/src/SiStripSpyEventMatcher.cc @@ -6,7 +6,7 @@ #include "FWCore/Sources/interface/VectorInputSource.h" #include "FWCore/Sources/interface/VectorInputSourceDescription.h" #include "FWCore/Sources/interface/VectorInputSourceFactory.h" -#include "FWCore/Framework/src/SignallingProductRegistry.h" +#include "FWCore/Framework/interface/SignallingProductRegistry.h" #include "DataFormats/FEDRawData/interface/FEDRawDataCollection.h" #include "DataFormats/SiStripDigi/interface/SiStripRawDigi.h" #include "DataFormats/Common/interface/DetSetVector.h" diff --git a/DQM/TrackerRemapper/interface/Phase1PixelMaps.h b/DQM/TrackerRemapper/interface/Phase1PixelMaps.h index 9a22292fb7840..06f46b63ab1fc 100644 --- a/DQM/TrackerRemapper/interface/Phase1PixelMaps.h +++ b/DQM/TrackerRemapper/interface/Phase1PixelMaps.h @@ -80,7 +80,7 @@ class Phase1PixelMaps { // drawing methos void drawBarrelMaps(const std::string& currentHistoName, TCanvas& canvas, const char* drawOption = nullptr); void drawForwardMaps(const std::string& currentHistoName, TCanvas& canvas, const char* drawOption = nullptr); - void drawSummaryMaps(const std::string& currentHistoName, TCanvas& canvas); + void drawSummaryMaps(const std::string& currentHistoName, TCanvas& canvas, const char* drawOption = nullptr); private: Option_t* m_option; diff --git a/DQM/TrackerRemapper/src/Phase1PixelMaps.cc b/DQM/TrackerRemapper/src/Phase1PixelMaps.cc index 8be086c0d678a..96c7a6aa86c9e 100644 --- a/DQM/TrackerRemapper/src/Phase1PixelMaps.cc +++ b/DQM/TrackerRemapper/src/Phase1PixelMaps.cc @@ -393,7 +393,7 @@ void Phase1PixelMaps::drawForwardMaps(const std::string& currentHistoName, TCanv } //============================================================================ -void Phase1PixelMaps::drawSummaryMaps(const std::string& currentHistoName, TCanvas& canvas) { +void Phase1PixelMaps::drawSummaryMaps(const std::string& currentHistoName, TCanvas& canvas, const char* drawOption) { auto found = (std::find(m_knownNames.begin(), m_knownNames.end(), currentHistoName) != m_knownNames.end()); if (!m_isBooked.second || !m_isBooked.first || !found) { @@ -411,7 +411,8 @@ void Phase1PixelMaps::drawSummaryMaps(const std::string& currentHistoName, TCanv pxbTh2PolyBarrelSummary[currentHistoName]->SetMarkerSize(0.5); } pxbTh2PolyBarrelSummary[currentHistoName]->GetZaxis()->SetTitleOffset(1.4); - pxbTh2PolyBarrelSummary[currentHistoName]->Draw(); + pxbTh2PolyBarrelSummary[currentHistoName]->Draw("AL"); + pxbTh2PolyBarrelSummary[currentHistoName]->Draw(fmt::sprintf("%s%ssame", m_option, drawOption).c_str()); canvas.cd(2); adjustCanvasMargins(canvas.cd(2), 0.07, 0.02, 0.01, isText ? 0.05 : 0.15); @@ -420,7 +421,8 @@ void Phase1PixelMaps::drawSummaryMaps(const std::string& currentHistoName, TCanv pxfTh2PolyForwardSummary[currentHistoName]->SetMarkerSize(0.5); } pxfTh2PolyForwardSummary[currentHistoName]->GetZaxis()->SetTitleOffset(1.4); - pxfTh2PolyForwardSummary[currentHistoName]->Draw(); + pxfTh2PolyForwardSummary[currentHistoName]->Draw("AL"); + pxfTh2PolyForwardSummary[currentHistoName]->Draw(fmt::sprintf("%s%ssame", m_option, drawOption).c_str()); } //============================================================================ diff --git a/DQM/TrackerRemapper/src/Phase1PixelROCMaps.cc b/DQM/TrackerRemapper/src/Phase1PixelROCMaps.cc index 105b0d6dbdad6..f803b4f4c6ce3 100644 --- a/DQM/TrackerRemapper/src/Phase1PixelROCMaps.cc +++ b/DQM/TrackerRemapper/src/Phase1PixelROCMaps.cc @@ -645,6 +645,7 @@ void Phase1PixelROCMaps::drawBarrelMaps(TCanvas& canvas, const std::string& text bottomPad->cd(); bottomPad->Divide(2, 2); for (unsigned int lay = 1; lay <= n_layers; lay++) { + h_bpix_maps[lay - 1]->SetStats(false); PixelROCMapHelper::dress_plot(bottomPad, h_bpix_maps[lay - 1].get(), lay, 0, 1, found == std::string::npos); } } @@ -676,6 +677,7 @@ void Phase1PixelROCMaps::drawForwardMaps(TCanvas& canvas, const std::string& tex bottomPad->cd(); bottomPad->Divide(2, 1); for (unsigned int ring = 1; ring <= n_rings; ring++) { + h_fpix_maps[ring - 1]->SetStats(false); PixelROCMapHelper::dress_plot(bottomPad, h_fpix_maps[ring - 1].get(), 0, ring, 1, found == std::string::npos); } } @@ -709,6 +711,7 @@ void Phase1PixelROCMaps::drawMaps(TCanvas& canvas, const std::string& text) // dress the plots for (unsigned int lay = 1; lay <= n_layers; lay++) { + h_bpix_maps[lay - 1]->SetStats(false); PixelROCMapHelper::dress_plot(bottomPad, h_bpix_maps[lay - 1].get(), lay, 0, 1, found == std::string::npos); } @@ -717,6 +720,7 @@ void Phase1PixelROCMaps::drawMaps(TCanvas& canvas, const std::string& text) bottomPad->cd(); for (unsigned int ring = 1; ring <= n_rings; ring++) { + h_fpix_maps[ring - 1]->SetStats(false); PixelROCMapHelper::dress_plot( bottomPad, h_fpix_maps[ring - 1].get(), 0, n_layers + ring, 1, found == std::string::npos); } diff --git a/DQM/TrackerRemapper/src/Phase1PixelSummaryMap.cc b/DQM/TrackerRemapper/src/Phase1PixelSummaryMap.cc index fc3a2f48f3588..d1b2a0846dedd 100644 --- a/DQM/TrackerRemapper/src/Phase1PixelSummaryMap.cc +++ b/DQM/TrackerRemapper/src/Phase1PixelSummaryMap.cc @@ -88,7 +88,8 @@ void Phase1PixelSummaryMap::printTrackerMap(TCanvas& canvas) { canvas.SetBottomMargin(0.02); canvas.SetLeftMargin(0.02); canvas.SetRightMargin(0.14); - m_BaseTrackerMap->Draw("AC COLZ L"); + m_BaseTrackerMap->Draw("AL"); + m_BaseTrackerMap->Draw("AC COLZ0 L SAME"); //### z arrow arrow = TArrow(0.05, 27.0, 0.05, -30.0, 0.02, "|>"); diff --git a/DQM/TrackingMonitorSource/src/TrackToTrackComparisonHists.cc b/DQM/TrackingMonitorSource/src/TrackToTrackComparisonHists.cc index 983fa54270163..a30b0a94d92ee 100644 --- a/DQM/TrackingMonitorSource/src/TrackToTrackComparisonHists.cc +++ b/DQM/TrackingMonitorSource/src/TrackToTrackComparisonHists.cc @@ -120,7 +120,7 @@ void TrackToTrackComparisonHists::analyze(const edm::Event& iEvent, const edm::E edm::Handle monitoredPVHandle; iEvent.getByToken(monitoredPVToken_, monitoredPVHandle); - if (!monitoredTracksHandle.isValid()) { + if (!monitoredPVHandle.isValid()) { edm::LogError("TrackToTrackComparisonHists") << "monitoredPVHandle not found, skipping event"; return; } diff --git a/DQMOffline/CalibCalo/BuildFile.xml b/DQMOffline/CalibCalo/BuildFile.xml deleted file mode 100644 index 67b730da69801..0000000000000 --- a/DQMOffline/CalibCalo/BuildFile.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/DQMOffline/CalibCalo/interface/DQMHcalIterativePhiSymAlCaReco.h b/DQMOffline/CalibCalo/interface/DQMHcalIterativePhiSymAlCaReco.h deleted file mode 100644 index 673c8905d3e58..0000000000000 --- a/DQMOffline/CalibCalo/interface/DQMHcalIterativePhiSymAlCaReco.h +++ /dev/null @@ -1,62 +0,0 @@ -#ifndef DQMHcalIterativePhiSymAlCaReco_H -#define DQMHcalIterativePhiSymAlCaReco_H - -/** \class DQMHcalIterativePhiSymAlCaReco - * * - * DQM Source for iterative phi symmetry stream - * - * \author Sunanda Banerjee - * - */ - -#include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" -#include "FWCore/ParameterSet/interface/ParameterSet.h" - -#include "DQMServices/Core/interface/DQMOneEDAnalyzer.h" -#include "DQMServices/Core/interface/DQMStore.h" -#include "DataFormats/FEDRawData/interface/FEDRawDataCollection.h" -#include "DataFormats/HcalRecHit/interface/HcalRecHitCollections.h" - -#include - -class DQMHcalIterativePhiSymAlCaReco : public DQMOneEDAnalyzer<> { -public: - DQMHcalIterativePhiSymAlCaReco(const edm::ParameterSet &); - ~DQMHcalIterativePhiSymAlCaReco() override; - - static void fillDescriptions(edm::ConfigurationDescriptions &descriptions); - -protected: - // void beginRun(const edm::Run& r, const edm::EventSetup& c); - void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override; - void analyze(const edm::Event &e, const edm::EventSetup &c) override; - - void dqmEndRun(const edm::Run &r, const edm::EventSetup &c) override {} - -private: - static constexpr int maxDepth_ = 7; - // - // Monitor elements - // - MonitorElement *hiDistr2D_[maxDepth_]; - - MonitorElement *hiDistrHBHEsize1D_; - MonitorElement *hiDistrHFsize1D_; - MonitorElement *hiDistrHOsize1D_; - - std::string folderName_; - int hiDistr_y_nbin_; - int hiDistr_x_nbin_; - double hiDistr_y_min_; - double hiDistr_y_max_; - double hiDistr_x_min_; - double hiDistr_x_max_; - /// object to monitor - - edm::EDGetTokenT tok_hbhe_; - edm::EDGetTokenT tok_ho_; - edm::EDGetTokenT tok_hf_; -}; - -#endif diff --git a/DQMOffline/CalibCalo/interface/DQMSourceEleCalib.h b/DQMOffline/CalibCalo/interface/DQMSourceEleCalib.h deleted file mode 100644 index c6584b99bb980..0000000000000 --- a/DQMOffline/CalibCalo/interface/DQMSourceEleCalib.h +++ /dev/null @@ -1,81 +0,0 @@ -#ifndef DQMSourceEleCalib_H -#define DQMSourceEleCalib_H - -/** \class DQMSourceEleCalib - * * - * DQM Source for phi symmetry stream - * - * \author Stefano Argiro' - * Andrea Gozzelino - Universita� e INFN Torino - * - */ - -#include "DataFormats/DetId/interface/DetId.h" -#include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h" -#include "FWCore/Framework/interface/EDAnalyzer.h" -#include "FWCore/Framework/interface/Frameworkfwd.h" - -#include "DQMServices/Core/interface/DQMEDAnalyzer.h" -#include "DQMServices/Core/interface/DQMStore.h" -#include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h" -#include "DataFormats/EgammaCandidates/interface/GsfElectronFwd.h" - -class DQMSourceEleCalib : public DQMEDAnalyzer { -public: - DQMSourceEleCalib(const edm::ParameterSet &); - ~DQMSourceEleCalib() override; - -protected: - void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override; - - void analyze(const edm::Event &e, const edm::EventSetup &c) override; - -private: - //! find the MOX - DetId findMaxHit(const std::vector> &, - const EcalRecHitCollection *, - const EcalRecHitCollection *); - //! fills local occupancy graphs - void fillAroundBarrel(const EcalRecHitCollection *, int, int); - void fillAroundEndcap(const EcalRecHitCollection *, int, int); - - int eventCounter_; - - //! Number of recHits per electron - MonitorElement *recHitsPerElectron_; - //! Number of electrons - MonitorElement *ElectronsNumber_; - //! ESCoP - MonitorElement *ESCoP_; - //! Occupancy - MonitorElement *OccupancyEB_; - MonitorElement *OccupancyEEP_; - MonitorElement *OccupancyEEM_; - MonitorElement *LocalOccupancyEB_; - MonitorElement *LocalOccupancyEE_; - - //! recHits over associated recHits - MonitorElement *HitsVsAssociatedHits_; - - /// object to monitor - edm::EDGetTokenT productMonitoredEB_; - - /// object to monitor - edm::EDGetTokenT productMonitoredEE_; - //! electrons to monitor - edm::EDGetTokenT productMonitoredElectrons_; - - /// Monitor every prescaleFactor_ events - unsigned int prescaleFactor_; - - /// DQM folder name - std::string folderName_; - - /// Write to file - bool saveToFile_; - - /// Output file name if required - std::string fileName_; -}; - -#endif diff --git a/DQMOffline/CalibCalo/plugins/BuildFile.xml b/DQMOffline/CalibCalo/plugins/BuildFile.xml index b7903a0d73b16..c2d5fb1806da4 100644 --- a/DQMOffline/CalibCalo/plugins/BuildFile.xml +++ b/DQMOffline/CalibCalo/plugins/BuildFile.xml @@ -1,4 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + - diff --git a/DQMOffline/CalibCalo/src/DQMHOAlCaRecoStream.cc b/DQMOffline/CalibCalo/plugins/DQMHOAlCaRecoStream.cc similarity index 78% rename from DQMOffline/CalibCalo/src/DQMHOAlCaRecoStream.cc rename to DQMOffline/CalibCalo/plugins/DQMHOAlCaRecoStream.cc index 74244d4f71bf9..fe7cde9188ab1 100644 --- a/DQMOffline/CalibCalo/src/DQMHOAlCaRecoStream.cc +++ b/DQMOffline/CalibCalo/plugins/DQMHOAlCaRecoStream.cc @@ -18,38 +18,67 @@ // // system include files -#include +#include // user include files +#include "DataFormats/HcalCalibObjects/interface/HOCalibVariables.h" -#include "FWCore/Framework/interface/EDAnalyzer.h" - -#include "FWCore/Framework/interface/ESHandle.h" +#include "FWCore/Framework/interface/Frameworkfwd.h" +#include "FWCore/Utilities/interface/InputTag.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/MakerMacros.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" - #include "FWCore/ParameterSet/interface/ParameterSet.h" -#include "DQMOffline/CalibCalo/src/DQMHOAlCaRecoStream.h" +#include "DQMServices/Core/interface/DQMEDAnalyzer.h" +#include "DQMServices/Core/interface/DQMStore.h" #include "DQMServices/Core/interface/DQMStore.h" #include "FWCore/ServiceRegistry/interface/Service.h" -#include - // // class decleration // -using namespace std; -using namespace edm; -// -// constants, enums and typedefs -// +class DQMHOAlCaRecoStream : public DQMEDAnalyzer { +public: + explicit DQMHOAlCaRecoStream(const edm::ParameterSet &); + ~DQMHOAlCaRecoStream() override; -// -// static data member definitions -// +private: + void analyze(const edm::Event &, const edm::EventSetup &) override; + void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override; + + // ----------member data --------------------------- + + MonitorElement *hMuonMultipl; + MonitorElement *hMuonMom; + MonitorElement *hMuonEta; + MonitorElement *hMuonPhi; + + MonitorElement *hDirCosine; + MonitorElement *hHOTime; + + MonitorElement *hSigRing[5]; + MonitorElement *hPedRing[5]; + MonitorElement *hSignal3x3[9]; + + int Nevents; + int Nmuons; + + std::string theRootFileName; + std::string folderName_; + double m_sigmaValue; + + double m_lowRadPosInMuch; + double m_highRadPosInMuch; + + int m_nbins; + double m_lowEdge; + double m_highEdge; + + bool saveToFile_; + edm::EDGetTokenT hoCalibVariableCollectionTag; +}; // // constructors and destructor @@ -59,8 +88,8 @@ DQMHOAlCaRecoStream::DQMHOAlCaRecoStream(const edm::ParameterSet &iConfig) consumes(iConfig.getParameter("hoCalibVariableCollectionTag"))) { // now do what ever initialization is needed - theRootFileName = iConfig.getUntrackedParameter("RootFileName", "tmp.root"); - folderName_ = iConfig.getUntrackedParameter("folderName"); + theRootFileName = iConfig.getUntrackedParameter("RootFileName", "tmp.root"); + folderName_ = iConfig.getUntrackedParameter("folderName"); m_sigmaValue = iConfig.getUntrackedParameter("sigmaval", 0.2); m_lowRadPosInMuch = iConfig.getUntrackedParameter("lowradposinmuch", 400.0); m_highRadPosInMuch = iConfig.getUntrackedParameter("highradposinmuch", 480.0); @@ -81,8 +110,6 @@ DQMHOAlCaRecoStream::~DQMHOAlCaRecoStream() { // ------------ method called to for each event ------------ void DQMHOAlCaRecoStream::analyze(const edm::Event &iEvent, const edm::EventSetup &iSetup) { - using namespace edm; - Nevents++; edm::Handle HOCalib; @@ -188,27 +215,6 @@ void DQMHOAlCaRecoStream::bookHistograms(DQMStore::IBooker &ibooker, hPedRing[i]->setAxisTitle(title, 1); } - // hSigRingm1 = ibooker.book1D("hSigRingm1", "HO signal in Ring-1", m_nbins, - // m_lowEdge, m_highEdge); hSigRingm1->setAxisTitle("HO signal in Ring-1",1); - - // hSigRing00 = ibooker.book1D("hSigRing00", "HO signal in Ring_0", m_nbins, - // m_lowEdge, m_highEdge); hSigRing00->setAxisTitle("HO signal in Ring_0",1); - - // hSigRingp1 = ibooker.book1D("hSigRingp1", "HO signal in Ring-1", m_nbins, - // m_lowEdge, m_highEdge); hSigRingp1->setAxisTitle("HO signal in Ring+1",1); - - // hSigRingp2 = ibooker.book1D("hSigRingp2", "HO signal in Ring-2", m_nbins, - // m_lowEdge, m_highEdge); hSigRingp2->setAxisTitle("HO signal in Ring+2",1); - - // hPedRingm2 = ibooker.book1D("hPedRingm2", "HO pedestal in Ring-2", - // m_nbins, m_lowEdge, m_highEdge); hPedRingm1 = ibooker.book1D("hPedRingm1", - // "HO pedestal in Ring-1", m_nbins, m_lowEdge, m_highEdge); hPedRing00 = - // ibooker.book1D("hPedRing00", "HO pedestal in Ring_0", m_nbins, m_lowEdge, - // m_highEdge); hPedRingp1 = ibooker.book1D("hPedRingp1", "HO pedestal in - // Ring-1", m_nbins, m_lowEdge, m_highEdge); hPedRingp2 = - // ibooker.book1D("hPedRingp2", "HO pedestal in Ring-2", m_nbins, m_lowEdge, - // m_highEdge); - for (int i = -1; i <= 1; i++) { for (int j = -1; j <= 1; j++) { int k = 3 * (i + 1) + j + 1; @@ -222,3 +228,5 @@ void DQMHOAlCaRecoStream::bookHistograms(DQMStore::IBooker &ibooker, Nevents = 0; Nmuons = 0; } + +DEFINE_FWK_MODULE(DQMHOAlCaRecoStream); diff --git a/DQMOffline/CalibCalo/src/DQMHcalDiJetsAlCaReco.cc b/DQMOffline/CalibCalo/plugins/DQMHcalDiJetsAlCaReco.cc similarity index 71% rename from DQMOffline/CalibCalo/src/DQMHcalDiJetsAlCaReco.cc rename to DQMOffline/CalibCalo/plugins/DQMHcalDiJetsAlCaReco.cc index deddafdd89135..ae36a2854f42b 100644 --- a/DQMOffline/CalibCalo/src/DQMHcalDiJetsAlCaReco.cc +++ b/DQMOffline/CalibCalo/plugins/DQMHcalDiJetsAlCaReco.cc @@ -8,31 +8,81 @@ * Description: Monitoring of Phi Symmetry Calibration Stream */ +// work on collections + +#include "DataFormats/CaloTowers/interface/CaloTowerDetId.h" +#include "DataFormats/DetId/interface/DetId.h" +#include "DataFormats/HcalDetId/interface/HcalDetId.h" +#include "DataFormats/CaloTowers/interface/CaloTowerCollection.h" +#include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h" +#include "DataFormats/HcalRecHit/interface/HcalRecHitCollections.h" +#include "DataFormats/JetReco/interface/CaloJet.h" +#include "DataFormats/JetReco/interface/CaloJetCollection.h" + +#include "FWCore/Framework/interface/Frameworkfwd.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/EventSetup.h" +#include "FWCore/Framework/interface/MakerMacros.h" +#include "FWCore/MessageLogger/interface/MessageLogger.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "FWCore/ServiceRegistry/interface/Service.h" // DQM include files +#include "DQMServices/Core/interface/DQMEDAnalyzer.h" +#include "DQMServices/Core/interface/DQMStore.h" #include "DQMServices/Core/interface/DQMStore.h" -// work on collections +#include -#include "DataFormats/CaloTowers/interface/CaloTowerDetId.h" -#include "DataFormats/DetId/interface/DetId.h" -#include "DataFormats/HcalDetId/interface/HcalDetId.h" -#include "FWCore/MessageLogger/interface/MessageLogger.h" +class DQMHcalDiJetsAlCaReco : public DQMEDAnalyzer { +public: + DQMHcalDiJetsAlCaReco(const edm::ParameterSet &); + ~DQMHcalDiJetsAlCaReco() override; + +protected: + void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override; + void analyze(const edm::Event &e, const edm::EventSetup &c) override; + +private: + int eventCounter_; + + // + // Monitor elements + // + MonitorElement *hiDistrRecHitEnergyEBEE_; + MonitorElement *hiDistrRecHitEnergyHBHE_; + MonitorElement *hiDistrRecHitEnergyHF_; + MonitorElement *hiDistrRecHitEnergyHO_; -// #include "Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h" -// #include "Geometry/CaloGeometry/interface/CaloCellGeometry.h" -// #include "DataFormats/HcalDetId/interface/HcalSubdetector.h" + MonitorElement *hiDistrProbeJetEnergy_; + MonitorElement *hiDistrProbeJetEta_; + MonitorElement *hiDistrProbeJetPhi_; -#include "DQMOffline/CalibCalo/src/DQMHcalDiJetsAlCaReco.h" + MonitorElement *hiDistrTagJetEnergy_; + MonitorElement *hiDistrTagJetEta_; + MonitorElement *hiDistrTagJetPhi_; -using namespace std; -using namespace edm; -using namespace reco; + MonitorElement *hiDistrEtThirdJet_; + + /// object to monitor + edm::EDGetTokenT jets_; + edm::EDGetTokenT ec_; + edm::EDGetTokenT hbhe_; + edm::EDGetTokenT ho_; + edm::EDGetTokenT hf_; + + /// DQM folder name + std::string folderName_; + + /// Write to file + bool saveToFile_; + + /// Output file name if required + std::string fileName_; + + bool allowMissingInputs_; +}; // ****************************************** // constructors @@ -42,16 +92,16 @@ DQMHcalDiJetsAlCaReco::DQMHcalDiJetsAlCaReco(const edm::ParameterSet &iConfig) : // // Input from configurator file // - folderName_ = iConfig.getUntrackedParameter("FolderName", "ALCAStreamHcalDiJets"); + folderName_ = iConfig.getUntrackedParameter("FolderName", "ALCAStreamHcalDiJets"); - jets_ = consumes(iConfig.getParameter("jetsInput")); + jets_ = consumes(iConfig.getParameter("jetsInput")); ec_ = consumes(iConfig.getParameter("ecInput")); hbhe_ = consumes(iConfig.getParameter("hbheInput")); ho_ = consumes(iConfig.getParameter("hoInput")); hf_ = consumes(iConfig.getParameter("hfInput")); saveToFile_ = iConfig.getUntrackedParameter("SaveToFile", false); - fileName_ = iConfig.getUntrackedParameter("FileName", "MonitorAlCaHcalDiJets.root"); + fileName_ = iConfig.getUntrackedParameter("FileName", "MonitorAlCaHcalDiJets.root"); } DQMHcalDiJetsAlCaReco::~DQMHcalDiJetsAlCaReco() {} @@ -111,13 +161,13 @@ void DQMHcalDiJetsAlCaReco::bookHistograms(DQMStore::IBooker &ibooker, //------------------------------------------------------------- -void DQMHcalDiJetsAlCaReco::analyze(const Event &iEvent, const EventSetup &iSetup) { +void DQMHcalDiJetsAlCaReco::analyze(const edm::Event &iEvent, const edm::EventSetup &iSetup) { eventCounter_++; - CaloJet jet1, jet2, jet3; + reco::CaloJet jet1, jet2, jet3; Float_t etVetoJet; - edm::Handle jets; + edm::Handle jets; iEvent.getByToken(jets_, jets); if (!jets.isValid()) { @@ -129,7 +179,7 @@ void DQMHcalDiJetsAlCaReco::analyze(const Event &iEvent, const EventSetup &iSetu jet1 = (*jets)[0]; jet2 = (*jets)[1]; if (fabs(jet1.eta()) > fabs(jet2.eta())) { - CaloJet jet = jet1; + reco::CaloJet jet = jet1; jet1 = jet2; jet2 = jet; } @@ -156,7 +206,7 @@ void DQMHcalDiJetsAlCaReco::analyze(const Event &iEvent, const EventSetup &iSetu hiDistrEtThirdJet_->Fill(etVetoJet); } - Handle ec; + edm::Handle ec; iEvent.getByToken(ec_, ec); if (!ec.isValid()) { @@ -168,7 +218,7 @@ void DQMHcalDiJetsAlCaReco::analyze(const Event &iEvent, const EventSetup &iSetu hiDistrRecHitEnergyEBEE_->Fill(ecItr->energy()); } - Handle hbhe; + edm::Handle hbhe; iEvent.getByToken(hbhe_, hbhe); if (!hbhe.isValid()) { @@ -180,7 +230,7 @@ void DQMHcalDiJetsAlCaReco::analyze(const Event &iEvent, const EventSetup &iSetu hiDistrRecHitEnergyHBHE_->Fill(hbheItr->energy()); } - Handle ho; + edm::Handle ho; iEvent.getByToken(ho_, ho); if (!ho.isValid()) { @@ -192,7 +242,7 @@ void DQMHcalDiJetsAlCaReco::analyze(const Event &iEvent, const EventSetup &iSetu hiDistrRecHitEnergyHO_->Fill(hoItr->energy()); } - Handle hf; + edm::Handle hf; iEvent.getByToken(hf_, hf); if (!hf.isValid()) { @@ -205,3 +255,5 @@ void DQMHcalDiJetsAlCaReco::analyze(const Event &iEvent, const EventSetup &iSetu } } // analyze + +DEFINE_FWK_MODULE(DQMHcalDiJetsAlCaReco); diff --git a/DQMOffline/CalibCalo/src/DQMHcalIsoTrackAlCaReco.cc b/DQMOffline/CalibCalo/plugins/DQMHcalIsoTrackAlCaReco.cc similarity index 86% rename from DQMOffline/CalibCalo/src/DQMHcalIsoTrackAlCaReco.cc rename to DQMOffline/CalibCalo/plugins/DQMHcalIsoTrackAlCaReco.cc index 2f574a39bdd37..5f680cf1b3598 100644 --- a/DQMOffline/CalibCalo/src/DQMHcalIsoTrackAlCaReco.cc +++ b/DQMOffline/CalibCalo/plugins/DQMHcalIsoTrackAlCaReco.cc @@ -20,11 +20,54 @@ // system include files #include +#include +#include // user include files +#include "DataFormats/HLTReco/interface/TriggerEvent.h" +#include "DataFormats/HcalIsolatedTrack/interface/HcalIsolatedTrackCandidate.h" +#include "DataFormats/HcalIsolatedTrack/interface/HcalIsolatedTrackCandidateFwd.h" +#include "DataFormats/Math/interface/deltaR.h" -#include "DQMOffline/CalibCalo/src/DQMHcalIsoTrackAlCaReco.h" +#include "FWCore/Framework/interface/Event.h" +#include "FWCore/Framework/interface/Frameworkfwd.h" +#include "FWCore/Framework/interface/MakerMacros.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/ServiceRegistry/interface/Service.h" + +#include "DQMServices/Core/interface/DQMEDAnalyzer.h" +#include "DQMServices/Core/interface/DQMStore.h" + +class DQMHcalIsoTrackAlCaReco : public DQMEDAnalyzer { +public: + explicit DQMHcalIsoTrackAlCaReco(const edm::ParameterSet &); + ~DQMHcalIsoTrackAlCaReco() override; + + void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override; + void analyze(const edm::Event &, const edm::EventSetup &) override; + +private: + std::string folderName_; + std::vector l1FilterTag_, hltFilterTag_; + std::vector type_; + edm::InputTag labelTrigger_, labelTrack_; + edm::EDGetTokenT tokTrigger_; + edm::EDGetTokenT tokTrack_; + + double pThr_; + + std::vector hL1Pt_, hL1Eta_, hL1phi_; + std::vector hHltP_, hHltEta_, hHltPhi_; + MonitorElement *hL3Dr_, *hL3Rat_; + std::vector hOffP_; + MonitorElement *hMaxP_, *hEnEcal_, *hIeta_, *hIphi_; + + int nTotal_, nHLTaccepts_; + std::vector etaRange_; + std::vector indexH_; + std::vector ifL3_; +}; DQMHcalIsoTrackAlCaReco::DQMHcalIsoTrackAlCaReco(const edm::ParameterSet &iConfig) { folderName_ = iConfig.getParameter("FolderName"); @@ -244,3 +287,5 @@ void DQMHcalIsoTrackAlCaReco::bookHistograms(DQMStore::IBooker &iBooker, edm::Ru hIphi_ = iBooker.book1D("hIPhi", "i#phi for HCAL tower", 72, 0, 72); hIphi_->setAxisTitle("i#phi", 1); } + +DEFINE_FWK_MODULE(DQMHcalIsoTrackAlCaReco); diff --git a/DQMOffline/CalibCalo/src/DQMHcalIsoTrackPostProcessor.cc b/DQMOffline/CalibCalo/plugins/DQMHcalIsoTrackPostProcessor.cc similarity index 90% rename from DQMOffline/CalibCalo/src/DQMHcalIsoTrackPostProcessor.cc rename to DQMOffline/CalibCalo/plugins/DQMHcalIsoTrackPostProcessor.cc index 8c4552bbd66e3..9b6eb38829ba1 100644 --- a/DQMOffline/CalibCalo/src/DQMHcalIsoTrackPostProcessor.cc +++ b/DQMOffline/CalibCalo/plugins/DQMHcalIsoTrackPostProcessor.cc @@ -1,19 +1,11 @@ #include "DQMServices/Core/interface/DQMEDAnalyzer.h" #include "DQMServices/Core/interface/DQMEDHarvester.h" #include "DQMServices/Core/interface/DQMStore.h" -#include "FWCore/Framework/interface/MakerMacros.h" -#include "FWCore/ServiceRegistry/interface/Service.h" -#include "FWCore/Framework/interface/EDAnalyzer.h" #include "FWCore/Framework/interface/Frameworkfwd.h" - -#include -#include -#include -#include -#include - -#define DebugLog +#include "FWCore/Framework/interface/MakerMacros.h" +#include "FWCore/MessageLogger/interface/MessageLogger.h" +#include "FWCore/ServiceRegistry/interface/Service.h" class DQMHcalIsoTrackPostProcessor : public DQMEDHarvester { public: @@ -74,15 +66,13 @@ void DQMHcalIsoTrackPostProcessor::dqmEndJob(DQMStore::IBooker &ibooker, DQMStor for (int i = 0; i < 4; ++i) { sprintf(name, "/heta%s", types[i].c_str()); std::string hname1 = ibooker.pwd() + std::string(name); -#ifdef DebugLog - std::cout << "PostProcesor " << hname1 << " " << igetter.get(hname1) << std::endl; -#endif + edm::LogVerbatim("DQMHcal") << "PostProcesor " << hname1 << " " << igetter.get(hname1); + hSumEta[i]->getTH1F()->Add(igetter.get(hname1)->getTH1F(), 1); sprintf(name, "/hphi%s", types[i].c_str()); std::string hname2 = ibooker.pwd() + std::string(name); -#ifdef DebugLog - std::cout << "PostProcesor " << hname2 << " " << igetter.get(hname2) << std::endl; -#endif + edm::LogVerbatim("DQMHcal") << "PostProcesor " << hname2 << " " << igetter.get(hname2); + hSumPhi[i]->getTH1F()->Add(igetter.get(hname2)->getTH1F(), 1); } diff --git a/DQMOffline/CalibCalo/src/DQMHcalIsolatedBunchAlCaReco.cc b/DQMOffline/CalibCalo/plugins/DQMHcalIsolatedBunchAlCaReco.cc similarity index 78% rename from DQMOffline/CalibCalo/src/DQMHcalIsolatedBunchAlCaReco.cc rename to DQMOffline/CalibCalo/plugins/DQMHcalIsolatedBunchAlCaReco.cc index 89823584319fa..fb554af3ddfcf 100644 --- a/DQMOffline/CalibCalo/src/DQMHcalIsolatedBunchAlCaReco.cc +++ b/DQMOffline/CalibCalo/plugins/DQMHcalIsolatedBunchAlCaReco.cc @@ -11,30 +11,61 @@ #include "FWCore/Common/interface/TriggerNames.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/EventSetup.h" +#include "FWCore/Framework/interface/Frameworkfwd.h" +#include "FWCore/Framework/interface/MakerMacros.h" +#include "FWCore/MessageLogger/interface/MessageLogger.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "FWCore/ServiceRegistry/interface/Service.h" - #include "CommonTools/UtilAlgos/interface/TFileService.h" -#include "FWCore/MessageLogger/interface/MessageLogger.h" // DQM include files +#include "DQMServices/Core/interface/DQMStore.h" +#include "DQMServices/Core/interface/DQMEDAnalyzer.h" #include "DQMServices/Core/interface/DQMStore.h" // work on collections #include "DataFormats/HcalDetId/interface/HcalDetId.h" #include "DataFormats/HcalDetId/interface/HcalSubdetector.h" -#include "Geometry/CaloGeometry/interface/CaloCellGeometry.h" -#include "Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h" - #include "DataFormats/FEDRawData/interface/FEDHeader.h" #include "DataFormats/FEDRawData/interface/FEDNumbering.h" #include "DataFormats/FEDRawData/interface/FEDRawData.h" +#include "DataFormats/Common/interface/TriggerResults.h" +#include "DataFormats/HLTReco/interface/TriggerEvent.h" +#include "DataFormats/HcalRecHit/interface/HcalRecHitCollections.h" + +#include "Geometry/CaloGeometry/interface/CaloCellGeometry.h" +#include "Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h" + #include "EventFilter/HcalRawToDigi/interface/HcalDCCHeader.h" #include "EventFilter/HcalRawToDigi/interface/HcalHTRData.h" -#include "DQMOffline/CalibCalo/src/DQMHcalIsolatedBunchAlCaReco.h" +class DQMHcalIsolatedBunchAlCaReco : public DQMEDAnalyzer { +public: + DQMHcalIsolatedBunchAlCaReco(const edm::ParameterSet &); + ~DQMHcalIsolatedBunchAlCaReco() override; + +protected: + void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override; + void analyze(const edm::Event &e, const edm::EventSetup &c) override; + +private: + // + // Monitor elements + // + MonitorElement *h_Event_, *h_hbhehit_, *h_hfhit_, *h_hohit_; + + /// DQM folder name + std::string folderName_, trigName_; + bool plotAll_; + + /// object to monitor + edm::EDGetTokenT hbhereco_; + edm::EDGetTokenT horeco_; + edm::EDGetTokenT hfreco_; + edm::EDGetTokenT trigResult_; +}; // ****************************************** // constructors @@ -119,3 +150,5 @@ void DQMHcalIsolatedBunchAlCaReco::analyze(const edm::Event &iEvent, const edm:: } } // analyze + +DEFINE_FWK_MODULE(DQMHcalIsolatedBunchAlCaReco); diff --git a/DQMOffline/CalibCalo/src/DQMHcalIterativePhiSymAlCaReco.cc b/DQMOffline/CalibCalo/plugins/DQMHcalIterativePhiSymAlCaReco.cc similarity index 79% rename from DQMOffline/CalibCalo/src/DQMHcalIterativePhiSymAlCaReco.cc rename to DQMOffline/CalibCalo/plugins/DQMHcalIterativePhiSymAlCaReco.cc index 8cf92573de7fd..ce91a25ffb561 100644 --- a/DQMOffline/CalibCalo/src/DQMHcalIterativePhiSymAlCaReco.cc +++ b/DQMOffline/CalibCalo/plugins/DQMHcalIterativePhiSymAlCaReco.cc @@ -10,24 +10,69 @@ #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/EventSetup.h" +#include "FWCore/Framework/interface/Frameworkfwd.h" +#include "FWCore/Framework/interface/MakerMacros.h" +#include "FWCore/MessageLogger/interface/MessageLogger.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "FWCore/ServiceRegistry/interface/Service.h" - -#include "FWCore/MessageLogger/interface/MessageLogger.h" +#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" // DQM include files #include "DQMServices/Core/interface/DQMStore.h" +#include "DQMServices/Core/interface/DQMOneEDAnalyzer.h" // work on collections #include "DataFormats/HcalDetId/interface/HcalDetId.h" #include "DataFormats/HcalDetId/interface/HcalSubdetector.h" #include "DataFormats/HcalRecHit/interface/HcalRecHitCollections.h" +#include "DataFormats/FEDRawData/interface/FEDRawDataCollection.h" + #include "Geometry/CaloGeometry/interface/CaloCellGeometry.h" #include "Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h" -#include "DQMOffline/CalibCalo/interface/DQMHcalIterativePhiSymAlCaReco.h" +#include + +class DQMHcalIterativePhiSymAlCaReco : public DQMOneEDAnalyzer<> { +public: + DQMHcalIterativePhiSymAlCaReco(const edm::ParameterSet &); + ~DQMHcalIterativePhiSymAlCaReco() override; + + static void fillDescriptions(edm::ConfigurationDescriptions &descriptions); + +protected: + // void beginRun(const edm::Run& r, const edm::EventSetup& c); + void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override; + void analyze(const edm::Event &e, const edm::EventSetup &c) override; + + void dqmEndRun(const edm::Run &r, const edm::EventSetup &c) override {} + +private: + static constexpr int maxDepth_ = 7; + // + // Monitor elements + // + MonitorElement *hiDistr2D_[maxDepth_]; + + MonitorElement *hiDistrHBHEsize1D_; + MonitorElement *hiDistrHFsize1D_; + MonitorElement *hiDistrHOsize1D_; + + std::string folderName_; + int hiDistr_y_nbin_; + int hiDistr_x_nbin_; + double hiDistr_y_min_; + double hiDistr_y_max_; + double hiDistr_x_min_; + double hiDistr_x_max_; + /// object to monitor + + edm::EDGetTokenT tok_hbhe_; + edm::EDGetTokenT tok_ho_; + edm::EDGetTokenT tok_hf_; +}; // ****************************************** // constructors @@ -148,3 +193,5 @@ void DQMHcalIterativePhiSymAlCaReco::analyze(const edm::Event &iEvent, const edm } } // analyze + +DEFINE_FWK_MODULE(DQMHcalIterativePhiSymAlCaReco); diff --git a/DQMOffline/CalibCalo/src/DQMHcalPhiSymAlCaReco.cc b/DQMOffline/CalibCalo/plugins/DQMHcalPhiSymAlCaReco.cc similarity index 86% rename from DQMOffline/CalibCalo/src/DQMHcalPhiSymAlCaReco.cc rename to DQMOffline/CalibCalo/plugins/DQMHcalPhiSymAlCaReco.cc index 712bfee58744d..50fb72e341b83 100644 --- a/DQMOffline/CalibCalo/src/DQMHcalPhiSymAlCaReco.cc +++ b/DQMOffline/CalibCalo/plugins/DQMHcalPhiSymAlCaReco.cc @@ -10,32 +10,110 @@ #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/EventSetup.h" +#include "FWCore/Framework/interface/Frameworkfwd.h" +#include "FWCore/Framework/interface/MakerMacros.h" +#include "FWCore/MessageLogger/interface/MessageLogger.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "FWCore/ServiceRegistry/interface/Service.h" -#include "FWCore/MessageLogger/interface/MessageLogger.h" - // DQM include files #include "DQMServices/Core/interface/DQMStore.h" +#include "DQMServices/Core/interface/DQMOneEDAnalyzer.h" // work on collections #include "DataFormats/HcalDetId/interface/HcalDetId.h" #include "DataFormats/HcalDetId/interface/HcalSubdetector.h" -#include "Geometry/CaloGeometry/interface/CaloCellGeometry.h" -#include "Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h" - +#include "DataFormats/HcalRecHit/interface/HcalRecHitCollections.h" #include "DataFormats/FEDRawData/interface/FEDHeader.h" #include "DataFormats/FEDRawData/interface/FEDNumbering.h" #include "DataFormats/FEDRawData/interface/FEDRawData.h" +#include "DataFormats/FEDRawData/interface/FEDRawDataCollection.h" + +#include "Geometry/CaloGeometry/interface/CaloCellGeometry.h" +#include "Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h" + #include "EventFilter/HcalRawToDigi/interface/HcalDCCHeader.h" #include "EventFilter/HcalRawToDigi/interface/HcalHTRData.h" -#include "DQMOffline/CalibCalo/src/DQMHcalPhiSymAlCaReco.h" +class DQMHcalPhiSymAlCaReco : public DQMOneEDAnalyzer<> { +public: + DQMHcalPhiSymAlCaReco(const edm::ParameterSet &); + ~DQMHcalPhiSymAlCaReco() override; + +protected: + // void beginRun(const edm::Run& r, const edm::EventSetup& c); + void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override; + void analyze(const edm::Event &e, const edm::EventSetup &c) override; + + void dqmEndRun(const edm::Run &r, const edm::EventSetup &c) override; + +private: + int eventCounter_; + + // + // Monitor elements + // + MonitorElement *hiDistrMBPl2D_; + MonitorElement *hiDistrNoisePl2D_; + MonitorElement *hiDistrMBMin2D_; + MonitorElement *hiDistrNoiseMin2D_; -using namespace std; -using namespace edm; + MonitorElement *hiDistrMB2Pl2D_; + MonitorElement *hiDistrNoise2Pl2D_; + MonitorElement *hiDistrMB2Min2D_; + MonitorElement *hiDistrNoise2Min2D_; + + MonitorElement *hiDistrVarMBPl2D_; + MonitorElement *hiDistrVarNoisePl2D_; + MonitorElement *hiDistrVarMBMin2D_; + MonitorElement *hiDistrVarNoiseMin2D_; + + MonitorElement *hiDistrHBHEsize1D_; + MonitorElement *hiDistrHFsize1D_; + + MonitorElement *hFEDsize; + MonitorElement *hHcalIsZS; + MonitorElement *hL1Id; + + int hiDistr_y_nbin_; + int hiDistr_x_nbin_; + double hiDistr_y_min_; + double hiDistr_y_max_; + double hiDistr_x_min_; + double hiDistr_x_max_; + + int hiDistr_r_nbin_; + double ihbhe_size_; + double ihf_size_; + + bool perLSsaving_; //to avoid nanoDQMIO crashing, driven by DQMServices/Core/python/DQMStore_cfi.py + + /// object to monitor + + edm::EDGetTokenT hbherecoMB; + edm::InputTag horecoMB; + edm::EDGetTokenT hfrecoMB; + + edm::EDGetTokenT hbherecoNoise; + edm::InputTag horecoNoise; + edm::EDGetTokenT hfrecoNoise; + + edm::EDGetTokenT rawInLabel_; + + /// DQM folder name + std::string folderName_; + + /// Write to file + bool saveToFile_; + + // period of ZS + unsigned int period_; + + /// Output file name if required + std::string fileName_; +}; // ****************************************** // constructors @@ -45,7 +123,7 @@ DQMHcalPhiSymAlCaReco::DQMHcalPhiSymAlCaReco(const edm::ParameterSet &ps) : even // // Input from configurator file // - folderName_ = ps.getUntrackedParameter("FolderName", "ALCAStreamHcalPhiSym"); + folderName_ = ps.getUntrackedParameter("FolderName", "ALCAStreamHcalPhiSym"); hbherecoMB = consumes(ps.getParameter("hbheInputMB")); horecoMB = ps.getParameter("hoInputMB"); @@ -60,7 +138,7 @@ DQMHcalPhiSymAlCaReco::DQMHcalPhiSymAlCaReco(const edm::ParameterSet &ps) : even period_ = ps.getParameter("period"); saveToFile_ = ps.getUntrackedParameter("SaveToFile", false); - fileName_ = ps.getUntrackedParameter("FileName", "MonitorAlCaHcalPhiSym.root"); + fileName_ = ps.getUntrackedParameter("FileName", "MonitorAlCaHcalPhiSym.root"); perLSsaving_ = (ps.getUntrackedParameter("perLSsaving", false)); @@ -268,7 +346,7 @@ void DQMHcalPhiSymAlCaReco::bookHistograms(DQMStore::IBooker &ibooker, //------------------------------------------------------------- -void DQMHcalPhiSymAlCaReco::analyze(const Event &iEvent, const EventSetup &iSetup) { +void DQMHcalPhiSymAlCaReco::analyze(const edm::Event &iEvent, const edm::EventSetup &iSetup) { eventCounter_++; edm::Handle rawIn; @@ -441,7 +519,7 @@ void DQMHcalPhiSymAlCaReco::analyze(const Event &iEvent, const EventSetup &iSetu //-------------------------------------------------------- //-------------------------------------------------------- -void DQMHcalPhiSymAlCaReco::dqmEndRun(const Run &r, const EventSetup &context) { +void DQMHcalPhiSymAlCaReco::dqmEndRun(const edm::Run &r, const edm::EventSetup &context) { // Keep Variances if (eventCounter_ > 0 && !perLSsaving_) { for (int k = 0; k <= hiDistr_x_nbin_; k++) { @@ -472,3 +550,5 @@ void DQMHcalPhiSymAlCaReco::dqmEndRun(const Run &r, const EventSetup &context) { } } } + +DEFINE_FWK_MODULE(DQMHcalPhiSymAlCaReco); diff --git a/DQMOffline/CalibCalo/src/DQMSourceEleCalib.cc b/DQMOffline/CalibCalo/plugins/DQMSourceEleCalib.cc similarity index 73% rename from DQMOffline/CalibCalo/src/DQMSourceEleCalib.cc rename to DQMOffline/CalibCalo/plugins/DQMSourceEleCalib.cc index 6e73d0a28cceb..03792b60ce8a7 100644 --- a/DQMOffline/CalibCalo/src/DQMSourceEleCalib.cc +++ b/DQMOffline/CalibCalo/plugins/DQMSourceEleCalib.cc @@ -11,37 +11,97 @@ #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/EventSetup.h" +#include "FWCore/Framework/interface/Frameworkfwd.h" +#include "FWCore/Framework/interface/MakerMacros.h" +#include "FWCore/MessageLogger/interface/MessageLogger.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "FWCore/ServiceRegistry/interface/Service.h" -#include "FWCore/MessageLogger/interface/MessageLogger.h" // DQM include files +#include "DQMServices/Core/interface/DQMEDAnalyzer.h" #include "DQMServices/Core/interface/DQMStore.h" // work on collections #include "DataFormats/EcalDetId/interface/EBDetId.h" #include "DataFormats/EcalDetId/interface/EEDetId.h" - #include "DataFormats/EcalRecHit/interface/EcalRecHit.h" +#include "DataFormats/DetId/interface/DetId.h" +#include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h" +#include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h" +#include "DataFormats/EgammaCandidates/interface/GsfElectronFwd.h" + +class DQMSourceEleCalib : public DQMEDAnalyzer { +public: + DQMSourceEleCalib(const edm::ParameterSet &); + ~DQMSourceEleCalib() override; + +protected: + void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override; + + void analyze(const edm::Event &e, const edm::EventSetup &c) override; + +private: + //! find the MOX + DetId findMaxHit(const std::vector> &, + const EcalRecHitCollection *, + const EcalRecHitCollection *); + //! fills local occupancy graphs + void fillAroundBarrel(const EcalRecHitCollection *, int, int); + void fillAroundEndcap(const EcalRecHitCollection *, int, int); + + int eventCounter_; -#include "DQMOffline/CalibCalo/interface/DQMSourceEleCalib.h" + //! Number of recHits per electron + MonitorElement *recHitsPerElectron_; + //! Number of electrons + MonitorElement *ElectronsNumber_; + //! ESCoP + MonitorElement *ESCoP_; + //! Occupancy + MonitorElement *OccupancyEB_; + MonitorElement *OccupancyEEP_; + MonitorElement *OccupancyEEM_; + MonitorElement *LocalOccupancyEB_; + MonitorElement *LocalOccupancyEE_; -using namespace std; -using namespace edm; + //! recHits over associated recHits + MonitorElement *HitsVsAssociatedHits_; + + /// object to monitor + edm::EDGetTokenT productMonitoredEB_; + + /// object to monitor + edm::EDGetTokenT productMonitoredEE_; + //! electrons to monitor + edm::EDGetTokenT productMonitoredElectrons_; + + /// Monitor every prescaleFactor_ events + unsigned int prescaleFactor_; + + /// DQM folder name + std::string folderName_; + + /// Write to file + bool saveToFile_; + + /// Output file name if required + std::string fileName_; +}; // ****************************************** // constructors // ***************************************** DQMSourceEleCalib::DQMSourceEleCalib(const edm::ParameterSet &ps) : eventCounter_(0) { - folderName_ = ps.getUntrackedParameter("FolderName", "ALCAStreamEcalSingleEle"); + folderName_ = ps.getUntrackedParameter("FolderName", "ALCAStreamEcalSingleEle"); productMonitoredEB_ = consumes(ps.getParameter("AlCaStreamEBTag")); productMonitoredEE_ = consumes(ps.getParameter("AlCaStreamEETag")); saveToFile_ = ps.getUntrackedParameter("SaveToFile", false); - fileName_ = ps.getUntrackedParameter("FileName", "MonitorAlCaEcalSingleEle.root"); - productMonitoredElectrons_ = consumes(ps.getParameter("electronCollection")); + fileName_ = ps.getUntrackedParameter("FileName", "MonitorAlCaEcalSingleEle.root"); + productMonitoredElectrons_ = + consumes(ps.getParameter("electronCollection")); prescaleFactor_ = ps.getUntrackedParameter("prescaleFactor", 1); } @@ -70,7 +130,7 @@ void DQMSourceEleCalib::bookHistograms(DQMStore::IBooker &ibooker, //------------------------------------------------------------- -void DQMSourceEleCalib::analyze(const Event &iEvent, const EventSetup &iSetup) { +void DQMSourceEleCalib::analyze(const edm::Event &iEvent, const edm::EventSetup &iSetup) { // if (eventCounter_% prescaleFactor_ ) return; //FIXME eventCounter_++; int numberOfHits = 0; @@ -193,3 +253,5 @@ void DQMSourceEleCalib::fillAroundEndcap(const EcalRecHitCollection *recHits, in } return; } + +DEFINE_FWK_MODULE(DQMSourceEleCalib); diff --git a/DQMOffline/CalibCalo/src/DQMSourcePi0.cc b/DQMOffline/CalibCalo/plugins/DQMSourcePi0.cc similarity index 83% rename from DQMOffline/CalibCalo/src/DQMSourcePi0.cc rename to DQMOffline/CalibCalo/plugins/DQMSourcePi0.cc index 0161b1279c351..11388c2454f2e 100644 --- a/DQMOffline/CalibCalo/src/DQMSourcePi0.cc +++ b/DQMOffline/CalibCalo/plugins/DQMSourcePi0.cc @@ -1,49 +1,328 @@ #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/EventSetup.h" +#include "FWCore/Framework/interface/Frameworkfwd.h" +#include "FWCore/Framework/interface/MakerMacros.h" +#include "FWCore/MessageLogger/interface/MessageLogger.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "FWCore/ServiceRegistry/interface/Service.h" +#include "FWCore/Utilities/interface/InputTag.h" // DQM include files +#include "DQMServices/Core/interface/DQMEDAnalyzer.h" #include "DQMServices/Core/interface/DQMStore.h" // work on collections +#include "DataFormats/DetId/interface/DetId.h" #include "DataFormats/EcalDetId/interface/EBDetId.h" #include "DataFormats/EcalDetId/interface/EEDetId.h" #include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h" - #include "DataFormats/EcalRecHit/interface/EcalRecHit.h" - -#include "DQMOffline/CalibCalo/src/DQMSourcePi0.h" - -#include "DataFormats/DetId/interface/DetId.h" -#include "DataFormats/EcalDetId/interface/EBDetId.h" -#include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h" #include "DataFormats/EgammaReco/interface/BasicCluster.h" #include "DataFormats/Math/interface/Point3D.h" - #include "DataFormats/Common/interface/Handle.h" -#include "FWCore/Framework/interface/ESHandle.h" -#include "FWCore/Framework/interface/Event.h" -#include "FWCore/Framework/interface/EventSetup.h" -#include "FWCore/MessageLogger/interface/MessageLogger.h" - #include "DataFormats/RecoCandidate/interface/RecoEcalCandidate.h" #include "DataFormats/RecoCandidate/interface/RecoEcalCandidateFwd.h" +// Geometry +#include "Geometry/Records/interface/CaloTopologyRecord.h" +#include "Geometry/CaloGeometry/interface/CaloCellGeometry.h" +#include "Geometry/CaloGeometry/interface/CaloGeometry.h" +#include "Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h" +#include "Geometry/CaloTopology/interface/CaloSubdetectorTopology.h" +#include "Geometry/CaloTopology/interface/CaloTopology.h" +#include "Geometry/CaloTopology/interface/EcalBarrelTopology.h" +#include "Geometry/CaloTopology/interface/EcalEndcapTopology.h" +#include "Geometry/Records/interface/IdealGeometryRecord.h" +#include "RecoEcal/EgammaCoreTools/interface/PositionCalc.h" + #include "TVector3.h" -#define TWOPI 6.283185308 +// Less than operator for sorting EcalRecHits according to energy. +inline bool ecalRecHitGreater(EcalRecHit x, EcalRecHit y) { return (x.energy() > y.energy()); } + +class DQMSourcePi0 : public DQMEDAnalyzer { +public: + DQMSourcePi0(const edm::ParameterSet &); + ~DQMSourcePi0() override; + +protected: + void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override; + void analyze(const edm::Event &e, const edm::EventSetup &c) override; + + void convxtalid(int &, int &); + int diff_neta_s(int, int); + int diff_nphi_s(int, int); + +private: + int eventCounter_; + PositionCalc posCalculator_; + + /// Distribution of rechits in iPhi (pi0) + MonitorElement *hiPhiDistrEBpi0_; + + /// Distribution of rechits in ix EE (pi0) + MonitorElement *hiXDistrEEpi0_; + + /// Distribution of rechits in iPhi (eta) + MonitorElement *hiPhiDistrEBeta_; + + /// Distribution of rechits in ix EE (eta) + MonitorElement *hiXDistrEEeta_; + + /// Distribution of rechits in iEta (pi0) + MonitorElement *hiEtaDistrEBpi0_; + + /// Distribution of rechits in iy EE (pi0) + MonitorElement *hiYDistrEEpi0_; + + /// Distribution of rechits in iEta (eta) + MonitorElement *hiEtaDistrEBeta_; + + /// Distribution of rechits in iy EE (eta) + MonitorElement *hiYDistrEEeta_; + + /// Energy Distribution of rechits EB (pi0) + MonitorElement *hRechitEnergyEBpi0_; + + /// Energy Distribution of rechits EE (pi0) + MonitorElement *hRechitEnergyEEpi0_; + + /// Energy Distribution of rechits EB (eta) + MonitorElement *hRechitEnergyEBeta_; + + /// Energy Distribution of rechits EE (eta) + MonitorElement *hRechitEnergyEEeta_; + + /// Distribution of total event energy EB (pi0) + MonitorElement *hEventEnergyEBpi0_; + + /// Distribution of total event energy EE (pi0) + MonitorElement *hEventEnergyEEpi0_; + + /// Distribution of total event energy EB (eta) + MonitorElement *hEventEnergyEBeta_; + + /// Distribution of total event energy EE (eta) + MonitorElement *hEventEnergyEEeta_; + + /// Distribution of number of RecHits EB (pi0) + MonitorElement *hNRecHitsEBpi0_; + + /// Distribution of number of RecHits EE (pi0) + MonitorElement *hNRecHitsEEpi0_; + + /// Distribution of number of RecHits EB (eta) + MonitorElement *hNRecHitsEBeta_; + + /// Distribution of number of RecHits EE (eta) + MonitorElement *hNRecHitsEEeta_; + + /// Distribution of Mean energy per rechit EB (pi0) + MonitorElement *hMeanRecHitEnergyEBpi0_; + + /// Distribution of Mean energy per rechit EE (pi0) + MonitorElement *hMeanRecHitEnergyEEpi0_; -using namespace std; -using namespace edm; + /// Distribution of Mean energy per rechit EB (eta) + MonitorElement *hMeanRecHitEnergyEBeta_; + + /// Distribution of Mean energy per rechit EE (eta) + MonitorElement *hMeanRecHitEnergyEEeta_; + + /// Pi0 invariant mass in EB + MonitorElement *hMinvPi0EB_; + + /// Pi0 invariant mass in EE + MonitorElement *hMinvPi0EE_; + + /// Eta invariant mass in EB + MonitorElement *hMinvEtaEB_; + + /// Eta invariant mass in EE + MonitorElement *hMinvEtaEE_; + + /// Pt of the 1st most energetic Pi0 photon in EB + MonitorElement *hPt1Pi0EB_; + + /// Pt of the 1st most energetic Pi0 photon in EE + MonitorElement *hPt1Pi0EE_; + + /// Pt of the 1st most energetic Eta photon in EB + MonitorElement *hPt1EtaEB_; + + /// Pt of the 1st most energetic Eta photon in EE + MonitorElement *hPt1EtaEE_; + + /// Pt of the 2nd most energetic Pi0 photon in EB + MonitorElement *hPt2Pi0EB_; + + /// Pt of the 2nd most energetic Pi0 photon in EE + MonitorElement *hPt2Pi0EE_; + + /// Pt of the 2nd most energetic Eta photon in EB + MonitorElement *hPt2EtaEB_; + + /// Pt of the 2nd most energetic Eta photon in EE + MonitorElement *hPt2EtaEE_; + + /// Pi0 Pt in EB + MonitorElement *hPtPi0EB_; + + /// Pi0 Pt in EE + MonitorElement *hPtPi0EE_; + + /// Eta Pt in EB + MonitorElement *hPtEtaEB_; + + /// Eta Pt in EE + MonitorElement *hPtEtaEE_; + + /// Pi0 Iso EB + MonitorElement *hIsoPi0EB_; + + /// Pi0 Iso EE + MonitorElement *hIsoPi0EE_; + + /// Eta Iso EB + MonitorElement *hIsoEtaEB_; + + /// Eta Iso EE + MonitorElement *hIsoEtaEE_; + + /// S4S9 of the 1st most energetic pi0 photon + MonitorElement *hS4S91Pi0EB_; + + /// S4S9 of the 1st most energetic pi0 photon EE + MonitorElement *hS4S91Pi0EE_; + + /// S4S9 of the 1st most energetic eta photon + MonitorElement *hS4S91EtaEB_; + + /// S4S9 of the 1st most energetic eta photon EE + MonitorElement *hS4S91EtaEE_; + + /// S4S9 of the 2nd most energetic pi0 photon + MonitorElement *hS4S92Pi0EB_; + + /// S4S9 of the 2nd most energetic pi0 photon EE + MonitorElement *hS4S92Pi0EE_; + + /// S4S9 of the 2nd most energetic eta photon + MonitorElement *hS4S92EtaEB_; + + /// S4S9 of the 2nd most energetic eta photon EE + MonitorElement *hS4S92EtaEE_; + + /// object to monitor + edm::EDGetTokenT productMonitoredEBpi0_; + edm::EDGetTokenT productMonitoredEBeta_; + + /// object to monitor + edm::EDGetTokenT productMonitoredEEpi0_; + edm::EDGetTokenT productMonitoredEEeta_; + + edm::ESGetToken caloTopoToken_; + edm::ESGetToken caloGeomToken_; + + int gammaCandEtaSize_; + int gammaCandPhiSize_; + + double seleXtalMinEnergy_; + double seleXtalMinEnergyEndCap_; + + double clusSeedThr_; + int clusEtaSize_; + int clusPhiSize_; + + double clusSeedThrEndCap_; + + //// for pi0->gg barrel + double selePtGamma_; + double selePtPi0_; + double seleMinvMaxPi0_; + double seleMinvMinPi0_; + double seleS4S9Gamma_; + double selePi0BeltDR_; + double selePi0BeltDeta_; + double selePi0Iso_; + double ptMinForIsolation_; + + /// for pi0->gg endcap + double selePtGammaEndCap_; + double selePtPi0EndCap_; + double seleMinvMaxPi0EndCap_; + double seleMinvMinPi0EndCap_; + double seleS4S9GammaEndCap_; + double selePi0IsoEndCap_; + double selePi0BeltDREndCap_; + double selePi0BeltDetaEndCap_; + double ptMinForIsolationEndCap_; + + /// for eta->gg barrel + double selePtGammaEta_; + double selePtEta_; + double seleS4S9GammaEta_; + double seleS9S25GammaEta_; + double seleMinvMaxEta_; + double seleMinvMinEta_; + double ptMinForIsolationEta_; + double seleEtaIso_; + double seleEtaBeltDR_; + double seleEtaBeltDeta_; + + /// for eta->gg endcap + double selePtGammaEtaEndCap_; + double seleS4S9GammaEtaEndCap_; + double seleS9S25GammaEtaEndCap_; + double selePtEtaEndCap_; + double seleMinvMaxEtaEndCap_; + double seleMinvMinEtaEndCap_; + double ptMinForIsolationEtaEndCap_; + double seleEtaIsoEndCap_; + double seleEtaBeltDREndCap_; + double seleEtaBeltDetaEndCap_; + + bool ParameterLogWeighted_; + double ParameterX0_; + double ParameterT0_barl_; + double ParameterT0_endc_; + double ParameterT0_endcPresh_; + double ParameterW0_; + + std::vector detIdEBRecHits; + std::vector EBRecHits; + + std::vector detIdEERecHits; + std::vector EERecHits; + + /// Monitor every prescaleFactor_ events + unsigned int prescaleFactor_; + + /// DQM folder name + std::string folderName_; + + /// Write to file + bool saveToFile_; + + /// which subdet will be monitored + bool isMonEBpi0_; + bool isMonEBeta_; + bool isMonEEpi0_; + bool isMonEEeta_; + + /// Output file name if required + std::string fileName_; +}; + +#define TWOPI 6.283185308 // ****************************************** // constructors // ***************************************** DQMSourcePi0::DQMSourcePi0(const edm::ParameterSet &ps) : eventCounter_(0) { - folderName_ = ps.getUntrackedParameter("FolderName", "HLT/AlCaEcalPi0"); + folderName_ = ps.getUntrackedParameter("FolderName", "HLT/AlCaEcalPi0"); prescaleFactor_ = ps.getUntrackedParameter("prescaleFactor", 1); productMonitoredEBpi0_ = consumes(ps.getUntrackedParameter("AlCaStreamEBpi0Tag")); @@ -62,7 +341,7 @@ DQMSourcePi0::DQMSourcePi0(const edm::ParameterSet &ps) : eventCounter_(0) { isMonEEeta_ = ps.getUntrackedParameter("isMonEEeta", false); saveToFile_ = ps.getUntrackedParameter("SaveToFile", false); - fileName_ = ps.getUntrackedParameter("FileName", "MonitorAlCaEcalPi0.root"); + fileName_ = ps.getUntrackedParameter("FileName", "MonitorAlCaEcalPi0.root"); clusSeedThr_ = ps.getParameter("clusSeedThr"); clusSeedThrEndCap_ = ps.getParameter("clusSeedThrEndCap"); @@ -304,7 +583,7 @@ void DQMSourcePi0::bookHistograms(DQMStore::IBooker &ibooker, edm::Run const &ir } //------------------------------------------------------------- -void DQMSourcePi0::analyze(const Event &iEvent, const EventSetup &iSetup) { +void DQMSourcePi0::analyze(const edm::Event &iEvent, const edm::EventSetup &iSetup) { if (eventCounter_ % prescaleFactor_) return; eventCounter_++; @@ -314,7 +593,7 @@ void DQMSourcePi0::analyze(const Event &iEvent, const EventSetup &iSetup) { std::vector seeds; seeds.clear(); - vector usedXtals; + std::vector usedXtals; usedXtals.clear(); detIdEBRecHits.clear(); //// EBDetId @@ -387,22 +666,22 @@ void DQMSourcePi0::analyze(const Event &iEvent, const EventSetup &iSetup) { // cout<< " Pi0 seeds: "< eClus; - vector etClus; - vector etaClus; - vector thetaClus; - vector phiClus; - vector max_hit; - - vector> RecHitsCluster; - vector> RecHitsCluster5x5; - vector s4s9Clus; - vector s9s25Clus; + std::vector eClus; + std::vector etClus; + std::vector etaClus; + std::vector thetaClus; + std::vector phiClus; + std::vector max_hit; + + std::vector> RecHitsCluster; + std::vector> RecHitsCluster5x5; + std::vector s4s9Clus; + std::vector s9s25Clus; nClus = 0; // Make own simple clusters (3x3, 5x5 or clusPhiSize_ x clusEtaSize_) - sort(seeds.begin(), seeds.end(), ecalRecHitGreater); + std::sort(seeds.begin(), seeds.end(), ecalRecHitGreater); for (std::vector::iterator itseed = seeds.begin(); itseed != seeds.end(); itseed++) { EBDetId seed_id = itseed->id(); @@ -424,8 +703,8 @@ void DQMSourcePi0::analyze(const Event &iEvent, const EventSetup &iSetup) { // Reject the seed if not able to build the cluster around it correctly // if(clus_v.size() < clusEtaSize_*clusPhiSize_){cout<<" Not enough // RecHits "< RecHitsInWindow; - vector RecHitsInWindow5x5; + std::vector RecHitsInWindow; + std::vector RecHitsInWindow5x5; double simple_energy = 0; @@ -522,7 +801,7 @@ void DQMSourcePi0::analyze(const Event &iEvent, const EventSetup &iSetup) { if (e3x3 <= 0) continue; - float s4s9_max = *max_element(s4s9_tmp, s4s9_tmp + 4) / e3x3; + float s4s9_max = *std::max_element(s4s9_tmp, s4s9_tmp + 4) / e3x3; /// calculate e5x5 std::vector clus_v5x5 = topology_p->getWindow(seed_id, 5, 5); @@ -596,7 +875,7 @@ void DQMSourcePi0::analyze(const Event &iEvent, const EventSetup &iSetup) { (p0y + p1y) * (p0y + p1y) - (p0z + p1z) * (p0z + p1z)); if ((m_inv < seleMinvMaxPi0_) && (m_inv > seleMinvMinPi0_)) { // New Loop on cluster to measure isolation: - vector IsoClus; + std::vector IsoClus; IsoClus.clear(); float Iso = 0; TVector3 pairVect = TVector3((p0x + p1x), (p0y + p1y), (p0z + p1z)); @@ -696,22 +975,22 @@ void DQMSourcePi0::analyze(const Event &iEvent, const EventSetup &iSetup) { // cout<< " Eta seeds: "< eClus; - vector etClus; - vector etaClus; - vector thetaClus; - vector phiClus; - vector max_hit; - - vector> RecHitsCluster; - vector> RecHitsCluster5x5; - vector s4s9Clus; - vector s9s25Clus; + std::vector eClus; + std::vector etClus; + std::vector etaClus; + std::vector thetaClus; + std::vector phiClus; + std::vector max_hit; + + std::vector> RecHitsCluster; + std::vector> RecHitsCluster5x5; + std::vector s4s9Clus; + std::vector s9s25Clus; nClus = 0; // Make own simple clusters (3x3, 5x5 or clusPhiSize_ x clusEtaSize_) - sort(seeds.begin(), seeds.end(), ecalRecHitGreater); + std::sort(seeds.begin(), seeds.end(), ecalRecHitGreater); for (std::vector::iterator itseed = seeds.begin(); itseed != seeds.end(); itseed++) { EBDetId seed_id = itseed->id(); @@ -733,8 +1012,8 @@ void DQMSourcePi0::analyze(const Event &iEvent, const EventSetup &iSetup) { // Reject the seed if not able to build the cluster around it correctly // if(clus_v.size() < clusEtaSize_*clusPhiSize_){cout<<" Not enough // RecHits "< RecHitsInWindow; - vector RecHitsInWindow5x5; + std::vector RecHitsInWindow; + std::vector RecHitsInWindow5x5; double simple_energy = 0; @@ -831,7 +1110,7 @@ void DQMSourcePi0::analyze(const Event &iEvent, const EventSetup &iSetup) { if (e3x3 <= 0) continue; - float s4s9_max = *max_element(s4s9_tmp, s4s9_tmp + 4) / e3x3; + float s4s9_max = *std::max_element(s4s9_tmp, s4s9_tmp + 4) / e3x3; /// calculate e5x5 std::vector clus_v5x5 = topology_p->getWindow(seed_id, 5, 5); @@ -905,7 +1184,7 @@ void DQMSourcePi0::analyze(const Event &iEvent, const EventSetup &iSetup) { (p0y + p1y) * (p0y + p1y) - (p0z + p1z) * (p0z + p1z)); if ((m_inv < seleMinvMaxEta_) && (m_inv > seleMinvMinEta_)) { // New Loop on cluster to measure isolation: - vector IsoClus; + std::vector IsoClus; IsoClus.clear(); float Iso = 0; TVector3 pairVect = TVector3((p0x + p1x), (p0y + p1y), (p0z + p1z)); @@ -982,7 +1261,7 @@ void DQMSourcePi0::analyze(const Event &iEvent, const EventSetup &iSetup) { std::vector seedsEndCap; seedsEndCap.clear(); - vector usedXtalsEndCap; + std::vector usedXtalsEndCap; usedXtalsEndCap.clear(); ////make seeds. @@ -1016,20 +1295,20 @@ void DQMSourcePi0::analyze(const Event &iEvent, const EventSetup &iSetup) { // "<size()<<" "<size()<<" "< eClusEndCap; - vector etClusEndCap; - vector etaClusEndCap; - vector thetaClusEndCap; - vector phiClusEndCap; - vector> RecHitsClusterEndCap; - vector> RecHitsCluster5x5EndCap; - vector s4s9ClusEndCap; - vector s9s25ClusEndCap; + std::vector eClusEndCap; + std::vector etClusEndCap; + std::vector etaClusEndCap; + std::vector thetaClusEndCap; + std::vector phiClusEndCap; + std::vector> RecHitsClusterEndCap; + std::vector> RecHitsCluster5x5EndCap; + std::vector s4s9ClusEndCap; + std::vector s9s25ClusEndCap; nClusEndCap = 0; // Make own simple clusters (3x3, 5x5 or clusPhiSize_ x clusEtaSize_) - sort(seedsEndCap.begin(), seedsEndCap.end(), ecalRecHitGreater); + std::sort(seedsEndCap.begin(), seedsEndCap.end(), ecalRecHitGreater); for (std::vector::iterator itseed = seedsEndCap.begin(); itseed != seedsEndCap.end(); itseed++) { EEDetId seed_id = itseed->id(); @@ -1048,8 +1327,8 @@ void DQMSourcePi0::analyze(const Event &iEvent, const EventSetup &iSetup) { std::vector clus_v = topology_ee->getWindow(seed_id, clusEtaSize_, clusPhiSize_); std::vector> clus_used; - vector RecHitsInWindow; - vector RecHitsInWindow5x5; + std::vector RecHitsInWindow; + std::vector RecHitsInWindow5x5; float simple_energy = 0; @@ -1131,7 +1410,7 @@ void DQMSourcePi0::analyze(const Event &iEvent, const EventSetup &iSetup) { etaClusEndCap.push_back(clus_pos.eta()); thetaClusEndCap.push_back(theta_s); phiClusEndCap.push_back(clus_pos.phi()); - s4s9ClusEndCap.push_back(*max_element(s4s9_tmp, s4s9_tmp + 4) / e3x3); + s4s9ClusEndCap.push_back(*std::max_element(s4s9_tmp, s4s9_tmp + 4) / e3x3); s9s25ClusEndCap.push_back(e3x3 / e5x5); RecHitsClusterEndCap.push_back(RecHitsInWindow); RecHitsCluster5x5EndCap.push_back(RecHitsInWindow5x5); @@ -1168,7 +1447,7 @@ void DQMSourcePi0::analyze(const Event &iEvent, const EventSetup &iSetup) { if ((m_inv < seleMinvMaxPi0EndCap_) && (m_inv > seleMinvMinPi0EndCap_)) { // New Loop on cluster to measure isolation: - vector IsoClus; + std::vector IsoClus; IsoClus.clear(); float Iso = 0; TVector3 pairVect = TVector3((p0x + p1x), (p0y + p1y), (p0z + p1z)); @@ -1234,7 +1513,7 @@ void DQMSourcePi0::analyze(const Event &iEvent, const EventSetup &iSetup) { std::vector seedsEndCap; seedsEndCap.clear(); - vector usedXtalsEndCap; + std::vector usedXtalsEndCap; usedXtalsEndCap.clear(); ////make seeds. @@ -1268,20 +1547,20 @@ void DQMSourcePi0::analyze(const Event &iEvent, const EventSetup &iSetup) { // "<size()<<" "<size()<<" "< eClusEndCap; - vector etClusEndCap; - vector etaClusEndCap; - vector thetaClusEndCap; - vector phiClusEndCap; - vector> RecHitsClusterEndCap; - vector> RecHitsCluster5x5EndCap; - vector s4s9ClusEndCap; - vector s9s25ClusEndCap; + std::vector eClusEndCap; + std::vector etClusEndCap; + std::vector etaClusEndCap; + std::vector thetaClusEndCap; + std::vector phiClusEndCap; + std::vector> RecHitsClusterEndCap; + std::vector> RecHitsCluster5x5EndCap; + std::vector s4s9ClusEndCap; + std::vector s9s25ClusEndCap; nClusEndCap = 0; // Make own simple clusters (3x3, 5x5 or clusPhiSize_ x clusEtaSize_) - sort(seedsEndCap.begin(), seedsEndCap.end(), ecalRecHitGreater); + std::sort(seedsEndCap.begin(), seedsEndCap.end(), ecalRecHitGreater); for (std::vector::iterator itseed = seedsEndCap.begin(); itseed != seedsEndCap.end(); itseed++) { EEDetId seed_id = itseed->id(); @@ -1300,8 +1579,8 @@ void DQMSourcePi0::analyze(const Event &iEvent, const EventSetup &iSetup) { std::vector clus_v = topology_ee->getWindow(seed_id, clusEtaSize_, clusPhiSize_); std::vector> clus_used; - vector RecHitsInWindow; - vector RecHitsInWindow5x5; + std::vector RecHitsInWindow; + std::vector RecHitsInWindow5x5; float simple_energy = 0; @@ -1383,7 +1662,7 @@ void DQMSourcePi0::analyze(const Event &iEvent, const EventSetup &iSetup) { etaClusEndCap.push_back(clus_pos.eta()); thetaClusEndCap.push_back(theta_s); phiClusEndCap.push_back(clus_pos.phi()); - s4s9ClusEndCap.push_back(*max_element(s4s9_tmp, s4s9_tmp + 4) / e3x3); + s4s9ClusEndCap.push_back(*std::max_element(s4s9_tmp, s4s9_tmp + 4) / e3x3); s9s25ClusEndCap.push_back(e3x3 / e5x5); RecHitsClusterEndCap.push_back(RecHitsInWindow); RecHitsCluster5x5EndCap.push_back(RecHitsInWindow5x5); @@ -1420,7 +1699,7 @@ void DQMSourcePi0::analyze(const Event &iEvent, const EventSetup &iSetup) { if ((m_inv < seleMinvMaxEtaEndCap_) && (m_inv > seleMinvMinEtaEndCap_)) { // New Loop on cluster to measure isolation: - vector IsoClus; + std::vector IsoClus; IsoClus.clear(); float Iso = 0; TVector3 pairVect = TVector3((p0x + p1x), (p0y + p1y), (p0z + p1z)); @@ -1506,3 +1785,5 @@ int DQMSourcePi0::diff_nphi_s(Int_t nphi1, Int_t nphi2) { } return mdiff; } + +DEFINE_FWK_MODULE(DQMSourcePi0); diff --git a/DQMOffline/CalibCalo/plugins/SealModule.cc b/DQMOffline/CalibCalo/plugins/SealModule.cc deleted file mode 100644 index 8b457424fd2e7..0000000000000 --- a/DQMOffline/CalibCalo/plugins/SealModule.cc +++ /dev/null @@ -1,20 +0,0 @@ -#include "FWCore/Framework/interface/MakerMacros.h" - -// The PhiSym and Pi0 source module -#include "DQMOffline/CalibCalo/interface/DQMSourceEleCalib.h" -#include "DQMOffline/CalibCalo/src/DQMHOAlCaRecoStream.h" -#include "DQMOffline/CalibCalo/src/DQMHcalDiJetsAlCaReco.h" -#include "DQMOffline/CalibCalo/src/DQMHcalIsoTrackAlCaReco.h" -#include "DQMOffline/CalibCalo/src/DQMHcalIsolatedBunchAlCaReco.h" -#include "DQMOffline/CalibCalo/src/DQMHcalPhiSymAlCaReco.h" -#include "DQMOffline/CalibCalo/src/DQMSourcePi0.h" -#include "DQMOffline/CalibCalo/interface/DQMHcalIterativePhiSymAlCaReco.h" - -DEFINE_FWK_MODULE(DQMHcalPhiSymAlCaReco); -DEFINE_FWK_MODULE(DQMHcalIterativePhiSymAlCaReco); -DEFINE_FWK_MODULE(DQMSourcePi0); -DEFINE_FWK_MODULE(DQMSourceEleCalib); -DEFINE_FWK_MODULE(DQMHcalIsoTrackAlCaReco); -DEFINE_FWK_MODULE(DQMHcalDiJetsAlCaReco); -DEFINE_FWK_MODULE(DQMHOAlCaRecoStream); -DEFINE_FWK_MODULE(DQMHcalIsolatedBunchAlCaReco); diff --git a/DQMOffline/CalibCalo/src/DQMHOAlCaRecoStream.h b/DQMOffline/CalibCalo/src/DQMHOAlCaRecoStream.h deleted file mode 100644 index 11973499eff80..0000000000000 --- a/DQMOffline/CalibCalo/src/DQMHOAlCaRecoStream.h +++ /dev/null @@ -1,58 +0,0 @@ - -#include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Utilities/interface/InputTag.h" - -#include "DQMServices/Core/interface/DQMEDAnalyzer.h" -#include "DQMServices/Core/interface/DQMStore.h" -#include "DataFormats/HcalCalibObjects/interface/HOCalibVariables.h" - -class DQMHOAlCaRecoStream : public DQMEDAnalyzer { -public: - explicit DQMHOAlCaRecoStream(const edm::ParameterSet &); - ~DQMHOAlCaRecoStream() override; - -private: - void analyze(const edm::Event &, const edm::EventSetup &) override; - void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override; - - MonitorElement *hMuonMultipl; - MonitorElement *hMuonMom; - MonitorElement *hMuonEta; - MonitorElement *hMuonPhi; - - MonitorElement *hDirCosine; - MonitorElement *hHOTime; - - MonitorElement *hSigRing[5]; - // MonitorElement* hSigRingm1; - // MonitorElement* hSigRing00; - // MonitorElement* hSigRingp1; - // MonitorElement* hSigRingp2; - - MonitorElement *hPedRing[5]; - // MonitorElement* hPedRingm1; - // MonitorElement* hPedRing00; - // MonitorElement* hPedRingp1; - // MonitorElement* hPedRingp2; - - MonitorElement *hSignal3x3[9]; - - int Nevents; - int Nmuons; - - std::string theRootFileName; - std::string folderName_; - double m_sigmaValue; - - double m_lowRadPosInMuch; - double m_highRadPosInMuch; - - int m_nbins; - double m_lowEdge; - double m_highEdge; - - bool saveToFile_; - edm::EDGetTokenT hoCalibVariableCollectionTag; - - // ----------member data --------------------------- -}; diff --git a/DQMOffline/CalibCalo/src/DQMHcalDiJetsAlCaReco.h b/DQMOffline/CalibCalo/src/DQMHcalDiJetsAlCaReco.h deleted file mode 100644 index 8da6174706078..0000000000000 --- a/DQMOffline/CalibCalo/src/DQMHcalDiJetsAlCaReco.h +++ /dev/null @@ -1,73 +0,0 @@ -#ifndef DQMHcalDiJetsAlCaReco_H -#define DQMHcalDiJetsAlCaReco_H - -/** \class DQMHcalPhiSymAlCaReco - * * - * DQM Source for phi symmetry stream - * - * \author Stefano Argiro' - * Andrea Gozzelino - Universita� e INFN Torino - * - */ - -#include "FWCore/Framework/interface/EDAnalyzer.h" -#include "FWCore/Framework/interface/Frameworkfwd.h" - -#include "DQMServices/Core/interface/DQMEDAnalyzer.h" -#include "DQMServices/Core/interface/DQMStore.h" -#include "DataFormats/CaloTowers/interface/CaloTowerCollection.h" -#include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h" -#include "DataFormats/HcalRecHit/interface/HcalRecHitCollections.h" -#include "DataFormats/JetReco/interface/CaloJet.h" -#include "DataFormats/JetReco/interface/CaloJetCollection.h" - -class DQMHcalDiJetsAlCaReco : public DQMEDAnalyzer { -public: - DQMHcalDiJetsAlCaReco(const edm::ParameterSet &); - ~DQMHcalDiJetsAlCaReco() override; - -protected: - void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override; - void analyze(const edm::Event &e, const edm::EventSetup &c) override; - -private: - int eventCounter_; - - // - // Monitor elements - // - MonitorElement *hiDistrRecHitEnergyEBEE_; - MonitorElement *hiDistrRecHitEnergyHBHE_; - MonitorElement *hiDistrRecHitEnergyHF_; - MonitorElement *hiDistrRecHitEnergyHO_; - - MonitorElement *hiDistrProbeJetEnergy_; - MonitorElement *hiDistrProbeJetEta_; - MonitorElement *hiDistrProbeJetPhi_; - - MonitorElement *hiDistrTagJetEnergy_; - MonitorElement *hiDistrTagJetEta_; - MonitorElement *hiDistrTagJetPhi_; - - MonitorElement *hiDistrEtThirdJet_; - - /// object to monitor - edm::EDGetTokenT jets_; - edm::EDGetTokenT ec_; - edm::EDGetTokenT hbhe_; - edm::EDGetTokenT ho_; - edm::EDGetTokenT hf_; - - /// DQM folder name - std::string folderName_; - - /// Write to file - bool saveToFile_; - - /// Output file name if required - std::string fileName_; - - bool allowMissingInputs_; -}; - -#endif diff --git a/DQMOffline/CalibCalo/src/DQMHcalIsoTrackAlCaReco.h b/DQMOffline/CalibCalo/src/DQMHcalIsoTrackAlCaReco.h deleted file mode 100644 index 9d35b73080752..0000000000000 --- a/DQMOffline/CalibCalo/src/DQMHcalIsoTrackAlCaReco.h +++ /dev/null @@ -1,75 +0,0 @@ -#ifndef DQMHcalIsoTrackAlCaReco_H -#define DQMHcalIsoTrackAlCaReco_H - -// -*- C++ -*- -// -// Package: DQMOffline/CalibCalo -// Class: DQMHcalIsoTrackAlCaReco -// -/**\class DQMHcalIsoTrackAlCaReco DQMHcalIsoTrackAlCaReco.cc - DQMOffline/CalibCalo/src/DQMHcalIsoTrackAlCaReco.cc - - Description: - - Implementation: - -*/ -// -// Original Author: Grigory SAFRONOV -// Created: Tue Oct 14 16:10:31 CEST 2008 -// Modified: Tue Mar 3 16:10:31 CEST 2015 -// -// - -// system include files -#include -#include -#include - -// user include files - -#include "FWCore/Framework/interface/ESHandle.h" -#include "FWCore/Framework/interface/Event.h" -#include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/ParameterSet/interface/ParameterSet.h" - -#include "DataFormats/HLTReco/interface/TriggerEvent.h" -#include "DataFormats/HcalIsolatedTrack/interface/HcalIsolatedTrackCandidate.h" -#include "DataFormats/HcalIsolatedTrack/interface/HcalIsolatedTrackCandidateFwd.h" -#include "DataFormats/Math/interface/deltaR.h" - -#include "DQMServices/Core/interface/DQMEDAnalyzer.h" -#include "DQMServices/Core/interface/DQMStore.h" -#include "FWCore/ServiceRegistry/interface/Service.h" - -class DQMHcalIsoTrackAlCaReco : public DQMEDAnalyzer { -public: - explicit DQMHcalIsoTrackAlCaReco(const edm::ParameterSet &); - ~DQMHcalIsoTrackAlCaReco() override; - - void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override; - void analyze(const edm::Event &, const edm::EventSetup &) override; - -private: - std::string folderName_; - std::vector l1FilterTag_, hltFilterTag_; - std::vector type_; - edm::InputTag labelTrigger_, labelTrack_; - edm::EDGetTokenT tokTrigger_; - edm::EDGetTokenT tokTrack_; - - double pThr_; - - std::vector hL1Pt_, hL1Eta_, hL1phi_; - std::vector hHltP_, hHltEta_, hHltPhi_; - MonitorElement *hL3Dr_, *hL3Rat_; - std::vector hOffP_; - MonitorElement *hMaxP_, *hEnEcal_, *hIeta_, *hIphi_; - - int nTotal_, nHLTaccepts_; - std::vector etaRange_; - std::vector indexH_; - std::vector ifL3_; -}; - -#endif diff --git a/DQMOffline/CalibCalo/src/DQMHcalIsolatedBunchAlCaReco.h b/DQMOffline/CalibCalo/src/DQMHcalIsolatedBunchAlCaReco.h deleted file mode 100644 index 96fabbb61996c..0000000000000 --- a/DQMOffline/CalibCalo/src/DQMHcalIsolatedBunchAlCaReco.h +++ /dev/null @@ -1,50 +0,0 @@ -#ifndef DQMHcalIsolatedBunchAlCaReco_H -#define DQMHcalIsolatedBunchAlCaReco_H - -/** \class DQMHcalIsolatedBunchAlCaReco - * * - * DQM Source for Hcal iolated bunch stream - * - * - */ - -#include - -#include "FWCore/Framework/interface/ESHandle.h" -#include "FWCore/Framework/interface/Event.h" -#include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/ParameterSet/interface/ParameterSet.h" - -#include "DQMServices/Core/interface/DQMEDAnalyzer.h" -#include "DQMServices/Core/interface/DQMStore.h" -#include "DataFormats/Common/interface/TriggerResults.h" -#include "DataFormats/HLTReco/interface/TriggerEvent.h" -#include "DataFormats/HcalRecHit/interface/HcalRecHitCollections.h" - -class DQMHcalIsolatedBunchAlCaReco : public DQMEDAnalyzer { -public: - DQMHcalIsolatedBunchAlCaReco(const edm::ParameterSet &); - ~DQMHcalIsolatedBunchAlCaReco() override; - -protected: - void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override; - void analyze(const edm::Event &e, const edm::EventSetup &c) override; - -private: - // - // Monitor elements - // - MonitorElement *h_Event_, *h_hbhehit_, *h_hfhit_, *h_hohit_; - - /// DQM folder name - std::string folderName_, trigName_; - bool plotAll_; - - /// object to monitor - edm::EDGetTokenT hbhereco_; - edm::EDGetTokenT horeco_; - edm::EDGetTokenT hfreco_; - edm::EDGetTokenT trigResult_; -}; - -#endif diff --git a/DQMOffline/CalibCalo/src/DQMHcalPhiSymAlCaReco.h b/DQMOffline/CalibCalo/src/DQMHcalPhiSymAlCaReco.h deleted file mode 100644 index 378a3bcbfc420..0000000000000 --- a/DQMOffline/CalibCalo/src/DQMHcalPhiSymAlCaReco.h +++ /dev/null @@ -1,99 +0,0 @@ -#ifndef DQMHcalPhiSymAlCaReco_H -#define DQMHcalPhiSymAlCaReco_H - -/** \class DQMHcalPhiSymAlCaReco - * * - * DQM Source for phi symmetry stream - * - * \author Stefano Argiro' - * Andrea Gozzelino - Universita� e INFN Torino - * - */ - -#include "FWCore/Framework/interface/EDAnalyzer.h" -#include "FWCore/Framework/interface/Frameworkfwd.h" - -#include "DQMServices/Core/interface/DQMOneEDAnalyzer.h" -#include "DQMServices/Core/interface/DQMStore.h" -#include "DataFormats/FEDRawData/interface/FEDRawDataCollection.h" -#include "DataFormats/HcalRecHit/interface/HcalRecHitCollections.h" - -class DQMHcalPhiSymAlCaReco : public DQMOneEDAnalyzer<> { -public: - DQMHcalPhiSymAlCaReco(const edm::ParameterSet &); - ~DQMHcalPhiSymAlCaReco() override; - -protected: - // void beginRun(const edm::Run& r, const edm::EventSetup& c); - void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override; - void analyze(const edm::Event &e, const edm::EventSetup &c) override; - - void dqmEndRun(const edm::Run &r, const edm::EventSetup &c) override; - -private: - int eventCounter_; - - // - // Monitor elements - // - MonitorElement *hiDistrMBPl2D_; - MonitorElement *hiDistrNoisePl2D_; - MonitorElement *hiDistrMBMin2D_; - MonitorElement *hiDistrNoiseMin2D_; - - MonitorElement *hiDistrMB2Pl2D_; - MonitorElement *hiDistrNoise2Pl2D_; - MonitorElement *hiDistrMB2Min2D_; - MonitorElement *hiDistrNoise2Min2D_; - - MonitorElement *hiDistrVarMBPl2D_; - MonitorElement *hiDistrVarNoisePl2D_; - MonitorElement *hiDistrVarMBMin2D_; - MonitorElement *hiDistrVarNoiseMin2D_; - - MonitorElement *hiDistrHBHEsize1D_; - MonitorElement *hiDistrHFsize1D_; - - MonitorElement *hFEDsize; - MonitorElement *hHcalIsZS; - MonitorElement *hL1Id; - - int hiDistr_y_nbin_; - int hiDistr_x_nbin_; - double hiDistr_y_min_; - double hiDistr_y_max_; - double hiDistr_x_min_; - double hiDistr_x_max_; - - int hiDistr_r_nbin_; - double ihbhe_size_; - double ihf_size_; - - bool perLSsaving_; //to avoid nanoDQMIO crashing, driven by DQMServices/Core/python/DQMStore_cfi.py - - /// object to monitor - - edm::EDGetTokenT hbherecoMB; - edm::InputTag horecoMB; - edm::EDGetTokenT hfrecoMB; - - edm::EDGetTokenT hbherecoNoise; - edm::InputTag horecoNoise; - edm::EDGetTokenT hfrecoNoise; - - edm::EDGetTokenT rawInLabel_; - - /// DQM folder name - std::string folderName_; - - /// Write to file - bool saveToFile_; - - // period of ZS - unsigned int period_; - - /// Output file name if required - std::string fileName_; -}; - -#endif diff --git a/DQMOffline/CalibCalo/src/DQMSourcePi0.h b/DQMOffline/CalibCalo/src/DQMSourcePi0.h deleted file mode 100644 index b8370dbfc9a34..0000000000000 --- a/DQMOffline/CalibCalo/src/DQMSourcePi0.h +++ /dev/null @@ -1,303 +0,0 @@ -#ifndef DQMSourcePi0_H -#define DQMSourcePi0_H - -#include "FWCore/Framework/interface/EDAnalyzer.h" -#include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/ParameterSet/interface/ParameterSet.h" -#include "FWCore/Utilities/interface/InputTag.h" - -#include "DataFormats/EcalRecHit/interface/EcalRecHit.h" -#include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h" - -// Geometry -#include "DQMServices/Core/interface/DQMEDAnalyzer.h" -#include "DQMServices/Core/interface/DQMStore.h" -#include "Geometry/Records/interface/CaloTopologyRecord.h" -#include "Geometry/CaloGeometry/interface/CaloCellGeometry.h" -#include "Geometry/CaloGeometry/interface/CaloGeometry.h" -#include "Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h" -#include "Geometry/CaloTopology/interface/CaloSubdetectorTopology.h" -#include "Geometry/CaloTopology/interface/CaloTopology.h" -#include "Geometry/CaloTopology/interface/EcalBarrelTopology.h" -#include "Geometry/CaloTopology/interface/EcalEndcapTopology.h" -#include "Geometry/Records/interface/IdealGeometryRecord.h" -#include "RecoEcal/EgammaCoreTools/interface/PositionCalc.h" - -// Less than operator for sorting EcalRecHits according to energy. -inline bool ecalRecHitGreater(EcalRecHit x, EcalRecHit y) { return (x.energy() > y.energy()); } - -class DQMSourcePi0 : public DQMEDAnalyzer { -public: - DQMSourcePi0(const edm::ParameterSet &); - ~DQMSourcePi0() override; - -protected: - void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override; - void analyze(const edm::Event &e, const edm::EventSetup &c) override; - - void convxtalid(int &, int &); - int diff_neta_s(int, int); - int diff_nphi_s(int, int); - -private: - int eventCounter_; - PositionCalc posCalculator_; - - /// Distribution of rechits in iPhi (pi0) - MonitorElement *hiPhiDistrEBpi0_; - - /// Distribution of rechits in ix EE (pi0) - MonitorElement *hiXDistrEEpi0_; - - /// Distribution of rechits in iPhi (eta) - MonitorElement *hiPhiDistrEBeta_; - - /// Distribution of rechits in ix EE (eta) - MonitorElement *hiXDistrEEeta_; - - /// Distribution of rechits in iEta (pi0) - MonitorElement *hiEtaDistrEBpi0_; - - /// Distribution of rechits in iy EE (pi0) - MonitorElement *hiYDistrEEpi0_; - - /// Distribution of rechits in iEta (eta) - MonitorElement *hiEtaDistrEBeta_; - - /// Distribution of rechits in iy EE (eta) - MonitorElement *hiYDistrEEeta_; - - /// Energy Distribution of rechits EB (pi0) - MonitorElement *hRechitEnergyEBpi0_; - - /// Energy Distribution of rechits EE (pi0) - MonitorElement *hRechitEnergyEEpi0_; - - /// Energy Distribution of rechits EB (eta) - MonitorElement *hRechitEnergyEBeta_; - - /// Energy Distribution of rechits EE (eta) - MonitorElement *hRechitEnergyEEeta_; - - /// Distribution of total event energy EB (pi0) - MonitorElement *hEventEnergyEBpi0_; - - /// Distribution of total event energy EE (pi0) - MonitorElement *hEventEnergyEEpi0_; - - /// Distribution of total event energy EB (eta) - MonitorElement *hEventEnergyEBeta_; - - /// Distribution of total event energy EE (eta) - MonitorElement *hEventEnergyEEeta_; - - /// Distribution of number of RecHits EB (pi0) - MonitorElement *hNRecHitsEBpi0_; - - /// Distribution of number of RecHits EE (pi0) - MonitorElement *hNRecHitsEEpi0_; - - /// Distribution of number of RecHits EB (eta) - MonitorElement *hNRecHitsEBeta_; - - /// Distribution of number of RecHits EE (eta) - MonitorElement *hNRecHitsEEeta_; - - /// Distribution of Mean energy per rechit EB (pi0) - MonitorElement *hMeanRecHitEnergyEBpi0_; - - /// Distribution of Mean energy per rechit EE (pi0) - MonitorElement *hMeanRecHitEnergyEEpi0_; - - /// Distribution of Mean energy per rechit EB (eta) - MonitorElement *hMeanRecHitEnergyEBeta_; - - /// Distribution of Mean energy per rechit EE (eta) - MonitorElement *hMeanRecHitEnergyEEeta_; - - /// Pi0 invariant mass in EB - MonitorElement *hMinvPi0EB_; - - /// Pi0 invariant mass in EE - MonitorElement *hMinvPi0EE_; - - /// Eta invariant mass in EB - MonitorElement *hMinvEtaEB_; - - /// Eta invariant mass in EE - MonitorElement *hMinvEtaEE_; - - /// Pt of the 1st most energetic Pi0 photon in EB - MonitorElement *hPt1Pi0EB_; - - /// Pt of the 1st most energetic Pi0 photon in EE - MonitorElement *hPt1Pi0EE_; - - /// Pt of the 1st most energetic Eta photon in EB - MonitorElement *hPt1EtaEB_; - - /// Pt of the 1st most energetic Eta photon in EE - MonitorElement *hPt1EtaEE_; - - /// Pt of the 2nd most energetic Pi0 photon in EB - MonitorElement *hPt2Pi0EB_; - - /// Pt of the 2nd most energetic Pi0 photon in EE - MonitorElement *hPt2Pi0EE_; - - /// Pt of the 2nd most energetic Eta photon in EB - MonitorElement *hPt2EtaEB_; - - /// Pt of the 2nd most energetic Eta photon in EE - MonitorElement *hPt2EtaEE_; - - /// Pi0 Pt in EB - MonitorElement *hPtPi0EB_; - - /// Pi0 Pt in EE - MonitorElement *hPtPi0EE_; - - /// Eta Pt in EB - MonitorElement *hPtEtaEB_; - - /// Eta Pt in EE - MonitorElement *hPtEtaEE_; - - /// Pi0 Iso EB - MonitorElement *hIsoPi0EB_; - - /// Pi0 Iso EE - MonitorElement *hIsoPi0EE_; - - /// Eta Iso EB - MonitorElement *hIsoEtaEB_; - - /// Eta Iso EE - MonitorElement *hIsoEtaEE_; - - /// S4S9 of the 1st most energetic pi0 photon - MonitorElement *hS4S91Pi0EB_; - - /// S4S9 of the 1st most energetic pi0 photon EE - MonitorElement *hS4S91Pi0EE_; - - /// S4S9 of the 1st most energetic eta photon - MonitorElement *hS4S91EtaEB_; - - /// S4S9 of the 1st most energetic eta photon EE - MonitorElement *hS4S91EtaEE_; - - /// S4S9 of the 2nd most energetic pi0 photon - MonitorElement *hS4S92Pi0EB_; - - /// S4S9 of the 2nd most energetic pi0 photon EE - MonitorElement *hS4S92Pi0EE_; - - /// S4S9 of the 2nd most energetic eta photon - MonitorElement *hS4S92EtaEB_; - - /// S4S9 of the 2nd most energetic eta photon EE - MonitorElement *hS4S92EtaEE_; - - /// object to monitor - edm::EDGetTokenT productMonitoredEBpi0_; - edm::EDGetTokenT productMonitoredEBeta_; - - /// object to monitor - edm::EDGetTokenT productMonitoredEEpi0_; - edm::EDGetTokenT productMonitoredEEeta_; - - edm::ESGetToken caloTopoToken_; - edm::ESGetToken caloGeomToken_; - - int gammaCandEtaSize_; - int gammaCandPhiSize_; - - double seleXtalMinEnergy_; - double seleXtalMinEnergyEndCap_; - - double clusSeedThr_; - int clusEtaSize_; - int clusPhiSize_; - - double clusSeedThrEndCap_; - - //// for pi0->gg barrel - double selePtGamma_; - double selePtPi0_; - double seleMinvMaxPi0_; - double seleMinvMinPi0_; - double seleS4S9Gamma_; - double selePi0BeltDR_; - double selePi0BeltDeta_; - double selePi0Iso_; - double ptMinForIsolation_; - - /// for pi0->gg endcap - double selePtGammaEndCap_; - double selePtPi0EndCap_; - double seleMinvMaxPi0EndCap_; - double seleMinvMinPi0EndCap_; - double seleS4S9GammaEndCap_; - double selePi0IsoEndCap_; - double selePi0BeltDREndCap_; - double selePi0BeltDetaEndCap_; - double ptMinForIsolationEndCap_; - - /// for eta->gg barrel - double selePtGammaEta_; - double selePtEta_; - double seleS4S9GammaEta_; - double seleS9S25GammaEta_; - double seleMinvMaxEta_; - double seleMinvMinEta_; - double ptMinForIsolationEta_; - double seleEtaIso_; - double seleEtaBeltDR_; - double seleEtaBeltDeta_; - - /// for eta->gg endcap - double selePtGammaEtaEndCap_; - double seleS4S9GammaEtaEndCap_; - double seleS9S25GammaEtaEndCap_; - double selePtEtaEndCap_; - double seleMinvMaxEtaEndCap_; - double seleMinvMinEtaEndCap_; - double ptMinForIsolationEtaEndCap_; - double seleEtaIsoEndCap_; - double seleEtaBeltDREndCap_; - double seleEtaBeltDetaEndCap_; - - bool ParameterLogWeighted_; - double ParameterX0_; - double ParameterT0_barl_; - double ParameterT0_endc_; - double ParameterT0_endcPresh_; - double ParameterW0_; - - std::vector detIdEBRecHits; - std::vector EBRecHits; - - std::vector detIdEERecHits; - std::vector EERecHits; - - /// Monitor every prescaleFactor_ events - unsigned int prescaleFactor_; - - /// DQM folder name - std::string folderName_; - - /// Write to file - bool saveToFile_; - - /// which subdet will be monitored - bool isMonEBpi0_; - bool isMonEBeta_; - bool isMonEEpi0_; - bool isMonEEeta_; - - /// Output file name if required - std::string fileName_; -}; - -#endif diff --git a/DQMOffline/CalibTracker/plugins/SiStripBadComponentsDQMServiceReader.cc b/DQMOffline/CalibTracker/plugins/SiStripBadComponentsDQMServiceReader.cc index 7ae8d30dc2db6..9b1364f291d6a 100644 --- a/DQMOffline/CalibTracker/plugins/SiStripBadComponentsDQMServiceReader.cc +++ b/DQMOffline/CalibTracker/plugins/SiStripBadComponentsDQMServiceReader.cc @@ -8,8 +8,6 @@ #include #include -#include - using namespace std; SiStripBadComponentsDQMServiceReader::SiStripBadComponentsDQMServiceReader(const edm::ParameterSet& iConfig) @@ -47,7 +45,7 @@ void SiStripBadComponentsDQMServiceReader::analyze(const edm::Event& e, const ed unsigned int value = (*(range.first + it)); ss << detIdToString(detid[id], tTopo) << "\t" << detid[id] << "\t"; - uint32_t flag = boost::lexical_cast(siStripBadStrip.decode(value).flag); + uint32_t flag = static_cast(siStripBadStrip.decode(value).flag); printError(ss, ((flag & FedErrorMask) == FedErrorMask), "Fed error, "); printError(ss, ((flag & DigiErrorMask) == DigiErrorMask), "Digi error, "); @@ -120,7 +118,7 @@ string SiStripBadComponentsDQMServiceReader::detIdToString(DetId detid, const Tr name += "+"; } // if( side != -1 ) { - // name += boost::lexical_cast(side); + // name += std::to_string(side); // } return name; diff --git a/DQMOffline/EGamma/plugins/SealModule.cc b/DQMOffline/EGamma/plugins/SealModule.cc index 4f1ae003ca558..8d0479a17a524 100644 --- a/DQMOffline/EGamma/plugins/SealModule.cc +++ b/DQMOffline/EGamma/plugins/SealModule.cc @@ -1,7 +1,6 @@ #include "FWCore/PluginManager/interface/ModuleDef.h" #include "FWCore/Framework/interface/MakerMacros.h" #include "DQMOffline/EGamma/plugins/PhotonAnalyzer.h" -#include "DQMOffline/EGamma/plugins/ZToMuMuGammaAnalyzer.h" #include "DQMOffline/EGamma/plugins/PhotonOfflineClient.h" #include "DQMOffline/EGamma/plugins/PhotonDataCertification.h" #include "DQMOffline/EGamma/plugins/PiZeroAnalyzer.h" @@ -11,7 +10,6 @@ #include "DQMOffline/EGamma/plugins/ElectronOfflineClient.h" DEFINE_FWK_MODULE(PhotonAnalyzer); -DEFINE_FWK_MODULE(ZToMuMuGammaAnalyzer); DEFINE_FWK_MODULE(PhotonOfflineClient); DEFINE_FWK_MODULE(PhotonDataCertification); DEFINE_FWK_MODULE(PiZeroAnalyzer); diff --git a/DQMOffline/EGamma/plugins/ZToMuMuGammaAnalyzer.cc b/DQMOffline/EGamma/plugins/ZToMuMuGammaAnalyzer.cc index fd61f1acb53ba..a3369c2545189 100644 --- a/DQMOffline/EGamma/plugins/ZToMuMuGammaAnalyzer.cc +++ b/DQMOffline/EGamma/plugins/ZToMuMuGammaAnalyzer.cc @@ -1,18 +1,304 @@ -#include -#include - -#include "DQMOffline/EGamma/plugins/ZToMuMuGammaAnalyzer.h" /** \class ZToMuMuGammaAnalyzer - ** + ** ** ** $Id: ZToMuMuGammaAnalyzer - ** authors: - ** Nancy Marinelli, U. of Notre Dame, US - ** Nathan Kellams, U. of Notre Dame, US - ** + ** authors: + ** Nancy Marinelli, U. of Notre Dame, US + ** Jamie Antonelli, U. of Notre Dame, US + ** Nathan Kellams, U. of Notre Dame, US + ** ***/ +#include "FWCore/ServiceRegistry/interface/Service.h" +#include "CommonTools/UtilAlgos/interface/TFileService.h" + +#include "FWCore/Framework/interface/Event.h" +#include "FWCore/Framework/interface/EventSetup.h" +#include "FWCore/Framework/interface/Frameworkfwd.h" +#include "FWCore/MessageLogger/interface/MessageLogger.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/Utilities/interface/Exception.h" + +// DataFormats +#include "DataFormats/Math/interface/deltaR.h" +#include "DataFormats/Common/interface/Handle.h" +#include "DataFormats/TrackReco/interface/Track.h" +#include "DataFormats/TrackReco/interface/TrackExtra.h" +#include "DataFormats/TrackReco/interface/TrackFwd.h" +#include "DataFormats/Common/interface/ValueMap.h" +#include "DataFormats/EgammaCandidates/interface/Conversion.h" +#include "DataFormats/EgammaCandidates/interface/ConversionFwd.h" +#include "DataFormats/EgammaCandidates/interface/Photon.h" +#include "DataFormats/EgammaCandidates/interface/PhotonFwd.h" +#include "DataFormats/MuonReco/interface/MuonFwd.h" +#include "DataFormats/MuonReco/interface/MuonSelectors.h" +#include "DataFormats/VertexReco/interface/VertexFwd.h" +#include "DataFormats/EgammaReco/interface/SuperCluster.h" +#include "DataFormats/EcalDetId/interface/EBDetId.h" +#include "DataFormats/EcalDetId/interface/EEDetId.h" +#include "DataFormats/DetId/interface/DetId.h" +#include "DataFormats/ParticleFlowCandidate/interface/PFCandidate.h" +#include "DataFormats/EcalRecHit/interface/EcalRecHit.h" +#include "DataFormats/RecoCandidate/interface/RecoEcalCandidate.h" +#include "DataFormats/RecoCandidate/interface/RecoEcalCandidateFwd.h" +#include "DataFormats/HLTReco/interface/TriggerEvent.h" + +/// EgammaCoreTools +#include "RecoEcal/EgammaCoreTools/interface/PositionCalc.h" +#include "RecoEcal/EgammaCoreTools/interface/EcalClusterTools.h" + +#include "CommonTools/Statistics/interface/ChiSquaredProbability.h" + +// Geometry +#include "Geometry/Records/interface/CaloTopologyRecord.h" +#include "Geometry/CaloTopology/interface/CaloTopology.h" +#include "Geometry/CaloTopology/interface/CaloSubdetectorTopology.h" +#include "Geometry/Records/interface/IdealGeometryRecord.h" +#include "Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h" +#include "Geometry/CaloGeometry/interface/CaloCellGeometry.h" +#include "Geometry/CaloGeometry/interface/CaloGeometry.h" +#include "Geometry/CaloTopology/interface/EcalEndcapTopology.h" +#include "Geometry/CaloTopology/interface/EcalBarrelTopology.h" + +#include "TFile.h" +#include "TH1.h" +#include "TH2.h" +#include "TTree.h" +#include "TVector3.h" +#include "TProfile.h" + +//DQM services +#include +#include + +#include +#include +#include +#include + +class ZToMuMuGammaAnalyzer : public DQMEDAnalyzer { +public: + explicit ZToMuMuGammaAnalyzer(const edm::ParameterSet&); + ~ZToMuMuGammaAnalyzer() override; + void bookHistograms(DQMStore::IBooker&, edm::Run const&, edm::EventSetup const&) override; + void analyze(const edm::Event&, const edm::EventSetup&) override; + +private: + edm::EDGetTokenT > photon_token_; + edm::EDGetTokenT > muon_token_; + edm::EDGetTokenT > PhotonIDLoose_token_; + edm::EDGetTokenT > PhotonIDTight_token_; + edm::EDGetTokenT > > barrelRecHit_token_; + edm::EDGetTokenT > > endcapRecHit_token_; + edm::EDGetTokenT triggerEvent_token_; + edm::EDGetTokenT beamSpot_token_; + edm::EDGetTokenT pfCandidates_; + edm::EDGetTokenT offline_pvToken_; + edm::EDGetTokenT > > photonIsoValmap_token_; + + std::string fName_; + bool use2DHistos_; + bool makeProfiles_; + unsigned int prescaleFactor_; + std::stringstream currentFolder_; + int nEvt_; + + // muon selection + float muonMinPt_; + int minPixStripHits_; + float muonMaxChi2_; + float muonMaxDxy_; + int muonMatches_; + int validPixHits_; + int validMuonHits_; + float muonTrackIso_; + float muonTightEta_; + // dimuon selection + float minMumuInvMass_; + float maxMumuInvMass_; + // photon selection + float photonMinEt_; + float photonMaxEta_; + float photonTrackIso_; + + // mu mu gamma selection + float nearMuonDr2_; + float nearMuonHcalIso_; + float farMuonEcalIso_; + float farMuonTrackIso_; + float farMuonMinPt_; + float minMumuGammaInvMass_; + float maxMumuGammaInvMass_; + + // Histogram parameters + double eMin_; + double eMax_; + int eBin_; + + double etMin_; + double etMax_; + int etBin_; + + double sumMin_; + double sumMax_; + int sumBin_; + + double etaMin_; + double etaMax_; + int etaBin_; + + double phiMin_; + double phiMax_; + int phiBin_; + + double r9Min_; + double r9Max_; + int r9Bin_; + + double hOverEMin_; + double hOverEMax_; + int hOverEBin_; + + double numberMin_; + double numberMax_; + int numberBin_; + + double sigmaIetaMin_; + double sigmaIetaMax_; + int sigmaIetaBin_; + + int reducedEtBin_; + int reducedEtaBin_; + int reducedSumBin_; + int reducedR9Bin_; + + float mumuInvMass(const reco::Muon& m1, const reco::Muon& m2); + float mumuGammaInvMass(const reco::Muon& mu1, const reco::Muon& mu2, const reco::PhotonRef& pho); + bool basicMuonSelection(const reco::Muon& m); + bool muonSelection(const reco::Muon& m, const reco::BeamSpot& bs); + bool photonSelection(const reco::PhotonRef& p); + + MonitorElement* h_nRecoVtx_; + ///photon histos + MonitorElement* h1_mumuInvMass_[3]; + MonitorElement* h1_mumuGammaInvMass_[3]; + + MonitorElement* h_phoE_[3]; + MonitorElement* h_phoSigmaEoverE_[3]; + MonitorElement* p_phoSigmaEoverEVsNVtx_[3]; + MonitorElement* h_phoEt_[3]; + + MonitorElement* h_nPho_[3]; + + MonitorElement* h_phoEta_[3]; + MonitorElement* h_phoPhi_[3]; + MonitorElement* h_scEta_[3]; + MonitorElement* h_scPhi_[3]; + + MonitorElement* h_r9_[3]; + MonitorElement* h2_r9VsEt_[3]; + MonitorElement* p_r9VsEt_[3]; + MonitorElement* h2_r9VsEta_[3]; + MonitorElement* p_r9VsEta_[3]; + + MonitorElement* h_e1x5_[3]; + MonitorElement* h2_e1x5VsEta_[3]; + MonitorElement* p_e1x5VsEta_[3]; + MonitorElement* h2_e1x5VsEt_[3]; + MonitorElement* p_e1x5VsEt_[3]; + + MonitorElement* h_e2x5_[3]; + MonitorElement* h2_e2x5VsEta_[3]; + MonitorElement* p_e2x5VsEta_[3]; + MonitorElement* h2_e2x5VsEt_[3]; + MonitorElement* p_e2x5VsEt_[3]; + + MonitorElement* h_r1x5_[3]; + MonitorElement* h2_r1x5VsEta_[3]; + MonitorElement* p_r1x5VsEta_[3]; + MonitorElement* h2_r1x5VsEt_[3]; + MonitorElement* p_r1x5VsEt_[3]; + + MonitorElement* h_r2x5_[3]; + MonitorElement* h2_r2x5VsEta_[3]; + MonitorElement* p_r2x5VsEta_[3]; + MonitorElement* h2_r2x5VsEt_[3]; + MonitorElement* p_r2x5VsEt_[3]; + + MonitorElement* h_phoSigmaIetaIeta_[3]; + MonitorElement* h2_sigmaIetaIetaVsEta_[3]; + MonitorElement* p_sigmaIetaIetaVsEta_[3]; + + MonitorElement* h_nTrackIsolSolid_[3]; + MonitorElement* h2_nTrackIsolSolidVsEt_[3]; + MonitorElement* p_nTrackIsolSolidVsEt_[3]; + MonitorElement* h2_nTrackIsolSolidVsEta_[3]; + MonitorElement* p_nTrackIsolSolidVsEta_[3]; + + MonitorElement* h_nTrackIsolHollow_[3]; + MonitorElement* h2_nTrackIsolHollowVsEt_[3]; + MonitorElement* p_nTrackIsolHollowVsEt_[3]; + MonitorElement* h2_nTrackIsolHollowVsEta_[3]; + MonitorElement* p_nTrackIsolHollowVsEta_[3]; + + MonitorElement* h_trackPtSumSolid_[3]; + MonitorElement* h2_trackPtSumSolidVsEt_[3]; + MonitorElement* p_trackPtSumSolidVsEt_[3]; + MonitorElement* h2_trackPtSumSolidVsEta_[3]; + MonitorElement* p_trackPtSumSolidVsEta_[3]; + + MonitorElement* h_trackPtSumHollow_[3]; + MonitorElement* h2_trackPtSumHollowVsEt_[3]; + MonitorElement* p_trackPtSumHollowVsEt_[3]; + MonitorElement* h2_trackPtSumHollowVsEta_[3]; + MonitorElement* p_trackPtSumHollowVsEta_[3]; + + MonitorElement* h_ecalSum_[3]; + MonitorElement* h2_ecalSumVsEt_[3]; + MonitorElement* p_ecalSumVsEt_[3]; + MonitorElement* h2_ecalSumVsEta_[3]; + MonitorElement* p_ecalSumVsEta_[3]; + + MonitorElement* h_hcalSum_[3]; + MonitorElement* h2_hcalSumVsEt_[3]; + MonitorElement* p_hcalSumVsEt_[3]; + MonitorElement* h2_hcalSumVsEta_[3]; + MonitorElement* p_hcalSumVsEta_[3]; + + MonitorElement* h_hOverE_[3]; + MonitorElement* p_hOverEVsEt_[3]; + MonitorElement* p_hOverEVsEta_[3]; + MonitorElement* h_h1OverE_[3]; + MonitorElement* h_h2OverE_[3]; + + MonitorElement* h_newhOverE_[3]; + MonitorElement* p_newhOverEVsEta_[3]; + MonitorElement* p_newhOverEVsEt_[3]; + // Information from Particle Flow + // Isolation + MonitorElement* h_chHadIso_[3]; + MonitorElement* h_nHadIso_[3]; + MonitorElement* h_phoIso_[3]; + // Identification + MonitorElement* h_nCluOutsideMustache_[3]; + MonitorElement* h_etOutsideMustache_[3]; + MonitorElement* h_pfMva_[3]; + //// particle based isolation from ValueMap + MonitorElement* h_dRPhoPFcand_ChHad_Cleaned_[3]; + MonitorElement* h_dRPhoPFcand_NeuHad_Cleaned_[3]; + MonitorElement* h_dRPhoPFcand_Pho_Cleaned_[3]; + MonitorElement* h_dRPhoPFcand_ChHad_unCleaned_[3]; + MonitorElement* h_dRPhoPFcand_NeuHad_unCleaned_[3]; + MonitorElement* h_dRPhoPFcand_Pho_unCleaned_[3]; + MonitorElement* h_SumPtOverPhoPt_ChHad_Cleaned_[3]; + MonitorElement* h_SumPtOverPhoPt_NeuHad_Cleaned_[3]; + MonitorElement* h_SumPtOverPhoPt_Pho_Cleaned_[3]; + MonitorElement* h_SumPtOverPhoPt_ChHad_unCleaned_[3]; + MonitorElement* h_SumPtOverPhoPt_NeuHad_unCleaned_[3]; + MonitorElement* h_SumPtOverPhoPt_Pho_unCleaned_[3]; +}; + using namespace std; ZToMuMuGammaAnalyzer::ZToMuMuGammaAnalyzer(const edm::ParameterSet& pset) { @@ -55,7 +341,8 @@ ZToMuMuGammaAnalyzer::ZToMuMuGammaAnalyzer(const edm::ParameterSet& pset) { photonMaxEta_ = pset.getParameter("photonMaxEta"); photonTrackIso_ = pset.getParameter("photonTrackIso"); // mumuGamma selection - nearMuonDr_ = pset.getParameter("nearMuonDr"); + nearMuonDr2_ = pset.getParameter("nearMuonDr"); + nearMuonDr2_ *= nearMuonDr2_; nearMuonHcalIso_ = pset.getParameter("nearMuonHcalIso"); farMuonEcalIso_ = pset.getParameter("farMuonEcalIso"); farMuonTrackIso_ = pset.getParameter("farMuonTrackIso"); @@ -979,9 +1266,9 @@ void ZToMuMuGammaAnalyzer::analyze(const edm::Event& e, const edm::EventSetup& e for (unsigned int iPho = 0; iPho < photonHandle->size(); iPho++) { reco::PhotonRef aPho(reco::PhotonRef(photonHandle, iPho)); // - double dr1 = deltaR((*iMu).eta(), aPho->eta(), (*iMu).phi(), aPho->phi()); - double dr2 = deltaR((*iMu2).eta(), aPho->eta(), (*iMu2).phi(), aPho->phi()); - double drNear = dr1; + double dr1 = deltaR2((*iMu).eta(), aPho->eta(), (*iMu).phi(), aPho->phi()); + double dr2 = deltaR2((*iMu2).eta(), aPho->eta(), (*iMu2).phi(), aPho->phi()); + double drNear; if (dr1 < dr2) { nearMuon = *iMu; farMuon = *iMu2; @@ -1000,7 +1287,7 @@ void ZToMuMuGammaAnalyzer::analyze(const edm::Event& e, const edm::EventSetup& e continue; if (farMuon.pt() < farMuonMinPt_) continue; - if (drNear > nearMuonDr_) + if (drNear > nearMuonDr2_) continue; // if (!photonSelection(aPho)) @@ -1106,14 +1393,15 @@ void ZToMuMuGammaAnalyzer::analyze(const edm::Event& e, const edm::EventSetup& e for (unsigned int lCand = 0; lCand < pfCandidateHandle->size(); lCand++) { reco::PFCandidateRef pfCandRef(reco::PFCandidateRef(pfCandidateHandle, lCand)); - float dR = deltaR(aPho->eta(), aPho->phi(), pfCandRef->eta(), pfCandRef->phi()); - if (dR < 0.4) { + float dR = deltaR2(aPho->eta(), aPho->phi(), pfCandRef->eta(), pfCandRef->phi()); + if (dR < 0.4 * 0.4) { /// uncleaned reco::PFCandidate::ParticleType type = pfCandRef->particleId(); if (type == reco::PFCandidate::e) continue; if (type == reco::PFCandidate::gamma && pfCandRef->mva_nothing_gamma() > 0.) continue; + dR = sqrt(dR); if (type == reco::PFCandidate::h) { SumPtIsoValCh += pfCandRef->pt(); @@ -1347,3 +1635,8 @@ float ZToMuMuGammaAnalyzer::mumuGammaInvMass(const reco::Muon& mu1, const reco:: float invMass = sqrt(Mass2); return invMass; } + +#include "FWCore/PluginManager/interface/ModuleDef.h" +#include "FWCore/Framework/interface/MakerMacros.h" + +DEFINE_FWK_MODULE(ZToMuMuGammaAnalyzer); diff --git a/DQMOffline/EGamma/plugins/ZToMuMuGammaAnalyzer.h b/DQMOffline/EGamma/plugins/ZToMuMuGammaAnalyzer.h deleted file mode 100644 index 953ae31329090..0000000000000 --- a/DQMOffline/EGamma/plugins/ZToMuMuGammaAnalyzer.h +++ /dev/null @@ -1,320 +0,0 @@ -#ifndef ZToMuMuGammaAnalyzer_H -#define ZToMuMuGammaAnalyzer_H - -#include "FWCore/ServiceRegistry/interface/Service.h" -#include "CommonTools/UtilAlgos/interface/TFileService.h" - -#include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/MakerMacros.h" -#include "FWCore/MessageLogger/interface/MessageLogger.h" -#include "FWCore/Utilities/interface/Exception.h" -// DataFormats -#include "DataFormats/Math/interface/deltaR.h" -#include "DataFormats/Common/interface/Handle.h" -#include "DataFormats/TrackReco/interface/Track.h" -#include "DataFormats/TrackReco/interface/TrackExtra.h" -#include "DataFormats/TrackReco/interface/TrackFwd.h" -#include "DataFormats/Common/interface/ValueMap.h" -#include "DataFormats/EgammaCandidates/interface/Conversion.h" -#include "DataFormats/EgammaCandidates/interface/ConversionFwd.h" -#include "DataFormats/EgammaCandidates/interface/Photon.h" -#include "DataFormats/EgammaCandidates/interface/PhotonFwd.h" -#include "DataFormats/MuonReco/interface/MuonFwd.h" -#include "DataFormats/MuonReco/interface/MuonSelectors.h" -#include "DataFormats/VertexReco/interface/VertexFwd.h" -#include "DataFormats/EgammaReco/interface/BasicCluster.h" -#include "DataFormats/EgammaReco/interface/BasicClusterFwd.h" -#include "DataFormats/CaloRecHit/interface/CaloCluster.h" -#include "DataFormats/CaloRecHit/interface/CaloClusterFwd.h" -#include "DataFormats/EgammaReco/interface/SuperCluster.h" -#include "DataFormats/EcalDetId/interface/EBDetId.h" -#include "DataFormats/EcalDetId/interface/EEDetId.h" -#include "DataFormats/DetId/interface/DetId.h" -#include "DataFormats/ParticleFlowCandidate/interface/PFCandidate.h" -#include "DataFormats/EcalRecHit/interface/EcalRecHit.h" -#include "DataFormats/RecoCandidate/interface/RecoEcalCandidate.h" -#include "DataFormats/RecoCandidate/interface/RecoEcalCandidateFwd.h" -#include "DataFormats/HLTReco/interface/TriggerEvent.h" - -/// EgammaCoreTools -#include "RecoEcal/EgammaCoreTools/interface/PositionCalc.h" -#include "RecoEcal/EgammaCoreTools/interface/EcalClusterTools.h" - -#include "CommonTools/Statistics/interface/ChiSquaredProbability.h" - -// Geometry -#include "Geometry/Records/interface/CaloTopologyRecord.h" -#include "Geometry/CaloTopology/interface/CaloTopology.h" -#include "Geometry/CaloTopology/interface/CaloSubdetectorTopology.h" -#include "Geometry/Records/interface/IdealGeometryRecord.h" -#include "Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h" -#include "Geometry/CaloGeometry/interface/CaloCellGeometry.h" -#include "Geometry/CaloGeometry/interface/CaloGeometry.h" -#include "Geometry/CaloTopology/interface/EcalEndcapTopology.h" -#include "Geometry/CaloTopology/interface/EcalBarrelTopology.h" - -#include "TFile.h" -#include "TH1.h" -#include "TH2.h" -#include "TTree.h" -#include "TVector3.h" -#include "TProfile.h" - -#include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h" -#include "Geometry/CaloGeometry/interface/CaloGeometry.h" -#include "Geometry/CaloTopology/interface/CaloTopology.h" -#include "FWCore/ParameterSet/interface/ParameterSet.h" -#include "FWCore/Framework/interface/Event.h" -#include "FWCore/Framework/interface/EventSetup.h" -#include "FWCore/Framework/interface/ESHandle.h" - -//DQM services -#include -#include - -#include -#include - -/** \class ZToMuMuGammaAnalyzer - ** - ** - ** $Id: ZToMuMuGammaAnalyzer - ** authors: - ** Nancy Marinelli, U. of Notre Dame, US - ** Jamie Antonelli, U. of Notre Dame, US - ** Nathan Kellams, U. of Notre Dame, US - ** - ***/ - -// forward declarations -class TFile; -class TH1F; -class TH2F; -class TProfile; -class TTree; -class SimVertex; -class SimTrack; - -class ZToMuMuGammaAnalyzer : public DQMEDAnalyzer { -public: - explicit ZToMuMuGammaAnalyzer(const edm::ParameterSet&); - ~ZToMuMuGammaAnalyzer() override; - void bookHistograms(DQMStore::IBooker&, edm::Run const&, edm::EventSetup const&) override; - void analyze(const edm::Event&, const edm::EventSetup&) override; - -private: - edm::EDGetTokenT > photon_token_; - edm::EDGetTokenT > muon_token_; - edm::EDGetTokenT > PhotonIDLoose_token_; - edm::EDGetTokenT > PhotonIDTight_token_; - edm::EDGetTokenT > > barrelRecHit_token_; - edm::EDGetTokenT > > endcapRecHit_token_; - edm::EDGetTokenT triggerEvent_token_; - edm::EDGetTokenT beamSpot_token_; - edm::EDGetTokenT pfCandidates_; - edm::EDGetTokenT offline_pvToken_; - edm::EDGetTokenT > > photonIsoValmap_token_; - - std::string fName_; - bool use2DHistos_; - bool makeProfiles_; - unsigned int prescaleFactor_; - std::stringstream currentFolder_; - int nEvt_; - - // muon selection - float muonMinPt_; - int minPixStripHits_; - float muonMaxChi2_; - float muonMaxDxy_; - int muonMatches_; - int validPixHits_; - int validMuonHits_; - float muonTrackIso_; - float muonTightEta_; - // dimuon selection - float minMumuInvMass_; - float maxMumuInvMass_; - // photon selection - float photonMinEt_; - float photonMaxEta_; - float photonTrackIso_; - - // mu mu gamma selection - float nearMuonDr_; - float nearMuonHcalIso_; - float farMuonEcalIso_; - float farMuonTrackIso_; - float farMuonMinPt_; - float minMumuGammaInvMass_; - float maxMumuGammaInvMass_; - - // Histogram parameters - double eMin_; - double eMax_; - int eBin_; - - double etMin_; - double etMax_; - int etBin_; - - double sumMin_; - double sumMax_; - int sumBin_; - - double etaMin_; - double etaMax_; - int etaBin_; - - double phiMin_; - double phiMax_; - int phiBin_; - - double r9Min_; - double r9Max_; - int r9Bin_; - - double hOverEMin_; - double hOverEMax_; - int hOverEBin_; - - double numberMin_; - double numberMax_; - int numberBin_; - - double sigmaIetaMin_; - double sigmaIetaMax_; - int sigmaIetaBin_; - - int reducedEtBin_; - int reducedEtaBin_; - int reducedSumBin_; - int reducedR9Bin_; - - float mumuInvMass(const reco::Muon& m1, const reco::Muon& m2); - float mumuGammaInvMass(const reco::Muon& mu1, const reco::Muon& mu2, const reco::PhotonRef& pho); - bool basicMuonSelection(const reco::Muon& m); - bool muonSelection(const reco::Muon& m, const reco::BeamSpot& bs); - bool photonSelection(const reco::PhotonRef& p); - - MonitorElement* h_nRecoVtx_; - ///photon histos - MonitorElement* h1_mumuInvMass_[3]; - MonitorElement* h1_mumuGammaInvMass_[3]; - - MonitorElement* h_phoE_[3]; - MonitorElement* h_phoSigmaEoverE_[3]; - MonitorElement* p_phoSigmaEoverEVsNVtx_[3]; - MonitorElement* h_phoEt_[3]; - - MonitorElement* h_nPho_[3]; - - MonitorElement* h_phoEta_[3]; - MonitorElement* h_phoPhi_[3]; - MonitorElement* h_scEta_[3]; - MonitorElement* h_scPhi_[3]; - - MonitorElement* h_r9_[3]; - MonitorElement* h2_r9VsEt_[3]; - MonitorElement* p_r9VsEt_[3]; - MonitorElement* h2_r9VsEta_[3]; - MonitorElement* p_r9VsEta_[3]; - - MonitorElement* h_e1x5_[3]; - MonitorElement* h2_e1x5VsEta_[3]; - MonitorElement* p_e1x5VsEta_[3]; - MonitorElement* h2_e1x5VsEt_[3]; - MonitorElement* p_e1x5VsEt_[3]; - - MonitorElement* h_e2x5_[3]; - MonitorElement* h2_e2x5VsEta_[3]; - MonitorElement* p_e2x5VsEta_[3]; - MonitorElement* h2_e2x5VsEt_[3]; - MonitorElement* p_e2x5VsEt_[3]; - - MonitorElement* h_r1x5_[3]; - MonitorElement* h2_r1x5VsEta_[3]; - MonitorElement* p_r1x5VsEta_[3]; - MonitorElement* h2_r1x5VsEt_[3]; - MonitorElement* p_r1x5VsEt_[3]; - - MonitorElement* h_r2x5_[3]; - MonitorElement* h2_r2x5VsEta_[3]; - MonitorElement* p_r2x5VsEta_[3]; - MonitorElement* h2_r2x5VsEt_[3]; - MonitorElement* p_r2x5VsEt_[3]; - - MonitorElement* h_phoSigmaIetaIeta_[3]; - MonitorElement* h2_sigmaIetaIetaVsEta_[3]; - MonitorElement* p_sigmaIetaIetaVsEta_[3]; - - MonitorElement* h_nTrackIsolSolid_[3]; - MonitorElement* h2_nTrackIsolSolidVsEt_[3]; - MonitorElement* p_nTrackIsolSolidVsEt_[3]; - MonitorElement* h2_nTrackIsolSolidVsEta_[3]; - MonitorElement* p_nTrackIsolSolidVsEta_[3]; - - MonitorElement* h_nTrackIsolHollow_[3]; - MonitorElement* h2_nTrackIsolHollowVsEt_[3]; - MonitorElement* p_nTrackIsolHollowVsEt_[3]; - MonitorElement* h2_nTrackIsolHollowVsEta_[3]; - MonitorElement* p_nTrackIsolHollowVsEta_[3]; - - MonitorElement* h_trackPtSumSolid_[3]; - MonitorElement* h2_trackPtSumSolidVsEt_[3]; - MonitorElement* p_trackPtSumSolidVsEt_[3]; - MonitorElement* h2_trackPtSumSolidVsEta_[3]; - MonitorElement* p_trackPtSumSolidVsEta_[3]; - - MonitorElement* h_trackPtSumHollow_[3]; - MonitorElement* h2_trackPtSumHollowVsEt_[3]; - MonitorElement* p_trackPtSumHollowVsEt_[3]; - MonitorElement* h2_trackPtSumHollowVsEta_[3]; - MonitorElement* p_trackPtSumHollowVsEta_[3]; - - MonitorElement* h_ecalSum_[3]; - MonitorElement* h2_ecalSumVsEt_[3]; - MonitorElement* p_ecalSumVsEt_[3]; - MonitorElement* h2_ecalSumVsEta_[3]; - MonitorElement* p_ecalSumVsEta_[3]; - - MonitorElement* h_hcalSum_[3]; - MonitorElement* h2_hcalSumVsEt_[3]; - MonitorElement* p_hcalSumVsEt_[3]; - MonitorElement* h2_hcalSumVsEta_[3]; - MonitorElement* p_hcalSumVsEta_[3]; - - MonitorElement* h_hOverE_[3]; - MonitorElement* p_hOverEVsEt_[3]; - MonitorElement* p_hOverEVsEta_[3]; - MonitorElement* h_h1OverE_[3]; - MonitorElement* h_h2OverE_[3]; - - MonitorElement* h_newhOverE_[3]; - MonitorElement* p_newhOverEVsEta_[3]; - MonitorElement* p_newhOverEVsEt_[3]; - // Information from Particle Flow - // Isolation - MonitorElement* h_chHadIso_[3]; - MonitorElement* h_nHadIso_[3]; - MonitorElement* h_phoIso_[3]; - // Identification - MonitorElement* h_nCluOutsideMustache_[3]; - MonitorElement* h_etOutsideMustache_[3]; - MonitorElement* h_pfMva_[3]; - //// particle based isolation from ValueMap - MonitorElement* h_dRPhoPFcand_ChHad_Cleaned_[3]; - MonitorElement* h_dRPhoPFcand_NeuHad_Cleaned_[3]; - MonitorElement* h_dRPhoPFcand_Pho_Cleaned_[3]; - MonitorElement* h_dRPhoPFcand_ChHad_unCleaned_[3]; - MonitorElement* h_dRPhoPFcand_NeuHad_unCleaned_[3]; - MonitorElement* h_dRPhoPFcand_Pho_unCleaned_[3]; - MonitorElement* h_SumPtOverPhoPt_ChHad_Cleaned_[3]; - MonitorElement* h_SumPtOverPhoPt_NeuHad_Cleaned_[3]; - MonitorElement* h_SumPtOverPhoPt_Pho_Cleaned_[3]; - MonitorElement* h_SumPtOverPhoPt_ChHad_unCleaned_[3]; - MonitorElement* h_SumPtOverPhoPt_NeuHad_unCleaned_[3]; - MonitorElement* h_SumPtOverPhoPt_Pho_unCleaned_[3]; -}; - -#endif diff --git a/DQMOffline/L1Trigger/src/L1TTauOffline.cc b/DQMOffline/L1Trigger/src/L1TTauOffline.cc index 62838b5956894..5faf7ef570bf1 100644 --- a/DQMOffline/L1Trigger/src/L1TTauOffline.cc +++ b/DQMOffline/L1Trigger/src/L1TTauOffline.cc @@ -704,6 +704,19 @@ void L1TTauOffline::getProbeTaus(const edm::Event& iEvent, TLorentzVector mytau; mytau.SetPtEtaPhiE(tauIt->pt(), tauIt->eta(), tauIt->phi(), tauIt->energy()); + if ((*antimu)[tauCandidate].workingPoints.empty()) { + edm::LogWarning("L1TTauOffline") << "This offline tau has no antimu discriminator, skipping" << std::endl; + continue; + } + if ((*antiele)[tauCandidate].workingPoints.empty()) { + edm::LogWarning("L1TTauOffline") << "This offline tau has no antiele discriminator, skipping" << std::endl; + continue; + } + if ((*comb3T)[tauCandidate].workingPoints.empty()) { + edm::LogWarning("L1TTauOffline") << "This offline tau has no comb3T discriminator, skipping" << std::endl; + continue; + } + if (fabs(tauIt->charge()) == 1 && fabs(tauIt->eta()) < 2.1 && tauIt->pt() > 20 && (*antimu)[tauCandidate].workingPoints[AntiMuWPIndex_] && (*antiele)[tauCandidate].workingPoints[AntiEleWPIndex_] && (*dmf)[tauCandidate] > 0.5 && diff --git a/DQMOffline/Muon/interface/CSCOfflineMonitor.h b/DQMOffline/Muon/interface/CSCOfflineMonitor.h index 2a9ce2cd65e4c..72ae6ac6114b6 100644 --- a/DQMOffline/Muon/interface/CSCOfflineMonitor.h +++ b/DQMOffline/Muon/interface/CSCOfflineMonitor.h @@ -156,16 +156,19 @@ class CSCOfflineMonitor : public DQMEDAnalyzer { // Wire digis MonitorElement *hWirenGroupsTotal; + MonitorElement *hWirenGroupsTotalHi; std::vector hWireTBin; std::vector hWireNumber; // Strip Digis MonitorElement *hStripNFired; + MonitorElement *hStripNFiredHi; std::vector hStripNumber; std::vector hStripPed; // Rechits MonitorElement *hRHnrechits; + MonitorElement *hRHnrechitsHi; std::vector hRHGlobal; std::vector hRHSumQ; std::vector hRHTiming; diff --git a/DQMOffline/Muon/src/CSCOfflineMonitor.cc b/DQMOffline/Muon/src/CSCOfflineMonitor.cc index 46aefbec512c5..b37c0cf1d52e4 100644 --- a/DQMOffline/Muon/src/CSCOfflineMonitor.cc +++ b/DQMOffline/Muon/src/CSCOfflineMonitor.cc @@ -56,8 +56,13 @@ void CSCOfflineMonitor::bookHistograms(DQMStore::IBooker& ibooker, // wire digis ibooker.setCurrentFolder("CSC/CSCOfflineMonitor/Digis"); + // For low multiplicities (e.g. low or no pileup) hWirenGroupsTotal = - ibooker.book1D("hWirenGroupsTotal", "Fired Wires per Event; # Wiregroups Fired", 500, -0.5, 499.5); + ibooker.book1D("hWirenGroupsTotal", "Fired Wires per Event; # Wiregroups Fired", 250, 0., 250.); // 1 bin is 1 + // For high multiplcities (e.g. with pileup) + hWirenGroupsTotalHi = + ibooker.book1D("hWirenGroupsTotalHi", "Fired Wires per Event; # Wiregroups Fired", 250, 0., 1000.); // i bin is 4 + hWireTBin.push_back(ibooker.book1D("hWireTBin_m42", "Wire TBin Fired (ME -4/2); Time Bin (25ns)", 17, -0.5, 16.5)); hWireTBin.push_back(ibooker.book1D("hWireTBin_m41", "Wire TBin Fired (ME -4/1); Time Bin (25ns)", 17, -0.5, 16.5)); hWireTBin.push_back(ibooker.book1D("hWireTBin_m32", "Wire TBin Fired (ME -3/2); Time Bin (25ns)", 17, -0.5, 16.5)); @@ -120,8 +125,14 @@ void CSCOfflineMonitor::bookHistograms(DQMStore::IBooker& ibooker, ibooker.book1D("hWireNumber_p42", "Wiregroup Number Fired (ME +4/2); Wiregroup #", 113, -0.5, 112.5)); // strip digis - hStripNFired = - ibooker.book1D("hStripNFired", "Fired Strips per Event; # Strips Fired (above 13 ADC)", 1000, -0.5, 999.5); + + // For low multiplicities (e.g. low or no pileup) + hStripNFired = ibooker.book1D( + "hStripNFired", "Fired Strips per Event; # Strips Fired (above 13 ADC)", 400, 0., 400.); // 1 bin is 1 + // For high multiplcities (e.g. with pileup) + hStripNFiredHi = ibooker.book1D( + "hStripNFiredHi", "Fired Strips per Event; # Strips Fired (above 13 ADC)", 500, 0., 2000.); // 1 bin is 4 + hStripNumber.push_back( ibooker.book1D("hStripNumber_m42", "Strip Number Fired (ME -4/2); Strip # Fired (above 13 ADC)", 81, -0.5, 80.5)); hStripNumber.push_back( @@ -210,7 +221,11 @@ void CSCOfflineMonitor::bookHistograms(DQMStore::IBooker& ibooker, // rechits ibooker.setCurrentFolder("CSC/CSCOfflineMonitor/recHits"); - hRHnrechits = ibooker.book1D("hRHnrechits", "recHits per Event (all chambers); # of RecHits", 500, -0.50, 499.5); + // For low multiplicities (e.g. low or no pileup) + hRHnrechits = ibooker.book1D("hRHnrechits", "RecHits per Event; # of RecHits", 100, 0., 100.); // 1 bin is 1 + // For high multiplcities (e.g. with pileup) + hRHnrechitsHi = ibooker.book1D("hRHnrechitsHi", "RecHits per Event; # of RecHits", 250, 0., 1000.); // 1 bin is 4 + hRHGlobal.push_back(ibooker.book2D( "hRHGlobalp1", "recHit global X,Y station +1; Global X (cm); Global Y (cm)", 100, -800., 800., 100, -800., 800.)); hRHGlobal.push_back(ibooker.book2D( @@ -395,7 +410,8 @@ void CSCOfflineMonitor::bookHistograms(DQMStore::IBooker& ibooker, // segments ibooker.setCurrentFolder("CSC/CSCOfflineMonitor/Segments"); - hSnSegments = ibooker.book1D("hSnSegments", "Number of Segments per Event; # of Segments", 26, -0.5, 25.5); + hSnSegments = ibooker.book1D("hSnSegments", "Segments per Event; # of Segments", 100, 0., 100.); // 1 bin is 1 + hSnhitsAll = ibooker.book1D("hSnhits", "N hits on Segments; # of hits", 8, -0.5, 7.5); hSnhits.push_back(ibooker.book1D("hSnhitsm42", "# of hits on Segments (ME -4/2); # of hits", 8, -0.5, 7.5)); hSnhits.push_back(ibooker.book1D("hSnhitsm41", "# of hits on Segments (ME -4/1); # of hits", 8, -0.5, 7.5)); @@ -1028,10 +1044,8 @@ void CSCOfflineMonitor::doWireDigis(edm::Handle wires) { } } // end wire loop - // this way you can zero suppress but still store info on # events with no digis - // Tim: I'm unhappy with that since it breaks hist statistics - // if (nWireGroupsTotal == 0) nWireGroupsTotal = -1; hWirenGroupsTotal->Fill(nWireGroupsTotal); + hWirenGroupsTotalHi->Fill(nWireGroupsTotal); } // ============================================== @@ -1066,11 +1080,9 @@ void CSCOfflineMonitor::doStripDigis(edm::Handle strips) } } // end strip loop - // this way you can zero suppress but still store info on # events with no digis - // Tim: I guess the above comment means 'zero suppress' because the hist range is from -0.5. - // But doing this means the hist statistics are broken. If the zero bin is high, just apply log scale? - // if (nStripsFired == 0) nStripsFired = -1; hStripNFired->Fill(nStripsFired); + hStripNFiredHi->Fill(nStripsFired); + // fill n per event } @@ -1191,6 +1203,7 @@ void CSCOfflineMonitor::doRecHits(edm::Handle recHits, // if (nRecHits == 0) nRecHits = -1; // I see no point in doing this hRHnrechits->Fill(nRecHits); + hRHnrechitsHi->Fill(nRecHits); } // ============================================== @@ -1313,7 +1326,6 @@ void CSCOfflineMonitor::doSegments(edm::Handle cscSegments } // end segment loop - // if (nSegments == 0) nSegments = -1; // I see no point in doing this hSnSegments->Fill(nSegments); } @@ -1607,11 +1619,16 @@ void CSCOfflineMonitor::doEfficiencies(edm::Handle wires, NumberOfLayers++; } } - int bin = 0; - if (iS == 0) - bin = iR + 1 + (iE * 10); - else - bin = (iS + 1) * 2 + (iR + 1) + (iE * 10); + + // set bin = 1-10 for ME-42, ME-41,...ME-11B, ME-11A, + // 11-20 for ME+11A, ME+11B, ... ME+41, ME+42 + int bin = CSCDetId::iChamberType(iS + 1, iR + 1); // 1-10 for ME11A...ME42 + if (iE > 0) { // in this loop iE=1 is -z endcap + bin = 11 - bin; + } else { // in this loop iE=0 is +z endcap + bin += 10; + } + if (NumberOfLayers > 1) { //if(!(MultiSegments[iE][iS][iR][iC])){ if (AllSegments[iE][iS][iR][iC]) { @@ -1648,21 +1665,6 @@ void CSCOfflineMonitor::doEfficiencies(edm::Handle wires, if (1 == seg_ME3[1]) theSeg.push_back(&theSegments[3]); - // Needed for plots - // at the end the chamber types will be numbered as 1 to 20 - // (ME-4./2, ME-4/1, -ME3/2, -ME3/1, ..., +ME3/1, +ME3/2, ME+4/1, ME+4/2) - std::map chamberTypes; - chamberTypes["ME1/a"] = 0.5; - chamberTypes["ME1/b"] = 1.5; - chamberTypes["ME1/2"] = 2.5; - chamberTypes["ME1/3"] = 3.5; - chamberTypes["ME2/1"] = 4.5; - chamberTypes["ME2/2"] = 5.5; - chamberTypes["ME3/1"] = 6.5; - chamberTypes["ME3/2"] = 7.5; - chamberTypes["ME4/1"] = 8.5; - chamberTypes["ME4/2"] = 9.5; - if (!theSeg.empty()) { std::map extrapolatedPoint; std::map::iterator it; @@ -1728,18 +1730,15 @@ void CSCOfflineMonitor::doEfficiencies(edm::Handle wires, ++nRHLayers; } } - //std::cout<<" nRHLayers = "<specs()->chamberTypeName()]; - if (cscchamberCenter.z() < 0) { - verticalScale = -verticalScale; - } - verticalScale += 10.5; + + // set verticalScale to 1-10 for ME-42...ME-11A, + // 11-20 for ME+11A...ME+42 + float verticalScale = + 9. + cscchamber->id().endcap() + (cscchamber->specs()->chamberType()) * (cscchamber->id().zendcap()); + hSensitiveAreaEvt->Fill(float(cscchamber->id().chamber()), verticalScale); if (nRHLayers > 1) { // this chamber contains a reliable signal - //chamberTypes[cscchamber->specs()->chamberTypeName()]; - // "intrinsic" efficiencies - //std::cout<<" verticalScale = "<setBinLabel(VBIN_CASTOR, "CASTOR", 2); reportSummaryMap_->setBinLabel(VBIN_ZDC, "ZDC", 2); + reportSummaryMap_->setBinLabel(VBIN_GEM_P, "GEMp", 2); + reportSummaryMap_->setBinLabel(VBIN_GEM_M, "GEMm", 2); reportSummaryMap_->setBinLabel(VBIN_PHYSICS_DECLARED, "PhysDecl", 2); reportSummaryMap_->setBinLabel(VBIN_MOMENTUM, "13 TeV", 2); reportSummaryMap_->setBinLabel(VBIN_STABLE_BEAM, "Stable B", 2); @@ -361,6 +363,8 @@ void DQMProvInfo::fillDcsBitsFromDCSRecord(const DCSRecord& dcsRecord, bool* dcs dcsBits[VBIN_TE_M] = dcsRecord.highVoltageReady(DCSRecord::Partition::TECm); dcsBits[VBIN_CASTOR] = dcsRecord.highVoltageReady(DCSRecord::Partition::CASTOR); dcsBits[VBIN_ZDC] = dcsRecord.highVoltageReady(DCSRecord::Partition::ZDC); + dcsBits[VBIN_GEM_P] = dcsRecord.highVoltageReady(DCSRecord::Partition::GEMp); + dcsBits[VBIN_GEM_M] = dcsRecord.highVoltageReady(DCSRecord::Partition::GEMm); } void DQMProvInfo::fillDcsBitsFromDcsStatusCollection(const edm::Handle& dcsStatusCollection, @@ -402,6 +406,8 @@ void DQMProvInfo::fillDcsBitsFromDcsStatusCollection(const edm::Handle { const static int VBIN_TE_M = 23; const static int VBIN_CASTOR = 24; const static int VBIN_ZDC = 25; + const static int VBIN_GEM_P = 26; + const static int VBIN_GEM_M = 27; // Highest DCS bin, used for the length of the corresponding array. // We will have the indexes to this array the same as the vbins numbers. // (I.e. value at index 0 will not be used.) - const static int MAX_DCS_VBINS = 25; + const static int MAX_DCS_VBINS = 27; - const static int VBIN_PHYSICS_DECLARED = 26; - const static int VBIN_MOMENTUM = 27; - const static int VBIN_STABLE_BEAM = 28; - const static int VBIN_VALID = 29; + const static int VBIN_PHYSICS_DECLARED = 28; + const static int VBIN_MOMENTUM = 29; + const static int VBIN_STABLE_BEAM = 30; + const static int VBIN_VALID = 31; - const static int MAX_VBINS = 29; + const static int MAX_VBINS = 31; // Beam momentum at flat top, used to determine if collisions are // occurring with the beams at the energy allowed for physics production. diff --git a/DQMServices/Core/interface/LegacyIOHelper.h b/DQMServices/Core/interface/LegacyIOHelper.h index 0a08fc05d2739..9e1ae4b506df4 100644 --- a/DQMServices/Core/interface/LegacyIOHelper.h +++ b/DQMServices/Core/interface/LegacyIOHelper.h @@ -2,6 +2,7 @@ #define DQMSERVICES_CORE_LEGACYIOHELPER_H #include "DQMServices/Core/interface/DQMStore.h" +#include "TROOT.h" // This class encapsulates the TDirectory based file format used for DQMGUI // uploads and many other use cases. @@ -16,8 +17,14 @@ class LegacyIOHelper { // use internal type here since we call this from the DQMStore itself. typedef dqm::implementation::DQMStore DQMStore; typedef dqm::legacy::MonitorElement MonitorElement; - LegacyIOHelper(DQMStore* dqmstore) : dbe_(dqmstore){}; + typedef dqm::harvesting::DQMStore HarvestedDQMStore; + typedef dqm::harvesting::MonitorElement HarvestedMonitorElement; + + using MEMap = std::set; + + LegacyIOHelper(DQMStore* dqmstore) : dbe_(dqmstore){}; + LegacyIOHelper(HarvestedDQMStore* hdqmstore) : dbe_(hdqmstore){}; // Replace or append to `filename`, a TDirectory ROOT file. If a run number // is passed, the paths are rewritten to the "Run Summary" format used by // DQMGUI. The run number does not affect which MEs are saved; this code only @@ -32,9 +39,30 @@ class LegacyIOHelper { bool saveall = true, std::string const& fileupdate = "RECREATE"); + bool open(std::string const& filename, std::string const& path = "", uint32_t const run = 0); + private: + template + void getMEName(T* h, const std::string& toppath, std::string& meName) { + std::ostringstream fullpath; + fullpath << gDirectory->GetPath() << "/" << h->GetName(); + std::string dirpath = fullpath.str(); + // Search for the substring in string + size_t pos = dirpath.find(toppath); + if (pos != std::string::npos) { + dirpath.erase(pos, toppath.length()); + } + std::string rsummary = "/Run summary"; + pos = dirpath.find(rsummary); + if (pos != std::string::npos) { + dirpath.erase(pos, rsummary.length()); + } + meName = dirpath; + } + bool readdir(TDirectory* dir, const std::string& toppath); bool createDirectoryIfNeededAndCd(const std::string& path); DQMStore* dbe_; + MEMap data_; }; #endif diff --git a/DQMServices/Core/interface/MonitorElement.h b/DQMServices/Core/interface/MonitorElement.h index f39f88d97fab0..4b0cd2e890650 100644 --- a/DQMServices/Core/interface/MonitorElement.h +++ b/DQMServices/Core/interface/MonitorElement.h @@ -119,7 +119,7 @@ namespace dqm::impl { return std::make_tuple(std::reference_wrapper(me->getPathname()), std::reference_wrapper(me->getName())); } auto make_tuple(MonitorElementData::Path const &path) const { - return std::make_tuple(path.getDirname(), path.getObjectname()); + return std::make_tuple(std::reference_wrapper(path.getDirname()), std::reference_wrapper(path.getObjectname())); } bool operator()(MonitorElement *left, MonitorElement *right) const { return make_tuple(left) < make_tuple(right); diff --git a/DQMServices/Core/src/LegacyIOHelper.cc b/DQMServices/Core/src/LegacyIOHelper.cc index 3e5e6831bc884..83abc3017a3a6 100644 --- a/DQMServices/Core/src/LegacyIOHelper.cc +++ b/DQMServices/Core/src/LegacyIOHelper.cc @@ -1,4 +1,5 @@ #include "DQMServices/Core/interface/LegacyIOHelper.h" +#include "FWCore/MessageLogger/interface/MessageLogger.h" #include #include @@ -8,6 +9,7 @@ #include "TString.h" #include "TSystem.h" #include "TFile.h" +#include "TKey.h" #include void LegacyIOHelper::save(std::string const &filename, @@ -164,3 +166,103 @@ bool LegacyIOHelper::createDirectoryIfNeededAndCd(const std::string &path) { return true; } + +bool LegacyIOHelper::readdir(TDirectory *dir, const std::string &toppath) { + TDirectory *dirsav = gDirectory; + LogDebug("LegacyIOHelper") << "Inside:" << gDirectory->GetPath() << std::endl; + TIter next(dir->GetListOfKeys()); + TKey *key; + while ((key = (TKey *)next())) { + if (key->IsFolder()) { + LogDebug("LegacyIOHelper") << key->GetName() << std::endl; + dir->cd(key->GetName()); + TDirectory *subdir = gDirectory; + readdir(subdir, toppath); + dirsav->cd(); + continue; + } else { + TClass *cl = gROOT->GetClass(key->GetClassName()); + std::string meName; + if (cl->InheritsFrom("TProfile")) { + TProfile *h = dynamic_cast(key->ReadObject()->Clone()); + h->SetDirectory(nullptr); + if (h) { + getMEName(h, toppath, meName); + data_.insert(dbe_->bookProfile(meName, h)); + } + } else if (cl->InheritsFrom("TProfile2D")) { + TProfile2D *h = dynamic_cast(key->ReadObject()->Clone()); + h->SetDirectory(nullptr); + if (h) { + getMEName(h, toppath, meName); + data_.insert(dbe_->bookProfile2D(meName, h)); + } + } else if (cl->InheritsFrom("TH1F")) { + TH1F *h = dynamic_cast(key->ReadObject()->Clone()); + h->SetDirectory(nullptr); + if (h) { + getMEName(h, toppath, meName); + data_.insert(dbe_->book1D(meName, h)); + } + } else if (cl->InheritsFrom("TH1S")) { + TH1S *h = dynamic_cast(key->ReadObject()->Clone()); + h->SetDirectory(nullptr); + if (h) { + getMEName(h, toppath, meName); + data_.insert(dbe_->book1S(meName, h)); + } + } else if (cl->InheritsFrom("TH1D")) { + TH1D *h = dynamic_cast(key->ReadObject()->Clone()); + h->SetDirectory(nullptr); + if (h) { + getMEName(h, toppath, meName); + data_.insert(dbe_->book1DD(meName, h)); + } + } else if (cl->InheritsFrom("TH2F")) { + TH2F *h = dynamic_cast(key->ReadObject()->Clone()); + h->SetDirectory(nullptr); + if (h) { + getMEName(h, toppath, meName); + data_.insert(dbe_->book2D(meName, h)); + } + } else if (cl->InheritsFrom("TH2S")) { + TH2S *h = dynamic_cast(key->ReadObject()->Clone()); + h->SetDirectory(nullptr); + if (h) { + getMEName(h, toppath, meName); + data_.insert(dbe_->book2S(meName, h)); + } + } else if (cl->InheritsFrom("TH2D")) { + TH2D *h = dynamic_cast(key->ReadObject()->Clone()); + h->SetDirectory(nullptr); + if (h) { + getMEName(h, toppath, meName); + data_.insert(dbe_->book2DD(meName, h)); + } + } else if (cl->InheritsFrom("TH3F")) { + TH3F *h = dynamic_cast(key->ReadObject()->Clone()); + h->SetDirectory(nullptr); + if (h) { + getMEName(h, toppath, meName); + data_.insert(dbe_->book3D(meName, h)); + } + } + } + } + if (!data_.empty()) + return true; + return false; +} + +bool LegacyIOHelper::open(std::string const &filename, std::string const &path, uint32_t const run) { + TFile *f1 = TFile::Open(filename.c_str()); + if (!f1) + return false; + std::ostringstream toppath; + toppath << filename << ":/DQMData/Run " << run << "/"; + std::string dirpath = toppath.str(); + edm::LogPrint("LegacyIOHelper") << dirpath << std::endl; + bool flag = readdir(f1, dirpath); + f1->Close(); + return flag; +} diff --git a/DataFormats/BTauReco/interface/PFCombinedTauTagInfo.h b/DataFormats/BTauReco/interface/PFCombinedTauTagInfo.h deleted file mode 100644 index aa7354fb2659e..0000000000000 --- a/DataFormats/BTauReco/interface/PFCombinedTauTagInfo.h +++ /dev/null @@ -1,192 +0,0 @@ -#ifndef DataFormats_BTauReco_PFCombinedTauTagInfo_h -#define DataFormats_BTauReco_PFCombinedTauTagInfo_h - -/* class PFCombinedTauTagInfo - * Extended object for the Particle Flow Tau Combination algorithm, - * created: Apr 21 2007, - * revised: Jun 23 2007, - * author: Ludovic Houchu. - */ - -#include -#include - -#include "DataFormats/BTauReco/interface/RefMacros.h" -#include "DataFormats/JetReco/interface/PFJetCollection.h" -#include "DataFormats/ParticleFlowCandidate/interface/PFCandidateFwd.h" -#include "DataFormats/BTauReco/interface/BaseTagInfo.h" -#include "DataFormats/BTauReco/interface/PFIsolatedTauTagInfo.h" - - - - -namespace reco { - class PFCombinedTauTagInfo : public BaseTagInfo{ - public: - PFCombinedTauTagInfo() { - candidate_selectedByPFChargedHadrCands_=false; - electronTagged_=false; - muonTagged_=false; - PFChargedHadrCands_.clear(); - selectedPFChargedHadrCands_.clear(); - signalPFChargedHadrCands_.clear(); - isolPFChargedHadrCands_.clear(); - leadPFChargedHadrCandsignedSipt_=NAN; - leadPFChargedHadrCandsignedSip3D_=NAN; - signedSflightpath_=NAN; - PFChargedHadrCandsEtJetEtRatio_=NAN; - PFNeutrHadrCandsE_=NAN; - PFNeutrHadrCandsN_=std::numeric_limits::quiet_NaN(); - PFNeutrHadrCandsRadius_=NAN; - PFGammaCandsE_=NAN; - isolPFGammaCandsE_=NAN; - PFGammaCandsN_=std::numeric_limits::quiet_NaN(); - PFGammaCandsRadius_=NAN; - PFGammaCandsEJetalternatERatio_=NAN; - isolPFGammaCandsEJetalternatERatio_=NAN; - PFGammaCandsERatio_=NAN; - alternatLorentzVect_.SetPx(NAN); - alternatLorentzVect_.SetPy(NAN); - alternatLorentzVect_.SetPz(NAN); - alternatLorentzVect_.SetE(NAN); - ECALEtleadPFChargedHadrCandPtRatio_=NAN; - HCALEtleadPFChargedHadrCandPtRatio_=NAN; - } - virtual ~PFCombinedTauTagInfo() {}; - - //the reference to the PFJet; - const PFJetRef& pfjetRef()const{return PFJetRef_;} - void setpfjetRef(const PFJetRef x){PFJetRef_=x;} - - //the reference to the PFIsolatedTauTagInfo; - const PFIsolatedTauTagInfoRef& isolatedtautaginfoRef()const{return PFIsolatedTauTagInfoRef_;} - void setisolatedtautaginfoRef(const PFIsolatedTauTagInfoRef x) {PFIsolatedTauTagInfoRef_=x;} - - //the PF charged hadron candidates contained in the PF Jet; - const PFCandidateRefVector& PFChargedHadrCands()const{return PFChargedHadrCands_;} - void setPFChargedHadrCands(const PFCandidateRefVector& x) {PFChargedHadrCands_=x;} - - //the PF charged hadron candidates considered in the isolation strip and signal cone selections; - const PFCandidateRefVector& selectedPFChargedHadrCands()const{return selectedPFChargedHadrCands_;} - void setselectedPFChargedHadrCands(const PFCandidateRefVector& x) {selectedPFChargedHadrCands_=x;} - - //the PF charged hadron candidates inside signal cone; - const PFCandidateRefVector& signalPFChargedHadrCands()const{return signalPFChargedHadrCands_;} - void setsignalPFChargedHadrCands(const PFCandidateRefVector& x) {signalPFChargedHadrCands_=x;} - - //the PF charged hadron candidates inside isolation band; - const PFCandidateRefVector& isolPFChargedHadrCands()const{return isolPFChargedHadrCands_;} - void setisolPFChargedHadrCands(const PFCandidateRefVector& x) {isolPFChargedHadrCands_=x;} - - virtual PFCombinedTauTagInfo* clone() const{return new PFCombinedTauTagInfo(*this );} - - // float JetTag::discriminator() returns 0. if candidate did not pass PF charged hadron candidates selection, - // 1. if candidate passed PF charged hadron candidates selection and did not contain PF gamma candidate(s), - // 0<= <=1 if candidate passed PF charged hadron candidates selection, contained PF gamma candidate(s) and went through the likelihood ratio mechanism, - // NaN the values of the likelihood functions PDFs are 0 (test the result of discriminator() with bool isnan(.)); - //computed with the parameters taken from the RecoTauTag/PFCombinedTauTag/data/ .cfi files - - bool selectedByPFChargedHadrCands()const{return(candidate_selectedByPFChargedHadrCands_);} - void setselectedByPFChargedHadrCands(bool x){candidate_selectedByPFChargedHadrCands_=x;} - - bool electronTagged()const{return(electronTagged_);} // true : passed PF charged hadron candidates sel., contains 1 signal charged hadron candidate, e-identified through (ECALEtleadPFChargedHadrCandPtRatio(),HCALEtleadPFChargedHadrCandPtRatio()) space; - void setelectronTagged(bool x){electronTagged_=x;} - - bool muonTagged()const{return(muonTagged_);} // true : passed PF charged hadron candidates sel., contains 1 signal charged hadron candidate, mu-identified through (ECALEtleadPFChargedHadrCandPtRatio(),HCALEtleadPFChargedHadrCandPtRatio()) space; - void setmuonTagged(bool x){muonTagged_=x;} - - double leadPFChargedHadrCandsignedSipt()const{return (leadPFChargedHadrCandsignedSipt_);} // NaN : failure; - void setleadPFChargedHadrCandsignedSipt(double x){leadPFChargedHadrCandsignedSipt_=x;} - - double leadPFChargedHadrCandsignedSip3D()const{return(leadPFChargedHadrCandsignedSip3D_);} // NaN : failure; - void setleadPFChargedHadrCandsignedSip3D(double x){leadPFChargedHadrCandsignedSip3D_=x;} - - double signedSflightpath()const{return (signedSflightpath_);} // NaN : failure, did not build a SV.; - void setsignedSflightpath(double x){signedSflightpath_=x;} - - // Et_PFchargedhadrcands/Etjet; - double PFChargedHadrCandsEtJetEtRatio()const{return(PFChargedHadrCandsEtJetEtRatio_);} - void setPFChargedHadrCandsEtJetEtRatio(double x){PFChargedHadrCandsEtJetEtRatio_=x;} - - // PF neutral hadron candidates E sum; - double PFNeutrHadrCandsE()const{return(PFNeutrHadrCandsE_);} - void setPFNeutrHadrCandsE(double x){PFNeutrHadrCandsE_=x;} - - int PFNeutrHadrCandsN()const{return(PFNeutrHadrCandsN_);} - void setPFNeutrHadrCandsN(int x){PFNeutrHadrCandsN_=x;} - - //mean DR_PFNeutrHadrcands-lead.PFcand.; - double PFNeutrHadrCandsRadius()const{return(PFNeutrHadrCandsRadius_);} // NaN : PFNeutrHadrCandsN()=0; - void setPFNeutrHadrCandsRadius(double x){PFNeutrHadrCandsRadius_=x;} - - // PF gamma candidates E sum; - double PFGammaCandsE()const{return(PFGammaCandsE_);} - void setPFGammaCandsE(double x){PFGammaCandsE_=x;} - - // isol. band PF gamma candidates E sum; - double isolPFGammaCandsE()const{return(isolPFGammaCandsE_);} - void setisolPFGammaCandsE(double x){isolPFGammaCandsE_=x;} - - int PFGammaCandsN()const{return(PFGammaCandsN_);} - void setPFGammaCandsN(int x){PFGammaCandsN_=x;} - - //mean DR_PFgammacands-lead.PFcand.; - double PFGammaCandsRadius()const{return(PFGammaCandsRadius_);} // NaN : PFGammaCandsN()=0; - void setPFGammaCandsRadius(double x){PFGammaCandsRadius_=x;} - - // E_PFgammacands / (E_PFgammacands + E_PFchargedhadrcands); - double PFGammaCandsEJetalternatERatio()const{return(PFGammaCandsEJetalternatERatio_);} - void setPFGammaCandsEJetalternatERatio(double x){PFGammaCandsEJetalternatERatio_=x;} - - // E_PFgammacands,isol.band / (E_PFgammacands + E_PFchargedhadrcands); - double isolPFGammaCandsEJetalternatERatio()const{return(isolPFGammaCandsEJetalternatERatio_);} - void setisolPFGammaCandsEJetalternatERatio(double x){isolPFGammaCandsEJetalternatERatio_=x;} - - // E_PFgammacands,isol.band / E_PFgammacands; - double PFGammaCandsERatio()const{return(PFGammaCandsERatio_);} // NaN : PFGammaCandsN()=0; - void setPFGammaCandsERatio(double x){PFGammaCandsERatio_=x;} - - math::XYZTLorentzVector alternatLorentzVect()const{return(alternatLorentzVect_);} // rec. charged hadr. candidates + rec. gamma candidates combined; - void setalternatLorentzVect(math::XYZTLorentzVector x){alternatLorentzVect_=x;} - - // EtECAL*/Pt_lead.PFcand. *using ECAL cell hits inside a DR cone around lead. charged hadr. candidate ECAL impact point direction; - double ECALEtleadPFChargedHadrCandPtRatio()const{return(ECALEtleadPFChargedHadrCandPtRatio_);} // NaN : failure when trying to find the lead. charged hadr. candidate contact on ECAL surface point; - void setECALEtleadPFChargedHadrCandPtRatio(double x){ECALEtleadPFChargedHadrCandPtRatio_=x;} - - // EtHCAL**/Pt_lead.PFcand.; **using HCAL tower hits inside a DR cone around lead. charged hadr. candidate ECAL impact point direction; - double HCALEtleadPFChargedHadrCandPtRatio()const{return(HCALEtleadPFChargedHadrCandPtRatio_);} // NaN : failure when trying to find the lead. charged hadr. candidate contact on ECAL surface point; - void setHCALEtleadPFChargedHadrCandPtRatio(double x){HCALEtleadPFChargedHadrCandPtRatio_=x;} - private: - PFJetRef PFJetRef_; - PFIsolatedTauTagInfoRef PFIsolatedTauTagInfoRef_; - PFCandidateRefVector PFChargedHadrCands_; - PFCandidateRefVector selectedPFChargedHadrCands_; - PFCandidateRefVector signalPFChargedHadrCands_; - PFCandidateRefVector isolPFChargedHadrCands_; - bool candidate_selectedByPFChargedHadrCands_; - bool electronTagged_; - bool muonTagged_; - double leadPFChargedHadrCandsignedSipt_; - double leadPFChargedHadrCandsignedSip3D_; - double signedSflightpath_; - double PFChargedHadrCandsEtJetEtRatio_; - double PFNeutrHadrCandsE_; - int PFNeutrHadrCandsN_; - double PFNeutrHadrCandsRadius_; - double PFGammaCandsE_; - double isolPFGammaCandsE_; - int PFGammaCandsN_; - double PFGammaCandsRadius_; - double PFGammaCandsEJetalternatERatio_; - double isolPFGammaCandsEJetalternatERatio_; - double PFGammaCandsERatio_; - math::XYZTLorentzVector alternatLorentzVect_; - double ECALEtleadPFChargedHadrCandPtRatio_; - double HCALEtleadPFChargedHadrCandPtRatio_; - }; - - DECLARE_EDM_REFS( PFCombinedTauTagInfo ) - -} - -#endif // DataFormats_BTauReco_PFCombinedTauTagInfo_h diff --git a/DataFormats/BTauReco/interface/PFIsolatedTauTagInfo.h b/DataFormats/BTauReco/interface/PFIsolatedTauTagInfo.h deleted file mode 100644 index 1a279e21e2ee3..0000000000000 --- a/DataFormats/BTauReco/interface/PFIsolatedTauTagInfo.h +++ /dev/null @@ -1,147 +0,0 @@ -#ifndef DataFormats_BTauReco_PFIsolatedTauTagInfo_h -#define DataFormats_BTauReco_PFIsolatedTauTagInfo_h - -/* class PFIsolatedTauTagInfo - * Extended object for the Particle Flow Tau Isolation algorithm, - * contains the result and the methods used in the PFConeIsolation Algorithm - * created: Apr 21 2007, - * revised: Jun 23 2007, - * authors: Simone Gennai, Ludovic Houchu - */ - -#include - -#include "DataFormats/BTauReco/interface/RefMacros.h" - -#include "Math/GenVector/PxPyPzE4D.h" -#include "DataFormats/ParticleFlowCandidate/interface/PFCandidate.h" -#include "DataFormats/ParticleFlowCandidate/interface/PFCandidateFwd.h" -#include "DataFormats/JetReco/interface/PFJetCollection.h" -#include "DataFormats/BTauReco/interface/BaseTagInfo.h" - - - - - - -const int PFChargedHadrCand_codenumber=1; -const int PFNeutrHadrCand_codenumber=5; -const int PFGammaCand_codenumber=4; - -const int PFRecTrack_codenumber=1; -const int PFRecECALClus_codenumber=4; -const int PFRecHCALClus_codenumber=5; - -namespace reco{ - class PFIsolatedTauTagInfo : public BaseTagInfo{ - public: - PFIsolatedTauTagInfo() {} - PFIsolatedTauTagInfo(PFCandidateRefVector PFCands){ - initialPFCands_=PFCands; - PFCands_=PFCands; - for(PFCandidateRefVector::const_iterator iPFCand=PFCands_.begin();iPFCand!=PFCands_.end();iPFCand++){ - if ((**iPFCand).particleId()==PFChargedHadrCand_codenumber) initialPFChargedHadrCands_.push_back(*iPFCand); - if ((**iPFCand).particleId()==PFNeutrHadrCand_codenumber) initialPFNeutrHadrCands_.push_back(*iPFCand); - if ((**iPFCand).particleId()==PFGammaCand_codenumber) initialPFGammaCands_.push_back(*iPFCand); - } - PFChargedHadrCands_=initialPFChargedHadrCands_; - PFNeutrHadrCands_=initialPFNeutrHadrCands_; - PFGammaCands_=initialPFGammaCands_; - alternatLorentzVect_.SetPx(NAN); - alternatLorentzVect_.SetPy(NAN); - alternatLorentzVect_.SetPz(NAN); - alternatLorentzVect_.SetE(NAN); - passedtrackerisolation_=false; - passedECALisolation_=false; - } - virtual ~PFIsolatedTauTagInfo(){}; - virtual PFIsolatedTauTagInfo* clone()const{return new PFIsolatedTauTagInfo(*this);} - - //get the PFCandidates's which compose the PF jet and may be have been filtered by filterPFChargedHadrCands(.,.,.,.,.,.), filterPFNeutrHadrCands(.), filterPFGammaCands(.) member functions - const PFCandidateRefVector& PFCands() const {return PFCands_;} - const PFCandidateRefVector& PFChargedHadrCands() const {return PFChargedHadrCands_;} - const PFCandidateRefVector& PFNeutrHadrCands() const {return PFNeutrHadrCands_;} - const PFCandidateRefVector& PFGammaCands() const {return PFGammaCands_;} - - // rec. jet Lorentz-vector combining charged hadr. PFCandidate's and gamma PFCandidate's - math::XYZTLorentzVector alternatLorentzVect()const{return(alternatLorentzVect_);} - void setalternatLorentzVect(math::XYZTLorentzVector x){alternatLorentzVect_=x;} - - //the reference to the PFJet - const PFJetRef& pfjetRef()const{return PFJetRef_;} - void setpfjetRef(const PFJetRef x){PFJetRef_=x;} - - //JetTag::discriminator() computed with the parameters taken from the RecoTauTag/PFConeIsolation/data/pfConeIsolation.cfi file - - // true if a lead. PFCandidate exists and no charged hadron PFCandidate was found in an DR isolation ring around it (DR isolation ring limits defined in the RecoTauTag/PFConeIsolation/data/pfConeIsolation.cfi file - bool passedtrackerisolation()const{return passedtrackerisolation_;} - void setpassedtrackerisolation(bool x){passedtrackerisolation_=x;} - - // true if a lead. PFCandidate exists and no gamma PFCandidate was found in an DR isolation ring around it (DR isolation ring limits defined in the RecoTauTag/PFConeIsolation/data/pfConeIsolation.cfi file - bool passedECALisolation()const{return passedECALisolation_;} - void setpassedECALisolation(bool x){passedECALisolation_=x;} - - //methods to be used to recompute the isolation with a new set of parameters - double discriminatorByIsolPFCandsN(float matchingcone_size,float signalcone_size,float isolcone_size,bool useOnlyChargedHadrforleadPFCand,float minPt_leadPFCand,float minPt_PFCand,int IsolPFCands_maxN=0)const; - double discriminatorByIsolPFCandsN(math::XYZVector myVector,float matchingcone_size,float signalcone_size,float isolcone_size,bool useOnlyChargedHadrforleadPFCand,float minPt_leadPFCand,float minPt_PFCand,int IsolPFCands_maxN=0)const; - double discriminatorByIsolPFChargedHadrCandsN(float matchingcone_size,float signalcone_size,float isolcone_size,bool useOnlyChargedHadrforleadPFCand,float minPt_leadPFCand,float minPt_PFCand,int IsolPFCands_maxN=0)const; - double discriminatorByIsolPFChargedHadrCandsN(math::XYZVector myVector,float matchingcone_size,float signalcone_size,float isolcone_size,bool useOnlyChargedHadrforleadPFCand,float minPt_leadPFCand,float minPt_PFCand,int IsolPFCands_maxN=0)const; - double discriminatorByIsolPFNeutrHadrCandsN(float matchingcone_size,float signalcone_size,float isolcone_size,bool useOnlyChargedHadrforleadPFCand,float minPt_leadPFCand,float minPt_PFCand,int IsolPFCands_maxN=0)const; - double discriminatorByIsolPFNeutrHadrCandsN(math::XYZVector myVector,float matchingcone_size,float signalcone_size,float isolcone_size,bool useOnlyChargedHadrforleadPFCand,float minPt_leadPFCand,float minPt_PFCand,int IsolPFCands_maxN=0)const; - double discriminatorByIsolPFGammaCandsN(float matchingcone_size,float signalcone_size,float isolcone_size,bool useOnlyChargedHadrforleadPFCand,float minPt_leadPFCand,float minPt_PFCand,int IsolPFCands_maxN=0)const; - double discriminatorByIsolPFGammaCandsN(math::XYZVector myVector,float matchingcone_size,float signalcone_size,float isolcone_size,bool useOnlyChargedHadrforleadPFCand,float minPt_leadPFCand,float minPt_PFCand,int IsolPFCands_maxN=0)const; - double discriminatorByIsolPFCandsEtSum(float matchingcone_size,float signalcone_size,float isolcone_size,bool useOnlyChargedHadrforleadPFCand,float minPt_leadPFCand,float minPt_PFCand,float IsolPFCands_maxEtSum=0)const; - double discriminatorByIsolPFCandsEtSum(math::XYZVector myVector,float matchingcone_size,float signalcone_size,float isolcone_size,bool useOnlyChargedHadrforleadPFCand,float minPt_leadPFCand,float minPt_PFCand,float IsolPFCands_maxEtSum=0)const; - double discriminatorByIsolPFChargedHadrCandsEtSum(float matchingcone_size,float signalcone_size,float isolcone_size,bool useOnlyChargedHadrforleadPFCand,float minPt_leadPFCand,float minPt_PFCand,float IsolPFCands_maxEtSum=0)const; - double discriminatorByIsolPFChargedHadrCandsEtSum(math::XYZVector myVector,float matchingcone_size,float signalcone_size,float isolcone_size,bool useOnlyChargedHadrforleadPFCand,float minPt_leadPFCand,float minPt_PFCand,float IsolPFCands_maxEtSum=0)const; - double discriminatorByIsolPFNeutrHadrCandsEtSum(float matchingcone_size,float signalcone_size,float isolcone_size,bool useOnlyChargedHadrforleadPFCand,float minPt_leadPFCand,float minPt_PFCand,float IsolPFCands_maxEtSum=0)const; - double discriminatorByIsolPFNeutrHadrCandsEtSum(math::XYZVector myVector,float matchingcone_size,float signalcone_size,float isolcone_size,bool useOnlyChargedHadrforleadPFCand,float minPt_leadPFCand,float minPt_PFCand,float IsolPFCands_maxEtSum=0)const; - double discriminatorByIsolPFGammaCandsEtSum(float matchingcone_size,float signalcone_size,float isolcone_size,bool useOnlyChargedHadrforleadPFCand,float minPt_leadPFCand,float minPt_PFCand,float IsolPFCands_maxEtSum=0)const; - double discriminatorByIsolPFGammaCandsEtSum(math::XYZVector myVector,float matchingcone_size,float signalcone_size,float isolcone_size,bool useOnlyChargedHadrforleadPFCand,float minPt_leadPFCand,float minPt_PFCand,float IsolPFCands_maxEtSum=0)const; - - // return all PFCandidate's in a cone of size "conesize" around a direction "myVector" - const PFCandidateRefVector PFCandsInCone(const math::XYZVector myVector,const float conesize,const float minPt)const; - const PFCandidateRefVector PFChargedHadrCandsInCone(const math::XYZVector myVector,const float conesize,const float minPt)const; - const PFCandidateRefVector PFNeutrHadrCandsInCone(const math::XYZVector myVector,const float conesize,const float minPt)const; - const PFCandidateRefVector PFGammaCandsInCone(const math::XYZVector myVector,const float conesize,const float minPt)const; - - // return all PFCandidate's in a band defined by inner(size "innercone_size") and outer(size "outercone_size") cones around a direction "myVector" - const PFCandidateRefVector PFCandsInBand(const math::XYZVector myVector,const float innercone_size,const float outercone_size,const float minPt)const; - const PFCandidateRefVector PFChargedHadrCandsInBand(const math::XYZVector myVector,const float innercone_size,const float outercone_size,const float minPt)const; - const PFCandidateRefVector PFNeutrHadrCandsInBand(const math::XYZVector myVector,const float innercone_size,const float outercone_size,const float minPt)const; - const PFCandidateRefVector PFGammaCandsInBand(const math::XYZVector myVector,const float innercone_size,const float outercone_size,const float minPt)const; - - //return the leading PFCandidate in a given cone around the jet axis or a given direction - const PFCandidateRef leadPFCand(const float matchingcone_size, const float minPt)const; - const PFCandidateRef leadPFCand(const math::XYZVector myVector,const float matchingcone_size, const float minPt)const; - const PFCandidateRef leadPFChargedHadrCand(const float matchingcone_size, const float minPt)const; - const PFCandidateRef leadPFChargedHadrCand(const math::XYZVector myVector,const float matchingcone_size, const float minPt)const; - const PFCandidateRef leadPFNeutrHadrCand(const float matchingcone_size, const float minPt)const; - const PFCandidateRef leadPFNeutrHadrCand(const math::XYZVector myVector,const float matchingcone_size, const float minPt)const; - const PFCandidateRef leadPFGammaCand(const float matchingcone_size, const float minPt)const; - const PFCandidateRef leadPFGammaCand(const math::XYZVector myVector,const float matchingcone_size, const float minPt)const; - - void filterPFChargedHadrCands(double ChargedHadrCand_tkminPt,int ChargedHadrCand_tkminPixelHitsn,int ChargedHadrCand_tkminTrackerHitsn,double ChargedHadrCand_tkmaxipt,double ChargedHadrCand_tkmaxChi2,double ChargedHadrCand_tktorefpointDZ,bool UsePVconstraint,double PVtx_Z,bool UseOnlyChargedHadr_for_LeadCand,double LeadChargedHadrCandtoJet_MatchingConeSize,double LeadChargedHadrCand_minPt); - void filterPFNeutrHadrCands(double NeutrHadrCand_HcalclusminEt); - void filterPFGammaCands(double GammaCand_EcalclusminEt); - void removefilters(); - private: - PFJetRef PFJetRef_; - PFCandidateRefVector initialPFCands_; - PFCandidateRefVector PFCands_; - PFCandidateRefVector initialPFChargedHadrCands_; - PFCandidateRefVector PFChargedHadrCands_; - PFCandidateRefVector initialPFNeutrHadrCands_; - PFCandidateRefVector PFNeutrHadrCands_; - PFCandidateRefVector initialPFGammaCands_; - PFCandidateRefVector PFGammaCands_; - math::XYZTLorentzVector alternatLorentzVect_; - bool passedtrackerisolation_; - bool passedECALisolation_; - }; - - DECLARE_EDM_REFS( PFIsolatedTauTagInfo ) - -} - -#endif // DataFormats_BTauReco_PFIsolatedTauTagInfo_h diff --git a/DataFormats/BTauReco/interface/TemplatedSecondaryVertexTagInfo.h b/DataFormats/BTauReco/interface/TemplatedSecondaryVertexTagInfo.h index af39d241c52df..d2f25b5219a5b 100644 --- a/DataFormats/BTauReco/interface/TemplatedSecondaryVertexTagInfo.h +++ b/DataFormats/BTauReco/interface/TemplatedSecondaryVertexTagInfo.h @@ -30,15 +30,15 @@ namespace reco { } struct TrackData { - enum Status { trackSelected = 0, trackUsedForVertexFit, trackAssociatedToVertex }; - - inline bool usedForVertexFit() const { return (int)svStatus >= (int)trackUsedForVertexFit; } - inline bool associatedToVertex() const { return (int)svStatus >= (int)trackAssociatedToVertex; } + static constexpr int trackSelected = 0; + static constexpr int trackUsedForVertexFit = 1; + static constexpr int trackAssociatedToVertex = 2; + inline bool usedForVertexFit() const { return svStatus >= trackUsedForVertexFit; } + inline bool associatedToVertex() const { return svStatus >= trackAssociatedToVertex; } inline bool associatedToVertex(unsigned int index) const { - return (int)svStatus == (int)trackAssociatedToVertex + (int)index; + return svStatus == trackAssociatedToVertex + (int)index; } - - Status svStatus; + int svStatus; }; typedef std::pair IndexedTrackData; diff --git a/DataFormats/BTauReco/interface/TrackIPData.h b/DataFormats/BTauReco/interface/TrackIPData.h deleted file mode 100644 index 4ac87ce7eb346..0000000000000 --- a/DataFormats/BTauReco/interface/TrackIPData.h +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef TrackIPData_h -#define TrackIPData_h - -#include "DataFormats/Common/interface/Ref.h" -#include "DataFormats/GeometryVector/interface/GlobalVector.h" -#include "DataFormats/GeometryCommonDetAlgo/interface/Measurement1D.h" - -#include "DataFormats/JetReco/interface/JetTracksAssociation.h" - -namespace reco { - - -struct TrackIPData -{ - Measurement1D impactParameter3D; - Measurement1D impactParameter2D; - //float decayLen; - //float decayLenError; -}; - -} -#endif - diff --git a/DataFormats/BTauReco/src/classes_def.xml b/DataFormats/BTauReco/src/classes_def.xml index 69836a6d308a9..5073b468ae6ce 100644 --- a/DataFormats/BTauReco/src/classes_def.xml +++ b/DataFormats/BTauReco/src/classes_def.xml @@ -32,7 +32,8 @@ - + + diff --git a/DataFormats/CTPPSReco/interface/CTPPSPixelRecHit.h b/DataFormats/CTPPSReco/interface/CTPPSPixelRecHit.h index 6cbc0d018ded8..cc51dda981676 100644 --- a/DataFormats/CTPPSReco/interface/CTPPSPixelRecHit.h +++ b/DataFormats/CTPPSReco/interface/CTPPSPixelRecHit.h @@ -1,10 +1,10 @@ /* * -* This is a part of CTPPS offline software. -* Author: -* Fabrizio Ferro (ferro@ge.infn.it) -* -*/ + * This is a part of CTPPS offline software. + * Author: + * Fabrizio Ferro (ferro@ge.infn.it) + * + */ #ifndef DataFormats_CTPPSReco_CTPPSPixelRecHit_H #define DataFormats_CTPPSReco_CTPPSPixelRecHit_H @@ -16,10 +16,8 @@ class CTPPSPixelRecHit { public: - CTPPSPixelRecHit() {} - - CTPPSPixelRecHit(LocalPoint lp, - LocalError le, + CTPPSPixelRecHit(LocalPoint lp = LocalPoint(0., 0., 0.), + LocalError le = LocalError(0., 0., 0.), bool edge = false, bool bad = false, bool rocs = false, diff --git a/DataFormats/CaloTowers/interface/CaloTower.h b/DataFormats/CaloTowers/interface/CaloTower.h index 88975ce2cc6b5..acb100fbf77df 100644 --- a/DataFormats/CaloTowers/interface/CaloTower.h +++ b/DataFormats/CaloTowers/interface/CaloTower.h @@ -229,8 +229,8 @@ class CaloTower : public reco::LeafCandidate { GlobalPoint hadPosition_; //hcal subdetector info - HcalSubdetector subdet_; - bool inHO_, inHBHEgap_; + HcalSubdetector subdet_{HcalEmpty}; + bool inHO_{false}, inHBHEgap_{false}; // time int ecalTime_; diff --git a/DataFormats/Common/interface/NewPolicy.h b/DataFormats/Common/interface/NewPolicy.h deleted file mode 100644 index d66ae410ee192..0000000000000 --- a/DataFormats/Common/interface/NewPolicy.h +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef DataFormats_Common_NewPolicy_h -#define DataFormats_Common_NewPolicy_h - -namespace edm { - template - struct NewPolicy{ - static T * clone(const T & t) { - return new T(t); - } - }; -} - -#endif diff --git a/DataFormats/Common/interface/OwnArray.h b/DataFormats/Common/interface/OwnArray.h deleted file mode 100644 index 73976f87bf97e..0000000000000 --- a/DataFormats/Common/interface/OwnArray.h +++ /dev/null @@ -1,506 +0,0 @@ -#ifndef DataFormats_Common_OwnArray_h -#define DataFormats_Common_OwnArray_h - -#include "DataFormats/Common/interface/CMS_CLASS_VERSION.h" -#include "DataFormats/Common/interface/ClonePolicy.h" -#include "DataFormats/Common/interface/fillPtrVector.h" -#include "DataFormats/Common/interface/Ref.h" -#include "DataFormats/Common/interface/setPtr.h" -#include "DataFormats/Common/interface/traits.h" - -#if defined CMS_USE_DEBUGGING_ALLOCATOR -#include "DataFormats/Common/interface/debugging_allocator.h" -#endif -#include "FWCore/Utilities/interface/EDMException.h" - -#include -#include -#include -#include - -namespace edm { - class ProductID; - template > - class OwnArray { - private: - typedef OwnArray self; - typedef std::vector base; - public: - typedef unsigned int size_type; - typedef T value_type; - typedef T* pointer; - typedef T& reference; - typedef T const& const_reference; - typedef P policy_type; - - class iterator; - class const_iterator { - public: - typedef T value_type; - typedef T* pointer; - typedef T const& reference; - typedef ptrdiff_t difference_type; - typedef typename base::const_iterator::iterator_category iterator_category; - const_iterator(pointer const * it) : i(it) { } - const_iterator(iterator const& it) : i(it.i) { } - const_iterator() {} - const_iterator& operator++() { ++i; return *this; } - const_iterator operator++(int) { const_iterator ci = *this; ++i; return ci; } - const_iterator& operator--() { --i; return *this; } - const_iterator operator--(int) { const_iterator ci = *this; --i; return ci; } - difference_type operator-(const_iterator const& o) const { return i - o.i; } - const_iterator operator+(difference_type n) const { return const_iterator(i + n); } - const_iterator operator-(difference_type n) const { return const_iterator(i - n); } - bool operator<(const_iterator const& o) const { return i < o.i; } - bool operator==(const_iterator const& ci) const { return i == ci.i; } - bool operator!=(const_iterator const& ci) const { return i != ci.i; } - T const& operator *() const { return **i; } - // operator T const*() const { return & **i; } - T const* operator->() const { return & (operator*()); } - const_iterator & operator +=(difference_type d) { i += d; return *this; } - const_iterator & operator -=(difference_type d) { i -= d; return *this; } - reference operator[](difference_type d) const { return *const_iterator(i+d); } // for boost::iterator_range [] - private: - pointer const * i; - }; - class iterator { - public: - typedef T value_type; - typedef T * pointer; - typedef T & reference; - typedef ptrdiff_t difference_type; - typedef typename base::iterator::iterator_category iterator_category; - iterator(pointer * it) : i(it) { } - iterator() {} - iterator& operator++() { ++i; return *this; } - iterator operator++(int) { iterator ci = *this; ++i; return ci; } - iterator& operator--() { --i; return *this; } - iterator operator--(int) { iterator ci = *this; --i; return ci; } - difference_type operator-(iterator const& o) const { return i - o.i; } - iterator operator+(difference_type n) const { return iterator(i + n); } - iterator operator-(difference_type n) const { return iterator(i - n); } - bool operator<(iterator const& o) const { return i < o.i; } - bool operator==(iterator const& ci) const { return i == ci.i; } - bool operator!=(iterator const& ci) const { return i != ci.i; } - T & operator *() const { return **i; } - // operator T *() const { return & **i; } - //T *& get() { return *i; } - T * operator->() const { return & (operator*()); } - iterator & operator +=(difference_type d) { i += d; return *this; } - iterator & operator -=(difference_type d) { i -= d; return *this; } - reference operator[](difference_type d) const { return *iterator(i+d); } // for boost::iterator_range [] - private: - pointer * i; - friend class const_iterator; - friend class OwnArray; - }; - - - OwnArray(); - OwnArray(size_type); - OwnArray(OwnArray const&); -#if defined(__GXX_EXPERIMENTAL_CXX0X__) - OwnArray(OwnArray&&); -#endif - - ~OwnArray(); - - iterator begin(); - iterator end(); - const_iterator begin() const; - const_iterator end() const; - size_type size() const; - bool empty() const; - reference operator[](size_type); - const_reference operator[](size_type) const; - - self& operator=(self const&); -#if defined(__GXX_EXPERIMENTAL_CXX0X__) - self& operator=(self&&); -#endif - - - void reserve(size_t){} - size_type capacity() const { return MAX_SIZE;} - template void push_back(D*& d); - template void push_back(D* const& d); - template void push_back(std::unique_ptr d); - void push_back(T const& valueToCopy); - bool is_back_safe() const; - void pop_back(); - reference back(); - const_reference back() const; - reference front(); - const_reference front() const; - pointer const * data() const; - void clear(); - iterator erase(iterator pos); - iterator erase(iterator first, iterator last); - template - void sort(S s); - void sort(); - - void swap(self& other); - - void fillView(ProductID const& id, - std::vector& pointers, - FillViewHelperVector& helpers) const; - - void setPtr(std::type_info const& toType, - unsigned long index, - void const*& ptr) const; - - void fillPtrVector(std::type_info const& toType, - std::vector const& indices, - std::vector& ptrs) const; - - - //Used by ROOT storage - CMS_CLASS_VERSION(11) - - private: - void destroy(); - template - struct Ordering { - Ordering(O const& c) : comp(c) { } - bool operator()(T const* t1, T const* t2) const { - return comp(*t1, *t2); - } - private: - O comp; - }; - template - static Ordering ordering(O const& comp) { - return Ordering(comp); - } - pointer data_[MAX_SIZE]; - size_type size_; - }; - - template - inline OwnArray::OwnArray() : data_{{0}}, size_(0) { - } - - template - inline OwnArray::OwnArray(size_type n) : data_{{0}}, size_(n) { - } - - template - inline OwnArray::OwnArray(OwnArray const& o) : size_(o.size()) { - size_type current = 0; - for (const_iterator i = o.begin(), e = o.end(); i != e; ++i,++current) - data_[current] = policy_type::clone(*i); - } - -#if defined(__GXX_EXPERIMENTAL_CXX0X__) - template - inline OwnArray::OwnArray(OwnArray&& o) { - std::swap_ranges(data_,data_+M, o.data_); - } -#endif - - template - inline OwnArray::~OwnArray() { - destroy(); - } - - template - inline OwnArray& OwnArray::operator=(OwnArray const& o) { - OwnArray temp(o); - swap(temp); - return *this; - } - -#if defined(__GXX_EXPERIMENTAL_CXX0X__) - template - inline OwnArray& OwnArray::operator=(OwnArray&& o) { - std::swap_ranges(data_,data_+M, o.data_); - return *this; - } -#endif - - - template - inline typename OwnArray::iterator OwnArray::begin() { - return iterator(data_); - } - - template - inline typename OwnArray::iterator OwnArray::end() { - return iterator(data_+size()); - } - - template - inline typename OwnArray::const_iterator OwnArray::begin() const { - return const_iterator(data_); - } - - template - inline typename OwnArray::const_iterator OwnArray::end() const { - return const_iterator(data_+size()); - } - - template - inline typename OwnArray::size_type OwnArray::size() const { - return size_; - } - - template - inline bool OwnArray::empty() const { - return 0==size_; - } - - template - inline typename OwnArray::reference OwnArray::operator[](size_type n) { - return *data_[n]; - } - - template - inline typename OwnArray::const_reference OwnArray::operator[](size_type n) const { - return *data_[n]; - } - - template - template - inline void OwnArray::push_back(D*& d) { - // C++ does not yet support rvalue references, so d should only be - // able to bind to an lvalue. - // This should be called only for lvalues. - data_[size_++]=d; - d = 0; - } - - template - template - inline void OwnArray::push_back(D* const& d) { - - // C++ allows d to be bound to an lvalue or rvalue. But the other - // signature should be a better match for an lvalue (because it - // does not require an lvalue->rvalue conversion). Thus this - // signature should only be chosen for rvalues. - data_[size_++]=d; - } - - - template - template - inline void OwnArray::push_back(std::unique_ptr d) { - data_[size_++]=d.release(); - } - - - template - inline void OwnArray::push_back(T const& d) { - data_[size_++]=policy_type::clone(d); - } - - - template - inline void OwnArray::pop_back() { - // We have to delete the pointed-to thing, before we squeeze it - // out of the vector... - delete data_[--size_]; - } - - template - inline bool OwnArray::is_back_safe() const { - return data_[size_-1] != 0; - } - - template - inline typename OwnArray::reference OwnArray::back() { - pointer result = data_[size_-1]; - if (result == 0) { - Exception::throwThis(errors::NullPointerError, - "In OwnArray::back() we have intercepted an attempt to dereference a null pointer\n" - "Since OwnArray is allowed to contain null pointers, you much assure that the\n" - "pointer at the end of the collection is not null before calling back()\n" - "if you wish to avoid this exception.\n" - "Consider using OwnArray::is_back_safe()\n"); - } - return *result; - } - - template - inline typename OwnArray::const_reference OwnArray::back() const { - pointer const * result = data_[size_-1]; - if (result == 0) { - Exception::throwThis(errors::NullPointerError, - "In OwnArray::back() we have intercepted an attempt to dereference a null pointer\n" - "Since OwnArray is allowed to contain null pointers, you much assure that the\n" - "pointer at the end of the collection is not null before calling back()\n" - "if you wish to avoid this exception.\n" - "Consider using OwnArray::is_back_safe()\n"); - } - return *result; - } - - template - inline typename OwnArray::reference OwnArray::front() { - return *data_[0]; - } - - template - inline typename OwnArray::const_reference OwnArray::front() const { - return *data_[0]; - } - - template - inline void OwnArray::destroy() { - pointer * b = data_, * e = data_+size(); - for(pointer * i = b; i != e; ++ i) - delete * i; - } - - template - inline typename OwnArray::pointer const * OwnArray::data() const { - return data_; - } - - template - inline void OwnArray::clear() { - destroy(); - size_=0; - } - - template - typename OwnArray::iterator OwnArray::erase(iterator pos) { - pointer * b = pos.i; - delete *b; - pointer * e = data_+size(); - for(pointer * i = b; i != e-1; ++ i) *i = *(i+1); - size_--; - return iterator(b); - } - - template - typename OwnArray::iterator OwnArray::erase(iterator first, iterator last) { - pointer * b = first.i, * e = last.i; - for(pointer * i = b; i != e; ++ i) delete * i; - pointer * l = data_+size(); - auto ib=b; - for(pointer * i = e; i != l; ++i) *(ib++) = *i; - size_ -= (e-b); - return iterator(b); - } - - template template - void OwnArray::sort(S comp) { - std::sort(data_, data_+size(), ordering(comp)); - } - - template - void OwnArray::sort() { - std::sort(data_, data_+size(), ordering(std::less())); - } - - template - inline void OwnArray::swap(OwnArray& other) { - std::swap_ranges(data_,data_+M, other.data_); - } - - template - void OwnArray::fillView(ProductID const& id, - std::vector& pointers, - FillViewHelperVector& helpers) const { - typedef Ref ref_type ; - typedef reftobase::RefHolder holder_type; - - size_type numElements = this->size(); - pointers.reserve(numElements); - helpers.reserve(numElements); - size_type key = 0; - for(typename base::const_iterator i=data_.begin(), e=data_.end(); i!=e; ++i, ++key) { - - if (*i == 0) { - Exception::throwThis(errors::NullPointerError, - "In OwnArray::fillView() we have intercepted an attempt to put a null pointer\n" - "into a View and that is not allowed. It is probably an error that the null\n" - "pointer was in the OwnArray in the first place.\n"); - } - else { - pointers.push_back(*i); - holder_type h(ref_type(id, *i, key,this)); - helpers.push_back(&h); - } - } - } - - template - inline void swap(OwnArray& a, OwnArray& b) { - a.swap(b); - } - - //---------------------------------------------------------------------- - // - // Free function template to support creation of Views. - - template - inline - void - fillView(OwnArray const& obj, - ProductID const& id, - std::vector& pointers, - FillViewHelperVector& helpers) { - obj.fillView(id, pointers, helpers); - } - - - template - struct has_fillView > { - static bool const value = true; - }; - - - // Free function templates to support the use of edm::Ptr. - - template - inline - void - OwnArray::setPtr(std::type_info const& toType, - unsigned long index, - void const*& ptr) const { - detail::reallySetPtr >(*this, toType, index, ptr); - } - - template - inline - void - setPtr(OwnArray const& obj, - std::type_info const& toType, - unsigned long index, - void const*& ptr) { - obj.setPtr(toType, index, ptr); - } - - template - inline - void - OwnArray::fillPtrVector(std::type_info const& toType, - std::vector const& indices, - std::vector& ptrs) const { - detail::reallyfillPtrVector(*this, toType, indices, ptrs); - } - - - template - inline - void - fillPtrVector(OwnArray const& obj, - std::type_info const& toType, - std::vector const& indices, - std::vector& ptrs) { - obj.fillPtrVector(toType, indices, ptrs); - } - - - template - struct has_setPtr > { - static bool const value = true; - }; - - -} - - -#endif diff --git a/DataFormats/Common/interface/TransientDataFrame.h b/DataFormats/Common/interface/TransientDataFrame.h deleted file mode 100644 index bc77c8df6cb16..0000000000000 --- a/DataFormats/Common/interface/TransientDataFrame.h +++ /dev/null @@ -1,51 +0,0 @@ -#ifndef DataFormats_Common_TransientDataFrame_h -#define DataFormats_Common_TransientDataFrame_h - -#include "DataFormats/Common/interface/DataFrame.h" -#include - -namespace edm { - - /* a fixed size array of 16bit words belonging to - * a "channel" identified by an 32bit id - * - * FIXME interface to be finalized once use-cases fully identified - * - */ - template - class TransientDataFrame { - public: - - typedef DataFrame::data_type data_type; - typedef DataFrame::id_type id_type; - - TransientDataFrame() {} - TransientDataFrame( id_type i) : m_id(i) {} - TransientDataFrame(DataFrame const & iframe) : - m_id(iframe.id()) - { - data_type const * p = iframe.begin(); - std::copy(p,p+SIZE,m_data); - } - - int size() const { return SIZE;} - - data_type operator[](size_t i) const { - return m_data[i]; - } - - data_type & operator[](size_t i) { - return m_data[i]; - } - - id_type id() const { return m_id; } - - private: - id_type m_id; - data_type m_data[SIZE]; - - }; - -} - -#endif // DataFormats_Common_TransientDataFrame_h diff --git a/DataFormats/Common/interface/debugging_allocator.h b/DataFormats/Common/interface/debugging_allocator.h deleted file mode 100644 index 528386613f77b..0000000000000 --- a/DataFormats/Common/interface/debugging_allocator.h +++ /dev/null @@ -1,80 +0,0 @@ -#ifndef DataFormatsCommonDebuggingAllocator -#define DataFormatsCommonDebuggingAllocator - -//--------------------------------------------------------------------- -// -// This file declares and defines an allocator class template. -// This allocator is intended for use with the memory checking tool -// valgrind. It is a minimum conformant implementation which makes sure -// not use use any unitialized memory, and so it causes no spurious error -// reports from valgrind. -// -// The intended use is in the declarations of objects from STL templates, -// e.g. -// typedef vector > vint; -// etc. -// -//--------------------------------------------------------------------- - -#include -#include - -namespace edm -{ - template - class debugging_allocator - { - public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef T* pointer; - typedef T const* const_pointer; - typedef T& reference; - typedef T const& const_reference; - typedef T value_type; - - template struct rebind { typedef debugging_allocator other; }; - - - debugging_allocator() noexcept : dummy('x') { } - - debugging_allocator(debugging_allocator const&) noexcept : dummy('c') { } - - template debugging_allocator(debugging_allocator const&) noexcept : dummy('u') { } - - ~debugging_allocator() noexcept { }; - - pointer address(reference value) const {return &value;} - - const_pointer address(const_reference value) const {return &value; } - - size_type max_size() const noexcept { return std::numeric_limits::max()/sizeof(T); } - - pointer allocate(size_type num, void const* hint = 0) - { - // allocate objects with global new - return (pointer)(::operator new(num*sizeof(T))); - } - - void construct(pointer p, T const& value) { new((void*)p)T(value); } - - void destroy(pointer p) { p->~T(); } - - void deallocate(pointer p, size_type num) { ::operator delete((void*)p); } - - private: - char dummy; - - }; - - // instances of all specializations of this allocator are equal - template - bool operator== (debugging_allocator const&, debugging_allocator const&) noexcept { return true; } - - template - bool operator!= (debugging_allocator const&, debugging_allocator const&) noexcept { return false; } - -} //namespace edm - - -#endif diff --git a/DataFormats/Common/test/OwnArray_t.cpp b/DataFormats/Common/test/OwnArray_t.cpp deleted file mode 100644 index 14afce3c5f1d7..0000000000000 --- a/DataFormats/Common/test/OwnArray_t.cpp +++ /dev/null @@ -1,188 +0,0 @@ -#include -#include -#include - -#include "DataFormats/Common/interface/OwnArray.h" -#include "FWCore/Utilities/interface/propagate_const.h" - - -struct Base -{ - virtual ~Base(); - virtual Base* clone() const = 0; -}; - -Base::~Base() {} - -struct Derived : Base -{ - explicit Derived(int n); - Derived(Derived const& other); - Derived& operator=(Derived const& other); - virtual ~Derived(); - void swap(Derived& other); - virtual Derived* clone() const; - - edm::propagate_const pointer; -}; - -Derived::Derived(int n) : pointer(new int(n)) { } - -Derived::Derived(Derived const& other) : pointer(new int(*other.pointer)) { } - -Derived& Derived::operator=(Derived const& other) -{ - Derived temp(other); - swap(temp); - return *this; -} - -void Derived::swap(Derived& other) -{ - std::swap(pointer, other.pointer); -} - -void swap(Derived& a, Derived& b) -{ - a.swap(b); -} - -Derived::~Derived() -{ - delete pointer.get(); -} - -Derived* -Derived::clone() const -{ - return new Derived(*this); -} - - - -void same_guy_twice() -{ - edm::OwnArray vec; - Base* p = new Derived(1); - - vec.push_back(p); - vec.push_back(p); -} - -void two_different_owners() -{ - edm::OwnArray v1,v2; - Base* p = new Derived(1); - v1.push_back(p); - v2.push_back(p); -} - -// void guy_on_stack() -// { -// edm::OwnArray v; -// Derived d(10); -// v.push_back(&d); -// } - -void copy_good_vec() -{ - // v1 is perfectly fine... - edm::OwnArray v1; - Base* p = new Derived(100); - v1.push_back(p); - //v1.push_back(new Derived(100)); - - // But what if we copy him? - edm::OwnArray v2(v1); -} - -void assign_to_other() -{ - edm::OwnArray v1; - Base* p = new Derived(100); - v1.push_back(p); - - edm::OwnArray v2; - v2 = v1; -} - -void assign_to_self() -{ - // Self-assignment happens, often by accident... - edm::OwnArray v1; - v1.push_back(new Derived(100)); - v1 = v1; -} - -void pop_one() -{ - edm::OwnArray v1; - v1.push_back(new Derived(100)); - v1.pop_back(); -} - -void back_with_null_pointer() -{ - edm::OwnArray v; - Base* p = 0; - v.push_back(p); - try - { - v.back(); - assert("Failed to throw a required exception in OwnArray_t"==0); - } - catch (edm::Exception& x) - { - // this is expected. - } - catch (...) - { - throw; - } -} - -void take_an_rvalue() -{ - edm::OwnArray v; - v.push_back(new Derived(101)); - Derived d(102); - v.push_back(d.clone()); -} - -void take_an_lvalue() -{ - edm::OwnArray v1; - Base* p = new Derived(100); - v1.push_back(p); - - assert(p == 0); -} - -void take_an_auto_ptr() -{ - edm::OwnArray v1; - std::unique_ptr p = std::make_unique(100); - v1.push_back(p); - assert(p.get() == 0); -} - -int main() -{ - edm::OwnArray vec; - vec.push_back(new Derived(100)); - edm::OwnArray* p = new edm::OwnArray; - p->push_back(new Derived(2)); - delete p; - // same_guy_twice(); - // two_different_owners(); - // guy_on_stack(); - copy_good_vec(); - assign_to_other(); - assign_to_self(); - pop_one(); - back_with_null_pointer(); - - take_an_rvalue(); - take_an_lvalue(); - take_an_auto_ptr(); -} diff --git a/DataFormats/Common/test/testOwnArray.cc b/DataFormats/Common/test/testOwnArray.cc deleted file mode 100644 index 498a76f77e4ad..0000000000000 --- a/DataFormats/Common/test/testOwnArray.cc +++ /dev/null @@ -1,139 +0,0 @@ -// -#include "cppunit/extensions/HelperMacros.h" -#include -#include -#include -#include "DataFormats/Common/interface/OwnArray.h" -#include "FWCore/Utilities/interface/propagate_const.h" - -class testOwnArray : public CppUnit::TestFixture { - CPPUNIT_TEST_SUITE(testOwnArray); - CPPUNIT_TEST(checkAll); - CPPUNIT_TEST_SUITE_END(); -public: - void setUp() {} - void tearDown() {} - void checkAll(); -}; - -CPPUNIT_TEST_SUITE_REGISTRATION(testOwnArray); - -namespace testOA { - struct Dummy { - Dummy(int n, bool * r) : value(n), ref(r) { } - ~Dummy() { * ref = true; } - int value; - bool operator<(const Dummy & o) const { - return value < o.value; - } - private: - edm::propagate_const ref; - }; - - struct DummyComp { - bool operator()(const Dummy& d1, const Dummy& d2) const { - return d1.value < d2.value; - } - }; - - class a { - public: - virtual ~a() {} - virtual int f() const = 0; - }; - - class ClassB : public a { - public: - ClassB(int i) : ii(i) {memset(&waste, 0, sizeof(waste));} - virtual ~ClassB() {} - virtual int f() const { return ii; } - int ii; - private: - char waste[1024*1024]; - }; - - class ss { - public: - bool operator() (const a & a1, const a & a2) const { - return (a1.f() > a2.f()); - } - }; - - inline std::ostream& operator<<(std::ostream& os, const a & aa) { - os << aa.f(); - return os; - } -} - -void testOwnArray::checkAll() { - edm::OwnArray v; - CPPUNIT_ASSERT(v.size() == 0); - CPPUNIT_ASSERT(v.empty()); - bool deleted[4] = { false, false, false, false }; - v.push_back(new testOA::Dummy(0, deleted + 0)); - v.push_back(new testOA::Dummy(1, deleted + 1)); - v.push_back(new testOA::Dummy(2, deleted + 2)); - v.push_back(new testOA::Dummy(3, deleted + 3)); - CPPUNIT_ASSERT(v.size() == 4); - auto i = v.begin(); - auto ci = i; - * ci; - v.sort(); - v.sort(testOA::DummyComp()); - CPPUNIT_ASSERT(!v.empty()); - CPPUNIT_ASSERT(v[0].value == 0); - CPPUNIT_ASSERT(v[1].value == 1); - CPPUNIT_ASSERT(v[2].value == 2); - CPPUNIT_ASSERT(v[3].value == 3); - i = v.begin() + 1; - v.erase( i ); - CPPUNIT_ASSERT(!deleted[0]); - CPPUNIT_ASSERT(deleted[1]); - CPPUNIT_ASSERT(!deleted[2]); - CPPUNIT_ASSERT(!deleted[3]); - CPPUNIT_ASSERT(v.size() == 3); - CPPUNIT_ASSERT(v[0].value == 0); - CPPUNIT_ASSERT(v[1].value == 2); - CPPUNIT_ASSERT(v[2].value == 3); - auto b = v.begin(), e = b + 1; - v.erase(b, e); - CPPUNIT_ASSERT(v.size() == 2); - CPPUNIT_ASSERT(deleted[0]); - CPPUNIT_ASSERT(deleted[1]); - CPPUNIT_ASSERT(!deleted[2]); - CPPUNIT_ASSERT(!deleted[3]); - v.clear(); - CPPUNIT_ASSERT(v.size() == 0); - CPPUNIT_ASSERT(v.empty()); - CPPUNIT_ASSERT(deleted[0]); - CPPUNIT_ASSERT(deleted[1]); - CPPUNIT_ASSERT(deleted[2]); - CPPUNIT_ASSERT(deleted[3]); - { - edm::OwnArray v; - testOA::a * aa = new testOA::ClassB(2); - v.push_back(aa); - aa = new testOA::ClassB(1); - v.push_back(aa); - aa = new testOA::ClassB(3); - v.push_back(aa); - v.sort(testOA::ss()); - std::cout << "OwnArray : dumping contents" << std::endl; - std::copy(v.begin(), - v.end(), - std::ostream_iterator(std::cout, "\t")); - - edm::Ptr ptr_v; - unsigned long index(0); - void const * data = &v[0]; - v.setPtr( typeid(testOA::a), index, data ); - testOA::a const * data_a = static_cast(data); - testOA::ClassB const * data_b = dynamic_cast(data_a); - CPPUNIT_ASSERT( data != 0); - CPPUNIT_ASSERT( data_a != 0); - CPPUNIT_ASSERT( data_b != 0); - if(data_b != 0) { // To silence Coverity - CPPUNIT_ASSERT( data_b->f() == 3); - } - } -} diff --git a/DataFormats/EcalDigi/interface/EcalMatacqDigi.h b/DataFormats/EcalDigi/interface/EcalMatacqDigi.h index b7cbc3949cf01..f33815d7b73d5 100644 --- a/DataFormats/EcalDigi/interface/EcalMatacqDigi.h +++ b/DataFormats/EcalDigi/interface/EcalMatacqDigi.h @@ -270,6 +270,7 @@ class EcalMatacqDigi { * @param value new value */ void laserPower(int value) { laserPower_ = value; } +#endif void init() { #if (ECAL_MATACQ_DIGI_VERS >= 2) @@ -285,11 +286,11 @@ class EcalMatacqDigi { emtcPhase_ = -1; attenuation_dB_ = -1; laserPower_ = -1; + tv_sec_ = 0; + tv_usec_ = 0; #endif } -#endif - private: /** Electronic channel id */ @@ -299,10 +300,6 @@ class EcalMatacqDigi { */ std::vector data_; - /** Frequency mode. 1->1GHz sampling, 2->2GHz sampling - */ - int freq; - /**Sampling period in seconds. In priniciple 1ns or 0.5ns */ double ts_; diff --git a/DataFormats/EcalDigi/src/classes_def.xml b/DataFormats/EcalDigi/src/classes_def.xml index 9c40edacab4db..5f365f96523b4 100644 --- a/DataFormats/EcalDigi/src/classes_def.xml +++ b/DataFormats/EcalDigi/src/classes_def.xml @@ -48,7 +48,8 @@ - + + diff --git a/DataFormats/FEDRawData/src/FEDHeader.cc b/DataFormats/FEDRawData/src/FEDHeader.cc index d92b1a2db6713..9faded6cce9a4 100644 --- a/DataFormats/FEDRawData/src/FEDHeader.cc +++ b/DataFormats/FEDRawData/src/FEDHeader.cc @@ -34,8 +34,8 @@ void FEDHeader::set(unsigned char* header, h->eventid = (FED_SLINK_START_MARKER << FED_HCTRLID_SHIFT) | ((triggerType << FED_EVTY_SHIFT) & FED_EVTY_MASK) | ((lvl1ID << FED_LVL1_SHIFT) & FED_LVL1_MASK); - h->sourceid = ((bxID << FED_BXID_SHIFT) & FED_BXID_MASK) | ((sourceID << FED_SOID_SHIFT) & FED_SOID_MASK) | - ((version << FED_VERSION_SHIFT) & FED_VERSION_MASK); + h->sourceid = (((bxID & FED_BXID_WIDTH) << FED_BXID_SHIFT) & FED_BXID_MASK) | + ((sourceID << FED_SOID_SHIFT) & FED_SOID_MASK) | ((version << FED_VERSION_SHIFT) & FED_VERSION_MASK); if (moreHeaders) h->sourceid |= (FED_MORE_HEADERS_WIDTH << FED_MORE_HEADERS_SHIFT); diff --git a/DataFormats/GEMDigi/interface/AMC13Event.h b/DataFormats/GEMDigi/interface/AMC13Event.h deleted file mode 100644 index f659ff208f2fa..0000000000000 --- a/DataFormats/GEMDigi/interface/AMC13Event.h +++ /dev/null @@ -1,126 +0,0 @@ -#ifndef DataFormats_GEMDigi_AMC13Event_h -#define DataFormats_GEMDigi_AMC13Event_h -#include -#include "AMCdata.h" - -namespace gem { - - union CDFHeader { - uint64_t word; - struct { - uint64_t fov : 8; // not used - uint64_t sourceId : 12; // FED number assigned by CDAQ - uint64_t bxId : 12; // BX number, Reset by BC0 - uint64_t lv1Id : 24; // L1A / event number, Reset by EC0 - uint64_t eventType : 4; // Event Type (1 for normal, 2 for calibration) - uint64_t cb5 : 4; // 0x5 - }; - }; - union AMC13Header { - uint64_t word; - struct { - uint64_t cb0 : 4; // 0x0 - uint64_t orbitN : 32; // Orbit Number - uint64_t reserved0 : 16; // reserved - uint64_t nAMC : 4; // Number of AMCs following (0 to 12) - uint64_t calType : 4; // Calibration event type - uint64_t uFov : 4; // Format version: 0x1 - }; - }; - union AMC13Trailer { - uint64_t word; - struct { - uint64_t bxIdT : 12; // bx id - uint64_t lv1IdT : 8; // level 1 id - uint64_t blkN : 8; // block number - uint64_t : 4; - uint64_t crc32 : 32; // Overall CRC - }; - }; - union CDFTrailer { - uint64_t word; - struct { - uint64_t res1 : 2; - uint64_t crcModified : 1; - uint64_t moreTrailers : 1; - uint64_t tts : 4; // tts - uint64_t evtStat : 4; // event status - uint64_t res2 : 2; - uint64_t slinkError : 1; - uint64_t wrongFedId : 1; - uint64_t crcCDF : 16; // CDF crc - uint64_t evtLength : 24; // event length - uint64_t eventType : 4; // Event Type - uint64_t cbA : 4; // 0xA - }; - }; - union AMCHeader { - uint64_t word; - struct { - uint64_t boardId : 16; // board id - uint64_t amcNo : 4; // amc number - uint64_t blkNo : 8; // block number - uint64_t unused : 4; // unused - uint64_t amcSize : 24; // amc size - uint64_t errStrip : 8; // errStrip - }; - }; - - class AMC13Event { - public: - AMC13Event() : cdfh_(0), amc13h_(0), amc13t_(0), cdft_(0) {} - ~AMC13Event() { - amcHeaders_.clear(); - amcs_.clear(); - } - - void setCDFHeader(uint64_t word) { cdfh_ = word; } - void setCDFHeader(uint8_t Evt_ty, uint32_t LV1_id, uint16_t BX_id, uint16_t Source_id); - uint64_t getCDFHeader() const { return cdfh_; } - - void setAMC13Header(uint64_t word) { amc13h_ = word; } - void setAMC13Header(uint8_t CalTyp, uint8_t nAMC, uint32_t OrN); - uint64_t getAMC13Header() const { return amc13h_; } - - void setAMC13Trailer(uint64_t word) { amc13t_ = word; } - void setAMC13Trailer(uint8_t Blk_NoT, uint8_t LV1_idT, uint16_t BX_idT); - uint64_t getAMC13Trailer() const { return amc13t_; } - - void setCDFTrailer(uint64_t word) { cdft_ = word; } - void setCDFTrailer(uint32_t EvtLength); - uint64_t getCDFTrailer() const { return cdft_; } - uint32_t fragmentLength() const { return CDFTrailer{cdft_}.evtLength; } - uint8_t evtStatus() const { return CDFTrailer{cdft_}.evtStat; } - uint8_t ttsBits() const { return CDFTrailer{cdft_}.tts; } - - uint16_t bunchCrossing() const { return CDFHeader{cdfh_}.bxId; } - uint32_t lv1Id() const { return CDFHeader{cdfh_}.lv1Id; } - uint16_t sourceId() const { return CDFHeader{cdfh_}.sourceId; } - - uint16_t orbitNumber() const { return AMC13Header{amc13h_}.orbitN; } - uint8_t nAMC() const { return AMC13Header{amc13h_}.nAMC; } - - const std::vector* getAMCheaders() const { return &amcHeaders_; } - uint32_t getAMCsize(int i) const { return AMCHeader{amcHeaders_.at(i)}.amcSize; } - void addAMCheader(uint64_t word); - void addAMCheader(uint32_t AMC_size, uint8_t Blk_No, uint8_t AMC_No, uint16_t BoardID); - - uint32_t crc() const { return AMC13Trailer{amc13t_}.crc32; } - - const std::vector* getAMCpayloads() const { return &amcs_; } - void addAMCpayload(const AMCdata& a) { amcs_.push_back(a); } - void clearAMCpayloads() { amcs_.clear(); } - - private: - uint64_t cdfh_; // CDFHeader - uint64_t amc13h_; // AMC13Header - uint64_t amc13t_; // AMC13Trailer - uint64_t cdft_; // CDFTrailer - - // AMC headers - std::vector amcHeaders_; - // AMCs payload - std::vector amcs_; - }; -} // namespace gem -#endif diff --git a/DataFormats/GEMDigi/interface/AMCdata.h b/DataFormats/GEMDigi/interface/AMCdata.h deleted file mode 100644 index eaae41fdcbc79..0000000000000 --- a/DataFormats/GEMDigi/interface/AMCdata.h +++ /dev/null @@ -1,138 +0,0 @@ -#ifndef DataFormats_GEMDigi_AMCdata_h -#define DataFormats_GEMDigi_AMCdata_h -#include "GEBdata.h" -#include - -namespace gem { - - union AMCheader1 { - uint64_t word; - struct { - uint64_t dataLength : 20; // Always 0xfffff, use trailer dataLengthT - uint64_t bxID : 12; // Bunch crossing ID - uint64_t l1AID : 24; // L1A number – basically this is like event number, but reset by resync - uint64_t AMCnum : 4; // Slot number of the AMC - uint64_t reserved : 4; // not used - }; - }; - union AMCheader2 { - uint64_t word; - struct { - uint64_t boardID : 16; // 8bit long GLIB serial number - uint64_t orbitNum : 16; // Orbit number, Reset by EC0 - uint64_t param3 : 8; // RunPar - Controlled by software, normally used only for calibrations - uint64_t param2 : 8; // RunPar - Controlled by software, normally used only for calibrations - uint64_t param1 : 8; // RunPar - Controlled by software, normally used only for calibrations - uint64_t runType : 4; // run types like physics, cosmics, threshold scan, latency scan, etc.. - uint64_t formatVer : 4; // Current format version = 0x0 - }; - }; - union AMCTrailer { - uint64_t word; - struct { - uint64_t dataLength : 20; // Number of 64bit words in this event - uint64_t : 4; - uint64_t l1AID : 8; // L1A number (first 8 bits) - uint64_t crc : 32; // CRC added by the AMC13 - }; - }; - union EventHeader { - uint64_t word; - struct { - uint64_t ttsState : 4; // GLIB TTS state at the moment when this event was built. - uint64_t pType : 4; // Payload type: can be one refering to different zero suppression schemes - // in normal data taking or calibration type. - // Note in calibration type the entire GCT (GEM Chamber Trailer) is skipped - uint64_t pVer : 3; // Version of the payload type - uint64_t davCnt : 5; // Number of chamber blocks in this event - uint64_t buffState : 24; // Buffer status, Always 0 in current fw - uint64_t davList : 24; // Data Available list: a bitmask indicating which chambers have data in this event - }; - }; - union EventTrailer { - uint64_t word; - struct { - uint64_t BCL : 4; // 1st bit, BC0 locked - If 0, this is a bad condition indicating a - // problem in the clock or TTC command stream (critical condition) - uint64_t DR : 1; // DAQ Ready - If 0, this means that AMC13 is not ready to take data (critical condition) - uint64_t CL : 1; // DAQ clock locked- If 0, this indicates a problem in the DAQ clock (critical condition) - uint64_t ML : 1; // MMCM locked - Should always be 1 - uint64_t BP : 1; // Backpressure - If this is 1, it means that we are receiving backpressure from AMC13 - uint64_t oosGlib : 32; // GLIB is out‐of‐sync (critical): L1A ID is different for - // different chambers in this event (1 bit) - uint64_t linkTo : 24; // Link timeout flags (one bit for each link indicating timeout condition) - }; - }; - - class AMCdata { - public: - AMCdata() : amch1_(0), amch2_(0), amct_(0), eh_(0), et_(0){}; - ~AMCdata() { gebd_.clear(); } - - int status(); - - void setAMCheader1(uint64_t word) { amch1_ = word; } - void setAMCheader1(uint32_t dataLength, uint16_t bxID, uint32_t l1AID, uint8_t AMCnum); - uint64_t getAMCheader1() const { return amch1_; } - - void setAMCheader2(uint64_t word) { amch2_ = word; } - void setAMCheader2(uint16_t boardID, uint16_t orbitNum, uint8_t runType); - uint64_t getAMCheader2() const { return amch2_; } - - void setAMCTrailer(uint64_t word) { amct_ = word; } - uint64_t getAMCTrailer() const { return amct_; } - - void setGEMeventHeader(uint64_t word) { eh_ = word; } - void setGEMeventHeader(uint8_t davCnt, uint32_t davList); - uint64_t getGEMeventHeader() const { return eh_; } - - void setGEMeventTrailer(uint64_t word) { et_ = word; } - uint64_t getGEMeventTrailer() const { return et_; } - - uint32_t dataLength() const { return AMCTrailer{amct_}.dataLength; } - uint16_t bunchCrossing() const { return AMCheader1{amch1_}.bxID; } - uint32_t lv1Id() const { return AMCheader1{amch1_}.l1AID; } - uint8_t amcNum() const { return AMCheader1{amch1_}.AMCnum; } - - uint16_t boardId() const { return AMCheader2{amch2_}.boardID; } - uint16_t orbitNumber() const { return AMCheader2{amch2_}.orbitNum; } - uint8_t param3() const { return AMCheader2{amch2_}.param3; } - uint8_t param2() const { return AMCheader2{amch2_}.param2; } - uint8_t param1() const { return AMCheader2{amch2_}.param1; } - uint8_t runType() const { return AMCheader2{amch2_}.runType; } - uint8_t formatVer() const { return AMCheader2{amch2_}.formatVer; } - - uint8_t lv1Idt() const { return AMCTrailer{amct_}.l1AID; } - uint32_t crc() const { return AMCTrailer{amct_}.crc; } - - uint16_t ttsState() const { return EventHeader{eh_}.ttsState; } - uint8_t davCnt() const { return EventHeader{eh_}.davCnt; } - uint32_t buffState() const { return EventHeader{eh_}.buffState; } - uint32_t davList() const { return EventHeader{eh_}.davList; } - - uint8_t bc0locked() const { return EventTrailer{et_}.BCL; } - uint8_t daqReady() const { return EventTrailer{et_}.DR; } - uint8_t daqClockLocked() const { return EventTrailer{et_}.CL; } - uint8_t mmcmLocked() const { return EventTrailer{et_}.ML; } - uint8_t backPressure() const { return EventTrailer{et_}.BP; } - uint8_t oosGlib() const { return EventTrailer{et_}.oosGlib; } - uint32_t linkTo() const { return EventTrailer{et_}.linkTo; } - - //!Adds GEB data to vector - void addGEB(GEBdata g) { gebd_.push_back(g); } - //!Returns a vector of GEB data - const std::vector* gebs() const { return &gebd_; } - //!Clear a vector of GEB data - void clearGEBs() { gebd_.clear(); } - - private: - uint64_t amch1_; - uint64_t amch2_; - uint64_t amct_; - uint64_t eh_; - uint64_t et_; - - std::vector gebd_; /// - -namespace gem { - - union GEBchamberHeader { - uint64_t word; - struct { - uint64_t : 10; // unused - uint64_t BxmVvV : 1; // 1st bit BX mismatch VFAT vs VFAT - uint64_t BxmAvV : 1; // BX mismatch AMC vs VFAT - uint64_t OOScVvV : 1; // Out of Sync (EC mismatch) VFAT vs VFAT - uint64_t OOScAvV : 1; // Out of Sync (EC mismatch) AMC vs VFAT - uint64_t Inv : 1; // Invalid event - uint64_t EvtSzW : 1; // Event size warning - uint64_t L1aNF : 1; // L1A FIFO near full - uint64_t InNF : 1; // Input FIFO near full - uint64_t EvtNF : 1; // Event FIFO near full - uint64_t EvtSzOFW : 1; // Event size overflow - uint64_t L1aF : 1; // L1A FIFO full - uint64_t InF : 1; // Input FIFO full - uint64_t EvtF : 1; // Event FIFO full - uint64_t VfWdCnt : 12; // VFAT word count (in number of 64-bit words) - uint64_t InputID : 5; // Input link ID - uint64_t CALIB_CHAN : 7; // Calibration channel number - uint64_t : 17; // unused - }; - }; - - union GEBchamberTrailer { - uint64_t word; - struct { - uint64_t ecOH : 20; // NOT USED - OptoHybrid event counter - uint64_t bcOH : 13; // NOT USED - OptoHybrid bunch crossing - uint64_t InUfw : 1; // Input FIFO underflow - uint64_t SkD : 1; // NOT USED - Stuck data - uint64_t EvUfw : 1; // NOT USED - Event FIFO underflow - uint64_t VfWdCntT : 12; // VFAT word count (in number of 64-bit words) - uint64_t crc16 : 16; // CRC of OptoHybrid data (currently not available – filled with 0) - }; - }; - - class GEBdata { - public: - GEBdata() : ch_(0), ct_(0){}; - ~GEBdata() { vfatd_.clear(); } - - //!Read chamberHeader from the block. - void setChamberHeader(uint64_t word) { ch_ = word; } - void setChamberHeader(uint16_t vfatWordCnt, uint8_t inputID) { - GEBchamberHeader u{0}; - u.VfWdCnt = vfatWordCnt; - u.InputID = inputID; - ch_ = u.word; - } - uint64_t getChamberHeader() const { return ch_; } - - //!Read chamberTrailer from the block. - void setChamberTrailer(uint64_t word) { ct_ = word; } - void setChamberTrailer(uint32_t ecOH, uint16_t bcOH, uint16_t vfatWordCntT) { - GEBchamberTrailer u{0}; - u.ecOH = ecOH; - u.bcOH = bcOH; - u.VfWdCntT = vfatWordCntT; - ct_ = u.word; - } - uint64_t getChamberTrailer() const { return ct_; } - - uint16_t vfatWordCnt() const { return GEBchamberHeader{ch_}.VfWdCnt; } - uint8_t inputID() const { return GEBchamberHeader{ch_}.InputID; } - uint16_t vfatWordCntT() const { return GEBchamberTrailer{ct_}.VfWdCntT; } - - bool bxmVvV() const { return GEBchamberHeader{ch_}.BxmVvV; } - bool bxmAvV() const { return GEBchamberHeader{ch_}.BxmAvV; } - bool oOScVvV() const { return GEBchamberHeader{ch_}.OOScVvV; } - bool oOScAvV() const { return GEBchamberHeader{ch_}.OOScAvV; } - bool inv() const { return GEBchamberHeader{ch_}.Inv; } - bool evtSzW() const { return GEBchamberHeader{ch_}.EvtSzW; } - bool l1aNF() const { return GEBchamberHeader{ch_}.L1aNF; } - bool inNF() const { return GEBchamberHeader{ch_}.InNF; } - bool evtNF() const { return GEBchamberHeader{ch_}.EvtNF; } - bool evtSzOFW() const { return GEBchamberHeader{ch_}.EvtSzOFW; } - bool l1aF() const { return GEBchamberHeader{ch_}.L1aF; } - bool inF() const { return GEBchamberHeader{ch_}.InF; } - bool evtF() const { return GEBchamberHeader{ch_}.EvtF; } - bool inUfw() const { return GEBchamberTrailer{ct_}.InUfw; } - - bool noVFAT() const { return false; } // to be removed - bool stuckData() const { return false; } // to be removed - bool evUfw() const { return false; } // to be removed - - //!Adds VFAT data to the vector - void addVFAT(VFATdata v) { vfatd_.push_back(v); } - //!Returns the vector of VFAT data - const std::vector* vFATs() const { return &vfatd_; } - //!Clear the vector rof VFAT data - void clearVFATs() { vfatd_.clear(); } - - static const int sizeGebID = 5; - - private: - uint64_t ch_; // GEBchamberHeader - uint64_t ct_; // GEBchamberTrailer - - std::vector vfatd_; - }; -} // namespace gem -#endif diff --git a/DataFormats/GEMDigi/interface/GEMAMC.h b/DataFormats/GEMDigi/interface/GEMAMC.h new file mode 100644 index 0000000000000..129dec4be1af7 --- /dev/null +++ b/DataFormats/GEMDigi/interface/GEMAMC.h @@ -0,0 +1,135 @@ +#ifndef DataFormats_GEMDigi_GEMAMC_h +#define DataFormats_GEMDigi_GEMAMC_h +#include "GEMOptoHybrid.h" +#include + +class GEMAMC { +public: + union AMCheader1 { + uint64_t word; + struct { + uint64_t dataLength : 20; // Always 0xfffff, use trailer dataLengthT + uint64_t bxID : 12; // Bunch crossing ID + uint64_t l1AID : 24; // L1A number – basically this is like event number, but reset by resync + uint64_t AMCnum : 4; // Slot number of the AMC + uint64_t reserved : 4; // not used + }; + }; + union AMCheader2 { + uint64_t word; + struct { + uint64_t boardID : 16; // 8bit long GLIB serial number + uint64_t orbitNum : 16; // Orbit number, Reset by EC0 + uint64_t param3 : 8; // RunPar - Controlled by software, normally used only for calibrations + uint64_t param2 : 8; // RunPar - Controlled by software, normally used only for calibrations + uint64_t param1 : 8; // RunPar - Controlled by software, normally used only for calibrations + uint64_t runType : 4; // run types like physics, cosmics, threshold scan, latency scan, etc.. + uint64_t formatVer : 4; // Current format version = 0x0 + }; + }; + union AMCTrailer { + uint64_t word; + struct { + uint64_t dataLength : 20; // Number of 64bit words in this event + uint64_t : 4; + uint64_t l1AID : 8; // L1A number (first 8 bits) + uint64_t crc : 32; // CRC added by the AMC13 + }; + }; + union EventHeader { + uint64_t word; + struct { + uint64_t ttsState : 4; // GLIB TTS state at the moment when this event was built. + uint64_t pType : 4; // Payload type: can be one refering to different zero suppression schemes + // in normal data taking or calibration type. + // Note in calibration type the entire GCT (GEM Chamber Trailer) is skipped + uint64_t pVer : 3; // Version of the payload type + uint64_t davCnt : 5; // Number of chamber blocks in this event + uint64_t buffState : 24; // Buffer status, Always 0 in current fw + uint64_t davList : 24; // Data Available list: a bitmask indicating which chambers have data in this event + }; + }; + union EventTrailer { + uint64_t word; + struct { + uint64_t BCL : 4; // 1st bit, BC0 locked - If 0, this is a bad condition indicating a + // problem in the clock or TTC command stream (critical condition) + uint64_t DR : 1; // DAQ Ready - If 0, this means that AMC13 is not ready to take data (critical condition) + uint64_t CL : 1; // DAQ clock locked- If 0, this indicates a problem in the DAQ clock (critical condition) + uint64_t ML : 1; // MMCM locked - Should always be 1 + uint64_t BP : 1; // Backpressure - If this is 1, it means that we are receiving backpressure from AMC13 + uint64_t oosGlib : 32; // GLIB is out‐of‐sync (critical): L1A ID is different for + // different chambers in this event (1 bit) + uint64_t linkTo : 24; // Link timeout flags (one bit for each link indicating timeout condition) + }; + }; + + GEMAMC() : amch1_(0), amch2_(0), amct_(0), eh_(0), et_(0){}; + ~GEMAMC() { gebd_.clear(); } + + int status(); + + void setAMCheader1(uint64_t word) { amch1_ = word; } + void setAMCheader1(uint32_t dataLength, uint16_t bxID, uint32_t l1AID, uint8_t AMCnum); + uint64_t getAMCheader1() const { return amch1_; } + + void setAMCheader2(uint64_t word) { amch2_ = word; } + void setAMCheader2(uint16_t boardID, uint16_t orbitNum, uint8_t runType); + uint64_t getAMCheader2() const { return amch2_; } + + void setAMCTrailer(uint64_t word) { amct_ = word; } + uint64_t getAMCTrailer() const { return amct_; } + + void setGEMeventHeader(uint64_t word) { eh_ = word; } + void setGEMeventHeader(uint8_t davCnt, uint32_t davList); + uint64_t getGEMeventHeader() const { return eh_; } + + void setGEMeventTrailer(uint64_t word) { et_ = word; } + uint64_t getGEMeventTrailer() const { return et_; } + + uint32_t dataLength() const { return AMCTrailer{amct_}.dataLength; } + uint16_t bunchCrossing() const { return AMCheader1{amch1_}.bxID; } + uint32_t lv1Id() const { return AMCheader1{amch1_}.l1AID; } + uint8_t amcNum() const { return AMCheader1{amch1_}.AMCnum; } + + uint16_t boardId() const { return AMCheader2{amch2_}.boardID; } + uint16_t orbitNumber() const { return AMCheader2{amch2_}.orbitNum; } + uint8_t param3() const { return AMCheader2{amch2_}.param3; } + uint8_t param2() const { return AMCheader2{amch2_}.param2; } + uint8_t param1() const { return AMCheader2{amch2_}.param1; } + uint8_t runType() const { return AMCheader2{amch2_}.runType; } + uint8_t formatVer() const { return AMCheader2{amch2_}.formatVer; } + + uint8_t lv1Idt() const { return AMCTrailer{amct_}.l1AID; } + uint32_t crc() const { return AMCTrailer{amct_}.crc; } + + uint16_t ttsState() const { return EventHeader{eh_}.ttsState; } + uint8_t davCnt() const { return EventHeader{eh_}.davCnt; } + uint32_t buffState() const { return EventHeader{eh_}.buffState; } + uint32_t davList() const { return EventHeader{eh_}.davList; } + + uint8_t bc0locked() const { return EventTrailer{et_}.BCL; } + uint8_t daqReady() const { return EventTrailer{et_}.DR; } + uint8_t daqClockLocked() const { return EventTrailer{et_}.CL; } + uint8_t mmcmLocked() const { return EventTrailer{et_}.ML; } + uint8_t backPressure() const { return EventTrailer{et_}.BP; } + uint8_t oosGlib() const { return EventTrailer{et_}.oosGlib; } + uint32_t linkTo() const { return EventTrailer{et_}.linkTo; } + + //!Adds GEB data to vector + void addGEB(GEMOptoHybrid g) { gebd_.push_back(g); } + //!Returns a vector of GEB data + const std::vector* gebs() const { return &gebd_; } + //!Clear a vector of GEB data + void clearGEBs() { gebd_.clear(); } + +private: + uint64_t amch1_; + uint64_t amch2_; + uint64_t amct_; + uint64_t eh_; + uint64_t et_; + + std::vector gebd_; /// +#include "GEMAMC.h" + +class GEMAMC13 { +public: + union CDFHeader { + uint64_t word; + struct { + uint64_t fov : 8; // not used + uint64_t sourceId : 12; // FED number assigned by CDAQ + uint64_t bxId : 12; // BX number, Reset by BC0 + uint64_t lv1Id : 24; // L1A / event number, Reset by EC0 + uint64_t eventType : 4; // Event Type (1 for normal, 2 for calibration) + uint64_t cb5 : 4; // 0x5 + }; + }; + union AMC13Header { + uint64_t word; + struct { + uint64_t cb0 : 4; // 0x0 + uint64_t orbitN : 32; // Orbit Number + uint64_t reserved0 : 16; // reserved + uint64_t nAMC : 4; // Number of AMCs following (0 to 12) + uint64_t calType : 4; // Calibration event type + uint64_t uFov : 4; // Format version: 0x1 + }; + }; + union AMC13Trailer { + uint64_t word; + struct { + uint64_t bxIdT : 12; // bx id + uint64_t lv1IdT : 8; // level 1 id + uint64_t blkN : 8; // block number + uint64_t : 4; + uint64_t crc32 : 32; // Overall CRC + }; + }; + union CDFTrailer { + uint64_t word; + struct { + uint64_t res1 : 2; + uint64_t crcModified : 1; + uint64_t moreTrailers : 1; + uint64_t tts : 4; // tts + uint64_t evtStat : 4; // event status + uint64_t res2 : 2; + uint64_t slinkError : 1; + uint64_t wrongFedId : 1; + uint64_t crcCDF : 16; // CDF crc + uint64_t evtLength : 24; // event length + uint64_t eventType : 4; // Event Type + uint64_t cbA : 4; // 0xA + }; + }; + union AMCHeader { + uint64_t word; + struct { + uint64_t boardId : 16; // board id + uint64_t amcNo : 4; // amc number + uint64_t blkNo : 8; // block number + uint64_t unused : 4; // unused + uint64_t amcSize : 24; // amc size + uint64_t errStrip : 8; // errStrip + }; + }; + + GEMAMC13() : cdfh_(0), amc13h_(0), amc13t_(0), cdft_(0) {} + ~GEMAMC13() { + amcHeaders_.clear(); + amcs_.clear(); + } + + void setCDFHeader(uint64_t word) { cdfh_ = word; } + void setCDFHeader(uint8_t Evt_ty, uint32_t LV1_id, uint16_t BX_id, uint16_t Source_id); + uint64_t getCDFHeader() const { return cdfh_; } + + void setAMC13Header(uint64_t word) { amc13h_ = word; } + void setAMC13Header(uint8_t CalTyp, uint8_t nAMC, uint32_t OrN); + uint64_t getAMC13Header() const { return amc13h_; } + + void setAMC13Trailer(uint64_t word) { amc13t_ = word; } + void setAMC13Trailer(uint8_t Blk_NoT, uint8_t LV1_idT, uint16_t BX_idT); + uint64_t getAMC13Trailer() const { return amc13t_; } + + void setCDFTrailer(uint64_t word) { cdft_ = word; } + void setCDFTrailer(uint32_t EvtLength); + uint64_t getCDFTrailer() const { return cdft_; } + uint32_t fragmentLength() const { return CDFTrailer{cdft_}.evtLength; } + uint8_t evtStatus() const { return CDFTrailer{cdft_}.evtStat; } + uint8_t ttsBits() const { return CDFTrailer{cdft_}.tts; } + + uint16_t bunchCrossing() const { return CDFHeader{cdfh_}.bxId; } + uint32_t lv1Id() const { return CDFHeader{cdfh_}.lv1Id; } + uint16_t sourceId() const { return CDFHeader{cdfh_}.sourceId; } + + uint16_t orbitNumber() const { return AMC13Header{amc13h_}.orbitN; } + uint8_t nAMC() const { return AMC13Header{amc13h_}.nAMC; } + + const std::vector* getAMCheaders() const { return &amcHeaders_; } + uint32_t getAMCsize(int i) const { return AMCHeader{amcHeaders_.at(i)}.amcSize; } + void addAMCheader(uint64_t word); + void addAMCheader(uint32_t AMC_size, uint8_t Blk_No, uint8_t AMC_No, uint16_t BoardID); + + uint32_t crc() const { return AMC13Trailer{amc13t_}.crc32; } + + const std::vector* getAMCpayloads() const { return &amcs_; } + void addAMCpayload(const GEMAMC& a) { amcs_.push_back(a); } + void clearAMCpayloads() { amcs_.clear(); } + +private: + uint64_t cdfh_; // CDFHeader + uint64_t amc13h_; // AMC13Header + uint64_t amc13t_; // AMC13Trailer + uint64_t cdft_; // CDFTrailer + + // AMC headers + std::vector amcHeaders_; + // AMCs payload + std::vector amcs_; +}; + +#endif diff --git a/DataFormats/GEMDigi/interface/GEMAMC13EventCollection.h b/DataFormats/GEMDigi/interface/GEMAMC13EventCollection.h deleted file mode 100644 index 2eb053e303f3b..0000000000000 --- a/DataFormats/GEMDigi/interface/GEMAMC13EventCollection.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef DataFormats_GEMDigi_GEMAMC13EventCollection_h -#define DataFormats_GEMDigi_GEMAMC13EventCollection_h - -#include "DataFormats/MuonData/interface/MuonDigiCollection.h" -#include "DataFormats/GEMDigi/interface/AMC13Event.h" - -typedef MuonDigiCollection GEMAMC13EventCollection; - -#endif diff --git a/DataFormats/GEMDigi/interface/GEMAMC13Status.h b/DataFormats/GEMDigi/interface/GEMAMC13Status.h index 6c848ed005fad..a1ad46fcc86c7 100644 --- a/DataFormats/GEMDigi/interface/GEMAMC13Status.h +++ b/DataFormats/GEMDigi/interface/GEMAMC13Status.h @@ -1,7 +1,7 @@ #ifndef DataFormats_GEMDigi_GEMAMC13Status_h #define DataFormats_GEMDigi_GEMAMC13Status_h -#include "AMC13Event.h" -#include "AMCdata.h" +#include "GEMAMC13.h" +#include "GEMAMC.h" #include "DataFormats/FEDRawData/interface/FEDRawData.h" #include "DataFormats/FEDRawData/interface/FEDTrailer.h" #include diff --git a/DataFormats/GEMDigi/interface/GEMAMCStatus.h b/DataFormats/GEMDigi/interface/GEMAMCStatus.h index d66d59c55dadc..abb9d6f66f026 100644 --- a/DataFormats/GEMDigi/interface/GEMAMCStatus.h +++ b/DataFormats/GEMDigi/interface/GEMAMCStatus.h @@ -1,7 +1,7 @@ #ifndef DataFormats_GEMDigi_GEMAMCStatus_h #define DataFormats_GEMDigi_GEMAMCStatus_h -#include "AMC13Event.h" -#include "AMCdata.h" +#include "GEMAMC13.h" +#include "GEMAMC.h" #include #include @@ -30,7 +30,7 @@ class GEMAMCStatus { }; GEMAMCStatus() {} - GEMAMCStatus(const gem::AMC13Event* amc13, const gem::AMCdata& amc) { + GEMAMCStatus(const GEMAMC13* amc13, const GEMAMC& amc) { amcNum_ = amc.amcNum(); Errors error{0}; error.badEC = (amc13->lv1Id() != amc.lv1Id()); diff --git a/DataFormats/GEMDigi/interface/GEMAMCdataCollection.h b/DataFormats/GEMDigi/interface/GEMAMCdataCollection.h deleted file mode 100644 index 3065dd3dc5306..0000000000000 --- a/DataFormats/GEMDigi/interface/GEMAMCdataCollection.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef DataFormats_GEMDigi_GEMAMCdataCollection_h -#define DataFormats_GEMDigi_GEMAMCdataCollection_h - -#include "DataFormats/MuonData/interface/MuonDigiCollection.h" -#include "DataFormats/GEMDigi/interface/AMCdata.h" - -typedef MuonDigiCollection GEMAMCdataCollection; - -#endif diff --git a/DataFormats/GEMDigi/interface/GEMGEBdataCollection.h b/DataFormats/GEMDigi/interface/GEMGEBdataCollection.h deleted file mode 100644 index c18a7176363ad..0000000000000 --- a/DataFormats/GEMDigi/interface/GEMGEBdataCollection.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef DataFormats_GEMDigi_GEMGEBdataCollection_h -#define DataFormats_GEMDigi_GEMGEBdataCollection_h - -#include "DataFormats/GEMDigi/interface/GEBdata.h" -#include "DataFormats/MuonDetId/interface/GEMDetId.h" -#include "DataFormats/MuonData/interface/MuonDigiCollection.h" - -typedef MuonDigiCollection GEMGEBdataCollection; - -#endif diff --git a/DataFormats/GEMDigi/interface/GEMOHStatus.h b/DataFormats/GEMDigi/interface/GEMOHStatus.h index c62675e1ece15..850356cb1618c 100644 --- a/DataFormats/GEMDigi/interface/GEMOHStatus.h +++ b/DataFormats/GEMDigi/interface/GEMOHStatus.h @@ -1,6 +1,6 @@ #ifndef DataFormats_GEMDigi_GEMOHStatus_h #define DataFormats_GEMDigi_GEMOHStatus_h -#include "GEBdata.h" +#include "GEMOptoHybrid.h" #include #include @@ -35,7 +35,7 @@ class GEMOHStatus { }; GEMOHStatus() {} - GEMOHStatus(const gem::GEBdata& oh) { + GEMOHStatus(const GEMOptoHybrid& oh) { Errors error{0}; error.EvtF = oh.evtF(); error.InF = oh.inF(); diff --git a/DataFormats/GEMDigi/interface/GEMOptoHybrid.h b/DataFormats/GEMDigi/interface/GEMOptoHybrid.h new file mode 100644 index 0000000000000..b0054f5fd2a5d --- /dev/null +++ b/DataFormats/GEMDigi/interface/GEMOptoHybrid.h @@ -0,0 +1,107 @@ +#ifndef DataFormats_GEMDigi_GEMOptoHybrid_h +#define DataFormats_GEMDigi_GEMOptoHybrid_h +#include "GEMVFAT.h" +#include + +class GEMOptoHybrid { +public: + union GEBchamberHeader { + uint64_t word; + struct { + uint64_t : 10; // unused + uint64_t BxmVvV : 1; // 1st bit BX mismatch VFAT vs VFAT + uint64_t BxmAvV : 1; // BX mismatch AMC vs VFAT + uint64_t OOScVvV : 1; // Out of Sync (EC mismatch) VFAT vs VFAT + uint64_t OOScAvV : 1; // Out of Sync (EC mismatch) AMC vs VFAT + uint64_t Inv : 1; // Invalid event + uint64_t EvtSzW : 1; // Event size warning + uint64_t L1aNF : 1; // L1A FIFO near full + uint64_t InNF : 1; // Input FIFO near full + uint64_t EvtNF : 1; // Event FIFO near full + uint64_t EvtSzOFW : 1; // Event size overflow + uint64_t L1aF : 1; // L1A FIFO full + uint64_t InF : 1; // Input FIFO full + uint64_t EvtF : 1; // Event FIFO full + uint64_t VfWdCnt : 12; // VFAT word count (in number of 64-bit words) + uint64_t InputID : 5; // Input link ID + uint64_t CALIB_CHAN : 7; // Calibration channel number + uint64_t : 17; // unused + }; + }; + + union GEBchamberTrailer { + uint64_t word; + struct { + uint64_t ecOH : 20; // NOT USED - OptoHybrid event counter + uint64_t bcOH : 13; // NOT USED - OptoHybrid bunch crossing + uint64_t InUfw : 1; // Input FIFO underflow + uint64_t SkD : 1; // NOT USED - Stuck data + uint64_t EvUfw : 1; // NOT USED - Event FIFO underflow + uint64_t VfWdCntT : 12; // VFAT word count (in number of 64-bit words) + uint64_t crc16 : 16; // CRC of OptoHybrid data (currently not available – filled with 0) + }; + }; + + GEMOptoHybrid() : ch_(0), ct_(0){}; + ~GEMOptoHybrid() { vfatd_.clear(); } + + //!Read chamberHeader from the block. + void setChamberHeader(uint64_t word) { ch_ = word; } + void setChamberHeader(uint16_t vfatWordCnt, uint8_t inputID) { + GEBchamberHeader u{0}; + u.VfWdCnt = vfatWordCnt; + u.InputID = inputID; + ch_ = u.word; + } + uint64_t getChamberHeader() const { return ch_; } + + //!Read chamberTrailer from the block. + void setChamberTrailer(uint64_t word) { ct_ = word; } + void setChamberTrailer(uint32_t ecOH, uint16_t bcOH, uint16_t vfatWordCntT) { + GEBchamberTrailer u{0}; + u.ecOH = ecOH; + u.bcOH = bcOH; + u.VfWdCntT = vfatWordCntT; + ct_ = u.word; + } + uint64_t getChamberTrailer() const { return ct_; } + + uint16_t vfatWordCnt() const { return GEBchamberHeader{ch_}.VfWdCnt; } + uint8_t inputID() const { return GEBchamberHeader{ch_}.InputID; } + uint16_t vfatWordCntT() const { return GEBchamberTrailer{ct_}.VfWdCntT; } + + bool bxmVvV() const { return GEBchamberHeader{ch_}.BxmVvV; } + bool bxmAvV() const { return GEBchamberHeader{ch_}.BxmAvV; } + bool oOScVvV() const { return GEBchamberHeader{ch_}.OOScVvV; } + bool oOScAvV() const { return GEBchamberHeader{ch_}.OOScAvV; } + bool inv() const { return GEBchamberHeader{ch_}.Inv; } + bool evtSzW() const { return GEBchamberHeader{ch_}.EvtSzW; } + bool l1aNF() const { return GEBchamberHeader{ch_}.L1aNF; } + bool inNF() const { return GEBchamberHeader{ch_}.InNF; } + bool evtNF() const { return GEBchamberHeader{ch_}.EvtNF; } + bool evtSzOFW() const { return GEBchamberHeader{ch_}.EvtSzOFW; } + bool l1aF() const { return GEBchamberHeader{ch_}.L1aF; } + bool inF() const { return GEBchamberHeader{ch_}.InF; } + bool evtF() const { return GEBchamberHeader{ch_}.EvtF; } + bool inUfw() const { return GEBchamberTrailer{ct_}.InUfw; } + + bool noVFAT() const { return false; } // to be removed + bool stuckData() const { return false; } // to be removed + bool evUfw() const { return false; } // to be removed + + //!Adds VFAT data to the vector + void addVFAT(GEMVFAT v) { vfatd_.push_back(v); } + //!Returns the vector of VFAT data + const std::vector* vFATs() const { return &vfatd_; } + //!Clear the vector rof VFAT data + void clearVFATs() { vfatd_.clear(); } + + static const int sizeGebID = 5; + +private: + uint64_t ch_; // GEBchamberHeader + uint64_t ct_; // GEBchamberTrailer + + std::vector vfatd_; +}; +#endif diff --git a/DataFormats/GEMDigi/interface/GEMVFAT.h b/DataFormats/GEMDigi/interface/GEMVFAT.h new file mode 100644 index 0000000000000..94811bac22e2b --- /dev/null +++ b/DataFormats/GEMDigi/interface/GEMVFAT.h @@ -0,0 +1,128 @@ +#ifndef DataFormats_GEMDigi_GEMVFAT_h +#define DataFormats_GEMDigi_GEMVFAT_h +#include + +class GEMVFAT { +public: + /// VFAT data structure - 3 words of 64 bits each + union VFATfirst { + uint64_t word; + // v3 dataformat + struct { + uint64_t msData1 : 16; /// #include @@ -25,7 +25,7 @@ class GEMVFATStatus { }; GEMVFATStatus() {} - GEMVFATStatus(const gem::AMCdata& amc, const gem::VFATdata& vfat, uint16_t position, bool readMultiBX) { + GEMVFATStatus(const GEMAMC& amc, const GEMVFAT& vfat, uint16_t position, bool readMultiBX) { Errors error{0}; Warnings warn{0}; diff --git a/DataFormats/GEMDigi/interface/GEMVfatStatusDigi.h b/DataFormats/GEMDigi/interface/GEMVfatStatusDigi.h deleted file mode 100644 index 6cb72edbef637..0000000000000 --- a/DataFormats/GEMDigi/interface/GEMVfatStatusDigi.h +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef DataFormats_GEMDigi_GEMVfatStatusDigi_H -#define DataFormats_GEMDigi_GEMVfatStatusDigi_H - -#include -#include "DataFormats/GEMDigi/interface/VFATdata.h" - -class GEMVfatStatusDigi { -public: - GEMVfatStatusDigi(gem::VFATdata &vfat); - GEMVfatStatusDigi() {} - - uint8_t quality() const { return quality_; } - uint8_t flag() const { return flag_; } - int phi() const { return phi_; } - uint16_t bc() const { return bc_; } - uint8_t ec() const { return ec_; } - -private: - uint8_t quality_; /// quality flag - bit: 0 good, 1 crc fail, 2 b1010 fail, 3 b1100 fail, 4 b1110 - uint8_t flag_; /// Control Flags: 4 bits, Hamming Error/AFULL/SEUlogic/SUEI2C - int phi_; /// vfat local phi postion in chamber - uint16_t bc_; - uint8_t ec_; -}; -#endif diff --git a/DataFormats/GEMDigi/interface/GEMVfatStatusDigiCollection.h b/DataFormats/GEMDigi/interface/GEMVfatStatusDigiCollection.h deleted file mode 100644 index 2fd3b2527b8bc..0000000000000 --- a/DataFormats/GEMDigi/interface/GEMVfatStatusDigiCollection.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef DataFormats_GEMDigi_GEMVfatStatusDigiCollection_h -#define DataFormats_GEMDigi_GEMVfatStatusDigiCollection_h - -#include "DataFormats/GEMDigi/interface/GEMVfatStatusDigi.h" -#include "DataFormats/MuonDetId/interface/GEMDetId.h" -#include "DataFormats/MuonData/interface/MuonDigiCollection.h" - -typedef MuonDigiCollection GEMVfatStatusDigiCollection; - -#endif diff --git a/DataFormats/GEMDigi/interface/VFATdata.h b/DataFormats/GEMDigi/interface/VFATdata.h deleted file mode 100644 index 64f59f482038d..0000000000000 --- a/DataFormats/GEMDigi/interface/VFATdata.h +++ /dev/null @@ -1,130 +0,0 @@ -#ifndef DataFormats_GEMDigi_VFATdata_h -#define DataFormats_GEMDigi_VFATdata_h - -#include - -namespace gem { - /// VFAT data structure - 3 words of 64 bits each - union VFATfirst { - uint64_t word; - // v3 dataformat - struct { - uint64_t msData1 : 16; /// -#include "DataFormats/GEMDigi/interface/AMCdata.h" +#include "DataFormats/GEMDigi/interface/GEMAMC.h" #include -using namespace gem; -void AMCdata::setAMCheader1(uint32_t dataLength, uint16_t bxID, uint32_t l1AID, uint8_t AMCnum) { +void GEMAMC::setAMCheader1(uint32_t dataLength, uint16_t bxID, uint32_t l1AID, uint8_t AMCnum) { AMCheader1 u{0}; u.dataLength = dataLength; u.bxID = bxID; @@ -17,7 +16,7 @@ void AMCdata::setAMCheader1(uint32_t dataLength, uint16_t bxID, uint32_t l1AID, amct_ = ut.word; } -void AMCdata::setAMCheader2(uint16_t boardID, uint16_t orbitNum, uint8_t runType) { +void GEMAMC::setAMCheader2(uint16_t boardID, uint16_t orbitNum, uint8_t runType) { AMCheader2 u{0}; u.boardID = boardID; u.orbitNum = orbitNum; @@ -25,7 +24,7 @@ void AMCdata::setAMCheader2(uint16_t boardID, uint16_t orbitNum, uint8_t runType amch2_ = u.word; } -void AMCdata::setGEMeventHeader(uint8_t davCnt, uint32_t davList) { +void GEMAMC::setGEMeventHeader(uint8_t davCnt, uint32_t davList) { EventHeader u{0}; u.davCnt = davCnt; u.davList = davList; diff --git a/DataFormats/GEMDigi/src/AMC13Event.cc b/DataFormats/GEMDigi/src/GEMAMC13.cc similarity index 60% rename from DataFormats/GEMDigi/src/AMC13Event.cc rename to DataFormats/GEMDigi/src/GEMAMC13.cc index 171af2c09a919..2d357995aaf1a 100644 --- a/DataFormats/GEMDigi/src/AMC13Event.cc +++ b/DataFormats/GEMDigi/src/GEMAMC13.cc @@ -1,9 +1,7 @@ #include -#include "DataFormats/GEMDigi/interface/AMC13Event.h" +#include "DataFormats/GEMDigi/interface/GEMAMC13.h" -using namespace gem; - -void AMC13Event::setCDFHeader(uint8_t Evt_ty, uint32_t LV1_id, uint16_t BX_id, uint16_t Source_id) { +void GEMAMC13::setCDFHeader(uint8_t Evt_ty, uint32_t LV1_id, uint16_t BX_id, uint16_t Source_id) { CDFHeader u{0}; u.cb5 = 0x5; u.eventType = Evt_ty; @@ -13,7 +11,7 @@ void AMC13Event::setCDFHeader(uint8_t Evt_ty, uint32_t LV1_id, uint16_t BX_id, u cdfh_ = u.word; } -void AMC13Event::setAMC13Header(uint8_t CalTyp, uint8_t nAMC, uint32_t OrN) { +void GEMAMC13::setAMC13Header(uint8_t CalTyp, uint8_t nAMC, uint32_t OrN) { AMC13Header u{0}; u.cb0 = 0x0; u.calType = CalTyp; @@ -22,7 +20,7 @@ void AMC13Event::setAMC13Header(uint8_t CalTyp, uint8_t nAMC, uint32_t OrN) { amc13h_ = u.word; } -void AMC13Event::setAMC13Trailer(uint8_t Blk_NoT, uint8_t LV1_idT, uint16_t BX_idT) { +void GEMAMC13::setAMC13Trailer(uint8_t Blk_NoT, uint8_t LV1_idT, uint16_t BX_idT) { AMC13Trailer u{0}; u.blkN = Blk_NoT; u.lv1IdT = LV1_idT; @@ -30,7 +28,7 @@ void AMC13Event::setAMC13Trailer(uint8_t Blk_NoT, uint8_t LV1_idT, uint16_t BX_i amc13t_ = u.word; } -void AMC13Event::setCDFTrailer(uint32_t EvtLength) { +void GEMAMC13::setCDFTrailer(uint32_t EvtLength) { CDFTrailer u{0}; u.cbA = 0xA; u.eventType = CDFHeader{cdfh_}.eventType; @@ -38,9 +36,9 @@ void AMC13Event::setCDFTrailer(uint32_t EvtLength) { cdft_ = u.word; } -void AMC13Event::addAMCheader(uint64_t word) { amcHeaders_.push_back(word); } +void GEMAMC13::addAMCheader(uint64_t word) { amcHeaders_.push_back(word); } -void AMC13Event::addAMCheader(uint32_t AMC_size, uint8_t Blk_No, uint8_t AMC_No, uint16_t BoardID) { +void GEMAMC13::addAMCheader(uint32_t AMC_size, uint8_t Blk_No, uint8_t AMC_No, uint16_t BoardID) { // AMC Header word // 55 - 32 | 27 - 20 | 19 - 16 | 15 - 0 | // AMC_size | Blk_No | AMC_No | BoardID | diff --git a/DataFormats/GEMDigi/src/VFATdata.cc b/DataFormats/GEMDigi/src/GEMVFAT.cc similarity index 82% rename from DataFormats/GEMDigi/src/VFATdata.cc rename to DataFormats/GEMDigi/src/GEMVFAT.cc index 41ad6e81124f5..1282be867d96b 100644 --- a/DataFormats/GEMDigi/src/VFATdata.cc +++ b/DataFormats/GEMDigi/src/GEMVFAT.cc @@ -1,15 +1,14 @@ -#include "DataFormats/GEMDigi/interface/VFATdata.h" +#include "DataFormats/GEMDigi/interface/GEMVFAT.h" #include -using namespace gem; -VFATdata::VFATdata() : ver_(0), phiPos_(0), fw_(0), sw_(0), tw_(0) {} +GEMVFAT::GEMVFAT() : ver_(0), phiPos_(0), fw_(0), sw_(0), tw_(0) {} -VFATdata::VFATdata(const int vfatVer, - const uint16_t BC, - const uint32_t EC, - const uint16_t chipID, - const uint64_t lsDatas, - const uint64_t msDatas) { +GEMVFAT::GEMVFAT(const int vfatVer, + const uint16_t BC, + const uint32_t EC, + const uint16_t chipID, + const uint64_t lsDatas, + const uint64_t msDatas) { // this constructor only used for packing sim digis VFATfirst fw{0}; VFATsecond sw{0}; @@ -47,7 +46,7 @@ VFATdata::VFATdata(const int vfatVer, tw_ = tw.word; } -uint8_t VFATdata::quality() { +uint8_t GEMVFAT::quality() { uint8_t q = 0; if (ver_ == 2) { if (VFATthird{tw_}.crc != checkCRC()) @@ -63,7 +62,7 @@ uint8_t VFATdata::quality() { return q; } -uint16_t VFATdata::crc_cal(uint16_t crc_in, uint16_t dato) { +uint16_t GEMVFAT::crc_cal(uint16_t crc_in, uint16_t dato) { uint16_t v = 0x0001; uint16_t mask = 0x0001; uint16_t d = 0x0000; @@ -83,7 +82,7 @@ uint16_t VFATdata::crc_cal(uint16_t crc_in, uint16_t dato) { return crc_temp; } -uint16_t VFATdata::checkCRC() { +uint16_t GEMVFAT::checkCRC() { uint16_t vfatBlockWords[12]; vfatBlockWords[11] = ((0x000f & VFATfirst{fw_}.b1010) << 12) | VFATfirst{fw_}.bcV2; vfatBlockWords[10] = diff --git a/DataFormats/GEMDigi/src/GEMVfatStatusDigi.cc b/DataFormats/GEMDigi/src/GEMVfatStatusDigi.cc deleted file mode 100644 index 0f39fc7488787..0000000000000 --- a/DataFormats/GEMDigi/src/GEMVfatStatusDigi.cc +++ /dev/null @@ -1,10 +0,0 @@ -#include "DataFormats/GEMDigi/interface/GEMVfatStatusDigi.h" -#include - -GEMVfatStatusDigi::GEMVfatStatusDigi(gem::VFATdata &vfat) { - quality_ = vfat.quality(); - flag_ = vfat.flag(); - phi_ = vfat.phi(); - ec_ = vfat.ec(); - bc_ = vfat.bc(); -}; diff --git a/DataFormats/GEMDigi/src/classes.h b/DataFormats/GEMDigi/src/classes.h index f3ae200dca21e..1d516137794a2 100644 --- a/DataFormats/GEMDigi/src/classes.h +++ b/DataFormats/GEMDigi/src/classes.h @@ -22,18 +22,6 @@ #include "DataFormats/GEMDigi/interface/GEMVFATStatus.h" #include "DataFormats/GEMDigi/interface/GEMVFATStatusCollection.h" -#include "DataFormats/GEMDigi/interface/GEMVfatStatusDigi.h" -#include "DataFormats/GEMDigi/interface/GEMVfatStatusDigiCollection.h" - -#include "DataFormats/GEMDigi/interface/GEBdata.h" -#include "DataFormats/GEMDigi/interface/GEMGEBdataCollection.h" - -#include "DataFormats/GEMDigi/interface/AMCdata.h" -#include "DataFormats/GEMDigi/interface/GEMAMCdataCollection.h" - -#include "DataFormats/GEMDigi/interface/AMC13Event.h" -#include "DataFormats/GEMDigi/interface/GEMAMC13EventCollection.h" - #include "DataFormats/GEMDigi/interface/ME0DigiPreReco.h" #include "DataFormats/GEMDigi/interface/ME0DigiPreRecoCollection.h" diff --git a/DataFormats/GEMDigi/src/classes_def.xml b/DataFormats/GEMDigi/src/classes_def.xml index c21b9c62bad44..2046f2f9f66b6 100644 --- a/DataFormats/GEMDigi/src/classes_def.xml +++ b/DataFormats/GEMDigi/src/classes_def.xml @@ -78,43 +78,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/DataFormats/GeometrySurface/interface/private/extTkRotation.h b/DataFormats/GeometrySurface/interface/private/extTkRotation.h index f1c2aa2a67aeb..e171d5785074a 100644 --- a/DataFormats/GeometrySurface/interface/private/extTkRotation.h +++ b/DataFormats/GeometrySurface/interface/private/extTkRotation.h @@ -7,23 +7,23 @@ #include "DataFormats/Math/interface/ExtVec.h" - #include -template class TkRotation; -template class TkRotation2D; +template +class TkRotation; +template +class TkRotation2D; template -std::ostream & operator<<( std::ostream& s, const TkRotation& r); +std::ostream& operator<<(std::ostream& s, const TkRotation& r); template -std::ostream & operator<<( std::ostream& s, const TkRotation2D& r); +std::ostream& operator<<(std::ostream& s, const TkRotation2D& r); namespace geometryDetails { void TkRotationErr1(); void TkRotationErr2(); -} - +} // namespace geometryDetails /** Rotaion matrix used by Surface. */ @@ -31,65 +31,52 @@ namespace geometryDetails { template class TkRotation { public: - - typedef Vector3DBase< T, GlobalTag> GlobalVector; + typedef Vector3DBase GlobalVector; typedef Basic3DVector BasicVector; - TkRotation( ){} - TkRotation( Rot3 const & irot ) : rot(irot){} - - TkRotation( T xx, T xy, T xz, T yx, T yy, T yz, T zx, T zy, T zz) : - rot(xx,xy,xz, yx,yy,yz, zx, zy,zz){} - - TkRotation( const T* p) : - rot(p[0],p[1],p[2], - p[3],p[4],p[5], - p[6],p[7],p[8]) {} - - TkRotation( const GlobalVector & aX, const GlobalVector & aY) { - + TkRotation() {} + TkRotation(Rot3 const& irot) : rot(irot) {} + + TkRotation(T xx, T xy, T xz, T yx, T yy, T yz, T zx, T zy, T zz) : rot(xx, xy, xz, yx, yy, yz, zx, zy, zz) {} + + TkRotation(const T* p) : rot(p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7], p[8]) {} + + TkRotation(const GlobalVector& aX, const GlobalVector& aY) { GlobalVector uX = aX.unit(); GlobalVector uY = aY.unit(); GlobalVector uZ(uX.cross(uY)); - - rot.axis[0]= uX.basicVector().v; - rot.axis[1]= uY.basicVector().v; - rot.axis[2]= uZ.basicVector().v; - + + rot.axis[0] = uX.basicVector().v; + rot.axis[1] = uY.basicVector().v; + rot.axis[2] = uZ.basicVector().v; } - TkRotation( const BasicVector & aX, const BasicVector & aY) { - + TkRotation(const BasicVector& aX, const BasicVector& aY) { BasicVector uX = aX.unit(); BasicVector uY = aY.unit(); BasicVector uZ(uX.cross(uY)); - - rot.axis[0]= uX.v; - rot.axis[1]= uY.v; - rot.axis[2]= uZ.v; - + + rot.axis[0] = uX.v; + rot.axis[1] = uY.v; + rot.axis[2] = uZ.v; } - /** Construct from global vectors of the x, y and z axes. * The axes are assumed to be unit vectors forming * a right-handed orthonormal basis. No checks are performed! */ - TkRotation( const GlobalVector & uX, const GlobalVector & uY, - const GlobalVector & uZ) { - rot.axis[0]= uX.basicVector().v; - rot.axis[1]= uY.basicVector().v; - rot.axis[2]= uZ.basicVector().v; + TkRotation(const GlobalVector& uX, const GlobalVector& uY, const GlobalVector& uZ) { + rot.axis[0] = uX.basicVector().v; + rot.axis[1] = uY.basicVector().v; + rot.axis[2] = uZ.basicVector().v; } - TkRotation( const BasicVector & uX, const BasicVector & uY, - const BasicVector & uZ) { - rot.axis[0]= uX.v; - rot.axis[1]= uY.v; - rot.axis[2]= uZ.v; + TkRotation(const BasicVector& uX, const BasicVector& uY, const BasicVector& uZ) { + rot.axis[0] = uX.v; + rot.axis[1] = uY.v; + rot.axis[2] = uZ.v; } - - + /** rotation around abritrary axis by the amount of phi: * its constructed by O^-1(z<->axis) rot_z(phi) O(z<->axis) * the frame is rotated such that the z-asis corresponds to the rotation @@ -98,26 +85,17 @@ class TkRotation { * unfortuately I'm too stupid to describe such thing directly by 3 Euler * angles.. hence I have to construckt it this way...by brute force */ - TkRotation( const Basic3DVector& axis, T phi) : - rot( cos(phi), sin(phi), 0, - -sin(phi), cos(phi), 0, - 0, 0, 1) { - + TkRotation(const Basic3DVector& axis, T phi) : rot(cos(phi), sin(phi), 0, -sin(phi), cos(phi), 0, 0, 0, 1) { //rotation around the z-axis by phi - TkRotation tmpRotz ( cos(axis.phi()), sin(axis.phi()), 0., - -sin(axis.phi()), cos(axis.phi()), 0., - 0., 0., 1. ); + TkRotation tmpRotz(cos(axis.phi()), sin(axis.phi()), 0., -sin(axis.phi()), cos(axis.phi()), 0., 0., 0., 1.); //rotation around y-axis by theta - TkRotation tmpRoty ( cos(axis.theta()), 0.,-sin(axis.theta()), - 0., 1., 0., - sin(axis.theta()), 0., cos(axis.theta()) ); - (*this)*=tmpRoty; - (*this)*=tmpRotz; // = this * tmpRoty * tmpRotz - + TkRotation tmpRoty(cos(axis.theta()), 0., -sin(axis.theta()), 0., 1., 0., sin(axis.theta()), 0., cos(axis.theta())); + (*this) *= tmpRoty; + (*this) *= tmpRotz; // = this * tmpRoty * tmpRotz + // (tmpRoty * tmpRotz)^-1 * this * tmpRoty * tmpRotz - - *this = (tmpRoty*tmpRotz).multiplyInverse(*this); - + + *this = (tmpRoty * tmpRotz).multiplyInverse(*this); } /* this is the same thing...derived from the CLHEP ... it gives the same results MODULO the sign of the rotation.... but I don't want @@ -151,216 +129,150 @@ class TkRotation { } */ - + template - TkRotation( const TkRotation& a) : - rot (a.xx(), a.xy(), a.xz(), - a.yx(), a.yy(), a.yz(), - a.zx(), a.zy(), a.zz()) {} - - TkRotation transposed() const { - return rot.transpose(); - } - - Basic3DVector rotate( const Basic3DVector& v) const { - return rot.rotate(v.v); - } + TkRotation(const TkRotation& a) : rot(a.xx(), a.xy(), a.xz(), a.yx(), a.yy(), a.yz(), a.zx(), a.zy(), a.zz()) {} - Basic3DVector rotateBack( const Basic3DVector& v) const { - return rot.rotateBack(v.v); - } + TkRotation transposed() const { return rot.transpose(); } + Basic3DVector rotate(const Basic3DVector& v) const { return rot.rotate(v.v); } - Basic3DVector operator*( const Basic3DVector& v) const { - return rot.rotate(v.v); - } + Basic3DVector rotateBack(const Basic3DVector& v) const { return rot.rotateBack(v.v); } + + Basic3DVector operator*(const Basic3DVector& v) const { return rot.rotate(v.v); } + + Basic3DVector multiplyInverse(const Basic3DVector& v) const { return rot.rotateBack(v.v); } - Basic3DVector multiplyInverse( const Basic3DVector& v) const { - return rot.rotateBack(v.v); - } - template - Basic3DVector multiplyInverse( const Basic3DVector& v) const { - return Basic3DVector( xx()*v.x() + yx()*v.y() + zx()*v.z(), - xy()*v.x() + yy()*v.y() + zy()*v.z(), - xz()*v.x() + yz()*v.y() + zz()*v.z()); - } - - Basic3DVector operator*( const Basic2DVector& v) const { - return Basic3DVector( xx()*v.x() + xy()*v.y(), - yx()*v.x() + yy()*v.y(), - zx()*v.x() + zy()*v.y()); - } - Basic3DVector multiplyInverse( const Basic2DVector& v) const { - return Basic3DVector( xx()*v.x() + yx()*v.y(), - xy()*v.x() + yy()*v.y(), - xz()*v.x() + yz()*v.y()); - } - - - - TkRotation operator*( const TkRotation& b) const { - return rot*b.rot; + Basic3DVector multiplyInverse(const Basic3DVector& v) const { + return Basic3DVector(xx() * v.x() + yx() * v.y() + zx() * v.z(), + xy() * v.x() + yy() * v.y() + zy() * v.z(), + xz() * v.x() + yz() * v.y() + zz() * v.z()); } - TkRotation multiplyInverse( const TkRotation& b) const { - return rot.transpose()*b.rot; + + Basic3DVector operator*(const Basic2DVector& v) const { + return Basic3DVector(xx() * v.x() + xy() * v.y(), yx() * v.x() + yy() * v.y(), zx() * v.x() + zy() * v.y()); } - - TkRotation& operator*=( const TkRotation& b) { - return *this = operator * (b); + Basic3DVector multiplyInverse(const Basic2DVector& v) const { + return Basic3DVector(xx() * v.x() + yx() * v.y(), xy() * v.x() + yy() * v.y(), xz() * v.x() + yz() * v.y()); } - + + TkRotation operator*(const TkRotation& b) const { return rot * b.rot; } + TkRotation multiplyInverse(const TkRotation& b) const { return rot.transpose() * b.rot; } + + TkRotation& operator*=(const TkRotation& b) { return *this = operator*(b); } + // Note a *= b; <=> a = a * b; while a.transform(b); <=> a = b * a; - TkRotation& transform(const TkRotation& b) { - return *this = b.operator * (*this); - } - - TkRotation & rotateAxes(const Basic3DVector& newX, - const Basic3DVector& newY, - const Basic3DVector& newZ) { + TkRotation& transform(const TkRotation& b) { return *this = b.operator*(*this); } + + TkRotation& rotateAxes(const Basic3DVector& newX, const Basic3DVector& newY, const Basic3DVector& newZ) { T del = 0.001; - + if ( - - // the check for right-handedness is not needed since - // we want to change the handedness when it's left in cmsim - // - // fabs(newZ.x()-w.x()) > del || - // fabs(newZ.y()-w.y()) > del || - // fabs(newZ.z()-w.z()) > del || - fabs(newX.mag2()-1.) > del || - fabs(newY.mag2()-1.) > del || - fabs(newZ.mag2()-1.) > del || - fabs(newX.dot(newY)) > del || - fabs(newY.dot(newZ)) > del || - fabs(newZ.dot(newX)) > del) { + + // the check for right-handedness is not needed since + // we want to change the handedness when it's left in cmsim + // + // fabs(newZ.x()-w.x()) > del || + // fabs(newZ.y()-w.y()) > del || + // fabs(newZ.z()-w.z()) > del || + fabs(newX.mag2() - 1.) > del || fabs(newY.mag2() - 1.) > del || fabs(newZ.mag2() - 1.) > del || + fabs(newX.dot(newY)) > del || fabs(newY.dot(newZ)) > del || fabs(newZ.dot(newX)) > del) { geometryDetails::TkRotationErr2(); return *this; } else { - return transform(TkRotation(newX.x(), newY.x(), newZ.x(), - newX.y(), newY.y(), newZ.y(), - newX.z(), newY.z(), newZ.z())); + return transform( + TkRotation(newX.x(), newY.x(), newZ.x(), newX.y(), newY.y(), newZ.y(), newX.z(), newY.z(), newZ.z())); } } - - - Basic3DVector x() const { return rot.axis[0];} - Basic3DVector y() const { return rot.axis[1];} - Basic3DVector z() const { return rot.axis[2];} - - T xx() const { return rot.axis[0][0];} - T xy() const { return rot.axis[0][1];} - T xz() const { return rot.axis[0][2];} - T yx() const { return rot.axis[1][0];} - T yy() const { return rot.axis[1][1];} - T yz() const { return rot.axis[1][2];} - T zx() const { return rot.axis[2][0];} - T zy() const { return rot.axis[2][1];} - T zz() const { return rot.axis[2][2];} - + + Basic3DVector x() const { return rot.axis[0]; } + Basic3DVector y() const { return rot.axis[1]; } + Basic3DVector z() const { return rot.axis[2]; } + + T xx() const { return rot.axis[0][0]; } + T xy() const { return rot.axis[0][1]; } + T xz() const { return rot.axis[0][2]; } + T yx() const { return rot.axis[1][0]; } + T yy() const { return rot.axis[1][1]; } + T yz() const { return rot.axis[1][2]; } + T zx() const { return rot.axis[2][0]; } + T zy() const { return rot.axis[2][1]; } + T zz() const { return rot.axis[2][2]; } + private: - Rot3 rot; - }; +template <> +std::ostream& operator<<(std::ostream& s, const TkRotation& r); -template<> -std::ostream & operator<< ( std::ostream& s, const TkRotation& r); - -template<> -std::ostream & operator<< ( std::ostream& s, const TkRotation& r); - +template <> +std::ostream& operator<<(std::ostream& s, const TkRotation& r); template -inline Basic3DVector operator*( const TkRotation& r, const Basic3DVector& v) { - return Basic3DVector( r.xx()*v.x() + r.xy()*v.y() + r.xz()*v.z(), - r.yx()*v.x() + r.yy()*v.y() + r.yz()*v.z(), - r.zx()*v.x() + r.zy()*v.y() + r.zz()*v.z()); +inline Basic3DVector operator*(const TkRotation& r, const Basic3DVector& v) { + return Basic3DVector(r.xx() * v.x() + r.xy() * v.y() + r.xz() * v.z(), + r.yx() * v.x() + r.yy() * v.y() + r.yz() * v.z(), + r.zx() * v.x() + r.zy() * v.y() + r.zz() * v.z()); } template -inline TkRotation::Type> -operator*( const TkRotation& a, const TkRotation& b) { - typedef TkRotation::Type> RT; - return RT( a.xx()*b.xx() + a.xy()*b.yx() + a.xz()*b.zx(), - a.xx()*b.xy() + a.xy()*b.yy() + a.xz()*b.zy(), - a.xx()*b.xz() + a.xy()*b.yz() + a.xz()*b.zz(), - a.yx()*b.xx() + a.yy()*b.yx() + a.yz()*b.zx(), - a.yx()*b.xy() + a.yy()*b.yy() + a.yz()*b.zy(), - a.yx()*b.xz() + a.yy()*b.yz() + a.yz()*b.zz(), - a.zx()*b.xx() + a.zy()*b.yx() + a.zz()*b.zx(), - a.zx()*b.xy() + a.zy()*b.yy() + a.zz()*b.zy(), - a.zx()*b.xz() + a.zy()*b.yz() + a.zz()*b.zz()); +inline TkRotation::Type> operator*(const TkRotation& a, const TkRotation& b) { + typedef TkRotation::Type> RT; + return RT(a.xx() * b.xx() + a.xy() * b.yx() + a.xz() * b.zx(), + a.xx() * b.xy() + a.xy() * b.yy() + a.xz() * b.zy(), + a.xx() * b.xz() + a.xy() * b.yz() + a.xz() * b.zz(), + a.yx() * b.xx() + a.yy() * b.yx() + a.yz() * b.zx(), + a.yx() * b.xy() + a.yy() * b.yy() + a.yz() * b.zy(), + a.yx() * b.xz() + a.yy() * b.yz() + a.yz() * b.zz(), + a.zx() * b.xx() + a.zy() * b.yx() + a.zz() * b.zx(), + a.zx() * b.xy() + a.zy() * b.yy() + a.zz() * b.zy(), + a.zx() * b.xz() + a.zy() * b.yz() + a.zz() * b.zz()); } - template class TkRotation2D { public: - typedef Basic2DVector BasicVector; - TkRotation2D( ){} - TkRotation2D( Rot2 const & irot ) : rot(irot){} - - TkRotation2D( T xx, T xy, T yx, T yy) : - rot(xx,xy, yx,yy){} - - TkRotation2D( const T* p) : - rot(p[0],p[1], - p[2],p[3]) {} - - TkRotation2D( const BasicVector & aX) { - - BasicVector uX = aX.unit(); - BasicVector uY(-uX.y(),uX.x()); - - rot.axis[0]= uX.v; - rot.axis[1]= uY.v; - - } + TkRotation2D() {} + TkRotation2D(Rot2 const& irot) : rot(irot) {} - - TkRotation2D( const BasicVector & uX, const BasicVector & uY) { - rot.axis[0]= uX.v; - rot.axis[1]= uY.v; - } - - BasicVector x() const { return rot.axis[0];} - BasicVector y() const { return rot.axis[1];} + TkRotation2D(T xx, T xy, T yx, T yy) : rot(xx, xy, yx, yy) {} + TkRotation2D(const T* p) : rot(p[0], p[1], p[2], p[3]) {} - TkRotation2D transposed() const { - return rot.transpose(); - } - - BasicVector rotate( const BasicVector& v) const { - return rot.rotate(v.v); + TkRotation2D(const BasicVector& aX) { + BasicVector uX = aX.unit(); + BasicVector uY(-uX.y(), uX.x()); + + rot.axis[0] = uX.v; + rot.axis[1] = uY.v; } - BasicVector rotateBack( const BasicVector& v) const { - return rot.rotateBack(v.v); + TkRotation2D(const BasicVector& uX, const BasicVector& uY) { + rot.axis[0] = uX.v; + rot.axis[1] = uY.v; } + BasicVector x() const { return rot.axis[0]; } + BasicVector y() const { return rot.axis[1]; } + TkRotation2D transposed() const { return rot.transpose(); } - private: - - Rot2 rot; - -}; + BasicVector rotate(const BasicVector& v) const { return rot.rotate(v.v); } + BasicVector rotateBack(const BasicVector& v) const { return rot.rotateBack(v.v); } -template<> -std::ostream & operator<< ( std::ostream& s, const TkRotation2D& r); +private: + Rot2 rot; +}; -template<> -std::ostream & operator<< ( std::ostream& s, const TkRotation2D& r); +template <> +std::ostream& operator<<(std::ostream& s, const TkRotation2D& r); +template <> +std::ostream& operator<<(std::ostream& s, const TkRotation2D& r); #endif - - - - diff --git a/DataFormats/GeometrySurface/interface/private/newTkRotation.h b/DataFormats/GeometrySurface/interface/private/newTkRotation.h deleted file mode 100644 index f12a7b1ebe118..0000000000000 --- a/DataFormats/GeometrySurface/interface/private/newTkRotation.h +++ /dev/null @@ -1,366 +0,0 @@ -#ifndef Geom_newTkRotation_H -#define Geom_newTkRotation_H - -#include "DataFormats/GeometryVector/interface/Basic2DVector.h" -#include "DataFormats/GeometryVector/interface/Basic3DVector.h" -#include "DataFormats/GeometryVector/interface/GlobalVector.h" - -#include "DataFormats/Math/interface/SSERot.h" - - -#include - -template class TkRotation; -template class TkRotation2D; - -template -std::ostream & operator<<( std::ostream& s, const TkRotation& r); -template -std::ostream & operator<<( std::ostream& s, const TkRotation2D& r); - -namespace geometryDetails { - void TkRotationErr1(); - void TkRotationErr2(); - -} - - -/** Rotaion matrix used by Surface. - */ - -template -class TkRotation { -public: - - typedef Vector3DBase< T, GlobalTag> GlobalVector; - typedef Basic3DVector BasicVector; - - TkRotation( ){} - TkRotation( mathSSE::Rot3 const & irot ) : rot(irot){} - - TkRotation( T xx, T xy, T xz, T yx, T yy, T yz, T zx, T zy, T zz) : - rot(xx,xy,xz, yx,yy,yz, zx, zy,zz){} - - TkRotation( const T* p) : - rot(p[0],p[1],p[2], - p[3],p[4],p[5], - p[6],p[7],p[8]) {} - - TkRotation( const GlobalVector & aX, const GlobalVector & aY) { - - GlobalVector uX = aX.unit(); - GlobalVector uY = aY.unit(); - GlobalVector uZ(uX.cross(uY)); - - rot.axis[0]= uX.basicVector().v; - rot.axis[1]= uY.basicVector().v; - rot.axis[2]= uZ.basicVector().v; - - } - - TkRotation( const BasicVector & aX, const BasicVector & aY) { - - BasicVector uX = aX.unit(); - BasicVector uY = aY.unit(); - BasicVector uZ(uX.cross(uY)); - - rot.axis[0]= uX.v; - rot.axis[1]= uY.v; - rot.axis[2]= uZ.v; - - } - - - /** Construct from global vectors of the x, y and z axes. - * The axes are assumed to be unit vectors forming - * a right-handed orthonormal basis. No checks are performed! - */ - TkRotation( const GlobalVector & uX, const GlobalVector & uY, - const GlobalVector & uZ) { - rot.axis[0]= uX.basicVector().v; - rot.axis[1]= uY.basicVector().v; - rot.axis[2]= uZ.basicVector().v; - } - - TkRotation( const BasicVector & uX, const BasicVector & uY, - const BasicVector & uZ) { - rot.axis[0]= uX.v; - rot.axis[1]= uY.v; - rot.axis[2]= uZ.v; - } - - - /** rotation around abritrary axis by the amount of phi: - * its constructed by O^-1(z<->axis) rot_z(phi) O(z<->axis) - * the frame is rotated such that the z-asis corresponds to the rotation - * axis desired. THen it's rotated round the "new" z-axis, and then - * the initial transformation is "taken back" again. - * unfortuately I'm too stupid to describe such thing directly by 3 Euler - * angles.. hence I have to construckt it this way...by brute force - */ - TkRotation( const Basic3DVector& axis, T phi) : - rot( cos(phi), sin(phi), 0, - -sin(phi), cos(phi), 0, - 0, 0, 1) { - - //rotation around the z-axis by phi - TkRotation tmpRotz ( cos(axis.phi()), sin(axis.phi()), 0., - -sin(axis.phi()), cos(axis.phi()), 0., - 0., 0., 1. ); - //rotation around y-axis by theta - TkRotation tmpRoty ( cos(axis.theta()), 0.,-sin(axis.theta()), - 0., 1., 0., - sin(axis.theta()), 0., cos(axis.theta()) ); - (*this)*=tmpRoty; - (*this)*=tmpRotz; // = this * tmpRoty * tmpRotz - - // (tmpRoty * tmpRotz)^-1 * this * tmpRoty * tmpRotz - - *this = (tmpRoty*tmpRotz).multiplyInverse(*this); - - } - /* this is the same thing...derived from the CLHEP ... it gives the - same results MODULO the sign of the rotation.... but I don't want - that... had - TkRotation (const Basic3DVector& axis, float phi) { - T cx = axis.x(); - T cy = axis.y(); - T cz = axis.z(); - - T ll = axis.mag(); - if (ll == 0) { - geometryDetails::TkRotationErr1(); - }else{ - - float cosa = cos(phi), sina = sin(phi); - cx /= ll; cy /= ll; cz /= ll; - - R11 = cosa + (1-cosa)*cx*cx; - R12 = (1-cosa)*cx*cy - sina*cz; - R13 = (1-cosa)*cx*cz + sina*cy; - - R21 = (1-cosa)*cy*cx + sina*cz; - R22 = cosa + (1-cosa)*cy*cy; - R23 = (1-cosa)*cy*cz - sina*cx; - - R31 = (1-cosa)*cz*cx - sina*cy; - R32 = (1-cosa)*cz*cy + sina*cx; - R33 = cosa + (1-cosa)*cz*cz; - - } - - } - */ - - template - TkRotation( const TkRotation& a) : - rot (a.xx(), a.xy(), a.xz(), - a.yx(), a.yy(), a.yz(), - a.zx(), a.zy(), a.zz()) {} - - TkRotation transposed() const { - return rot.transpose(); - } - - Basic3DVector rotate( const Basic3DVector& v) const { - return rot.rotate(v.v); - } - - Basic3DVector rotateBack( const Basic3DVector& v) const { - return rot.rotateBack(v.v); - } - - - Basic3DVector operator*( const Basic3DVector& v) const { - return rot.rotate(v.v); - } - - Basic3DVector multiplyInverse( const Basic3DVector& v) const { - return rot.rotateBack(v.v); - } - - template - Basic3DVector multiplyInverse( const Basic3DVector& v) const { - return Basic3DVector( xx()*v.x() + yx()*v.y() + zx()*v.z(), - xy()*v.x() + yy()*v.y() + zy()*v.z(), - xz()*v.x() + yz()*v.y() + zz()*v.z()); - } - - Basic3DVector operator*( const Basic2DVector& v) const { - return Basic3DVector( xx()*v.x() + xy()*v.y(), - yx()*v.x() + yy()*v.y(), - zx()*v.x() + zy()*v.y()); - } - Basic3DVector multiplyInverse( const Basic2DVector& v) const { - return Basic3DVector( xx()*v.x() + yx()*v.y(), - xy()*v.x() + yy()*v.y(), - xz()*v.x() + yz()*v.y()); - } - - - - TkRotation operator*( const TkRotation& b) const { - return rot*b.rot; - } - TkRotation multiplyInverse( const TkRotation& b) const { - return rot.transpose()*b.rot; - } - - TkRotation& operator*=( const TkRotation& b) { - return *this = operator * (b); - } - - // Note a *= b; <=> a = a * b; while a.transform(b); <=> a = b * a; - TkRotation& transform(const TkRotation& b) { - return *this = b.operator * (*this); - } - - TkRotation & rotateAxes(const Basic3DVector& newX, - const Basic3DVector& newY, - const Basic3DVector& newZ) { - T del = 0.001; - - if ( - - // the check for right-handedness is not needed since - // we want to change the handedness when it's left in cmsim - // - // fabs(newZ.x()-w.x()) > del || - // fabs(newZ.y()-w.y()) > del || - // fabs(newZ.z()-w.z()) > del || - fabs(newX.mag2()-1.) > del || - fabs(newY.mag2()-1.) > del || - fabs(newZ.mag2()-1.) > del || - fabs(newX.dot(newY)) > del || - fabs(newY.dot(newZ)) > del || - fabs(newZ.dot(newX)) > del) { - geometryDetails::TkRotationErr2(); - return *this; - } else { - return transform(TkRotation(newX.x(), newY.x(), newZ.x(), - newX.y(), newY.y(), newZ.y(), - newX.z(), newY.z(), newZ.z())); - } - } - - - Basic3DVector x() const { return rot.axis[0];} - Basic3DVector y() const { return rot.axis[1];} - Basic3DVector z() const { return rot.axis[2];} - - T xx() const { return rot.axis[0].arr[0];} - T xy() const { return rot.axis[0].arr[1];} - T xz() const { return rot.axis[0].arr[2];} - T yx() const { return rot.axis[1].arr[0];} - T yy() const { return rot.axis[1].arr[1];} - T yz() const { return rot.axis[1].arr[2];} - T zx() const { return rot.axis[2].arr[0];} - T zy() const { return rot.axis[2].arr[1];} - T zz() const { return rot.axis[2].arr[2];} - -private: - - mathSSE::Rot3 rot; - -}; - - -template<> -std::ostream & operator<< ( std::ostream& s, const TkRotation& r); - -template<> -std::ostream & operator<< ( std::ostream& s, const TkRotation& r); - - -template -inline Basic3DVector operator*( const TkRotation& r, const Basic3DVector& v) { - return Basic3DVector( r.xx()*v.x() + r.xy()*v.y() + r.xz()*v.z(), - r.yx()*v.x() + r.yy()*v.y() + r.yz()*v.z(), - r.zx()*v.x() + r.zy()*v.y() + r.zz()*v.z()); -} - -template -inline TkRotation::Type> -operator*( const TkRotation& a, const TkRotation& b) { - typedef TkRotation::Type> RT; - return RT( a.xx()*b.xx() + a.xy()*b.yx() + a.xz()*b.zx(), - a.xx()*b.xy() + a.xy()*b.yy() + a.xz()*b.zy(), - a.xx()*b.xz() + a.xy()*b.yz() + a.xz()*b.zz(), - a.yx()*b.xx() + a.yy()*b.yx() + a.yz()*b.zx(), - a.yx()*b.xy() + a.yy()*b.yy() + a.yz()*b.zy(), - a.yx()*b.xz() + a.yy()*b.yz() + a.yz()*b.zz(), - a.zx()*b.xx() + a.zy()*b.yx() + a.zz()*b.zx(), - a.zx()*b.xy() + a.zy()*b.yy() + a.zz()*b.zy(), - a.zx()*b.xz() + a.zy()*b.yz() + a.zz()*b.zz()); -} - - -template -class TkRotation2D { -public: - - typedef Basic2DVector BasicVector; - - TkRotation2D( ){} - TkRotation2D( mathSSE::Rot2 const & irot ) : rot(irot){} - - TkRotation2D( T xx, T xy, T yx, T yy) : - rot(xx,xy, yx,yy){} - - TkRotation2D( const T* p) : - rot(p[0],p[1], - p[2],p[3]) {} - - TkRotation2D( const BasicVector & aX) { - - BasicVector uX = aX.unit(); - BasicVector uY(-uX.y(),uX.x()); - - rot.axis[0]= uX.v; - rot.axis[1]= uY.v; - - } - - - TkRotation2D( const BasicVector & uX, const BasicVector & uY) { - rot.axis[0]= uX.v; - rot.axis[1]= uY.v; - } - - BasicVector x() const { return rot.axis[0];} - BasicVector y() const { return rot.axis[1];} - - - TkRotation2D transposed() const { - return rot.transpose(); - } - - BasicVector rotate( const BasicVector& v) const { - return rot.rotate(v.v); - } - - BasicVector rotateBack( const BasicVector& v) const { - return rot.rotateBack(v.v); - } - - - - private: - - mathSSE::Rot2 rot; - -}; - - -template<> -std::ostream & operator<< ( std::ostream& s, const TkRotation2D& r); - -template<> -std::ostream & operator<< ( std::ostream& s, const TkRotation2D& r); - - -#endif - - - - diff --git a/DataFormats/GeometryVector/interface/OnePiRange.h b/DataFormats/GeometryVector/interface/OnePiRange.h deleted file mode 100644 index 1983da64af506..0000000000000 --- a/DataFormats/GeometryVector/interface/OnePiRange.h +++ /dev/null @@ -1,133 +0,0 @@ -#ifndef GeometryVector_Geom_OnePiRange_h -#define GeometryVector_Geom_OnePiRange_h - -#include -#include - -namespace Geom { - -/** \class OnePiRange - * A class for polar angle represantation. - * The use of OnePiRange is tranparant due to the implicit conversion to T - * Constructs like cos(theta) work as with float or double. - * The difference with respect to built-in types is that - * OnePiRange is kept in the range [0, pi], and this is consistently - * implemented in aritmetic operations. In other words, OnePiRange implements - * "modulo(pi)" arithmetics. - */ - - template - class OnePiRange { - public: - - /// Default constructor does not initialise - just as double. - OnePiRange() {} - - /// Constructor from T, does not provide automatic conversion. - explicit OnePiRange( const T& val) : theValue(val) { normalize(); } - - /// conversion operator makes transparent use possible. - operator T() const { return theValue;} - - /// Template argument conversion - template operator OnePiRange() { return OnePiRange(theValue);} - - /// Explicit access to value in case implicit conversion not OK - T value() const { return theValue;} - - // Standard arithmetics - OnePiRange& operator+=(const T& a) {theValue+=a; normalize(); return *this;} - OnePiRange& operator+=(const OnePiRange& a) {return operator+=(a.value());} - - OnePiRange& operator-=(const T& a) {theValue-=a; normalize(); return *this;} - OnePiRange& operator-=(const OnePiRange& a) {return operator-=(a.value());} - - OnePiRange& operator*=(const T& a) {theValue*=a; normalize(); return *this;} - - OnePiRange& operator/=(const T& a) {theValue/=a; normalize(); return *this;} - - T degrees() const { return theValue*180./pi();} - - /// Return the pseudorapidity. - // No need to handle 0 or pi; in this case "inf" is returned. - T eta() const { return -log(tan(theValue/2.)); } - - - private: - - T theValue; - - void normalize() { - if( theValue > (T) pi() || theValue < 0) { - theValue = fmod( theValue, (T) pi()); - } - if (theValue < 0.) theValue += pi(); - } - - }; - - /// - operator - template - inline OnePiRange operator-(const OnePiRange& a) {return OnePiRange(-a.value());} - - - /// Addition - template - inline OnePiRange operator+(const OnePiRange& a, const OnePiRange& b) { - return OnePiRange(a) += b; - } - /// Addition with scalar, does not change the precision - template - inline OnePiRange operator+(const OnePiRange& a, const Scalar& b) { - return OnePiRange(a) += b; - } - /// Addition with scalar, does not change the precision - template - inline OnePiRange operator+(const Scalar& a, const OnePiRange& b) { - return OnePiRange(b) += a; - } - - /// Subtraction - template - inline OnePiRange operator-(const OnePiRange& a, const OnePiRange& b) { - return OnePiRange(a) -= b; - } - - /// Subtraction with scalar, does not change the precision - template - inline OnePiRange operator-(const OnePiRange& a, const Scalar& b) { - return OnePiRange(a) -= b; - } - - /// Subtraction with scalar, does not change the precision - template - inline OnePiRange operator-(const Scalar& a, const OnePiRange& b) { - return OnePiRange(a - b.value()); // use of unary operators would normalize twice - } - - /// Multiplication with scalar, does not change the precision - template - inline OnePiRange operator*(const OnePiRange& a, const Scalar& b) { - return OnePiRange(a) *= b; - } - - /// Multiplication with scalar - template - inline OnePiRange operator*(double a, const OnePiRange& b) { - return OnePiRange(b) *= a; - } - - /// Division - template - inline T operator/(const OnePiRange& a, const OnePiRange& b) { - return a.value() / b.value(); - } - - /// Division by scalar - template - inline OnePiRange operator/(const OnePiRange& a, double b) { - return OnePiRange(a) /= b; - } - -} -#endif diff --git a/DataFormats/GeometryVector/interface/private/extBasic2DVector.h b/DataFormats/GeometryVector/interface/private/extBasic2DVector.h index 7d6a871576de7..68e6c69d56d81 100644 --- a/DataFormats/GeometryVector/interface/private/extBasic2DVector.h +++ b/DataFormats/GeometryVector/interface/private/extBasic2DVector.h @@ -6,32 +6,28 @@ #include "DataFormats/GeometryVector/interface/CoordinateSets.h" #include "DataFormats/Math/interface/ExtVec.h" - #include #include - -template < class T> +template class Basic2DVector { public: - - typedef T ScalarType; + typedef T ScalarType; typedef Vec2 VectorType; typedef Vec2 MathVector; - typedef Geom::Polar2Cartesian Polar; + typedef Geom::Polar2Cartesian Polar; /** default constructor uses default constructor of T to initialize the * components. For built-in floating-point types this means initialization * to zero */ - Basic2DVector() : v{0,0} {} + Basic2DVector() : v{0, 0} {} /// Copy constructor from same type. Should not be needed but for gcc bug 12685 - Basic2DVector( const Basic2DVector & p) : v(p.v) {} - - template - Basic2DVector( const Basic2DVector & p) : v{T(p.v[0]),T(p.v[1])} {} + Basic2DVector(const Basic2DVector& p) : v(p.v) {} + template + Basic2DVector(const Basic2DVector& p) : v{T(p.v[0]), T(p.v[1])} {} /** Explicit constructor from other (possibly unrelated) vector classes * The only constraint on the argument type is that it has methods @@ -40,47 +36,46 @@ class Basic2DVector { *
construction from a Basic2DVector with different precision *
construction from a coordinate system converter */ - template - explicit Basic2DVector( const Other& p) : v{T(p.x()),T(p.y())} {} + template + explicit Basic2DVector(const Other& p) : v{T(p.x()), T(p.y())} {} /// construct from cartesian coordinates - Basic2DVector( const T& x, const T& y) : v{x,y} {} + Basic2DVector(const T& x, const T& y) : v{x, y} {} // constructor from Vec2 or vec4 - Basic2DVector(MathVector const& iv) : v(iv){} - template - Basic2DVector(Vec2 const& iv) : v{iv[0],iv[1]}{} - template - Basic2DVector(Vec4 const& iv) : v{iv[0],iv[1]}{} - - MathVector const & mathVector() const { return v;} - MathVector & mathVector() { return v;} + Basic2DVector(MathVector const& iv) : v(iv) {} + template + Basic2DVector(Vec2 const& iv) : v{iv[0], iv[1]} {} + template + Basic2DVector(Vec4 const& iv) : v{iv[0], iv[1]} {} - T operator[](int i) const { return v[i];} - T & operator[](int i) { return v[i];} + MathVector const& mathVector() const { return v; } + MathVector& mathVector() { return v; } + T operator[](int i) const { return v[i]; } + T& operator[](int i) { return v[i]; } /// Cartesian x coordinate - T x() const { return v[0];} + T x() const { return v[0]; } /// Cartesian y coordinate - T y() const { return v[1];} + T y() const { return v[1]; } /// The vector magnitude squared. Equivalent to vec.dot(vec) - T mag2() const { return ::dot(v,v);} + T mag2() const { return ::dot(v, v); } /// The vector magnitude. Equivalent to sqrt(vec.mag2()) - T mag() const { return std::sqrt( mag2());} + T mag() const { return std::sqrt(mag2()); } /// Radius, same as mag() - T r() const { return mag();} + T r() const { return mag(); } /** Azimuthal angle. The value is returned in radians, in the range (-pi,pi]. * Same precision as the system atan2(x,y) function. * The return type is Geom::Phi, see it's documentation. - */ - T barePhi() const {return std::atan2(y(),x());} - Geom::Phi phi() const {return Geom::Phi(atan2(y(),x()));} + */ + T barePhi() const { return std::atan2(y(), x()); } + Geom::Phi phi() const { return Geom::Phi(atan2(y(), x())); } /** Unit vector parallel to this. * If mag() is zero, a zero vector is returned. @@ -92,154 +87,140 @@ class Basic2DVector { /** Operator += with a Basic2DVector of possibly different precision. */ - template - Basic2DVector& operator+= ( const Basic2DVector& p) { + template + Basic2DVector& operator+=(const Basic2DVector& p) { v = v + p.v; return *this; - } + } /** Operator -= with a Basic2DVector of possibly different precision. */ - template - Basic2DVector& operator-= ( const Basic2DVector& p) { + template + Basic2DVector& operator-=(const Basic2DVector& p) { v = v - p.v; return *this; - } + } /// Unary minus, returns a vector with components (-x(),-y(),-z()) - Basic2DVector operator-() const { return Basic2DVector(-v);} + Basic2DVector operator-() const { return Basic2DVector(-v); } /// Scaling by a scalar value (multiplication) - Basic2DVector& operator*= ( T t) { - v = v*t; + Basic2DVector& operator*=(T t) { + v = v * t; return *this; - } + } /// Scaling by a scalar value (division) - Basic2DVector& operator/= ( T t) { - t = T(1)/t; - v = v*t; + Basic2DVector& operator/=(T t) { + t = T(1) / t; + v = v * t; return *this; - } + } /// Scalar product, or "dot" product, with a vector of same type. - T dot( const Basic2DVector& lh) const { return ::dot(v,lh.v);} + T dot(const Basic2DVector& lh) const { return ::dot(v, lh.v); } /** Scalar (or dot) product with a vector of different precision. * The product is computed without loss of precision. The type * of the returned scalar is the more precise of the scalar types * of the two vectors. */ - template - typename PreciseFloatType::Type dot( const Basic2DVector& lh) const { - return Basic2DVector::Type>(*this) - .dot(Basic2DVector::Type>(lh)); + template + typename PreciseFloatType::Type dot(const Basic2DVector& lh) const { + return Basic2DVector::Type>(*this).dot( + Basic2DVector::Type>(lh)); } /// Vector product, or "cross" product, with a vector of same type. - T cross( const Basic2DVector& lh) const { return ::cross2(v,lh.v);} + T cross(const Basic2DVector& lh) const { return ::cross2(v, lh.v); } /** Vector (or cross) product with a vector of different precision. * The product is computed without loss of precision. The type * of the returned scalar is the more precise of the scalar types * of the two vectors. */ - template - typename PreciseFloatType::Type cross( const Basic2DVector& lh) const { - return Basic2DVector::Type>(*this) - .cross(Basic2DVector::Type>(lh)); + template + typename PreciseFloatType::Type cross(const Basic2DVector& lh) const { + return Basic2DVector::Type>(*this).cross( + Basic2DVector::Type>(lh)); } - public: - Vec2 v; - }; - namespace geometryDetails { - std::ostream & print2D(std::ostream& s, double x, double y); + std::ostream& print2D(std::ostream& s, double x, double y); } /// simple text output to standard streams template -inline std::ostream & operator<<( std::ostream& s, const Basic2DVector& v) { - return geometryDetails::print2D(s, v.x(),v.y()); +inline std::ostream& operator<<(std::ostream& s, const Basic2DVector& v) { + return geometryDetails::print2D(s, v.x(), v.y()); } - /// vector sum and subtraction of vectors of possibly different precision template -inline Basic2DVector -operator+( const Basic2DVector& a, const Basic2DVector& b) { - return a.v+b.v; +inline Basic2DVector operator+(const Basic2DVector& a, const Basic2DVector& b) { + return a.v + b.v; } template -inline Basic2DVector -operator-( const Basic2DVector& a, const Basic2DVector& b) { - return a.v-b.v; +inline Basic2DVector operator-(const Basic2DVector& a, const Basic2DVector& b) { + return a.v - b.v; } template -inline Basic2DVector::Type> -operator+( const Basic2DVector& a, const Basic2DVector& b) { - typedef Basic2DVector::Type> RT; +inline Basic2DVector::Type> operator+(const Basic2DVector& a, + const Basic2DVector& b) { + typedef Basic2DVector::Type> RT; return RT(a) + RT(b); } template -inline Basic2DVector::Type> -operator-( const Basic2DVector& a, const Basic2DVector& b) { - typedef Basic2DVector::Type> RT; - return RT(a)-RT(b); +inline Basic2DVector::Type> operator-(const Basic2DVector& a, + const Basic2DVector& b) { + typedef Basic2DVector::Type> RT; + return RT(a) - RT(b); } - - - // scalar product of vectors of same precision template -inline T operator*( const Basic2DVector& v1, const Basic2DVector& v2) { +inline T operator*(const Basic2DVector& v1, const Basic2DVector& v2) { return v1.dot(v2); } /// scalar product of vectors of different precision template -inline typename PreciseFloatType::Type operator*( const Basic2DVector& v1, - const Basic2DVector& v2) { +inline typename PreciseFloatType::Type operator*(const Basic2DVector& v1, const Basic2DVector& v2) { return v1.dot(v2); } - /** Multiplication by scalar, does not change the precision of the vector. * The return type is the same as the type of the vector argument. */ template -inline Basic2DVector operator*( const Basic2DVector& v, T t) { - return v.v*t; +inline Basic2DVector operator*(const Basic2DVector& v, T t) { + return v.v * t; } /// Same as operator*( Vector, Scalar) template inline Basic2DVector operator*(T t, const Basic2DVector& v) { - return v.v*t; + return v.v * t; } - - template -inline Basic2DVector operator*( const Basic2DVector& v, const Scalar& s) { +inline Basic2DVector operator*(const Basic2DVector& v, const Scalar& s) { T t = static_cast(s); - return v*t; + return v * t; } /// Same as operator*( Vector, Scalar) template -inline Basic2DVector operator*( const Scalar& s, const Basic2DVector& v) { +inline Basic2DVector operator*(const Scalar& s, const Basic2DVector& v) { T t = static_cast(s); - return v*t; + return v * t; } /** Division by scalar, does not change the precision of the vector. @@ -247,18 +228,17 @@ inline Basic2DVector operator*( const Scalar& s, const Basic2DVector& v) { */ template inline Basic2DVector operator/(const Basic2DVector& v, T t) { - return v.v/t; + return v.v / t; } template -inline Basic2DVector operator/( const Basic2DVector& v, const Scalar& s) { +inline Basic2DVector operator/(const Basic2DVector& v, const Scalar& s) { // T t = static_cast(Scalar(1)/s); return v*t; - T t = static_cast(s); - return v/t; + T t = static_cast(s); + return v / t; } typedef Basic2DVector Basic2DVectorF; typedef Basic2DVector Basic2DVectorD; - -#endif // GeometryVector_Basic2DVector_h +#endif // GeometryVector_Basic2DVector_h diff --git a/DataFormats/HGCalReco/interface/Trackster.h b/DataFormats/HGCalReco/interface/Trackster.h index 2067ac2151d80..c0eab45d9bc3a 100644 --- a/DataFormats/HGCalReco/interface/Trackster.h +++ b/DataFormats/HGCalReco/interface/Trackster.h @@ -37,7 +37,8 @@ namespace ticl { enum class PCAOrdering { ascending = 0, descending }; Trackster() - : seedIndex_(0), + : iterationIndex_(0), + seedIndex_(0), time_(0.f), timeError_(-1.f), regressed_energy_(0.f), diff --git a/DataFormats/HcalCalibObjects/interface/HcalHBHEMuonVariables.h b/DataFormats/HcalCalibObjects/interface/HcalHBHEMuonVariables.h new file mode 100644 index 0000000000000..d165b1842cc0e --- /dev/null +++ b/DataFormats/HcalCalibObjects/interface/HcalHBHEMuonVariables.h @@ -0,0 +1,77 @@ +#ifndef DataFormatsHcalCalibObjectsHcalHBHEMuonVariables_h +#define DataFormatsHcalCalibObjectsHcalHBHEMuonVariables_h +#include +#include + +class HcalHBHEMuonVariables { +public: + HcalHBHEMuonVariables() { clear(); } + + void clear() { + runNumber_ = eventNumber_ = lumiNumber_ = bxNumber_ = goodVertex_ = 0; + muonGood_ = muonGlobal_ = muonTracker_ = muonTight_ = muonMedium_ = false; + ptGlob_ = etaGlob_ = phiGlob_ = energyMuon_ = pMuon_ = 0; + muonTrkKink_ = muonChi2LocalPosition_ = muonSegComp_ = 0; + trackerLayer_ = numPixelLayers_ = tightPixelHits_ = 0; + innerTrack_ = outerTrack_ = globalTrack_ = false; + chiTracker_ = dxyTracker_ = dzTracker_ = 0; + innerTrackPt_ = innerTrackEta_ = innerTrackPhi_ = 0; + outerTrackHits_ = outerTrackRHits_ = 0; + outerTrackPt_ = outerTrackEta_ = outerTrackPhi_ = outerTrackChi_ = 0; + globalMuonHits_ = matchedStat_ = 0; + globalTrackPt_ = globalTrackEta_ = globalTrackPhi_ = chiGlobal_ = 0; + tightValidFraction_ = tightLongPara_ = tightTransImpara_ = 0; + isolationR04_ = isolationR03_ = 0; + ecalDetId_ = 0; + ecalEnergy_ = ecal3x3Energy_ = 0; + hcalDetId_ = ehcalDetId_ = 0; + matchedId_ = hcalHot_ = false; + hcalIeta_ = hcalIphi_ = 0; + hcalEnergy_ = hoEnergy_ = hcal1x1Energy_ = 0; + hcalDepthEnergy_.clear(); + hcalDepthActiveLength_.clear(); + hcalDepthEnergyHot_.clear(); + hcalDepthActiveLengthHot_.clear(); + hcalDepthChargeHot_.clear(); + hcalDepthChargeHotBG_.clear(); + hcalDepthEnergyCorr_.clear(); + hcalDepthEnergyHotCorr_.clear(); + hcalDepthMatch_.clear(); + hcalDepthMatchHot_.clear(); + hcalActiveLength_ = hcalActiveLengthHot_ = 0; + allTriggers_.clear(); + hltResults_.clear(); + } + + unsigned int runNumber_, eventNumber_, lumiNumber_, bxNumber_, goodVertex_; + bool muonGood_, muonGlobal_, muonTracker_, muonTight_, muonMedium_; + float ptGlob_, etaGlob_, phiGlob_, energyMuon_, pMuon_; + float muonTrkKink_, muonChi2LocalPosition_, muonSegComp_; + int trackerLayer_, numPixelLayers_, tightPixelHits_; + bool innerTrack_, outerTrack_, globalTrack_; + float chiTracker_, dxyTracker_, dzTracker_; + float innerTrackPt_, innerTrackEta_, innerTrackPhi_; + int outerTrackHits_, outerTrackRHits_; + float outerTrackPt_, outerTrackEta_, outerTrackPhi_, outerTrackChi_; + int globalMuonHits_, matchedStat_; + float globalTrackPt_, globalTrackEta_, globalTrackPhi_, chiGlobal_; + float tightValidFraction_, tightLongPara_, tightTransImpara_; + float isolationR04_, isolationR03_; + unsigned int ecalDetId_; + float ecalEnergy_, ecal3x3Energy_; + unsigned int hcalDetId_, ehcalDetId_; + bool matchedId_, hcalHot_; + int hcalIeta_, hcalIphi_; + float hcalEnergy_, hoEnergy_, hcal1x1Energy_; + std::vector hcalDepthEnergy_, hcalDepthActiveLength_; + std::vector hcalDepthEnergyHot_, hcalDepthActiveLengthHot_; + std::vector hcalDepthChargeHot_, hcalDepthChargeHotBG_; + std::vector hcalDepthEnergyCorr_, hcalDepthEnergyHotCorr_; + std::vector hcalDepthMatch_, hcalDepthMatchHot_; + float hcalActiveLength_, hcalActiveLengthHot_; + std::vector allTriggers_; + std::vector hltResults_; +}; + +typedef std::vector HcalHBHEMuonVariablesCollection; +#endif diff --git a/DataFormats/HcalCalibObjects/interface/HcalIsoTrkCalibVariables.h b/DataFormats/HcalCalibObjects/interface/HcalIsoTrkCalibVariables.h new file mode 100644 index 0000000000000..166ad2c17490e --- /dev/null +++ b/DataFormats/HcalCalibObjects/interface/HcalIsoTrkCalibVariables.h @@ -0,0 +1,58 @@ +#ifndef DataFormatsHcalCalibObjectsHcalIsoTrkCalibVariables_h +#define DataFormatsHcalCalibObjectsHcalIsoTrkCalibVariables_h +#include +#include + +class HcalIsoTrkCalibVariables { +public: + HcalIsoTrkCalibVariables() { clear(); } + + void clear() { + eventWeight_ = rhoh_ = 0; + nVtx_ = goodPV_ = nTrk_ = 0; + trgbits_.clear(); + mindR1_ = l1pt_ = l1eta_ = l1phi_ = 0; + mindR2_ = l3pt_ = l3eta_ = l3phi_ = 0; + p_ = pt_ = phi_ = gentrackP_ = 0; + ieta_ = iphi_ = 0; + eMipDR_.clear(); + eHcal_ = eHcal10_ = eHcal30_ = 0; + eHcalRaw_ = eHcal10Raw_ = eHcal30Raw_ = 0; + eHcalAux_ = eHcal10Aux_ = eHcal30Aux_ = 0; + emaxNearP_ = eAnnular_ = hmaxNearP_ = hAnnular_ = 0; + selectTk_ = qltyFlag_ = qltyMissFlag_ = qltyPVFlag_ = false; + detIds_.clear(); + hitEnergies_.clear(); + hitEnergiesRaw_.clear(); + hitEnergiesAux_.clear(); + detIds1_.clear(); + hitEnergies1_.clear(); + hitEnergies1Raw_.clear(); + hitEnergies1Aux_.clear(); + detIds3_.clear(); + hitEnergies3_.clear(); + hitEnergies3Raw_.clear(); + hitEnergies3Aux_.clear(); + }; + + double eventWeight_, rhoh_; + int goodPV_, nVtx_, nTrk_; + std::vector trgbits_; + double mindR1_, l1pt_, l1eta_, l1phi_; + double mindR2_, l3pt_, l3eta_, l3phi_; + double p_, pt_, phi_, gentrackP_; + int ieta_, iphi_; + std::vector eMipDR_; + double eHcal_, eHcal10_, eHcal30_; + double eHcalRaw_, eHcal10Raw_, eHcal30Raw_; + double eHcalAux_, eHcal10Aux_, eHcal30Aux_; + double emaxNearP_, eAnnular_, hmaxNearP_, hAnnular_; + bool selectTk_, qltyFlag_, qltyMissFlag_, qltyPVFlag_; + std::vector detIds_, detIds1_, detIds3_; + std::vector hitEnergies_, hitEnergies1_, hitEnergies3_; + std::vector hitEnergiesRaw_, hitEnergies1Raw_, hitEnergies3Raw_; + std::vector hitEnergiesAux_, hitEnergies1Aux_, hitEnergies3Aux_; +}; + +typedef std::vector HcalIsoTrkCalibVariablesCollection; +#endif diff --git a/DataFormats/HcalCalibObjects/interface/HcalIsoTrkEventVariables.h b/DataFormats/HcalCalibObjects/interface/HcalIsoTrkEventVariables.h new file mode 100644 index 0000000000000..45ebd0366b174 --- /dev/null +++ b/DataFormats/HcalCalibObjects/interface/HcalIsoTrkEventVariables.h @@ -0,0 +1,28 @@ +#ifndef DataFormatsHcalCalibObjectsHcalIsoTrkEventVariables_h +#define DataFormatsHcalCalibObjectsHcalIsoTrkEventVariables_h +#include +#include + +class HcalIsoTrkEventVariables { +public: + HcalIsoTrkEventVariables() { clear(); } + + void clear() { + allvertex_ = 0; + tracks_ = tracksProp_ = tracksSaved_ = tracksLoose_ = tracksTight_ = 0; + l1Bit_ = trigPass_ = trigPassSel_ = false; + hltbits_.clear(); + ietaAll_.clear(); + ietaGood_.clear(); + trackType_.clear(); + }; + + int allvertex_, tracks_, tracksProp_, tracksSaved_; + int tracksLoose_, tracksTight_; + bool l1Bit_, trigPass_, trigPassSel_; + std::vector ietaAll_, ietaGood_, trackType_; + std::vector hltbits_; +}; + +typedef std::vector HcalIsoTrkEventVariablesCollection; +#endif diff --git a/DataFormats/HcalCalibObjects/src/classes.h b/DataFormats/HcalCalibObjects/src/classes.h index 943be3caafd82..875004e6e635e 100644 --- a/DataFormats/HcalCalibObjects/src/classes.h +++ b/DataFormats/HcalCalibObjects/src/classes.h @@ -1,3 +1,5 @@ #include "DataFormats/HcalCalibObjects/interface/HOCalibVariables.h" -// #include "DataFormats/HOCalibHit/interface/HOCalibVariableCollection.h" +#include "DataFormats/HcalCalibObjects/interface/HcalHBHEMuonVariables.h" +#include "DataFormats/HcalCalibObjects/interface/HcalIsoTrkCalibVariables.h" +#include "DataFormats/HcalCalibObjects/interface/HcalIsoTrkEventVariables.h" #include "DataFormats/Common/interface/Wrapper.h" diff --git a/DataFormats/HcalCalibObjects/src/classes_def.xml b/DataFormats/HcalCalibObjects/src/classes_def.xml index 135e27786a254..423d725be6e2d 100644 --- a/DataFormats/HcalCalibObjects/src/classes_def.xml +++ b/DataFormats/HcalCalibObjects/src/classes_def.xml @@ -4,4 +4,22 @@ + + + + + + + + + + + + + + + + + + diff --git a/DataFormats/Histograms/interface/MonitorElementCollection.h b/DataFormats/Histograms/interface/MonitorElementCollection.h index 2d65ddb35ef15..0e86719a96c20 100644 --- a/DataFormats/Histograms/interface/MonitorElementCollection.h +++ b/DataFormats/Histograms/interface/MonitorElementCollection.h @@ -36,7 +36,6 @@ #include #include #include -#include #include "TH1.h" @@ -179,36 +178,63 @@ struct MonitorElementData { // Type of string `path` could be just directory name, or // directory name followed by the name of the monitor element void set(std::string path, Path::Type type) { - std::string in(path); - std::vector buf; - static std::regex const dir("^/*([^/]+)"); - std::smatch m; - - while (std::regex_search(in, m, dir)) { - if (m[1] == "..") { - if (!buf.empty()) { - buf.pop_back(); + //rebuild 'path' to be in canonical form + + //remove any leading '/' + while (not path.empty() and path.front() == '/') { + path.erase(path.begin()); + } + + //handle '..' and '//' + // the 'dir' tokens are separate by a single '/' + std::string::size_type tokenStartPos = 0; + while (tokenStartPos < path.size()) { + auto tokenEndPos = path.find('/', tokenStartPos); + if (tokenEndPos == std::string::npos) { + tokenEndPos = path.size(); + } + if (0 == tokenEndPos - tokenStartPos) { + //we are sitting on a '/' + path.erase(path.begin() + tokenStartPos); + continue; + } else if (2 == tokenEndPos - tokenStartPos) { + if (path[tokenStartPos] == '.' and path[tokenStartPos + 1] == '.') { + //need to go backwards and remove previous directory + auto endOfLastToken = tokenStartPos; + if (tokenStartPos > 1) { + endOfLastToken -= 2; + } + auto startOfLastToken = path.rfind('/', endOfLastToken); + if (startOfLastToken == std::string::npos) { + //we are at the very beginning of 'path' since no '/' found + path.erase(path.begin(), path.begin() + tokenEndPos); + tokenStartPos = 0; + } else { + path.erase(path.begin() + startOfLastToken + 1, path.begin() + tokenEndPos); + tokenStartPos = startOfLastToken + 1; + } + continue; } - } else { - buf.push_back(m[1]); } - in = m.suffix().str(); + tokenStartPos = tokenEndPos + 1; } - // Construct dirname_ and object_name - dirname_ = ""; - objname_ = ""; - int numberOfItems = buf.size(); - for (int i = 0; i < numberOfItems; i++) { - if (i == numberOfItems - 1) { - // Processing last component... - if (type == Path::Type::DIR_AND_NAME) { - objname_ = buf[i]; - } else if (type == Path::Type::DIR) { - dirname_ += buf[i] + "/"; - } + //separate into objname_ and dirname_; + objname_.clear(); + if (type == Path::Type::DIR) { + if (not path.empty() and path.back() != '/') { + path.append(1, '/'); + } + dirname_ = std::move(path); + } else { + auto lastSlash = path.rfind('/'); + if (lastSlash == std::string::npos) { + objname_ = std::move(path); + dirname_.clear(); } else { - dirname_ += buf[i] + "/"; + objname_ = path.substr(lastSlash + 1); + path.erase(path.begin() + lastSlash + 1, path.end()); + dirname_ = std::move(path); } } } diff --git a/DataFormats/Histograms/test/BuildFile.xml b/DataFormats/Histograms/test/BuildFile.xml index 0022f83a4ea85..65ea107db573a 100644 --- a/DataFormats/Histograms/test/BuildFile.xml +++ b/DataFormats/Histograms/test/BuildFile.xml @@ -2,3 +2,8 @@ + + + + + diff --git a/DataFormats/Histograms/test/MonitorElementData_Path_catch.cc b/DataFormats/Histograms/test/MonitorElementData_Path_catch.cc new file mode 100644 index 0000000000000..2409a087a819d --- /dev/null +++ b/DataFormats/Histograms/test/MonitorElementData_Path_catch.cc @@ -0,0 +1,264 @@ +// -*- C++ -*- +// +// Package: Histograms +// Class : metoemdformat_t +// +// Implementation: +// +// +// Original Author: +// Created: Tue Jul 21 11:00:06 CDT 2009 +// + +// system include files + +#define CATCH_CONFIG_MAIN +#include "catch.hpp" + +// user include files +#include "DataFormats/Histograms/interface/MonitorElementCollection.h" + +TEST_CASE("MonitorElementData::Path", "[MonitorElementData_Path]") { + MonitorElementData::Path p; + + SECTION("Canonical Paths") { + SECTION("short path") { + std::string pathName = "Foo/"; + p.set(pathName, MonitorElementData::Path::Type::DIR); + REQUIRE(p.getDirname() == pathName); + REQUIRE(p.getObjectname().empty()); + REQUIRE(p.getFullname() == pathName); + } + + SECTION("2 dirs") { + std::string pathName = "Foo/Bar/"; + p.set(pathName, MonitorElementData::Path::Type::DIR); + REQUIRE(p.getDirname() == pathName); + REQUIRE(p.getObjectname().empty()); + REQUIRE(p.getFullname() == pathName); + } + + SECTION("long path") { + std::string pathName = "This/Is/A/Very/Long/Path/Name/"; + p.set(pathName, MonitorElementData::Path::Type::DIR); + REQUIRE(p.getDirname() == pathName); + REQUIRE(p.getObjectname().empty()); + REQUIRE(p.getFullname() == pathName); + } + } + SECTION("extra /") { + SECTION("only /") { + std::string pathName = "/"; + std::string canonical = ""; + p.set(pathName, MonitorElementData::Path::Type::DIR); + REQUIRE(p.getDirname() == canonical); + REQUIRE(p.getObjectname().empty()); + REQUIRE(p.getFullname() == canonical); + } + SECTION("only //") { + std::string pathName = "//"; + std::string canonical = ""; + p.set(pathName, MonitorElementData::Path::Type::DIR); + REQUIRE(p.getDirname() == canonical); + REQUIRE(p.getObjectname().empty()); + REQUIRE(p.getFullname() == canonical); + } + SECTION("leading /") { + std::string pathName = "/Foo/"; + std::string canonical = "Foo/"; + p.set(pathName, MonitorElementData::Path::Type::DIR); + REQUIRE(p.getDirname() == canonical); + REQUIRE(p.getObjectname().empty()); + REQUIRE(p.getFullname() == canonical); + } + SECTION("ending //") { + std::string pathName = "Foo//"; + std::string canonical = "Foo/"; + p.set(pathName, MonitorElementData::Path::Type::DIR); + REQUIRE(p.getDirname() == canonical); + REQUIRE(p.getObjectname().empty()); + REQUIRE(p.getFullname() == canonical); + } + SECTION("middle //") { + std::string pathName = "Foo//Bar/"; + std::string canonical = "Foo/Bar/"; + p.set(pathName, MonitorElementData::Path::Type::DIR); + REQUIRE(p.getDirname() == canonical); + REQUIRE(p.getObjectname().empty()); + REQUIRE(p.getFullname() == canonical); + } + } + SECTION("missing end /") { + SECTION("blank") { + std::string pathName = ""; + std::string canonical = ""; + p.set(pathName, MonitorElementData::Path::Type::DIR); + REQUIRE(p.getDirname() == canonical); + REQUIRE(p.getObjectname().empty()); + REQUIRE(p.getFullname() == canonical); + } + SECTION("one dir") { + std::string pathName = "Foo"; + std::string canonical = "Foo/"; + p.set(pathName, MonitorElementData::Path::Type::DIR); + REQUIRE(p.getDirname() == canonical); + REQUIRE(p.getObjectname().empty()); + REQUIRE(p.getFullname() == canonical); + } + SECTION("two dir") { + std::string pathName = "Foo/Bar"; + std::string canonical = "Foo/Bar/"; + p.set(pathName, MonitorElementData::Path::Type::DIR); + REQUIRE(p.getDirname() == canonical); + REQUIRE(p.getObjectname().empty()); + REQUIRE(p.getFullname() == canonical); + } + } + SECTION("up dir") { + SECTION("to beginning") { + SECTION("end /") { + std::string pathName = "Foo/../"; + std::string canonical = ""; + p.set(pathName, MonitorElementData::Path::Type::DIR); + REQUIRE(p.getDirname() == canonical); + REQUIRE(p.getObjectname().empty()); + REQUIRE(p.getFullname() == canonical); + } + SECTION("missing end /") { + std::string pathName = "Foo/.."; + std::string canonical = ""; + p.set(pathName, MonitorElementData::Path::Type::DIR); + REQUIRE(p.getDirname() == canonical); + REQUIRE(p.getObjectname().empty()); + REQUIRE(p.getFullname() == canonical); + } + } + SECTION("beyond beginning") { + SECTION("end /") { + std::string pathName = "Foo/../.."; + std::string canonical = ""; + p.set(pathName, MonitorElementData::Path::Type::DIR); + REQUIRE(p.getDirname() == canonical); + REQUIRE(p.getObjectname().empty()); + REQUIRE(p.getFullname() == canonical); + } + SECTION("missing end /") { + std::string pathName = "Foo/../.."; + std::string canonical = ""; + p.set(pathName, MonitorElementData::Path::Type::DIR); + REQUIRE(p.getDirname() == canonical); + REQUIRE(p.getObjectname().empty()); + REQUIRE(p.getFullname() == canonical); + } + } + SECTION("middle") { + SECTION("back to beginning") { + std::string pathName = "Foo/../Bar/"; + std::string canonical = "Bar/"; + p.set(pathName, MonitorElementData::Path::Type::DIR); + REQUIRE(p.getDirname() == canonical); + REQUIRE(p.getObjectname().empty()); + REQUIRE(p.getFullname() == canonical); + } + SECTION("midway") { + std::string pathName = "Foo/Bar/../Biz/"; + std::string canonical = "Foo/Biz/"; + p.set(pathName, MonitorElementData::Path::Type::DIR); + REQUIRE(p.getDirname() == canonical); + REQUIRE(p.getObjectname().empty()); + REQUIRE(p.getFullname() == canonical); + } + SECTION("last") { + std::string pathName = "Foo/Bar/../"; + std::string canonical = "Foo/"; + p.set(pathName, MonitorElementData::Path::Type::DIR); + REQUIRE(p.getDirname() == canonical); + REQUIRE(p.getObjectname().empty()); + REQUIRE(p.getFullname() == canonical); + } + } + SECTION("multiple consecutive") { + SECTION("two") { + SECTION("back to beginning") { + std::string pathName = "Foo/Biz/../../Bar/"; + std::string canonical = "Bar/"; + p.set(pathName, MonitorElementData::Path::Type::DIR); + REQUIRE(p.getDirname() == canonical); + REQUIRE(p.getObjectname().empty()); + REQUIRE(p.getFullname() == canonical); + } + SECTION("midway") { + std::string pathName = "Foo/Bar/Blah/../../Biz/"; + std::string canonical = "Foo/Biz/"; + p.set(pathName, MonitorElementData::Path::Type::DIR); + REQUIRE(p.getDirname() == canonical); + REQUIRE(p.getObjectname().empty()); + REQUIRE(p.getFullname() == canonical); + } + SECTION("last") { + std::string pathName = "Foo/Bar/Blah/../../"; + std::string canonical = "Foo/"; + p.set(pathName, MonitorElementData::Path::Type::DIR); + REQUIRE(p.getDirname() == canonical); + REQUIRE(p.getObjectname().empty()); + REQUIRE(p.getFullname() == canonical); + } + } + SECTION("three") { + SECTION("back to beginning") { + std::string pathName = "Foo/Biz/Bleep/../../../Bar/"; + std::string canonical = "Bar/"; + p.set(pathName, MonitorElementData::Path::Type::DIR); + REQUIRE(p.getDirname() == canonical); + REQUIRE(p.getObjectname().empty()); + REQUIRE(p.getFullname() == canonical); + } + SECTION("midway") { + std::string pathName = "Foo/Bar/Blah/Bleep/../../../Biz/"; + std::string canonical = "Foo/Biz/"; + p.set(pathName, MonitorElementData::Path::Type::DIR); + REQUIRE(p.getDirname() == canonical); + REQUIRE(p.getObjectname().empty()); + REQUIRE(p.getFullname() == canonical); + } + SECTION("last") { + std::string pathName = "Foo/Bar/Blah/Bleep/../../../"; + std::string canonical = "Foo/"; + p.set(pathName, MonitorElementData::Path::Type::DIR); + REQUIRE(p.getDirname() == canonical); + REQUIRE(p.getObjectname().empty()); + REQUIRE(p.getFullname() == canonical); + } + } + } + } + SECTION("object") { + SECTION("no dir") { + std::string pathName = "bar"; + std::string canonical = ""; + std::string objectName = "bar"; + p.set(pathName, MonitorElementData::Path::Type::DIR_AND_NAME); + REQUIRE(p.getDirname() == canonical); + REQUIRE(p.getObjectname() == objectName); + REQUIRE(p.getFullname() == canonical + objectName); + } + SECTION("1 dir") { + std::string pathName = "Foo/bar"; + std::string canonical = "Foo/"; + std::string objectName = "bar"; + p.set(pathName, MonitorElementData::Path::Type::DIR_AND_NAME); + REQUIRE(p.getDirname() == canonical); + REQUIRE(p.getObjectname() == objectName); + REQUIRE(p.getFullname() == canonical + objectName); + } + SECTION("2 dir") { + std::string pathName = "Foo/Biz/bar"; + std::string canonical = "Foo/Biz/"; + std::string objectName = "bar"; + p.set(pathName, MonitorElementData::Path::Type::DIR_AND_NAME); + REQUIRE(p.getDirname() == canonical); + REQUIRE(p.getObjectname() == objectName); + REQUIRE(p.getFullname() == canonical + objectName); + } + } +} diff --git a/DataFormats/L1THGCal/BuildFile.xml b/DataFormats/L1THGCal/BuildFile.xml index a81d1b9fd188b..aaba3b9a72339 100644 --- a/DataFormats/L1THGCal/BuildFile.xml +++ b/DataFormats/L1THGCal/BuildFile.xml @@ -4,7 +4,6 @@ - diff --git a/DataFormats/L1TrackTrigger/BuildFile.xml b/DataFormats/L1TrackTrigger/BuildFile.xml index 4cec83b885a91..7cd37080c5417 100644 --- a/DataFormats/L1TrackTrigger/BuildFile.xml +++ b/DataFormats/L1TrackTrigger/BuildFile.xml @@ -2,6 +2,7 @@ + diff --git a/DataFormats/L1TrackTrigger/interface/TTTrack.h b/DataFormats/L1TrackTrigger/interface/TTTrack.h index f5e46805bd50f..8428d694ac779 100644 --- a/DataFormats/L1TrackTrigger/interface/TTTrack.h +++ b/DataFormats/L1TrackTrigger/interface/TTTrack.h @@ -105,6 +105,9 @@ class TTTrack : public TTTrack_TrackWord { /// Track phi double phi() const; + /// Local track phi (within the sector) + double localPhi() const; + /// Track tanL double tanL() const; @@ -313,6 +316,11 @@ double TTTrack::phi() const { return thePhi_; } +template +double TTTrack::localPhi() const { + return TTTrack_TrackWord::localPhi(thePhi_, thePhiSector_); +} + template double TTTrack::d0() const { return theD0_; @@ -441,9 +449,17 @@ void TTTrack::setTrackWordBits() { // missing conversion of global phi to difference from sector center phi if (theChi2_Z_ < 0) { - setTrackWord( - valid, theMomentum_, thePOCA_, theRInv_, chi2Red(), 0, chi2BendRed(), theHitPattern_, mvaQuality, mvaOther); - + setTrackWord(valid, + theMomentum_, + thePOCA_, + theRInv_, + theChi2_, + 0, + theStubPtConsistency_, + theHitPattern_, + mvaQuality, + mvaOther, + thePhiSector_); } else { setTrackWord(valid, theMomentum_, @@ -454,7 +470,8 @@ void TTTrack::setTrackWordBits() { chi2BendRed(), theHitPattern_, mvaQuality, - mvaOther); + mvaOther, + thePhiSector_); } return; } diff --git a/DataFormats/L1TrackTrigger/interface/TTTrack_TrackWord.h b/DataFormats/L1TrackTrigger/interface/TTTrack_TrackWord.h index 81208788ec947..4b37a6b63a46b 100644 --- a/DataFormats/L1TrackTrigger/interface/TTTrack_TrackWord.h +++ b/DataFormats/L1TrackTrigger/interface/TTTrack_TrackWord.h @@ -15,15 +15,23 @@ #include "DataFormats/GeometryVector/interface/GlobalVector.h" #include "DataFormats/GeometryVector/interface/GlobalPoint.h" +#include "DataFormats/Math/interface/deltaPhi.h" #include #include #include #include +#include +#include #include #include +namespace tttrack_trackword { + void infoTestDigitizationScheme( + const unsigned int, const double, const double, const unsigned int, const double, const unsigned int); +} + class TTTrack_TrackWord { public: // ----------constants, enums and typedefs --------- @@ -96,6 +104,10 @@ class TTTrack_TrackWord { static constexpr std::array bendChi2Bins = { {0.0, 0.75, 1.0, 1.5, 2.25, 3.5, 5.0, 20.0}}; + // Sector constants + static constexpr unsigned int nSectors = 9; + static constexpr double sectorWidth = (2. * M_PI) / nSectors; + // Track flags typedef ap_uint valid_t; // valid bit @@ -130,10 +142,11 @@ class TTTrack_TrackWord { double bendChi2, unsigned int hitPattern, unsigned int mvaQuality, - unsigned int mvaOther); + unsigned int mvaOther, + unsigned int sector); TTTrack_TrackWord(unsigned int valid, unsigned int rInv, - unsigned int phi0, + unsigned int phi0, // local phi unsigned int tanl, unsigned int z0, unsigned int d0, @@ -201,11 +214,11 @@ class TTTrack_TrackWord { // These functions return the unpacked and converted values // These functions return real numbers converted from the digitized quantities by unpacking the 96-bit track word bool getValid() const { return getValidWord().to_bool(); } - double getRinv() const { return unpackSignedValue(getRinvBits(), TrackBitWidths::kRinvSize, stepRinv); } - double getPhi() const { return unpackSignedValue(getPhiBits(), TrackBitWidths::kPhiSize, stepPhi0); } - double getTanl() const { return unpackSignedValue(getTanlBits(), TrackBitWidths::kTanlSize, stepTanL); } - double getZ0() const { return unpackSignedValue(getZ0Bits(), TrackBitWidths::kZ0Size, stepZ0); } - double getD0() const { return unpackSignedValue(getD0Bits(), TrackBitWidths::kD0Size, stepD0); } + double getRinv() const { return undigitizeSignedValue(getRinvBits(), TrackBitWidths::kRinvSize, stepRinv); } + double getPhi() const { return undigitizeSignedValue(getPhiBits(), TrackBitWidths::kPhiSize, stepPhi0); } + double getTanl() const { return undigitizeSignedValue(getTanlBits(), TrackBitWidths::kTanlSize, stepTanL); } + double getZ0() const { return undigitizeSignedValue(getZ0Bits(), TrackBitWidths::kZ0Size, stepZ0); } + double getD0() const { return undigitizeSignedValue(getD0Bits(), TrackBitWidths::kD0Size, stepD0); } double getChi2RPhi() const { return chi2RPhiBins[getChi2RPhiBits()]; } double getChi2RZ() const { return chi2RZBins[getChi2RZBits()]; } double getBendChi2() const { return bendChi2Bins[getBendChi2Bits()]; } @@ -223,11 +236,12 @@ class TTTrack_TrackWord { double bendChi2, unsigned int hitPattern, unsigned int mvaQuality, - unsigned int mvaOther); + unsigned int mvaOther, + unsigned int sector); void setTrackWord(unsigned int valid, unsigned int rInv, - unsigned int phi0, + unsigned int phi0, // local phi unsigned int tanl, unsigned int z0, unsigned int d0, @@ -240,7 +254,7 @@ class TTTrack_TrackWord { void setTrackWord(ap_uint valid, ap_uint rInv, - ap_uint phi0, + ap_uint phi0, // local phi ap_uint tanl, ap_uint z0, ap_uint d0, @@ -251,16 +265,36 @@ class TTTrack_TrackWord { ap_uint mvaQuality, ap_uint mvaOther); + // ----------member functions (testers) ------------ + bool singleDigitizationSchemeTest(const double floatingPointValue, const unsigned int nBits, const double lsb) const; + void testDigitizationScheme() const; + +protected: + // ----------protected member functions ------------ + float localPhi(float globalPhi, unsigned int sector) const { + return reco::deltaPhi(globalPhi, (sector * sectorWidth)); + } + private: // ----------private member functions -------------- unsigned int digitizeSignedValue(double value, unsigned int nBits, double lsb) const { - unsigned int digitized_value = std::floor(std::abs(value) / lsb); - unsigned int digitized_maximum = (1 << (nBits - 1)) - 1; // The remove 1 bit from nBits to account for the sign - if (digitized_value > digitized_maximum) - digitized_value = digitized_maximum; - if (value < 0) - digitized_value = (1 << nBits) - digitized_value; // two's complement encoding - return digitized_value; + // Digitize the incoming value + int digitizedValue = std::floor(value / lsb); + + // Calculate the maxmum possible positive value given an output of nBits in size + int digitizedMaximum = (1 << (nBits - 1)) - 1; // The remove 1 bit from nBits to account for the sign + int digitizedMinimum = -1. * (digitizedMaximum + 1); + + // Saturate the digitized value + digitizedValue = std::clamp(digitizedValue, digitizedMinimum, digitizedMaximum); + + // Do the two's compliment encoding + unsigned int twosValue = digitizedValue; + if (digitizedValue < 0) { + twosValue += (1 << nBits); + } + + return twosValue; } template @@ -269,14 +303,20 @@ class TTTrack_TrackWord { return (up - bins.begin() - 1); } - double unpackSignedValue(unsigned int bits, unsigned int nBits, double lsb) const { - int isign = 1; - unsigned int digitized_maximum = (1 << nBits) - 1; - if (bits & (1 << (nBits - 1))) { // check the sign - isign = -1; - bits = (1 << (nBits + 1)) - bits; // if negative, flip everything for two's complement encoding + double undigitizeSignedValue(unsigned int twosValue, unsigned int nBits, double lsb) const { + // Check that none of the bits above the nBits-1 bit, in a range of [0, nBits-1], are set. + // This makes sure that it isn't possible for the value represented by `twosValue` to be + // any bigger than ((1 << nBits) - 1). + assert((twosValue >> nBits) == 0); + + // Convert from twos compliment to C++ signed integer (normal digitized value) + int digitizedValue = twosValue; + if (twosValue & (1 << (nBits - 1))) { // check if the twosValue is negative + digitizedValue -= (1 << nBits); } - return (double(bits & digitized_maximum) + 0.5) * lsb * isign; + + // Convert to floating point value + return (double(digitizedValue) + 0.5) * lsb; } // ----------member data --------------------------- diff --git a/DataFormats/L1TrackTrigger/src/TTTrack_TrackWord.cc b/DataFormats/L1TrackTrigger/src/TTTrack_TrackWord.cc index 48031bc8fc514..0b1420d2ca09f 100644 --- a/DataFormats/L1TrackTrigger/src/TTTrack_TrackWord.cc +++ b/DataFormats/L1TrackTrigger/src/TTTrack_TrackWord.cc @@ -11,6 +11,20 @@ /////// #include "DataFormats/L1TrackTrigger/interface/TTTrack_TrackWord.h" +#include "FWCore/MessageLogger/interface/MessageLogger.h" + +void tttrack_trackword::infoTestDigitizationScheme(const unsigned int nBits, + const double lsb, + const double floatingPointValue, + const unsigned int digitizedSignedValue, + const double undigitizedSignedValue, + const unsigned int redigitizedSignedValue) { + edm::LogInfo("TTTrack_TrackWord") << "testDigitizationScheme: (nBits, lsb) = (" << nBits << ", " << lsb << ")\n" + << "Floating point value = " << floatingPointValue + << "\tDigitized value = " << digitizedSignedValue + << "\tUn-digitized value = " << undigitizedSignedValue + << "\tRe-digitized value = " << redigitizedSignedValue; +} //Constructor - turn track parameters into 96-bit word TTTrack_TrackWord::TTTrack_TrackWord(unsigned int valid, @@ -22,8 +36,9 @@ TTTrack_TrackWord::TTTrack_TrackWord(unsigned int valid, double bendChi2, unsigned int hitPattern, unsigned int mvaQuality, - unsigned int mvaOther) { - setTrackWord(valid, momentum, POCA, rInv, chi2RPhi, chi2RZ, bendChi2, hitPattern, mvaQuality, mvaOther); + unsigned int mvaOther, + unsigned int sector) { + setTrackWord(valid, momentum, POCA, rInv, chi2RPhi, chi2RZ, bendChi2, hitPattern, mvaQuality, mvaOther, sector); } TTTrack_TrackWord::TTTrack_TrackWord(unsigned int valid, @@ -51,9 +66,10 @@ void TTTrack_TrackWord::setTrackWord(unsigned int valid, double bendChi2, unsigned int hitPattern, unsigned int mvaQuality, - unsigned int mvaOther) { + unsigned int mvaOther, + unsigned int sector) { // first, derive quantities to be packed - float rPhi = momentum.phi(); // this needs to be phi relative to center of sector **** + float rPhi = localPhi(momentum.phi(), sector); // this needs to be phi relative to the center of the sector float rTanl = momentum.z() / momentum.perp(); float rZ0 = POCA.z(); float rD0 = POCA.perp(); @@ -176,3 +192,29 @@ void TTTrack_TrackWord::setTrackWord( trackWord_.set(b, valid[b - offset]); } } + +bool TTTrack_TrackWord::singleDigitizationSchemeTest(const double floatingPointValue, + const unsigned int nBits, + const double lsb) const { + unsigned int digitizedSignedValue = digitizeSignedValue(floatingPointValue, nBits, lsb); + double undigitizedSignedValue = undigitizeSignedValue(digitizedSignedValue, nBits, lsb); + unsigned int redigitizedSignedValue = digitizeSignedValue(undigitizedSignedValue, nBits, lsb); + tttrack_trackword::infoTestDigitizationScheme( + nBits, lsb, floatingPointValue, digitizedSignedValue, undigitizedSignedValue, redigitizedSignedValue); + return (std::abs(floatingPointValue - undigitizedSignedValue) <= (lsb / 2.0)) && + (digitizedSignedValue == redigitizedSignedValue); +} + +void TTTrack_TrackWord::testDigitizationScheme() const { + /* + Expected output: + testDigitizationScheme: Floating point value = -4 Digitized value = 4 Un-digitized value = -3.5 + testDigitizationScheme: Floating point value = 3 Digitized value = 3 Un-digitized value = 3.5 + testDigitizationScheme: Floating point value = -3.5 Digitized value = 9 Un-digitized value = -3.25 + testDigitizationScheme: Floating point value = 3.5 Digitized value = 7 Un-digitized value = 3.75 + */ + assert(singleDigitizationSchemeTest(-4.0, 3, 1.0)); + assert(singleDigitizationSchemeTest(3.0, 3, 1.0)); + assert(singleDigitizationSchemeTest(-3.5, 4, 0.5)); + assert(singleDigitizationSchemeTest(3.5, 4, 0.5)); +} diff --git a/DataFormats/L1TrackTrigger/test/BuildFile.xml b/DataFormats/L1TrackTrigger/test/BuildFile.xml new file mode 100644 index 0000000000000..2e2e4ad4f5bb4 --- /dev/null +++ b/DataFormats/L1TrackTrigger/test/BuildFile.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/DataFormats/L1TrackTrigger/test/TestDataFormatsTTTrackTrackWord.cc b/DataFormats/L1TrackTrigger/test/TestDataFormatsTTTrackTrackWord.cc new file mode 100644 index 0000000000000..14709bc605514 --- /dev/null +++ b/DataFormats/L1TrackTrigger/test/TestDataFormatsTTTrackTrackWord.cc @@ -0,0 +1,31 @@ +#include "FWCore/Framework/interface/EDAnalyzer.h" +#include "FWCore/Framework/interface/MakerMacros.h" +#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/ParameterSet/interface/ParameterSetDescription.h" +#include "DataFormats/TestObjects/interface/ToyProducts.h" +#include "DataFormats/L1TrackTrigger/interface/TTTrack_TrackWord.h" + +#include + +namespace trackwordtest { + class TTTrackTrackWordDummyOneAnalyzer : public edm::EDAnalyzer { + public: + explicit TTTrackTrackWordDummyOneAnalyzer(const edm::ParameterSet&) {} + ~TTTrackTrackWordDummyOneAnalyzer() {} + + void analyze(edm::Event const& iEvent, edm::EventSetup const& iSetup) override { + TTTrack_TrackWord tw; + tw.testDigitizationScheme(); + } + + static void fillDescriptions(edm::ConfigurationDescriptions& descriptions) { + edm::ParameterSetDescription desc; + //to ensure distinct cfi names + descriptions.addWithDefaultLabel(desc); + } + }; +} // namespace trackwordtest + +using trackwordtest::TTTrackTrackWordDummyOneAnalyzer; +DEFINE_FWK_MODULE(TTTrackTrackWordDummyOneAnalyzer); \ No newline at end of file diff --git a/DataFormats/L1TrackTrigger/test/testDataFormatsTTTrackTrackWord_cfg.py b/DataFormats/L1TrackTrigger/test/testDataFormatsTTTrackTrackWord_cfg.py new file mode 100644 index 0000000000000..227d9a0e740c2 --- /dev/null +++ b/DataFormats/L1TrackTrigger/test/testDataFormatsTTTrackTrackWord_cfg.py @@ -0,0 +1,14 @@ +import FWCore.ParameterSet.Config as cms + +process = cms.Process("Test") + +process.source = cms.Source("EmptySource") + +process.maxEvents.input = 1 + +process.load("FWCore.MessageService.MessageLogger_cfi") +process.MessageLogger.cerr.INFO.limit = cms.untracked.int32(1000000000) + +process.dummyAna = cms.EDAnalyzer("TTTrackTrackWordDummyOneAnalyzer") + +process.p = cms.Path(process.dummyAna) \ No newline at end of file diff --git a/DataFormats/METReco/interface/PFClusterMETCollection.h b/DataFormats/METReco/interface/PFClusterMETCollection.h deleted file mode 100644 index 1a02b783450ae..0000000000000 --- a/DataFormats/METReco/interface/PFClusterMETCollection.h +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef METRECO_PFClusterMETCOLLECTION_H -#define METRECO_PFClusterMETCOLLECTION_H - -/** \class PFClusterMETCollection - * - * \short Collection of PFCluster MET - * - * PFClusterMETCollection is a collection of PFClusterMET objects - * - * \author Salvatore Rappoccio, JHU - * - * \version 1st Version Dec, 2010 - * - ************************************************************/ - -#include -#include "DataFormats/METReco/interface/PFClusterMETFwd.h" - -namespace reco -{ - typedef std::vector PFClusterMETCollection; -} -#endif // METRECO_PFClusterMETCOLLECTION_H diff --git a/DataFormats/Math/interface/SSEArray.h b/DataFormats/Math/interface/SSEArray.h deleted file mode 100644 index 778100e291007..0000000000000 --- a/DataFormats/Math/interface/SSEArray.h +++ /dev/null @@ -1,111 +0,0 @@ -#ifndef DataFormat_Math_SSEArray_H -#define DataFormat_Math_SSEArray_H - - -#include "DataFormats/Math/interface/SSEVec.h" -#include - -#ifdef CMS_USE_SSE -namespace mathSSE { - -// "vertical array" - template - struct ArrayTraits { - }; - - template - struct ArrayMask { - }; - - //FIXME avoid punning... - template <> - struct ArrayMask { - static inline Vec4 value() { - Vec4 v; v.setMask(0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff); - return v; - } - }; - template <> - struct ArrayMask { - static inline Vec4 value() { - Vec4 v; v.setMask(0xffffffff, 0x0, 0x0, 0x0); - return v; - } - }; - template <> - struct ArrayMask { - static inline Vec4 value() { - Vec4 v; v.setMask(0xffffffff, 0xffffffff, 0x0, 0x0); - return v; - } - }; - template <> - struct ArrayMask { - static inline Vec4 value() { - Vec4 v; v.setMask(0xffffffff, 0xffffffff, 0xffffffff, 0x0); - return v; - } - }; - - template <> - struct ArrayMask { - static inline Vec2 value() { - Vec2 v; v.setMask(0xffffffffffffffffLL, 0xffffffffffffffffLL); - return v; - } - }; - template <> - struct ArrayMask { - static inline Vec2 value() { - Vec2 v; v.setMask(0xffffffffffffffffLL, 0x0LL); - return v; - } - }; - - - template - struct ArrayTraits { - typedef float Scalar; - typedef Vec4 Vec; - static const size_t size = S; - static const size_t ssesize = (S+3)/4; - static const size_t arrsize = 4*ssesize; - static inline Vec maskLast() { return ArrayMask::value(); } - static inline Vec __attribute__((__always_inline__)) mask(Vec v, size_t i) { - return (i==ssesize-1) ? maskLast()&v : v; - } - template - static void loop(F f) { - for (size_t i=0; i!=ssesize-1;++i) - f(i, ArrayMask::value()); - f(ssesize-1,maskLast()); - } - }; - - template - struct ArrayTraits { - typedef double Scalar; - typedef Vec2 Vec; - static const size_t size = S; - static const size_t ssesize = (S+1)/2; - static const size_t arrsize = 2*ssesize; - static inline Vec maskLast() { return ArrayMask::value();} - }; - - template - union Array { - typedef ArrayTraits Traits; - typedef typename Traits::Vec Vec; - typename Vec::nativeType vec[Traits::ssesize]; - T __attribute__ ((aligned(16))) arr[Traits::arrsize]; - - Vec operator[]( size_t i) { return vec[i];} - Vec const & operator[]( size_t i) const{ return reinterpret_cast(vec[i]);} - - }; - - -} - -#endif // CMS_USE_SSE -#endif // DataFormat_Math_SSEArray_H diff --git a/DataFormats/Math/interface/libminifloat.h b/DataFormats/Math/interface/libminifloat.h index e811b89bca4e7..14c88c3def68e 100644 --- a/DataFormats/Math/interface/libminifloat.h +++ b/DataFormats/Math/interface/libminifloat.h @@ -1,6 +1,7 @@ #ifndef libminifloat_h #define libminifloat_h #include "FWCore/Utilities/interface/thread_safety_macros.h" +#include "FWCore/Utilities/interface/bit_cast.h" #include #include #include @@ -10,62 +11,42 @@ class MiniFloatConverter { public: MiniFloatConverter(); inline static float float16to32(uint16_t h) { - union { - float flt; - uint32_t i32; - } conv; - conv.i32 = mantissatable[offsettable[h >> 10] + (h & 0x3ff)] + exponenttable[h >> 10]; - return conv.flt; + uint32_t i32 = mantissatable[offsettable[h >> 10] + (h & 0x3ff)] + exponenttable[h >> 10]; + return edm::bit_cast(i32); } inline static uint16_t float32to16(float x) { return float32to16round(x); } /// Fast implementation, but it crops the number so it biases low inline static uint16_t float32to16crop(float x) { - union { - float flt; - uint32_t i32; - } conv; - conv.flt = x; - return basetable[(conv.i32 >> 23) & 0x1ff] + ((conv.i32 & 0x007fffff) >> shifttable[(conv.i32 >> 23) & 0x1ff]); + uint32_t i32 = edm::bit_cast(x); + return basetable[(i32 >> 23) & 0x1ff] + ((i32 & 0x007fffff) >> shifttable[(i32 >> 23) & 0x1ff]); } /// Slower implementation, but it rounds to avoid biases inline static uint16_t float32to16round(float x) { - union { - float flt; - uint32_t i32; - } conv; - conv.flt = x; - uint8_t shift = shifttable[(conv.i32 >> 23) & 0x1ff]; + uint32_t i32 = edm::bit_cast(x); + uint8_t shift = shifttable[(i32 >> 23) & 0x1ff]; if (shift == 13) { - uint16_t base2 = (conv.i32 & 0x007fffff) >> 12; + uint16_t base2 = (i32 & 0x007fffff) >> 12; uint16_t base = base2 >> 1; if (((base2 & 1) != 0) && (base < 1023)) base++; - return basetable[(conv.i32 >> 23) & 0x1ff] + base; + return basetable[(i32 >> 23) & 0x1ff] + base; } else { - return basetable[(conv.i32 >> 23) & 0x1ff] + ((conv.i32 & 0x007fffff) >> shifttable[(conv.i32 >> 23) & 0x1ff]); + return basetable[(i32 >> 23) & 0x1ff] + ((i32 & 0x007fffff) >> shifttable[(i32 >> 23) & 0x1ff]); } } template inline static float reduceMantissaToNbits(const float &f) { static_assert(bits <= 23, "max mantissa size is 23 bits"); constexpr uint32_t mask = (0xFFFFFFFF >> (23 - bits)) << (23 - bits); - union { - float flt; - uint32_t i32; - } conv; - conv.flt = f; - conv.i32 &= mask; - return conv.flt; + uint32_t i32 = edm::bit_cast(f); + i32 &= mask; + return edm::bit_cast(i32); } inline static float reduceMantissaToNbits(const float &f, int bits) { uint32_t mask = (0xFFFFFFFF >> (23 - bits)) << (23 - bits); - union { - float flt; - uint32_t i32; - } conv; - conv.flt = f; - conv.i32 &= mask; - return conv.flt; + uint32_t i32 = edm::bit_cast(f); + i32 &= mask; + return edm::bit_cast(i32); } class ReduceMantissaToNbitsRounding { @@ -77,20 +58,16 @@ class MiniFloatConverter { float operator()(float f) const { constexpr uint32_t low23 = (0x007FFFFF); // mask to keep lowest 23 bits = mantissa constexpr uint32_t hi9 = (0xFF800000); // mask to keep highest 9 bits = the rest - union { - float flt; - uint32_t i32; - } conv; - conv.flt = f; - if (conv.i32 & test) { // need to round - uint32_t mantissa = (conv.i32 & low23) >> shift; + uint32_t i32 = edm::bit_cast(f); + if (i32 & test) { // need to round + uint32_t mantissa = (i32 & low23) >> shift; if (mantissa < maxn) mantissa++; - conv.i32 = (conv.i32 & hi9) | (mantissa << shift); + i32 = (i32 & hi9) | (mantissa << shift); } else { - conv.i32 &= mask; + i32 &= mask; } - return conv.flt; + return edm::bit_cast(i32); } private: @@ -114,54 +91,34 @@ class MiniFloatConverter { } inline static float max() { - union { - float flt; - uint32_t i32; - } conv; - conv.i32 = 0x477fe000; // = mantissatable[offsettable[0x1e]+0x3ff]+exponenttable[0x1e] - return conv.flt; + constexpr uint32_t i32 = 0x477fe000; // = mantissatable[offsettable[0x1e]+0x3ff]+exponenttable[0x1e] + return edm::bit_cast(i32); } // Maximum float32 value that gets rounded to max() inline static float max32RoundedToMax16() { - union { - float flt; - uint32_t i32; - } conv; // 2^16 in float32 is the first to result inf in float16, so // 2^16-1 is the last float32 to result max() in float16 - conv.i32 = (0x8f << 23) - 1; - return conv.flt; + constexpr uint32_t i32 = (0x8f << 23) - 1; + return edm::bit_cast(i32); } inline static float min() { - union { - float flt; - uint32_t i32; - } conv; - conv.i32 = 0x38800000; // = mantissatable[offsettable[1]+0]+exponenttable[1] - return conv.flt; + constexpr uint32_t i32 = 0x38800000; // = mantissatable[offsettable[1]+0]+exponenttable[1] + return edm::bit_cast(i32); } // Minimum float32 value that gets rounded to min() inline static float min32RoundedToMin16() { - union { - float flt; - uint32_t i32; - } conv; // 2^-14-1 in float32 is the first to result denormalized in float16, so // 2^-14 is the first float32 to result min() in float16 - conv.i32 = (0x71 << 23); - return conv.flt; + constexpr uint32_t i32 = (0x71 << 23); + return edm::bit_cast(i32); } inline static float denorm_min() { - union { - float flt; - uint32_t i32; - } conv; - conv.i32 = 0x33800000; // mantissatable[offsettable[0]+1]+exponenttable[0] - return conv.flt; + constexpr uint32_t i32 = 0x33800000; // mantissatable[offsettable[0]+1]+exponenttable[0] + return edm::bit_cast(i32); } inline static bool isdenorm(uint16_t h) { diff --git a/DataFormats/Math/interface/private/AVXVec.h b/DataFormats/Math/interface/private/AVXVec.h index 9fe33e8c3d1fd..78850716bba21 100644 --- a/DataFormats/Math/interface/private/AVXVec.h +++ b/DataFormats/Math/interface/private/AVXVec.h @@ -5,183 +5,157 @@ // only as part of SSEVec namespace mathSSE { - template<> + template <> union Vec4 { - typedef __m256d nativeType; + typedef __m256d nativeType; __m256d vec; - double __attribute__ ((aligned(32))) arr[4]; + double __attribute__((aligned(32))) arr[4]; OldVec o; - + Vec4(__m256d ivec) : vec(ivec) {} - Vec4(OldVec const & ivec) : o(ivec) {} - - Vec4() { - vec = _mm256_setzero_pd(); - } + Vec4(OldVec const& ivec) : o(ivec) {} + Vec4() { vec = _mm256_setzero_pd(); } - inline Vec4(Vec4 ivec) { - vec = _mm256_cvtps_pd(ivec.vec); - } + inline Vec4(Vec4 ivec) { vec = _mm256_cvtps_pd(ivec.vec); } - explicit Vec4(double f1) { - set1(f1); - } + explicit Vec4(double f1) { set1(f1); } - Vec4(double f1, double f2, double f3, double f4=0) { - arr[0] = f1; arr[1] = f2; arr[2] = f3; arr[3]=f4; + Vec4(double f1, double f2, double f3, double f4 = 0) { + arr[0] = f1; + arr[1] = f2; + arr[2] = f3; + arr[3] = f4; } - - Vec4( Vec2 ivec0, Vec2 ivec1) { - vec = _mm256_insertf128_pd(vec,ivec0.vec,0); - vec = _mm256_insertf128_pd(vec,ivec1.vec,1); - - } - - Vec4( Vec2 ivec0, double f3, double f4=0) { - vec = _mm256_insertf128_pd(vec,ivec0.vec,0); - arr[2] = f3; arr[3] = f4; + Vec4(Vec2 ivec0, Vec2 ivec1) { + vec = _mm256_insertf128_pd(vec, ivec0.vec, 0); + vec = _mm256_insertf128_pd(vec, ivec1.vec, 1); } - Vec4( Vec2 ivec0) { - vec = _mm256_setzero_pd(); - vec = _mm256_insertf128_pd(vec,ivec0.vec,0); + Vec4(Vec2 ivec0, double f3, double f4 = 0) { + vec = _mm256_insertf128_pd(vec, ivec0.vec, 0); + arr[2] = f3; + arr[3] = f4; } + Vec4(Vec2 ivec0) { + vec = _mm256_setzero_pd(); + vec = _mm256_insertf128_pd(vec, ivec0.vec, 0); + } // for masking void setMask(unsigned int m1, unsigned int m2, unsigned int m3, unsigned int m4) { - Mask4 mask(m1,m2,m3,m4); vec=mask.vec; + Mask4 mask(m1, m2, m3, m4); + vec = mask.vec; } - void set(double f1, double f2, double f3, double f4=0) { - vec = _mm256_set_pd(f4, f3, f2, f1); - } + void set(double f1, double f2, double f3, double f4 = 0) { vec = _mm256_set_pd(f4, f3, f2, f1); } - void set1(double f1) { - vec = _mm256_set1_pd(f1); - } + void set1(double f1) { vec = _mm256_set1_pd(f1); } - template + template Vec4 get1() const { - return _mm256_set1_pd(arr[N]); //FIXME + return _mm256_set1_pd(arr[N]); //FIXME } /* Vec4 get1(unsigned int n) const { return _mm256_set1_pd(arr[n]); //FIXME } */ - double & operator[](unsigned int n) { - return arr[n]; - } + double& operator[](unsigned int n) { return arr[n]; } - double operator[](unsigned int n) const { - return arr[n]; - } - - Vec2 xy() const { return Vec2(_mm256_castpd256_pd128(vec));} - Vec2 zw() const { return Vec2(_mm256_castpd256_pd128(_mm256_permute2f128_pd(vec,vec,1)));} + double operator[](unsigned int n) const { return arr[n]; } + Vec2 xy() const { return Vec2(_mm256_castpd256_pd128(vec)); } + Vec2 zw() const { return Vec2(_mm256_castpd256_pd128(_mm256_permute2f128_pd(vec, vec, 1))); } }; - - inline Vec4::Vec4(Vec4 ivec) { - vec = _mm256_cvtpd_ps(ivec.vec); - } -} // namespace mathSSE - + inline Vec4::Vec4(Vec4 ivec) { vec = _mm256_cvtpd_ps(ivec.vec); } +} // namespace mathSSE inline bool operator==(mathSSE::Vec4 a, mathSSE::Vec4 b) { - return _mm256_movemask_pd(_mm256_cmp_pd(a.vec,b.vec,_CMP_EQ_OS))==0xf; + return _mm256_movemask_pd(_mm256_cmp_pd(a.vec, b.vec, _CMP_EQ_OS)) == 0xf; } - + inline mathSSE::Vec4 cmpeq(mathSSE::Vec4 a, mathSSE::Vec4 b) { - return _mm256_cmp_pd(a.vec,b.vec,_CMP_EQ_OS); + return _mm256_cmp_pd(a.vec, b.vec, _CMP_EQ_OS); } inline mathSSE::Vec4 cmpgt(mathSSE::Vec4 a, mathSSE::Vec4 b) { - return _mm256_cmp_pd(a.vec,b.vec,_CMP_GT_OS); + return _mm256_cmp_pd(a.vec, b.vec, _CMP_GT_OS); } inline mathSSE::Vec4 hadd(mathSSE::Vec4 a, mathSSE::Vec4 b) { - return _mm256_hadd_pd(a.vec,b.vec); + return _mm256_hadd_pd(a.vec, b.vec); } - - inline mathSSE::Vec4 operator-(mathSSE::Vec4 a) { - const __m256d neg = _mm256_set_pd ( -0.0 , -0.0 , -0.0, -0.0); - return _mm256_xor_pd(a.vec,neg); + const __m256d neg = _mm256_set_pd(-0.0, -0.0, -0.0, -0.0); + return _mm256_xor_pd(a.vec, neg); } inline mathSSE::Vec4 operator&(mathSSE::Vec4 a, mathSSE::Vec4 b) { - return _mm256_and_pd(a.vec,b.vec); + return _mm256_and_pd(a.vec, b.vec); } inline mathSSE::Vec4 operator|(mathSSE::Vec4 a, mathSSE::Vec4 b) { - return _mm256_or_pd(a.vec,b.vec); + return _mm256_or_pd(a.vec, b.vec); } inline mathSSE::Vec4 operator^(mathSSE::Vec4 a, mathSSE::Vec4 b) { - return _mm256_xor_pd(a.vec,b.vec); + return _mm256_xor_pd(a.vec, b.vec); } inline mathSSE::Vec4 andnot(mathSSE::Vec4 a, mathSSE::Vec4 b) { - return _mm256_andnot_pd(a.vec,b.vec); + return _mm256_andnot_pd(a.vec, b.vec); } - inline mathSSE::Vec4 operator+(mathSSE::Vec4 a, mathSSE::Vec4 b) { - return _mm256_add_pd(a.vec,b.vec); + return _mm256_add_pd(a.vec, b.vec); } inline mathSSE::Vec4 operator-(mathSSE::Vec4 a, mathSSE::Vec4 b) { - return _mm256_sub_pd(a.vec,b.vec); + return _mm256_sub_pd(a.vec, b.vec); } inline mathSSE::Vec4 operator*(mathSSE::Vec4 a, mathSSE::Vec4 b) { - return _mm256_mul_pd(a.vec,b.vec); + return _mm256_mul_pd(a.vec, b.vec); } inline mathSSE::Vec4 operator/(mathSSE::Vec4 a, mathSSE::Vec4 b) { - return _mm256_div_pd(a.vec,b.vec); + return _mm256_div_pd(a.vec, b.vec); } inline mathSSE::Vec4 operator*(double a, mathSSE::Vec4 b) { - return _mm256_mul_pd(_mm256_set1_pd(a),b.vec); + return _mm256_mul_pd(_mm256_set1_pd(a), b.vec); } -inline mathSSE::Vec4 operator*(mathSSE::Vec4 b,double a) { - return _mm256_mul_pd(_mm256_set1_pd(a),b.vec); +inline mathSSE::Vec4 operator*(mathSSE::Vec4 b, double a) { + return _mm256_mul_pd(_mm256_set1_pd(a), b.vec); } -inline mathSSE::Vec4 operator/(mathSSE::Vec4 b,double a) { - return _mm256_div_pd(b.vec,_mm256_set1_pd(a)); +inline mathSSE::Vec4 operator/(mathSSE::Vec4 b, double a) { + return _mm256_div_pd(b.vec, _mm256_set1_pd(a)); } - -inline double -__attribute__((always_inline)) __attribute__ ((pure)) +inline double __attribute__((always_inline)) __attribute__((pure)) dot(mathSSE::Vec4 a, mathSSE::Vec4 b) { - using mathSSE::_mm256_dot_pd; + using mathSSE::_mm256_dot_pd; mathSSE::Vec4 ret; - ret.vec = _mm256_dot_pd(a.vec,b.vec); + ret.vec = _mm256_dot_pd(a.vec, b.vec); return ret.arr[0]; } -inline mathSSE::Vec4 -__attribute__((always_inline)) __attribute__ ((pure)) +inline mathSSE::Vec4 __attribute__((always_inline)) __attribute__((pure)) cross(mathSSE::Vec4 a, mathSSE::Vec4 b) { - using mathSSE::_mm256_cross_pd; - return _mm256_cross_pd(a.vec,b.vec); + using mathSSE::_mm256_cross_pd; + return _mm256_cross_pd(a.vec, b.vec); } -inline double -__attribute__((always_inline)) __attribute__ ((pure)) +inline double __attribute__((always_inline)) __attribute__((pure)) dotxy(mathSSE::Vec4 a, mathSSE::Vec4 b) { - mathSSE::Vec4 mul = a*b; - mul = hadd(mul,mul); + mathSSE::Vec4 mul = a * b; + mul = hadd(mul, mul); return mul.arr[0]; } - #endif diff --git a/DataFormats/MuonDetId/interface/CSCDetId.h b/DataFormats/MuonDetId/interface/CSCDetId.h index 16336125a8422..bcbba04a9c684 100644 --- a/DataFormats/MuonDetId/interface/CSCDetId.h +++ b/DataFormats/MuonDetId/interface/CSCDetId.h @@ -249,6 +249,12 @@ class CSCDetId : public DetId { static std::string chamberName(int endcap, int station, int ring, int chamber); static std::string chamberName(int iChamberType); std::string chamberName() const; + /** + * Returns the layer name in the format + * ME$sign$station/$ring/$chamber/$layer. Example: ME+1/1/9/1 + */ + static std::string layerName(int endcap, int station, int ring, int chamber, int layer); + std::string layerName() const; private: /** diff --git a/DataFormats/MuonDetId/src/CSCDetId.cc b/DataFormats/MuonDetId/src/CSCDetId.cc index d2eb1f886a355..ec02ed72097c8 100644 --- a/DataFormats/MuonDetId/src/CSCDetId.cc +++ b/DataFormats/MuonDetId/src/CSCDetId.cc @@ -76,6 +76,12 @@ std::string CSCDetId::chamberName(int endcap, int station, int ring, int chamber return "ME" + eSign + std::to_string(station) + "/" + std::to_string(ring) + "/" + std::to_string(chamber); } +std::string CSCDetId::layerName(int endcap, int station, int ring, int chamber, int layer) { + const std::string eSign = endcap == 1 ? "+" : "-"; + return "ME" + eSign + std::to_string(station) + "/" + std::to_string(ring) + "/" + std::to_string(chamber) + "/" + + std::to_string(layer); +} + std::string CSCDetId::chamberName(int chamberType) { // ME1a, ME1b, ME12, ME13, ME21, ME22, ME31, ME32, ME41, ME42 const unsigned stations[10] = {1, 1, 1, 1, 2, 2, 3, 3, 4, 4}; @@ -85,6 +91,8 @@ std::string CSCDetId::chamberName(int chamberType) { std::string CSCDetId::chamberName() const { return chamberName(endcap(), station(), ring(), chamber()); } +std::string CSCDetId::layerName() const { return layerName(endcap(), station(), ring(), chamber(), layer()); } + std::ostream& operator<<(std::ostream& os, const CSCDetId& id) { // Note that there is no endl to end the output diff --git a/DataFormats/OnlineMetaData/src/DCSRecord.cc b/DataFormats/OnlineMetaData/src/DCSRecord.cc index 7ab7bc585341d..2d112aa28c55d 100644 --- a/DataFormats/OnlineMetaData/src/DCSRecord.cc +++ b/DataFormats/OnlineMetaData/src/DCSRecord.cc @@ -6,7 +6,7 @@ const DCSRecord::ParitionNames DCSRecord::partitionNames_ = { {"EBp", "EBm", "EEp", "EEm", "HBHEa", "HBHEb", "HBHEc", "HF", "HO", "RPC", "DT0", "DTp", "DTm", "CSCp", - "CSCm", "CASTOR", "ZDC", "TIBTID", "TOB", "TECp", "TECm", "BPIX", "FPIX", "ESp", "ESm", "GEMm", "GEMp"}}; + "CSCm", "CASTOR", "ZDC", "TIBTID", "TOB", "TECp", "TECm", "BPIX", "FPIX", "ESp", "ESm", "GEMp", "GEMm"}}; DCSRecord::DCSRecord() : timestamp_(edm::Timestamp::invalidTimestamp()), magnetCurrent_(-1) {} diff --git a/DataFormats/ParticleFlowReco/interface/PFBlockElementFwd.h b/DataFormats/ParticleFlowReco/interface/PFBlockElementFwd.h deleted file mode 100644 index 1ec4e68460ee2..0000000000000 --- a/DataFormats/ParticleFlowReco/interface/PFBlockElementFwd.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef DataFormats_ParticleFlowReco_PFBlockElementFwd_h -#define DataFormats_ParticleFlowReco_PFBlockElementFwd_h - -/* #include */ - -/* #include "DataFormats/Common/interface/RefProd.h" */ -/* #include "DataFormats/Common/interface/RefVector.h" */ - -namespace reco { - class PFBlockElement; - class PFBlockElementCluster; - class PFBlockElementTrack; -} // namespace reco - -#endif diff --git a/DataFormats/ParticleFlowReco/interface/PFBlockElementSuperClusterFwd.h b/DataFormats/ParticleFlowReco/interface/PFBlockElementSuperClusterFwd.h deleted file mode 100644 index f185ddc2b8f96..0000000000000 --- a/DataFormats/ParticleFlowReco/interface/PFBlockElementSuperClusterFwd.h +++ /dev/null @@ -1,11 +0,0 @@ -#ifndef PFBlockElementSuperClusterFwd_H -#define PFBlockElementSuperClusterFwd_H -#include -#include "DataFormats/Common/interface/Ref.h" -namespace reco { - class PFBlockElementSuperCluster; - typedef std::vector PFBlockElementSuperClusterCollection; - typedef edm::Ref PFBlockElementSuperClusterRef; -} // namespace reco - -#endif diff --git a/DataFormats/ParticleFlowReco/interface/PFClusterShapeAssociation.h b/DataFormats/ParticleFlowReco/interface/PFClusterShapeAssociation.h deleted file mode 100644 index d6dccf9c9c476..0000000000000 --- a/DataFormats/ParticleFlowReco/interface/PFClusterShapeAssociation.h +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef ParticleFlowReco_PFClusterShapeAssociation_h_ -#define ParticleFlowReco_PFClusterShapeAssociation_h_ -// \class PFClusterShapeAssociation -// -// \association of ClusterShape to PFCluster -// -// -// -#include "DataFormats/EgammaReco/interface/ClusterShapeFwd.h" -#include "DataFormats/ParticleFlowReco/interface/PFClusterFwd.h" -#include "DataFormats/Common/interface/Ref.h" -#include "DataFormats/Common/interface/RefVector.h" -#include "DataFormats/Common/interface/AssociationMap.h" -#include - -namespace reco -{ - typedef - edm::AssociationMap > - PFClusterShapeAssociationCollection; - typedef - PFClusterShapeAssociationCollection::value_type PFClusterShapeAssociation; - typedef - edm::Ref PFClusterShapeAssociationRef; - typedef - edm::RefProd PFClusterShapeAssociationRefProd; - typedef - edm::RefVector PFClusterShapeAssociationRefVector; -} - -#endif diff --git a/DataFormats/ParticleFlowReco/interface/PFParticleFwd.h b/DataFormats/ParticleFlowReco/interface/PFParticleFwd.h deleted file mode 100644 index ae63ca1682f2b..0000000000000 --- a/DataFormats/ParticleFlowReco/interface/PFParticleFwd.h +++ /dev/null @@ -1,27 +0,0 @@ -#ifndef DataFormats_ParticleFlowReco_PFParticleFwd_h -#define DataFormats_ParticleFlowReco_PFParticleFwd_h -#include -#include "DataFormats/Common/interface/Ref.h" -#include "DataFormats/Common/interface/RefVector.h" -#include "DataFormats/Common/interface/RefProd.h" - -namespace reco { - class PFParticle; - - /// collection of PFParticle objects - typedef std::vector PFParticleCollection; - - /// persistent reference to PFParticle objects - typedef edm::Ref PFParticleRef; - - /// reference to PFParticle collection - typedef edm::RefProd PFParticleRefProd; - - /// vector of references to PFParticle objects all in the same collection - typedef edm::RefVector PFParticleRefVector; - - /// iterator over a vector of references to PFParticle objects - typedef PFParticleRefVector::iterator pfParticle_iterator; -} - -#endif diff --git a/DataFormats/ParticleFlowReco/interface/PFSuperClusterFwd.h b/DataFormats/ParticleFlowReco/interface/PFSuperClusterFwd.h deleted file mode 100644 index 4710147743e4e..0000000000000 --- a/DataFormats/ParticleFlowReco/interface/PFSuperClusterFwd.h +++ /dev/null @@ -1,27 +0,0 @@ -#ifndef ParticleFlowReco_PFSuperClusterFwd_h -#define ParticleFlowReco_PFSuperClusterFwd_h -#include -#include "DataFormats/Common/interface/Ref.h" -#include "DataFormats/Common/interface/RefVector.h" -#include "DataFormats/Common/interface/RefProd.h" - -namespace reco { - class PFSuperCluster; - - /// collection of PFSuperCluster objects - typedef std::vector PFSuperClusterCollection; - - /// persistent reference to PFSuperCluster objects - typedef edm::Ref PFSuperClusterRef; - - /// reference to PFSuperCluster collection - typedef edm::RefProd PFSuperClusterRefProd; - - /// vector of references to PFSuperCluster objects all in the same collection - typedef edm::RefVector PFSuperClusterRefVector; - - /// iterator over a vector of references to PFSuperCluster objects - typedef PFSuperClusterRefVector::iterator PFSuperCluster_iterator; -} - -#endif diff --git a/DataFormats/ParticleFlowReco/interface/PFTrajectoryPointFwd.h b/DataFormats/ParticleFlowReco/interface/PFTrajectoryPointFwd.h deleted file mode 100644 index fa2645f21f5df..0000000000000 --- a/DataFormats/ParticleFlowReco/interface/PFTrajectoryPointFwd.h +++ /dev/null @@ -1,27 +0,0 @@ -#ifndef DataFormats_ParticleFlowReco_PFTrajectoryPointFwd_h -#define DataFormats_ParticleFlowReco_PFTrajectoryPointFwd_h -#include -#include "DataFormats/Common/interface/Ref.h" -#include "DataFormats/Common/interface/RefVector.h" -#include "DataFormats/Common/interface/RefProd.h" - -namespace reco { - class PFTrajectoryPoint; - - /// collection of PFTrajectoryPoint objects - typedef std::vector PFTrajectoryPointCollection; - - /// persistent reference to PFTrajectoryPoint objects - typedef edm::Ref PFTrajectoryPointRef; - - /// reference to PFTrajectoryPoint collection - typedef edm::RefProd PFTrajectoryPointRefProd; - - /// vector of references to PFTrajectoryPoint objects all in the same collection - typedef edm::RefVector PFTrajectoryPointRefVector; - - /// iterator over a vector of references to PFTrajectoryPoint objects - typedef PFTrajectoryPointRefVector::iterator trajectoryPoint_iterator; -} - -#endif diff --git a/DataFormats/PatCandidates/interface/PackedCandidate.h b/DataFormats/PatCandidates/interface/PackedCandidate.h index 6bca9f611d4d0..47e79e956dfe7 100644 --- a/DataFormats/PatCandidates/interface/PackedCandidate.h +++ b/DataFormats/PatCandidates/interface/PackedCandidate.h @@ -661,6 +661,16 @@ namespace pat { setTrackProperties(tk, tk.covariance(), quality, covarianceVersion); } + void setTrackPropertiesLite(unsigned int covSchema, + unsigned int covarianceVersion, + unsigned int nHits, + unsigned int nPixelHits) { + covarianceVersion_ = covarianceVersion; + covarianceSchema_ = covSchema; + packedHits_ = + (nPixelHits & trackPixelHitsMask) | (((nHits - nPixelHits) & trackStripHitsMask) << trackStripHitsShift); + } + int numberOfPixelHits() const { return (packedHits_ & trackPixelHitsMask) + pixelLayersWithMeasurement(); } int numberOfHits() const { return (packedHits_ >> trackStripHitsShift) + stripLayersWithMeasurement() + numberOfPixelHits(); @@ -742,6 +752,7 @@ namespace pat { maybeUnpackBoth(); return dxy_; } + /// dz with respect to the PV[ipv] virtual float dz(size_t ipv = 0) const { maybeUnpackBoth(); @@ -752,6 +763,7 @@ namespace pat { maybeUnpackBoth(); return dz_; } + /// dxy with respect to another point virtual float dxy(const Point &p) const; /// dz with respect to another point @@ -786,7 +798,9 @@ namespace pat { } /// Return true if a bestTrack can be extracted from this Candidate bool hasTrackDetails() const { return (packedHits_ != 0 || packedLayers_ != 0); } - + /// Return true if the original candidate had a track associated + /// even if the PackedCandidate has no track + bool fromTrackCandidate() const { return (packedDz_ != 0 || (packedDxy_ != 0 && packedDxy_ != 32768)); } /// true if the track had the highPurity quality bit bool trackHighPurity() const { return (qualityFlags_ & trackHighPurityMask) >> trackHighPurityShift; } /// set to true if the track had the highPurity quality bit diff --git a/DataFormats/Provenance/interface/BranchDescriptionIndex.h b/DataFormats/Provenance/interface/BranchDescriptionIndex.h deleted file mode 100644 index 23a6da64024b2..0000000000000 --- a/DataFormats/Provenance/interface/BranchDescriptionIndex.h +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef DataFormats_Provenance_BranchDescriptionIndex_h -#define DataFormats_Provenance_BranchDescriptionIndex_h -// -*- C++ -*- -// -// Package: Provenance -// Class : BranchDescriptionIndex -// -/**\class BranchDescriptionIndex BranchDescriptionIndex.h DataFormats/Provenance/interface/BranchDescriptionIndex.h - - Description: Index into BranchDescription vector - - Usage: - Internally used by ProductRegistry and by Principal to quickly find data - -*/ -// -// Original Author: Chris Jones -// Created: Thu Apr 30 15:46:09 CDT 2009 -// - -// system include files - -// user include files - -// forward declarations - -namespace edm { - typedef unsigned int BranchDescriptionIndex; -} - -#endif diff --git a/DataFormats/Provenance/interface/TypeInBranchType.h b/DataFormats/Provenance/interface/TypeInBranchType.h deleted file mode 100644 index 8dd5c6a262e52..0000000000000 --- a/DataFormats/Provenance/interface/TypeInBranchType.h +++ /dev/null @@ -1,62 +0,0 @@ -#ifndef DataFormats_Provenance_TypeInBranchType_h -#define DataFormats_Provenance_TypeInBranchType_h -// -*- C++ -*- -// -// Package: Provenance -// Class : TypeInBranchType -// -/**\class TypeInBranchType TypeInBranchType.h DataFormats/Provenance/interface/TypeInBranchType.h - - Description: Pairs C++ class type and edm::BranchType - - Usage: - Used internally to ProductRegistry and for quickly finding data in Principals - -*/ -// -// Original Author: Chris Jones -// Created: Thu Apr 30 15:50:17 CDT 2009 -// - -// system include files - -// user include files -#include "DataFormats/Provenance/interface/BranchType.h" -#include "FWCore/Utilities/interface/TypeID.h" - -// forward declarations - -namespace edm { - class TypeInBranchType { - - public: - TypeInBranchType(TypeID const& iID, - BranchType const& iBranch) : - id_(iID), - branch_(iBranch) {} - - TypeID const& typeID() const { - return id_; - } - - BranchType const& branchType() const { - return branch_; - } - - bool operator<(TypeInBranchType const& iRHS) const { - if(branch_ < iRHS.branch_) { - return true; - } - if(iRHS.branch_ < branch_) { - return false; - } - return id_ < iRHS.id_; - } - private: - TypeID id_; - BranchType branch_; - }; - -} - -#endif diff --git a/DataFormats/RPCDigi/interface/RPCDigiL1Linkfwd.h b/DataFormats/RPCDigi/interface/RPCDigiL1Linkfwd.h deleted file mode 100644 index 429c7ab205921..0000000000000 --- a/DataFormats/RPCDigi/interface/RPCDigiL1Linkfwd.h +++ /dev/null @@ -1,4 +0,0 @@ -#ifndef RPCOBJECTS_RPCDIGIL1LINKFWD_H -#define RPCOBJECTS_RPCDIGIL1LINKFWD_H -class RPCDigiL1Link; -#endif // RPCOBJECTS_RPCDIGIL1LINKFWD_H diff --git a/DataFormats/SiPixelDetId/README.md b/DataFormats/SiPixelDetId/README.md index a7e70e623ceab..974688cfaacef 100644 --- a/DataFormats/SiPixelDetId/README.md +++ b/DataFormats/SiPixelDetId/README.md @@ -1,11 +1,18 @@ -2016.05.11 ATricomi+EMigliore (INFN) changes in PixelChannelIdentifier.cc -Change PixelChannelIdentifier::thePacking() to have indexes spanning the full module in case of small pixels (phase II InnerPixel) +Changes - timeline +##### 2016.05.11 ATricomi+EMigliore (INFN) changes in PixelChannelIdentifier.cc +- Change PixelChannelIdentifier::thePacking() to have indexes spanning the full module in case of small pixels (phase II InnerPixel) -PixelChannelIdentifier::thePacking( 11, 11, 0, 10); // It was row=8,col=9, time=4, adc=11 +##### 2021.08.16. Reserve one bit for the flag in pixel digi packing - see PRs #34509 and #34662 +- Change packing from (11, **11**, **0**, 10) -> (11, **10**, **1**, 10), reducing row x column to 2048x1024; and time -> flag -Reserved bits -row = 11 -> 2^11-1 = 2047 -col = 11 -> 2^11-1 = 2047 -time = 0 (not used) -adc = 10 -> 2^10-1 = 1023 +--- +#### PixelChannelIdentifier::thePacking( 11, 10, 1, 10); // row, column, flag, adc +// Before phase II changes, it was row=8,col=9, time=4, adc=11 +// Before introducing the flag, it was row=11, col=11, time=0, adc=10 + +#### Reserved bits: +- row = 11 -> 2^11-1 = 2047 +- col = 10 -> 2^10-1 = 1023 +- flag = 1 -> 0/1 +- adc = 10 -> 2^10-1 = 1023 diff --git a/DataFormats/SiPixelDetId/interface/PixelChannelIdentifier.h b/DataFormats/SiPixelDetId/interface/PixelChannelIdentifier.h index 9c79103ec17d0..3f909412910ec 100644 --- a/DataFormats/SiPixelDetId/interface/PixelChannelIdentifier.h +++ b/DataFormats/SiPixelDetId/interface/PixelChannelIdentifier.h @@ -1,16 +1,17 @@ -#ifndef DATAFORMATS_PIXELCHANMNELIDENTIFIER_H -#define DATAFORMATS_PIXELCHANMNELIDENTIFIER_H +#ifndef DataFormats_SiPixelDetId_interface_PixelChannelIdentifier_h +#define DataFormats_SiPixelDetId_interface_PixelChannelIdentifier_h #include +#include -namespace pixelchanelidentifierimpl { +namespace pixelchannelidentifierimpl { /** * Pack the pixel information to use less memory */ class Packing { public: - using PackedDigiType = unsigned int; + using PackedDigiType = uint32_t; // Constructor: pre-computes masks and shifts from field widths constexpr Packing(unsigned int row_w, unsigned int column_w, unsigned int flag_w, unsigned int adc_w) @@ -30,14 +31,14 @@ namespace pixelchanelidentifierimpl { max_column(column_mask), max_adc(adc_mask) {} - const int row_width; - const int column_width; - const int adc_width; + const uint32_t row_width; + const uint32_t column_width; + const uint32_t adc_width; - const int row_shift; - const int column_shift; - const int flag_shift; - const int adc_shift; + const uint32_t row_shift; + const uint32_t column_shift; + const uint32_t flag_shift; + const uint32_t adc_shift; const PackedDigiType row_mask; const PackedDigiType column_mask; @@ -49,7 +50,7 @@ namespace pixelchanelidentifierimpl { const int max_column; const int max_adc; }; -} // namespace pixelchanelidentifierimpl +} // namespace pixelchannelidentifierimpl class PixelChannelIdentifier { public: @@ -64,7 +65,7 @@ class PixelChannelIdentifier { static int pixelToChannel(int row, int col) { return (row << thePacking.column_width) | col; } - using Packing = pixelchanelidentifierimpl::Packing; + using Packing = pixelchannelidentifierimpl::Packing; public: constexpr static Packing packing() { return Packing(8, 9, 4, 11); } @@ -72,4 +73,4 @@ class PixelChannelIdentifier { constexpr static Packing thePacking = {11, 10, 1, 10}; }; -#endif +#endif // DataFormats_SiPixelDetId_interface_PixelChannelIdentifier_h diff --git a/DataFormats/SiPixelDigi/interface/PixelDigiCollectionfwd.h b/DataFormats/SiPixelDigi/interface/PixelDigiCollectionfwd.h deleted file mode 100644 index 9e5062017f007..0000000000000 --- a/DataFormats/SiPixelDigi/interface/PixelDigiCollectionfwd.h +++ /dev/null @@ -1,4 +0,0 @@ -#ifndef TRACKINGOBJECTS_PIXELDIGICOLLECTIONFWD_H -#define TRACKINGOBJECTS_PIXELDIGICOLLECTIONFWD_H -class PixelDigiCollection; -#endif // TRACKINGOBJECTS_PIXELDIGICOLLECTIONFWD_H diff --git a/DataFormats/SiStripCommon/interface/ConstantsForSummaryPlots.h b/DataFormats/SiStripCommon/interface/ConstantsForSummaryPlots.h deleted file mode 100644 index 7a0bd46627698..0000000000000 --- a/DataFormats/SiStripCommon/interface/ConstantsForSummaryPlots.h +++ /dev/null @@ -1,10 +0,0 @@ - -#ifndef DataFormats_SiStripCommon_ConstantsForSummaryPlots_H -#define DataFormats_SiStripCommon_ConstantsForSummaryPlots_H - -#include "DataFormats/SiStripCommon/interface/ConstantsForMonitorable.h" -#include "DataFormats/SiStripCommon/interface/ConstantsForPresentation.h" - -#endif // DataFormats_SiStripCommon_ConstantsForSummaryPlots_H - - diff --git a/DataFormats/SiStripDigi/interface/SiStripDigifwd.h b/DataFormats/SiStripDigi/interface/SiStripDigifwd.h deleted file mode 100644 index 5287a400d6d3b..0000000000000 --- a/DataFormats/SiStripDigi/interface/SiStripDigifwd.h +++ /dev/null @@ -1,4 +0,0 @@ -#ifndef TRACKINGOBJECTS_SISTRIPDIGIFWD_H -#define TRACKINGOBJECTS_SISTRIPDIGIFWD_H -class SiStripDigi; -#endif // TRACKINGOBJECTS_SISTRIPDIGIFWD_H diff --git a/DataFormats/TrackReco/interface/HitPattern.h b/DataFormats/TrackReco/interface/HitPattern.h index 6b5b8d1e1506e..cb36daa3d16de 100644 --- a/DataFormats/TrackReco/interface/HitPattern.h +++ b/DataFormats/TrackReco/interface/HitPattern.h @@ -33,7 +33,7 @@ // | mu = 0 | DT = 1 | 4*(stat-1)+superlayer | | hit type = 0-3 | // | mu = 0 | CSC = 2 | 4*(stat-1)+(ring-1) | | hit type = 0-3 | // | mu = 0 | RPC = 3 | 4*(stat-1)+2*layer+region | | hit type = 0-3 | -// | mu = 0 | GEM = 4 | 2*(stat-1)+2*(layer-1) | | hit type = 0-3 | +// | mu = 0 | GEM = 4 | 1xxx=st0, 0yxx=st y-1 la x| | hit type = 0-3 | // | mu = 0 | ME0 = 5 | roll | | hit type = 0-3 | // | mtd = 2 | BTL = 1 | moduleType = 1-3 | | hit type = 0-3 | // | mtd = 2 | ETL = 2 | ring = 1-12 | | hit type = 0-3 | @@ -214,7 +214,7 @@ namespace reco { /// GEM station: 1,2. Only valid for muon GEM patterns, of course. static uint16_t getGEMStation(uint16_t pattern); - /// GEM layer: 1,2. Only valid for muon GEM patterns, of course. + /// GEM layer: 1-6 for station 0, 1-2 for stations 1 and 2. Only valid for muon GEM patterns, of course. static uint16_t getGEMLayer(uint16_t pattern); /// BTL Module type: 1,2,3. Only valid for BTL patterns of course. @@ -746,7 +746,9 @@ namespace reco { return ((pattern >> HitTypeOffset) & HitTypeMask); } - inline uint16_t HitPattern::getMuonStation(uint16_t pattern) { return (getSubSubStructure(pattern) >> 2) + 1; } + inline uint16_t HitPattern::getMuonStation(uint16_t pattern) { + return muonGEMHitFilter(pattern) ? getGEMStation(pattern) : (getSubSubStructure(pattern) >> 2) + 1; + } inline uint16_t HitPattern::getDTSuperLayer(uint16_t pattern) { return (getSubSubStructure(pattern) & 3); } @@ -766,11 +768,11 @@ namespace reco { inline uint16_t HitPattern::getRPCregion(uint16_t pattern) { return getSubSubStructure(pattern) & 1; } ////////////////////////////// GEM - inline uint16_t HitPattern::getGEMStation(uint16_t pattern) - - { - uint16_t sss = getSubSubStructure(pattern), stat = sss >> 1; - return stat + 1; + inline uint16_t HitPattern::getGEMStation(uint16_t pattern) { + uint16_t sss = getSubSubStructure(pattern); + if (sss & 0b1000) + return 0; + return (sss >> 2) + 1; } /// MTD @@ -778,7 +780,12 @@ namespace reco { inline uint16_t HitPattern::getETLRing(uint16_t pattern) { return getSubSubStructure(pattern); } - inline uint16_t HitPattern::getGEMLayer(uint16_t pattern) { return (getSubSubStructure(pattern) & 1) + 1; } + inline uint16_t HitPattern::getGEMLayer(uint16_t pattern) { + uint16_t sss = getSubSubStructure(pattern); + if (sss & 0b1000) + return (sss & 0b0111) + 1; + return (sss & 0b11) + 1; + } inline bool HitPattern::validHitFilter(uint16_t pattern) { return getHitType(pattern) == HitPattern::VALID; } diff --git a/DataFormats/TrackReco/src/HitPattern.cc b/DataFormats/TrackReco/src/HitPattern.cc index 8f13a068125e0..18a5d33bfc5d2 100644 --- a/DataFormats/TrackReco/src/HitPattern.cc +++ b/DataFormats/TrackReco/src/HitPattern.cc @@ -99,8 +99,17 @@ namespace { } break; case MuonSubdetId::GEM: { GEMDetId gemid(id.rawId()); - layer = ((gemid.station() - 1) << 2); - layer |= abs(gemid.layer() - 1); + { + uint16_t st = gemid.station(); + uint16_t la = gemid.layer(); + if (st == 0) { + layer |= 0b1000; + layer |= (la - 1); + } else { + layer |= (st - 1) << 2; + layer |= (la - 1); + } + } } break; case MuonSubdetId::ME0: { ME0DetId me0id(id.rawId()); @@ -818,7 +827,8 @@ void HitPattern::printHitPattern(HitCategory category, int position, std::ostrea } else if (muonRPCHitFilter(pattern)) { stream << "\trpc " << (getRPCregion(pattern) ? "endcaps" : "barrel") << ", layer " << getRPCLayer(pattern); } else if (muonGEMHitFilter(pattern)) { - stream << "\tgem " << (getGEMLayer(pattern) ? "layer1" : "layer2") << ", station " << getGEMStation(pattern); + stream << "\tgem " + << " station " << getGEMStation(pattern) << ", layer" << getGEMLayer(pattern); } else if (muonME0HitFilter(pattern)) { stream << "\tme0 "; } else { @@ -872,16 +882,16 @@ uint16_t HitPattern::isStereo(DetId i, const TrackerTopology& ttopo) { } int HitPattern::muonStations(int subdet, int hitType) const { - int stations[4] = {0, 0, 0, 0}; + int stations[5] = {0, 0, 0, 0, 0}; for (int i = beginTrackHits; i < endTrackHits; ++i) { uint16_t pattern = getHitPatternByAbsoluteIndex(i); if (muonHitFilter(pattern) && (subdet == 0 || int(getSubStructure(pattern)) == subdet) && (hitType == -1 || int(getHitType(pattern)) == hitType)) { - stations[getMuonStation(pattern) - 1] = 1; + stations[getMuonStation(pattern)] = 1; } } - return stations[0] + stations[1] + stations[2] + stations[3]; + return stations[0] + stations[1] + stations[2] + stations[3] + stations[4]; } int HitPattern::innermostMuonStationWithHits(int hitType) const { diff --git a/DataFormats/TrackerRecHit2D/interface/SiPixelRecHitfwd.h b/DataFormats/TrackerRecHit2D/interface/SiPixelRecHitfwd.h deleted file mode 100644 index 1e5b57c035863..0000000000000 --- a/DataFormats/TrackerRecHit2D/interface/SiPixelRecHitfwd.h +++ /dev/null @@ -1,4 +0,0 @@ -#ifndef DataFormats_SiPixelRecHitFWD_H -#define DataFormats_SiPixelRecHitFWD_H -class SiPixelRecHit; -#endif // diff --git a/DataFormats/TrajectorySeed/interface/BasicTrajectorySeed.h b/DataFormats/TrajectorySeed/interface/BasicTrajectorySeed.h deleted file mode 100644 index 12c0a9bf9db97..0000000000000 --- a/DataFormats/TrajectorySeed/interface/BasicTrajectorySeed.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef DATAFORMATS_TRAJECTORYSEED_BASICTRAJECTORYSEED_h -#define DATAFORMATS_TRAJECTORYSEED_BASICTRAJECTORYSEED_h - - -#include "DataFormats/TrajectorySeed/interface/TrajectorySeed.h" -typedef TrajectorySeed BasicTrajectorySeed; - - -#endif diff --git a/DetectorDescription/DDCMS/interface/DDParsingContext.h b/DetectorDescription/DDCMS/interface/DDParsingContext.h index 135571f0fa425..66acb4b1f2d0e 100644 --- a/DetectorDescription/DDCMS/interface/DDParsingContext.h +++ b/DetectorDescription/DDCMS/interface/DDParsingContext.h @@ -27,7 +27,8 @@ namespace cms { namespaces.emplace_back(""); if (makePayload) { rotRevMap.reserve(3000); - allCompMaterials.reserve(400); + compMaterialsVec.reserve(400); + compMaterialsRefs.reserve(400); } } @@ -84,7 +85,8 @@ namespace cms { std::vector namespaces; std::unordered_map> unresolvedMaterials; - std::unordered_map>> allCompMaterials; + std::vector> compMaterialsVec; + std::unordered_map> compMaterialsRefs; std::unordered_map> unresolvedVectors; std::unordered_map, diff --git a/DetectorDescription/DDCMS/plugins/DDDetectorESProducer.cc b/DetectorDescription/DDCMS/plugins/DDDetectorESProducer.cc index 103d46920153f..640e24c1db61d 100644 --- a/DetectorDescription/DDCMS/plugins/DDDetectorESProducer.cc +++ b/DetectorDescription/DDCMS/plugins/DDDetectorESProducer.cc @@ -70,6 +70,9 @@ DDDetectorESProducer::DDDetectorESProducer(const ParameterSet& iConfig) rootDDName_(iConfig.getParameter("rootDDName")), label_(iConfig.getParameter("label")) { usesResources({edm::ESSharedResourceNames::kDD4Hep}); + edm::LogVerbatim("Geometry") << "DDDetectorESProducer::fromDB " << fromDB_ << " appendToDataLabel " + << appendToDataLabel_ << " rootDDName " << rootDDName_ << " label " << label_ + << " confGeomXMLFiles " << confGeomXMLFiles_; if (rootDDName_ == "MagneticFieldVolumes:MAGF" || rootDDName_ == "cmsMagneticField:MAGF") { auto c = setWhatProduced(this, &DDDetectorESProducer::produceMagField, diff --git a/DetectorDescription/DDCMS/plugins/dd4hep/DDDefinitions2Objects.cc b/DetectorDescription/DDCMS/plugins/dd4hep/DDDefinitions2Objects.cc index 08d81af2650c1..7b4f3897ec5db 100644 --- a/DetectorDescription/DDCMS/plugins/dd4hep/DDDefinitions2Objects.cc +++ b/DetectorDescription/DDCMS/plugins/dd4hep/DDDefinitions2Objects.cc @@ -603,6 +603,9 @@ void Converter::operator()(xml_h element) const { #endif + if (ns.context()->makePayload) { + ns.context()->compMaterialsVec.emplace_back(std::make_pair(nam, density)); + } for (composites.reset(); composites; ++composites) { xml_dim_t xfrac(composites); xml_dim_t xfrac_mat(xfrac.child(DD_CMU(rMaterial))); @@ -610,8 +613,7 @@ void Converter::operator()(xml_h element) const { string fracname = ns.realName(xfrac_mat.nameStr()); if (ns.context()->makePayload) { - ns.context()->allCompMaterials[nam].first = density; - ns.context()->allCompMaterials[nam].second.emplace_back( + ns.context()->compMaterialsRefs[nam].emplace_back( cms::DDParsingContext::CompositeMaterial(ns.prepend(fracname), fraction)); } TGeoMaterial* frac_mat = mgr.GetMaterial(fracname.c_str()); diff --git a/DetectorDescription/DDCMS/src/DDNamespace.cc b/DetectorDescription/DDCMS/src/DDNamespace.cc index e71aab1b3429c..1a624db1936cf 100644 --- a/DetectorDescription/DDCMS/src/DDNamespace.cc +++ b/DetectorDescription/DDCMS/src/DDNamespace.cc @@ -6,6 +6,8 @@ #include "XML/XML.h" #include +#include +#include #include #include @@ -14,7 +16,7 @@ using namespace cms; double cms::rotation_utils::roundBinary(double value) { value = cms_rounding::roundIfNear0(value); - static constexpr double roundingVal = 1 << 14; + static constexpr double roundingVal = 1 << 24; value = (round(value * roundingVal) / roundingVal); // Set -0 to 0 return (cms_rounding::roundIfNear0(value)); @@ -24,7 +26,10 @@ std::string cms::rotation_utils::rotHash(const Double_t* rot) { std::string hashVal; for (int row = 0; row <= 2; ++row) { for (int col = 0; col <= 2; ++col) { - hashVal += std::to_string(roundBinary(rot[(3 * row) + col])); + std::ostringstream numStream; + numStream << std::fixed << std::setprecision(7); + numStream << roundBinary(rot[(3 * row) + col]); + hashVal += numStream.str(); } } return (hashVal); @@ -36,7 +41,10 @@ std::string cms::rotation_utils::rotHash(const dd4hep::Rotation3D& rot) { matrix.assign(9, 0.); rot.GetComponents(matrix.begin()); for (double val : matrix) { - hashVal += std::to_string(roundBinary(val)); + std::ostringstream numStream; + numStream << std::fixed << std::setprecision(7); + numStream << roundBinary(val); + hashVal += numStream.str(); } return (hashVal); } @@ -152,7 +160,10 @@ void DDNamespace::addRotation(const string& name, const dd4hep::Rotation3D& rot) m_context->rotations[n] = rot; if (m_context->makePayload) { string hashVal = cms::rotation_utils::rotHash(rot); - m_context->rotRevMap[hashVal] = n; + if (m_context->rotRevMap.find(hashVal) == m_context->rotRevMap.end()) { + // Only set a rotation that is not already in the map + m_context->rotRevMap[hashVal] = n; + } } } diff --git a/DetectorDescription/OfflineDBLoader/interface/DDCoreToDDXMLOutput.h b/DetectorDescription/OfflineDBLoader/interface/DDCoreToDDXMLOutput.h index 69c6ebf2ea5ac..5531f71c90705 100644 --- a/DetectorDescription/OfflineDBLoader/interface/DDCoreToDDXMLOutput.h +++ b/DetectorDescription/OfflineDBLoader/interface/DDCoreToDDXMLOutput.h @@ -43,9 +43,10 @@ struct DDCoreToDDXMLOutput { void element(const TGeoMaterial* element, std::ostream& xos); void material(const DDMaterial& material, std::ostream& xos); - void material( - const std::pair>>& material, - std::ostream& xos); + void material(const std::string& matName, + double density, + const std::vector& matRefs, + std::ostream& xos); void rotation(const DDRotation& rotation, std::ostream& xos, const std::string& rotn = ""); void rotation(const dd4hep::Rotation3D& rotation, diff --git a/DetectorDescription/OfflineDBLoader/plugins/OutputDD4hepToDDL.cc b/DetectorDescription/OfflineDBLoader/plugins/OutputDD4hepToDDL.cc index caa71771f1f6b..c54fa87f3a52f 100644 --- a/DetectorDescription/OfflineDBLoader/plugins/OutputDD4hepToDDL.cc +++ b/DetectorDescription/OfflineDBLoader/plugins/OutputDD4hepToDDL.cc @@ -123,8 +123,9 @@ void OutputDD4hepToDDL::beginRun(const edm::Run &, edm::EventSetup const &es) { out.element(dynamic_cast(iter), *m_xos); } // Output composite materials - for (const auto &it : parsingContext->allCompMaterials) { - out.material(it, *m_xos); + for (const auto &it : parsingContext->compMaterialsVec) { + const std::string &matName = it.first; + out.material(matName, it.second, parsingContext->compMaterialsRefs[matName], *m_xos); } (*m_xos) << "" << std::endl; (*m_xos) << "" << std::endl; diff --git a/DetectorDescription/OfflineDBLoader/src/DDCoreToDDXMLOutput.cc b/DetectorDescription/OfflineDBLoader/src/DDCoreToDDXMLOutput.cc index f99be33e89f6c..422d6605e4b86 100644 --- a/DetectorDescription/OfflineDBLoader/src/DDCoreToDDXMLOutput.cc +++ b/DetectorDescription/OfflineDBLoader/src/DDCoreToDDXMLOutput.cc @@ -39,6 +39,9 @@ static inline constexpr NumType convertGPerCcToMgPerCc(NumType gPerCc) // g/cm^ return (gPerCc * 1000.); } +static constexpr double tol0 = 1.e-11; // Tiny values to be considered equal to 0 +static constexpr double reflectTol = 1.0e-3; // Tolerance for recognizing reflections; Geant4-compatible + namespace cms::rotation_utils { /* For debugging static double determinant(const dd4hep::Rotation3D &rot) { @@ -51,7 +54,8 @@ namespace cms::rotation_utils { } */ - static const std::string identityHash("1.0000000.0000000.0000000.0000001.0000000.0000000.0000000.0000001.000000"); + static const std::string identityHash( + "1.00000000.00000000.00000000.00000001.00000000.00000000.00000000.00000001.0000000"); static void addRotWithNewName(cms::DDNamespace& ns, std::string& name, const dd4hep::Rotation3D& rot) { const dd4hep::Rotation3D& rot2 = rot; @@ -61,15 +65,15 @@ namespace cms::rotation_utils { static void addRotWithNewName(cms::DDNamespace& ns, std::string& name, const Double_t* rot) { using namespace cms_rounding; - dd4hep::Rotation3D rot2(roundIfNear0(rot[0]), - roundIfNear0(rot[1]), - roundIfNear0(rot[2]), - roundIfNear0(rot[3]), - roundIfNear0(rot[4]), - roundIfNear0(rot[5]), - roundIfNear0(rot[6]), - roundIfNear0(rot[7]), - roundIfNear0(rot[8])); + dd4hep::Rotation3D rot2(roundIfNear0(rot[0], tol0), + roundIfNear0(rot[1], tol0), + roundIfNear0(rot[2], tol0), + roundIfNear0(rot[3], tol0), + roundIfNear0(rot[4], tol0), + roundIfNear0(rot[5], tol0), + roundIfNear0(rot[6], tol0), + roundIfNear0(rot[7], tol0), + roundIfNear0(rot[8], tol0)); addRotWithNewName(ns, name, rot2); } @@ -115,8 +119,12 @@ void DDCoreToDDXMLOutput::solid(const dd4hep::Solid& solid, const cms::DDParsing xos << " y=\"" << trans[1] << "*mm\""; xos << " z=\"" << trans[2] << "*mm\""; xos << "/>" << std::endl; - std::string rotNameStr = cms::rotation_utils::rotName(rs.rightMatrix()->GetRotationMatrix(), context); - xos << "" << std::endl; + auto rot = rs.rightMatrix()->GetRotationMatrix(); + // The identity rotation can be omitted. + if (cms::rotation_utils::rotHash(rot) != cms::rotation_utils::identityHash) { + std::string rotNameStr = cms::rotation_utils::rotName(rot, context); + xos << "" << std::endl; + } if (shape == cms::DDSolidShape::ddunion) { xos << "" << std::endl; } else if (shape == cms::DDSolidShape::ddsubtraction) { @@ -610,16 +618,15 @@ void DDCoreToDDXMLOutput::material(const DDMaterial& material, std::ostream& xos } } -void DDCoreToDDXMLOutput::material( - const std::pair>>& material, - std::ostream& xos) { - xos << "& matRefs, + std::ostream& xos) { + xos << "" << std::endl; - auto compIter = material.second.second.begin(); - for (; compIter != material.second.second.end(); ++compIter) { + for (auto compIter = matRefs.begin(); compIter != matRefs.end(); ++compIter) { xos << "fraction << "\">" << std::endl; xos << "name << "\"/>" << std::endl; @@ -655,19 +662,21 @@ void DDCoreToDDXMLOutput::element(const TGeoMaterial* material, std::ostream& xo } void DDCoreToDDXMLOutput::rotation(const DDRotation& rotation, std::ostream& xos, const std::string& rotn) { - double tol = 1.0e-3; // Geant4 compatible DD3Vector x, y, z; rotation.rotation().GetComponents(x, y, z); double a, b, c; x.GetCoordinates(a, b, c); - x.SetCoordinates(cms_rounding::roundIfNear0(a), cms_rounding::roundIfNear0(b), cms_rounding::roundIfNear0(c)); + x.SetCoordinates( + cms_rounding::roundIfNear0(a, tol0), cms_rounding::roundIfNear0(b, tol0), cms_rounding::roundIfNear0(c, tol0)); y.GetCoordinates(a, b, c); - y.SetCoordinates(cms_rounding::roundIfNear0(a), cms_rounding::roundIfNear0(b), cms_rounding::roundIfNear0(c)); + y.SetCoordinates( + cms_rounding::roundIfNear0(a, tol0), cms_rounding::roundIfNear0(b, tol0), cms_rounding::roundIfNear0(c, tol0)); z.GetCoordinates(a, b, c); - z.SetCoordinates(cms_rounding::roundIfNear0(a), cms_rounding::roundIfNear0(b), cms_rounding::roundIfNear0(c)); + z.SetCoordinates( + cms_rounding::roundIfNear0(a, tol0), cms_rounding::roundIfNear0(b, tol0), cms_rounding::roundIfNear0(c, tol0)); double check = (x.Cross(y)).Dot(z); // in case of a LEFT-handed orthogonal system // this must be -1 - bool reflection((1. - check) > tol); + bool reflection((1. - check) > reflectTol); std::string rotName = rotation.toString(); if (rotName == ":") { if (!rotn.empty()) { @@ -686,31 +695,33 @@ void DDCoreToDDXMLOutput::rotation(const DDRotation& rotation, std::ostream& xos } using namespace cms_rounding; xos << "name=\"" << rotName << "\"" - << " phiX=\"" << roundIfNear0(convertRadToDeg(x.phi()), 4.e-4) << "*deg\"" - << " thetaX=\"" << roundIfNear0(convertRadToDeg(x.theta()), 4.e-4) << "*deg\"" - << " phiY=\"" << roundIfNear0(convertRadToDeg(y.phi()), 4.e-4) << "*deg\"" - << " thetaY=\"" << roundIfNear0(convertRadToDeg(y.theta()), 4.e-4) << "*deg\"" - << " phiZ=\"" << roundIfNear0(convertRadToDeg(z.phi()), 4.e-4) << "*deg\"" - << " thetaZ=\"" << roundIfNear0(convertRadToDeg(z.theta()), 4.e-4) << "*deg\"/>" << std::endl; + << " phiX=\"" << roundIfNear0(convertRadToDeg(x.phi()), tol0) << "*deg\"" + << " thetaX=\"" << roundIfNear0(convertRadToDeg(x.theta()), tol0) << "*deg\"" + << " phiY=\"" << roundIfNear0(convertRadToDeg(y.phi()), tol0) << "*deg\"" + << " thetaY=\"" << roundIfNear0(convertRadToDeg(y.theta()), tol0) << "*deg\"" + << " phiZ=\"" << roundIfNear0(convertRadToDeg(z.phi()), tol0) << "*deg\"" + << " thetaZ=\"" << roundIfNear0(convertRadToDeg(z.theta()), tol0) << "*deg\"/>" << std::endl; } void DDCoreToDDXMLOutput::rotation(const dd4hep::Rotation3D& rotation, std::ostream& xos, const cms::DDParsingContext& context, const std::string& rotn) { - double tol = 1.0e-3; // Geant4 compatible ROOT::Math::XYZVector x, y, z; rotation.GetComponents(x, y, z); double a, b, c; x.GetCoordinates(a, b, c); - x.SetCoordinates(cms_rounding::roundIfNear0(a), cms_rounding::roundIfNear0(b), cms_rounding::roundIfNear0(c)); + x.SetCoordinates( + cms_rounding::roundIfNear0(a, tol0), cms_rounding::roundIfNear0(b, tol0), cms_rounding::roundIfNear0(c, tol0)); y.GetCoordinates(a, b, c); - y.SetCoordinates(cms_rounding::roundIfNear0(a), cms_rounding::roundIfNear0(b), cms_rounding::roundIfNear0(c)); + y.SetCoordinates( + cms_rounding::roundIfNear0(a, tol0), cms_rounding::roundIfNear0(b, tol0), cms_rounding::roundIfNear0(c, tol0)); z.GetCoordinates(a, b, c); - z.SetCoordinates(cms_rounding::roundIfNear0(a), cms_rounding::roundIfNear0(b), cms_rounding::roundIfNear0(c)); + z.SetCoordinates( + cms_rounding::roundIfNear0(a, tol0), cms_rounding::roundIfNear0(b, tol0), cms_rounding::roundIfNear0(c, tol0)); double check = (x.Cross(y)).Dot(z); // in case of a LEFT-handed orthogonal system // this must be -1 - bool reflection((1. - check) > tol); + bool reflection((1. - check) > reflectTol); if (!reflection) { xos << "" << std::endl; + << " phiX=\"" << roundIfNear0(convertRadToDeg(x.phi()), tol0) << "*deg\"" + << " thetaX=\"" << roundIfNear0(convertRadToDeg(x.theta()), tol0) << "*deg\"" + << " phiY=\"" << roundIfNear0(convertRadToDeg(y.phi()), tol0) << "*deg\"" + << " thetaY=\"" << roundIfNear0(convertRadToDeg(y.theta()), tol0) << "*deg\"" + << " phiZ=\"" << roundIfNear0(convertRadToDeg(z.phi()), tol0) << "*deg\"" + << " thetaZ=\"" << roundIfNear0(convertRadToDeg(z.theta()), tol0) << "*deg\"/>" << std::endl; } void DDCoreToDDXMLOutput::logicalPart(const DDLogicalPart& lp, std::ostream& xos) { diff --git a/EventFilter/CSCRawToDigi/interface/CSCDigiToRaw.h b/EventFilter/CSCRawToDigi/interface/CSCDigiToRaw.h index 54720901e5596..582ff89f7b4fb 100644 --- a/EventFilter/CSCRawToDigi/interface/CSCDigiToRaw.h +++ b/EventFilter/CSCRawToDigi/interface/CSCDigiToRaw.h @@ -81,6 +81,7 @@ class CSCDigiToRaw { uint16_t formatVersion_; bool packEverything_; bool usePreTriggers_; + bool packByCFEB_; }; #endif diff --git a/EventFilter/CSCRawToDigi/interface/CSCDigiToRawAccept.h b/EventFilter/CSCRawToDigi/interface/CSCDigiToRawAccept.h new file mode 100644 index 0000000000000..9eae22fef42c7 --- /dev/null +++ b/EventFilter/CSCRawToDigi/interface/CSCDigiToRawAccept.h @@ -0,0 +1,58 @@ +#ifndef EventFilter_CSCRawToDigi_CSCDigiToRawAccept_h +#define EventFilter_CSCRawToDigi_CSCDigiToRawAccept_h + +/** \class CSCDigiToRawAccept + * + * Static class with conditions to accept CSC digis in the Digi-to-Raw step + * + * \author Sven Dildick - Rice + */ + +#include "DataFormats/CSCDigi/interface/CSCALCTDigiCollection.h" +#include "DataFormats/CSCDigi/interface/CSCCLCTDigiCollection.h" +#include "DataFormats/CSCDigi/interface/CSCCLCTPreTriggerCollection.h" +#include "DataFormats/CSCDigi/interface/CSCCLCTPreTriggerDigiCollection.h" + +namespace CSCDigiToRawAccept { + + // takes layer ID, converts to chamber ID, switching ME1A to ME11 + CSCDetId chamberID(const CSCDetId& cscDetId); + + /* Was there a trigger primitive in the BX range between bxMin and bxMax? + The nominalBX argument is 3 for ALCTs and 7 for CLCTs. This is subtracted + from the object BX before we check if it is in the BX range. + + Triggers in ME1/1 should always be assigned with ring number equal to 1. + Distinguishing CLCTs in ME1/a and ME1/b is done with the CLCT half-strip, + or CLCT CFEB. + */ + template + bool accept(const CSCDetId& cscId, const LCTCollection& lcts, int bxMin, int bxMax, int nominalBX) { + if (bxMin == -999) + return true; + CSCDetId chamberId = chamberID(cscId); + typename LCTCollection::Range lctRange = lcts.get(chamberId); + bool result = false; + for (typename LCTCollection::const_iterator lctItr = lctRange.first; lctItr != lctRange.second; ++lctItr) { + int bx = lctItr->getBX() - nominalBX; + if (bx >= bxMin && bx <= bxMax) { + result = true; + break; + } + } + return result; + } + + // older implementation for CLCT pretrigger objects that only have BX information + bool accept(const CSCDetId& cscId, const CSCCLCTPreTriggerCollection& lcts, int bxMin, int bxMax, int nominalBX); + + // newer implementation for CLCT pretrigger objects that have BX and CFEB information + bool accept(const CSCDetId& cscId, + const CSCCLCTPreTriggerDigiCollection& lcts, + int bxMin, + int bxMax, + int nominalBX, + std::vector& preTriggerInCFEB); +}; // namespace CSCDigiToRawAccept + +#endif diff --git a/EventFilter/CSCRawToDigi/plugins/CSCDigiToRawModule.cc b/EventFilter/CSCRawToDigi/plugins/CSCDigiToRawModule.cc index f82b010362024..e6d3db41fa416 100644 --- a/EventFilter/CSCRawToDigi/plugins/CSCDigiToRawModule.cc +++ b/EventFilter/CSCRawToDigi/plugins/CSCDigiToRawModule.cc @@ -105,6 +105,7 @@ void CSCDigiToRawModule::fillDescriptions(edm::ConfigurationDescriptions& descri desc.add("usePreTriggers", true)->setComment("Set to false if CSCCLCTPreTrigger digis are not available"); desc.add("packEverything", false) ->setComment("Set to true to disable trigger-related constraints on readout data"); + desc.add("packByCFEB", false)->setComment("Pack strip digis using CFEB info"); desc.add("useGEMs", false)->setComment("Pack GEM trigger data"); desc.add("useCSCShowers", false)->setComment("Pack CSC shower trigger data"); diff --git a/EventFilter/CSCRawToDigi/src/CSCDigiToRaw.cc b/EventFilter/CSCRawToDigi/src/CSCDigiToRaw.cc index 5e9d5848491af..343cd9eff7874 100644 --- a/EventFilter/CSCRawToDigi/src/CSCDigiToRaw.cc +++ b/EventFilter/CSCRawToDigi/src/CSCDigiToRaw.cc @@ -7,6 +7,7 @@ #include "DataFormats/MuonDetId/interface/CSCDetId.h" #include "DataFormats/CSCDigi/interface/CSCConstants.h" #include "EventFilter/CSCRawToDigi/interface/CSCDigiToRaw.h" +#include "EventFilter/CSCRawToDigi/interface/CSCDigiToRawAccept.h" #include "EventFilter/CSCRawToDigi/interface/CSCDCCEventData.h" #include "DataFormats/FEDRawData/interface/FEDRawDataCollection.h" #include "DataFormats/FEDRawData/interface/FEDRawData.h" @@ -25,87 +26,6 @@ using namespace edm; using namespace std; -namespace cscd2r { - /// takes layer ID, converts to chamber ID, switching ME1A to ME11 - CSCDetId chamberID(const CSCDetId& cscDetId) { - CSCDetId chamberId = cscDetId.chamberId(); - if (chamberId.ring() == 4) { - chamberId = CSCDetId(chamberId.endcap(), chamberId.station(), 1, chamberId.chamber(), 0); - } - return chamberId; - } - - template - bool accept( - const CSCDetId& cscId, const LCTCollection& lcts, int bxMin, int bxMax, int nominalBX, bool me1abCheck = false) { - if (bxMin == -999) - return true; - CSCDetId chamberId = chamberID(cscId); - typename LCTCollection::Range lctRange = lcts.get(chamberId); - bool result = false; - for (typename LCTCollection::const_iterator lctItr = lctRange.first; lctItr != lctRange.second; ++lctItr) { - int bx = lctItr->getBX() - nominalBX; - if (bx >= bxMin && bx <= bxMax) { - result = true; - break; - } - } - - bool me1 = cscId.station() == 1 && cscId.ring() == 1; - //this is another "creative" recovery of smart ME1A-ME1B TMB logic cases: - //wire selective readout requires at least one (A)LCT in the full chamber - if (me1 && result == false && me1abCheck) { - CSCDetId me1aId = CSCDetId(chamberId.endcap(), chamberId.station(), 4, chamberId.chamber(), 0); - lctRange = lcts.get(me1aId); - for (typename LCTCollection::const_iterator lctItr = lctRange.first; lctItr != lctRange.second; ++lctItr) { - int bx = lctItr->getBX() - nominalBX; - if (bx >= bxMin && bx <= bxMax) { - result = true; - break; - } - } - } - - return result; - } - - // need to specialize for pretriggers, since they don't have a getBX() - template <> - bool accept(const CSCDetId& cscId, - const CSCCLCTPreTriggerCollection& lcts, - int bxMin, - int bxMax, - int nominalBX, - bool me1abCheck) { - if (bxMin == -999) - return true; - CSCDetId chamberId = chamberID(cscId); - CSCCLCTPreTriggerCollection::Range lctRange = lcts.get(chamberId); - bool result = false; - for (CSCCLCTPreTriggerCollection::const_iterator lctItr = lctRange.first; lctItr != lctRange.second; ++lctItr) { - int bx = *lctItr - nominalBX; - if (bx >= bxMin && bx <= bxMax) { - result = true; - break; - } - } - bool me1a = cscId.station() == 1 && cscId.ring() == 4; - if (me1a && result == false && me1abCheck) { - //check pretriggers in me1a as well; relevant for TMB emulator writing to separate detIds - lctRange = lcts.get(cscId); - for (CSCCLCTPreTriggerCollection::const_iterator lctItr = lctRange.first; lctItr != lctRange.second; ++lctItr) { - int bx = *lctItr - nominalBX; - if (bx >= bxMin && bx <= bxMax) { - result = true; - break; - } - } - } - return result; - } - -} // namespace cscd2r - CSCDigiToRaw::CSCDigiToRaw(const edm::ParameterSet& pset) : alctWindowMin_(pset.getParameter("alctWindowMin")), alctWindowMax_(pset.getParameter("alctWindowMax")), @@ -118,10 +38,11 @@ CSCDigiToRaw::CSCDigiToRaw(const edm::ParameterSet& pset) // don't check for consistency with trig primitives // overrides usePreTriggers packEverything_(pset.getParameter("packEverything")), - usePreTriggers_(pset.getParameter("usePreTriggers")) {} + usePreTriggers_(pset.getParameter("usePreTriggers")), + packByCFEB_(pset.getParameter("packByCFEB")) {} CSCEventData& CSCDigiToRaw::findEventData(const CSCDetId& cscDetId, FindEventDataInfo& info) const { - CSCDetId chamberId = cscd2r::chamberID(cscDetId); + CSCDetId chamberId = CSCDigiToRawAccept::chamberID(cscDetId); // find the entry into the map map::iterator chamberMapItr = info.theChamberDataMap.find(chamberId); if (chamberMapItr == info.theChamberDataMap.end()) { @@ -156,16 +77,19 @@ void CSCDigiToRaw::add(const CSCStripDigiCollection& stripDigis, CSCDetId cscDetId = (*j).first; // only digitize if there are pre-triggers - bool me1abCheck = fedInfo.formatVersion_ == 2013; + // determine where the pretriggers are + std::vector preTriggerInCFEB; + preTriggerInCFEB.resize(CSCConstants::MAX_CFEBS_RUN2); + // pretrigger flag must be set and the pretrigger collection must be nonzero! const bool usePreTriggers = usePreTriggers_ and preTriggers != nullptr; if (!usePreTriggers || packEverything_ || - (usePreTriggers && cscd2r::accept(cscDetId, - *preTriggerDigis, - preTriggerWindowMin_, - preTriggerWindowMax_, - CSCConstants::CLCT_CENTRAL_BX, - me1abCheck))) { + (usePreTriggers && CSCDigiToRawAccept::accept(cscDetId, + *preTriggerDigis, + preTriggerWindowMin_, + preTriggerWindowMax_, + CSCConstants::CLCT_CENTRAL_BX, + preTriggerInCFEB))) { bool me1a = (cscDetId.station() == 1) && (cscDetId.ring() == 4); bool zplus = (cscDetId.endcap() == 1); bool me1b = (cscDetId.station() == 1) && (cscDetId.ring() == 1); @@ -177,6 +101,17 @@ void CSCDigiToRaw::add(const CSCStripDigiCollection& stripDigis, for (; digiItr != last; ++digiItr) { CSCStripDigi digi = *digiItr; int strip = digi.getStrip(); + int cfeb = digi.getCFEB(); + // CSC strip digis in ME1/a have CFEB number 0, 1, or 2 + // But a pretrigger in ME1/a has CFEB number 4, 5, or 6 (+4) + if (me1a) + cfeb += CSCConstants::NUM_CFEBS_ME1B; + + // At this point, if we are packing by CFEBs and there is no + // pretrigger in this CFEB, ignore this strip digi + if (packByCFEB_ and not preTriggerInCFEB[cfeb]) + continue; + // From LS1 on ME1a strips are unganged if (fedInfo.formatVersion_ == 2013) { if (me1a && zplus) { @@ -215,10 +150,8 @@ void CSCDigiToRaw::add(const CSCWireDigiCollection& wireDigis, add(alctDigis, fedInfo); for (CSCWireDigiCollection::DigiRangeIterator j = wireDigis.begin(); j != wireDigis.end(); ++j) { CSCDetId cscDetId = (*j).first; - bool me1abCheck = fedInfo.formatVersion_ == 2013; - if (packEverything_ || - cscd2r::accept( - cscDetId, alctDigis, alctWindowMin_, alctWindowMax_, CSCConstants::ALCT_CENTRAL_BX, me1abCheck)) { + if (packEverything_ || CSCDigiToRawAccept::accept( + cscDetId, alctDigis, alctWindowMin_, alctWindowMax_, CSCConstants::ALCT_CENTRAL_BX)) { CSCEventData& cscData = findEventData(cscDetId, fedInfo); std::vector::const_iterator digiItr = (*j).second.first; std::vector::const_iterator last = (*j).second.second; @@ -236,10 +169,8 @@ void CSCDigiToRaw::add(const CSCComparatorDigiCollection& comparatorDigis, for (auto const& j : comparatorDigis) { CSCDetId cscDetId = j.first; CSCEventData& cscData = findEventData(cscDetId, fedInfo); - bool me1abCheck = fedInfo.formatVersion_ == 2013; - if (packEverything_ || - cscd2r::accept( - cscDetId, clctDigis, clctWindowMin_, clctWindowMax_, CSCConstants::CLCT_CENTRAL_BX, me1abCheck)) { + if (packEverything_ || CSCDigiToRawAccept::accept( + cscDetId, clctDigis, clctWindowMin_, clctWindowMax_, CSCConstants::CLCT_CENTRAL_BX)) { bool me1a = (cscDetId.station() == 1) && (cscDetId.ring() == 4); /* diff --git a/EventFilter/CSCRawToDigi/src/CSCDigiToRawAccept.cc b/EventFilter/CSCRawToDigi/src/CSCDigiToRawAccept.cc new file mode 100644 index 0000000000000..07d190e4e9730 --- /dev/null +++ b/EventFilter/CSCRawToDigi/src/CSCDigiToRawAccept.cc @@ -0,0 +1,52 @@ +#include "DataFormats/CSCDigi/interface/CSCConstants.h" +#include "EventFilter/CSCRawToDigi/interface/CSCDigiToRawAccept.h" + +CSCDetId CSCDigiToRawAccept::chamberID(const CSCDetId& cscDetId) { + CSCDetId chamberId = cscDetId.chamberId(); + if (chamberId.ring() == 4) { + chamberId = CSCDetId(chamberId.endcap(), chamberId.station(), 1, chamberId.chamber(), 0); + } + return chamberId; +} + +// older function for pretriggers BX objects +bool CSCDigiToRawAccept::accept( + const CSCDetId& cscId, const CSCCLCTPreTriggerCollection& lcts, int bxMin, int bxMax, int nominalBX) { + if (bxMin == -999) + return true; + CSCDetId chamberId = chamberID(cscId); + CSCCLCTPreTriggerCollection::Range lctRange = lcts.get(chamberId); + bool result = false; + for (CSCCLCTPreTriggerCollection::const_iterator lctItr = lctRange.first; lctItr != lctRange.second; ++lctItr) { + int bx = *lctItr - nominalBX; + if (bx >= bxMin && bx <= bxMax) { + result = true; + break; + } + } + return result; +} + +bool CSCDigiToRawAccept::accept(const CSCDetId& cscId, + const CSCCLCTPreTriggerDigiCollection& lcts, + int bxMin, + int bxMax, + int nominalBX, + std::vector& preTriggerInCFEB) { + if (bxMin == -999) + return true; + + bool atLeastOnePreTrigger = false; + + CSCDetId chamberId = chamberID(cscId); + CSCCLCTPreTriggerDigiCollection::Range lctRange = lcts.get(chamberId); + for (CSCCLCTPreTriggerDigiCollection::const_iterator lctItr = lctRange.first; lctItr != lctRange.second; ++lctItr) { + int bx = lctItr->getBX() - nominalBX; + if (bx >= bxMin && bx <= bxMax) { + atLeastOnePreTrigger = true; + // save the location of all pretriggers + preTriggerInCFEB[lctItr->getCFEB()] = true; + } + } + return atLeastOnePreTrigger; +} diff --git a/EventFilter/CSCRawToDigi/test/BuildFile.xml b/EventFilter/CSCRawToDigi/test/BuildFile.xml index f6cec9d11ccfc..c5e80ffceec72 100644 --- a/EventFilter/CSCRawToDigi/test/BuildFile.xml +++ b/EventFilter/CSCRawToDigi/test/BuildFile.xml @@ -1,3 +1,9 @@ + + + + + + diff --git a/EventFilter/CSCRawToDigi/test/CSCPackerUnpackerUnitTest.cc b/EventFilter/CSCRawToDigi/test/CSCPackerUnpackerUnitTest.cc new file mode 100644 index 0000000000000..323b0edb9c44d --- /dev/null +++ b/EventFilter/CSCRawToDigi/test/CSCPackerUnpackerUnitTest.cc @@ -0,0 +1,548 @@ +#include "FWCore/Framework/interface/ConsumesCollector.h" +#include "FWCore/Framework/interface/Frameworkfwd.h" +#include "FWCore/Framework/interface/one/EDAnalyzer.h" +#include "FWCore/Framework/interface/Event.h" +#include "FWCore/Framework/interface/EventSetup.h" +#include "FWCore/Framework/interface/MakerMacros.h" +#include "FWCore/Utilities/interface/EDGetToken.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/MessageLogger/interface/MessageLogger.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" + +#include "DataFormats/CSCDigi/interface/CSCWireDigiCollection.h" +#include "DataFormats/CSCDigi/interface/CSCStripDigiCollection.h" +#include "DataFormats/CSCDigi/interface/CSCComparatorDigiCollection.h" +#include "DataFormats/CSCDigi/interface/CSCALCTDigiCollection.h" +#include "DataFormats/CSCDigi/interface/CSCCLCTDigiCollection.h" +#include "DataFormats/CSCDigi/interface/CSCCLCTPreTriggerDigiCollection.h" +#include "DataFormats/CSCDigi/interface/CSCCorrelatedLCTDigiCollection.h" +#include "DataFormats/CSCDigi/interface/CSCShowerDigiCollection.h" +#include "DataFormats/MuonDetId/interface/CSCTriggerNumbering.h" +#include "Geometry/CSCGeometry/interface/CSCGeometry.h" +#include "DataFormats/CSCDigi/interface/CSCConstants.h" +#include "EventFilter/CSCRawToDigi/interface/CSCDigiToRawAccept.h" + +#include +#include + +class CSCPackerUnpackerUnitTest : public edm::one::EDAnalyzer<> { +public: + explicit CSCPackerUnpackerUnitTest(const edm::ParameterSet&); + ~CSCPackerUnpackerUnitTest() override {} + + void analyze(const edm::Event&, const edm::EventSetup&) override; + + // Fill parameters descriptions + static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); + +private: + void analyzeChamber(const CSCDetId& cscId, + const CSCWireDigiCollection& wd, + const CSCWireDigiCollection& wdu, + const CSCStripDigiCollection& sd, + const CSCStripDigiCollection& sdu, + const CSCComparatorDigiCollection& cd, + const CSCComparatorDigiCollection& cdu, + const CSCALCTDigiCollection& alct, + const CSCCLCTDigiCollection& clct, + const CSCCLCTPreTriggerDigiCollection& pre, + const CSCCorrelatedLCTDigiCollection& lct, + const CSCShowerDigiCollection* showers) const; + + // the return value indicates the number of failed tests + unsigned analyzeALCT(const CSCDetId& cscDetId, + const CSCWireDigiCollection& wires, + const CSCWireDigiCollection& wires_unpacked, + const CSCALCTDigiCollection& alcts) const; + unsigned analyzeCLCT(const CSCDetId& cscDetId, + const CSCComparatorDigiCollection& comparators, + const CSCComparatorDigiCollection& comparators_unpacked, + const CSCCLCTDigiCollection& clcts) const; + unsigned analyzePreCLCT(const CSCDetId& cscDetId, + const CSCStripDigiCollection& strips, + const CSCStripDigiCollection& strips_unpacked, + const CSCCLCTPreTriggerDigiCollection& preclcts) const; + + // helper functions + template + unsigned nDigis(const CSCDetId& cscId, const DIGICollection& digis) const; + + template + unsigned nDigisLayer(const CSCDetId& cscId, const DIGICollection& digis) const; + + unsigned nDigisCFEB(const CSCDetId& cscId, const CSCStripDigiCollection& digis, int cfeb) const; + + unsigned nDigisCFEBLayer(const CSCDetId& cscId, const CSCStripDigiCollection& digis, int cfeb) const; + + unsigned getNCFEBs(unsigned type) const; + + int alctWindowMin_; + int alctWindowMax_; + int clctWindowMin_; + int clctWindowMax_; + int preTriggerWindowMin_; + int preTriggerWindowMax_; + unsigned formatVersion_; + bool packEverything_; + bool usePreTriggers_; + bool useCSCShowers_; + bool packByCFEB_; + bool testALCT_; + bool testCLCT_; + bool testPreCLCT_; + + edm::EDGetTokenT wd_token_; + edm::EDGetTokenT wd_unpacked_token_; + edm::EDGetTokenT sd_token_; + edm::EDGetTokenT sd_unpacked_token_; + edm::EDGetTokenT cd_token_; + edm::EDGetTokenT cd_unpacked_token_; + edm::EDGetTokenT al_token_; + edm::EDGetTokenT cl_token_; + edm::EDGetTokenT clpre_token_; + edm::EDGetTokenT co_token_; + edm::EDGetTokenT shower_token; +}; + +CSCPackerUnpackerUnitTest::CSCPackerUnpackerUnitTest(const edm::ParameterSet& conf) + : alctWindowMin_(conf.getParameter("alctWindowMin")), + alctWindowMax_(conf.getParameter("alctWindowMax")), + clctWindowMin_(conf.getParameter("clctWindowMin")), + clctWindowMax_(conf.getParameter("clctWindowMax")), + preTriggerWindowMin_(conf.getParameter("preTriggerWindowMin")), + preTriggerWindowMax_(conf.getParameter("preTriggerWindowMax")), + formatVersion_(conf.getParameter("formatVersion")), + packEverything_(conf.getParameter("packEverything")), + usePreTriggers_(conf.getParameter("usePreTriggers")), + useCSCShowers_(conf.getParameter("useCSCShowers")), + packByCFEB_(conf.getParameter("packByCFEB")), + testALCT_(conf.getParameter("testALCT")), + testCLCT_(conf.getParameter("testCLCT")), + testPreCLCT_(conf.getParameter("testPreCLCT")), + wd_token_(consumes(conf.getParameter("wireTag"))), + wd_unpacked_token_(consumes(conf.getParameter("wireUnpackedTag"))), + sd_token_(consumes(conf.getParameter("stripTag"))), + sd_unpacked_token_(consumes(conf.getParameter("stripUnpackedTag"))), + cd_token_(consumes(conf.getParameter("comparatorTag"))), + cd_unpacked_token_( + consumes(conf.getParameter("comparatorUnpackedTag"))), + al_token_(consumes(conf.getParameter("alctTag"))), + cl_token_(consumes(conf.getParameter("clctTag"))), + clpre_token_(consumes(conf.getParameter("clctpreTag"))), + co_token_(consumes(conf.getParameter("corrclctTag"))) { + if (useCSCShowers_) { + shower_token = consumes(conf.getParameter("showerDigiTag")); + } +} + +void CSCPackerUnpackerUnitTest::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { + edm::ParameterSetDescription desc; + // digi collections + desc.add("wireTag", edm::InputTag("simMuonCSCDigis", "MuonCSCWireDigi")); + desc.add("stripTag", edm::InputTag("simMuonCSCDigis", "MuonCSCStripDigi")); + desc.add("comparatorTag", edm::InputTag("simMuonCSCDigis", "MuonCSCComparatorDigi")); + // DAQ collections + desc.add("wireUnpackedTag", edm::InputTag("muonCSCDigis", "MuonCSCWireDigi")); + desc.add("stripUnpackedTag", edm::InputTag("muonCSCDigis", "MuonCSCStripDigi")); + desc.add("comparatorUnpackedTag", edm::InputTag("muonCSCDigis", "MuonCSCComparatorDigi")); + // trigger collections + desc.add("alctTag", edm::InputTag("simCscTriggerPrimitiveDigis")); + desc.add("clctTag", edm::InputTag("simCscTriggerPrimitiveDigis")); + desc.add("clctpreTag", edm::InputTag("simCscTriggerPrimitiveDigis")); + desc.add("corrclctTag", edm::InputTag("simCscTriggerPrimitiveDigis")); + desc.add("showerDigiTag", edm::InputTag("simCscTriggerPrimitiveDigis")); + // readout windows + desc.add("alctWindowMin", -3); + desc.add("alctWindowMax", 3); + desc.add("clctWindowMin", -3); + desc.add("clctWindowMax", 3); + desc.add("preTriggerWindowMin", -3); + desc.add("preTriggerWindowMax", 1); + desc.add("formatVersion", 2005); + // enable functions + desc.add("testALCT", true); + desc.add("testCLCT", true); + desc.add("testPreCLCT", true); + desc.add("usePreTriggers", true); + desc.add("packEverything", false); + desc.add("useCSCShowers", false); + desc.add("packByCFEB", true); + descriptions.add("cscPackerUnpackerUnitTestDef", desc); +} + +void CSCPackerUnpackerUnitTest::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) { + // handles, tokens + edm::Handle wires; + iEvent.getByToken(wd_token_, wires); + + edm::Handle wires_unpacked; + iEvent.getByToken(wd_unpacked_token_, wires_unpacked); + + edm::Handle strips; + iEvent.getByToken(sd_token_, strips); + + edm::Handle strips_unpacked; + iEvent.getByToken(sd_unpacked_token_, strips_unpacked); + + edm::Handle comparators; + iEvent.getByToken(cd_token_, comparators); + + edm::Handle comparators_unpacked; + iEvent.getByToken(cd_unpacked_token_, comparators_unpacked); + + edm::Handle alcts; + iEvent.getByToken(al_token_, alcts); + + edm::Handle clcts; + iEvent.getByToken(cl_token_, clcts); + + edm::Handle preclcts; + iEvent.getByToken(clpre_token_, preclcts); + + edm::Handle lcts; + iEvent.getByToken(co_token_, lcts); + + const CSCShowerDigiCollection* cscShowerDigisPtr = nullptr; + if (useCSCShowers_) { + cscShowerDigisPtr = &iEvent.get(shower_token); + } + + const int min_endcap = CSCDetId::minEndcapId(); + const int max_endcap = CSCDetId::maxEndcapId(); + const int min_station = CSCDetId::minStationId(); + const int max_station = CSCDetId::maxStationId(); + const int min_sector = CSCTriggerNumbering::minTriggerSectorId(); + const int max_sector = CSCTriggerNumbering::maxTriggerSectorId(); + const int min_subsector = CSCTriggerNumbering::minTriggerSubSectorId(); + const int max_subsector = CSCTriggerNumbering::maxTriggerSubSectorId(); + const int min_chamber = CSCTriggerNumbering::minTriggerCscId(); + const int max_chamber = CSCTriggerNumbering::maxTriggerCscId(); + + for (int endc = min_endcap; endc <= max_endcap; endc++) { + for (int stat = min_station; stat <= max_station; stat++) { + int numsubs = ((stat == 1) ? max_subsector : 1); + for (int sect = min_sector; sect <= max_sector; sect++) { + for (int subs = min_subsector; subs <= numsubs; subs++) { + for (int cham = min_chamber; cham <= max_chamber; cham++) { + int ring = CSCTriggerNumbering::ringFromTriggerLabels(stat, cham); + + // actual chamber number =/= trigger chamber number + int chid = CSCTriggerNumbering::chamberFromTriggerLabels(sect, subs, stat, cham); + + // 0th layer means whole chamber. + CSCDetId cscDetId(endc, stat, ring, chid, 0); + + analyzeChamber(cscDetId, + *wires, + *wires_unpacked, + *strips, + *strips_unpacked, + *comparators, + *comparators_unpacked, + *alcts, + *clcts, + *preclcts, + *lcts, + cscShowerDigisPtr); + } + } + } + } + } +} + +void CSCPackerUnpackerUnitTest::analyzeChamber(const CSCDetId& cscDetId, + const CSCWireDigiCollection& wires, + const CSCWireDigiCollection& wires_unpacked, + const CSCStripDigiCollection& strips, + const CSCStripDigiCollection& strips_unpacked, + const CSCComparatorDigiCollection& comparators, + const CSCComparatorDigiCollection& comparators_unpacked, + const CSCALCTDigiCollection& alcts, + const CSCCLCTDigiCollection& clcts, + const CSCCLCTPreTriggerDigiCollection& preclcts, + const CSCCorrelatedLCTDigiCollection& lcts, + const CSCShowerDigiCollection* showers) const { + if (testALCT_) { + const unsigned nFailedTestsALCT = analyzeALCT(cscDetId, wires, wires_unpacked, alcts); + if (nFailedTestsALCT) { + edm::LogWarning("CSCPackerUnpackerUnitTest") + << nFailedTestsALCT << " ALCT test(s) failed in " << cscDetId.chamberName(); + } + } + + if (testCLCT_) { + const unsigned nFailedTestsCLCT = analyzeCLCT(cscDetId, comparators, comparators_unpacked, clcts); + if (nFailedTestsCLCT) { + edm::LogWarning("CSCPackerUnpackerUnitTest") + << nFailedTestsCLCT << " CLCT test(s) failed in " << cscDetId.chamberName(); + } + } + + if (testPreCLCT_) { + const unsigned nFailedTestsPreCLCT = analyzePreCLCT(cscDetId, strips, strips_unpacked, preclcts); + if (nFailedTestsPreCLCT) { + edm::LogWarning("CSCPackerUnpackerUnitTest") + << nFailedTestsPreCLCT << " PreCLCT test(s) failed in " << cscDetId.chamberName(); + } + } +} + +unsigned CSCPackerUnpackerUnitTest::analyzeALCT(const CSCDetId& cscDetId, + const CSCWireDigiCollection& wires, + const CSCWireDigiCollection& wires_unpacked, + const CSCALCTDigiCollection& alcts) const { + unsigned numWireDigis = nDigis(cscDetId, wires); + // no simulated wire digis means that all tests pass + if (numWireDigis == 0) { + return 0; + } + + // readout condition for wires: L1A + ALCT + bool hasALCT = + CSCDigiToRawAccept::accept(cscDetId, alcts, alctWindowMin_, alctWindowMax_, CSCConstants::ALCT_CENTRAL_BX); + + unsigned numWireDigisUnpacked = nDigis(cscDetId, wires_unpacked); + + unsigned testsFailed = 0; + + // these tests are only done when the trigger/pretriggers are enabled + if (!packEverything_ and usePreTriggers_) { + // test 1: check that an ALCT in this chamber kept the wire digis + if (hasALCT) { + if (numWireDigisUnpacked == 0) { + testsFailed++; + edm::LogWarning("analyzeALCT::Test1Failure") << "hasALCT " << hasALCT << " numWireDigisUnpacked " + << numWireDigisUnpacked << " " << cscDetId.chamberName(); + } + } + + // test 2: check no wire digis were kept if there was no ALCT + if (numWireDigisUnpacked != 0) { + if (!hasALCT) { + testsFailed++; + edm::LogWarning("analyzeALCT::Test2Failure") << "hasALCT " << hasALCT << " numWireDigisUnpacked " + << numWireDigisUnpacked << " " << cscDetId.chamberName(); + } + } + } + + // test 3: count the number of wire digis before and after unpacking + if (numWireDigis < numWireDigisUnpacked) { + testsFailed++; + edm::LogWarning("analyzeALCT::Test3Failure") << "numWireDigis " << numWireDigis << " numWireDigisUnpacked " + << numWireDigisUnpacked << " " << cscDetId.chamberName(); + } + + return testsFailed; +} + +unsigned CSCPackerUnpackerUnitTest::analyzeCLCT(const CSCDetId& cscDetId, + const CSCComparatorDigiCollection& comparators, + const CSCComparatorDigiCollection& comparators_unpacked, + const CSCCLCTDigiCollection& clcts) const { + unsigned numCompDigis = nDigis(cscDetId, comparators); + // no simulated comparator digis means that all tests pass + if (numCompDigis == 0) { + return 0; + } + + // readout condition for comparators in (O)TMB; L1A + CLCT + bool hasCLCT = + CSCDigiToRawAccept::accept(cscDetId, clcts, clctWindowMin_, clctWindowMax_, CSCConstants::CLCT_CENTRAL_BX); + + unsigned numCompDigisUnpacked = nDigis(cscDetId, comparators_unpacked); + + unsigned testsFailed = 0; + + // these tests are only done when the trigger/pretriggers are enabled + if (!packEverything_ and usePreTriggers_) { + // test 1: check that an CLCT in this chamber kept the comp digis + if (hasCLCT) { + if (numCompDigisUnpacked == 0) { + testsFailed++; + edm::LogWarning("analyzeCLCT::Test1Failure") << "hasCLCT " << hasCLCT << " numCompDigisUnpacked " + << numCompDigisUnpacked << " " << cscDetId.chamberName(); + } + } + + // test 2: check no comp digis were kept if there was no CLCT + if (numCompDigisUnpacked != 0) { + if (!hasCLCT) { + testsFailed++; + edm::LogWarning("analyzeCLCT::Test2Failure") << "hasCLCT " << hasCLCT << " numCompDigisUnpacked " + << numCompDigisUnpacked << " " << cscDetId.chamberName(); + } + } + } + + // test 3: count the number of comp digis before and after unpacking + if (numCompDigis < numCompDigisUnpacked) { + testsFailed++; + edm::LogWarning("analyzeCLCT::Test3Failure") << "numCompDigis " << numCompDigis << " numCompDigisUnpacked " + << numCompDigisUnpacked << " " << cscDetId.chamberName(); + } + + return testsFailed; +} + +unsigned CSCPackerUnpackerUnitTest::analyzePreCLCT(const CSCDetId& cscDetId, + const CSCStripDigiCollection& strips, + const CSCStripDigiCollection& strips_unpacked, + const CSCCLCTPreTriggerDigiCollection& preclcts) const { + unsigned numStripDigis = nDigis(cscDetId, strips); + // no simulated strip digis means that all tests pass + if (numStripDigis == 0) { + return 0; + } + + // determine where the pretriggers are + std::vector preTriggerInCFEB; + preTriggerInCFEB.resize(CSCConstants::MAX_CFEBS_RUN2); + + // readout condition for strips: L1A + preCLCT in CFEB + bool hasPreCLCT = CSCDigiToRawAccept::accept( + cscDetId, preclcts, preTriggerWindowMin_, preTriggerWindowMax_, CSCConstants::CLCT_CENTRAL_BX, preTriggerInCFEB); + + unsigned testsFailed = 0; + + unsigned nStripDigisUnpacked = nDigis(cscDetId, strips_unpacked); + + // these tests are only done when the trigger/pretriggers are enabled + if (!packEverything_ and usePreTriggers_) { + // Test when NOT packing by CFEB + if (!packByCFEB_) { + // test 1: check that a PreCLCT in this chamber kept the strip digis + if (hasPreCLCT) { + if (nStripDigisUnpacked == 0) { + testsFailed++; + edm::LogWarning("analyzePreCLCT::Test1Failure") << "preTrigger " << hasPreCLCT << " nStripDigisUnpacked " + << nStripDigisUnpacked << " " << cscDetId.chamberName(); + } + } + + // test 2: check no strip digis were kept if there was no PreCLCT + if (nStripDigisUnpacked != 0) { + if (!hasPreCLCT) { + testsFailed++; + edm::LogWarning("analyzePreCLCT::Test2Failure") << "preTrigger " << hasPreCLCT << " nStripDigisUnpacked " + << nStripDigisUnpacked << " " << cscDetId.chamberName(); + } + } + } + + // Test when packing by CFEBs + else { + // tests are performed for each CFEB + for (unsigned i = 0; i < CSCConstants::MAX_CFEBS_RUN2; i++) { + // only do the tests for the CFEBs in this chamber (4,5,7) + if (i >= getNCFEBs(cscDetId.iChamberType() - 1)) + continue; + + unsigned nStripDigisUnpackedCFEB = nDigisCFEB(cscDetId, strips_unpacked, i); + + // test 1: check that a PreCLCT in this chamber kept the strip digis + if (preTriggerInCFEB[i]) { + if (nStripDigisUnpackedCFEB == 0) { + testsFailed++; + edm::LogWarning("analyzePreCLCT::Test1Failure") + << "CFEB " << i << "preTriggerInCFEB " << preTriggerInCFEB[i] << " nStripDigisUnpackedCFEB " + << nStripDigisUnpackedCFEB << " " << cscDetId.chamberName(); + } + } + + // test 2: check no strip digis were kept if there was no PreCLCT + if (nStripDigisUnpackedCFEB != 0) { + if (!preTriggerInCFEB[i]) { + testsFailed++; + edm::LogWarning("analyzePreCLCT::Test2Failure") + << "CFEB " << i << "preTriggerInCFEB " << preTriggerInCFEB[i] << " nStripDigisUnpackedCFEB " + << nStripDigisUnpackedCFEB << " " << cscDetId.chamberName(); + } + } + } + } + } + + return testsFailed; +} + +template +unsigned CSCPackerUnpackerUnitTest::nDigis(const CSCDetId& detid, const DIGICollection& digis) const { + unsigned nDigis = 0; + for (int i_layer = 0; i_layer < CSCConstants::NUM_LAYERS; i_layer++) { + CSCDetId ldetid(detid.endcap(), detid.station(), detid.ring(), detid.chamber(), i_layer + 1); + nDigis += nDigisLayer(ldetid, digis); + + if (detid.station() == 1 and detid.ring() == 1) { + CSCDetId ldetid_me1a(detid.endcap(), detid.station(), 4, detid.chamber(), i_layer + 1); + nDigis += nDigisLayer(ldetid_me1a, digis); + } + } + return nDigis; +} + +template +unsigned CSCPackerUnpackerUnitTest::nDigisLayer(const CSCDetId& cscId, const DIGICollection& digis) const { + unsigned nDigis = 0; + auto digiRange = digis.get(cscId); + for (auto digiItr = digiRange.first; digiItr != digiRange.second; ++digiItr) { + nDigis++; + } + return nDigis; +} + +unsigned CSCPackerUnpackerUnitTest::nDigisCFEB(const CSCDetId& detid, + const CSCStripDigiCollection& digis, + int cfeb) const { + unsigned nDigis = 0; + + for (int i_layer = 0; i_layer < CSCConstants::NUM_LAYERS; i_layer++) { + // ME1/A case + if (detid.station() == 1 and detid.ring() == 1 and cfeb >= 4) { + CSCDetId ldetid(detid.endcap(), detid.station(), 4, detid.chamber(), i_layer + 1); + nDigis += nDigisCFEBLayer(ldetid, digis, cfeb); + } + // all other cases + else { + CSCDetId ldetid(detid.endcap(), detid.station(), detid.ring(), detid.chamber(), i_layer + 1); + nDigis += nDigisCFEBLayer(ldetid, digis, cfeb); + } + } + return nDigis; +} + +unsigned CSCPackerUnpackerUnitTest::nDigisCFEBLayer(const CSCDetId& cscId, + const CSCStripDigiCollection& digis, + int cfeb) const { + unsigned nDigis = 0; + auto digiRange = digis.get(cscId); + for (auto digiItr = digiRange.first; digiItr != digiRange.second; ++digiItr) { + CSCStripDigi digi = *digiItr; + int cfb = digi.getCFEB(); + if (cscId.station() == 1 and cscId.ring() == 4) { + cfb += CSCConstants::NUM_CFEBS_ME1B; + } + if (cfeb == cfb) { + nDigis++; + } + } + return nDigis; +} + +unsigned CSCPackerUnpackerUnitTest::getNCFEBs(unsigned type) const { + const unsigned cfebs[10] = {CSCConstants::NUM_CFEBS_ME1A_UNGANGED, + CSCConstants::NUM_CFEBS_ME11_UNGANGED, + CSCConstants::NUM_CFEBS_ME12, + CSCConstants::NUM_CFEBS_ME13, + CSCConstants::NUM_CFEBS_ME21, + CSCConstants::NUM_CFEBS_ME22, + CSCConstants::NUM_CFEBS_ME31, + CSCConstants::NUM_CFEBS_ME32, + CSCConstants::NUM_CFEBS_ME41, + CSCConstants::NUM_CFEBS_ME42}; + return cfebs[type]; +} + +//define this as a plug-in +DEFINE_FWK_MODULE(CSCPackerUnpackerUnitTest); diff --git a/EventFilter/CSCRawToDigi/test/testPackingUnpackingPreTriggers_cfg.py b/EventFilter/CSCRawToDigi/test/testPackingUnpackingPreTriggers_cfg.py new file mode 100644 index 0000000000000..5e5ff059620d9 --- /dev/null +++ b/EventFilter/CSCRawToDigi/test/testPackingUnpackingPreTriggers_cfg.py @@ -0,0 +1,104 @@ +import FWCore.ParameterSet.Config as cms +from Configuration.Eras.Era_Run3_cff import Run3 + +from FWCore.ParameterSet.VarParsing import VarParsing +options = VarParsing('analysis') +options.parseArguments() + +## process def +process = cms.Process("TEST", Run3) +process.load("FWCore.MessageService.MessageLogger_cfi") +process.load('Configuration.StandardSequences.Services_cff') +process.load('Configuration.StandardSequences.GeometrySimDB_cff') +process.load("Configuration.StandardSequences.GeometryRecoDB_cff") +process.load("Configuration.StandardSequences.MagneticField_cff") +process.load('Configuration.EventContent.EventContent_cff') +process.load('Configuration.StandardSequences.Generator_cff') +process.load('GeneratorInterface.Core.genFilterSummary_cff') +process.load('SimGeneral.HepPDTESSource.pythiapdt_cfi') +process.load('IOMC.EventVertexGenerators.VtxSmearedRun3RoundOptics25ns13TeVLowSigmaZ_cfi') +process.load('Configuration.StandardSequences.SimIdeal_cff') +process.load('Configuration.StandardSequences.Digi_cff') +process.load('SimGeneral.MixingModule.mixNoPU_cfi') +process.load('Configuration.StandardSequences.SimL1Emulator_cff') +process.load("EventFilter.CSCRawToDigi.cscUnpacker_cfi") +process.load("EventFilter.CSCRawToDigi.cscPacker_cfi") +process.load("EventFilter.CSCRawToDigi.cscPackerUnpackerUnitTestDef_cfi") +process.load('Configuration.StandardSequences.EndOfProcess_cff') +process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') + +process.maxEvents = cms.untracked.PSet( + input = cms.untracked.int32(10) +) + +process.source = cms.Source("EmptySource") + +## global tag +from Configuration.AlCa.GlobalTag import GlobalTag +process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase1_2021_realistic', '') + +process.XMLFromDBSource.label = cms.string("Extended") +process.genstepfilter.triggerConditions=cms.vstring("generation_step") + +process.generator = cms.EDFilter( + "Pythia8PtGun", + PGunParameters = cms.PSet( + AddAntiParticle = cms.bool(True), + MaxEta = cms.double(2.4), + MaxPhi = cms.double(3.14159265359), + MaxPt = cms.double(1000.1), + MinEta = cms.double(0.9), + MinPhi = cms.double(-3.14159265359), + MinPt = cms.double(1.9), + ParticleID = cms.vint32(-13) + ), + PythiaParameters = cms.PSet( + parameterSets = cms.vstring() + ), + Verbosity = cms.untracked.int32(0), + firstRun = cms.untracked.uint32(1), + psethack = cms.string('single mu pt 1') +) + + +process.FEVTDEBUGHLToutput = cms.OutputModule( + "PoolOutputModule", + SelectEvents = cms.untracked.PSet( + SelectEvents = cms.vstring('generation_step') + ), + dataset = cms.untracked.PSet( + dataTier = cms.untracked.string('GEN-SIM-DIGI-RAW'), + filterName = cms.untracked.string('') + ), + fileName = cms.untracked.string('file:step1.root'), + outputCommands = process.FEVTDEBUGHLTEventContent.outputCommands, + splitLevel = cms.untracked.int32(0) +) + +process.mix.digitizers = cms.PSet(process.theDigitizersValid) + +process.muonCSCDigis.InputObjects = "cscpacker:CSCRawData" + +## specification of the test with the packer expert settings +process.cscPackerUnpackerUnitTestDef.usePreTriggers = process.cscpacker.usePreTriggers +process.cscPackerUnpackerUnitTestDef.packEverything = process.cscpacker.packEverything +process.cscPackerUnpackerUnitTestDef.packByCFEB = process.cscpacker.packByCFEB +process.cscPackerUnpackerUnitTestDef.formatVersion = process.cscpacker.formatVersion +process.cscPackerUnpackerUnitTestDef.useCSCShowers = process.cscpacker.useCSCShowers + +process.generation_step = cms.Path(process.pgen) +process.simulation_step = cms.Path(process.psim) +process.genfiltersummary_step = cms.EndPath(process.genFilterSummary) +process.digitisation_step = cms.Path(process.pdigi_valid) +process.L1simulation_step = cms.Path(process.simMuonGEMPadDigis * process.simMuonGEMPadDigiClusters * process.simCscTriggerPrimitiveDigis) +process.testPackUnpack_step = cms.Path(process.cscpacker * process.muonCSCDigis * process.cscPackerUnpackerUnitTestDef) +process.endjob_step = cms.EndPath(process.endOfProcess) +process.FEVTDEBUGHLToutput_step = cms.EndPath(process.FEVTDEBUGHLToutput) + +process.schedule = cms.Schedule(process.generation_step,process.genfiltersummary_step,process.simulation_step,process.digitisation_step,process.L1simulation_step, process.testPackUnpack_step, process.endjob_step) + +from PhysicsTools.PatAlgos.tools.helpers import associatePatAlgosToolsTask +associatePatAlgosToolsTask(process) +# filter all path with the production filter sequence +for path in process.paths: + getattr(process,path).insert(0, process.generator) diff --git a/EventFilter/CSCTFRawToDigi/interface/CSCTFAnalyzer.h b/EventFilter/CSCTFRawToDigi/interface/CSCTFAnalyzer.h deleted file mode 100644 index 8d9917d281f40..0000000000000 --- a/EventFilter/CSCTFRawToDigi/interface/CSCTFAnalyzer.h +++ /dev/null @@ -1,44 +0,0 @@ -#ifndef CSCTFAnalyzer_h -#define CSCTFAnalyzer_h - -#include "FWCore/Framework/interface/ConsumesCollector.h" -#include "FWCore/Framework/interface/EDAnalyzer.h" -#include "FWCore/Framework/interface/Event.h" -#include "FWCore/ParameterSet/interface/ParameterSet.h" -#include "FWCore/Framework/interface/EventSetup.h" -#include "FWCore/Utilities/interface/InputTag.h" - -//consumes -#include "DataFormats/CSCDigi/interface/CSCCorrelatedLCTDigiCollection.h" -#include "DataFormats/L1CSCTrackFinder/interface/L1CSCTrackCollection.h" -#include "DataFormats/L1CSCTrackFinder/interface/L1CSCStatusDigiCollection.h" -#include "DataFormats/L1CSCTrackFinder/interface/CSCTriggerContainer.h" -#include "DataFormats/L1CSCTrackFinder/interface/TrackStub.h" - -#include -#include - -class CSCTFAnalyzer : public edm::EDAnalyzer { -private: - edm::InputTag mbProducer, lctProducer, trackProducer, statusProducer; - TTree *tree; - TFile *file; - int dtPhi[12][2]; - - edm::EDGetTokenT L1CSCS_Tok; - edm::EDGetTokenT > CSCTC_Tok; - edm::EDGetTokenT CSCCDC_Tok; - edm::EDGetTokenT L1CST_Tok; - -public: - void analyze(const edm::Event &e, const edm::EventSetup &c) override; - - explicit CSCTFAnalyzer(const edm::ParameterSet &conf); - ~CSCTFAnalyzer(void) override { - file->cd(); - tree->Write(); - file->Close(); - } -}; - -#endif diff --git a/EventFilter/CSCTFRawToDigi/interface/CSCTFPacker.h b/EventFilter/CSCTFRawToDigi/interface/CSCTFPacker.h deleted file mode 100644 index 4164f7fdce1fd..0000000000000 --- a/EventFilter/CSCTFRawToDigi/interface/CSCTFPacker.h +++ /dev/null @@ -1,44 +0,0 @@ -#ifndef CSCTFPacker_h -#define CSCTFPacker_h - -#include "FWCore/Framework/interface/ConsumesCollector.h" - -#include "FWCore/Framework/interface/one/EDProducer.h" -#include "FWCore/Framework/interface/Event.h" -#include "FWCore/ParameterSet/interface/ParameterSet.h" -#include "FWCore/Framework/interface/EventSetup.h" -#include "FWCore/Utilities/interface/InputTag.h" - -#include "DataFormats/L1CSCTrackFinder/interface/L1CSCTrackCollection.h" -#include "DataFormats/L1CSCTrackFinder/interface/CSCTriggerContainer.h" -#include "DataFormats/L1CSCTrackFinder/interface/TrackStub.h" - -#include - -class CSCTFPacker : public edm::one::EDProducer<> { -private: - edm::InputTag lctProducer, mbProducer, trackProducer; - - bool zeroSuppression; - unsigned short nTBINs; - unsigned short activeSectors; - bool putBufferToEvent; - - bool swapME1strips; - - FILE* file; - - int m_minBX, m_maxBX, central_lct_bx, central_sp_bx; - - edm::EDGetTokenT CSCCDC_Tok; - edm::EDGetTokenT > CSCTC_Tok; - edm::EDGetTokenT L1CSCTr_Tok; - -public: - void produce(edm::Event& e, const edm::EventSetup& c) override; - - explicit CSCTFPacker(const edm::ParameterSet& conf); - ~CSCTFPacker(void) override; -}; - -#endif diff --git a/EventFilter/CSCTFRawToDigi/interface/CSCTFUnpacker.h b/EventFilter/CSCTFRawToDigi/interface/CSCTFUnpacker.h deleted file mode 100644 index b0470ab41f599..0000000000000 --- a/EventFilter/CSCTFRawToDigi/interface/CSCTFUnpacker.h +++ /dev/null @@ -1,47 +0,0 @@ -#ifndef CSCTFUnpacker_h -#define CSCTFUnpacker_h - -#include "FWCore/Framework/interface/stream/EDProducer.h" -#include "FWCore/Framework/interface/ConsumesCollector.h" -#include -#include - -//CSC Track Finder Raw Data Format -#include "EventFilter/CSCTFRawToDigi/src/CSCTFEvent.h" - -//FEDRawData -#include "DataFormats/FEDRawData/interface/FEDRawData.h" -#include "DataFormats/FEDRawData/interface/FEDNumbering.h" -#include "DataFormats/FEDRawData/interface/FEDRawDataCollection.h" - -#include -#include - -class CSCTriggerMapping; - -class CSCTFUnpacker : public edm::stream::EDProducer<> { -private: - int m_minBX, m_maxBX; - bool swapME1strips; - - CSCTriggerMapping* mapping; // redundant, but needed - - CSCTFEvent tfEvent; // TF data container - - // geometry may not be properly set in CSC TF data - // make an artificial assignment of each of 12 SPs (slots 6-11 and 16-21) to 12 sectors (1-12, 0-not assigned) - std::vector slot2sector; - - // label of the module which produced raw data - edm::InputTag producer; - - edm::EDGetTokenT Raw_token; - -public: - void produce(edm::Event& e, const edm::EventSetup& c) override; - - CSCTFUnpacker(const edm::ParameterSet& pset); - ~CSCTFUnpacker(void) override; -}; - -#endif diff --git a/EventFilter/CSCTFRawToDigi/plugins/CSCTFAnalyzer.cc b/EventFilter/CSCTFRawToDigi/plugins/CSCTFAnalyzer.cc index 80ed4e9042564..e74f6dee3dc3e 100644 --- a/EventFilter/CSCTFRawToDigi/plugins/CSCTFAnalyzer.cc +++ b/EventFilter/CSCTFRawToDigi/plugins/CSCTFAnalyzer.cc @@ -1,4 +1,43 @@ -#include "EventFilter/CSCTFRawToDigi/interface/CSCTFAnalyzer.h" +#include "FWCore/Framework/interface/ConsumesCollector.h" +#include "FWCore/Framework/interface/EDAnalyzer.h" +#include "FWCore/Framework/interface/Event.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/Framework/interface/EventSetup.h" +#include "FWCore/Utilities/interface/InputTag.h" + +//consumes +#include "DataFormats/CSCDigi/interface/CSCCorrelatedLCTDigiCollection.h" +#include "DataFormats/L1CSCTrackFinder/interface/L1CSCTrackCollection.h" +#include "DataFormats/L1CSCTrackFinder/interface/L1CSCStatusDigiCollection.h" +#include "DataFormats/L1CSCTrackFinder/interface/CSCTriggerContainer.h" +#include "DataFormats/L1CSCTrackFinder/interface/TrackStub.h" + +#include +#include + +class CSCTFAnalyzer : public edm::EDAnalyzer { +private: + edm::InputTag mbProducer, lctProducer, trackProducer, statusProducer; + TTree *tree; + TFile *file; + int dtPhi[12][2]; + + edm::EDGetTokenT L1CSCS_Tok; + edm::EDGetTokenT > CSCTC_Tok; + edm::EDGetTokenT CSCCDC_Tok; + edm::EDGetTokenT L1CST_Tok; + +public: + void analyze(const edm::Event &e, const edm::EventSetup &c) override; + + explicit CSCTFAnalyzer(const edm::ParameterSet &conf); + ~CSCTFAnalyzer(void) override { + file->cd(); + tree->Write(); + file->Close(); + } +}; + #include "DataFormats/Common/interface/Handle.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" @@ -7,7 +46,7 @@ #include #include -CSCTFAnalyzer::CSCTFAnalyzer(const edm::ParameterSet& conf) : edm::EDAnalyzer() { +CSCTFAnalyzer::CSCTFAnalyzer(const edm::ParameterSet &conf) : edm::EDAnalyzer() { mbProducer = conf.getUntrackedParameter("mbProducer", edm::InputTag("csctfunpacker")); lctProducer = conf.getUntrackedParameter("lctProducer", edm::InputTag("csctfunpacker")); trackProducer = conf.getUntrackedParameter("trackProducer", edm::InputTag("csctfunpacker")); @@ -46,7 +85,7 @@ CSCTFAnalyzer::CSCTFAnalyzer(const edm::ParameterSet& conf) : edm::EDAnalyzer() L1CST_Tok = consumes(edm::InputTag(trackProducer.label(), trackProducer.instance())); } -void CSCTFAnalyzer::analyze(const edm::Event& e, const edm::EventSetup& c) { +void CSCTFAnalyzer::analyze(const edm::Event &e, const edm::EventSetup &c) { /* edm::Handle rawdata; e.getByToken("source","",rawdata); @@ -192,3 +231,6 @@ void CSCTFAnalyzer::analyze(const edm::Event& e, const edm::EventSetup& c) { edm::LogInfo("CSCTFAnalyzer") << " No valid L1CSCTrackCollection products found"; } } + +#include "FWCore/Framework/interface/MakerMacros.h" +DEFINE_FWK_MODULE(CSCTFAnalyzer); diff --git a/EventFilter/CSCTFRawToDigi/plugins/CSCTFPacker.cc b/EventFilter/CSCTFRawToDigi/plugins/CSCTFPacker.cc index b9ee603bc976a..edc65539eee02 100644 --- a/EventFilter/CSCTFRawToDigi/plugins/CSCTFPacker.cc +++ b/EventFilter/CSCTFRawToDigi/plugins/CSCTFPacker.cc @@ -1,4 +1,43 @@ -#include "EventFilter/CSCTFRawToDigi/interface/CSCTFPacker.h" +#include "FWCore/Framework/interface/ConsumesCollector.h" + +#include "FWCore/Framework/interface/one/EDProducer.h" +#include "FWCore/Framework/interface/Event.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/Framework/interface/EventSetup.h" +#include "FWCore/Utilities/interface/InputTag.h" + +#include "DataFormats/L1CSCTrackFinder/interface/L1CSCTrackCollection.h" +#include "DataFormats/L1CSCTrackFinder/interface/CSCTriggerContainer.h" +#include "DataFormats/L1CSCTrackFinder/interface/TrackStub.h" + +#include + +class CSCTFPacker : public edm::one::EDProducer<> { +private: + edm::InputTag lctProducer, mbProducer, trackProducer; + + bool zeroSuppression; + unsigned short nTBINs; + unsigned short activeSectors; + bool putBufferToEvent; + + bool swapME1strips; + + FILE* file; + + int m_minBX, m_maxBX, central_lct_bx, central_sp_bx; + + edm::EDGetTokenT CSCCDC_Tok; + edm::EDGetTokenT > CSCTC_Tok; + edm::EDGetTokenT L1CSCTr_Tok; + +public: + void produce(edm::Event& e, const edm::EventSetup& c) override; + + explicit CSCTFPacker(const edm::ParameterSet& conf); + ~CSCTFPacker(void) override; +}; + #include "EventFilter/CSCTFRawToDigi/src/CSCTFEvent.h" #include @@ -397,3 +436,6 @@ void CSCTFPacker::produce(edm::Event& e, const edm::EventSetup& c) { if (file) fwrite(spDDUrecord, 2, pos - spDDUrecord, file); } + +#include "FWCore/Framework/interface/MakerMacros.h" +DEFINE_FWK_MODULE(CSCTFPacker); diff --git a/EventFilter/CSCTFRawToDigi/plugins/CSCTFUnpacker.cc b/EventFilter/CSCTFRawToDigi/plugins/CSCTFUnpacker.cc index 8ef1ce1e3109c..3d4b1a427643f 100644 --- a/EventFilter/CSCTFRawToDigi/plugins/CSCTFUnpacker.cc +++ b/EventFilter/CSCTFRawToDigi/plugins/CSCTFUnpacker.cc @@ -1,4 +1,45 @@ -#include "EventFilter/CSCTFRawToDigi/interface/CSCTFUnpacker.h" +#include "FWCore/Framework/interface/stream/EDProducer.h" +#include "FWCore/Framework/interface/ConsumesCollector.h" +#include +#include + +//CSC Track Finder Raw Data Format +#include "EventFilter/CSCTFRawToDigi/src/CSCTFEvent.h" + +//FEDRawData +#include "DataFormats/FEDRawData/interface/FEDRawData.h" +#include "DataFormats/FEDRawData/interface/FEDNumbering.h" +#include "DataFormats/FEDRawData/interface/FEDRawDataCollection.h" + +#include +#include + +class CSCTriggerMapping; + +class CSCTFUnpacker : public edm::stream::EDProducer<> { +private: + int m_minBX, m_maxBX; + bool swapME1strips; + + CSCTriggerMapping* mapping; // redundant, but needed + + CSCTFEvent tfEvent; // TF data container + + // geometry may not be properly set in CSC TF data + // make an artificial assignment of each of 12 SPs (slots 6-11 and 16-21) to 12 sectors (1-12, 0-not assigned) + std::vector slot2sector; + + // label of the module which produced raw data + edm::InputTag producer; + + edm::EDGetTokenT Raw_token; + +public: + void produce(edm::Event& e, const edm::EventSetup& c) override; + + CSCTFUnpacker(const edm::ParameterSet& pset); + ~CSCTFUnpacker(void) override; +}; //Framework stuff #include "DataFormats/Common/interface/Handle.h" @@ -330,3 +371,6 @@ void CSCTFUnpacker::produce(edm::Event& e, const edm::EventSetup& c) { e.put(std::move(trackProduct)); e.put(std::move(statusProduct)); } + +#include "FWCore/Framework/interface/MakerMacros.h" +DEFINE_FWK_MODULE(CSCTFUnpacker); diff --git a/EventFilter/CSCTFRawToDigi/plugins/SealModule.cc b/EventFilter/CSCTFRawToDigi/plugins/SealModule.cc deleted file mode 100644 index 1a69f18313757..0000000000000 --- a/EventFilter/CSCTFRawToDigi/plugins/SealModule.cc +++ /dev/null @@ -1,8 +0,0 @@ -#include "FWCore/Framework/interface/MakerMacros.h" -#include -#include -#include - -DEFINE_FWK_MODULE(CSCTFUnpacker); -DEFINE_FWK_MODULE(CSCTFPacker); -DEFINE_FWK_MODULE(CSCTFAnalyzer); diff --git a/EventFilter/CTPPSRawToDigi/interface/CTPPSPixelDataFormatter.h b/EventFilter/CTPPSRawToDigi/interface/CTPPSPixelDataFormatter.h index dcc0a9c2248a2..1f8d0d0b89b2f 100644 --- a/EventFilter/CTPPSRawToDigi/interface/CTPPSPixelDataFormatter.h +++ b/EventFilter/CTPPSRawToDigi/interface/CTPPSPixelDataFormatter.h @@ -71,7 +71,8 @@ class CTPPSPixelDataFormatter { int nWords() const { return m_WordCounter; } - void interpretRawData(bool& errorsInEvent, int fedId, const FEDRawData& data, Collection& digis, Errors& errors); + void interpretRawData( + const bool& isRun3, bool& errorsInEvent, int fedId, const FEDRawData& data, Collection& digis, Errors& errors); int nDigis() const { return m_DigiCounter; } @@ -83,7 +84,8 @@ class CTPPSPixelDataFormatter { short unsigned int fedch; }; - void formatRawData(unsigned int lvl1_ID, + void formatRawData(const bool& isRun3, + unsigned int lvl1_ID, RawData& fedRawData, const Digis& digis, std::vector v_iDdet2fed); @@ -98,8 +100,8 @@ class CTPPSPixelDataFormatter { bool m_IncludeErrors; RPixErrorChecker m_ErrorCheck; - int m_ADC_shift, m_PXID_shift, m_DCOL_shift, m_ROC_shift, m_LINK_shift; - Word32 m_LINK_mask, m_ROC_mask, m_DCOL_mask, m_PXID_mask, m_ADC_mask; + int m_ADC_shift, m_PXID_shift, m_DCOL_shift, m_ROC_shift, m_LINK_shift, m_COL_shift, m_ROW_shift; + Word32 m_LINK_mask, m_ROC_mask, m_DCOL_mask, m_PXID_mask, m_ADC_mask, m_COL_mask, m_ROW_mask; int checkError(const Word32& data) const; diff --git a/EventFilter/CTPPSRawToDigi/interface/CTPPSPixelRawToDigi.h b/EventFilter/CTPPSRawToDigi/interface/CTPPSPixelRawToDigi.h index 12604c610320f..679638680fec1 100644 --- a/EventFilter/CTPPSRawToDigi/interface/CTPPSPixelRawToDigi.h +++ b/EventFilter/CTPPSRawToDigi/interface/CTPPSPixelRawToDigi.h @@ -44,5 +44,6 @@ class CTPPSPixelRawToDigi : public edm::stream::EDProducer<> { std::string mappingLabel_; bool includeErrors_; + bool isRun3_; }; #endif diff --git a/EventFilter/CTPPSRawToDigi/plugins/CTPPSPixelDigiToRaw.cc b/EventFilter/CTPPSRawToDigi/plugins/CTPPSPixelDigiToRaw.cc index 38461b1de90c4..0907d376bea02 100644 --- a/EventFilter/CTPPSRawToDigi/plugins/CTPPSPixelDigiToRaw.cc +++ b/EventFilter/CTPPSRawToDigi/plugins/CTPPSPixelDigiToRaw.cc @@ -82,6 +82,7 @@ class CTPPSPixelDigiToRaw : public edm::stream::EDProducer<> { edm::ESGetToken tCTPPSPixelDAQMapping_; std::vector v_iDdet2fed_; CTPPSPixelFramePosition fPos_; + bool isRun3_; }; // @@ -106,6 +107,8 @@ CTPPSPixelDigiToRaw::CTPPSPixelDigiToRaw(const edm::ParameterSet& iConfig) // Define EDProduct type produces(); + + isRun3_ = iConfig.getParameter("isRun3"); } CTPPSPixelDigiToRaw::~CTPPSPixelDigiToRaw() {} @@ -149,7 +152,7 @@ void CTPPSPixelDigiToRaw::produce(edm::Event& iEvent, const edm::EventSetup& iSe std::sort(v_iDdet2fed_.begin(), v_iDdet2fed_.end(), CTPPSPixelDataFormatter::compare); // convert data to raw - formatter.formatRawData(iEvent.id().event(), rawdata, digis, v_iDdet2fed_); + formatter.formatRawData(isRun3_, iEvent.id().event(), rawdata, digis, v_iDdet2fed_); // pack raw data into collection for (auto it = fedIds_.begin(); it != fedIds_.end(); it++) { @@ -171,6 +174,7 @@ void CTPPSPixelDigiToRaw::produce(edm::Event& iEvent, const edm::EventSetup& iSe // ------------ method fills 'descriptions' with the allowed parameters for the module ------------ void CTPPSPixelDigiToRaw::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { edm::ParameterSetDescription desc; + desc.add("isRun3", true); desc.add("InputLabel", edm::InputTag("RPixDetDigitizer")); desc.add("mappingLabel", "RPix"); descriptions.add("ctppsPixelRawData", desc); diff --git a/EventFilter/CTPPSRawToDigi/plugins/CTPPSPixelRawToDigi.cc b/EventFilter/CTPPSRawToDigi/plugins/CTPPSPixelRawToDigi.cc index c0002f2bd2703..9856c37e728cf 100644 --- a/EventFilter/CTPPSRawToDigi/plugins/CTPPSPixelRawToDigi.cc +++ b/EventFilter/CTPPSRawToDigi/plugins/CTPPSPixelRawToDigi.cc @@ -30,6 +30,7 @@ CTPPSPixelRawToDigi::CTPPSPixelRawToDigi(const edm::ParameterSet& conf) produces>(); + isRun3_ = config_.getParameter("isRun3"); includeErrors_ = config_.getParameter("includeErrors"); mappingLabel_ = config_.getParameter("mappingLabel"); @@ -44,6 +45,7 @@ CTPPSPixelRawToDigi::~CTPPSPixelRawToDigi() { void CTPPSPixelRawToDigi::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { edm::ParameterSetDescription desc; + desc.add("isRun3", true); desc.add("includeErrors", true); desc.add("inputLabel", edm::InputTag("rawDataCollector")); desc.add("mappingLabel", "RPix"); @@ -89,7 +91,7 @@ void CTPPSPixelRawToDigi::produce(edm::Event& ev, const edm::EventSetup& es) { /// get event data for this fed const FEDRawData& fedRawData = buffers->FEDData(fedId); - formatter.interpretRawData(errorsInEvent, fedId, fedRawData, *collection, errors); + formatter.interpretRawData(isRun3_, errorsInEvent, fedId, fedRawData, *collection, errors); if (includeErrors_) { for (auto const& is : errors) { diff --git a/EventFilter/CTPPSRawToDigi/python/ctppsRawToDigi_cff.py b/EventFilter/CTPPSRawToDigi/python/ctppsRawToDigi_cff.py index 9151ec8467804..04708735e343c 100644 --- a/EventFilter/CTPPSRawToDigi/python/ctppsRawToDigi_cff.py +++ b/EventFilter/CTPPSRawToDigi/python/ctppsRawToDigi_cff.py @@ -113,6 +113,11 @@ from EventFilter.CTPPSRawToDigi.ctppsPixelDigis_cfi import ctppsPixelDigis ctppsPixelDigis.inputLabel = cms.InputTag("rawDataCollector") +from Configuration.Eras.Modifier_ctpps_2016_cff import ctpps_2016 +from Configuration.Eras.Modifier_ctpps_2017_cff import ctpps_2017 +from Configuration.Eras.Modifier_ctpps_2018_cff import ctpps_2018 +(ctpps_2016 | ctpps_2017 | ctpps_2018).toModify(ctppsPixelDigis, isRun3 = False ) + # raw-to-digi task and sequence ctppsRawToDigiTask = cms.Task( totemTriggerRawToDigi, diff --git a/EventFilter/CTPPSRawToDigi/src/CTPPSPixelDataFormatter.cc b/EventFilter/CTPPSRawToDigi/src/CTPPSPixelDataFormatter.cc index b42bf70341085..983ad51d77cbf 100644 --- a/EventFilter/CTPPSRawToDigi/src/CTPPSPixelDataFormatter.cc +++ b/EventFilter/CTPPSRawToDigi/src/CTPPSPixelDataFormatter.cc @@ -21,13 +21,20 @@ namespace { constexpr int m_ROC_bits = 5; constexpr int m_DCOL_bits = 5; constexpr int m_PXID_bits = 8; + constexpr int m_COL_bits = 6; + constexpr int m_ROW_bits = 7; constexpr int m_ADC_bits = 8; constexpr int min_Dcol = 0; constexpr int max_Dcol = 25; constexpr int min_Pixid = 2; constexpr int max_Pixid = 161; + constexpr int min_COL = 0; + constexpr int max_COL = 51; + constexpr int min_ROW = 0; + constexpr int max_ROW = 79; constexpr int maxRocIndex = 3; - constexpr int maxLinkIndex = 13; + constexpr int maxLinkIndex = 49; + } // namespace CTPPSPixelDataFormatter::CTPPSPixelDataFormatter(std::map const& mapping) @@ -44,6 +51,10 @@ CTPPSPixelDataFormatter::CTPPSPixelDataFormatter(std::map> m_LINK_shift) & m_LINK_mask; int nroc = (ww >> m_ROC_shift) & m_ROC_mask; - int FMC = 0; uint32_t iD = RPixErrorChecker::dummyDetId; //0xFFFFFFFF; //dummyDetId int convroc = nroc - 1; CTPPSPixelFramePosition fPos(fedId, FMC, nlink, convroc); + std::map::const_iterator mit; mit = m_Mapping.find(fPos); @@ -161,8 +176,10 @@ void CTPPSPixelDataFormatter::interpretRawData( int dcol = (ww >> m_DCOL_shift) & m_DCOL_mask; int pxid = (ww >> m_PXID_shift) & m_PXID_mask; + int col = (ww >> m_COL_shift) & m_COL_mask; + int row = (ww >> m_ROW_shift) & m_ROW_mask; - if (dcol < min_Dcol || dcol > max_Dcol || pxid < min_Pixid || pxid > max_Pixid) { + if (!isRun3 && (dcol < min_Dcol || dcol > max_Dcol || pxid < min_Pixid || pxid > max_Pixid)) { edm::LogError("CTPPSPixelDataFormatter") << " unphysical dcol and/or pxid " << " nllink=" << nlink << " nroc=" << nroc << " adc=" << adc << " dcol=" << dcol << " pxid=" << pxid; @@ -171,13 +188,26 @@ void CTPPSPixelDataFormatter::interpretRawData( continue; } + if (isRun3 && (col < min_COL || col > max_COL || row < min_ROW || row > max_ROW)) { + edm::LogError("CTPPSPixelDataFormatter") + << " unphysical col and/or row " + << " nllink=" << nlink << " nroc=" << nroc << " adc=" << adc << " col=" << col << " row=" << row; + + m_ErrorCheck.conversionError(fedId, iD, InvalidPixelId, ww, errors); + + continue; + } std::pair rocPixel; std::pair modPixel; - rocPixel = std::make_pair(dcol, pxid); - - modPixel = rocp.toGlobalfromDcol(rocPixel); + if (isRun3) { + rocPixel = std::make_pair(row, col); + modPixel = rocp.toGlobal(rocPixel); + } else { + rocPixel = std::make_pair(dcol, pxid); + modPixel = rocp.toGlobalfromDcol(rocPixel); + } CTPPSPixelDigi testdigi(modPixel.first, modPixel.second, adc); @@ -186,7 +216,8 @@ void CTPPSPixelDataFormatter::interpretRawData( } } -void CTPPSPixelDataFormatter::formatRawData(unsigned int lvl1_ID, +void CTPPSPixelDataFormatter::formatRawData(const bool& isRun3, + unsigned int lvl1_ID, RawData& fedRawData, const Digis& digis, std::vector iDdet2fed) { @@ -219,11 +250,19 @@ void CTPPSPixelDataFormatter::formatRawData(unsigned int lvl1_ID, nroc = iDdet2fed.at(i).rocch + 1; pps::pixel::ElectronicIndex cabling = {nlink, nroc, dcol, pxid}; - - cms_uint32_t word = (cabling.link << m_LINK_shift) | (cabling.roc << m_ROC_shift) | - (cabling.dcol << m_DCOL_shift) | (cabling.pxid << m_PXID_shift) | (it.adc() << m_ADC_shift); - - words[iDdet2fed.at(i).fedid].push_back(word); + if (isRun3) { + cms_uint32_t word = (cabling.link << m_LINK_shift) | (cabling.roc << m_ROC_shift) | + (rocPixelColumn << m_COL_shift) | (rocPixelRow << m_ROW_shift) | + (it.adc() << m_ADC_shift); + + words[iDdet2fed.at(i).fedid].push_back(word); + } else { + cms_uint32_t word = (cabling.link << m_LINK_shift) | (cabling.roc << m_ROC_shift) | + (cabling.dcol << m_DCOL_shift) | (cabling.pxid << m_PXID_shift) | + (it.adc() << m_ADC_shift); + + words[iDdet2fed.at(i).fedid].push_back(word); + } m_WordCounter++; m_hasDetDigis++; diff --git a/EventFilter/CTPPSRawToDigi/test/test_pixels_only_cfg_eraRun3_562.py b/EventFilter/CTPPSRawToDigi/test/test_pixels_only_cfg_eraRun3_562.py new file mode 100644 index 0000000000000..d718caed4da45 --- /dev/null +++ b/EventFilter/CTPPSRawToDigi/test/test_pixels_only_cfg_eraRun3_562.py @@ -0,0 +1,82 @@ +import FWCore.ParameterSet.Config as cms +from Configuration.StandardSequences.Eras import eras + +#process = cms.Process("CTPPSRawToDigiTestPixelsOnly",eras.Run2_2017) +process = cms.Process("CTPPSRawToDigiTestPixelsOnly",eras.Run3) +# minimum of logs +process.MessageLogger = cms.Service("MessageLogger", + statistics = cms.untracked.vstring(), + destinations = cms.untracked.vstring('cerr'), + cerr = cms.untracked.PSet( threshold = cms.untracked.string('DEBUG') ) +) + +# raw data source +process.source = cms.Source("PoolSource", + fileNames = cms.untracked.vstring( +# 'file:/afs/cern.ch/user/f/fabferro/WORKSPACE/public/Unpacking/CMSSW_11_3_0/src/IORawData/SiPixelInputSources/test/PixelAlive_1463_548.root' + 'file:/eos/cms/store/group/dpg_ctpps/comm_ctpps/PixelAlive_562_RAW.root' + ), +labelRawDataLikeMC = cms.untracked.bool(False), # for testing H8 data +duplicateCheckMode = cms.untracked.string("checkEachFile") +) + +process.maxEvents = cms.untracked.PSet( + input = cms.untracked.int32(-1) +) + +#process.load("CalibPPS.ESProducers.CTPPSPixelDAQMappingESSourceXML_cfi") + +#ctppsPixelDAQMappingESSourceXML = cms.ESSource("CTPPSPixelDAQMappingESSourceXML", +# verbosity = cms.untracked.uint32(2), +# subSystem= cms.untracked.string("RPix"), +# configuration = cms.VPSet( + # example configuration block: +# cms.PSet( +# validityRange = cms.EventRange("1:min - 999999999:max"), +# mappingFileNames = cms.vstring("CondFormats/PPSObjects/xml/rpix_tests_2021.xml"), +# maskFileNames = cms.vstring("CondFormats/PPSObjects/xml/rpix_channel_mask_220_far.xml") +# ) +# ) +# +#) + +# raw-to-digi conversion +process.load("EventFilter.CTPPSRawToDigi.ctppsRawToDigi_cff") +process.ctppsPixelDigis.inputLabel = cms.InputTag("source") + + + + + +#process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') +#from Configuration.AlCa.GlobalTag import GlobalTag +#process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase1_2021_realistic', '') + + +process.load("CondCore.CondDB.CondDB_cfi") +# input database (in this case the local sqlite file) +process.CondDB.connect = 'sqlite_file:/eos/cms/store/group/dpg_ctpps/comm_ctpps/CTPPSPixel_DAQMapping_AnalysisMask.db' + +process.PoolDBESSource = cms.ESSource("PoolDBESSource", + process.CondDB, + DumpStat=cms.untracked.bool(True), + toGet = cms.VPSet(cms.PSet( + record = cms.string('CTPPSPixelDAQMappingRcd'), + tag = cms.string("PixelDAQMapping") + )), +) + +process.p = cms.Path( + process.ctppsPixelDigis +# process.ctppsRawToDigi +) + +# output configuration +process.output = cms.OutputModule("PoolOutputModule", + fileName = cms.untracked.string("file:./_digi_PixelAlive_562.root"), + outputCommands = cms.untracked.vstring( + 'keep *' + ) +) + +process.outpath = cms.EndPath(process.output) diff --git a/EventFilter/DTRawToDigi/interface/DTROS25Data.h b/EventFilter/DTRawToDigi/interface/DTROS25Data.h deleted file mode 100644 index 57ea5ecaa1df0..0000000000000 --- a/EventFilter/DTRawToDigi/interface/DTROS25Data.h +++ /dev/null @@ -1,61 +0,0 @@ -#ifndef DTRawToDigi_DTROS25Data_h -#define DTRawToDigi_DTROS25Data_h - -/** \class DTROS25Data - * The collection containing DT ROS25 status data. - * - * \author M. Zanetti - INFN Padova - */ - -#include - -#include - - -typedef std::pair DTTDCData; - -class DTROS25Data { - -public: - - /// Constructors - DTROS25Data(int ROSId = 0): theROSId(ROSId) {} - - - /// Destructor - virtual ~DTROS25Data() {} - - /// Setters - inline void setROSId(const int & ID) { theROSId = ID; } - - inline void addROSTrailer( const DTROSTrailerWord & word) { theROSTrailers.push_back(word); } - inline void addROSError( const DTROSErrorWord & word) { theROSErrors.push_back(word); } - inline void addROSDebug( const DTROSDebugWord & word) { theROSDebugs.push_back(word); } - inline void addROBTrailer( const DTROBTrailerWord & word) { theROBTrailers.push_back(word); } - inline void addTDCMeasurement( const DTTDCMeasurementWord & word) { theTDCMeasurements.push_back(word); } - inline void addTDCData( const DTTDCData & tdcData) { theTDCData.push_back(tdcData); } - - /// Getters - inline int getROSID() const { return theROSId; } - - inline const std::vector& getROSTrailers() const {return theROSTrailers;} - inline const std::vector& getROSErrors() const {return theROSErrors;} - inline const std::vector& getROSDebugs() const {return theROSDebugs;} - inline const std::vector& getROBTrailers() const {return theROBTrailers;} - inline const std::vector& getTDCMeasurements() const {return theTDCMeasurements;} - inline const std::vector& getTDCData() const {return theTDCData;} - -private: - - int theROSId; - - std::vector theROSTrailers; - std::vector theROSErrors; - std::vector theROSDebugs; - std::vector theROBTrailers; - std::vector theTDCMeasurements; - std::vector theTDCData; - -}; - -#endif diff --git a/EventFilter/ESRawToDigi/interface/ESCrcKchipFast.h b/EventFilter/ESRawToDigi/interface/ESCrcKchipFast.h deleted file mode 100644 index 206cbc5c734dc..0000000000000 --- a/EventFilter/ESRawToDigi/interface/ESCrcKchipFast.h +++ /dev/null @@ -1,50 +0,0 @@ -#ifndef ESCrcKchipFast_H -#define ESCrcKchipFast_H - -#include - -class ESCrcKchipFast { - - private : - - uint32_t crc; - - public: - - ESCrcKchipFast() { - init(); - reset() ; - }; - - void init() { - crc = 0x0ffff ; - } - - void reset() { - crc = 0x0ffff ; - } ; - - void add(unsigned int data) { - for (int i=0;i<16;i++) - { - if ((crc&0x0001) == (data&0x0001)) - crc=crc>>1; - else - crc=(crc>>1)^0x8408; // flipped 0x1021; - data=(data>>1); - } - }; - - uint32_t get_crc() { - return crc ; - }; - - bool isCrcOk(unsigned int crcin=0x0000) { - return ((get_crc()==crcin) ? true : false ); - }; - - ~ESCrcKchipFast() { } ; - -}; - -#endif diff --git a/EventFilter/EcalRawToDigi/interface/DCCEBSRPBlock.h b/EventFilter/EcalRawToDigi/interface/DCCEBSRPBlock.h index 3f87bb7361797..fafcd99cd6b42 100644 --- a/EventFilter/EcalRawToDigi/interface/DCCEBSRPBlock.h +++ b/EventFilter/EcalRawToDigi/interface/DCCEBSRPBlock.h @@ -39,8 +39,6 @@ class DCCEBSRPBlock : public DCCSRPBlock { bool checkSrpIdAndNumbSRFlags() override; std::unique_ptr* ebSrFlagsDigis_; - - EcalTrigTowerDetId* pTTDetId_; }; #endif diff --git a/EventFilter/EcalRawToDigi/interface/DCCEESRPBlock.h b/EventFilter/EcalRawToDigi/interface/DCCEESRPBlock.h index 418949318301a..beb2fa24e8c59 100644 --- a/EventFilter/EcalRawToDigi/interface/DCCEESRPBlock.h +++ b/EventFilter/EcalRawToDigi/interface/DCCEESRPBlock.h @@ -39,8 +39,6 @@ class DCCEESRPBlock : public DCCSRPBlock { bool checkSrpIdAndNumbSRFlags() override; std::unique_ptr* eeSrFlagsDigis_; - - EcalScDetId* pSCDetId_; }; #endif diff --git a/EventFilter/EcalRawToDigi/interface/DCCTCCBlock.h b/EventFilter/EcalRawToDigi/interface/DCCTCCBlock.h index 5db19585bf35b..bac78ea4e17ed 100644 --- a/EventFilter/EcalRawToDigi/interface/DCCTCCBlock.h +++ b/EventFilter/EcalRawToDigi/interface/DCCTCCBlock.h @@ -59,7 +59,6 @@ class DCCTCCBlock : public DCCDataBlockPrototype { unsigned int expTccId_; unsigned int ps_; - EcalTrigTowerDetId* pTTDetId_; EcalTriggerPrimitiveDigi* pTP_; EcalPseudoStripInputDigi* pPS_; std::unique_ptr* tps_; diff --git a/EventFilter/EcalRawToDigi/interface/ECALUnpackerException.h b/EventFilter/EcalRawToDigi/interface/ECALUnpackerException.h deleted file mode 100644 index a9f1e57d0cdb2..0000000000000 --- a/EventFilter/EcalRawToDigi/interface/ECALUnpackerException.h +++ /dev/null @@ -1,32 +0,0 @@ -// Date : 30/05/2005 -// Author : N.Almeida (LIP) - -#ifndef ECALUNPACKEREXCEPTION_H -#define ECALUNPACKEREXCEPTION_H - -#include -#include -#include - - -class ECALUnpackerException { - public : - - /** - * Constructor - */ - ECALUnpackerException(std::ostringstream a){ info_=a.str(); } - - ECALUnpackerException(std::string a){info_=a;} - /** - * Exception's discription - */ - std::string what() const throw() { return info_;} - - protected : - - std::string info_; - -}; - -#endif diff --git a/EventFilter/EcalRawToDigi/interface/EcalElectronicsMapper.h b/EventFilter/EcalRawToDigi/interface/EcalElectronicsMapper.h index 6086063d57268..e187ef1695b18 100644 --- a/EventFilter/EcalRawToDigi/interface/EcalElectronicsMapper.h +++ b/EventFilter/EcalRawToDigi/interface/EcalElectronicsMapper.h @@ -14,6 +14,7 @@ */ #include +#include #include #include #include @@ -26,9 +27,6 @@ #include #include #include -#include -#include - #include class EcalElectronicsMapping; diff --git a/EventFilter/EcalRawToDigi/interface/MatacqProducer.h b/EventFilter/EcalRawToDigi/interface/MatacqProducer.h deleted file mode 100644 index fad2161e4324e..0000000000000 --- a/EventFilter/EcalRawToDigi/interface/MatacqProducer.h +++ /dev/null @@ -1,319 +0,0 @@ -#ifndef PRODUCER_H -#define PRODUCER_H - -//#define USE_STORAGE_MANAGER - -#ifdef USE_STORAGE_MANAGER -#include "Utilities/StorageFactory/interface/Storage.h" -#include "Utilities/StorageFactory/interface/StorageFactory.h" -#else //USE_STORAGE_MANAGER not defined -#ifndef _LARGEFILE64_SOURCE -#define _LARGEFILE64_SOURCE -#endif //_LARGEFILE64_SOURCE not defined -#define _FILE_OFFSET_BITS 64 -#include -#endif //USE_STORAGE_MANAGER defined - -#include "FWCore/Framework/interface/EDProducer.h" -#include "FWCore/Utilities/interface/InputTag.h" -#include "FWCore/Utilities/interface/EDGetToken.h" -#include "EventFilter/EcalRawToDigi/interface/MatacqRawEvent.h" -#include "EventFilter/EcalRawToDigi/src/MatacqDataFormatter.h" -#include "FWCore/MessageLogger/interface/MessageLogger.h" -#include "FWCore/Utilities/interface/InputTag.h" -#include "DataFormats/FEDRawData/interface/FEDRawDataCollection.h" - -#include -#include -#include -#include - -#include - -struct NullOut { - NullOut& operator<<(std::ostream& (*pf)(std::ostream&)) { return *this; } - template - inline NullOut& operator<<(const T& a) { - return *this; - } -}; - -class MatacqProducer : public edm::EDProducer { -public: - enum calibTrigType_t { laserType = 4, ledType = 5, tpType = 6, pedType = 7 }; - -private: -#ifdef USE_STORAGE_MANAGER - typedef IOOffset filepos_t; - typedef std::unique_ptr FILE_t; -#else - typedef off_t filepos_t; - typedef FILE* FILE_t; -#endif - struct MatacqEventId { - MatacqEventId() : run(0), orbit(0) {} - MatacqEventId(uint32_t r, uint32_t o) : run(r), orbit(o) {} - - /** Run number - */ - uint32_t run; - - /** Orbit id - */ - uint32_t orbit; - - bool operator<(const MatacqEventId& a) { - return (this->run < a.run) || ((this->run == a.run) && (this->orbit < a.orbit)); - } - - bool operator>(const MatacqEventId& a) { - return (this->run > a.run) || ((this->run == a.run) && (this->orbit > a.orbit)); - } - - bool operator==(const MatacqEventId& a) { return !((*this) < a || (*this) > a); } - }; - - /** Estimates matacq event position in a file from its orbit id. This - * estimator requires that every event in the file has the same length. A - * linear extrapolation of pos=f(orbit) function from first and last event - * is performed. It gives only a rough estimate, relevant only to initiliaze - * the event search. - */ - class PosEstimator { - //Note: a better estimate could be obtained by using segment of linear - //functions. In such implementation, the estimator must be updated - //each time a point with wrong estimate has been found. - public: - PosEstimator() : eventLength_(0), orbitStepMean_(0), firstOrbit_(0), invalid_(true), verbosity_(0) {} - void init(MatacqProducer* mp); - bool invalid() const { return invalid_; } - int64_t pos(int orb) const; - int eventLength() const { return eventLength_; } - int firstOrbit() const { return firstOrbit_; } - void verbosity(int verb) { verbosity_ = verb; } - - private: - int eventLength_; - int orbitStepMean_; - int firstOrbit_; - bool invalid_; - int verbosity_; - }; - -public: - /** Constructor - * @param params seletive readout parameters - */ - explicit MatacqProducer(const edm::ParameterSet& params); - - /** Destructor - */ - ~MatacqProducer() override; - - /** Produces the EDM products - * @param CMS event - * @param eventSetup event conditions - */ - void produce(edm::Event& event, const edm::EventSetup& eventSetup) override; - -private: - /** Add matacq digi to the event - * @param event the event - * @param digiInstanceName_ name to give to the matacq digi instance - */ - void addMatacqData(edm::Event& event); - - /** Retrieve the file containing a given matacq event - * @param runNumber Number of the run the matacq event is looking from - * @param orbitId Id of the orbit of the matacq event - * @param fileChange if not null pointer, set to true if the file changed. - * @return true if file retrieval succeeded, false otherwise. - * found. - */ - bool getMatacqFile(uint32_t runNumber, uint32_t orbitId, bool* fileChange = nullptr); - - bool getMatacqEvent(uint32_t runNumber, int32_t orbitId, bool fileChange); - /*,bool doWrap = false, std::streamoff maxPos = -1);*/ - - uint32_t getRunNumber(edm::Event& ev) const; - uint32_t getOrbitId(edm::Event& ev) const; - - bool getOrbitRange(uint32_t& firstOrb, uint32_t& lastOrb); - - int getCalibTriggerType(edm::Event& ev) const; - - /** Loading orbit correction table from file. @see orbitOffsetFile_ - */ - void loadOrbitOffset(); - - /** Move input file read pointer. On failure file is rewind. - * @param buf buffer to store read data - * @param n size of data block - * @param mess text to insert in the eventual error message. - * @return true on success, false on failure - */ - bool mseek(filepos_t offset, int whence = SEEK_SET, const char* mess = nullptr); - - bool mtell(filepos_t& pos); - - /** Read a data block from input file. On failure file position is restored - * and if position restoring fails, file is rewind. - * @param buf buffer to store read data - * @param n size of data block - * @param mess text to insert in the eventual error message. - * @param peek if true file position is restored after the data read - * @return true on success, false on failure - */ - bool mread(char* buf, size_t n, const char* mess = nullptr, bool peek = false); - - bool mcheck(const std::string& name); - - bool mopen(const std::string& name); - - void mclose(); - - bool misOpened(); - - bool meof(); - - bool mrewind(); - - bool msize(filepos_t& s); - - void newRun(int prevRun, int newRun); - - static std::string runSubDir(uint32_t runNumber); - -private: - std::vector fileNames_; - - /** Instance name to use for the produced Matacq digi collection - */ - std::string digiInstanceName_; - - /** Instance name to use for the produced Matacq raw data collection - */ - std::string rawInstanceName_; - - /** Parameter to switch module timing. - */ - bool timing_; - - /** Parameter to disable matacq data production. For timing purpose. - */ - bool disabled_; - - /** Verbosity level - */ - int verbosity_; - - /** Swictch for Matacq digi producion - */ - bool produceDigis_; - - /** Switch for Matacq FED raw data production - */ - bool produceRaw_; - - /** Name of the raw data collection the Matacq data must be merge to - * if merging is enabled. - */ - edm::InputTag inputRawCollection_; - - /** EDM token to access the raw data collection the Matacq data must be merge to - * if merging is enabled. - */ - edm::EDGetTokenT inputRawCollectionToken_; - - /** Switch for merging Matacq raw data with existing raw data - * collection. - */ - bool mergeRaw_; - - /** When true look for matacq data independently of trigger type. - */ - bool ignoreTriggerType_; - - MatacqRawEvent matacq_; - - /** Stream of currently opened matacq file - */ - FILE_t inFile_; - - static const int bufferSize = 30000; //must greater or equal to maximum - // matacq event size. - std::vector data_; - MatacqDataFormatter formatter_; - const static int orbitTolerance_; - uint32_t openedFileRunNumber_; - int32_t lastOrb_; - int fastRetrievalThresh_; - - PosEstimator posEstim_; - - timeval startTime_; - - /** File name of table with orbit offset between - * matacq event and DCC. Used to recover data suffering from orbit - * miss-synchonization - */ - std::string orbitOffsetFile_; - - /** Orbit offset table. @see orbitOffsetFile_ - */ - std::map orbitOffset_; - - /** Switch for orbit ID correction. @see orbitOffsetFile_ - */ - bool doOrbitOffset_; - - /** Name of currently opened matacq file - */ - std::string inFileName_; - - static const int matacqFedId_ = 655; - - struct stats_t { - double nEvents; - double nLaserEventsWithMatacq; - double nNonLaserEventsWithMatacq; - } stats_; - - const static stats_t stats_init; - /** Log file name - */ - std::string logFileName_; - - /** Log file - */ - std::ofstream logFile_; - - /** counter for event skipping - */ - int eventSkipCounter_; - - /** Number of events to skip in case of error - */ - int onErrorDisablingEvtCnt_; - - /** Name of file to log timing - */ - std::string timeLogFile_; - /** Buffer for timing - */ - timeval timer_; - - /** Output stream to log code timing - */ - std::ofstream timeLog_; - - /** Switch for code timing. - */ - bool logTiming_; - - /** Number of the currently processed run - */ - uint32_t runNumber_; -}; - -#endif diff --git a/EventFilter/EcalRawToDigi/interface/MyWatcher.h b/EventFilter/EcalRawToDigi/interface/MyWatcher.h deleted file mode 100644 index 5d26a0df24808..0000000000000 --- a/EventFilter/EcalRawToDigi/interface/MyWatcher.h +++ /dev/null @@ -1,43 +0,0 @@ -#ifndef MyWATCHER_H -#define MyWATCHER_H - -#include "TStopwatch.h" -#include -#include - -#ifdef EDM_ML_DEBUG -class MyWatcher : public TStopwatch { - public: - MyWatcher(const std::string n=""):name(n),total(0) {} - ~MyWatcher(){} - - std::string start(bool r=true){Start(r); return " [Start]";} - std::string continu(){Continue(); return " [Continue]";} - std::string reset(){Reset(); return " [Reset]";} - std::string stop() {Stop(); return " [Stop]";} - std::string lap() { - std::stringstream o; - double r=RealTime(); - total+=r; - o<<"\n "< + +#include "EventFilter/EcalRawToDigi/interface/DCCRawDataDefinitions.h" + +#include +#include +#include +#include +#include +#include "Geometry/EcalMapping/interface/EcalMappingRcd.h" +#include "Geometry/EcalMapping/interface/EcalElectronicsMapping.h" +#include "CondFormats/EcalObjects/interface/EcalChannelStatus.h" +#include "CondFormats/DataRecord/interface/EcalChannelStatusRcd.h" + +#include +#include +#include "FWCore/Framework/interface/stream/EDProducer.h" +#include +#include +#include +#include "FWCore/Utilities/interface/ESGetToken.h" +#include "DataFormats/EcalRawData/interface/EcalListOfFEDS.h" +#include + +class EcalElectronicsMapper; +class EcalElectronicsMapping; +class DCCDataUnpacker; + +class EcalRawToDigi : public edm::stream::EDProducer<> { +public: + /** + * Class constructor + */ + explicit EcalRawToDigi(const edm::ParameterSet& ps); + + /** + * Functions that are called by framework at each event + */ + void produce(edm::Event& e, const edm::EventSetup& c) override; + static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); + + // function called at start of each run + void beginRun(const edm::Run& run, const edm::EventSetup& es) override; + + /** + * Class destructor + */ + ~EcalRawToDigi() override; + + edm::ESWatcher watcher_; + +private: + //list of FEDs to unpack + std::vector fedUnpackList_; + + std::vector orderedFedUnpackList_; + std::vector orderedDCCIdList_; + + unsigned int numbXtalTSamples_; + unsigned int numbTriggerTSamples_; + + bool headerUnpacking_; + bool srpUnpacking_; + bool tccUnpacking_; + bool feUnpacking_; + bool memUnpacking_; + bool syncCheck_; + bool feIdCheck_; + bool forceToKeepFRdata_; + bool first_; + bool put_; + + edm::EDGetTokenT dataToken_; + edm::EDGetTokenT fedsToken_; + edm::ESGetToken chStatusToken_; + edm::ESGetToken ecalMappingToken_; + + // -- For regional unacking : + bool REGIONAL_; + + //an electronics mapper class + EcalElectronicsMapper* myMap_; + + //Ecal unpacker + DCCDataUnpacker* theUnpacker_; + + unsigned int nevts_; // NA: for testing + double RUNNING_TIME_, SETUP_TIME_; +}; + #include "EventFilter/EcalRawToDigi/interface/EcalElectronicsMapper.h" #include "EventFilter/EcalRawToDigi/interface/DCCDataUnpacker.h" @@ -8,9 +110,6 @@ #include "FWCore/Framework/interface/EventSetup.h" #include "FWCore/Framework/interface/ESHandle.h" -#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" -#include "FWCore/ParameterSet/interface/ParameterSetDescription.h" - EcalRawToDigi::EcalRawToDigi(edm::ParameterSet const& conf) : @@ -524,3 +623,6 @@ EcalRawToDigi::~EcalRawToDigi() { if (theUnpacker_) delete theUnpacker_; } + +#include "FWCore/Framework/interface/MakerMacros.h" +DEFINE_FWK_MODULE(EcalRawToDigi); diff --git a/EventFilter/EcalRawToDigi/plugins/EcalRawToDigi.h b/EventFilter/EcalRawToDigi/plugins/EcalRawToDigi.h deleted file mode 100644 index a26eca3bdfd82..0000000000000 --- a/EventFilter/EcalRawToDigi/plugins/EcalRawToDigi.h +++ /dev/null @@ -1,107 +0,0 @@ -#ifndef _ECALRAWTODIGIDEV_H_ -#define _ECALRAWTODIGIDEV_H_ - -/* - *\ Class EcalRawToDigi - * - * This class takes unpacks ECAL raw data - * produces digis and raw data format prolblems reports - * - * \file EcalRawToDigi.h - * - * \author N. Almeida - * \author G. Franzoni - * -*/ - -#include - -#include "EventFilter/EcalRawToDigi/interface/DCCRawDataDefinitions.h" - -#include -#include -#include -#include -#include -#include "Geometry/EcalMapping/interface/EcalMappingRcd.h" -#include "Geometry/EcalMapping/interface/EcalElectronicsMapping.h" -#include "CondFormats/EcalObjects/interface/EcalChannelStatus.h" -#include "CondFormats/DataRecord/interface/EcalChannelStatusRcd.h" - -#include -#include -#include "FWCore/Framework/interface/stream/EDProducer.h" -#include -#include -#include -#include "FWCore/Utilities/interface/ESGetToken.h" -#include "DataFormats/EcalRawData/interface/EcalListOfFEDS.h" -#include - -class EcalElectronicsMapper; -class EcalElectronicsMapping; -class DCCDataUnpacker; - -class EcalRawToDigi : public edm::stream::EDProducer<> { -public: - /** - * Class constructor - */ - explicit EcalRawToDigi(const edm::ParameterSet& ps); - - /** - * Functions that are called by framework at each event - */ - void produce(edm::Event& e, const edm::EventSetup& c) override; - static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); - - // function called at start of each run - void beginRun(const edm::Run& run, const edm::EventSetup& es) override; - - /** - * Class destructor - */ - ~EcalRawToDigi() override; - - edm::ESWatcher watcher_; - -private: - //list of FEDs to unpack - std::vector fedUnpackList_; - - std::vector orderedFedUnpackList_; - std::vector orderedDCCIdList_; - - unsigned int numbXtalTSamples_; - unsigned int numbTriggerTSamples_; - - bool headerUnpacking_; - bool srpUnpacking_; - bool tccUnpacking_; - bool feUnpacking_; - bool memUnpacking_; - bool syncCheck_; - bool feIdCheck_; - bool forceToKeepFRdata_; - bool first_; - bool put_; - - edm::EDGetTokenT dataToken_; - edm::EDGetTokenT fedsToken_; - edm::ESGetToken chStatusToken_; - edm::ESGetToken ecalMappingToken_; - - // -- For regional unacking : - bool REGIONAL_; - - //an electronics mapper class - EcalElectronicsMapper* myMap_; - - //Ecal unpacker - DCCDataUnpacker* theUnpacker_; - - unsigned int nevts_; // NA: for testing - double RUNNING_TIME_, SETUP_TIME_; -}; - -#endif diff --git a/EventFilter/EcalRawToDigi/plugins/EcalRegionCablingESProducer.cc b/EventFilter/EcalRawToDigi/plugins/EcalRegionCablingESProducer.cc index d5cef950503f5..4237d346f2780 100644 --- a/EventFilter/EcalRawToDigi/plugins/EcalRegionCablingESProducer.cc +++ b/EventFilter/EcalRawToDigi/plugins/EcalRegionCablingESProducer.cc @@ -1,4 +1,46 @@ -#include "EventFilter/EcalRawToDigi/plugins/EcalRegionCablingESProducer.h" +// -*- C++ -*- +// +// Package: EcalRegionCablingESProducer +// Class: EcalRegionCablingESProducer +// +/**\class EcalRegionCablingESProducer EcalRegionCablingESProducer.h EventFilter/EcalRegionCablingESProducer/src/EcalRegionCablingESProducer.cc + + Description: + + Implementation: + +*/ +// +// Original Author: Jean-Roch Vlimant +// Created: Sun Oct 7 00:37:06 CEST 2007 +// +// + +// system include files +#include + +// user include files +#include "FWCore/Framework/interface/ESProducer.h" +#include "FWCore/Framework/interface/ESHandle.h" +#include "FWCore/Utilities/interface/ESGetToken.h" + +#include "EventFilter/EcalRawToDigi/interface/EcalRegionCablingRecord.h" +#include "EventFilter/EcalRawToDigi/interface/EcalRegionCabling.h" + +class EcalRegionCablingESProducer : public edm::ESProducer { +public: + EcalRegionCablingESProducer(const edm::ParameterSet&); + ~EcalRegionCablingESProducer() override; + + typedef std::unique_ptr ReturnType; + + ReturnType produce(const EcalRegionCablingRecord&); + +private: + edm::ParameterSet conf_; + + edm::ESGetToken esEcalElectronicsMappingToken_; +}; EcalRegionCablingESProducer::EcalRegionCablingESProducer(const edm::ParameterSet& iConfig) : conf_(iConfig) { auto cc = setWhatProduced(this); @@ -12,3 +54,6 @@ EcalRegionCablingESProducer::ReturnType EcalRegionCablingESProducer::produce(con return std::make_unique(conf_, mapping.product()); } + +#include "FWCore/Framework/interface/ModuleFactory.h" +DEFINE_FWK_EVENTSETUP_MODULE(EcalRegionCablingESProducer); diff --git a/EventFilter/EcalRawToDigi/plugins/EcalRegionCablingESProducer.h b/EventFilter/EcalRawToDigi/plugins/EcalRegionCablingESProducer.h deleted file mode 100644 index 485cf367cfc87..0000000000000 --- a/EventFilter/EcalRawToDigi/plugins/EcalRegionCablingESProducer.h +++ /dev/null @@ -1,46 +0,0 @@ -#ifndef EventFilter_EcalRawToDigi_EcalRegionCablingESProducer_H -#define EventFilter_EcalRawToDigi_EcalRegionCablingESProducer_H -// -*- C++ -*- -// -// Package: EcalRegionCablingESProducer -// Class: EcalRegionCablingESProducer -// -/**\class EcalRegionCablingESProducer EcalRegionCablingESProducer.h EventFilter/EcalRegionCablingESProducer/src/EcalRegionCablingESProducer.cc - - Description: - - Implementation: - -*/ -// -// Original Author: Jean-Roch Vlimant -// Created: Sun Oct 7 00:37:06 CEST 2007 -// -// - -// system include files -#include - -// user include files -#include "FWCore/Framework/interface/ESProducer.h" -#include "FWCore/Framework/interface/ESHandle.h" -#include "FWCore/Utilities/interface/ESGetToken.h" - -#include "EventFilter/EcalRawToDigi/interface/EcalRegionCablingRecord.h" -#include "EventFilter/EcalRawToDigi/interface/EcalRegionCabling.h" - -class EcalRegionCablingESProducer : public edm::ESProducer { -public: - EcalRegionCablingESProducer(const edm::ParameterSet&); - ~EcalRegionCablingESProducer() override; - - typedef std::unique_ptr ReturnType; - - ReturnType produce(const EcalRegionCablingRecord&); - -private: - edm::ParameterSet conf_; - - edm::ESGetToken esEcalElectronicsMappingToken_; -}; -#endif diff --git a/EventFilter/EcalRawToDigi/plugins/MatacqProducer.cc b/EventFilter/EcalRawToDigi/plugins/MatacqProducer.cc index d50b96c0725fc..b3a523297c7ec 100644 --- a/EventFilter/EcalRawToDigi/plugins/MatacqProducer.cc +++ b/EventFilter/EcalRawToDigi/plugins/MatacqProducer.cc @@ -1,9 +1,321 @@ -#include +//#define USE_STORAGE_MANAGER + +#ifdef USE_STORAGE_MANAGER +#include "Utilities/StorageFactory/interface/Storage.h" +#include "Utilities/StorageFactory/interface/StorageFactory.h" +#else //USE_STORAGE_MANAGER not defined +#ifndef _LARGEFILE64_SOURCE +#define _LARGEFILE64_SOURCE +#endif //_LARGEFILE64_SOURCE not defined +#define _FILE_OFFSET_BITS 64 #include +#endif //USE_STORAGE_MANAGER defined + +#include "FWCore/Framework/interface/EDProducer.h" +#include "FWCore/Utilities/interface/InputTag.h" +#include "FWCore/Utilities/interface/EDGetToken.h" +#include "EventFilter/EcalRawToDigi/interface/MatacqRawEvent.h" +#include "EventFilter/EcalRawToDigi/src/MatacqDataFormatter.h" +#include "FWCore/MessageLogger/interface/MessageLogger.h" +#include "DataFormats/FEDRawData/interface/FEDRawDataCollection.h" + +#include +#include #include +#include + +#include + +struct NullOut { + NullOut& operator<<(std::ostream& (*pf)(std::ostream&)) { return *this; } + template + inline NullOut& operator<<(const T& a) { + return *this; + } +}; + +class MatacqProducer : public edm::EDProducer { +public: + enum calibTrigType_t { laserType = 4, ledType = 5, tpType = 6, pedType = 7 }; + +private: +#ifdef USE_STORAGE_MANAGER + typedef IOOffset filepos_t; + typedef std::unique_ptr FILE_t; +#else + typedef off_t filepos_t; + typedef FILE* FILE_t; +#endif + struct MatacqEventId { + MatacqEventId() : run(0), orbit(0) {} + MatacqEventId(uint32_t r, uint32_t o) : run(r), orbit(o) {} + + /** Run number + */ + uint32_t run; + + /** Orbit id + */ + uint32_t orbit; + + bool operator<(const MatacqEventId& a) { + return (this->run < a.run) || ((this->run == a.run) && (this->orbit < a.orbit)); + } + + bool operator>(const MatacqEventId& a) { + return (this->run > a.run) || ((this->run == a.run) && (this->orbit > a.orbit)); + } + + bool operator==(const MatacqEventId& a) { return !((*this) < a || (*this) > a); } + }; + + /** Estimates matacq event position in a file from its orbit id. This + * estimator requires that every event in the file has the same length. A + * linear extrapolation of pos=f(orbit) function from first and last event + * is performed. It gives only a rough estimate, relevant only to initiliaze + * the event search. + */ + class PosEstimator { + //Note: a better estimate could be obtained by using segment of linear + //functions. In such implementation, the estimator must be updated + //each time a point with wrong estimate has been found. + public: + PosEstimator() : eventLength_(0), orbitStepMean_(0), firstOrbit_(0), invalid_(true), verbosity_(0) {} + void init(MatacqProducer* mp); + bool invalid() const { return invalid_; } + int64_t pos(int orb) const; + int eventLength() const { return eventLength_; } + int firstOrbit() const { return firstOrbit_; } + void verbosity(int verb) { verbosity_ = verb; } + + private: + int eventLength_; + int orbitStepMean_; + int firstOrbit_; + bool invalid_; + int verbosity_; + }; + +public: + /** Constructor + * @param params seletive readout parameters + */ + explicit MatacqProducer(const edm::ParameterSet& params); + + /** Destructor + */ + ~MatacqProducer() override; + + /** Produces the EDM products + * @param CMS event + * @param eventSetup event conditions + */ + void produce(edm::Event& event, const edm::EventSetup& eventSetup) override; + +private: + /** Add matacq digi to the event + * @param event the event + * @param digiInstanceName_ name to give to the matacq digi instance + */ + void addMatacqData(edm::Event& event); + + /** Retrieve the file containing a given matacq event + * @param runNumber Number of the run the matacq event is looking from + * @param orbitId Id of the orbit of the matacq event + * @param fileChange if not null pointer, set to true if the file changed. + * @return true if file retrieval succeeded, false otherwise. + * found. + */ + bool getMatacqFile(uint32_t runNumber, uint32_t orbitId, bool* fileChange = nullptr); + + bool getMatacqEvent(uint32_t runNumber, int32_t orbitId, bool fileChange); + /*,bool doWrap = false, std::streamoff maxPos = -1);*/ + + uint32_t getRunNumber(edm::Event& ev) const; + uint32_t getOrbitId(edm::Event& ev) const; + + bool getOrbitRange(uint32_t& firstOrb, uint32_t& lastOrb); + + int getCalibTriggerType(edm::Event& ev) const; + + /** Loading orbit correction table from file. @see orbitOffsetFile_ + */ + void loadOrbitOffset(); + + /** Move input file read pointer. On failure file is rewind. + * @param buf buffer to store read data + * @param n size of data block + * @param mess text to insert in the eventual error message. + * @return true on success, false on failure + */ + bool mseek(filepos_t offset, int whence = SEEK_SET, const char* mess = nullptr); + + bool mtell(filepos_t& pos); + + /** Read a data block from input file. On failure file position is restored + * and if position restoring fails, file is rewind. + * @param buf buffer to store read data + * @param n size of data block + * @param mess text to insert in the eventual error message. + * @param peek if true file position is restored after the data read + * @return true on success, false on failure + */ + bool mread(char* buf, size_t n, const char* mess = nullptr, bool peek = false); + + bool mcheck(const std::string& name); + + bool mopen(const std::string& name); + + void mclose(); + + bool misOpened(); + + bool meof(); + + bool mrewind(); + + bool msize(filepos_t& s); + + void newRun(int prevRun, int newRun); + + static std::string runSubDir(uint32_t runNumber); + +private: + std::vector fileNames_; + + /** Instance name to use for the produced Matacq digi collection + */ + std::string digiInstanceName_; + + /** Instance name to use for the produced Matacq raw data collection + */ + std::string rawInstanceName_; + + /** Parameter to switch module timing. + */ + bool timing_; + + /** Parameter to disable matacq data production. For timing purpose. + */ + bool disabled_; + + /** Verbosity level + */ + int verbosity_; + + /** Swictch for Matacq digi producion + */ + bool produceDigis_; + + /** Switch for Matacq FED raw data production + */ + bool produceRaw_; + + /** Name of the raw data collection the Matacq data must be merge to + * if merging is enabled. + */ + edm::InputTag inputRawCollection_; + + /** EDM token to access the raw data collection the Matacq data must be merge to + * if merging is enabled. + */ + edm::EDGetTokenT inputRawCollectionToken_; + + /** Switch for merging Matacq raw data with existing raw data + * collection. + */ + bool mergeRaw_; + + /** When true look for matacq data independently of trigger type. + */ + bool ignoreTriggerType_; + + MatacqRawEvent matacq_; + + /** Stream of currently opened matacq file + */ + FILE_t inFile_; + + static const int bufferSize = 30000; //must greater or equal to maximum + // matacq event size. + std::vector data_; + MatacqDataFormatter formatter_; + const static int orbitTolerance_; + uint32_t openedFileRunNumber_; + int32_t lastOrb_; + int fastRetrievalThresh_; + + PosEstimator posEstim_; + + timeval startTime_; + + /** File name of table with orbit offset between + * matacq event and DCC. Used to recover data suffering from orbit + * miss-synchonization + */ + std::string orbitOffsetFile_; + + /** Orbit offset table. @see orbitOffsetFile_ + */ + std::map orbitOffset_; + + /** Switch for orbit ID correction. @see orbitOffsetFile_ + */ + bool doOrbitOffset_; + + /** Name of currently opened matacq file + */ + std::string inFileName_; + + static const int matacqFedId_ = 655; + + struct stats_t { + double nEvents; + double nLaserEventsWithMatacq; + double nNonLaserEventsWithMatacq; + } stats_; + + const static stats_t stats_init; + /** Log file name + */ + std::string logFileName_; + + /** Log file + */ + std::ofstream logFile_; + + /** counter for event skipping + */ + int eventSkipCounter_; + + /** Number of events to skip in case of error + */ + int onErrorDisablingEvtCnt_; + + /** Name of file to log timing + */ + std::string timeLogFile_; + /** Buffer for timing + */ + timeval timer_; + + /** Output stream to log code timing + */ + std::ofstream timeLog_; + + /** Switch for code timing. + */ + bool logTiming_; + + /** Number of the currently processed run + */ + uint32_t runNumber_; +}; + +#include +#include #include #include -#include #include #include @@ -15,10 +327,8 @@ #include "DataFormats/EcalDigi/interface/EcalDigiCollections.h" #include "DataFormats/EcalDigi/interface/EcalMatacqDigi.h" -#include "DataFormats/EcalDigi/interface/EcalMatacqDigi.h" #include "DataFormats/FEDRawData/interface/FEDNumbering.h" #include "DataFormats/FEDRawData/interface/FEDRawData.h" -#include "EventFilter/EcalRawToDigi/interface/MatacqProducer.h" #include "EventFilter/EcalRawToDigi/src/Majority.h" #include "FWCore/Framework/interface/ESHandle.h" #include "FWCore/Framework/interface/Event.h" @@ -1163,3 +1473,6 @@ bool MatacqProducer::getOrbitRange(uint32_t& firstOrb, uint32_t& lastOrb) { return true; } + +#include "FWCore/Framework/interface/MakerMacros.h" +DEFINE_FWK_MODULE(MatacqProducer); diff --git a/EventFilter/EcalRawToDigi/plugins/SealModules.cc b/EventFilter/EcalRawToDigi/plugins/SealModules.cc deleted file mode 100644 index e1e9ddf7c8539..0000000000000 --- a/EventFilter/EcalRawToDigi/plugins/SealModules.cc +++ /dev/null @@ -1,14 +0,0 @@ -#include - -#include "FWCore/Framework/interface/ModuleFactory.h" -#include "EventFilter/EcalRawToDigi/plugins/EcalRegionCablingESProducer.h" -DEFINE_FWK_EVENTSETUP_MODULE(EcalRegionCablingESProducer); - -#include "EventFilter/EcalRawToDigi/plugins/EcalRawToDigi.h" -DEFINE_FWK_MODULE(EcalRawToDigi); - -#include "EventFilter/EcalRawToDigi/interface/MatacqProducer.h" -DEFINE_FWK_MODULE(MatacqProducer); - -#include "EventFilter/EcalRawToDigi/interface/EcalDumpRaw.h" -DEFINE_FWK_MODULE(EcalDumpRaw); diff --git a/EventFilter/EcalRawToDigi/src/DCCEESRPBlock.cc b/EventFilter/EcalRawToDigi/src/DCCEESRPBlock.cc index 97a1c5dc0b286..65288060996ca 100644 --- a/EventFilter/EcalRawToDigi/src/DCCEESRPBlock.cc +++ b/EventFilter/EcalRawToDigi/src/DCCEESRPBlock.cc @@ -16,7 +16,7 @@ void DCCEESRPBlock::addSRFlagToCollection() { data_++; const uint16_t *my16Bitp_ = reinterpret_cast(data_); - for (unsigned int n = 0; n < expNumbSrFlags_; n++, pSCDetId_++) { + for (unsigned int n = 0; n < expNumbSrFlags_; ++n) { if (n != 0 && n % 4 == 0) my16Bitp_++; diff --git a/EventFilter/EcalRawToDigi/src/MatacqDataFormatter.cc b/EventFilter/EcalRawToDigi/src/MatacqDataFormatter.cc index d0f038d7ef0e0..1c27e3728da07 100644 --- a/EventFilter/EcalRawToDigi/src/MatacqDataFormatter.cc +++ b/EventFilter/EcalRawToDigi/src/MatacqDataFormatter.cc @@ -9,7 +9,6 @@ #include #include #include -#include #include using namespace std; diff --git a/EventFilter/GEMRawToDigi/interface/GEMRawToDigi.h b/EventFilter/GEMRawToDigi/interface/GEMRawToDigi.h index f5997127a4756..075cb4b14e112 100644 --- a/EventFilter/GEMRawToDigi/interface/GEMRawToDigi.h +++ b/EventFilter/GEMRawToDigi/interface/GEMRawToDigi.h @@ -4,11 +4,11 @@ * \author J. Lee, Yechan Kang - UoS */ #include -#include "DataFormats/GEMDigi/interface/AMC13Event.h" +#include "DataFormats/GEMDigi/interface/GEMAMC13.h" class GEMRawToDigi { public: - std::unique_ptr convertWordToAMC13Event(const uint64_t* word); + std::unique_ptr convertWordToGEMAMC13(const uint64_t* word); bool vfatError() const { return vfatError_; } bool amcError() const { return amcError_; } diff --git a/EventFilter/GEMRawToDigi/plugins/GEMDigiToRawModule.cc b/EventFilter/GEMRawToDigi/plugins/GEMDigiToRawModule.cc index ec3f76c8ba5e3..45323c8af0522 100644 --- a/EventFilter/GEMRawToDigi/plugins/GEMDigiToRawModule.cc +++ b/EventFilter/GEMRawToDigi/plugins/GEMDigiToRawModule.cc @@ -13,7 +13,7 @@ #include "DataFormats/FEDRawData/interface/FEDRawData.h" #include "DataFormats/FEDRawData/interface/FEDRawDataCollection.h" #include "DataFormats/FEDRawData/interface/FEDTrailer.h" -#include "DataFormats/GEMDigi/interface/AMC13Event.h" +#include "DataFormats/GEMDigi/interface/GEMAMC13.h" #include "DataFormats/GEMDigi/interface/GEMDigiCollection.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/EventSetup.h" @@ -49,8 +49,6 @@ class GEMDigiToRawModule : public edm::global::EDProducer("eventType")), digi_token(consumes(pset.getParameter("gemDigi"))), @@ -97,15 +95,15 @@ void GEMDigiToRawModule::produce(edm::StreamID iID, edm::Event& iEvent, edm::Eve auto gemROMap = runCache(iEvent.getRun().index()); - std::vector> amc13Events; - amc13Events.reserve(FEDNumbering::MAXGEMFEDID - FEDNumbering::MINGEMFEDID + 1); + std::vector> amc13s; + amc13s.reserve(FEDNumbering::MAXGEMFEDID - FEDNumbering::MINGEMFEDID + 1); int LV1_id = iEvent.id().event(); uint8_t BX_id(iEvent.bunchCrossing()); int OrN = iEvent.orbitNumber(); // making map of bx GEMDigiCollection - // each bx will be saved as new AMC13Event, so GEMDigiCollection needs to be split into bx + // each bx will be saved as new GEMAMC13, so GEMDigiCollection needs to be split into bx std::map gemBxMap; for (auto const& etaPart : *gemDigis) { GEMDetId gemId = etaPart.first; @@ -125,14 +123,14 @@ void GEMDigiToRawModule::produce(edm::StreamID iID, edm::Event& iEvent, edm::Eve for (unsigned int fedId = FEDNumbering::MINGEMFEDID; fedId <= FEDNumbering::MAXGEMFEDID; ++fedId) { uint32_t amc13EvtLength = 0; - std::unique_ptr amc13Event = std::make_unique(); + std::unique_ptr amc13 = std::make_unique(); for (uint8_t amcNum = 0; amcNum <= GEMeMap::maxAMCs_; ++amcNum) { uint32_t amcSize = 0; - std::unique_ptr amcData = std::make_unique(); + std::unique_ptr amc = std::make_unique(); for (uint8_t gebId = 0; gebId <= GEMeMap::maxGEBs_; ++gebId) { - std::unique_ptr gebData = std::make_unique(); + std::unique_ptr optoH = std::make_unique(); GEMROMapping::chamEC geb_ec{fedId, amcNum, gebId}; if (!gemROMap->isValidChamber(geb_ec)) @@ -182,47 +180,47 @@ void GEMDigiToRawModule::produce(edm::StreamID iID, edm::Event& iEvent, edm::Eve continue; // only make vfat with hits amcSize += 3; - auto vfatData = std::make_unique(geb_dc.vfatVer, bc, LV1_id, vfatId, lsData, msData); - gebData->addVFAT(*vfatData); + auto vfat = std::make_unique(geb_dc.vfatVer, bc, LV1_id, vfatId, lsData, msData); + optoH->addVFAT(*vfat); } } // end of vfats in GEB - if (!gebData->vFATs()->empty()) { + if (!optoH->vFATs()->empty()) { amcSize += 2; - gebData->setChamberHeader(gebData->vFATs()->size() * 3, gebId); - gebData->setChamberTrailer(LV1_id, BX_id, gebData->vFATs()->size() * 3); - amcData->addGEB(*gebData); + optoH->setChamberHeader(optoH->vFATs()->size() * 3, gebId); + optoH->setChamberTrailer(LV1_id, BX_id, optoH->vFATs()->size() * 3); + amc->addGEB(*optoH); } } // end of GEB loop - if (!amcData->gebs()->empty()) { + if (!amc->gebs()->empty()) { amcSize += 5; - amcData->setAMCheader1(amcSize, BX_id, LV1_id, amcNum); - amcData->setAMCheader2(amcNum, OrN, 1); - amcData->setGEMeventHeader(amcData->gebs()->size(), 0); - amc13Event->addAMCpayload(*amcData); - // AMC header in AMC13Event - amc13Event->addAMCheader(amcSize, 0, amcNum, 0); + amc->setAMCheader1(amcSize, BX_id, LV1_id, amcNum); + amc->setAMCheader2(amcNum, OrN, 1); + amc->setGEMeventHeader(amc->gebs()->size(), 0); + amc13->addAMCpayload(*amc); + // AMC header in GEMAMC13 + amc13->addAMCheader(amcSize, 0, amcNum, 0); amc13EvtLength += amcSize + 1; // AMC data size + AMC header size } } // end of AMC loop - if (!amc13Event->getAMCpayloads()->empty()) { + if (!amc13->getAMCpayloads()->empty()) { // CDFHeader - amc13Event->setCDFHeader(event_type_, LV1_id, BX_id, fedId); + amc13->setCDFHeader(event_type_, LV1_id, BX_id, fedId); // AMC13header - uint8_t nAMC = amc13Event->getAMCpayloads()->size(); - amc13Event->setAMC13Header(1, nAMC, OrN); - amc13Event->setAMC13Trailer(BX_id, LV1_id, BX_id); + uint8_t nAMC = amc13->getAMCpayloads()->size(); + amc13->setAMC13Header(1, nAMC, OrN); + amc13->setAMC13Trailer(BX_id, LV1_id, BX_id); //CDF trailer uint32_t EvtLength = amc13EvtLength + 4; // 2 header and 2 trailer - amc13Event->setCDFTrailer(EvtLength); - amc13Events.emplace_back(std::move(amc13Event)); - } // finished making amc13Event data + amc13->setCDFTrailer(EvtLength); + amc13s.emplace_back(std::move(amc13)); + } // finished making amc13 data } // end of FED loop - // read out amc13Events into fedRawData - for (const auto& amc13e : amc13Events) { + // read out amc13s into fedRawData + for (const auto& amc13e : amc13s) { std::vector words; words.emplace_back(amc13e->getCDFHeader()); words.emplace_back(amc13e->getAMC13Header()); diff --git a/EventFilter/GEMRawToDigi/plugins/GEMRawToDigiModule.cc b/EventFilter/GEMRawToDigi/plugins/GEMRawToDigiModule.cc index 3b1e04ea88291..668a86868a26c 100644 --- a/EventFilter/GEMRawToDigi/plugins/GEMRawToDigiModule.cc +++ b/EventFilter/GEMRawToDigi/plugins/GEMRawToDigiModule.cc @@ -15,13 +15,7 @@ #include "DataFormats/GEMDigi/interface/GEMAMCStatusCollection.h" #include "DataFormats/GEMDigi/interface/GEMOHStatusCollection.h" #include "DataFormats/GEMDigi/interface/GEMVFATStatusCollection.h" -#include "DataFormats/GEMDigi/interface/AMC13Event.h" -#include "DataFormats/GEMDigi/interface/GEMAMC13EventCollection.h" -#include "DataFormats/GEMDigi/interface/GEMAMCdataCollection.h" #include "DataFormats/GEMDigi/interface/GEMDigiCollection.h" -#include "DataFormats/GEMDigi/interface/GEMGEBdataCollection.h" -#include "DataFormats/GEMDigi/interface/GEMVfatStatusDigiCollection.h" -#include "DataFormats/GEMDigi/interface/VFATdata.h" #include "EventFilter/GEMRawToDigi/interface/GEMRawToDigi.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/EventSetup.h" @@ -59,14 +53,11 @@ class GEMRawToDigiModule : public edm::global::EDProducer(pset.getParameter("InputLabel"))), useDBEMap_(pset.getParameter("useDBEMap")), keepDAQStatus_(pset.getParameter("keepDAQStatus")), readMultiBX_(pset.getParameter("readMultiBX")), - unPackStatusDigis_(pset.getParameter("unPackStatusDigis")), gemRawToDigi_(std::make_unique()) { produces(); if (keepDAQStatus_) { @@ -75,13 +66,6 @@ GEMRawToDigiModule::GEMRawToDigiModule(const edm::ParameterSet& pset) produces("OHStatus"); produces("VFATStatus"); } - if (unPackStatusDigis_) { - // to be removed - produces("vfatStatus"); - produces("gebStatus"); - produces("AMCdata"); - produces("AMC13Event"); - } if (useDBEMap_) { gemEMapToken_ = esConsumes(); } @@ -91,7 +75,6 @@ void GEMRawToDigiModule::fillDescriptions(edm::ConfigurationDescriptions& descri edm::ParameterSetDescription desc; desc.add("InputLabel", edm::InputTag("rawDataCollector")); desc.add("useDBEMap", false); - desc.add("unPackStatusDigis", false); desc.add("keepDAQStatus", false); desc.add("readMultiBX", false); descriptions.add("muonGEMDigisDefault", desc); @@ -120,12 +103,6 @@ void GEMRawToDigiModule::produce(edm::StreamID iID, edm::Event& iEvent, edm::Eve auto outOHStatus = std::make_unique(); auto outVFATStatus = std::make_unique(); - // to be removed - auto outVFATStatusOld = std::make_unique(); - auto outGEBStatus = std::make_unique(); - auto outAMCdata = std::make_unique(); - auto outAMC13Event = std::make_unique(); - // Take raw from the event edm::Handle fed_buffers; iEvent.getByToken(fed_token, fed_buffers); @@ -147,23 +124,22 @@ void GEMRawToDigiModule::produce(edm::StreamID iID, edm::Event& iEvent, edm::Eve } const uint64_t* word = reinterpret_cast(fedData.data()); - auto amc13Event = gemRawToDigi_->convertWordToAMC13Event(word); + auto amc13 = gemRawToDigi_->convertWordToGEMAMC13(word); LogDebug("GEMRawToDigiModule") << "Event bx:" << iEvent.bunchCrossing() << " lv1Id:" << iEvent.id().event() << " orbitNumber:" << iEvent.orbitNumber(); - LogDebug("GEMRawToDigiModule") << "AMC13 bx:" << amc13Event->bunchCrossing() - << " lv1Id:" << int(amc13Event->lv1Id()) - << " orbitNumber:" << amc13Event->orbitNumber(); + LogDebug("GEMRawToDigiModule") << "AMC13 bx:" << amc13->bunchCrossing() << " lv1Id:" << int(amc13->lv1Id()) + << " orbitNumber:" << amc13->orbitNumber(); // Read AMC data - for (auto amcData : *(amc13Event->getAMCpayloads())) { - uint8_t amcNum = amcData.amcNum(); + for (const auto& amc : *(amc13->getAMCpayloads())) { + uint8_t amcNum = amc.amcNum(); GEMROMapping::sectorEC amcEC{fedId, amcNum}; if (!gemROMap->isValidAMC(amcEC)) { st_amc13.inValidAMC(); continue; } - GEMAMCStatus st_amc(amc13Event.get(), amcData); + GEMAMCStatus st_amc(amc13.get(), amc); if (st_amc.isBad()) { LogDebug("GEMRawToDigiModule") << st_amc; if (keepDAQStatus_) { @@ -172,13 +148,12 @@ void GEMRawToDigiModule::produce(edm::StreamID iID, edm::Event& iEvent, edm::Eve continue; } - uint16_t amcBx = amcData.bunchCrossing(); - LogDebug("GEMRawToDigiModule") << "AMC no.:" << int(amcData.amcNum()) << " bx:" << int(amcData.bunchCrossing()) - << " lv1Id:" << int(amcData.lv1Id()) - << " orbitNumber:" << int(amcData.orbitNumber()); + uint16_t amcBx = amc.bunchCrossing(); + LogDebug("GEMRawToDigiModule") << "AMC no.:" << int(amc.amcNum()) << " bx:" << int(amc.bunchCrossing()) + << " lv1Id:" << int(amc.lv1Id()) << " orbitNumber:" << int(amc.orbitNumber()); // Read GEB data - for (auto optoHybrid : *amcData.gebs()) { + for (const auto& optoHybrid : *amc.gebs()) { uint8_t gebId = optoHybrid.inputID(); GEMROMapping::chamEC geb_ec{fedId, amcNum, gebId}; @@ -199,10 +174,10 @@ void GEMRawToDigiModule::produce(edm::StreamID iID, edm::Event& iEvent, edm::Eve } //Read vfat data - for (auto vfatData : *optoHybrid.vFATs()) { + for (auto vfat : *optoHybrid.vFATs()) { // set vfat fw version - vfatData.setVersion(geb_dc.vfatVer); - uint16_t vfatId = vfatData.vfatId(); + vfat.setVersion(geb_dc.vfatVer); + uint16_t vfatId = vfat.vfatId(); GEMROMapping::vfatEC vfat_ec{vfatId, gemChId}; if (!gemROMap->isValidChipID(vfat_ec)) { @@ -211,10 +186,10 @@ void GEMRawToDigiModule::produce(edm::StreamID iID, edm::Event& iEvent, edm::Eve } GEMROMapping::vfatDC vfat_dc = gemROMap->vfatPos(vfat_ec); - vfatData.setPhi(vfat_dc.localPhi); + vfat.setPhi(vfat_dc.localPhi); GEMDetId gemId = vfat_dc.detId; - GEMVFATStatus st_vfat(amcData, vfatData, vfatData.phi(), readMultiBX_); + GEMVFATStatus st_vfat(amc, vfat, vfat.phi(), readMultiBX_); if (st_vfat.isBad()) { LogDebug("GEMRawToDigiModule") << st_vfat; if (keepDAQStatus_) { @@ -223,14 +198,14 @@ void GEMRawToDigiModule::produce(edm::StreamID iID, edm::Event& iEvent, edm::Eve continue; } - int bx(vfatData.bc() - amcBx); + int bx(vfat.bc() - amcBx); - for (int chan = 0; chan < VFATdata::nChannels; ++chan) { + for (int chan = 0; chan < GEMVFAT::nChannels; ++chan) { uint8_t chan0xf = 0; if (chan < 64) - chan0xf = ((vfatData.lsData() >> chan) & 0x1); + chan0xf = ((vfat.lsData() >> chan) & 0x1); else - chan0xf = ((vfatData.msData() >> (chan - 64)) & 0x1); + chan0xf = ((vfat.msData() >> (chan - 64)) & 0x1); // no hits if (chan0xf == 0) @@ -239,7 +214,7 @@ void GEMRawToDigiModule::produce(edm::StreamID iID, edm::Event& iEvent, edm::Eve GEMROMapping::channelNum chMap{vfat_dc.vfatType, chan}; GEMROMapping::stripNum stMap = gemROMap->hitPos(chMap); - int stripId = stMap.stNum + vfatData.phi() * GEMeMap::maxChan_; + int stripId = stMap.stNum + vfat.phi() * GEMeMap::maxChan_; GEMDigi digi(stripId, bx); @@ -255,29 +230,18 @@ void GEMRawToDigiModule::produce(edm::StreamID iID, edm::Event& iEvent, edm::Eve if (keepDAQStatus_) { outVFATStatus.get()->insertDigi(gemId, st_vfat); } - if (unPackStatusDigis_) { - outVFATStatusOld.get()->insertDigi(gemId, GEMVfatStatusDigi(vfatData)); - } } // end of vfat loop if (keepDAQStatus_) { outOHStatus.get()->insertDigi(gemChId, st_oh); } - if (unPackStatusDigis_) { - optoHybrid.clearVFATs(); - outGEBStatus.get()->insertDigi(gemChId.chamberId(), (optoHybrid)); - } } // end of optohybrid loop if (keepDAQStatus_) { outAMCStatus.get()->insertDigi(fedId, st_amc); } - if (unPackStatusDigis_) { - amcData.clearGEBs(); - outAMCdata.get()->insertDigi(amcData.boardId(), (amcData)); - } } // end of amc loop @@ -285,11 +249,7 @@ void GEMRawToDigiModule::produce(edm::StreamID iID, edm::Event& iEvent, edm::Eve outAMC13Status.get()->insertDigi(fedId, st_amc13); } - if (unPackStatusDigis_) { - amc13Event->clearAMCpayloads(); - } - - } // end of amc13Event + } // end of amc13 iEvent.put(std::move(outGEMDigis)); @@ -299,11 +259,4 @@ void GEMRawToDigiModule::produce(edm::StreamID iID, edm::Event& iEvent, edm::Eve iEvent.put(std::move(outOHStatus), "OHStatus"); iEvent.put(std::move(outVFATStatus), "VFATStatus"); } - if (unPackStatusDigis_) { - // to be removed - iEvent.put(std::move(outVFATStatusOld), "vfatStatus"); - iEvent.put(std::move(outGEBStatus), "gebStatus"); - iEvent.put(std::move(outAMCdata), "AMCdata"); - iEvent.put(std::move(outAMC13Event), "AMC13Event"); - } } diff --git a/EventFilter/GEMRawToDigi/src/GEMRawToDigi.cc b/EventFilter/GEMRawToDigi/src/GEMRawToDigi.cc index 3151d7a180332..6adaaff75fdbf 100644 --- a/EventFilter/GEMRawToDigi/src/GEMRawToDigi.cc +++ b/EventFilter/GEMRawToDigi/src/GEMRawToDigi.cc @@ -3,56 +3,55 @@ */ #include "EventFilter/GEMRawToDigi/interface/GEMRawToDigi.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" -using namespace gem; -std::unique_ptr GEMRawToDigi::convertWordToAMC13Event(const uint64_t* word) { +std::unique_ptr GEMRawToDigi::convertWordToGEMAMC13(const uint64_t* word) { vfatError_ = false; amcError_ = false; - auto amc13Event = std::make_unique(); + auto amc13 = std::make_unique(); - amc13Event->setCDFHeader(*word); - amc13Event->setAMC13Header(*(++word)); + amc13->setCDFHeader(*word); + amc13->setAMC13Header(*(++word)); // Readout out AMC headers - for (uint8_t i = 0; i < amc13Event->nAMC(); ++i) - amc13Event->addAMCheader(*(++word)); + for (uint8_t i = 0; i < amc13->nAMC(); ++i) + amc13->addAMCheader(*(++word)); // Readout out AMC payloads - for (uint8_t i = 0; i < amc13Event->nAMC(); ++i) { - auto amcData = AMCdata(); - amcData.setAMCheader1(*(++word)); - amcData.setAMCheader2(*(++word)); - amcData.setGEMeventHeader(*(++word)); + for (uint8_t i = 0; i < amc13->nAMC(); ++i) { + auto amc = GEMAMC(); + amc.setAMCheader1(*(++word)); + amc.setAMCheader2(*(++word)); + amc.setGEMeventHeader(*(++word)); // Fill GEB - for (uint8_t j = 0; j < amcData.davCnt(); ++j) { - auto gebData = GEBdata(); - gebData.setChamberHeader(*(++word)); + for (uint8_t j = 0; j < amc.davCnt(); ++j) { + auto oh = GEMOptoHybrid(); + oh.setChamberHeader(*(++word)); // Fill vfat - for (uint16_t k = 0; k < gebData.vfatWordCnt() / 3; k++) { - auto vfatData = VFATdata(); - vfatData.read_fw(*(++word)); - vfatData.read_sw(*(++word)); - vfatData.read_tw(*(++word)); - gebData.addVFAT(vfatData); + for (uint16_t k = 0; k < oh.vfatWordCnt() / 3; k++) { + auto vfat = GEMVFAT(); + vfat.read_fw(*(++word)); + vfat.read_sw(*(++word)); + vfat.read_tw(*(++word)); + oh.addVFAT(vfat); } // end of vfat loop - gebData.setChamberTrailer(*(++word)); - amcData.addGEB(gebData); + oh.setChamberTrailer(*(++word)); + amc.addGEB(oh); } // end of geb loop - amcData.setGEMeventTrailer(*(++word)); - amcData.setAMCTrailer(*(++word)); - amc13Event->addAMCpayload(amcData); + amc.setGEMeventTrailer(*(++word)); + amc.setAMCTrailer(*(++word)); + amc13->addAMCpayload(amc); } // end of amc loop - amc13Event->setAMC13Trailer(*(++word)); - amc13Event->setCDFTrailer(*(++word)); + amc13->setAMC13Trailer(*(++word)); + amc13->setCDFTrailer(*(++word)); - return amc13Event; + return amc13; } diff --git a/EventFilter/GEMRawToDigi/test/gemUnPackerTester.py b/EventFilter/GEMRawToDigi/test/gemUnPackerTester.py index ac7bfdfeab3e1..b21d5f3d2820f 100755 --- a/EventFilter/GEMRawToDigi/test/gemUnPackerTester.py +++ b/EventFilter/GEMRawToDigi/test/gemUnPackerTester.py @@ -1,8 +1,6 @@ import FWCore.ParameterSet.Config as cms -from Configuration.Eras.Era_Run3_cff import Run3 -from Configuration.Eras.Era_Phase2C11I13M9_cff import Phase2C11I13M9 -process = cms.Process('gemTester', Phase2C11I13M9) +process = cms.Process('gemTester') process.load('FWCore.MessageService.MessageLogger_cfi') process.load('Configuration.StandardSequences.DigiToRaw_cff') @@ -11,14 +9,13 @@ process.load('Configuration.EventContent.EventContent_cff') process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') -process.maxEvents.input = cms.untracked.int32(10) +process.maxEvents.input = cms.untracked.int32(1000) from Configuration.AlCa.GlobalTag import GlobalTag -process.GlobalTag = GlobalTag(process.GlobalTag, '113X_mcRun4_realistic_v4', '') process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase2_realistic_T21', '') -#process.gemPacker.useDBEMap = True -#process.muonGEMDigis.readMultiBX = True +process.gemPacker.useDBEMap = False +process.muonGEMDigis.readMultiBX = True process.muonGEMDigis.useDBEMap = process.gemPacker.useDBEMap process.muonGEMDigis.keepDAQStatus = True @@ -49,5 +46,5 @@ process.p = cms.Path(process.gemPacker+process.rawDataCollector+process.muonGEMDigis+process.GEMPackingTester) -print 'useDBEMap', process.gemPacker.useDBEMap, process.muonGEMDigis.useDBEMap -print 'readMultiBX', process.muonGEMDigis.readMultiBX +print('useDBEMap', process.gemPacker.useDBEMap, process.muonGEMDigis.useDBEMap) +print('readMultiBX', process.muonGEMDigis.readMultiBX) diff --git a/EventFilter/L1TRawToDigi/plugins/implementations_stage2/BMTFPackerOutput.cc b/EventFilter/L1TRawToDigi/plugins/implementations_stage2/BMTFPackerOutput.cc index 0e873900c8ef8..1395fd3f06323 100644 --- a/EventFilter/L1TRawToDigi/plugins/implementations_stage2/BMTFPackerOutput.cc +++ b/EventFilter/L1TRawToDigi/plugins/implementations_stage2/BMTFPackerOutput.cc @@ -20,7 +20,7 @@ namespace l1t { for (auto imu = muons->begin(); imu != muons->end(); imu++) { if (imu->processor() + 1 == board_id) { uint32_t firstWord(0), lastWord(0); - RegionalMuonRawDigiTranslator::generatePackedDataWords(*imu, firstWord, lastWord, isKalman_); + RegionalMuonRawDigiTranslator::generatePackedDataWords(*imu, firstWord, lastWord, isKalman_, false); payloadMap_[bmtfBlockID].push_back(firstWord); //imu->link()*2+1 payloadMap_[bmtfBlockID].push_back(lastWord); //imu->link()*2+1 } diff --git a/EventFilter/L1TRawToDigi/plugins/implementations_stage2/BMTFUnpackerOutput.cc b/EventFilter/L1TRawToDigi/plugins/implementations_stage2/BMTFUnpackerOutput.cc index d905880a3fc74..9869cf3afde81 100644 --- a/EventFilter/L1TRawToDigi/plugins/implementations_stage2/BMTFUnpackerOutput.cc +++ b/EventFilter/L1TRawToDigi/plugins/implementations_stage2/BMTFUnpackerOutput.cc @@ -67,7 +67,7 @@ namespace l1t { RegionalMuonCand muCand; RegionalMuonRawDigiTranslator::fillRegionalMuonCand( - muCand, raw_first, raw_secnd, processor, tftype::bmtf, isKalman); + muCand, raw_first, raw_secnd, processor, tftype::bmtf, isKalman, false); if (muCand.hwPt() == 0) { continue; diff --git a/EventFilter/L1TRawToDigi/plugins/implementations_stage2/EMTFBlockGEM.cc b/EventFilter/L1TRawToDigi/plugins/implementations_stage2/EMTFBlockGEM.cc index 8ad17f728eba0..bfe6d0a845501 100644 --- a/EventFilter/L1TRawToDigi/plugins/implementations_stage2/EMTFBlockGEM.cc +++ b/EventFilter/L1TRawToDigi/plugins/implementations_stage2/EMTFBlockGEM.cc @@ -227,11 +227,12 @@ namespace l1t { } } // End loop: for (auto const & iHit : *res_hit) - if (exact_duplicate) - edm::LogWarning("L1T|EMTF") << "EMTF unpacked duplicate GEM digis: BX " << Hit_.BX() << ", endcap " - << Hit_.Endcap() << ", station " << Hit_.Station() << ", neighbor " - << Hit_.Neighbor() << ", ring " << Hit_.Ring() << ", chamber " << Hit_.Chamber() - << ", roll " << Hit_.Roll() << ", pad " << Hit_.Pad() << std::endl; + // TODO: Re-enable once GEM TP data format is fixed + // if (exact_duplicate) + // edm::LogWarning("L1T|EMTF") << "EMTF unpacked duplicate GEM digis: BX " << Hit_.BX() << ", endcap " + // << Hit_.Endcap() << ", station " << Hit_.Station() << ", neighbor " + // << Hit_.Neighbor() << ", ring " << Hit_.Ring() << ", chamber " << Hit_.Chamber() + // << ", roll " << Hit_.Roll() << ", pad " << Hit_.Pad() << std::endl; (res->at(iOut)).push_GEM(GEM_); if (!exact_duplicate) diff --git a/EventFilter/L1TRawToDigi/plugins/implementations_stage2/GMTSetup.cc b/EventFilter/L1TRawToDigi/plugins/implementations_stage2/GMTSetup.cc index 83f29e7f27b62..c4508e7763388 100644 --- a/EventFilter/L1TRawToDigi/plugins/implementations_stage2/GMTSetup.cc +++ b/EventFilter/L1TRawToDigi/plugins/implementations_stage2/GMTSetup.cc @@ -43,8 +43,11 @@ namespace l1t { if (fed == 1402) { auto gmt_in_packer = static_pointer_cast( PackerFactory::get()->make("stage2::RegionalMuonGMTPacker")); + if (fw >= 0x6010000) { + gmt_in_packer->setUseEmtfDisplacementInfo(); + } if (fw >= 0x6000000) { - gmt_in_packer->setIsRun3(); + gmt_in_packer->setIsKbmtf(); } auto gmt_out_packer = static_pointer_cast(PackerFactory::get()->make("stage2::GMTMuonPacker")); @@ -86,8 +89,11 @@ namespace l1t { // input muons on links 36-71 auto gmt_in_unp = static_pointer_cast( UnpackerFactory::get()->make("stage2::RegionalMuonGMTUnpacker")); + if (fw >= 0x6010000) { + gmt_in_unp->setUseEmtfDisplacementInfo(); + } if (fw >= 0x6000000) { - gmt_in_unp->setIsRun3(); + gmt_in_unp->setIsKbmtf(); } for (int iLink = 72; iLink < 144; iLink += 2) { diff --git a/EventFilter/L1TRawToDigi/plugins/implementations_stage2/RegionalMuonGMTPacker.cc b/EventFilter/L1TRawToDigi/plugins/implementations_stage2/RegionalMuonGMTPacker.cc index 64ed17ecf676b..36301c3037568 100644 --- a/EventFilter/L1TRawToDigi/plugins/implementations_stage2/RegionalMuonGMTPacker.cc +++ b/EventFilter/L1TRawToDigi/plugins/implementations_stage2/RegionalMuonGMTPacker.cc @@ -54,7 +54,7 @@ namespace l1t { uint32_t msw = 0; uint32_t lsw = 0; - RegionalMuonRawDigiTranslator::generatePackedDataWords(*mu, lsw, msw, isRun3_); + RegionalMuonRawDigiTranslator::generatePackedDataWords(*mu, lsw, msw, isKbmtf_, useEmtfDisplacementInfo_); payloadMap[linkTimes2].push_back(lsw); payloadMap[linkTimes2].push_back(msw); diff --git a/EventFilter/L1TRawToDigi/plugins/implementations_stage2/RegionalMuonGMTPacker.h b/EventFilter/L1TRawToDigi/plugins/implementations_stage2/RegionalMuonGMTPacker.h index 67fa5f14d8aa7..e3feb1bce562b 100644 --- a/EventFilter/L1TRawToDigi/plugins/implementations_stage2/RegionalMuonGMTPacker.h +++ b/EventFilter/L1TRawToDigi/plugins/implementations_stage2/RegionalMuonGMTPacker.h @@ -13,13 +13,15 @@ namespace l1t { class RegionalMuonGMTPacker : public Packer { public: Blocks pack(const edm::Event&, const PackerTokens*) override; - void setIsRun3() { isRun3_ = true; }; + void setIsKbmtf() { isKbmtf_ = true; }; + void setUseEmtfDisplacementInfo() { useEmtfDisplacementInfo_ = true; }; private: typedef std::map> PayloadMap; void packTF(const edm::Event&, const edm::EDGetTokenT&, Blocks&); - bool isRun3_{false}; + bool isKbmtf_{false}; + bool useEmtfDisplacementInfo_{false}; }; } // namespace stage2 } // namespace l1t diff --git a/EventFilter/L1TRawToDigi/plugins/implementations_stage2/RegionalMuonGMTUnpacker.cc b/EventFilter/L1TRawToDigi/plugins/implementations_stage2/RegionalMuonGMTUnpacker.cc index d58909a9395fe..57a603a82294e 100644 --- a/EventFilter/L1TRawToDigi/plugins/implementations_stage2/RegionalMuonGMTUnpacker.cc +++ b/EventFilter/L1TRawToDigi/plugins/implementations_stage2/RegionalMuonGMTUnpacker.cc @@ -102,7 +102,7 @@ namespace l1t { RegionalMuonCand mu; RegionalMuonRawDigiTranslator::fillRegionalMuonCand( - mu, raw_data_00_31, raw_data_32_63, processor, trackFinder, isRun3_); + mu, raw_data_00_31, raw_data_32_63, processor, trackFinder, isKbmtf_, useEmtfDisplacementInfo_); LogDebug("L1T") << "Mu" << nWord / 2 << ": eta " << mu.hwEta() << " phi " << mu.hwPhi() << " pT " << mu.hwPt() << " qual " << mu.hwQual() << " sign " << mu.hwSign() << " sign valid " diff --git a/EventFilter/L1TRawToDigi/plugins/implementations_stage2/RegionalMuonGMTUnpacker.h b/EventFilter/L1TRawToDigi/plugins/implementations_stage2/RegionalMuonGMTUnpacker.h index 43362150b2a53..f991d1cffdca1 100644 --- a/EventFilter/L1TRawToDigi/plugins/implementations_stage2/RegionalMuonGMTUnpacker.h +++ b/EventFilter/L1TRawToDigi/plugins/implementations_stage2/RegionalMuonGMTUnpacker.h @@ -10,13 +10,15 @@ namespace l1t { class RegionalMuonGMTUnpacker : public Unpacker { public: bool unpack(const Block& block, UnpackerCollections* coll) override; - void setIsRun3() { isRun3_ = true; } + void setIsKbmtf() { isKbmtf_ = true; } + void setUseEmtfDisplacementInfo() { useEmtfDisplacementInfo_ = true; } private: static constexpr unsigned nWords_ = 6; // every link transmits 6 words (3 muons) per bx static constexpr unsigned bxzs_enable_shift_ = 1; - bool isRun3_{false}; + bool isKbmtf_{false}; + bool useEmtfDisplacementInfo_{false}; }; } // namespace stage2 } // namespace l1t diff --git a/EventFilter/L1TRawToDigi/python/gmtStage2Raw_cfi.py b/EventFilter/L1TRawToDigi/python/gmtStage2Raw_cfi.py index 2e35f21005890..eb031df1e82fd 100644 --- a/EventFilter/L1TRawToDigi/python/gmtStage2Raw_cfi.py +++ b/EventFilter/L1TRawToDigi/python/gmtStage2Raw_cfi.py @@ -13,7 +13,7 @@ ImdInputLabelOMTFNeg = cms.InputTag("simGmtStage2Digis", "imdMuonsOMTFNeg"), ImdInputLabelOMTFPos = cms.InputTag("simGmtStage2Digis", "imdMuonsOMTFPos"), FedId = cms.int32(1402), - FWId = cms.uint32(0x6000000), # FW version in GMT with displaced muon information + FWId = cms.uint32(0x3000000), # First used uGMT firmware version lenSlinkHeader = cms.untracked.int32(8), lenSlinkTrailer = cms.untracked.int32(8) ) @@ -32,4 +32,4 @@ ### Era: Run3_2021 from Configuration.Eras.Modifier_stage2L1Trigger_2021_cff import stage2L1Trigger_2021 -stage2L1Trigger_2021.toModify(gmtStage2Raw, BMTFInputLabel = cms.InputTag("simKBmtfDigis", "BMTF"), FWId = cms.uint32(0x6000000)) +stage2L1Trigger_2021.toModify(gmtStage2Raw, BMTFInputLabel = cms.InputTag("simKBmtfDigis", "BMTF"), FWId = cms.uint32(0x6010000)) diff --git a/EventFilter/L1TRawToDigi/src/MP7FileReader.cc b/EventFilter/L1TRawToDigi/src/MP7FileReader.cc index 2427fcf26c9a7..5ddf8096390e6 100644 --- a/EventFilter/L1TRawToDigi/src/MP7FileReader.cc +++ b/EventFilter/L1TRawToDigi/src/MP7FileReader.cc @@ -5,7 +5,6 @@ #include #include -#include #include #include @@ -165,9 +164,9 @@ std::vector MP7FileReader::searchLinks() { boost::split(tokens, tmp, boost::is_any_of(" \t"), boost::token_compress_on); // Convert it into uint32 s std::vector links; - std::transform( - tokens.begin(), tokens.end(), std::back_inserter(links), boost::lexical_cast); - return links; + std::transform(tokens.begin(), tokens.end(), std::back_inserter(links), [](const std::string& str) { + return std::stoul(str); + }); } else { throw std::logic_error("Unexpected line found!"); } @@ -201,7 +200,7 @@ std::vector > MP7FileReader::readRows() { if (boost::regex_match(line, what, reFrame_)) { // check frame number - uint32_t n = boost::lexical_cast(what[1].str()); + uint32_t n = std::stoul(what[1].str()); if (n != data.size()) { std::stringstream ss; diff --git a/EventFilter/RPCRawToDigi/interface/RPCRawSynchro.h b/EventFilter/RPCRawToDigi/interface/RPCRawSynchro.h deleted file mode 100644 index 446b390012f91..0000000000000 --- a/EventFilter/RPCRawToDigi/interface/RPCRawSynchro.h +++ /dev/null @@ -1 +0,0 @@ -#include "DataFormats/RPCDigi/interface/RPCRawSynchro.h" diff --git a/EventFilter/RPCRawToDigi/plugins/RPCUnpackingModule.cc b/EventFilter/RPCRawToDigi/plugins/RPCUnpackingModule.cc index 12a6c1d19d109..c82a1d399e111 100644 --- a/EventFilter/RPCRawToDigi/plugins/RPCUnpackingModule.cc +++ b/EventFilter/RPCRawToDigi/plugins/RPCUnpackingModule.cc @@ -20,8 +20,6 @@ #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" -#include "CondFormats/RPCObjects/interface/RPCEMap.h" -#include "CondFormats/DataRecord/interface/RPCEMapRcd.h" #include "DataFormats/RPCDigi/interface/DataRecord.h" #include "DataFormats/RPCDigi/interface/ReadoutError.h" #include "DataFormats/RPCDigi/interface/RPCRawSynchro.h" @@ -41,6 +39,7 @@ RPCUnpackingModule::RPCUnpackingModule(const edm::ParameterSet& pset) : dataLabel_(pset.getParameter("InputLabel")), doSynchro_(pset.getParameter("doSynchro")), eventCounter_(0), + theReadoutMappingToken(esConsumes()), theCabling(nullptr) { produces(); produces(); @@ -62,8 +61,7 @@ void RPCUnpackingModule::beginRun(const edm::Run& run, const edm::EventSetup& es if (theRecordWatcher.check(es)) { LogTrace("") << "record has CHANGED!!, (re)initialise readout map!"; delete theCabling; - ESTransientHandle readoutMapping; - es.get().get(readoutMapping); + ESTransientHandle readoutMapping = es.getTransientHandle(theReadoutMappingToken); theCabling = readoutMapping->convert(); theReadoutMappingSearch.init(theCabling); LogTrace("") << " READOUT MAP VERSION: " << theCabling->version() << endl; diff --git a/EventFilter/RPCRawToDigi/plugins/RPCUnpackingModule.h b/EventFilter/RPCRawToDigi/plugins/RPCUnpackingModule.h index ea7a4d7846490..c1237dd93c9f6 100644 --- a/EventFilter/RPCRawToDigi/plugins/RPCUnpackingModule.h +++ b/EventFilter/RPCRawToDigi/plugins/RPCUnpackingModule.h @@ -9,6 +9,7 @@ #include "FWCore/Utilities/interface/InputTag.h" #include "FWCore/Framework/interface/ESWatcher.h" #include "CondFormats/DataRecord/interface/RPCEMapRcd.h" +#include "CondFormats/RPCObjects/interface/RPCEMap.h" #include "RPCReadOutMappingWithFastSearch.h" #include "DataFormats/FEDRawData/interface/FEDRawDataCollection.h" @@ -42,6 +43,7 @@ class RPCUnpackingModule : public edm::stream::EDProducer<> { unsigned long eventCounter_; edm::ESWatcher theRecordWatcher; + edm::ESGetToken theReadoutMappingToken; const RPCReadOutMapping* theCabling; RPCReadOutMappingWithFastSearch theReadoutMappingSearch; edm::EDGetTokenT fedToken_; diff --git a/EventFilter/Utilities/interface/AuxiliaryMakers.h b/EventFilter/Utilities/interface/AuxiliaryMakers.h index 00d15bc0081b1..39cee97ed042f 100644 --- a/EventFilter/Utilities/interface/AuxiliaryMakers.h +++ b/EventFilter/Utilities/interface/AuxiliaryMakers.h @@ -12,7 +12,8 @@ namespace evf { bool isRealData, const edm::EventAuxiliary::ExperimentType&, const std::string& processGUID, - bool verifyLumiSection); + bool verifyLumiSection, + bool suppressWarning); } } // namespace evf #endif diff --git a/EventFilter/Utilities/interface/EvFDaqDirector.h b/EventFilter/Utilities/interface/EvFDaqDirector.h index fbc0881ead2d4..1c78cfa0c4be6 100644 --- a/EventFilter/Utilities/interface/EvFDaqDirector.h +++ b/EventFilter/Utilities/interface/EvFDaqDirector.h @@ -127,7 +127,8 @@ namespace evf { void createBoLSFile(const uint32_t lumiSection, bool checkIfExists) const; void createLumiSectionFiles(const uint32_t lumiSection, const uint32_t currentLumiSection, - bool doCreateBoLS = true); + bool doCreateBoLS, + bool doCreateEoLS); static int parseFRDFileHeader(std::string const& rawSourcePath, int& rawFd, uint16_t& rawHeaderSize, @@ -172,6 +173,7 @@ namespace evf { void createProcessingNotificationMaybe() const; int readLastLSEntry(std::string const& file); unsigned int getLumisectionToStart() const; + unsigned int getStartLumisectionFromEnv() const { return startFromLS_; } void setDeleteTracking(std::mutex* fileDeleteLock, std::list>>* filesToDelete) { fileDeleteLockPtr_ = fileDeleteLock; diff --git a/EventFilter/Utilities/interface/FedRawDataInputSource.h b/EventFilter/Utilities/interface/FedRawDataInputSource.h index b68c98ca9a624..005e103daa8e8 100644 --- a/EventFilter/Utilities/interface/FedRawDataInputSource.h +++ b/EventFilter/Utilities/interface/FedRawDataInputSource.h @@ -60,7 +60,7 @@ class FedRawDataInputSource : public edm::RawInputSource { void maybeOpenNewLumiSection(const uint32_t lumiSection); evf::EvFDaqDirector::FileStatus nextEvent(); evf::EvFDaqDirector::FileStatus getNextEvent(); - edm::Timestamp fillFEDRawDataCollection(FEDRawDataCollection&); + edm::Timestamp fillFEDRawDataCollection(FEDRawDataCollection& rawData, bool& tcdsInRange); void readSupervisor(); void readWorker(unsigned int tid); diff --git a/EventFilter/Utilities/interface/ModuleWeb.h b/EventFilter/Utilities/interface/ModuleWeb.h deleted file mode 100644 index f7c94bfaa47e0..0000000000000 --- a/EventFilter/Utilities/interface/ModuleWeb.h +++ /dev/null @@ -1,51 +0,0 @@ -#ifndef EVF_MODULEWEB_H -#define EVF_MODULEWEB_H - -//#include "toolbox/lang/Class.h" -//#include "xdata/InfoSpace.h" -#include -#include -#include - - - - namespace evf - { - - - namespace moduleweb { - class ForkParams { - public: - ForkParams():slotId(-1),restart(0),isMaster(-1){} - int slotId; - bool restart; - int isMaster; - }; - class ForkInfoObj { - public: - ForkInfoObj() - { - control_sem_ = new sem_t; - sem_init(control_sem_,0,0); - stopCondition=0; - receivedStop_=false; - } - ~ForkInfoObj() - { - sem_destroy(control_sem_); - delete control_sem_; - } - void lock() {if (mst_lock_) pthread_mutex_lock(mst_lock_);} - void unlock() {if (mst_lock_) pthread_mutex_unlock(mst_lock_);} - void (*forkHandler) (void *); - ForkParams forkParams; - unsigned int stopCondition; - bool receivedStop_; - sem_t *control_sem_; - pthread_mutex_t * mst_lock_; - void * fuAddr; - }; - } - -} -#endif diff --git a/EventFilter/Utilities/interface/config_json.h b/EventFilter/Utilities/interface/config_json.h deleted file mode 100644 index 5d334cbc5e6b9..0000000000000 --- a/EventFilter/Utilities/interface/config_json.h +++ /dev/null @@ -1,43 +0,0 @@ -#ifndef JSON_CONFIG_H_INCLUDED -# define JSON_CONFIG_H_INCLUDED - -/// If defined, indicates that json library is embedded in CppTL library. -//# define JSON_IN_CPPTL 1 - -/// If defined, indicates that json may leverage CppTL library -//# define JSON_USE_CPPTL 1 -/// If defined, indicates that cpptl vector based map should be used instead of std::map -/// as Value container. -//# define JSON_USE_CPPTL_SMALLMAP 1 -/// If defined, indicates that Json specific container should be used -/// (hash table & simple deque container with customizable allocator). -/// THIS FEATURE IS STILL EXPERIMENTAL! -//# define JSON_VALUE_USE_INTERNAL_MAP 1 -/// Force usage of standard new/malloc based allocator instead of memory pool based allocator. -/// The memory pools allocator used optimization (initializing Value and ValueInternalLink -/// as if it was a POD) that may cause some validation tool to report errors. -/// Only has effects if JSON_VALUE_USE_INTERNAL_MAP is defined. -//# define JSON_USE_SIMPLE_INTERNAL_ALLOCATOR 1 - -/// If defined, indicates that Json use exception to report invalid type manipulation -/// instead of C assert macro. -# define JSON_USE_EXCEPTION 1 - -# ifdef JSON_IN_CPPTL -# include -# ifndef JSON_USE_CPPTL -# define JSON_USE_CPPTL 1 -# endif -# endif - -# ifdef JSON_IN_CPPTL -# define JSON_API CPPTL_API -# elif defined(JSON_DLL_BUILD) -# define JSON_API __declspec(dllexport) -# elif defined(JSON_DLL) -# define JSON_API __declspec(dllimport) -# else -# define JSON_API -# endif - -#endif // JSON_CONFIG_H_INCLUDED diff --git a/EventFilter/Utilities/plugins/DaqFakeReader.cc b/EventFilter/Utilities/plugins/DaqFakeReader.cc index 7bc931d1658a2..60fd1ace513ea 100644 --- a/EventFilter/Utilities/plugins/DaqFakeReader.cc +++ b/EventFilter/Utilities/plugins/DaqFakeReader.cc @@ -20,6 +20,8 @@ #include #include #include +#include +#include using namespace std; using namespace edm; @@ -33,6 +35,7 @@ DaqFakeReader::DaqFakeReader(const edm::ParameterSet& pset) : runNum(1), eventNum(1), empty_events(pset.getUntrackedParameter("emptyEvents", false)), + fillRandom_(pset.getUntrackedParameter("fillRandom", false)), meansize(pset.getUntrackedParameter("meanSize", 1024)), width(pset.getUntrackedParameter("width", 1024)), injected_errors_per_million_events(pset.getUntrackedParameter("injectErrPpm", 0)), @@ -43,6 +46,12 @@ DaqFakeReader::DaqFakeReader(const edm::ParameterSet& pset) if (tcdsFEDID_ < FEDNumbering::MINTCDSuTCAFEDID) throw cms::Exception("DaqFakeReader::DaqFakeReader") << " TCDS FED ID lower than " << FEDNumbering::MINTCDSuTCAFEDID; + if (fillRandom_) { + //intialize random seed + auto time_count = + static_cast(std::chrono::high_resolution_clock::now().time_since_epoch().count()); + srand(time_count & 0xffffffff); + } produces(); } @@ -102,6 +111,18 @@ void DaqFakeReader::fillFEDs( // Allocate space for header+trailer+payload feddata.resize(size + 16); + if (fillRandom_) { + //fill FED with random values + size_t size_ui = size - size % sizeof(unsigned int); + for (size_t i = 0; i < size_ui; i += sizeof(unsigned int)) { + *((unsigned int*)(feddata.data() + i)) = (unsigned int)rand(); + } + //remainder + for (size_t i = size_ui; i < size; i++) { + *(feddata.data() + i) = rand() & 0xff; + } + } + // Generate header FEDHeader::set(feddata.data(), 1, // Trigger type @@ -164,3 +185,15 @@ void DaqFakeReader::beginLuminosityBlock(LuminosityBlock const& iL, EventSetup c std::cout << "DaqFakeReader begin Lumi " << iL.luminosityBlock() << std::endl; fakeLs_ = iL.luminosityBlock(); } + +void DaqFakeReader::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { + edm::ParameterSetDescription desc; + desc.setComment("Injector of generated raw FED data for DAQ testing"); + desc.addUntracked("emptyEvents", false); + desc.addUntracked("fillRandom", false); + desc.addUntracked("meanSize", 1024); + desc.addUntracked("width", 1024); + desc.addUntracked("injectErrPpm", 1024); + desc.addUntracked("tcdsFEDID", 1024); + descriptions.add("DaqFakeReader", desc); +} diff --git a/EventFilter/Utilities/plugins/DaqFakeReader.h b/EventFilter/Utilities/plugins/DaqFakeReader.h index 94d9d6d79bd4b..33152b790c686 100644 --- a/EventFilter/Utilities/plugins/DaqFakeReader.h +++ b/EventFilter/Utilities/plugins/DaqFakeReader.h @@ -7,6 +7,7 @@ * \author N. Amapane - CERN */ +#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" #include "FWCore/Framework/interface/one/EDProducer.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/EventSetup.h" @@ -33,6 +34,8 @@ class DaqFakeReader : public edm::one::EDProducer<> { void produce(edm::Event&, edm::EventSetup const&) override; + static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); + private: // // private member functions @@ -48,6 +51,7 @@ class DaqFakeReader : public edm::one::EDProducer<> { edm::RunNumber_t runNum; edm::EventNumber_t eventNum; bool empty_events; + bool fillRandom_; unsigned int meansize; // in bytes unsigned int width; unsigned int injected_errors_per_million_events; diff --git a/EventFilter/Utilities/src/AuxiliaryMakers.cc b/EventFilter/Utilities/src/AuxiliaryMakers.cc index a11ccd229fa09..5886700681e86 100644 --- a/EventFilter/Utilities/src/AuxiliaryMakers.cc +++ b/EventFilter/Utilities/src/AuxiliaryMakers.cc @@ -12,7 +12,8 @@ namespace evf { bool isRealData, const edm::EventAuxiliary::ExperimentType& eventType, const std::string& processGUID, - bool verifyLumiSection) { + bool verifyLumiSection, + bool suppressWarning) { edm::EventID eventId(runNumber, // check that runnumber from record is consistent lumiSection, tcds->header.eventNumber); @@ -29,7 +30,7 @@ namespace evf { const uint64_t orbitnr = ((uint64_t)tcds->header.orbitHigh << 16) | tcds->header.orbitLow; const uint32_t recordLumiSection = tcds->header.lumiSection; - if (isRealData) { + if (isRealData && !suppressWarning) { //warnings are disabled for generated data if (verifyLumiSection && recordLumiSection != lumiSection) edm::LogWarning("AuxiliaryMakers") diff --git a/EventFilter/Utilities/src/EvFDaqDirector.cc b/EventFilter/Utilities/src/EvFDaqDirector.cc index 5943bee8c0c48..46ecb013799e4 100644 --- a/EventFilter/Utilities/src/EvFDaqDirector.cc +++ b/EventFilter/Utilities/src/EvFDaqDirector.cc @@ -22,7 +22,6 @@ #include #include #include -#include #include //using boost::asio::ip::tcp; @@ -84,10 +83,10 @@ namespace evf { char* fuLockPollIntervalPtr = std::getenv("FFF_LOCKPOLLINTERVAL"); if (fuLockPollIntervalPtr) { try { - fuLockPollInterval_ = boost::lexical_cast(std::string(fuLockPollIntervalPtr)); + fuLockPollInterval_ = std::stoul(std::string(fuLockPollIntervalPtr)); edm::LogInfo("EvFDaqDirector") << "Setting fu lock poll interval by environment string: " << fuLockPollInterval_ << " us"; - } catch (boost::bad_lexical_cast const&) { + } catch (const std::exception&) { edm::LogWarning("EvFDaqDirector") << "Bad lexical cast in parsing: " << std::string(fuLockPollIntervalPtr); } } @@ -96,9 +95,9 @@ namespace evf { char* fileBrokerParamPtr = std::getenv("FFF_USEFILEBROKER"); if (fileBrokerParamPtr) { try { - useFileBroker_ = (boost::lexical_cast(std::string(fileBrokerParamPtr))) > 0; + useFileBroker_ = (std::stoul(std::string(fileBrokerParamPtr))) > 0; edm::LogInfo("EvFDaqDirector") << "Setting useFileBroker parameter by environment string: " << useFileBroker_; - } catch (boost::bad_lexical_cast const&) { + } catch (const std::exception&) { edm::LogWarning("EvFDaqDirector") << "Bad lexical cast in parsing: " << std::string(fileBrokerParamPtr); } } @@ -123,12 +122,12 @@ namespace evf { socket_ = std::make_unique(io_service_); } - char* startFromLSPtr = std::getenv("FFF_STARTFROMLS"); + char* startFromLSPtr = std::getenv("FFF_START_LUMISECTION"); if (startFromLSPtr) { try { - startFromLS_ = boost::lexical_cast(std::string(startFromLSPtr)); + startFromLS_ = std::stoul(std::string(startFromLSPtr)); edm::LogInfo("EvFDaqDirector") << "Setting start from LS by environment string: " << startFromLS_; - } catch (boost::bad_lexical_cast const&) { + } catch (const std::exception&) { edm::LogWarning("EvFDaqDirector") << "Bad lexical cast in parsing: " << std::string(startFromLSPtr); } } @@ -137,10 +136,10 @@ namespace evf { char* fileBrokerUseLockParamPtr = std::getenv("FFF_FILEBROKERUSELOCALLOCK"); if (fileBrokerUseLockParamPtr) { try { - fileBrokerUseLocalLock_ = (boost::lexical_cast(std::string(fileBrokerUseLockParamPtr))) > 0; + fileBrokerUseLocalLock_ = (std::stoul(std::string(fileBrokerUseLockParamPtr))) > 0; edm::LogInfo("EvFDaqDirector") << "Setting fileBrokerUseLocalLock parameter by environment string: " << fileBrokerUseLocalLock_; - } catch (boost::bad_lexical_cast const&) { + } catch (const std::exception&) { edm::LogWarning("EvFDaqDirector") << "Bad lexical cast in parsing: " << std::string(fileBrokerUseLockParamPtr); } } @@ -773,7 +772,7 @@ namespace evf { edm::LogError("EvFDaqDirector") << " error reading number of files from BU JSON -: " << BUEoLSFile; return -1; } - return boost::lexical_cast(data); + return std::stoi(data); } bool EvFDaqDirector::bumpFile(unsigned int& ls, @@ -942,14 +941,18 @@ namespace evf { void EvFDaqDirector::createLumiSectionFiles(const uint32_t lumiSection, const uint32_t currentLumiSection, - bool doCreateBoLS) { + bool doCreateBoLS, + bool doCreateEoLS) { if (currentLumiSection > 0) { const std::string fuEoLS = getEoLSFilePathOnFU(currentLumiSection); struct stat buf; bool found = (stat(fuEoLS.c_str(), &buf) == 0); if (!found) { - int eol_fd = open(fuEoLS.c_str(), O_RDWR | O_CREAT, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH); - close(eol_fd); + if (doCreateEoLS) { + int eol_fd = + open(fuEoLS.c_str(), O_RDWR | O_CREAT, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH); + close(eol_fd); + } if (doCreateBoLS) createBoLSFile(lumiSection, false); } @@ -1326,8 +1329,8 @@ namespace evf { if (i < dp.getData().size()) { std::string dataSize = dp.getData()[i]; try { - fileSizeFromJson = boost::lexical_cast(dataSize); - } catch (boost::bad_lexical_cast const&) { + fileSizeFromJson = std::stol(dataSize); + } catch (const std::exception&) { //non-fatal currently, processing can continue without this value edm::LogWarning("EvFDaqDirector") << "grabNextJsonFile - error parsing number of Bytes from BU JSON. " << "Input value is -: " << dataSize; @@ -1336,10 +1339,13 @@ namespace evf { } } } - return boost::lexical_cast(data); - } catch (boost::bad_lexical_cast const& e) { + return std::stoi(data); + } catch (const std::out_of_range& e) { edm::LogError("EvFDaqDirector") << "grabNextJsonFile - error parsing number of events from BU JSON. " << "Input value is -: " << data; + } catch (const std::invalid_argument& e) { + edm::LogError("EvFDaqDirector") << "grabNextJsonFile - argument error parsing events from BU JSON. " + << "Input value is -: " << data; } catch (std::runtime_error const& e) { //Can be thrown by Json parser edm::LogError("EvFDaqDirector") << "grabNextJsonFile - std::runtime_error exception -: " << e.what(); @@ -1423,7 +1429,7 @@ namespace evf { throw cms::Exception("EvFDaqDirector::grabNextJsonFileUnlock") << " error reading number of events from BU JSON -: No input value " << data; } - return boost::lexical_cast(data); + return std::stoi(data); } catch (std::filesystem::filesystem_error const& ex) { // Input dir gone? unlockFULocal(); @@ -1432,9 +1438,12 @@ namespace evf { // Another process grabbed the file and NFS did not register this unlockFULocal(); edm::LogError("EvFDaqDirector") << "grabNextFile runtime Exception -: " << e.what(); - } catch (boost::bad_lexical_cast const&) { + } catch (const std::out_of_range&) { edm::LogError("EvFDaqDirector") << "grabNextFile error parsing number of events from BU JSON. " << "Input value is -: " << data; + } catch (const std::invalid_argument&) { + edm::LogError("EvFDaqDirector") << "grabNextFile argument error parsing events from BU JSON. " + << "Input value is -: " << data; } catch (std::exception const& e) { // BU run directory disappeared? unlockFULocal(); @@ -1677,8 +1686,10 @@ namespace evf { serverError = true; } } + break; } + } catch (std::exception const& e) { edm::LogWarning("EvFDaqDirector") << "Exception in socket handling"; serverError = true; @@ -1704,6 +1715,7 @@ namespace evf { fileStatus = noFile; sleep(1); //back-off if error detected } + return fileStatus; } @@ -1760,7 +1772,7 @@ namespace evf { //local lock to force index json and EoLS files to appear in order if (fileBrokerUseLocalLock_) - lockFULocal2(); + lockFULocal(); int maxLS = stopFileLS < 0 ? -1 : std::max(stopFileLS, (int)currentLumiSection); bool rawHeader = false; @@ -1770,22 +1782,21 @@ namespace evf { if (serverError) { //do not update anything if (fileBrokerUseLocalLock_) - unlockFULocal2(); + unlockFULocal(); return noFile; } - //handle creation of EoLS and BoLS files if lumisection has changed + //handle creation of BoLS files if lumisection has changed if (currentLumiSection == 0) { - if (fileStatus == runEnded) { - createLumiSectionFiles(closedServerLS, 0); - createLumiSectionFiles(serverLS, closedServerLS, false); // +1 - } else - createLumiSectionFiles(serverLS, 0); + if (fileStatus == runEnded) + createLumiSectionFiles(closedServerLS, 0, true, false); + else + createLumiSectionFiles(serverLS, 0, true, false); } else { - //loop over and create any EoLS files missing if (closedServerLS >= currentLumiSection) { + //only BoLS files for (uint32_t i = std::max(currentLumiSection, 1U); i <= closedServerLS; i++) - createLumiSectionFiles(i + 1, i); + createLumiSectionFiles(i + 1, i, true, false); } } @@ -1803,6 +1814,11 @@ namespace evf { close(rawFd); rawFd = -1; } + + //can unlock because all files have been created locally + if (fileBrokerUseLocalLock_) + unlockFULocal(); + if (!fileFound) { //catch condition where directory got deleted fileStatus = noFile; @@ -1813,9 +1829,26 @@ namespace evf { } } - //can unlock because all files have been created locally - if (fileBrokerUseLocalLock_) + //handle creation of EoLS files if lumisection has changed, this needs to be locked exclusively + //so that EoLS files can not appear locally before index files + if (currentLumiSection == 0) { + lockFULocal2(); + if (fileStatus == runEnded) { + createLumiSectionFiles(closedServerLS, 0, false, true); + createLumiSectionFiles(serverLS, closedServerLS, false, true); // +1 + } else { + createLumiSectionFiles(serverLS, 0, false, true); + } unlockFULocal2(); + } else { + if (closedServerLS >= currentLumiSection) { + //lock exclusive to create EoLS files + lockFULocal2(); + for (uint32_t i = std::max(currentLumiSection, 1U); i <= closedServerLS; i++) + createLumiSectionFiles(i + 1, i, false, true); + unlockFULocal2(); + } + } if (fileStatus == runEnded) ls = std::max(currentLumiSection, serverLS); @@ -1863,7 +1896,7 @@ namespace evf { std::string fileprefix = run_dir_ + "/" + run_string_ + "_ls"; std::string fullpath; struct stat buf; - unsigned int lscount = startFromLS_; + unsigned int lscount = 1; do { std::stringstream ss; ss << fileprefix << std::setfill('0') << std::setw(4) << lscount << "_EoLS.jsn"; diff --git a/EventFilter/Utilities/src/FedRawDataInputSource.cc b/EventFilter/Utilities/src/FedRawDataInputSource.cc index e39363529cbaa..97b102f1fb7a2 100644 --- a/EventFilter/Utilities/src/FedRawDataInputSource.cc +++ b/EventFilter/Utilities/src/FedRawDataInputSource.cc @@ -46,8 +46,6 @@ //JSON file reader #include "EventFilter/Utilities/interface/reader.h" -#include - using namespace evf::FastMonState; FedRawDataInputSource::FedRawDataInputSource(edm::ParameterSet const& pset, edm::InputSourceDescription const& desc) @@ -613,7 +611,8 @@ inline evf::EvFDaqDirector::FileStatus FedRawDataInputSource::getNextEvent() { void FedRawDataInputSource::read(edm::EventPrincipal& eventPrincipal) { setMonState(inReadEvent); std::unique_ptr rawData(new FEDRawDataCollection); - edm::Timestamp tstamp = fillFEDRawDataCollection(*rawData); + bool tcdsInRange; + edm::Timestamp tstamp = fillFEDRawDataCollection(*rawData, tcdsInRange); if (useL1EventID_) { eventID_ = edm::EventID(eventRunNumber_, currentLumiSection_, L1EventID_); @@ -639,7 +638,8 @@ void FedRawDataInputSource::read(edm::EventPrincipal& eventPrincipal) { event_->isRealData(), static_cast(fedHeader.triggerType()), processGUID(), - !fileListLoopMode_); + !fileListLoopMode_, + !tcdsInRange); aux.setProcessHistoryID(processHistoryID_); makeEvent(eventPrincipal, aux); } @@ -684,7 +684,7 @@ void FedRawDataInputSource::read(edm::EventPrincipal& eventPrincipal) { return; } -edm::Timestamp FedRawDataInputSource::fillFEDRawDataCollection(FEDRawDataCollection& rawData) { +edm::Timestamp FedRawDataInputSource::fillFEDRawDataCollection(FEDRawDataCollection& rawData, bool& tcdsInRange) { edm::TimeValue_t time; timeval stv; gettimeofday(&stv, nullptr); @@ -696,6 +696,7 @@ edm::Timestamp FedRawDataInputSource::fillFEDRawDataCollection(FEDRawDataCollect unsigned char* event = (unsigned char*)event_->payload(); GTPEventID_ = 0; tcds_pointer_ = nullptr; + tcdsInRange = false; uint16_t selectedTCDSFed = 0; while (eventSize > 0) { assert(eventSize >= FEDTrailer::length); @@ -712,6 +713,9 @@ edm::Timestamp FedRawDataInputSource::fillFEDRawDataCollection(FEDRawDataCollect if (!selectedTCDSFed) { selectedTCDSFed = fedId; tcds_pointer_ = event + eventSize; + if (fedId >= FEDNumbering::MINTCDSuTCAFEDID && fedId <= FEDNumbering::MAXTCDSuTCAFEDID) { + tcdsInRange = true; + } } else throw cms::Exception("FedRawDataInputSource::fillFEDRawDataCollection") << "Second TCDS FED ID " << fedId << " found. First ID: " << selectedTCDSFed; @@ -810,7 +814,6 @@ void FedRawDataInputSource::readSupervisor() { if (fms_) { setMonStateSup(inSupBusy); fms_->startedLookingForFile(); - setMonStateSup(inSupLockPolling); } evf::EvFDaqDirector::FileStatus status = evf::EvFDaqDirector::noFile; @@ -830,6 +833,7 @@ void FedRawDataInputSource::readSupervisor() { assert(rawFd == -1); uint64_t thisLockWaitTimeUs = 0.; + setMonStateSup(inSupLockPolling); if (fileListMode_) { //return LS if LS not set, otherwise return file status = getFile(ls, nextFile, fileSizeIndex, thisLockWaitTimeUs); @@ -921,7 +925,21 @@ void FedRawDataInputSource::readSupervisor() { } else { //new file service if (currentLumiSection == 0 && !alwaysStartFromFirstLS_) { - if (ls < 100) { + if (daqDirector_->getStartLumisectionFromEnv() > 1) { + //start transitions from LS specified by env, continue if not reached + if (ls < daqDirector_->getStartLumisectionFromEnv()) { + //skip file if from earlier LS than specified by env + if (rawFd != -1) { + close(rawFd); + rawFd = -1; + } + status = evf::EvFDaqDirector::noFile; + continue; + } else { + std::unique_ptr inf(new InputFile(evf::EvFDaqDirector::newLumi, ls)); + fileQueue_.push(std::move(inf)); + } + } else if (ls < 100) { //look at last LS file on disk to start from that lumisection (only within first 100 LS) unsigned int lsToStart = daqDirector_->getLumisectionToStart(); @@ -1542,10 +1560,10 @@ long FedRawDataInputSource::initFileList() { std::string runStr = fileStem.substr(3, end - 3); try { //get long to support test run numbers < 2^32 - long rval = boost::lexical_cast(runStr); + long rval = std::stol(runStr); edm::LogInfo("FedRawDataInputSource") << "Autodetected run number in fileListMode -: " << rval; return rval; - } catch (boost::bad_lexical_cast const&) { + } catch (const std::exception&) { edm::LogWarning("FedRawDataInputSource") << "Unable to autodetect run number in fileListMode from file -: " << fileName; } @@ -1572,7 +1590,7 @@ evf::EvFDaqDirector::FileStatus FedRawDataInputSource::getFile(unsigned int& ls, fileStem = fileStem.substr(0, fileStem.find('_')); if (!fileListLoopMode_) - ls = boost::lexical_cast(fileStem); + ls = std::stoul(fileStem); else //always starting from LS 1 in loop mode ls = 1 + loopModeIterationInc_; diff --git a/EventFilter/Utilities/test/LocalRunBUFU.sh b/EventFilter/Utilities/test/LocalRunBUFU.sh index 156521aca2c45..8497d1cce955e 100755 --- a/EventFilter/Utilities/test/LocalRunBUFU.sh +++ b/EventFilter/Utilities/test/LocalRunBUFU.sh @@ -19,7 +19,7 @@ RC=0 P=$$ PREFIX=results_${USER}${P} OUTDIR=${LOCAL_TMP_DIR}/${PREFIX} - +echo "Output will be temporarily written to ${OUTDIR}" mkdir ${OUTDIR} cp ${SCRIPTDIR}/startBU.py ${OUTDIR} diff --git a/EventFilter/Utilities/test/startBU.py b/EventFilter/Utilities/test/startBU.py index c827a6e5d3022..c4825646fbaaa 100644 --- a/EventFilter/Utilities/test/startBU.py +++ b/EventFilter/Utilities/test/startBU.py @@ -121,6 +121,7 @@ defaultQualifier = cms.untracked.int32(0)) process.s = cms.EDProducer("DaqFakeReader", + fillRandom = cms.untracked.bool(True), meanSize = cms.untracked.uint32(options.fedMeanSize), width = cms.untracked.uint32(int(math.ceil(options.fedMeanSize/2.))), tcdsFEDID = cms.untracked.uint32(1024), diff --git a/FWCore/Framework/interface/Callback.h b/FWCore/Framework/interface/Callback.h index 2a85a423183a8..a584e3d9046f9 100644 --- a/FWCore/Framework/interface/Callback.h +++ b/FWCore/Framework/interface/Callback.h @@ -36,6 +36,8 @@ #include "FWCore/ServiceRegistry/interface/ESModuleCallingContext.h" namespace edm { + void exceptionContext(cms::Exception&, ESModuleCallingContext const&); + namespace eventsetup { class EventSetupRecordImpl; @@ -208,10 +210,7 @@ namespace edm { decorator_.post(rec); }); } catch (cms::Exception& iException) { - auto const& description = producer_->description(); - std::ostringstream ost; - ost << "Running EventSetup component " << description.type_ << "/'" << description.label_; - iException.addContext(ost.str()); + edm::exceptionContext(iException, callingContext_); exceptPtr = std::current_exception(); } taskList_.doneWaiting(exceptPtr); diff --git a/FWCore/Framework/interface/ConstProductRegistry.h b/FWCore/Framework/interface/ConstProductRegistry.h index 5800d492eb7cd..1cbf38671a011 100644 --- a/FWCore/Framework/interface/ConstProductRegistry.h +++ b/FWCore/Framework/interface/ConstProductRegistry.h @@ -23,7 +23,7 @@ Description: Provides a 'service' interface to the ProductRegistry #include // user include files -#include "FWCore/Framework/src/SignallingProductRegistry.h" +#include "FWCore/Framework/interface/SignallingProductRegistry.h" #include "FWCore/ServiceRegistry/interface/connect_but_block_self.h" #include "FWCore/Utilities/interface/propagate_const.h" diff --git a/FWCore/Framework/src/EarlyDeleteHelper.h b/FWCore/Framework/interface/EarlyDeleteHelper.h similarity index 100% rename from FWCore/Framework/src/EarlyDeleteHelper.h rename to FWCore/Framework/interface/EarlyDeleteHelper.h diff --git a/FWCore/Framework/interface/EventProcessor.h b/FWCore/Framework/interface/EventProcessor.h index 8f4cf4b1264d8..89c604e946a95 100644 --- a/FWCore/Framework/interface/EventProcessor.h +++ b/FWCore/Framework/interface/EventProcessor.h @@ -18,9 +18,9 @@ configured in the user's main() function, and is set running. #include "FWCore/Framework/interface/MergeableRunProductProcesses.h" #include "FWCore/Framework/interface/PathsAndConsumesOfModules.h" #include "FWCore/Framework/interface/SharedResourcesAcquirer.h" -#include "FWCore/Framework/src/PrincipalCache.h" -#include "FWCore/Framework/src/SignallingProductRegistry.h" -#include "FWCore/Framework/src/PreallocationConfiguration.h" +#include "FWCore/Framework/interface/PrincipalCache.h" +#include "FWCore/Framework/interface/SignallingProductRegistry.h" +#include "FWCore/Framework/interface/PreallocationConfiguration.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" diff --git a/FWCore/Framework/src/EventSetupRecordIOVQueue.h b/FWCore/Framework/interface/EventSetupRecordIOVQueue.h similarity index 100% rename from FWCore/Framework/src/EventSetupRecordIOVQueue.h rename to FWCore/Framework/interface/EventSetupRecordIOVQueue.h diff --git a/FWCore/Framework/src/EventSetupsController.h b/FWCore/Framework/interface/EventSetupsController.h similarity index 98% rename from FWCore/Framework/src/EventSetupsController.h rename to FWCore/Framework/interface/EventSetupsController.h index 6eb88662ab4a1..b5573bea01297 100644 --- a/FWCore/Framework/src/EventSetupsController.h +++ b/FWCore/Framework/interface/EventSetupsController.h @@ -19,8 +19,8 @@ // #include "DataFormats/Provenance/interface/ParameterSetID.h" -#include "FWCore/Framework/src/EventSetupRecordIOVQueue.h" -#include "FWCore/Framework/src/NumberOfConcurrentIOVs.h" +#include "FWCore/Framework/interface/EventSetupRecordIOVQueue.h" +#include "FWCore/Framework/interface/NumberOfConcurrentIOVs.h" #include "FWCore/Utilities/interface/propagate_const.h" #include diff --git a/FWCore/Framework/src/GlobalSchedule.h b/FWCore/Framework/interface/GlobalSchedule.h similarity index 98% rename from FWCore/Framework/src/GlobalSchedule.h rename to FWCore/Framework/interface/GlobalSchedule.h index 43e8b24a0f38c..6cc5f427efcb0 100644 --- a/FWCore/Framework/src/GlobalSchedule.h +++ b/FWCore/Framework/interface/GlobalSchedule.h @@ -15,8 +15,8 @@ #include "FWCore/Framework/interface/ProcessBlockPrincipal.h" #include "FWCore/Framework/interface/RunPrincipal.h" #include "FWCore/Framework/interface/WorkerManager.h" -#include "FWCore/Framework/src/Worker.h" -#include "FWCore/Framework/src/WorkerRegistry.h" +#include "FWCore/Framework/interface/maker/Worker.h" +#include "FWCore/Framework/interface/WorkerRegistry.h" #include "FWCore/MessageLogger/interface/ExceptionMessages.h" #include "FWCore/ServiceRegistry/interface/GlobalContext.h" #include "FWCore/Utilities/interface/Algorithms.h" diff --git a/FWCore/Framework/interface/InputSourceDescription.h b/FWCore/Framework/interface/InputSourceDescription.h index 5aafcbc743b22..f865fdc8cb65c 100644 --- a/FWCore/Framework/interface/InputSourceDescription.h +++ b/FWCore/Framework/interface/InputSourceDescription.h @@ -9,7 +9,7 @@ input source that does not come in through the ParameterSet #include #include "DataFormats/Provenance/interface/ModuleDescription.h" #include "FWCore/Common/interface/FWCoreCommonFwd.h" -#include "FWCore/Framework/src/PreallocationConfiguration.h" +#include "FWCore/Framework/interface/PreallocationConfiguration.h" namespace edm { class ProductRegistry; diff --git a/FWCore/Framework/interface/InputSourceMacros.h b/FWCore/Framework/interface/InputSourceMacros.h index 14d4fd393f4bc..6ec8e239ffbf8 100644 --- a/FWCore/Framework/interface/InputSourceMacros.h +++ b/FWCore/Framework/interface/InputSourceMacros.h @@ -1,7 +1,7 @@ #ifndef FWCore_Framework_InputSourceMacros_h #define FWCore_Framework_InputSourceMacros_h -#include "FWCore/Framework/src/InputSourceFactory.h" +#include "FWCore/Framework/interface/maker/InputSourceFactory.h" #include "FWCore/Framework/interface/InputSource.h" #include "FWCore/ParameterSet/interface/ParameterSetDescriptionFillerPluginFactory.h" diff --git a/FWCore/Framework/interface/MakerMacros.h b/FWCore/Framework/interface/MakerMacros.h index b2edd882fdf3b..756e599d09807 100644 --- a/FWCore/Framework/interface/MakerMacros.h +++ b/FWCore/Framework/interface/MakerMacros.h @@ -1,8 +1,8 @@ #ifndef Framework_MakerMacros_h #define Framework_MakerMacros_h -#include "FWCore/Framework/src/Factory.h" -#include "FWCore/Framework/src/WorkerMaker.h" +#include "FWCore/Framework/interface/maker/MakerPluginFactory.h" +#include "FWCore/Framework/interface/maker/WorkerMaker.h" #include "FWCore/ParameterSet/interface/ParameterSetDescriptionFillerPluginFactory.h" // The following includes are temporary until a better // solution can be found. Placing these includes here @@ -11,7 +11,7 @@ // implementation file (one every for each XXXWorker) and // then include all the relevent worker headers in the // implementation file only. -#include "FWCore/Framework/src/WorkerT.h" +#include "FWCore/Framework/interface/maker/WorkerT.h" #define DEFINE_FWK_MODULE(type) \ DEFINE_EDM_PLUGIN(edm::MakerPluginFactory, edm::WorkerMaker, #type); \ diff --git a/FWCore/Framework/src/ModuleRegistry.h b/FWCore/Framework/interface/ModuleRegistry.h similarity index 98% rename from FWCore/Framework/src/ModuleRegistry.h rename to FWCore/Framework/interface/ModuleRegistry.h index 4978ee6e2c6ee..9f2ab2cf4ea07 100644 --- a/FWCore/Framework/src/ModuleRegistry.h +++ b/FWCore/Framework/interface/ModuleRegistry.h @@ -5,7 +5,7 @@ // Package: FWCore/Framework // Class : ModuleRegistry // -/**\class edm::ModuleRegistry ModuleRegistry.h "FWCore/Framework/src/ModuleRegistry.h" +/**\class edm::ModuleRegistry ModuleRegistry.h "FWCore/Framework/interface/ModuleRegistry.h" Description: Constructs and owns framework modules diff --git a/FWCore/Framework/src/NumberOfConcurrentIOVs.h b/FWCore/Framework/interface/NumberOfConcurrentIOVs.h similarity index 100% rename from FWCore/Framework/src/NumberOfConcurrentIOVs.h rename to FWCore/Framework/interface/NumberOfConcurrentIOVs.h diff --git a/FWCore/Framework/interface/OccurrenceTraits.h b/FWCore/Framework/interface/OccurrenceTraits.h index 0844cc1c8588b..6cff691267140 100644 --- a/FWCore/Framework/interface/OccurrenceTraits.h +++ b/FWCore/Framework/interface/OccurrenceTraits.h @@ -15,7 +15,7 @@ #include "FWCore/Framework/interface/ProcessBlockPrincipal.h" #include "FWCore/Utilities/interface/RunIndex.h" #include "FWCore/Framework/interface/RunPrincipal.h" -#include "FWCore/Framework/src/TransitionInfoTypes.h" +#include "FWCore/Framework/interface/TransitionInfoTypes.h" #include "FWCore/ServiceRegistry/interface/ActivityRegistry.h" #include "FWCore/ServiceRegistry/interface/GlobalContext.h" #include "FWCore/ServiceRegistry/interface/ModuleCallingContext.h" diff --git a/FWCore/Framework/src/OutputModuleCommunicator.h b/FWCore/Framework/interface/OutputModuleCommunicator.h similarity index 100% rename from FWCore/Framework/src/OutputModuleCommunicator.h rename to FWCore/Framework/interface/OutputModuleCommunicator.h diff --git a/FWCore/Framework/src/OutputModuleCommunicatorT.h b/FWCore/Framework/interface/OutputModuleCommunicatorT.h similarity index 98% rename from FWCore/Framework/src/OutputModuleCommunicatorT.h rename to FWCore/Framework/interface/OutputModuleCommunicatorT.h index b4ee6165a646e..67db5a94be5fb 100644 --- a/FWCore/Framework/src/OutputModuleCommunicatorT.h +++ b/FWCore/Framework/interface/OutputModuleCommunicatorT.h @@ -4,7 +4,7 @@ /*---------------------------------------------------------------------- ----------------------------------------------------------------------*/ -#include "FWCore/Framework/src/OutputModuleCommunicator.h" +#include "FWCore/Framework/interface/OutputModuleCommunicator.h" #include "FWCore/Common/interface/FWCoreCommonFwd.h" namespace edm { diff --git a/FWCore/Framework/src/Path.h b/FWCore/Framework/interface/Path.h similarity index 98% rename from FWCore/Framework/src/Path.h rename to FWCore/Framework/interface/Path.h index ac340a48ac681..4f95fc872cbf1 100644 --- a/FWCore/Framework/src/Path.h +++ b/FWCore/Framework/interface/Path.h @@ -11,8 +11,8 @@ can be kept for each worker. */ -#include "FWCore/Framework/src/WorkerInPath.h" -#include "FWCore/Framework/src/Worker.h" +#include "FWCore/Framework/interface/WorkerInPath.h" +#include "FWCore/Framework/interface/maker/Worker.h" #include "DataFormats/Common/interface/HLTenums.h" #include "DataFormats/Common/interface/TriggerResults.h" #include "FWCore/ServiceRegistry/interface/PathContext.h" diff --git a/FWCore/Framework/src/PreallocationConfiguration.h b/FWCore/Framework/interface/PreallocationConfiguration.h similarity index 100% rename from FWCore/Framework/src/PreallocationConfiguration.h rename to FWCore/Framework/interface/PreallocationConfiguration.h diff --git a/FWCore/Framework/src/PrincipalCache.h b/FWCore/Framework/interface/PrincipalCache.h similarity index 100% rename from FWCore/Framework/src/PrincipalCache.h rename to FWCore/Framework/interface/PrincipalCache.h diff --git a/FWCore/Framework/interface/ProducerBase.h b/FWCore/Framework/interface/ProducerBase.h index 98eff23835fbb..4a971b3bdf85c 100644 --- a/FWCore/Framework/interface/ProducerBase.h +++ b/FWCore/Framework/interface/ProducerBase.h @@ -9,6 +9,7 @@ EDProducts into an Event. ----------------------------------------------------------------------*/ #include "FWCore/Framework/interface/ProductRegistryHelper.h" +#include "FWCore/Framework/interface/ProducesCollector.h" #include "FWCore/Utilities/interface/ProductResolverIndex.h" #include diff --git a/FWCore/Framework/interface/ProducesCollector.h b/FWCore/Framework/interface/ProducesCollector.h index ae2abb2d324ee..d31ceaa7d66dd 100644 --- a/FWCore/Framework/interface/ProducesCollector.h +++ b/FWCore/Framework/interface/ProducesCollector.h @@ -39,6 +39,8 @@ a functor passed to the Framework with a call to callWhenNewProductsRegistered. namespace edm { class TypeID; + template + class ProducesCollectorAdaptor; class ProducesCollector { public: @@ -68,6 +70,15 @@ namespace edm { return helper_->produces(std::move(instanceName)); } + template + [[nodiscard]] auto produces(std::string instanceName) noexcept { + return ProducesCollectorAdaptor(*this, std::move(instanceName)); + } + template + [[nodiscard]] auto produces() noexcept { + return ProducesCollectorAdaptor(*this); + } + ProductRegistryHelper::BranchAliasSetter produces(const TypeID& id, std::string instanceName = std::string(), bool recordProvenance = true); @@ -86,5 +97,27 @@ namespace edm { propagate_const helper_; }; + template + class ProducesCollectorAdaptor { + public: + using Adapter = ProducesCollectorAdaptor; + + template + EDPutTokenT produces() { + return m_producer.template produces(m_label); + } + + private: + //only ProducesCollector is allowed to make an instance of this class + friend class ProducesCollector; + + ProducesCollectorAdaptor(ProducesCollector iBase, std::string iLabel) + : m_producer(iBase), m_label(std::move(iLabel)) {} + ProducesCollectorAdaptor(ProducesCollector iBase) : m_producer(iBase), m_label() {} + + ProducesCollector m_producer; + std::string const m_label; + }; + } // namespace edm #endif diff --git a/FWCore/Framework/src/ProductPutterBase.h b/FWCore/Framework/interface/ProductPutterBase.h similarity index 100% rename from FWCore/Framework/src/ProductPutterBase.h rename to FWCore/Framework/interface/ProductPutterBase.h diff --git a/FWCore/Framework/interface/ProductRegistryHelper.h b/FWCore/Framework/interface/ProductRegistryHelper.h index 72c0087dd2278..c13a95a11fe16 100644 --- a/FWCore/Framework/interface/ProductRegistryHelper.h +++ b/FWCore/Framework/interface/ProductRegistryHelper.h @@ -20,6 +20,9 @@ namespace edm { class ProductRegistry; struct DoNotRecordParents; + template + class ProductRegistryHelperAdaptor; + class ProductRegistryHelper { public: virtual ~ProductRegistryHelper() noexcept(false); @@ -79,6 +82,12 @@ namespace edm { TypeLabelItem& value_; EDPutTokenT token_; + template + EDPutTokenT produces() { + static_assert(std::is_same_v); + return token_; + } + operator EDPutTokenT() { return token_; } operator EDPutToken() { return EDPutToken(token_.index()); } }; @@ -104,6 +113,15 @@ namespace edm { \endcode should be added to the producer ctor for every product */ + template + [[nodiscard]] auto produces(std::string instanceName) noexcept { + return ProductRegistryHelperAdaptor(*this, std::move(instanceName)); + } + template + [[nodiscard]] auto produces() noexcept { + return ProductRegistryHelperAdaptor(*this); + } + template BranchAliasSetterT produces() { return produces(std::string()); @@ -177,6 +195,26 @@ namespace edm { std::vector recordProvenanceList_; }; + template + class ProductRegistryHelperAdaptor { + public: + template + EDPutTokenT produces() { + return m_helper.template produces(m_label); + } + + private: + //only ProductRegistryHelper is allowed to make an instance of this class + friend class ProductRegistryHelper; + + ProductRegistryHelperAdaptor(ProductRegistryHelper& iBase, std::string iLabel) + : m_helper(iBase), m_label(std::move(iLabel)) {} + explicit ProductRegistryHelperAdaptor(ProductRegistryHelper& iBase) : m_helper(iBase), m_label() {} + + ProductRegistryHelper& m_helper; + std::string const m_label; + }; + } // namespace edm #endif diff --git a/FWCore/Framework/interface/Schedule.h b/FWCore/Framework/interface/Schedule.h index ad3204e8246a0..4bf25e4c2f935 100644 --- a/FWCore/Framework/interface/Schedule.h +++ b/FWCore/Framework/interface/Schedule.h @@ -64,12 +64,12 @@ #include "FWCore/Framework/interface/Frameworkfwd.h" #include "FWCore/Framework/interface/OccurrenceTraits.h" #include "FWCore/Framework/interface/WorkerManager.h" -#include "FWCore/Framework/src/Worker.h" -#include "FWCore/Framework/src/WorkerRegistry.h" -#include "FWCore/Framework/src/GlobalSchedule.h" -#include "FWCore/Framework/src/StreamSchedule.h" -#include "FWCore/Framework/src/SystemTimeKeeper.h" -#include "FWCore/Framework/src/PreallocationConfiguration.h" +#include "FWCore/Framework/interface/maker/Worker.h" +#include "FWCore/Framework/interface/WorkerRegistry.h" +#include "FWCore/Framework/interface/GlobalSchedule.h" +#include "FWCore/Framework/interface/StreamSchedule.h" +#include "FWCore/Framework/interface/SystemTimeKeeper.h" +#include "FWCore/Framework/interface/PreallocationConfiguration.h" #include "FWCore/MessageLogger/interface/ExceptionMessages.h" #include "FWCore/MessageLogger/interface/JobReport.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" diff --git a/FWCore/Framework/src/SharedResourcesRegistry.h b/FWCore/Framework/interface/SharedResourcesRegistry.h similarity index 100% rename from FWCore/Framework/src/SharedResourcesRegistry.h rename to FWCore/Framework/interface/SharedResourcesRegistry.h diff --git a/FWCore/Framework/src/SignallingProductRegistry.h b/FWCore/Framework/interface/SignallingProductRegistry.h similarity index 100% rename from FWCore/Framework/src/SignallingProductRegistry.h rename to FWCore/Framework/interface/SignallingProductRegistry.h diff --git a/FWCore/Framework/src/StreamSchedule.h b/FWCore/Framework/interface/StreamSchedule.h similarity index 98% rename from FWCore/Framework/src/StreamSchedule.h rename to FWCore/Framework/interface/StreamSchedule.h index d2dcfcde48f5c..563b03a03f767 100644 --- a/FWCore/Framework/src/StreamSchedule.h +++ b/FWCore/Framework/interface/StreamSchedule.h @@ -67,11 +67,11 @@ #include "FWCore/Framework/interface/UnscheduledCallProducer.h" #include "FWCore/Framework/interface/WorkerManager.h" #include "FWCore/Framework/interface/EDProducer.h" -#include "FWCore/Framework/src/Path.h" -#include "FWCore/Framework/src/TransitionInfoTypes.h" -#include "FWCore/Framework/src/Worker.h" -#include "FWCore/Framework/src/WorkerRegistry.h" -#include "FWCore/Framework/src/EarlyDeleteHelper.h" +#include "FWCore/Framework/interface/Path.h" +#include "FWCore/Framework/interface/TransitionInfoTypes.h" +#include "FWCore/Framework/interface/maker/Worker.h" +#include "FWCore/Framework/interface/WorkerRegistry.h" +#include "FWCore/Framework/interface/EarlyDeleteHelper.h" #include "FWCore/MessageLogger/interface/ExceptionMessages.h" #include "FWCore/MessageLogger/interface/JobReport.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" diff --git a/FWCore/Framework/src/SubProcess.h b/FWCore/Framework/interface/SubProcess.h similarity index 99% rename from FWCore/Framework/src/SubProcess.h rename to FWCore/Framework/interface/SubProcess.h index fcd3e811508f8..5ca673eb388f5 100644 --- a/FWCore/Framework/src/SubProcess.h +++ b/FWCore/Framework/interface/SubProcess.h @@ -6,7 +6,7 @@ #include "FWCore/Framework/interface/EventSetupProvider.h" #include "FWCore/Framework/interface/EDConsumerBase.h" #include "FWCore/Framework/interface/PathsAndConsumesOfModules.h" -#include "FWCore/Framework/src/PrincipalCache.h" +#include "FWCore/Framework/interface/PrincipalCache.h" #include "FWCore/Framework/interface/Schedule.h" #include "FWCore/Framework/interface/TriggerResultsBasedEventSelector.h" #include "FWCore/Framework/interface/ProductSelectorRules.h" diff --git a/FWCore/Framework/src/SystemTimeKeeper.h b/FWCore/Framework/interface/SystemTimeKeeper.h similarity index 96% rename from FWCore/Framework/src/SystemTimeKeeper.h rename to FWCore/Framework/interface/SystemTimeKeeper.h index 6361d72e728f1..7fbc9e917dd2c 100644 --- a/FWCore/Framework/src/SystemTimeKeeper.h +++ b/FWCore/Framework/interface/SystemTimeKeeper.h @@ -26,6 +26,7 @@ // user include files #include "FWCore/Utilities/interface/CPUTimer.h" +#include "FWCore/Utilities/interface/ChildrenCPUTimer.h" #include "FWCore/Utilities/interface/WallclockTimer.h" // forward declarations @@ -106,6 +107,7 @@ namespace edm { std::vector> m_modulesOnPaths; CPUTimer m_processingLoopTimer; + ChildrenCPUTimer m_processingLoopChildrenTimer; ProcessContext const* m_processContext; unsigned int m_minModuleID; diff --git a/FWCore/Framework/src/TransitionInfoTypes.h b/FWCore/Framework/interface/TransitionInfoTypes.h similarity index 100% rename from FWCore/Framework/src/TransitionInfoTypes.h rename to FWCore/Framework/interface/TransitionInfoTypes.h diff --git a/FWCore/Framework/src/UnscheduledAuxiliary.h b/FWCore/Framework/interface/UnscheduledAuxiliary.h similarity index 89% rename from FWCore/Framework/src/UnscheduledAuxiliary.h rename to FWCore/Framework/interface/UnscheduledAuxiliary.h index 9767372687d80..5b587e1c6aab9 100644 --- a/FWCore/Framework/src/UnscheduledAuxiliary.h +++ b/FWCore/Framework/interface/UnscheduledAuxiliary.h @@ -5,7 +5,7 @@ // Package: FWCore/Framework // Class : UnscheduledAuxiliary // -/**\class UnscheduledAuxiliary UnscheduledAuxiliary.h "UnscheduledAuxiliary.h" +/**\class UnscheduledAuxiliary UnscheduledAuxiliary.h "FWCore/Framework/interface/UnscheduledAuxiliary.h" Description: Holds auxiliary information needed for unscheduled calls to EDProducers @@ -21,7 +21,7 @@ // system include files // user include files -#include "FWCore/Framework/src/TransitionInfoTypes.h" +#include "FWCore/Framework/interface/TransitionInfoTypes.h" #include "FWCore/Utilities/interface/Signal.h" // forward declarations diff --git a/FWCore/Framework/interface/UnscheduledCallProducer.h b/FWCore/Framework/interface/UnscheduledCallProducer.h index 543085b3c8ac6..65d5b29ab1950 100644 --- a/FWCore/Framework/interface/UnscheduledCallProducer.h +++ b/FWCore/Framework/interface/UnscheduledCallProducer.h @@ -18,8 +18,8 @@ #include "FWCore/Framework/interface/BranchActionType.h" #include "FWCore/Framework/interface/Frameworkfwd.h" #include "FWCore/Framework/interface/OccurrenceTraits.h" -#include "FWCore/Framework/src/Worker.h" -#include "FWCore/Framework/src/UnscheduledAuxiliary.h" +#include "FWCore/Framework/interface/maker/Worker.h" +#include "FWCore/Framework/interface/UnscheduledAuxiliary.h" #include "FWCore/Concurrency/interface/WaitingTaskHolder.h" #include "FWCore/ServiceRegistry/interface/ParentContext.h" #include "FWCore/ServiceRegistry/interface/ActivityRegistry.h" diff --git a/FWCore/Framework/src/WorkerInPath.h b/FWCore/Framework/interface/WorkerInPath.h similarity index 98% rename from FWCore/Framework/src/WorkerInPath.h rename to FWCore/Framework/interface/WorkerInPath.h index 36292cc3981f8..f57721a6e8b3a 100644 --- a/FWCore/Framework/src/WorkerInPath.h +++ b/FWCore/Framework/interface/WorkerInPath.h @@ -11,7 +11,7 @@ */ -#include "FWCore/Framework/src/Worker.h" +#include "FWCore/Framework/interface/maker/Worker.h" #include "FWCore/Concurrency/interface/WaitingTaskHolder.h" #include "FWCore/ServiceRegistry/interface/ParentContext.h" #include "FWCore/ServiceRegistry/interface/PlaceInPathContext.h" diff --git a/FWCore/Framework/interface/WorkerManager.h b/FWCore/Framework/interface/WorkerManager.h index 01b212849364e..d6e185628f3f5 100644 --- a/FWCore/Framework/interface/WorkerManager.h +++ b/FWCore/Framework/interface/WorkerManager.h @@ -9,8 +9,8 @@ #include "FWCore/Framework/interface/ExceptionHelpers.h" #include "FWCore/Framework/interface/Frameworkfwd.h" #include "FWCore/Framework/interface/UnscheduledCallProducer.h" -#include "FWCore/Framework/src/Worker.h" -#include "FWCore/Framework/src/WorkerRegistry.h" +#include "FWCore/Framework/interface/maker/Worker.h" +#include "FWCore/Framework/interface/WorkerRegistry.h" #include "FWCore/ServiceRegistry/interface/ServiceRegistry.h" #include "FWCore/Concurrency/interface/WaitingTaskHolder.h" #include "FWCore/Utilities/interface/ConvertException.h" diff --git a/FWCore/Framework/src/WorkerRegistry.h b/FWCore/Framework/interface/WorkerRegistry.h similarity index 100% rename from FWCore/Framework/src/WorkerRegistry.h rename to FWCore/Framework/interface/WorkerRegistry.h diff --git a/FWCore/Framework/src/globalTransitionAsync.h b/FWCore/Framework/interface/globalTransitionAsync.h similarity index 62% rename from FWCore/Framework/src/globalTransitionAsync.h rename to FWCore/Framework/interface/globalTransitionAsync.h index b0ee00f7a6c96..fd5f5abfaca89 100644 --- a/FWCore/Framework/src/globalTransitionAsync.h +++ b/FWCore/Framework/interface/globalTransitionAsync.h @@ -19,10 +19,11 @@ // #include "FWCore/Framework/interface/Schedule.h" -#include "FWCore/Framework/src/SubProcess.h" -#include "FWCore/Framework/src/TransitionInfoTypes.h" +#include "FWCore/Framework/interface/SubProcess.h" +#include "FWCore/Framework/interface/TransitionInfoTypes.h" #include "FWCore/Concurrency/interface/WaitingTask.h" #include "FWCore/Concurrency/interface/WaitingTaskHolder.h" +#include "FWCore/Concurrency/interface/chain_first.h" #include #include @@ -85,25 +86,29 @@ namespace edm { bool cleaningUpAfterException = false) { // When we are done processing the global for this process, // we need to run the global for all SubProcesses - auto subs = make_waiting_task([&iSubProcesses, iWait, info = transitionInfo, cleaningUpAfterException]( - std::exception_ptr const* iPtr) mutable { - if (iPtr) { - auto excpt = *iPtr; - auto delayError = - make_waiting_task([iWait, excpt](std::exception_ptr const*) mutable { iWait.doneWaiting(excpt); }); - WaitingTaskHolder h(*iWait.group(), delayError); - for (auto& subProcess : iSubProcesses) { - subProcessDoGlobalBeginTransitionAsync(h, subProcess, info, cleaningUpAfterException); - } - } else { - for (auto& subProcess : iSubProcesses) { - subProcessDoGlobalBeginTransitionAsync(iWait, subProcess, info, cleaningUpAfterException); - } - } - }); - - WaitingTaskHolder h(*iWait.group(), subs); - iSchedule.processOneGlobalAsync(std::move(h), transitionInfo, token, cleaningUpAfterException); + using namespace edm::waiting_task; + + chain::first([&](auto nextTask) { + iSchedule.processOneGlobalAsync(std::move(nextTask), transitionInfo, token, cleaningUpAfterException); + }) | + chain::then([&iSubProcesses, info = transitionInfo, cleaningUpAfterException](std::exception_ptr const* iPtr, + auto nextTask) { + if (iPtr) { + //delay handling exception until after subProcesses run + chain::first([&](auto nextTask) { + for (auto& subProcess : iSubProcesses) { + subProcessDoGlobalBeginTransitionAsync(nextTask, subProcess, info, cleaningUpAfterException); + } + }) | chain::then([excpt = *iPtr](std::exception_ptr const*, auto nextTask) { + nextTask.doneWaiting(excpt); + }) | chain::runLast(nextTask); + } else { + for (auto& subProcess : iSubProcesses) { + subProcessDoGlobalBeginTransitionAsync(nextTask, subProcess, info, cleaningUpAfterException); + } + } + }) | + chain::runLast(iWait); } template @@ -113,27 +118,30 @@ namespace edm { ServiceToken const& token, std::vector& iSubProcesses, bool cleaningUpAfterException) { - // When we are done processing the global for this process, - // we need to run the global for all SubProcesses - auto subs = make_waiting_task([&iSubProcesses, iWait, info = transitionInfo, cleaningUpAfterException]( - std::exception_ptr const* iPtr) mutable { - if (iPtr) { - auto excpt = *iPtr; - auto delayError = - make_waiting_task([iWait, excpt](std::exception_ptr const*) mutable { iWait.doneWaiting(excpt); }); - WaitingTaskHolder h(*iWait.group(), delayError); - for (auto& subProcess : iSubProcesses) { - subProcessDoGlobalEndTransitionAsync(h, subProcess, info, cleaningUpAfterException); - } - } else { - for (auto& subProcess : iSubProcesses) { - subProcessDoGlobalEndTransitionAsync(iWait, subProcess, info, cleaningUpAfterException); - } - } - }); - - WaitingTaskHolder h(*iWait.group(), subs); - iSchedule.processOneGlobalAsync(std::move(h), transitionInfo, token, cleaningUpAfterException); + using namespace edm::waiting_task; + chain::first([&](auto nextTask) { + iSchedule.processOneGlobalAsync(std::move(nextTask), transitionInfo, token, cleaningUpAfterException); + }) + // When we are done processing the global for this process, + // we need to run the global for all SubProcesses + | chain::then([&iSubProcesses, info = transitionInfo, cleaningUpAfterException](std::exception_ptr const* iPtr, + auto nextTask) { + if (iPtr) { + //still run the sub process but pass this exception to the nextTask + auto excpt = *iPtr; + chain::first([&](auto nextTask) { + for (auto& subProcess : iSubProcesses) { + subProcessDoGlobalEndTransitionAsync(nextTask, subProcess, info, cleaningUpAfterException); + } + }) | chain::then([excpt](std::exception_ptr const*, auto nextTask) { nextTask.doneWaiting(excpt); }) | + chain::runLast(std::move(nextTask)); + } else { + for (auto& subProcess : iSubProcesses) { + subProcessDoGlobalEndTransitionAsync(nextTask, subProcess, info, cleaningUpAfterException); + } + } + }) | + chain::runLast(iWait); } }; // namespace edm diff --git a/FWCore/Framework/src/InputSourceFactory.h b/FWCore/Framework/interface/maker/InputSourceFactory.h similarity index 100% rename from FWCore/Framework/src/InputSourceFactory.h rename to FWCore/Framework/interface/maker/InputSourceFactory.h diff --git a/FWCore/Framework/src/MakeModuleHelper.h b/FWCore/Framework/interface/maker/MakeModuleHelper.h similarity index 100% rename from FWCore/Framework/src/MakeModuleHelper.h rename to FWCore/Framework/interface/maker/MakeModuleHelper.h diff --git a/FWCore/Framework/src/MakeModuleParams.h b/FWCore/Framework/interface/maker/MakeModuleParams.h similarity index 100% rename from FWCore/Framework/src/MakeModuleParams.h rename to FWCore/Framework/interface/maker/MakeModuleParams.h diff --git a/FWCore/Framework/interface/maker/MakerPluginFactory.h b/FWCore/Framework/interface/maker/MakerPluginFactory.h new file mode 100644 index 0000000000000..ec2cf491aa4bb --- /dev/null +++ b/FWCore/Framework/interface/maker/MakerPluginFactory.h @@ -0,0 +1,12 @@ +#ifndef FWCore_Framework_MakerPluginFactory_h +#define FWCore_Framework_MakerPluginFactory_h + +#include "FWCore/PluginManager/interface/PluginFactory.h" + +namespace edm { + class Maker; + + using MakerPluginFactory = edmplugin::PluginFactory; +} // namespace edm + +#endif diff --git a/FWCore/Framework/src/ModuleHolder.h b/FWCore/Framework/interface/maker/ModuleHolder.h similarity index 94% rename from FWCore/Framework/src/ModuleHolder.h rename to FWCore/Framework/interface/maker/ModuleHolder.h index 9aead896b929b..6c223c024a16a 100644 --- a/FWCore/Framework/src/ModuleHolder.h +++ b/FWCore/Framework/interface/maker/ModuleHolder.h @@ -5,7 +5,7 @@ // Package: FWCore/Framework // Class : ModuleHolder // -/**\class edm::maker::ModuleHolder ModuleHolder.h "FWCore/Framework/src/ModuleHolder.h" +/**\class edm::maker::ModuleHolder ModuleHolder.h "FWCore/Framework/interface/maker/ModuleHolder.h" Description: Base class used to own a module for the framework @@ -22,8 +22,8 @@ #include // user include files -#include "FWCore/Framework/src/WorkerT.h" -#include "FWCore/Framework/src/OutputModuleCommunicatorT.h" +#include "FWCore/Framework/interface/maker/WorkerT.h" +#include "FWCore/Framework/interface/OutputModuleCommunicatorT.h" // forward declarations namespace edm { diff --git a/FWCore/Framework/src/Worker.h b/FWCore/Framework/interface/maker/Worker.h similarity index 99% rename from FWCore/Framework/src/Worker.h rename to FWCore/Framework/interface/maker/Worker.h index a0d6a61c2f6a7..65e4d0b0d4230 100644 --- a/FWCore/Framework/src/Worker.h +++ b/FWCore/Framework/interface/maker/Worker.h @@ -24,8 +24,8 @@ the worker is reset(). #include "DataFormats/Provenance/interface/ModuleDescription.h" #include "FWCore/Common/interface/FWCoreCommonFwd.h" #include "FWCore/MessageLogger/interface/ExceptionMessages.h" -#include "FWCore/Framework/src/TransitionInfoTypes.h" -#include "FWCore/Framework/src/WorkerParams.h" +#include "FWCore/Framework/interface/TransitionInfoTypes.h" +#include "FWCore/Framework/interface/maker/WorkerParams.h" #include "FWCore/Framework/interface/ExceptionActions.h" #include "FWCore/Framework/interface/ModuleContextSentry.h" #include "FWCore/Framework/interface/OccurrenceTraits.h" @@ -302,8 +302,6 @@ namespace edm { virtual TaskQueueAdaptor serializeRunModule() = 0; - static void exceptionContext(cms::Exception& ex, ModuleCallingContext const* mcc); - bool shouldRethrowException(std::exception_ptr iPtr, ParentContext const& parentContext, bool isEvent) const; template @@ -1131,7 +1129,7 @@ namespace edm { } }); } catch (cms::Exception& ex) { - exceptionContext(ex, &moduleCallingContext_); + edm::exceptionContext(ex, moduleCallingContext_); if (shouldRethrowException(std::current_exception(), parentContext, T::isEvent_)) { assert(not cached_exception_); setException(std::current_exception()); diff --git a/FWCore/Framework/src/WorkerMaker.h b/FWCore/Framework/interface/maker/WorkerMaker.h similarity index 94% rename from FWCore/Framework/src/WorkerMaker.h rename to FWCore/Framework/interface/maker/WorkerMaker.h index 6ab378994eb59..8052585d2ede0 100644 --- a/FWCore/Framework/src/WorkerMaker.h +++ b/FWCore/Framework/interface/maker/WorkerMaker.h @@ -5,10 +5,10 @@ #include #include -#include "FWCore/Framework/src/WorkerT.h" -#include "FWCore/Framework/src/MakeModuleParams.h" -#include "FWCore/Framework/src/ModuleHolder.h" -#include "FWCore/Framework/src/MakeModuleHelper.h" +#include "FWCore/Framework/interface/maker/WorkerT.h" +#include "FWCore/Framework/interface/maker/MakeModuleParams.h" +#include "FWCore/Framework/interface/maker/ModuleHolder.h" +#include "FWCore/Framework/interface/maker/MakeModuleHelper.h" #include "FWCore/Utilities/interface/Signal.h" @@ -16,7 +16,6 @@ namespace edm { class ConfigurationDescriptions; class ModuleDescription; class ParameterSet; - class Maker; class ExceptionToActionTable; class Maker { diff --git a/FWCore/Framework/src/WorkerParams.h b/FWCore/Framework/interface/maker/WorkerParams.h similarity index 100% rename from FWCore/Framework/src/WorkerParams.h rename to FWCore/Framework/interface/maker/WorkerParams.h diff --git a/FWCore/Framework/src/WorkerT.h b/FWCore/Framework/interface/maker/WorkerT.h similarity index 97% rename from FWCore/Framework/src/WorkerT.h rename to FWCore/Framework/interface/maker/WorkerT.h index 007a50c7dd65a..fa566f29c64ac 100644 --- a/FWCore/Framework/src/WorkerT.h +++ b/FWCore/Framework/interface/maker/WorkerT.h @@ -9,9 +9,9 @@ WorkerT: Code common to all workers. #include "FWCore/Common/interface/FWCoreCommonFwd.h" #include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/src/TransitionInfoTypes.h" -#include "FWCore/Framework/src/Worker.h" -#include "FWCore/Framework/src/WorkerParams.h" +#include "FWCore/Framework/interface/TransitionInfoTypes.h" +#include "FWCore/Framework/interface/maker/Worker.h" +#include "FWCore/Framework/interface/maker/WorkerParams.h" #include "FWCore/ServiceRegistry/interface/ConsumesInfo.h" #include "FWCore/Utilities/interface/propagate_const.h" diff --git a/FWCore/Framework/interface/stream/EDAnalyzerAdaptor.h b/FWCore/Framework/interface/stream/EDAnalyzerAdaptor.h index 6d420137af8cc..1bb532737f2d7 100644 --- a/FWCore/Framework/interface/stream/EDAnalyzerAdaptor.h +++ b/FWCore/Framework/interface/stream/EDAnalyzerAdaptor.h @@ -31,8 +31,8 @@ #include "FWCore/Framework/interface/stream/callAbilities.h" #include "FWCore/Framework/interface/stream/dummy_helpers.h" #include "FWCore/Framework/interface/stream/makeGlobal.h" -#include "FWCore/Framework/src/MakeModuleHelper.h" -#include "FWCore/Framework/src/TransitionInfoTypes.h" +#include "FWCore/Framework/interface/maker/MakeModuleHelper.h" +#include "FWCore/Framework/interface/TransitionInfoTypes.h" #include "FWCore/ServiceRegistry/interface/ESParentContext.h" // forward declarations diff --git a/FWCore/Framework/interface/stream/EDFilterAdaptor.h b/FWCore/Framework/interface/stream/EDFilterAdaptor.h index b69fab70c4fe5..0c20c7a744555 100644 --- a/FWCore/Framework/interface/stream/EDFilterAdaptor.h +++ b/FWCore/Framework/interface/stream/EDFilterAdaptor.h @@ -23,7 +23,7 @@ // user include files #include "FWCore/Framework/interface/stream/EDFilterAdaptorBase.h" #include "FWCore/Framework/interface/stream/ProducingModuleAdaptor.h" -#include "FWCore/Framework/src/MakeModuleHelper.h" +#include "FWCore/Framework/interface/maker/MakeModuleHelper.h" // forward declarations diff --git a/FWCore/Framework/interface/stream/EDProducerAdaptor.h b/FWCore/Framework/interface/stream/EDProducerAdaptor.h index d3a7d5b347e6a..92eeb269e6428 100644 --- a/FWCore/Framework/interface/stream/EDProducerAdaptor.h +++ b/FWCore/Framework/interface/stream/EDProducerAdaptor.h @@ -23,7 +23,7 @@ // user include files #include "FWCore/Framework/interface/stream/EDProducerAdaptorBase.h" #include "FWCore/Framework/interface/stream/ProducingModuleAdaptor.h" -#include "FWCore/Framework/src/MakeModuleHelper.h" +#include "FWCore/Framework/interface/maker/MakeModuleHelper.h" // forward declarations namespace edm { diff --git a/FWCore/Framework/interface/stream/ProducingModuleAdaptor.h b/FWCore/Framework/interface/stream/ProducingModuleAdaptor.h index 374eca94e63f6..499691f733430 100644 --- a/FWCore/Framework/interface/stream/ProducingModuleAdaptor.h +++ b/FWCore/Framework/interface/stream/ProducingModuleAdaptor.h @@ -30,7 +30,7 @@ #include "FWCore/Framework/interface/stream/callAbilities.h" #include "FWCore/Framework/interface/stream/dummy_helpers.h" #include "FWCore/Framework/interface/stream/makeGlobal.h" -#include "FWCore/Framework/src/TransitionInfoTypes.h" +#include "FWCore/Framework/interface/TransitionInfoTypes.h" #include "FWCore/ServiceRegistry/interface/ESParentContext.h" // forward declarations diff --git a/FWCore/Framework/src/streamTransitionAsync.h b/FWCore/Framework/interface/streamTransitionAsync.h similarity index 69% rename from FWCore/Framework/src/streamTransitionAsync.h rename to FWCore/Framework/interface/streamTransitionAsync.h index 3a171b2392c0b..3416cb64d3602 100644 --- a/FWCore/Framework/src/streamTransitionAsync.h +++ b/FWCore/Framework/interface/streamTransitionAsync.h @@ -19,10 +19,11 @@ // #include "FWCore/Framework/interface/Schedule.h" -#include "FWCore/Framework/src/SubProcess.h" -#include "FWCore/Framework/src/TransitionInfoTypes.h" +#include "FWCore/Framework/interface/SubProcess.h" +#include "FWCore/Framework/interface/TransitionInfoTypes.h" #include "FWCore/Concurrency/interface/WaitingTask.h" #include "FWCore/Concurrency/interface/WaitingTaskHolder.h" +#include "FWCore/Concurrency/interface/chain_first.h" #include @@ -69,25 +70,28 @@ namespace edm { //When we are done processing the stream for this process, // we need to run the stream for all SubProcesses //NOTE: The subprocesses set their own service tokens - auto subs = make_waiting_task( - [&iSubProcesses, iWait, iStreamIndex, info = transitionInfo](std::exception_ptr const* iPtr) mutable { - if (iPtr) { - auto excpt = *iPtr; - auto delayError = - make_waiting_task([iWait, excpt](std::exception_ptr const*) mutable { iWait.doneWaiting(excpt); }); - WaitingTaskHolder h(*iWait.group(), delayError); - for (auto& subProcess : iSubProcesses) { - subProcessDoStreamBeginTransitionAsync(h, subProcess, iStreamIndex, info); - }; - } else { - for (auto& subProcess : iSubProcesses) { - subProcessDoStreamBeginTransitionAsync(iWait, subProcess, iStreamIndex, info); - }; - } - }); - - WaitingTaskHolder h(*iWait.group(), subs); - iSchedule.processOneStreamAsync(std::move(h), iStreamIndex, transitionInfo, token); + using namespace edm::waiting_task; + chain::first([&](auto nextTask) { + iSchedule.processOneStreamAsync(std::move(nextTask), iStreamIndex, transitionInfo, token); + }) | + chain::then( + [&iSubProcesses, iStreamIndex, info = transitionInfo](std::exception_ptr const* iPtr, auto nextTask) { + if (iPtr) { + auto excpt = *iPtr; + //defer handling exception until after sub processes run + chain::first([&](std::exception_ptr const*, auto nextTask) { + for (auto& subProcess : iSubProcesses) { + subProcessDoStreamBeginTransitionAsync(nextTask, subProcess, iStreamIndex, info); + }; + }) | chain::then([excpt](std::exception_ptr const*, auto nextTask) { nextTask.doneWaiting(excpt); }) | + chain::runLast(nextTask); + } else { + for (auto& subProcess : iSubProcesses) { + subProcessDoStreamBeginTransitionAsync(nextTask, subProcess, iStreamIndex, info); + }; + } + }) | + chain::runLast(iWait); } template @@ -114,26 +118,28 @@ namespace edm { // we need to run the stream for all SubProcesses //NOTE: The subprocesses set their own service tokens - auto subs = - make_waiting_task([&iSubProcesses, iWait, iStreamIndex, info = transitionInfo, cleaningUpAfterException]( - std::exception_ptr const* iPtr) mutable { + using namespace edm::waiting_task; + chain::first([&](auto nextTask) { + iSchedule.processOneStreamAsync(nextTask, iStreamIndex, transitionInfo, token, cleaningUpAfterException); + }) | + chain::then([&iSubProcesses, iStreamIndex, info = transitionInfo, cleaningUpAfterException]( + std::exception_ptr const* iPtr, auto nextTask) { if (iPtr) { auto excpt = *iPtr; - auto delayError = - make_waiting_task([iWait, excpt](std::exception_ptr const*) mutable { iWait.doneWaiting(excpt); }); - WaitingTaskHolder h(*iWait.group(), delayError); - for (auto& subProcess : iSubProcesses) { - subProcessDoStreamEndTransitionAsync(h, subProcess, iStreamIndex, info, cleaningUpAfterException); - } + chain::first([&](std::exception_ptr const*, auto nextTask) { + for (auto& subProcess : iSubProcesses) { + subProcessDoStreamEndTransitionAsync( + nextTask, subProcess, iStreamIndex, info, cleaningUpAfterException); + } + }) | chain::then([excpt](std::exception_ptr const*, auto nextTask) { nextTask.doneWaiting(excpt); }) | + chain::runLast(nextTask); } else { for (auto& subProcess : iSubProcesses) { - subProcessDoStreamEndTransitionAsync(iWait, subProcess, iStreamIndex, info, cleaningUpAfterException); + subProcessDoStreamEndTransitionAsync(nextTask, subProcess, iStreamIndex, info, cleaningUpAfterException); } } - }); - - iSchedule.processOneStreamAsync( - WaitingTaskHolder(*iWait.group(), subs), iStreamIndex, transitionInfo, token, cleaningUpAfterException); + }) | + chain::runLast(iWait); } template diff --git a/FWCore/Framework/src/EDAnalyzer.cc b/FWCore/Framework/src/EDAnalyzer.cc index a451efb264bd2..83031d6daadbf 100644 --- a/FWCore/Framework/src/EDAnalyzer.cc +++ b/FWCore/Framework/src/EDAnalyzer.cc @@ -11,9 +11,9 @@ #include "FWCore/Framework/src/edmodule_mightGet_config.h" #include "FWCore/Framework/interface/ConstProductRegistry.h" #include "FWCore/Framework/src/EventSignalsSentry.h" -#include "FWCore/Framework/src/TransitionInfoTypes.h" +#include "FWCore/Framework/interface/TransitionInfoTypes.h" -#include "SharedResourcesRegistry.h" +#include "FWCore/Framework/interface/SharedResourcesRegistry.h" #include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" #include "FWCore/ParameterSet/interface/ParameterSetDescription.h" diff --git a/FWCore/Framework/src/EDFilter.cc b/FWCore/Framework/src/EDFilter.cc index 0fe1cc68d28d5..573d89bd68da4 100644 --- a/FWCore/Framework/src/EDFilter.cc +++ b/FWCore/Framework/src/EDFilter.cc @@ -10,10 +10,10 @@ #include "FWCore/Framework/interface/EventSetup.h" #include "FWCore/Framework/src/edmodule_mightGet_config.h" #include "FWCore/Framework/src/EventSignalsSentry.h" -#include "FWCore/Framework/src/TransitionInfoTypes.h" +#include "FWCore/Framework/interface/TransitionInfoTypes.h" #include "FWCore/ServiceRegistry/interface/ESParentContext.h" -#include "SharedResourcesRegistry.h" +#include "FWCore/Framework/interface/SharedResourcesRegistry.h" #include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" #include "FWCore/ParameterSet/interface/ParameterSetDescription.h" diff --git a/FWCore/Framework/src/EDProducer.cc b/FWCore/Framework/src/EDProducer.cc index d6ac5da139aff..eda5ba67128b3 100644 --- a/FWCore/Framework/src/EDProducer.cc +++ b/FWCore/Framework/src/EDProducer.cc @@ -10,12 +10,12 @@ #include "FWCore/Framework/interface/EventSetup.h" #include "FWCore/Framework/src/edmodule_mightGet_config.h" #include "FWCore/Framework/src/EventSignalsSentry.h" -#include "FWCore/Framework/src/TransitionInfoTypes.h" +#include "FWCore/Framework/interface/TransitionInfoTypes.h" #include "FWCore/ServiceRegistry/interface/ESParentContext.h" #include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" #include "FWCore/ParameterSet/interface/ParameterSetDescription.h" -#include "SharedResourcesRegistry.h" +#include "FWCore/Framework/interface/SharedResourcesRegistry.h" namespace edm { EDProducer::EDProducer() : ProducerBase(), moduleDescription_(), previousParentage_(), previousParentageId_() { diff --git a/FWCore/Framework/src/ESProducer.cc b/FWCore/Framework/src/ESProducer.cc index ea237cee53107..963092ff86ffe 100644 --- a/FWCore/Framework/src/ESProducer.cc +++ b/FWCore/Framework/src/ESProducer.cc @@ -15,7 +15,7 @@ // user include files #include "FWCore/Framework/interface/ESProducer.h" #include "FWCore/Framework/interface/ESRecordsToProxyIndices.h" -#include "FWCore/Framework/src/SharedResourcesRegistry.h" +#include "FWCore/Framework/interface/SharedResourcesRegistry.h" // // constants, enums and typedefs // diff --git a/FWCore/Framework/src/EarlyDeleteHelper.cc b/FWCore/Framework/src/EarlyDeleteHelper.cc index c565aeef73b3f..ea09448a94058 100644 --- a/FWCore/Framework/src/EarlyDeleteHelper.cc +++ b/FWCore/Framework/src/EarlyDeleteHelper.cc @@ -16,7 +16,7 @@ #include "DataFormats/Provenance/interface/BranchID.h" #include "FWCore/Framework/interface/EventPrincipal.h" -#include "FWCore/Framework/src/EarlyDeleteHelper.h" +#include "FWCore/Framework/interface/EarlyDeleteHelper.h" using namespace edm; // diff --git a/FWCore/Framework/src/EndPathStatusInserter.cc b/FWCore/Framework/src/EndPathStatusInserter.cc index 292739efd9703..5c040e4fd32b2 100644 --- a/FWCore/Framework/src/EndPathStatusInserter.cc +++ b/FWCore/Framework/src/EndPathStatusInserter.cc @@ -7,7 +7,7 @@ #include namespace edm { - EndPathStatusInserter::EndPathStatusInserter(unsigned int) : token_{produces()} {} + EndPathStatusInserter::EndPathStatusInserter(unsigned int) : token_{produces()} {} void EndPathStatusInserter::produce(StreamID, edm::Event& event, edm::EventSetup const&) const { //Puts a default constructed EndPathStatus diff --git a/FWCore/Framework/src/Event.cc b/FWCore/Framework/src/Event.cc index 54dfb44246144..00974f938aba6 100644 --- a/FWCore/Framework/src/Event.cc +++ b/FWCore/Framework/src/Event.cc @@ -7,8 +7,8 @@ #include "FWCore/Common/interface/TriggerResultsByName.h" #include "FWCore/Framework/interface/EventPrincipal.h" #include "FWCore/Framework/interface/LuminosityBlock.h" -#include "FWCore/Framework/src/TransitionInfoTypes.h" -#include "FWCore/Framework/src/ProductPutterBase.h" +#include "FWCore/Framework/interface/TransitionInfoTypes.h" +#include "FWCore/Framework/interface/ProductPutterBase.h" #include "FWCore/ParameterSet/interface/Registry.h" #include "FWCore/Utilities/interface/Algorithms.h" #include "FWCore/Utilities/interface/InputTag.h" diff --git a/FWCore/Framework/src/EventForOutput.cc b/FWCore/Framework/src/EventForOutput.cc index 74a8a2d8c55e8..6b37b2804dc8a 100644 --- a/FWCore/Framework/src/EventForOutput.cc +++ b/FWCore/Framework/src/EventForOutput.cc @@ -4,7 +4,7 @@ #include "FWCore/Common/interface/TriggerResultsByName.h" #include "FWCore/Framework/interface/EventPrincipal.h" #include "FWCore/Framework/interface/LuminosityBlockForOutput.h" -#include "FWCore/Framework/src/TransitionInfoTypes.h" +#include "FWCore/Framework/interface/TransitionInfoTypes.h" #include "FWCore/ParameterSet/interface/Registry.h" #include "FWCore/Utilities/interface/Algorithms.h" #include "FWCore/Utilities/interface/InputTag.h" diff --git a/FWCore/Framework/src/EventPrincipal.cc b/FWCore/Framework/src/EventPrincipal.cc index 089aec3b05d46..88b6b048f9846 100644 --- a/FWCore/Framework/src/EventPrincipal.cc +++ b/FWCore/Framework/src/EventPrincipal.cc @@ -18,7 +18,7 @@ #include "FWCore/Framework/interface/ProductResolverBase.h" #include "FWCore/Framework/interface/LuminosityBlockPrincipal.h" #include "FWCore/Framework/src/ProductDeletedException.h" -#include "FWCore/Framework/src/ProductPutterBase.h" +#include "FWCore/Framework/interface/ProductPutterBase.h" #include "FWCore/Framework/interface/SharedResourcesAcquirer.h" #include "FWCore/Utilities/interface/Algorithms.h" #include "FWCore/Utilities/interface/EDMException.h" diff --git a/FWCore/Framework/src/EventProcessor.cc b/FWCore/Framework/src/EventProcessor.cc index 59c25aaec6767..8e3fe85612854 100644 --- a/FWCore/Framework/src/EventProcessor.cc +++ b/FWCore/Framework/src/EventProcessor.cc @@ -28,16 +28,16 @@ #include "FWCore/Framework/interface/Schedule.h" #include "FWCore/Framework/interface/ScheduleInfo.h" #include "FWCore/Framework/interface/ScheduleItems.h" -#include "FWCore/Framework/src/SubProcess.h" +#include "FWCore/Framework/interface/SubProcess.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/ESRecordsToProxyIndices.h" #include "FWCore/Framework/src/Breakpoints.h" -#include "FWCore/Framework/src/EventSetupsController.h" -#include "FWCore/Framework/src/InputSourceFactory.h" -#include "FWCore/Framework/src/SharedResourcesRegistry.h" -#include "FWCore/Framework/src/streamTransitionAsync.h" -#include "FWCore/Framework/src/TransitionInfoTypes.h" -#include "FWCore/Framework/src/globalTransitionAsync.h" +#include "FWCore/Framework/interface/EventSetupsController.h" +#include "FWCore/Framework/interface/maker/InputSourceFactory.h" +#include "FWCore/Framework/interface/SharedResourcesRegistry.h" +#include "FWCore/Framework/interface/streamTransitionAsync.h" +#include "FWCore/Framework/interface/TransitionInfoTypes.h" +#include "FWCore/Framework/interface/globalTransitionAsync.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" @@ -698,13 +698,49 @@ namespace edm { //make the services available ServiceRegistry::Operate operate(serviceToken_); - //NOTE: this really should go elsewhere in the future - for (unsigned int i = 0; i < preallocations_.numberOfStreams(); ++i) { - c.call([this, i]() { this->schedule_->endStream(i); }); - for (auto& subProcess : subProcesses_) { - c.call([&subProcess, i]() { subProcess.doEndStream(i); }); + using namespace edm::waiting_task::chain; + + edm::FinalWaitingTask waitTask; + tbb::task_group group; + + { + //handle endStream transitions + edm::WaitingTaskHolder taskHolder(group, &waitTask); + std::mutex collectorMutex; + for (unsigned int i = 0; i < preallocations_.numberOfStreams(); ++i) { + first([this, i, &c, &collectorMutex](auto nextTask) { + std::exception_ptr ep; + try { + ServiceRegistry::Operate operate(serviceToken_); + this->schedule_->endStream(i); + } catch (...) { + ep = std::current_exception(); + } + if (ep) { + std::lock_guard l(collectorMutex); + c.call([&ep]() { std::rethrow_exception(ep); }); + } + }) | then([this, i, &c, &collectorMutex](auto nextTask) { + for (auto& subProcess : subProcesses_) { + first([this, i, &c, &collectorMutex, &subProcess](auto nextTask) { + std::exception_ptr ep; + try { + ServiceRegistry::Operate operate(serviceToken_); + subProcess.doEndStream(i); + } catch (...) { + ep = std::current_exception(); + } + if (ep) { + std::lock_guard l(collectorMutex); + c.call([&ep]() { std::rethrow_exception(ep); }); + } + }) | lastTask(nextTask); + } + }) | lastTask(taskHolder); } } + group.wait(); + auto actReg = actReg_.get(); c.call([actReg]() { actReg->preEndJobSignal_(); }); schedule_->endJob(c); @@ -1294,159 +1330,149 @@ namespace edm { // destroyed inside this function and lumiWork. auto status = std::make_shared(this, preallocations_.numberOfStreams(), iRunResource); - - auto lumiWork = [this, iHolder, status](edm::LimitedTaskQueue::Resumer iResumer) mutable { - if (iHolder.taskHasFailed()) { - status->resetResources(); - return; - } - - status->setResumer(std::move(iResumer)); - - sourceResourcesAcquirer_.serialQueueChain().push( - *iHolder.group(), [this, iHolder, status = std::move(status)]() mutable { - //make the services available - ServiceRegistry::Operate operate(serviceToken_); - // Caught exception is propagated via WaitingTaskHolder - CMS_SA_ALLOW try { - readLuminosityBlock(*status); - - LuminosityBlockPrincipal& lumiPrincipal = *status->lumiPrincipal(); - { - SendSourceTerminationSignalIfException sentry(actReg_.get()); - - input_->doBeginLumi(lumiPrincipal, &processContext_); - sentry.completedSuccessfully(); - } - - Service rng; - if (rng.isAvailable()) { - LuminosityBlock lb(lumiPrincipal, ModuleDescription(), nullptr, false); - rng->preBeginLumi(lb); - } - - EventSetupImpl const& es = status->eventSetupImpl(esp_->subProcessIndex()); - - using namespace edm::waiting_task::chain; - chain::first([this, status, &lumiPrincipal](auto nextTask) { - EventSetupImpl const& es = status->eventSetupImpl(esp_->subProcessIndex()); - { - LumiTransitionInfo transitionInfo(lumiPrincipal, es, &status->eventSetupImpls()); - using Traits = OccurrenceTraits; - beginGlobalTransitionAsync( - nextTask, *schedule_, transitionInfo, serviceToken_, subProcesses_); - } - }) | ifThen(looper_, [this, status, &es](auto nextTask) { - looper_->prefetchAsync( - nextTask, serviceToken_, Transition::BeginLuminosityBlock, *(status->lumiPrincipal()), es); - }) | ifThen(looper_, [this, status, &es](auto nextTask) { - status->globalBeginDidSucceed(); - //make the services available - ServiceRegistry::Operate operateLooper(serviceToken_); - looper_->doBeginLuminosityBlock(*(status->lumiPrincipal()), es, &processContext_); - }) | then([this, status](std::exception_ptr const* iPtr, auto holder) mutable { - if (iPtr) { - status->resetResources(); - holder.doneWaiting(*iPtr); - } else { - if (not looper_) { - status->globalBeginDidSucceed(); - } - EventSetupImpl const& es = status->eventSetupImpl(esp_->subProcessIndex()); - using Traits = OccurrenceTraits; - - for (unsigned int i = 0; i < preallocations_.numberOfStreams(); ++i) { - streamQueues_[i].push(*holder.group(), [this, i, status, holder, &es]() mutable { - streamQueues_[i].pause(); - - auto& event = principalCache_.eventPrincipal(i); - //We need to be sure that 'status' and its internal shared_ptr are only - // held by the container as this lambda may not finish executing before all the tasks it - // spawns have already started to run. - auto eventSetupImpls = &status->eventSetupImpls(); - auto lp = status->lumiPrincipal().get(); - streamLumiStatus_[i] = std::move(status); - ++streamLumiActive_; - event.setLuminosityBlockPrincipal(lp); - LumiTransitionInfo transitionInfo(*lp, es, eventSetupImpls); - using namespace edm::waiting_task::chain; - chain::first([this, i, &transitionInfo](auto nextTask) { - beginStreamTransitionAsync( - std::move(nextTask), *schedule_, i, transitionInfo, serviceToken_, subProcesses_); - }) | then([this, i](std::exception_ptr const* exceptionFromBeginStreamLumi, auto nextTask) { - if (exceptionFromBeginStreamLumi) { - WaitingTaskHolder tmp(nextTask); - tmp.doneWaiting(*exceptionFromBeginStreamLumi); - streamEndLumiAsync(nextTask, i); - } else { - handleNextEventForStreamAsync(std::move(nextTask), i); - } - }) | runLast(holder); - }); - } - } - }) | runLast(iHolder); - - } catch (...) { - status->resetResources(); - iHolder.doneWaiting(std::current_exception()); - } - }); // task in sourceResourcesAcquirer - }; // end lumiWork - - auto queueLumiWorkTask = make_waiting_task( - [this, lumiWorkLambda = std::move(lumiWork), iHolder](std::exception_ptr const* iPtr) mutable { - if (iPtr) { - iHolder.doneWaiting(*iPtr); - } - lumiQueue_->pushAndPause(*iHolder.group(), std::move(lumiWorkLambda)); - }); - - if (espController_->doWeNeedToWaitForIOVsToFinish(iSync)) { - // We only get here inside this block if there is an EventSetup - // module not able to handle concurrent IOVs (usually an ESSource) - // and the new sync value is outside the current IOV of that module. - - WaitingTaskHolder queueLumiWorkTaskHolder{*iHolder.group(), queueLumiWorkTask}; - - queueWhichWaitsForIOVsToFinish_.push(*iHolder.group(), [this, queueLumiWorkTaskHolder, iSync, status]() mutable { - // Caught exception is propagated via WaitingTaskHolder + chain::first([&](auto nextTask) { + auto asyncEventSetup = [](ActivityRegistry* actReg, + auto* espController, + auto& queue, + WaitingTaskHolder task, + auto& status, + IOVSyncValue const& iSync) { + queue.pause(); CMS_SA_ALLOW try { - SendSourceTerminationSignalIfException sentry(actReg_.get()); + SendSourceTerminationSignalIfException sentry(actReg); // Pass in iSync to let the EventSetup system know which run and lumi // need to be processed and prepare IOVs for it. // Pass in the endIOVWaitingTasks so the lumi can notify them when the // lumi is done and no longer needs its EventSetup IOVs. - espController_->eventSetupForInstanceAsync( - iSync, queueLumiWorkTaskHolder, status->endIOVWaitingTasks(), status->eventSetupImpls()); + espController->eventSetupForInstanceAsync( + iSync, task, status->endIOVWaitingTasks(), status->eventSetupImpls()); sentry.completedSuccessfully(); } catch (...) { - queueLumiWorkTaskHolder.doneWaiting(std::current_exception()); + task.doneWaiting(std::current_exception()); } - queueWhichWaitsForIOVsToFinish_.pause(); - }); - - } else { - queueWhichWaitsForIOVsToFinish_.pause(); - - // This holder will be used to wait until the EventSetup IOVs are ready - WaitingTaskHolder queueLumiWorkTaskHolder{*iHolder.group(), queueLumiWorkTask}; - // Caught exception is propagated via WaitingTaskHolder - CMS_SA_ALLOW try { - SendSourceTerminationSignalIfException sentry(actReg_.get()); + }; + if (espController_->doWeNeedToWaitForIOVsToFinish(iSync)) { + // We only get here inside this block if there is an EventSetup + // module not able to handle concurrent IOVs (usually an ESSource) + // and the new sync value is outside the current IOV of that module. + auto group = nextTask.group(); + queueWhichWaitsForIOVsToFinish_.push( + *group, [this, task = std::move(nextTask), iSync, status, asyncEventSetup]() mutable { + asyncEventSetup( + actReg_.get(), espController_.get(), queueWhichWaitsForIOVsToFinish_, std::move(task), status, iSync); + }); + } else { + asyncEventSetup( + actReg_.get(), espController_.get(), queueWhichWaitsForIOVsToFinish_, std::move(nextTask), status, iSync); + } + }) | chain::then([this, status](std::exception_ptr const* iPtr, auto nextTask) { + //the call to doneWaiting will cause the count to decrement + auto copyTask = nextTask; + if (iPtr) { + nextTask.doneWaiting(*iPtr); + } + auto group = copyTask.group(); + lumiQueue_->pushAndPause( + *group, [this, task = std::move(copyTask), status](edm::LimitedTaskQueue::Resumer iResumer) mutable { + if (task.taskHasFailed()) { + status->resetResources(); + return; + } - // Pass in iSync to let the EventSetup system know which run and lumi - // need to be processed and prepare IOVs for it. - // Pass in the endIOVWaitingTasks so the lumi can notify them when the - // lumi is done and no longer needs its EventSetup IOVs. - espController_->eventSetupForInstanceAsync( - iSync, queueLumiWorkTaskHolder, status->endIOVWaitingTasks(), status->eventSetupImpls()); - sentry.completedSuccessfully(); + status->setResumer(std::move(iResumer)); + + auto group = task.group(); + sourceResourcesAcquirer_.serialQueueChain().push( + *group, [this, postQueueTask = std::move(task), status = std::move(status)]() mutable { + //make the services available + ServiceRegistry::Operate operate(serviceToken_); + // Caught exception is propagated via WaitingTaskHolder + CMS_SA_ALLOW try { + readLuminosityBlock(*status); + + LuminosityBlockPrincipal& lumiPrincipal = *status->lumiPrincipal(); + { + SendSourceTerminationSignalIfException sentry(actReg_.get()); + + input_->doBeginLumi(lumiPrincipal, &processContext_); + sentry.completedSuccessfully(); + } + + Service rng; + if (rng.isAvailable()) { + LuminosityBlock lb(lumiPrincipal, ModuleDescription(), nullptr, false); + rng->preBeginLumi(lb); + } + + EventSetupImpl const& es = status->eventSetupImpl(esp_->subProcessIndex()); + + using namespace edm::waiting_task::chain; + chain::first([this, status, &lumiPrincipal](auto nextTask) { + EventSetupImpl const& es = status->eventSetupImpl(esp_->subProcessIndex()); + { + LumiTransitionInfo transitionInfo(lumiPrincipal, es, &status->eventSetupImpls()); + using Traits = OccurrenceTraits; + beginGlobalTransitionAsync( + nextTask, *schedule_, transitionInfo, serviceToken_, subProcesses_); + } + }) | ifThen(looper_, [this, status, &es](auto nextTask) { + looper_->prefetchAsync( + nextTask, serviceToken_, Transition::BeginLuminosityBlock, *(status->lumiPrincipal()), es); + }) | ifThen(looper_, [this, status, &es](auto nextTask) { + status->globalBeginDidSucceed(); + //make the services available + ServiceRegistry::Operate operateLooper(serviceToken_); + looper_->doBeginLuminosityBlock(*(status->lumiPrincipal()), es, &processContext_); + }) | then([this, status](std::exception_ptr const* iPtr, auto holder) mutable { + if (iPtr) { + status->resetResources(); + holder.doneWaiting(*iPtr); + } else { + if (not looper_) { + status->globalBeginDidSucceed(); + } + EventSetupImpl const& es = status->eventSetupImpl(esp_->subProcessIndex()); + using Traits = OccurrenceTraits; + + for (unsigned int i = 0; i < preallocations_.numberOfStreams(); ++i) { + streamQueues_[i].push(*holder.group(), [this, i, status, holder, &es]() mutable { + streamQueues_[i].pause(); + + auto& event = principalCache_.eventPrincipal(i); + //We need to be sure that 'status' and its internal shared_ptr are only + // held by the container as this lambda may not finish executing before all the tasks it + // spawns have already started to run. + auto eventSetupImpls = &status->eventSetupImpls(); + auto lp = status->lumiPrincipal().get(); + streamLumiStatus_[i] = std::move(status); + ++streamLumiActive_; + event.setLuminosityBlockPrincipal(lp); + LumiTransitionInfo transitionInfo(*lp, es, eventSetupImpls); + using namespace edm::waiting_task::chain; + chain::first([this, i, &transitionInfo](auto nextTask) { + beginStreamTransitionAsync( + std::move(nextTask), *schedule_, i, transitionInfo, serviceToken_, subProcesses_); + }) | then([this, i](std::exception_ptr const* exceptionFromBeginStreamLumi, auto nextTask) { + if (exceptionFromBeginStreamLumi) { + WaitingTaskHolder tmp(nextTask); + tmp.doneWaiting(*exceptionFromBeginStreamLumi); + streamEndLumiAsync(nextTask, i); + } else { + handleNextEventForStreamAsync(std::move(nextTask), i); + } + }) | runLast(holder); + }); + } + } + }) | runLast(postQueueTask); - } catch (...) { - queueLumiWorkTaskHolder.doneWaiting(std::current_exception()); - } - } + } catch (...) { + status->resetResources(); + postQueueTask.doneWaiting(std::current_exception()); + } + }); // task in sourceResourcesAcquirer + }); + }) | chain::runLast(std::move(iHolder)); } void EventProcessor::continueLumiAsync(edm::WaitingTaskHolder iHolder) { @@ -1691,44 +1717,37 @@ namespace edm { } void EventProcessor::writeProcessBlockAsync(WaitingTaskHolder task, ProcessBlockType processBlockType) { - auto subsT = edm::make_waiting_task([this, task, processBlockType](std::exception_ptr const* iExcept) mutable { - if (iExcept) { - task.doneWaiting(*iExcept); - } else { - ServiceRegistry::Operate op(serviceToken_); - for (auto& s : subProcesses_) { - s.writeProcessBlockAsync(task, processBlockType); - } + using namespace edm::waiting_task; + chain::first([&](auto nextTask) { + ServiceRegistry::Operate op(serviceToken_); + schedule_->writeProcessBlockAsync( + nextTask, principalCache_.processBlockPrincipal(processBlockType), &processContext_, actReg_.get()); + }) | chain::ifThen(not subProcesses_.empty(), [this, processBlockType](auto nextTask) { + ServiceRegistry::Operate op(serviceToken_); + for (auto& s : subProcesses_) { + s.writeProcessBlockAsync(nextTask, processBlockType); } - }); - ServiceRegistry::Operate op(serviceToken_); - schedule_->writeProcessBlockAsync(WaitingTaskHolder(*task.group(), subsT), - principalCache_.processBlockPrincipal(processBlockType), - &processContext_, - actReg_.get()); + }) | chain::runLast(std::move(task)); } void EventProcessor::writeRunAsync(WaitingTaskHolder task, ProcessHistoryID const& phid, RunNumber_t run, MergeableRunProductMetadata const* mergeableRunProductMetadata) { - auto subsT = edm::make_waiting_task( - [this, phid, run, task, mergeableRunProductMetadata](std::exception_ptr const* iExcept) mutable { - if (iExcept) { - task.doneWaiting(*iExcept); - } else { - ServiceRegistry::Operate op(serviceToken_); - for (auto& s : subProcesses_) { - s.writeRunAsync(task, phid, run, mergeableRunProductMetadata); - } - } - }); - ServiceRegistry::Operate op(serviceToken_); - schedule_->writeRunAsync(WaitingTaskHolder(*task.group(), subsT), - principalCache_.runPrincipal(phid, run), - &processContext_, - actReg_.get(), - mergeableRunProductMetadata); + using namespace edm::waiting_task; + chain::first([&](auto nextTask) { + ServiceRegistry::Operate op(serviceToken_); + schedule_->writeRunAsync(nextTask, + principalCache_.runPrincipal(phid, run), + &processContext_, + actReg_.get(), + mergeableRunProductMetadata); + }) | chain::ifThen(not subProcesses_.empty(), [this, phid, run, mergeableRunProductMetadata](auto nextTask) { + ServiceRegistry::Operate op(serviceToken_); + for (auto& s : subProcesses_) { + s.writeRunAsync(nextTask, phid, run, mergeableRunProductMetadata); + } + }) | chain::runLast(std::move(task)); } void EventProcessor::deleteRunFromCache(ProcessHistoryID const& phid, RunNumber_t run) { @@ -1738,21 +1757,18 @@ namespace edm { } void EventProcessor::writeLumiAsync(WaitingTaskHolder task, LuminosityBlockPrincipal& lumiPrincipal) { - auto subsT = edm::make_waiting_task([this, task, &lumiPrincipal](std::exception_ptr const* iExcept) mutable { - if (iExcept) { - task.doneWaiting(*iExcept); - } else { - ServiceRegistry::Operate op(serviceToken_); - for (auto& s : subProcesses_) { - s.writeLumiAsync(task, lumiPrincipal); - } + using namespace edm::waiting_task; + chain::first([&](auto nextTask) { + ServiceRegistry::Operate op(serviceToken_); + + lumiPrincipal.runPrincipal().mergeableRunProductMetadata()->writeLumi(lumiPrincipal.luminosityBlock()); + schedule_->writeLumiAsync(nextTask, lumiPrincipal, &processContext_, actReg_.get()); + }) | chain::ifThen(not subProcesses_.empty(), [this, &lumiPrincipal](auto nextTask) { + ServiceRegistry::Operate op(serviceToken_); + for (auto& s : subProcesses_) { + s.writeLumiAsync(nextTask, lumiPrincipal); } - }); - ServiceRegistry::Operate op(serviceToken_); - - lumiPrincipal.runPrincipal().mergeableRunProductMetadata()->writeLumi(lumiPrincipal.luminosityBlock()); - - schedule_->writeLumiAsync(WaitingTaskHolder{*task.group(), subsT}, lumiPrincipal, &processContext_, actReg_.get()); + }) | chain::lastTask(std::move(task)); } void EventProcessor::deleteLumiFromCache(LuminosityBlockProcessingStatus& iStatus) { diff --git a/FWCore/Framework/src/EventSetupProvider.cc b/FWCore/Framework/src/EventSetupProvider.cc index d8527595f0d85..77357e5c836b7 100644 --- a/FWCore/Framework/src/EventSetupProvider.cc +++ b/FWCore/Framework/src/EventSetupProvider.cc @@ -27,8 +27,8 @@ #include "FWCore/Framework/interface/ModuleFactory.h" #include "FWCore/Framework/interface/ParameterSetIDHolder.h" #include "FWCore/Framework/interface/ESRecordsToProxyIndices.h" -#include "FWCore/Framework/src/EventSetupsController.h" -#include "FWCore/Framework/src/NumberOfConcurrentIOVs.h" +#include "FWCore/Framework/interface/EventSetupsController.h" +#include "FWCore/Framework/interface/NumberOfConcurrentIOVs.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "FWCore/Utilities/interface/Algorithms.h" diff --git a/FWCore/Framework/src/EventSetupRecordIOVQueue.cc b/FWCore/Framework/src/EventSetupRecordIOVQueue.cc index f102f0e06d058..7870a7b03eb12 100644 --- a/FWCore/Framework/src/EventSetupRecordIOVQueue.cc +++ b/FWCore/Framework/src/EventSetupRecordIOVQueue.cc @@ -7,7 +7,7 @@ // Author: W. David Dagenhart // Created: 22 Feb 2019 -#include "FWCore/Framework/src/EventSetupRecordIOVQueue.h" +#include "FWCore/Framework/interface/EventSetupRecordIOVQueue.h" #include "FWCore/Framework/interface/EventSetupRecordProvider.h" #include "FWCore/Concurrency/interface/WaitingTask.h" #include "FWCore/Utilities/interface/EDMException.h" diff --git a/FWCore/Framework/src/EventSetupsController.cc b/FWCore/Framework/src/EventSetupsController.cc index 254d5c17782da..139ad2a348cfb 100644 --- a/FWCore/Framework/src/EventSetupsController.cc +++ b/FWCore/Framework/src/EventSetupsController.cc @@ -10,7 +10,7 @@ // Created: Wed Jan 12 14:30:44 CST 2011 // -#include "FWCore/Framework/src/EventSetupsController.h" +#include "FWCore/Framework/interface/EventSetupsController.h" #include "FWCore/Concurrency/interface/WaitingTaskHolder.h" #include "FWCore/Concurrency/interface/WaitingTaskList.h" diff --git a/FWCore/Framework/src/Factory.cc b/FWCore/Framework/src/Factory.cc index f3568e0b5c9d1..980b3cf35fd8a 100644 --- a/FWCore/Framework/src/Factory.cc +++ b/FWCore/Framework/src/Factory.cc @@ -1,5 +1,6 @@ #include "FWCore/Framework/src/Factory.h" +#include "FWCore/Framework/interface/maker/MakerPluginFactory.h" #include "FWCore/Utilities/interface/DebugMacros.h" #include "FWCore/Utilities/interface/EDMException.h" #include "FWCore/Utilities/interface/Algorithms.h" diff --git a/FWCore/Framework/src/Factory.h b/FWCore/Framework/src/Factory.h index 4b39654f3a277..67fbc04355a81 100644 --- a/FWCore/Framework/src/Factory.h +++ b/FWCore/Framework/src/Factory.h @@ -1,10 +1,9 @@ #ifndef FWCore_Framework_Factory_h #define FWCore_Framework_Factory_h -#include "FWCore/PluginManager/interface/PluginFactory.h" -#include "FWCore/Framework/src/Worker.h" -#include "FWCore/Framework/src/WorkerMaker.h" -#include "FWCore/Framework/src/MakeModuleParams.h" +#include "FWCore/Framework/interface/maker/Worker.h" +#include "FWCore/Framework/interface/maker/WorkerMaker.h" +#include "FWCore/Framework/interface/maker/MakeModuleParams.h" #include #include @@ -14,8 +13,6 @@ #include "FWCore/Utilities/interface/thread_safety_macros.h" namespace edm { - typedef edmplugin::PluginFactory MakerPluginFactory; - class Factory { public: typedef std::map> MakerMap; diff --git a/FWCore/Framework/src/GlobalSchedule.cc b/FWCore/Framework/src/GlobalSchedule.cc index 4d831c798a9aa..453ea07e285cc 100644 --- a/FWCore/Framework/src/GlobalSchedule.cc +++ b/FWCore/Framework/src/GlobalSchedule.cc @@ -1,9 +1,9 @@ -#include "FWCore/Framework/src/GlobalSchedule.h" -#include "FWCore/Framework/src/WorkerMaker.h" +#include "FWCore/Framework/interface/GlobalSchedule.h" +#include "FWCore/Framework/interface/maker/WorkerMaker.h" #include "FWCore/Framework/src/TriggerResultInserter.h" #include "FWCore/Framework/src/PathStatusInserter.h" #include "FWCore/Framework/src/EndPathStatusInserter.h" -#include "FWCore/Framework/src/PreallocationConfiguration.h" +#include "FWCore/Framework/interface/PreallocationConfiguration.h" #include "DataFormats/Provenance/interface/ProcessConfiguration.h" #include "DataFormats/Provenance/interface/ProductRegistry.h" diff --git a/FWCore/Framework/src/InputSourceFactory.cc b/FWCore/Framework/src/InputSourceFactory.cc index 111337ed1582e..5628035036fd1 100644 --- a/FWCore/Framework/src/InputSourceFactory.cc +++ b/FWCore/Framework/src/InputSourceFactory.cc @@ -1,5 +1,5 @@ -#include "FWCore/Framework/src/InputSourceFactory.h" +#include "FWCore/Framework/interface/maker/InputSourceFactory.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "FWCore/Utilities/interface/DebugMacros.h" #include "FWCore/Utilities/interface/EDMException.h" diff --git a/FWCore/Framework/src/LuminosityBlock.cc b/FWCore/Framework/src/LuminosityBlock.cc index 1deedf0230ba8..b607ca9acca60 100644 --- a/FWCore/Framework/src/LuminosityBlock.cc +++ b/FWCore/Framework/src/LuminosityBlock.cc @@ -2,8 +2,8 @@ #include "FWCore/Framework/interface/LuminosityBlockPrincipal.h" #include "FWCore/Framework/interface/Run.h" -#include "FWCore/Framework/src/TransitionInfoTypes.h" -#include "FWCore/Framework/src/ProductPutterBase.h" +#include "FWCore/Framework/interface/TransitionInfoTypes.h" +#include "FWCore/Framework/interface/ProductPutterBase.h" #include "FWCore/Utilities/interface/Algorithms.h" #include "FWCore/Utilities/interface/get_underlying_safe.h" diff --git a/FWCore/Framework/src/LuminosityBlockForOutput.cc b/FWCore/Framework/src/LuminosityBlockForOutput.cc index fa9a946ca9d21..7e22298c8e074 100644 --- a/FWCore/Framework/src/LuminosityBlockForOutput.cc +++ b/FWCore/Framework/src/LuminosityBlockForOutput.cc @@ -2,7 +2,7 @@ #include "FWCore/Framework/interface/LuminosityBlockPrincipal.h" #include "FWCore/Framework/interface/RunForOutput.h" -#include "FWCore/Framework/src/TransitionInfoTypes.h" +#include "FWCore/Framework/interface/TransitionInfoTypes.h" #include "FWCore/Utilities/interface/Algorithms.h" #include "FWCore/Utilities/interface/get_underlying_safe.h" diff --git a/FWCore/Framework/src/LuminosityBlockPrincipal.cc b/FWCore/Framework/src/LuminosityBlockPrincipal.cc index e713688b4a065..63994ccb77de9 100644 --- a/FWCore/Framework/src/LuminosityBlockPrincipal.cc +++ b/FWCore/Framework/src/LuminosityBlockPrincipal.cc @@ -1,5 +1,5 @@ #include "FWCore/Framework/interface/LuminosityBlockPrincipal.h" -#include "FWCore/Framework/src/ProductPutterBase.h" +#include "FWCore/Framework/interface/ProductPutterBase.h" #include "DataFormats/Provenance/interface/ProductRegistry.h" namespace edm { diff --git a/FWCore/Framework/src/ModuleFactory.cc b/FWCore/Framework/src/ModuleFactory.cc index 9f9505f05f6c4..dfde3415b8962 100644 --- a/FWCore/Framework/src/ModuleFactory.cc +++ b/FWCore/Framework/src/ModuleFactory.cc @@ -15,7 +15,7 @@ // user include files #include "FWCore/Framework/interface/ModuleFactory.h" #include "FWCore/Framework/interface/EventSetupProvider.h" -#include "FWCore/Framework/src/EventSetupsController.h" +#include "FWCore/Framework/interface/EventSetupsController.h" // // constants, enums and typedefs diff --git a/FWCore/Framework/src/ModuleHolder.cc b/FWCore/Framework/src/ModuleHolder.cc index 22f25d038faeb..ec82fbb843001 100644 --- a/FWCore/Framework/src/ModuleHolder.cc +++ b/FWCore/Framework/src/ModuleHolder.cc @@ -13,8 +13,8 @@ // system include files // user include files -#include "FWCore/Framework/src/ModuleHolder.h" -#include "FWCore/Framework/src/WorkerMaker.h" +#include "FWCore/Framework/interface/maker/ModuleHolder.h" +#include "FWCore/Framework/interface/maker/WorkerMaker.h" namespace edm { namespace maker { @@ -22,4 +22,4 @@ namespace edm { return m_maker->makeWorker(iActions, this); } } // namespace maker -} // namespace edm \ No newline at end of file +} // namespace edm diff --git a/FWCore/Framework/src/ModuleRegistry.cc b/FWCore/Framework/src/ModuleRegistry.cc index c83762beb7640..590348918e100 100644 --- a/FWCore/Framework/src/ModuleRegistry.cc +++ b/FWCore/Framework/src/ModuleRegistry.cc @@ -13,7 +13,7 @@ // system include files // user include files -#include "FWCore/Framework/src/ModuleRegistry.h" +#include "FWCore/Framework/interface/ModuleRegistry.h" #include "FWCore/Framework/src/Factory.h" namespace edm { diff --git a/FWCore/Framework/src/NoRecordException.cc b/FWCore/Framework/src/NoRecordException.cc index 8d72b2540a9b4..1d6c21a7da76e 100644 --- a/FWCore/Framework/src/NoRecordException.cc +++ b/FWCore/Framework/src/NoRecordException.cc @@ -26,10 +26,10 @@ bool edm::eventsetup::recordDoesExist(EventSetupImpl const& iES, EventSetupRecor void edm::eventsetup::no_record_exception_message_builder(cms::Exception& oException, const char* iName, bool iKnownRecord) { - oException << "No \"" << iName << "\" record found in the EventSetup.n"; + oException << "No \"" << iName << "\" record found in the EventSetup.\n"; if (iKnownRecord) { oException << "\n The Record is delivered by an ESSource or ESProducer but there is no valid IOV for the " - "synchronizatio value.\n" + "synchronization value.\n" " Please check \n" " a) if the synchronization value is reasonable and report to the hypernews if it is not.\n" " b) else check that all ESSources have been properly configured. \n"; diff --git a/FWCore/Framework/src/NumberOfConcurrentIOVs.cc b/FWCore/Framework/src/NumberOfConcurrentIOVs.cc index c61b37d1de0a4..80ed3878b8d72 100644 --- a/FWCore/Framework/src/NumberOfConcurrentIOVs.cc +++ b/FWCore/Framework/src/NumberOfConcurrentIOVs.cc @@ -1,5 +1,5 @@ -#include "FWCore/Framework/src/NumberOfConcurrentIOVs.h" +#include "FWCore/Framework/interface/NumberOfConcurrentIOVs.h" #include "FWCore/Framework/interface/EventSetupProvider.h" #include "FWCore/Framework/interface/HCTypeTag.h" diff --git a/FWCore/Framework/src/OutputModuleCommunicator.cc b/FWCore/Framework/src/OutputModuleCommunicator.cc index 3fe8b89951498..2fb3881fada15 100644 --- a/FWCore/Framework/src/OutputModuleCommunicator.cc +++ b/FWCore/Framework/src/OutputModuleCommunicator.cc @@ -13,7 +13,7 @@ // system include files // user include files -#include "FWCore/Framework/src/OutputModuleCommunicator.h" +#include "FWCore/Framework/interface/OutputModuleCommunicator.h" using namespace edm; diff --git a/FWCore/Framework/src/OutputModuleCommunicatorT.cc b/FWCore/Framework/src/OutputModuleCommunicatorT.cc index 8bf00d3ff3e66..a7035c178faa3 100644 --- a/FWCore/Framework/src/OutputModuleCommunicatorT.cc +++ b/FWCore/Framework/src/OutputModuleCommunicatorT.cc @@ -15,7 +15,7 @@ #include "FWCore/Utilities/interface/LuminosityBlockIndex.h" #include "FWCore/Utilities/interface/make_sentry.h" -#include "FWCore/Framework/src/OutputModuleCommunicatorT.h" +#include "FWCore/Framework/interface/OutputModuleCommunicatorT.h" #include "FWCore/Framework/interface/global/OutputModuleBase.h" #include "FWCore/Framework/interface/one/OutputModuleBase.h" diff --git a/FWCore/Framework/src/Path.cc b/FWCore/Framework/src/Path.cc index 5545644c010a4..8dbcfa65b272e 100644 --- a/FWCore/Framework/src/Path.cc +++ b/FWCore/Framework/src/Path.cc @@ -1,11 +1,11 @@ -#include "FWCore/Framework/src/Path.h" +#include "FWCore/Framework/interface/Path.h" #include "FWCore/Framework/interface/EventPrincipal.h" #include "FWCore/Framework/interface/ExceptionActions.h" #include "FWCore/Framework/interface/OccurrenceTraits.h" -#include "FWCore/Framework/src/EarlyDeleteHelper.h" +#include "FWCore/Framework/interface/EarlyDeleteHelper.h" #include "FWCore/Framework/src/PathStatusInserter.h" -#include "FWCore/Framework/src/TransitionInfoTypes.h" +#include "FWCore/Framework/interface/TransitionInfoTypes.h" #include "FWCore/ServiceRegistry/interface/ParentContext.h" #include "FWCore/Utilities/interface/Algorithms.h" #include "FWCore/MessageLogger/interface/ExceptionMessages.h" diff --git a/FWCore/Framework/src/PathStatusInserter.cc b/FWCore/Framework/src/PathStatusInserter.cc index 8a9d9e61e0e24..4917fbecf5c25 100644 --- a/FWCore/Framework/src/PathStatusInserter.cc +++ b/FWCore/Framework/src/PathStatusInserter.cc @@ -7,7 +7,7 @@ namespace edm { PathStatusInserter::PathStatusInserter(unsigned int numberOfStreams) - : hltPathStatus_(numberOfStreams), token_{produces()} {} + : hltPathStatus_(numberOfStreams), token_{produces()} {} void PathStatusInserter::setPathStatus(StreamID const& streamID, HLTPathStatus const& hltPathStatus) { hltPathStatus_[streamID.value()] = hltPathStatus; diff --git a/FWCore/Framework/src/PathsAndConsumesOfModules.cc b/FWCore/Framework/src/PathsAndConsumesOfModules.cc index 86d57a4b4f964..ff4c083eeccbb 100644 --- a/FWCore/Framework/src/PathsAndConsumesOfModules.cc +++ b/FWCore/Framework/src/PathsAndConsumesOfModules.cc @@ -2,7 +2,7 @@ #include "FWCore/Framework/interface/Schedule.h" #include "FWCore/Framework/interface/ModuleProcessName.h" -#include "FWCore/Framework/src/Worker.h" +#include "FWCore/Framework/interface/maker/Worker.h" #include "FWCore/Utilities/interface/EDMException.h" diff --git a/FWCore/Framework/src/Principal.cc b/FWCore/Framework/src/Principal.cc index f249137aa2be1..beefa28fe9424 100644 --- a/FWCore/Framework/src/Principal.cc +++ b/FWCore/Framework/src/Principal.cc @@ -10,7 +10,7 @@ #include "FWCore/Framework/interface/DelayedReader.h" #include "FWCore/Framework/interface/HistoryAppender.h" #include "FWCore/Framework/src/ProductDeletedException.h" -#include "FWCore/Framework/src/ProductPutterBase.h" +#include "FWCore/Framework/interface/ProductPutterBase.h" #include "FWCore/Framework/interface/EDConsumerBase.h" #include "ProductResolvers.h" #include "FWCore/Utilities/interface/EDMException.h" diff --git a/FWCore/Framework/src/PrincipalCache.cc b/FWCore/Framework/src/PrincipalCache.cc index eadcfc5e785c8..6f1f6cea7c4c4 100644 --- a/FWCore/Framework/src/PrincipalCache.cc +++ b/FWCore/Framework/src/PrincipalCache.cc @@ -1,10 +1,10 @@ -#include "FWCore/Framework/src/PrincipalCache.h" +#include "FWCore/Framework/interface/PrincipalCache.h" #include "FWCore/Framework/interface/EventPrincipal.h" #include "FWCore/Framework/interface/LuminosityBlockPrincipal.h" #include "FWCore/Framework/interface/ProcessBlockPrincipal.h" #include "FWCore/Framework/interface/RunPrincipal.h" -#include "FWCore/Framework/src/PreallocationConfiguration.h" +#include "FWCore/Framework/interface/PreallocationConfiguration.h" #include "FWCore/Utilities/interface/EDMException.h" #include "DataFormats/Provenance/interface/ProcessHistoryRegistry.h" diff --git a/FWCore/Framework/src/ProcessBlock.cc b/FWCore/Framework/src/ProcessBlock.cc index e98a33e38ca63..0203b00f10f3f 100644 --- a/FWCore/Framework/src/ProcessBlock.cc +++ b/FWCore/Framework/src/ProcessBlock.cc @@ -1,6 +1,6 @@ #include "FWCore/Framework/interface/ProcessBlock.h" #include "FWCore/Framework/interface/ProcessBlockPrincipal.h" -#include "FWCore/Framework/src/ProductPutterBase.h" +#include "FWCore/Framework/interface/ProductPutterBase.h" namespace edm { diff --git a/FWCore/Framework/src/ProcessBlockPrincipal.cc b/FWCore/Framework/src/ProcessBlockPrincipal.cc index a17c489402d52..2fd05a2a36478 100644 --- a/FWCore/Framework/src/ProcessBlockPrincipal.cc +++ b/FWCore/Framework/src/ProcessBlockPrincipal.cc @@ -1,5 +1,5 @@ #include "FWCore/Framework/interface/ProcessBlockPrincipal.h" -#include "FWCore/Framework/src/ProductPutterBase.h" +#include "FWCore/Framework/interface/ProductPutterBase.h" #include "DataFormats/Provenance/interface/ProductRegistry.h" #include "DataFormats/Provenance/interface/BranchType.h" diff --git a/FWCore/Framework/src/ProductResolvers.cc b/FWCore/Framework/src/ProductResolvers.cc index 17832689a4af6..23b2e65c602a7 100644 --- a/FWCore/Framework/src/ProductResolvers.cc +++ b/FWCore/Framework/src/ProductResolvers.cc @@ -1,15 +1,15 @@ /*---------------------------------------------------------------------- ----------------------------------------------------------------------*/ #include "ProductResolvers.h" -#include "Worker.h" -#include "UnscheduledAuxiliary.h" +#include "FWCore/Framework/interface/maker/Worker.h" +#include "FWCore/Framework/interface/UnscheduledAuxiliary.h" #include "UnscheduledConfigurator.h" #include "FWCore/Framework/interface/EventPrincipal.h" #include "FWCore/Framework/interface/MergeableRunProductMetadata.h" #include "FWCore/Framework/src/ProductDeletedException.h" #include "FWCore/Framework/interface/SharedResourcesAcquirer.h" #include "FWCore/Framework/interface/DelayedReader.h" -#include "FWCore/Framework/src/TransitionInfoTypes.h" +#include "FWCore/Framework/interface/TransitionInfoTypes.h" #include "FWCore/Framework/interface/ProductProvenanceRetriever.h" #include "DataFormats/Provenance/interface/BranchKey.h" #include "DataFormats/Provenance/interface/ParentageRegistry.h" diff --git a/FWCore/Framework/src/ProductResolvers.h b/FWCore/Framework/src/ProductResolvers.h index bd4326d36a121..2c93aa1e9a6bc 100644 --- a/FWCore/Framework/src/ProductResolvers.h +++ b/FWCore/Framework/src/ProductResolvers.h @@ -8,7 +8,7 @@ a set of related EDProducts. This is the storage unit of such information. ----------------------------------------------------------------------*/ #include "FWCore/Framework/interface/ProductResolverBase.h" -#include "FWCore/Framework/src/ProductPutterBase.h" +#include "FWCore/Framework/interface/ProductPutterBase.h" #include "FWCore/Framework/src/ProductPutOrMergerBase.h" #include "DataFormats/Common/interface/WrapperBase.h" #include "DataFormats/Common/interface/ProductData.h" diff --git a/FWCore/Framework/src/Run.cc b/FWCore/Framework/src/Run.cc index 27d9590b80495..30719cf2afa58 100644 --- a/FWCore/Framework/src/Run.cc +++ b/FWCore/Framework/src/Run.cc @@ -1,8 +1,8 @@ #include "FWCore/Framework/interface/Run.h" #include "FWCore/Framework/interface/RunPrincipal.h" -#include "FWCore/Framework/src/TransitionInfoTypes.h" -#include "FWCore/Framework/src/ProductPutterBase.h" +#include "FWCore/Framework/interface/TransitionInfoTypes.h" +#include "FWCore/Framework/interface/ProductPutterBase.h" #include "FWCore/Utilities/interface/Algorithms.h" #include "FWCore/Utilities/interface/get_underlying_safe.h" diff --git a/FWCore/Framework/src/RunForOutput.cc b/FWCore/Framework/src/RunForOutput.cc index b07c210b24943..9b4843b2c7fe0 100644 --- a/FWCore/Framework/src/RunForOutput.cc +++ b/FWCore/Framework/src/RunForOutput.cc @@ -1,7 +1,7 @@ #include "FWCore/Framework/interface/RunForOutput.h" #include "FWCore/Framework/interface/RunPrincipal.h" -#include "FWCore/Framework/src/TransitionInfoTypes.h" +#include "FWCore/Framework/interface/TransitionInfoTypes.h" #include "FWCore/Utilities/interface/Algorithms.h" #include "FWCore/Utilities/interface/get_underlying_safe.h" diff --git a/FWCore/Framework/src/RunPrincipal.cc b/FWCore/Framework/src/RunPrincipal.cc index b49e4ece31207..d7de344253e90 100644 --- a/FWCore/Framework/src/RunPrincipal.cc +++ b/FWCore/Framework/src/RunPrincipal.cc @@ -4,7 +4,7 @@ #include "DataFormats/Provenance/interface/ProductRegistry.h" #include "FWCore/Framework/interface/ProductResolverBase.h" #include "FWCore/Framework/interface/MergeableRunProductMetadata.h" -#include "FWCore/Framework/src/ProductPutterBase.h" +#include "FWCore/Framework/interface/ProductPutterBase.h" #include "FWCore/Framework/src/ProductPutOrMergerBase.h" namespace edm { diff --git a/FWCore/Framework/src/Schedule.cc b/FWCore/Framework/src/Schedule.cc index d5dc57141d566..8c30a26a14ddf 100644 --- a/FWCore/Framework/src/Schedule.cc +++ b/FWCore/Framework/src/Schedule.cc @@ -10,19 +10,20 @@ #include "FWCore/Common/interface/ProcessBlockHelper.h" #include "FWCore/Framework/interface/EDConsumerBase.h" #include "FWCore/Framework/src/OutputModuleDescription.h" -#include "FWCore/Framework/src/SubProcess.h" +#include "FWCore/Framework/interface/SubProcess.h" #include "FWCore/Framework/interface/TriggerNamesService.h" #include "FWCore/Framework/src/TriggerReport.h" #include "FWCore/Framework/src/TriggerTimingReport.h" -#include "FWCore/Framework/src/PreallocationConfiguration.h" +#include "FWCore/Framework/interface/PreallocationConfiguration.h" #include "FWCore/Framework/src/Factory.h" -#include "FWCore/Framework/src/OutputModuleCommunicator.h" -#include "FWCore/Framework/src/ModuleHolder.h" -#include "FWCore/Framework/src/ModuleRegistry.h" +#include "FWCore/Framework/interface/OutputModuleCommunicator.h" +#include "FWCore/Framework/interface/maker/ModuleHolder.h" +#include "FWCore/Framework/interface/ModuleRegistry.h" #include "FWCore/Framework/src/TriggerResultInserter.h" #include "FWCore/Framework/src/PathStatusInserter.h" #include "FWCore/Framework/src/EndPathStatusInserter.h" #include "FWCore/Concurrency/interface/WaitingTaskHolder.h" +#include "FWCore/Concurrency/interface/chain_first.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "FWCore/ParameterSet/interface/ParameterSetDescription.h" @@ -648,6 +649,18 @@ namespace edm { } } }; + + template + auto doCleanup(F&& iF) { + auto wrapped = [f = std::move(iF)](std::exception_ptr const* iPtr, edm::WaitingTaskHolder iTask) { + CMS_SA_ALLOW try { f(); } catch (...) { + } + if (iPtr) { + iTask.doneWaiting(*iPtr); + } + }; + return wrapped; + } } // namespace // ----------------------------- @@ -1239,30 +1252,25 @@ namespace edm { LuminosityBlockIndex::invalidLuminosityBlockIndex(), rp.endTime(), processContext); - auto t = - make_waiting_task([task, activityRegistry, globalContext, token](std::exception_ptr const* iExcept) mutable { - // Propagating the exception would be nontrivial, and signal actions are not supposed to throw exceptions - CMS_SA_ALLOW try { - //services can depend on other services - ServiceRegistry::Operate op(token); - - activityRegistry->postGlobalWriteRunSignal_(globalContext); - } catch (...) { - } - std::exception_ptr ptr; - if (iExcept) { - ptr = *iExcept; - } - task.doneWaiting(ptr); - }); - // Propagating the exception would be nontrivial, and signal actions are not supposed to throw exceptions - CMS_SA_ALLOW try { activityRegistry->preGlobalWriteRunSignal_(globalContext); } catch (...) { - } - WaitingTaskHolder tHolder(*task.group(), t); - for (auto& c : all_output_communicators_) { - c->writeRunAsync(tHolder, rp, processContext, activityRegistry, mergeableRunProductMetadata); - } + using namespace edm::waiting_task; + chain::first([&](auto nextTask) { + //services can depend on other services + ServiceRegistry::Operate op(token); + + // Propagating the exception would be nontrivial, and signal actions are not supposed to throw exceptions + CMS_SA_ALLOW try { activityRegistry->preGlobalWriteRunSignal_(globalContext); } catch (...) { + } + for (auto& c : all_output_communicators_) { + c->writeRunAsync(nextTask, rp, processContext, activityRegistry, mergeableRunProductMetadata); + } + }) | chain::then(doCleanup([activityRegistry, globalContext, token]() { + //services can depend on other services + ServiceRegistry::Operate op(token); + + activityRegistry->postGlobalWriteRunSignal_(globalContext); + })) | + chain::runLast(task); } void Schedule::writeProcessBlockAsync(WaitingTaskHolder task, @@ -1277,30 +1285,22 @@ namespace edm { Timestamp::invalidTimestamp(), processContext); - auto t = - make_waiting_task([task, activityRegistry, globalContext, token](std::exception_ptr const* iExcept) mutable { - // Propagating the exception would be nontrivial, and signal actions are not supposed to throw exceptions - CMS_SA_ALLOW try { - //services can depend on other services - ServiceRegistry::Operate op(token); - - activityRegistry->postWriteProcessBlockSignal_(globalContext); - } catch (...) { - } - std::exception_ptr ptr; - if (iExcept) { - ptr = *iExcept; - } - task.doneWaiting(ptr); - }); - // Propagating the exception would be nontrivial, and signal actions are not supposed to throw exceptions - CMS_SA_ALLOW try { activityRegistry->preWriteProcessBlockSignal_(globalContext); } catch (...) { - } - WaitingTaskHolder tHolder(*task.group(), t); + using namespace edm::waiting_task; + chain::first([&](auto nextTask) { + // Propagating the exception would be nontrivial, and signal actions are not supposed to throw exceptions + ServiceRegistry::Operate op(token); + CMS_SA_ALLOW try { activityRegistry->preWriteProcessBlockSignal_(globalContext); } catch (...) { + } + for (auto& c : all_output_communicators_) { + c->writeProcessBlockAsync(nextTask, pbp, processContext, activityRegistry); + } + }) | chain::then(doCleanup([activityRegistry, globalContext, token]() { + //services can depend on other services + ServiceRegistry::Operate op(token); - for (auto& c : all_output_communicators_) { - c->writeProcessBlockAsync(tHolder, pbp, processContext, activityRegistry); - } + activityRegistry->postWriteProcessBlockSignal_(globalContext); + })) | + chain::runLast(std::move(task)); } void Schedule::writeLumiAsync(WaitingTaskHolder task, @@ -1315,29 +1315,21 @@ namespace edm { lbp.beginTime(), processContext); - auto t = - make_waiting_task([task, activityRegistry, globalContext, token](std::exception_ptr const* iExcept) mutable { - // Propagating the exception would be nontrivial, and signal actions are not supposed to throw exceptions - CMS_SA_ALLOW try { - //services can depend on other services - ServiceRegistry::Operate op(token); + using namespace edm::waiting_task; + chain::first([&](auto nextTask) { + ServiceRegistry::Operate op(token); + CMS_SA_ALLOW try { activityRegistry->preGlobalWriteLumiSignal_(globalContext); } catch (...) { + } + for (auto& c : all_output_communicators_) { + c->writeLumiAsync(nextTask, lbp, processContext, activityRegistry); + } + }) | chain::then(doCleanup([activityRegistry, globalContext, token]() { + //services can depend on other services + ServiceRegistry::Operate op(token); - activityRegistry->postGlobalWriteLumiSignal_(globalContext); - } catch (...) { - } - std::exception_ptr ptr; - if (iExcept) { - ptr = *iExcept; - } - task.doneWaiting(ptr); - }); - // Propagating the exception would be nontrivial, and signal actions are not supposed to throw exceptions - CMS_SA_ALLOW try { activityRegistry->preGlobalWriteLumiSignal_(globalContext); } catch (...) { - } - WaitingTaskHolder tHolder(*task.group(), t); - for (auto& c : all_output_communicators_) { - c->writeLumiAsync(tHolder, lbp, processContext, activityRegistry); - } + activityRegistry->postGlobalWriteLumiSignal_(globalContext); + })) | + chain::runLast(task); } bool Schedule::shouldWeCloseOutput() const { diff --git a/FWCore/Framework/src/ScheduleItems.cc b/FWCore/Framework/src/ScheduleItems.cc index 5e1bc2348f3a3..df0e1ad007131 100644 --- a/FWCore/Framework/src/ScheduleItems.cc +++ b/FWCore/Framework/src/ScheduleItems.cc @@ -10,10 +10,10 @@ #include "FWCore/Framework/interface/ExceptionActions.h" #include "FWCore/Framework/src/CommonParams.h" #include "FWCore/Framework/interface/ConstProductRegistry.h" -#include "FWCore/Framework/src/SubProcess.h" +#include "FWCore/Framework/interface/SubProcess.h" #include "FWCore/Framework/interface/Schedule.h" #include "FWCore/Framework/interface/TriggerNamesService.h" -#include "FWCore/Framework/src/SignallingProductRegistry.h" +#include "FWCore/Framework/interface/SignallingProductRegistry.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "FWCore/ServiceRegistry/interface/ActivityRegistry.h" #include "FWCore/ServiceRegistry/interface/ServiceRegistry.h" diff --git a/FWCore/Framework/src/SharedResourcesRegistry.cc b/FWCore/Framework/src/SharedResourcesRegistry.cc index 8d5543b162d5e..752f079f52f6d 100644 --- a/FWCore/Framework/src/SharedResourcesRegistry.cc +++ b/FWCore/Framework/src/SharedResourcesRegistry.cc @@ -15,7 +15,7 @@ #include // user include files -#include "SharedResourcesRegistry.h" +#include "FWCore/Framework/interface/SharedResourcesRegistry.h" #include "FWCore/Framework/interface/SharedResourcesAcquirer.h" namespace edm { diff --git a/FWCore/Framework/src/SignallingProductRegistry.cc b/FWCore/Framework/src/SignallingProductRegistry.cc index acf2c13b29f89..9554fcdd769d4 100644 --- a/FWCore/Framework/src/SignallingProductRegistry.cc +++ b/FWCore/Framework/src/SignallingProductRegistry.cc @@ -13,7 +13,7 @@ // system include files // user include files -#include "FWCore/Framework/src/SignallingProductRegistry.h" +#include "FWCore/Framework/interface/SignallingProductRegistry.h" #include "FWCore/Utilities/interface/Exception.h" using namespace edm; diff --git a/FWCore/Framework/src/SourceFactory.cc b/FWCore/Framework/src/SourceFactory.cc index 81b8c93e782e8..4e430e80870d8 100644 --- a/FWCore/Framework/src/SourceFactory.cc +++ b/FWCore/Framework/src/SourceFactory.cc @@ -14,7 +14,7 @@ // user include files #include "FWCore/Framework/interface/SourceFactory.h" -#include "FWCore/Framework/src/EventSetupsController.h" +#include "FWCore/Framework/interface/EventSetupsController.h" #include "FWCore/Utilities/interface/EDMException.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" diff --git a/FWCore/Framework/src/StreamSchedule.cc b/FWCore/Framework/src/StreamSchedule.cc index 32ea3b58d7ae7..43f518d75c1b9 100644 --- a/FWCore/Framework/src/StreamSchedule.cc +++ b/FWCore/Framework/src/StreamSchedule.cc @@ -1,4 +1,4 @@ -#include "FWCore/Framework/src/StreamSchedule.h" +#include "FWCore/Framework/interface/StreamSchedule.h" #include "DataFormats/Provenance/interface/BranchIDListHelper.h" #include "DataFormats/Provenance/interface/ProcessConfiguration.h" @@ -8,14 +8,14 @@ #include "FWCore/Framework/src/TriggerReport.h" #include "FWCore/Framework/src/TriggerTimingReport.h" #include "FWCore/Framework/src/Factory.h" -#include "FWCore/Framework/src/OutputModuleCommunicator.h" +#include "FWCore/Framework/interface/OutputModuleCommunicator.h" #include "FWCore/Framework/src/TriggerResultInserter.h" #include "FWCore/Framework/src/PathStatusInserter.h" #include "FWCore/Framework/src/EndPathStatusInserter.h" -#include "FWCore/Framework/src/WorkerInPath.h" -#include "FWCore/Framework/src/ModuleHolder.h" -#include "FWCore/Framework/src/WorkerT.h" -#include "FWCore/Framework/src/ModuleRegistry.h" +#include "FWCore/Framework/interface/WorkerInPath.h" +#include "FWCore/Framework/interface/maker/ModuleHolder.h" +#include "FWCore/Framework/interface/maker/WorkerT.h" +#include "FWCore/Framework/interface/ModuleRegistry.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "FWCore/ParameterSet/interface/ParameterSetDescription.h" diff --git a/FWCore/Framework/src/SubProcess.cc b/FWCore/Framework/src/SubProcess.cc index ab3e793ebe01d..30840f4535d5b 100644 --- a/FWCore/Framework/src/SubProcess.cc +++ b/FWCore/Framework/src/SubProcess.cc @@ -1,4 +1,4 @@ -#include "FWCore/Framework/src/SubProcess.h" +#include "FWCore/Framework/interface/SubProcess.h" #include "DataFormats/Common/interface/ThinnedAssociation.h" #include "DataFormats/Provenance/interface/BranchIDListHelper.h" @@ -24,12 +24,12 @@ #include "FWCore/Framework/interface/getAllTriggerNames.h" #include "FWCore/Framework/interface/TriggerNamesService.h" #include "FWCore/Framework/interface/ScheduleItems.h" -#include "FWCore/Framework/src/EventSetupsController.h" -#include "FWCore/Framework/src/SignallingProductRegistry.h" -#include "FWCore/Framework/src/PreallocationConfiguration.h" -#include "FWCore/Framework/src/streamTransitionAsync.h" -#include "FWCore/Framework/src/TransitionInfoTypes.h" -#include "FWCore/Framework/src/globalTransitionAsync.h" +#include "FWCore/Framework/interface/EventSetupsController.h" +#include "FWCore/Framework/interface/SignallingProductRegistry.h" +#include "FWCore/Framework/interface/PreallocationConfiguration.h" +#include "FWCore/Framework/interface/streamTransitionAsync.h" +#include "FWCore/Framework/interface/TransitionInfoTypes.h" +#include "FWCore/Framework/interface/globalTransitionAsync.h" #include "FWCore/Framework/interface/ESRecordsToProxyIndices.h" #include "FWCore/ParameterSet/interface/IllegalParameters.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" @@ -37,6 +37,7 @@ #include "FWCore/ServiceRegistry/interface/ActivityRegistry.h" #include "FWCore/Concurrency/interface/WaitingTaskHolder.h" #include "FWCore/Concurrency/interface/WaitingTask.h" +#include "FWCore/Concurrency/interface/chain_first.h" #include "FWCore/Utilities/interface/ExceptionCollector.h" #include "boost/range/adaptor/reversed.hpp" @@ -440,33 +441,20 @@ namespace edm { ep.setLuminosityBlockPrincipal(inUseLumiPrincipals_[principal.luminosityBlockPrincipal().index()].get()); propagateProducts(InEvent, principal, ep); - WaitingTaskHolder finalizeEventTask(*iHolder.group(), - make_waiting_task([&ep, iHolder](std::exception_ptr const* iPtr) mutable { - ep.clearEventPrincipal(); - if (iPtr) { - iHolder.doneWaiting(*iPtr); - } else { - iHolder.doneWaiting(std::exception_ptr()); - } - })); - WaitingTaskHolder afterProcessTask; - if (subProcesses_.empty()) { - afterProcessTask = std::move(finalizeEventTask); - } else { - afterProcessTask = WaitingTaskHolder( - *iHolder.group(), - make_waiting_task([this, &ep, finalizeEventTask, iEventSetupImpls](std::exception_ptr const* iPtr) mutable { - if (not iPtr) { - for (auto& subProcess : boost::adaptors::reverse(subProcesses_)) { - subProcess.doEventAsync(finalizeEventTask, ep, iEventSetupImpls); - } - } else { - finalizeEventTask.doneWaiting(*iPtr); - } - })); - } - EventTransitionInfo info(ep, *((*iEventSetupImpls)[esp_->subProcessIndex()])); - schedule_->processOneEventAsync(std::move(afterProcessTask), ep.streamID().value(), info, serviceToken_); + using namespace edm::waiting_task; + chain::first([&](auto nextTask) { + EventTransitionInfo info(ep, *((*iEventSetupImpls)[esp_->subProcessIndex()])); + schedule_->processOneEventAsync(std::move(nextTask), ep.streamID().value(), info, serviceToken_); + }) | chain::ifThen(not subProcesses_.empty(), [this, &ep, iEventSetupImpls](auto nextTask) { + for (auto& subProcess : boost::adaptors::reverse(subProcesses_)) { + subProcess.doEventAsync(nextTask, ep, iEventSetupImpls); + } + }) | chain::then([&ep](std::exception_ptr const* iPtr, auto nextTask) { + ep.clearEventPrincipal(); + if (iPtr) { + nextTask.doneWaiting(*iPtr); + } + }) | chain::runLast(std::move(iHolder)); } template <> @@ -510,48 +498,37 @@ namespace edm { ProcessBlockTransitionInfo transitionInfo(processBlockPrincipal); if (parentProducedProductIsKept(parentPrincipal, processBlockPrincipal)) { - auto& taskGroup = *iHolder.group(); - auto runEndProcessBlock = - make_waiting_task([this, iWait = std::move(iHolder), info = transitionInfo, cleaningUpAfterException]( - std::exception_ptr const* iPtr) mutable { + ProcessBlockPrincipal& inputProcessBlockPrincipal = principalCache_.inputProcessBlockPrincipal(); + inputProcessBlockPrincipal.fillProcessBlockPrincipal(parentPrincipal.processName(), parentPrincipal.reader()); + propagateProducts(InProcess, parentPrincipal, inputProcessBlockPrincipal); + ProcessBlockTransitionInfo inputTransitionInfo(inputProcessBlockPrincipal); + + using namespace edm::waiting_task; + chain::first([&](const std::exception_ptr*, auto nextTask) { + using TraitsInput = OccurrenceTraits; + beginGlobalTransitionAsync(std::move(nextTask), + *schedule_, + inputTransitionInfo, + serviceToken_, + subProcesses_, + cleaningUpAfterException); + }) | chain::then([this](auto nextTask) { writeProcessBlockAsync(nextTask, ProcessBlockType::Input); }) | + chain::then([this, info = transitionInfo, cleaningUpAfterException](std::exception_ptr const* iPtr, + auto nextTask) mutable { ProcessBlockPrincipal& inputProcessBlockPrincipal = principalCache_.inputProcessBlockPrincipal(); inputProcessBlockPrincipal.clearPrincipal(); for (auto& s : subProcesses_) { s.clearProcessBlockPrincipal(ProcessBlockType::Input); } if (iPtr) { - iWait.doneWaiting(*iPtr); + nextTask.doneWaiting(*iPtr); } else { using Traits = OccurrenceTraits; endGlobalTransitionAsync( - std::move(iWait), *schedule_, info, serviceToken_, subProcesses_, cleaningUpAfterException); + std::move(nextTask), *schedule_, info, serviceToken_, subProcesses_, cleaningUpAfterException); } - }); - WaitingTaskHolder holder(taskGroup, runEndProcessBlock); - - auto runWriteProcessBlock = - make_waiting_task([this, iWait = std::move(holder)](std::exception_ptr const* iPtr) mutable { - if (iPtr) { - iWait.doneWaiting(*iPtr); - } else { - writeProcessBlockAsync(iWait, ProcessBlockType::Input); - } - }); - WaitingTaskHolder writeHolder(taskGroup, runWriteProcessBlock); - - ProcessBlockPrincipal& inputProcessBlockPrincipal = principalCache_.inputProcessBlockPrincipal(); - inputProcessBlockPrincipal.fillProcessBlockPrincipal(parentPrincipal.processName(), parentPrincipal.reader()); - propagateProducts(InProcess, parentPrincipal, inputProcessBlockPrincipal); - ProcessBlockTransitionInfo inputTransitionInfo(inputProcessBlockPrincipal); - - using TraitsInput = OccurrenceTraits; - beginGlobalTransitionAsync(std::move(writeHolder), - *schedule_, - inputTransitionInfo, - serviceToken_, - subProcesses_, - cleaningUpAfterException); - + }) | + chain::runLast(std::move(iHolder)); } else { using Traits = OccurrenceTraits; endGlobalTransitionAsync( @@ -603,22 +580,17 @@ namespace edm { } void SubProcess::writeProcessBlockAsync(edm::WaitingTaskHolder task, ProcessBlockType processBlockType) { - ServiceRegistry::Operate operate(serviceToken_); - - auto subTasks = edm::make_waiting_task([this, task, processBlockType](std::exception_ptr const* iExcept) mutable { - if (iExcept) { - task.doneWaiting(*iExcept); - } else { - ServiceRegistry::Operate operate(serviceToken_); - for (auto& s : subProcesses_) { - s.writeProcessBlockAsync(task, processBlockType); - } + using namespace edm::waiting_task; + chain::first([&](std::exception_ptr const*, auto nextTask) { + ServiceRegistry::Operate operate(serviceToken_); + schedule_->writeProcessBlockAsync( + nextTask, principalCache_.processBlockPrincipal(processBlockType), &processContext_, actReg_.get()); + }) | chain::ifThen(not subProcesses_.empty(), [this, processBlockType](auto nextTask) { + ServiceRegistry::Operate operate(serviceToken_); + for (auto& s : subProcesses_) { + s.writeProcessBlockAsync(nextTask, processBlockType); } - }); - schedule_->writeProcessBlockAsync(WaitingTaskHolder(*task.group(), subTasks), - principalCache_.processBlockPrincipal(processBlockType), - &processContext_, - actReg_.get()); + }) | chain::runLast(std::move(task)); } void SubProcess::writeRunAsync(edm::WaitingTaskHolder task, @@ -630,22 +602,23 @@ namespace edm { assert(it != parentToChildPhID_.end()); auto const& childPhID = it->second; - auto subTasks = edm::make_waiting_task( - [this, childPhID, runNumber, task, mergeableRunProductMetadata](std::exception_ptr const* iExcept) mutable { - if (iExcept) { - task.doneWaiting(*iExcept); - } else { - ServiceRegistry::Operate operateWriteRun(serviceToken_); - for (auto& s : subProcesses_) { - s.writeRunAsync(task, childPhID, runNumber, mergeableRunProductMetadata); - } - } - }); - schedule_->writeRunAsync(WaitingTaskHolder(*task.group(), subTasks), - principalCache_.runPrincipal(childPhID, runNumber), - &processContext_, - actReg_.get(), - mergeableRunProductMetadata); + using namespace edm::waiting_task; + chain::first([&](std::exception_ptr const*, auto nextTask) { + ServiceRegistry::Operate operate(serviceToken_); + schedule_->writeRunAsync(nextTask, + principalCache_.runPrincipal(childPhID, runNumber), + &processContext_, + actReg_.get(), + mergeableRunProductMetadata); + }) | + chain::ifThen(not subProcesses_.empty(), + [this, childPhID, runNumber, mergeableRunProductMetadata](auto nextTask) { + ServiceRegistry::Operate operateWriteRun(serviceToken_); + for (auto& s : subProcesses_) { + s.writeRunAsync(nextTask, childPhID, runNumber, mergeableRunProductMetadata); + } + }) | + chain::runLast(task); } void SubProcess::deleteRunFromCache(ProcessHistoryID const& parentPhID, int runNumber) { @@ -702,20 +675,18 @@ namespace edm { } void SubProcess::writeLumiAsync(WaitingTaskHolder task, LuminosityBlockPrincipal& principal) { - ServiceRegistry::Operate operate(serviceToken_); + using namespace edm::waiting_task; auto l = inUseLumiPrincipals_[principal.index()]; - auto subTasks = edm::make_waiting_task([this, l, task](std::exception_ptr const* iExcept) mutable { - if (iExcept) { - task.doneWaiting(*iExcept); - } else { - ServiceRegistry::Operate operateWriteLumi(serviceToken_); - for (auto& s : subProcesses_) { - s.writeLumiAsync(task, *l); - } + chain::first([&](std::exception_ptr const*, auto nextTask) { + ServiceRegistry::Operate operate(serviceToken_); + schedule_->writeLumiAsync(nextTask, *l, &processContext_, actReg_.get()); + }) | chain::ifThen(not subProcesses_.empty(), [this, l](auto nextTask) { + ServiceRegistry::Operate operateWriteLumi(serviceToken_); + for (auto& s : subProcesses_) { + s.writeLumiAsync(nextTask, *l); } - }); - schedule_->writeLumiAsync(WaitingTaskHolder(*task.group(), subTasks), *l, &processContext_, actReg_.get()); + }) | chain::runLast(std::move(task)); } void SubProcess::deleteLumiFromCache(LuminosityBlockPrincipal& principal) { diff --git a/FWCore/Framework/src/SynchronousEventSetupsController.h b/FWCore/Framework/src/SynchronousEventSetupsController.h index a5cf62bf48a89..56963dfe21eb8 100644 --- a/FWCore/Framework/src/SynchronousEventSetupsController.h +++ b/FWCore/Framework/src/SynchronousEventSetupsController.h @@ -18,7 +18,7 @@ // Created: Wed Jan 12 14:30:42 CST 2011 // -#include "EventSetupsController.h" +#include "FWCore/Framework/interface/EventSetupsController.h" #include "tbb/task_group.h" #include "tbb/global_control.h" diff --git a/FWCore/Framework/src/SystemTimeKeeper.cc b/FWCore/Framework/src/SystemTimeKeeper.cc index b50799f953658..9b4fe82d26a50 100644 --- a/FWCore/Framework/src/SystemTimeKeeper.cc +++ b/FWCore/Framework/src/SystemTimeKeeper.cc @@ -24,7 +24,7 @@ #include "FWCore/Framework/src/TriggerTimingReport.h" #include "FWCore/Framework/interface/TriggerNamesService.h" #include "FWCore/Utilities/interface/Algorithms.h" -#include "SystemTimeKeeper.h" +#include "FWCore/Framework/interface/SystemTimeKeeper.h" using namespace edm; @@ -202,9 +202,15 @@ void SystemTimeKeeper::restartModuleEvent(StreamContext const& iStream, ModuleCa } } -void SystemTimeKeeper::startProcessingLoop() { m_processingLoopTimer.start(); } +void SystemTimeKeeper::startProcessingLoop() { + m_processingLoopTimer.start(); + m_processingLoopChildrenTimer.start(); +} -void SystemTimeKeeper::stopProcessingLoop() { m_processingLoopTimer.stop(); } +void SystemTimeKeeper::stopProcessingLoop() { + m_processingLoopTimer.stop(); + m_processingLoopChildrenTimer.stop(); +} static void fillPathSummary(unsigned int iStartIndex, unsigned int iEndIndex, @@ -248,7 +254,7 @@ void SystemTimeKeeper::fillTriggerTimingReport(TriggerTimingReport& rep) const { sumEventTime += stream.realTime(); } rep.eventSummary.realTime = m_processingLoopTimer.realTime(); - rep.eventSummary.cpuTime = m_processingLoopTimer.cpuTime(); + rep.eventSummary.cpuTime = m_processingLoopTimer.cpuTime() + m_processingLoopChildrenTimer.cpuTime(); rep.eventSummary.sumStreamRealTime = sumEventTime; } diff --git a/FWCore/Framework/src/TriggerResultInserter.cc b/FWCore/Framework/src/TriggerResultInserter.cc index 0460b610efa70..83a45c348cabe 100644 --- a/FWCore/Framework/src/TriggerResultInserter.cc +++ b/FWCore/Framework/src/TriggerResultInserter.cc @@ -8,7 +8,7 @@ namespace edm { TriggerResultInserter::TriggerResultInserter(const ParameterSet& pset, unsigned int iNStreams) - : resultsPerStream_(iNStreams), pset_id_(pset.id()), token_{produces()} {} + : resultsPerStream_(iNStreams), pset_id_(pset.id()), token_{produces()} {} void TriggerResultInserter::setTrigResultForStream(unsigned int iStreamIndex, const TrigResPtr& trptr) { resultsPerStream_[iStreamIndex] = trptr; diff --git a/FWCore/Framework/src/UnscheduledAuxiliary.cc b/FWCore/Framework/src/UnscheduledAuxiliary.cc index 94679bb5de21a..3acdcf1a9ca18 100644 --- a/FWCore/Framework/src/UnscheduledAuxiliary.cc +++ b/FWCore/Framework/src/UnscheduledAuxiliary.cc @@ -13,7 +13,7 @@ // system include files // user include files -#include "UnscheduledAuxiliary.h" +#include "FWCore/Framework/interface/UnscheduledAuxiliary.h" // // constants, enums and typedefs diff --git a/FWCore/Framework/src/Worker.cc b/FWCore/Framework/src/Worker.cc index 4eea40ca1ba64..b2196e5ebe33b 100644 --- a/FWCore/Framework/src/Worker.cc +++ b/FWCore/Framework/src/Worker.cc @@ -2,8 +2,8 @@ /*---------------------------------------------------------------------- ----------------------------------------------------------------------*/ #include "FWCore/Concurrency/interface/include_first_syncWait.h" -#include "FWCore/Framework/src/Worker.h" -#include "FWCore/Framework/src/EarlyDeleteHelper.h" +#include "FWCore/Framework/interface/maker/Worker.h" +#include "FWCore/Framework/interface/EarlyDeleteHelper.h" #include "FWCore/Framework/interface/EventPrincipal.h" #include "FWCore/Framework/interface/EventSetupImpl.h" #include "FWCore/Framework/interface/LuminosityBlockPrincipal.h" @@ -109,58 +109,6 @@ namespace edm { void Worker::setActivityRegistry(std::shared_ptr areg) { actReg_ = areg; } - void Worker::exceptionContext(cms::Exception& ex, ModuleCallingContext const* mcc) { - ModuleCallingContext const* imcc = mcc; - while ((imcc->type() == ParentContext::Type::kModule) or (imcc->type() == ParentContext::Type::kInternal)) { - std::ostringstream iost; - if (imcc->state() == ModuleCallingContext::State::kPrefetching) { - iost << "Prefetching for module "; - } else { - iost << "Calling method for module "; - } - iost << imcc->moduleDescription()->moduleName() << "/'" << imcc->moduleDescription()->moduleLabel() << "'"; - - if (imcc->type() == ParentContext::Type::kInternal) { - iost << " (probably inside some kind of mixing module)"; - imcc = imcc->internalContext()->moduleCallingContext(); - } else { - imcc = imcc->moduleCallingContext(); - } - ex.addContext(iost.str()); - } - std::ostringstream ost; - if (imcc->state() == ModuleCallingContext::State::kPrefetching) { - ost << "Prefetching for module "; - } else { - ost << "Calling method for module "; - } - ost << imcc->moduleDescription()->moduleName() << "/'" << imcc->moduleDescription()->moduleLabel() << "'"; - ex.addContext(ost.str()); - - if (imcc->type() == ParentContext::Type::kPlaceInPath) { - ost.str(""); - ost << "Running path '"; - ost << imcc->placeInPathContext()->pathContext()->pathName() << "'"; - ex.addContext(ost.str()); - auto streamContext = imcc->placeInPathContext()->pathContext()->streamContext(); - if (streamContext) { - ost.str(""); - edm::exceptionContext(ost, *streamContext); - ex.addContext(ost.str()); - } - } else { - if (imcc->type() == ParentContext::Type::kStream) { - ost.str(""); - edm::exceptionContext(ost, *(imcc->streamContext())); - ex.addContext(ost.str()); - } else if (imcc->type() == ParentContext::Type::kGlobal) { - ost.str(""); - edm::exceptionContext(ost, *(imcc->globalContext())); - ex.addContext(ost.str()); - } - } - } - bool Worker::shouldRethrowException(std::exception_ptr iPtr, ParentContext const& parentContext, bool isEvent) const { // NOTE: the warning printed as a result of ignoring or failing // a module will only be printed during the full true processing @@ -456,7 +404,7 @@ namespace edm { try { convertException::wrap([&]() { this->implDoAcquire(info, &moduleCallingContext_, holder); }); } catch (cms::Exception& ex) { - exceptionContext(ex, &moduleCallingContext_); + edm::exceptionContext(ex, moduleCallingContext_); if (shouldRethrowException(std::current_exception(), parentContext, true)) { timesRun_.fetch_add(1, std::memory_order_relaxed); throw; @@ -496,7 +444,7 @@ namespace edm { convertException::wrap([iEPtr]() { std::rethrow_exception(*iEPtr); }); } catch (cms::Exception& ex) { ModuleContextSentry moduleContextSentry(&moduleCallingContext_, parentContext); - exceptionContext(ex, &moduleCallingContext_); + edm::exceptionContext(ex, moduleCallingContext_); return std::current_exception(); } } diff --git a/FWCore/Framework/src/WorkerInPath.cc b/FWCore/Framework/src/WorkerInPath.cc index 5beb28b13e4c7..4c58839ca8b33 100644 --- a/FWCore/Framework/src/WorkerInPath.cc +++ b/FWCore/Framework/src/WorkerInPath.cc @@ -1,6 +1,6 @@ -#include "FWCore/Framework/src/WorkerInPath.h" +#include "FWCore/Framework/interface/WorkerInPath.h" namespace edm { WorkerInPath::WorkerInPath(Worker* w, FilterAction theFilterAction, unsigned int placeInPath, bool runConcurrently) diff --git a/FWCore/Framework/src/WorkerMaker.cc b/FWCore/Framework/src/WorkerMaker.cc index 84813794ff061..7cee114f9d48b 100644 --- a/FWCore/Framework/src/WorkerMaker.cc +++ b/FWCore/Framework/src/WorkerMaker.cc @@ -1,5 +1,5 @@ -#include "FWCore/Framework/src/WorkerMaker.h" +#include "FWCore/Framework/interface/maker/WorkerMaker.h" #include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" #include "FWCore/ParameterSet/interface/Registry.h" #include "DataFormats/Provenance/interface/ModuleDescription.h" diff --git a/FWCore/Framework/src/WorkerRegistry.cc b/FWCore/Framework/src/WorkerRegistry.cc index 8c24d3a3df2cf..f0464ce57a050 100644 --- a/FWCore/Framework/src/WorkerRegistry.cc +++ b/FWCore/Framework/src/WorkerRegistry.cc @@ -6,11 +6,11 @@ \date 18 May 2005 */ #include -#include "FWCore/Framework/src/WorkerRegistry.h" -#include "FWCore/Framework/src/Worker.h" -#include "FWCore/Framework/src/ModuleHolder.h" -#include "FWCore/Framework/src/MakeModuleParams.h" -#include "FWCore/Framework/src/ModuleRegistry.h" +#include "FWCore/Framework/interface/WorkerRegistry.h" +#include "FWCore/Framework/interface/maker/Worker.h" +#include "FWCore/Framework/interface/maker/ModuleHolder.h" +#include "FWCore/Framework/interface/maker/MakeModuleParams.h" +#include "FWCore/Framework/interface/ModuleRegistry.h" #include "FWCore/ServiceRegistry/interface/ActivityRegistry.h" namespace edm { diff --git a/FWCore/Framework/src/WorkerT.cc b/FWCore/Framework/src/WorkerT.cc index a3d10062dc97d..77ae243fecaaf 100644 --- a/FWCore/Framework/src/WorkerT.cc +++ b/FWCore/Framework/src/WorkerT.cc @@ -1,4 +1,4 @@ -#include "FWCore/Framework/src/WorkerT.h" +#include "FWCore/Framework/interface/maker/WorkerT.h" #include "FWCore/Framework/interface/EventPrincipal.h" #include "FWCore/Framework/interface/EDProducer.h" diff --git a/FWCore/Framework/src/exceptionContext.cc b/FWCore/Framework/src/exceptionContext.cc new file mode 100644 index 0000000000000..49e29a9e0b735 --- /dev/null +++ b/FWCore/Framework/src/exceptionContext.cc @@ -0,0 +1,30 @@ +#include "FWCore/ServiceRegistry/interface/ESModuleCallingContext.h" +#include "FWCore/ServiceRegistry/interface/ParentContext.h" +#include "FWCore/ServiceRegistry/interface/ModuleCallingContext.h" +#include "FWCore/Utilities/interface/EDMException.h" +#include "FWCore/Framework/interface/ComponentDescription.h" + +#include + +namespace edm { + + void exceptionContext(cms::Exception& ex, ESModuleCallingContext const& mcc) { + ESModuleCallingContext const* imcc = &mcc; + while (true) { + std::ostringstream iost; + if (imcc->state() == ESModuleCallingContext::State::kPrefetching) { + iost << "Prefetching for EventSetup module "; + } else { + iost << "Calling method for EventSetup module "; + } + iost << imcc->componentDescription()->type_ << "/'" << imcc->componentDescription()->label_ << "'"; + + ex.addContext(iost.str()); + if (imcc->type() != ESParentContext::Type::kESModule) { + break; + } + imcc = imcc->esmoduleCallingContext(); + } + edm::exceptionContext(ex, *imcc->moduleCallingContext()); + } +} // namespace edm diff --git a/FWCore/Framework/src/global/EDAnalyzerBase.cc b/FWCore/Framework/src/global/EDAnalyzerBase.cc index 64ca4ad3fce9a..f1a1c2125029b 100644 --- a/FWCore/Framework/src/global/EDAnalyzerBase.cc +++ b/FWCore/Framework/src/global/EDAnalyzerBase.cc @@ -20,9 +20,9 @@ #include "FWCore/Framework/interface/Run.h" #include "FWCore/Framework/interface/EventSetup.h" #include "FWCore/Framework/src/edmodule_mightGet_config.h" -#include "FWCore/Framework/src/PreallocationConfiguration.h" +#include "FWCore/Framework/interface/PreallocationConfiguration.h" #include "FWCore/Framework/src/EventSignalsSentry.h" -#include "FWCore/Framework/src/TransitionInfoTypes.h" +#include "FWCore/Framework/interface/TransitionInfoTypes.h" #include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" #include "FWCore/ParameterSet/interface/ParameterSetDescription.h" diff --git a/FWCore/Framework/src/global/EDFilterBase.cc b/FWCore/Framework/src/global/EDFilterBase.cc index 488d8799c37c0..7ee20416e40c9 100644 --- a/FWCore/Framework/src/global/EDFilterBase.cc +++ b/FWCore/Framework/src/global/EDFilterBase.cc @@ -23,9 +23,9 @@ #include "FWCore/Framework/interface/global/EDFilterBase.h" #include "FWCore/Framework/src/EventAcquireSignalsSentry.h" #include "FWCore/Framework/src/EventSignalsSentry.h" -#include "FWCore/Framework/src/PreallocationConfiguration.h" +#include "FWCore/Framework/interface/PreallocationConfiguration.h" #include "FWCore/Framework/src/edmodule_mightGet_config.h" -#include "FWCore/Framework/src/TransitionInfoTypes.h" +#include "FWCore/Framework/interface/TransitionInfoTypes.h" #include "FWCore/ServiceRegistry/interface/ESParentContext.h" #include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" diff --git a/FWCore/Framework/src/global/EDProducerBase.cc b/FWCore/Framework/src/global/EDProducerBase.cc index 8d24bcb498b70..b3ef3bf4c50b5 100644 --- a/FWCore/Framework/src/global/EDProducerBase.cc +++ b/FWCore/Framework/src/global/EDProducerBase.cc @@ -23,9 +23,9 @@ #include "FWCore/Framework/interface/global/EDProducerBase.h" #include "FWCore/Framework/src/EventAcquireSignalsSentry.h" #include "FWCore/Framework/src/EventSignalsSentry.h" -#include "FWCore/Framework/src/PreallocationConfiguration.h" +#include "FWCore/Framework/interface/PreallocationConfiguration.h" #include "FWCore/Framework/src/edmodule_mightGet_config.h" -#include "FWCore/Framework/src/TransitionInfoTypes.h" +#include "FWCore/Framework/interface/TransitionInfoTypes.h" #include "FWCore/ServiceRegistry/interface/ESParentContext.h" #include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" diff --git a/FWCore/Framework/src/global/OutputModuleBase.cc b/FWCore/Framework/src/global/OutputModuleBase.cc index 19dd868d6de41..1931724b4e9f8 100644 --- a/FWCore/Framework/src/global/OutputModuleBase.cc +++ b/FWCore/Framework/src/global/OutputModuleBase.cc @@ -29,7 +29,7 @@ #include "FWCore/Framework/src/OutputModuleDescription.h" #include "FWCore/Framework/interface/TriggerNamesService.h" #include "FWCore/Framework/src/EventSignalsSentry.h" -#include "FWCore/Framework/src/PreallocationConfiguration.h" +#include "FWCore/Framework/interface/PreallocationConfiguration.h" #include "FWCore/Framework/src/EventAcquireSignalsSentry.h" #include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" diff --git a/FWCore/Framework/src/limited/EDAnalyzerBase.cc b/FWCore/Framework/src/limited/EDAnalyzerBase.cc index af70265548374..51e8b2e2e1eab 100644 --- a/FWCore/Framework/src/limited/EDAnalyzerBase.cc +++ b/FWCore/Framework/src/limited/EDAnalyzerBase.cc @@ -20,9 +20,9 @@ #include "FWCore/Framework/interface/Run.h" #include "FWCore/Framework/interface/EventSetup.h" #include "FWCore/Framework/src/edmodule_mightGet_config.h" -#include "FWCore/Framework/src/PreallocationConfiguration.h" +#include "FWCore/Framework/interface/PreallocationConfiguration.h" #include "FWCore/Framework/src/EventSignalsSentry.h" -#include "FWCore/Framework/src/TransitionInfoTypes.h" +#include "FWCore/Framework/interface/TransitionInfoTypes.h" #include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" #include "FWCore/ParameterSet/interface/ParameterSetDescription.h" diff --git a/FWCore/Framework/src/limited/EDFilterBase.cc b/FWCore/Framework/src/limited/EDFilterBase.cc index 2f26a2e03f8a4..c89a64405e530 100644 --- a/FWCore/Framework/src/limited/EDFilterBase.cc +++ b/FWCore/Framework/src/limited/EDFilterBase.cc @@ -22,9 +22,9 @@ #include "FWCore/Framework/interface/Run.h" #include "FWCore/Framework/interface/limited/EDFilterBase.h" #include "FWCore/Framework/src/EventSignalsSentry.h" -#include "FWCore/Framework/src/PreallocationConfiguration.h" +#include "FWCore/Framework/interface/PreallocationConfiguration.h" #include "FWCore/Framework/src/edmodule_mightGet_config.h" -#include "FWCore/Framework/src/TransitionInfoTypes.h" +#include "FWCore/Framework/interface/TransitionInfoTypes.h" #include "FWCore/ServiceRegistry/interface/ESParentContext.h" #include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" diff --git a/FWCore/Framework/src/limited/EDProducerBase.cc b/FWCore/Framework/src/limited/EDProducerBase.cc index 8d167ec15ea73..7e8058fa07847 100644 --- a/FWCore/Framework/src/limited/EDProducerBase.cc +++ b/FWCore/Framework/src/limited/EDProducerBase.cc @@ -22,9 +22,9 @@ #include "FWCore/Framework/interface/Run.h" #include "FWCore/Framework/interface/limited/EDProducerBase.h" #include "FWCore/Framework/src/EventSignalsSentry.h" -#include "FWCore/Framework/src/PreallocationConfiguration.h" +#include "FWCore/Framework/interface/PreallocationConfiguration.h" #include "FWCore/Framework/src/edmodule_mightGet_config.h" -#include "FWCore/Framework/src/TransitionInfoTypes.h" +#include "FWCore/Framework/interface/TransitionInfoTypes.h" #include "FWCore/ServiceRegistry/interface/ESParentContext.h" #include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" diff --git a/FWCore/Framework/src/limited/OutputModuleBase.cc b/FWCore/Framework/src/limited/OutputModuleBase.cc index 67fcd9916ec72..0a5156070efc5 100644 --- a/FWCore/Framework/src/limited/OutputModuleBase.cc +++ b/FWCore/Framework/src/limited/OutputModuleBase.cc @@ -29,7 +29,7 @@ #include "FWCore/Framework/src/OutputModuleDescription.h" #include "FWCore/Framework/interface/TriggerNamesService.h" #include "FWCore/Framework/src/EventSignalsSentry.h" -#include "FWCore/Framework/src/PreallocationConfiguration.h" +#include "FWCore/Framework/interface/PreallocationConfiguration.h" #include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "FWCore/ParameterSet/interface/ParameterSetDescription.h" diff --git a/FWCore/Framework/src/one/EDAnalyzerBase.cc b/FWCore/Framework/src/one/EDAnalyzerBase.cc index 30518265e1382..a35ba9eb02c69 100644 --- a/FWCore/Framework/src/one/EDAnalyzerBase.cc +++ b/FWCore/Framework/src/one/EDAnalyzerBase.cc @@ -21,8 +21,8 @@ #include "FWCore/Framework/interface/EventSetup.h" #include "FWCore/Framework/src/edmodule_mightGet_config.h" #include "FWCore/Framework/src/EventSignalsSentry.h" -#include "FWCore/Framework/src/PreallocationConfiguration.h" -#include "FWCore/Framework/src/TransitionInfoTypes.h" +#include "FWCore/Framework/interface/PreallocationConfiguration.h" +#include "FWCore/Framework/interface/TransitionInfoTypes.h" #include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" #include "FWCore/ParameterSet/interface/ParameterSetDescription.h" diff --git a/FWCore/Framework/src/one/EDFilterBase.cc b/FWCore/Framework/src/one/EDFilterBase.cc index 60395400dacb2..cc3322c0253c4 100644 --- a/FWCore/Framework/src/one/EDFilterBase.cc +++ b/FWCore/Framework/src/one/EDFilterBase.cc @@ -20,9 +20,9 @@ #include "FWCore/Framework/interface/Run.h" #include "FWCore/Framework/interface/EventSetup.h" #include "FWCore/Framework/src/edmodule_mightGet_config.h" -#include "FWCore/Framework/src/PreallocationConfiguration.h" +#include "FWCore/Framework/interface/PreallocationConfiguration.h" #include "FWCore/Framework/src/EventSignalsSentry.h" -#include "FWCore/Framework/src/TransitionInfoTypes.h" +#include "FWCore/Framework/interface/TransitionInfoTypes.h" #include "FWCore/ServiceRegistry/interface/ESParentContext.h" #include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" diff --git a/FWCore/Framework/src/one/EDProducerBase.cc b/FWCore/Framework/src/one/EDProducerBase.cc index 8b8e369c87d47..621eb4d1e56a8 100644 --- a/FWCore/Framework/src/one/EDProducerBase.cc +++ b/FWCore/Framework/src/one/EDProducerBase.cc @@ -20,9 +20,9 @@ #include "FWCore/Framework/interface/Run.h" #include "FWCore/Framework/interface/EventSetup.h" #include "FWCore/Framework/src/edmodule_mightGet_config.h" -#include "FWCore/Framework/src/PreallocationConfiguration.h" +#include "FWCore/Framework/interface/PreallocationConfiguration.h" #include "FWCore/Framework/src/EventSignalsSentry.h" -#include "FWCore/Framework/src/TransitionInfoTypes.h" +#include "FWCore/Framework/interface/TransitionInfoTypes.h" #include "FWCore/ServiceRegistry/interface/ESParentContext.h" #include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" diff --git a/FWCore/Framework/src/one/OutputModuleBase.cc b/FWCore/Framework/src/one/OutputModuleBase.cc index 87a879f1aa983..9a85555ff6b32 100644 --- a/FWCore/Framework/src/one/OutputModuleBase.cc +++ b/FWCore/Framework/src/one/OutputModuleBase.cc @@ -31,7 +31,7 @@ #include "FWCore/Framework/src/OutputModuleDescription.h" #include "FWCore/Framework/interface/TriggerNamesService.h" #include "FWCore/Framework/src/EventSignalsSentry.h" -#include "FWCore/Framework/src/PreallocationConfiguration.h" +#include "FWCore/Framework/interface/PreallocationConfiguration.h" #include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "FWCore/ParameterSet/interface/ParameterSetDescription.h" diff --git a/FWCore/Framework/src/one/implementorsMethods.h b/FWCore/Framework/src/one/implementorsMethods.h index 46fba4548e164..726b73d06abe0 100644 --- a/FWCore/Framework/src/one/implementorsMethods.h +++ b/FWCore/Framework/src/one/implementorsMethods.h @@ -22,7 +22,7 @@ // user include files #include "FWCore/Framework/interface/one/implementors.h" -#include "FWCore/Framework/src/SharedResourcesRegistry.h" +#include "FWCore/Framework/interface/SharedResourcesRegistry.h" #include "FWCore/Framework/interface/SharedResourcesAcquirer.h" // forward declarations diff --git a/FWCore/Framework/src/stream/EDAnalyzerAdaptorBase.cc b/FWCore/Framework/src/stream/EDAnalyzerAdaptorBase.cc index 87b0da0833f4d..2cff309ee689c 100644 --- a/FWCore/Framework/src/stream/EDAnalyzerAdaptorBase.cc +++ b/FWCore/Framework/src/stream/EDAnalyzerAdaptorBase.cc @@ -25,9 +25,9 @@ #include "FWCore/Framework/interface/RunPrincipal.h" #include "FWCore/ServiceRegistry/interface/ESParentContext.h" -#include "FWCore/Framework/src/PreallocationConfiguration.h" +#include "FWCore/Framework/interface/PreallocationConfiguration.h" #include "FWCore/Framework/src/EventSignalsSentry.h" -#include "FWCore/Framework/src/TransitionInfoTypes.h" +#include "FWCore/Framework/interface/TransitionInfoTypes.h" using namespace edm::stream; // diff --git a/FWCore/Framework/src/stream/EDFilterAdaptorBase.cc b/FWCore/Framework/src/stream/EDFilterAdaptorBase.cc index 7cb496bd7f209..8ce606196fe2d 100644 --- a/FWCore/Framework/src/stream/EDFilterAdaptorBase.cc +++ b/FWCore/Framework/src/stream/EDFilterAdaptorBase.cc @@ -25,7 +25,7 @@ #include "FWCore/Framework/src/EventAcquireSignalsSentry.h" #include "FWCore/Framework/src/EventSignalsSentry.h" #include "FWCore/Framework/src/stream/ProducingModuleAdaptorBase.cc" -#include "FWCore/Framework/src/TransitionInfoTypes.h" +#include "FWCore/Framework/interface/TransitionInfoTypes.h" #include "FWCore/ServiceRegistry/interface/ESParentContext.h" using namespace edm::stream; diff --git a/FWCore/Framework/src/stream/EDProducerAdaptorBase.cc b/FWCore/Framework/src/stream/EDProducerAdaptorBase.cc index b48358274bffa..8e515516c548d 100644 --- a/FWCore/Framework/src/stream/EDProducerAdaptorBase.cc +++ b/FWCore/Framework/src/stream/EDProducerAdaptorBase.cc @@ -25,7 +25,7 @@ #include "FWCore/Framework/src/EventAcquireSignalsSentry.h" #include "FWCore/Framework/src/EventSignalsSentry.h" #include "FWCore/Framework/src/stream/ProducingModuleAdaptorBase.cc" -#include "FWCore/Framework/src/TransitionInfoTypes.h" +#include "FWCore/Framework/interface/TransitionInfoTypes.h" #include "FWCore/ServiceRegistry/interface/ESParentContext.h" using namespace edm::stream; diff --git a/FWCore/Framework/src/stream/ProducingModuleAdaptorBase.cc b/FWCore/Framework/src/stream/ProducingModuleAdaptorBase.cc index 39ee2326670f2..b34073bfe8425 100644 --- a/FWCore/Framework/src/stream/ProducingModuleAdaptorBase.cc +++ b/FWCore/Framework/src/stream/ProducingModuleAdaptorBase.cc @@ -20,8 +20,8 @@ #include "FWCore/Framework/interface/LuminosityBlockPrincipal.h" #include "FWCore/Framework/interface/EventSetup.h" #include "FWCore/Framework/interface/RunPrincipal.h" -#include "FWCore/Framework/src/PreallocationConfiguration.h" -#include "FWCore/Framework/src/TransitionInfoTypes.h" +#include "FWCore/Framework/interface/PreallocationConfiguration.h" +#include "FWCore/Framework/interface/TransitionInfoTypes.h" #include "FWCore/ServiceRegistry/interface/ESParentContext.h" // diff --git a/FWCore/Framework/test/Event_t.cpp b/FWCore/Framework/test/Event_t.cpp index f57128a2a74f2..793e6bccae147 100644 --- a/FWCore/Framework/test/Event_t.cpp +++ b/FWCore/Framework/test/Event_t.cpp @@ -83,7 +83,7 @@ namespace { template class TestProducer : public edm::ProducerBase { public: - TestProducer(std::string const& productInstanceName) { token_ = produces(productInstanceName); } + TestProducer(std::string const& productInstanceName) { token_ = produces(productInstanceName); } EDPutTokenT token_; }; } // namespace diff --git a/FWCore/Framework/test/edproducer_productregistry_callback.cc b/FWCore/Framework/test/edproducer_productregistry_callback.cc index 87ec7f75f0da7..569fed0a69ce8 100644 --- a/FWCore/Framework/test/edproducer_productregistry_callback.cc +++ b/FWCore/Framework/test/edproducer_productregistry_callback.cc @@ -12,17 +12,17 @@ #include "FWCore/Utilities/interface/GetPassID.h" #include "FWCore/Version/interface/GetReleaseVersion.h" -#include "FWCore/Framework/src/SignallingProductRegistry.h" +#include "FWCore/Framework/interface/SignallingProductRegistry.h" #include "FWCore/Framework/interface/ConstProductRegistry.h" -#include "FWCore/Framework/src/PreallocationConfiguration.h" +#include "FWCore/Framework/interface/PreallocationConfiguration.h" #include "FWCore/Framework/interface/EDProducer.h" #include "FWCore/Framework/interface/ExceptionActions.h" #include "DataFormats/Provenance/interface/ProductRegistry.h" #include "DataFormats/Provenance/interface/ProcessConfiguration.h" -#include "FWCore/Framework/src/WorkerMaker.h" -#include "FWCore/Framework/src/MakeModuleParams.h" -#include "FWCore/Framework/src/WorkerT.h" +#include "FWCore/Framework/interface/maker/WorkerMaker.h" +#include "FWCore/Framework/interface/maker/MakeModuleParams.h" +#include "FWCore/Framework/interface/maker/WorkerT.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" diff --git a/FWCore/Framework/test/eventsetupplugin_t.cppunit.cc b/FWCore/Framework/test/eventsetupplugin_t.cppunit.cc index 8d56d5cfbd356..5a53b5041d6a1 100644 --- a/FWCore/Framework/test/eventsetupplugin_t.cppunit.cc +++ b/FWCore/Framework/test/eventsetupplugin_t.cppunit.cc @@ -21,7 +21,7 @@ #include "FWCore/Framework/interface/SourceFactory.h" #include "FWCore/Framework/interface/ModuleFactory.h" #include "FWCore/Framework/interface/EventSetupProvider.h" -#include "FWCore/Framework/src/EventSetupsController.h" +#include "FWCore/Framework/interface/EventSetupsController.h" #include "FWCore/ServiceRegistry/interface/ActivityRegistry.h" using namespace edm::eventsetup; diff --git a/FWCore/Framework/test/eventsetupscontroller_t.cppunit.cc b/FWCore/Framework/test/eventsetupscontroller_t.cppunit.cc index 66e35b5eef95f..04466e30ecde7 100644 --- a/FWCore/Framework/test/eventsetupscontroller_t.cppunit.cc +++ b/FWCore/Framework/test/eventsetupscontroller_t.cppunit.cc @@ -5,7 +5,7 @@ #include "cppunit/extensions/HelperMacros.h" #include "DataFormats/Provenance/interface/ParameterSetID.h" #include "FWCore/Framework/interface/EventSetupProvider.h" -#include "FWCore/Framework/src/EventSetupsController.h" +#include "FWCore/Framework/interface/EventSetupsController.h" #include "FWCore/Framework/interface/ParameterSetIDHolder.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "FWCore/Framework/test/DummyFinder.h" diff --git a/FWCore/Framework/test/global_filter_t.cppunit.cc b/FWCore/Framework/test/global_filter_t.cppunit.cc index 6fef924e85609..c1882c48f90dc 100644 --- a/FWCore/Framework/test/global_filter_t.cppunit.cc +++ b/FWCore/Framework/test/global_filter_t.cppunit.cc @@ -12,10 +12,10 @@ #include #include "tbb/global_control.h" #include "FWCore/Framework/interface/global/EDFilter.h" -#include "FWCore/Framework/src/WorkerT.h" -#include "FWCore/Framework/src/ModuleHolder.h" -#include "FWCore/Framework/src/PreallocationConfiguration.h" -#include "FWCore/Framework/src/TransitionInfoTypes.h" +#include "FWCore/Framework/interface/maker/WorkerT.h" +#include "FWCore/Framework/interface/maker/ModuleHolder.h" +#include "FWCore/Framework/interface/PreallocationConfiguration.h" +#include "FWCore/Framework/interface/TransitionInfoTypes.h" #include "FWCore/Framework/interface/OccurrenceTraits.h" #include "DataFormats/Provenance/interface/ProductRegistry.h" #include "DataFormats/Provenance/interface/BranchIDListHelper.h" diff --git a/FWCore/Framework/test/global_outputmodule_t.cppunit.cc b/FWCore/Framework/test/global_outputmodule_t.cppunit.cc index 998792b76968a..d68b23a1dba85 100644 --- a/FWCore/Framework/test/global_outputmodule_t.cppunit.cc +++ b/FWCore/Framework/test/global_outputmodule_t.cppunit.cc @@ -10,9 +10,9 @@ #include #include "tbb/global_control.h" #include "FWCore/Framework/interface/global/OutputModule.h" -#include "FWCore/Framework/src/OutputModuleCommunicatorT.h" -#include "FWCore/Framework/src/TransitionInfoTypes.h" -#include "FWCore/Framework/src/WorkerT.h" +#include "FWCore/Framework/interface/OutputModuleCommunicatorT.h" +#include "FWCore/Framework/interface/TransitionInfoTypes.h" +#include "FWCore/Framework/interface/maker/WorkerT.h" #include "FWCore/Framework/interface/OccurrenceTraits.h" #include "DataFormats/Provenance/interface/ProductRegistry.h" #include "DataFormats/Provenance/interface/BranchIDListHelper.h" @@ -25,7 +25,7 @@ #include "FWCore/ServiceRegistry/interface/Service.h" #include "FWCore/ServiceRegistry/interface/ServiceRegistry.h" #include "FWCore/Framework/interface/FileBlock.h" -#include "FWCore/Framework/src/PreallocationConfiguration.h" +#include "FWCore/Framework/interface/PreallocationConfiguration.h" #include "FWCore/Concurrency/interface/WaitingTaskHolder.h" #include "FWCore/Utilities/interface/Exception.h" diff --git a/FWCore/Framework/test/global_producer_t.cppunit.cc b/FWCore/Framework/test/global_producer_t.cppunit.cc index 3da30b7400da6..ee0936d55f61b 100644 --- a/FWCore/Framework/test/global_producer_t.cppunit.cc +++ b/FWCore/Framework/test/global_producer_t.cppunit.cc @@ -12,10 +12,10 @@ #include #include "tbb/global_control.h" #include "FWCore/Framework/interface/global/EDProducer.h" -#include "FWCore/Framework/src/WorkerT.h" -#include "FWCore/Framework/src/ModuleHolder.h" -#include "FWCore/Framework/src/PreallocationConfiguration.h" -#include "FWCore/Framework/src/TransitionInfoTypes.h" +#include "FWCore/Framework/interface/maker/WorkerT.h" +#include "FWCore/Framework/interface/maker/ModuleHolder.h" +#include "FWCore/Framework/interface/PreallocationConfiguration.h" +#include "FWCore/Framework/interface/TransitionInfoTypes.h" #include "FWCore/Framework/interface/OccurrenceTraits.h" #include "DataFormats/Provenance/interface/ProductRegistry.h" #include "DataFormats/Provenance/interface/BranchIDListHelper.h" diff --git a/FWCore/Framework/test/limited_filter_t.cppunit.cc b/FWCore/Framework/test/limited_filter_t.cppunit.cc index ca89678e4a754..da797c329a6bd 100644 --- a/FWCore/Framework/test/limited_filter_t.cppunit.cc +++ b/FWCore/Framework/test/limited_filter_t.cppunit.cc @@ -12,10 +12,10 @@ #include #include "tbb/global_control.h" #include "FWCore/Framework/interface/limited/EDFilter.h" -#include "FWCore/Framework/src/WorkerT.h" -#include "FWCore/Framework/src/ModuleHolder.h" -#include "FWCore/Framework/src/PreallocationConfiguration.h" -#include "FWCore/Framework/src/TransitionInfoTypes.h" +#include "FWCore/Framework/interface/maker/WorkerT.h" +#include "FWCore/Framework/interface/maker/ModuleHolder.h" +#include "FWCore/Framework/interface/PreallocationConfiguration.h" +#include "FWCore/Framework/interface/TransitionInfoTypes.h" #include "FWCore/Framework/interface/OccurrenceTraits.h" #include "DataFormats/Provenance/interface/ProductRegistry.h" #include "DataFormats/Provenance/interface/BranchIDListHelper.h" diff --git a/FWCore/Framework/test/limited_outputmodule_t.cppunit.cc b/FWCore/Framework/test/limited_outputmodule_t.cppunit.cc index 40d6230b8f2c8..43cc689f59188 100644 --- a/FWCore/Framework/test/limited_outputmodule_t.cppunit.cc +++ b/FWCore/Framework/test/limited_outputmodule_t.cppunit.cc @@ -10,9 +10,9 @@ #include #include "tbb/global_control.h" #include "FWCore/Framework/interface/limited/OutputModule.h" -#include "FWCore/Framework/src/OutputModuleCommunicatorT.h" -#include "FWCore/Framework/src/TransitionInfoTypes.h" -#include "FWCore/Framework/src/WorkerT.h" +#include "FWCore/Framework/interface/OutputModuleCommunicatorT.h" +#include "FWCore/Framework/interface/TransitionInfoTypes.h" +#include "FWCore/Framework/interface/maker/WorkerT.h" #include "FWCore/Framework/interface/OccurrenceTraits.h" #include "DataFormats/Provenance/interface/ProductRegistry.h" #include "DataFormats/Provenance/interface/BranchIDListHelper.h" @@ -25,7 +25,7 @@ #include "FWCore/ServiceRegistry/interface/Service.h" #include "FWCore/ServiceRegistry/interface/ServiceRegistry.h" #include "FWCore/Framework/interface/FileBlock.h" -#include "FWCore/Framework/src/PreallocationConfiguration.h" +#include "FWCore/Framework/interface/PreallocationConfiguration.h" #include "FWCore/Concurrency/interface/WaitingTaskHolder.h" #include "FWCore/Utilities/interface/Exception.h" diff --git a/FWCore/Framework/test/limited_producer_t.cppunit.cc b/FWCore/Framework/test/limited_producer_t.cppunit.cc index c526ffbdd870e..1e36ac7b66398 100644 --- a/FWCore/Framework/test/limited_producer_t.cppunit.cc +++ b/FWCore/Framework/test/limited_producer_t.cppunit.cc @@ -12,10 +12,10 @@ #include #include "tbb/global_control.h" #include "FWCore/Framework/interface/limited/EDProducer.h" -#include "FWCore/Framework/src/WorkerT.h" -#include "FWCore/Framework/src/ModuleHolder.h" -#include "FWCore/Framework/src/PreallocationConfiguration.h" -#include "FWCore/Framework/src/TransitionInfoTypes.h" +#include "FWCore/Framework/interface/maker/WorkerT.h" +#include "FWCore/Framework/interface/maker/ModuleHolder.h" +#include "FWCore/Framework/interface/PreallocationConfiguration.h" +#include "FWCore/Framework/interface/TransitionInfoTypes.h" #include "FWCore/Framework/interface/OccurrenceTraits.h" #include "DataFormats/Provenance/interface/ProductRegistry.h" #include "DataFormats/Provenance/interface/BranchIDListHelper.h" diff --git a/FWCore/Framework/test/maker2_t.cppunit.cc b/FWCore/Framework/test/maker2_t.cppunit.cc index cca1dd12f942f..bafc82a116890 100644 --- a/FWCore/Framework/test/maker2_t.cppunit.cc +++ b/FWCore/Framework/test/maker2_t.cppunit.cc @@ -7,12 +7,12 @@ #include "FWCore/Version/interface/GetReleaseVersion.h" #include "FWCore/Framework/interface/Frameworkfwd.h" #include "FWCore/Framework/interface/EDProducer.h" -#include "FWCore/Framework/src/WorkerT.h" -#include "FWCore/Framework/src/PreallocationConfiguration.h" +#include "FWCore/Framework/interface/maker/WorkerT.h" +#include "FWCore/Framework/interface/PreallocationConfiguration.h" #include "FWCore/Framework/interface/ExceptionActions.h" #include "DataFormats/Provenance/interface/ProductRegistry.h" -#include "FWCore/Framework/src/WorkerMaker.h" -#include "FWCore/Framework/src/MakeModuleParams.h" +#include "FWCore/Framework/interface/maker/WorkerMaker.h" +#include "FWCore/Framework/interface/maker/MakeModuleParams.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" diff --git a/FWCore/Framework/test/one_outputmodule_t.cppunit.cc b/FWCore/Framework/test/one_outputmodule_t.cppunit.cc index b303dfb188e2f..c305456e0118d 100644 --- a/FWCore/Framework/test/one_outputmodule_t.cppunit.cc +++ b/FWCore/Framework/test/one_outputmodule_t.cppunit.cc @@ -12,9 +12,9 @@ #include #include "tbb/global_control.h" #include "FWCore/Framework/interface/one/OutputModule.h" -#include "FWCore/Framework/src/OutputModuleCommunicatorT.h" -#include "FWCore/Framework/src/TransitionInfoTypes.h" -#include "FWCore/Framework/src/WorkerT.h" +#include "FWCore/Framework/interface/OutputModuleCommunicatorT.h" +#include "FWCore/Framework/interface/TransitionInfoTypes.h" +#include "FWCore/Framework/interface/maker/WorkerT.h" #include "FWCore/Framework/interface/OccurrenceTraits.h" #include "DataFormats/Provenance/interface/ProductRegistry.h" #include "DataFormats/Provenance/interface/BranchIDListHelper.h" @@ -27,7 +27,7 @@ #include "FWCore/ServiceRegistry/interface/Service.h" #include "FWCore/ServiceRegistry/interface/ServiceRegistry.h" #include "FWCore/Framework/interface/FileBlock.h" -#include "FWCore/Framework/src/PreallocationConfiguration.h" +#include "FWCore/Framework/interface/PreallocationConfiguration.h" #include "FWCore/Concurrency/interface/WaitingTaskHolder.h" #include "FWCore/Utilities/interface/Exception.h" diff --git a/FWCore/Framework/test/productregistry.cppunit.cc b/FWCore/Framework/test/productregistry.cppunit.cc index 5ed4ee8c0e10e..820b0d3946b2c 100644 --- a/FWCore/Framework/test/productregistry.cppunit.cc +++ b/FWCore/Framework/test/productregistry.cppunit.cc @@ -11,7 +11,7 @@ #include "DataFormats/TestObjects/interface/ToyProducts.h" #include "FWCore/Framework/interface/ConstProductRegistry.h" #include "FWCore/Framework/interface/EventProcessor.h" -#include "FWCore/Framework/src/SignallingProductRegistry.h" +#include "FWCore/Framework/interface/SignallingProductRegistry.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "FWCore/PluginManager/interface/ProblemTracker.h" #include "FWCore/Utilities/interface/Exception.h" diff --git a/FWCore/Framework/test/sharedresourcesregistry_t.cppunit.cc b/FWCore/Framework/test/sharedresourcesregistry_t.cppunit.cc index 00fdad3479e54..4b89854b3d10a 100644 --- a/FWCore/Framework/test/sharedresourcesregistry_t.cppunit.cc +++ b/FWCore/Framework/test/sharedresourcesregistry_t.cppunit.cc @@ -9,7 +9,7 @@ #include "cppunit/extensions/HelperMacros.h" #define SHAREDRESOURCETESTACCESSORS 1 -#include "FWCore/Framework/src/SharedResourcesRegistry.h" +#include "FWCore/Framework/interface/SharedResourcesRegistry.h" #include "FWCore/Framework/interface/SharedResourcesAcquirer.h" using namespace edm; diff --git a/FWCore/Framework/test/stream_filter_t.cppunit.cc b/FWCore/Framework/test/stream_filter_t.cppunit.cc index d28c2e8ecbb0d..4beaf1aa19c84 100644 --- a/FWCore/Framework/test/stream_filter_t.cppunit.cc +++ b/FWCore/Framework/test/stream_filter_t.cppunit.cc @@ -10,11 +10,11 @@ #include #include #include "tbb/global_control.h" -#include "FWCore/Framework/src/Worker.h" -#include "FWCore/Framework/src/WorkerT.h" -#include "FWCore/Framework/src/ModuleHolder.h" -#include "FWCore/Framework/src/PreallocationConfiguration.h" -#include "FWCore/Framework/src/TransitionInfoTypes.h" +#include "FWCore/Framework/interface/maker/Worker.h" +#include "FWCore/Framework/interface/maker/WorkerT.h" +#include "FWCore/Framework/interface/maker/ModuleHolder.h" +#include "FWCore/Framework/interface/PreallocationConfiguration.h" +#include "FWCore/Framework/interface/TransitionInfoTypes.h" #include "FWCore/Framework/interface/stream/EDFilter.h" #include "FWCore/Framework/interface/stream/EDProducerAdaptor.h" #include "FWCore/Framework/interface/OccurrenceTraits.h" diff --git a/FWCore/Framework/test/stream_producer_t.cppunit.cc b/FWCore/Framework/test/stream_producer_t.cppunit.cc index b75abb1104c5e..cc5af5f558a67 100644 --- a/FWCore/Framework/test/stream_producer_t.cppunit.cc +++ b/FWCore/Framework/test/stream_producer_t.cppunit.cc @@ -10,11 +10,11 @@ #include #include #include "tbb/global_control.h" -#include "FWCore/Framework/src/Worker.h" -#include "FWCore/Framework/src/WorkerT.h" -#include "FWCore/Framework/src/ModuleHolder.h" -#include "FWCore/Framework/src/PreallocationConfiguration.h" -#include "FWCore/Framework/src/TransitionInfoTypes.h" +#include "FWCore/Framework/interface/maker/Worker.h" +#include "FWCore/Framework/interface/maker/WorkerT.h" +#include "FWCore/Framework/interface/maker/ModuleHolder.h" +#include "FWCore/Framework/interface/PreallocationConfiguration.h" +#include "FWCore/Framework/interface/TransitionInfoTypes.h" #include "FWCore/Framework/interface/stream/EDProducer.h" #include "FWCore/Framework/interface/stream/EDProducerAdaptor.h" #include "FWCore/Framework/interface/OccurrenceTraits.h" diff --git a/FWCore/Framework/test/stubs/TestGlobalFilters.cc b/FWCore/Framework/test/stubs/TestGlobalFilters.cc index 1465a9060ad7f..50800b415d1ff 100644 --- a/FWCore/Framework/test/stubs/TestGlobalFilters.cc +++ b/FWCore/Framework/test/stubs/TestGlobalFilters.cc @@ -503,8 +503,7 @@ namespace edmtest { class TestBeginProcessBlockFilter : public edm::global::EDFilter { public: explicit TestBeginProcessBlockFilter(edm::ParameterSet const& p) - : trans_(p.getParameter("transitions")), - token_(produces("begin")) { + : trans_(p.getParameter("transitions")), token_(produces("begin")) { produces(); auto tag = p.getParameter("consumesBeginProcessBlock"); diff --git a/FWCore/Framework/test/stubs/TestGlobalProducers.cc b/FWCore/Framework/test/stubs/TestGlobalProducers.cc index ee05190d9d74e..09bbf09b7cbbc 100644 --- a/FWCore/Framework/test/stubs/TestGlobalProducers.cc +++ b/FWCore/Framework/test/stubs/TestGlobalProducers.cc @@ -793,7 +793,7 @@ namespace edmtest { public: explicit TestAccumulator(edm::ParameterSet const& p) : m_expectedCount(p.getParameter("expectedCount")), - m_putToken(produces()) {} + m_putToken(produces()) {} void accumulate(edm::StreamID iID, edm::Event const&, edm::EventSetup const&) const override { ++m_count; } diff --git a/FWCore/Framework/test/stubs/TestStreamAnalyzers.cc b/FWCore/Framework/test/stubs/TestStreamAnalyzers.cc index 5137ede36ee54..6a132abda0dd8 100644 --- a/FWCore/Framework/test/stubs/TestStreamAnalyzers.cc +++ b/FWCore/Framework/test/stubs/TestStreamAnalyzers.cc @@ -16,7 +16,7 @@ for testing purposes only. #include "FWCore/Framework/interface/CacheHandle.h" #include "FWCore/Framework/interface/stream/EDAnalyzer.h" -#include "FWCore/Framework/src/WorkerT.h" +#include "FWCore/Framework/interface/maker/WorkerT.h" #include "FWCore/Framework/interface/HistoryAppender.h" #include "FWCore/ServiceRegistry/interface/ParentContext.h" #include "FWCore/ServiceRegistry/interface/StreamContext.h" diff --git a/FWCore/Framework/test/stubs/TestStreamFilters.cc b/FWCore/Framework/test/stubs/TestStreamFilters.cc index 57ac06456e930..0dd2d6c4a2c73 100644 --- a/FWCore/Framework/test/stubs/TestStreamFilters.cc +++ b/FWCore/Framework/test/stubs/TestStreamFilters.cc @@ -17,7 +17,7 @@ for testing purposes only. #include "FWCore/Framework/interface/CacheHandle.h" #include "FWCore/Framework/interface/stream/EDFilter.h" -#include "FWCore/Framework/src/WorkerT.h" +#include "FWCore/Framework/interface/maker/WorkerT.h" #include "FWCore/Framework/interface/HistoryAppender.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" #include "FWCore/ServiceRegistry/interface/ParentContext.h" diff --git a/FWCore/Framework/test/stubs/TestStreamProducers.cc b/FWCore/Framework/test/stubs/TestStreamProducers.cc index e9a64713d1978..c5b21fce93564 100644 --- a/FWCore/Framework/test/stubs/TestStreamProducers.cc +++ b/FWCore/Framework/test/stubs/TestStreamProducers.cc @@ -17,7 +17,7 @@ for testing purposes only. #include "FWCore/Framework/interface/CacheHandle.h" #include "FWCore/Framework/interface/stream/EDProducer.h" -#include "FWCore/Framework/src/WorkerT.h" +#include "FWCore/Framework/interface/maker/WorkerT.h" #include "FWCore/Framework/interface/HistoryAppender.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" #include "FWCore/ServiceRegistry/interface/ParentContext.h" diff --git a/FWCore/Framework/test/stubs/ToyIntProducers.cc b/FWCore/Framework/test/stubs/ToyIntProducers.cc index db3ead0e8f3f6..12b8602403e53 100644 --- a/FWCore/Framework/test/stubs/ToyIntProducers.cc +++ b/FWCore/Framework/test/stubs/ToyIntProducers.cc @@ -457,7 +457,7 @@ namespace edmtest { } // EventSetup is not used. - for (auto const tv : tokenValues_) { + for (auto const& tv : tokenValues_) { e.emplace(tv.token, tv.value); } } diff --git a/FWCore/Integration/test/AcquireIntFilter.cc b/FWCore/Integration/test/AcquireIntFilter.cc index c9c5d20ce581f..b162a84c8e49a 100644 --- a/FWCore/Integration/test/AcquireIntFilter.cc +++ b/FWCore/Integration/test/AcquireIntFilter.cc @@ -4,7 +4,7 @@ #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/global/EDFilter.h" #include "FWCore/Framework/interface/MakerMacros.h" -#include "FWCore/Framework/src/PreallocationConfiguration.h" +#include "FWCore/Framework/interface/PreallocationConfiguration.h" #include "FWCore/Integration/test/WaitingServer.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "FWCore/Utilities/interface/EDGetToken.h" diff --git a/FWCore/Integration/test/AcquireIntProducer.cc b/FWCore/Integration/test/AcquireIntProducer.cc index 5053c8f77cce3..4debcf6838094 100644 --- a/FWCore/Integration/test/AcquireIntProducer.cc +++ b/FWCore/Integration/test/AcquireIntProducer.cc @@ -4,7 +4,7 @@ #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/global/EDProducer.h" #include "FWCore/Framework/interface/MakerMacros.h" -#include "FWCore/Framework/src/PreallocationConfiguration.h" +#include "FWCore/Framework/interface/PreallocationConfiguration.h" #include "FWCore/Integration/test/WaitingServer.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "FWCore/Utilities/interface/EDGetToken.h" diff --git a/FWCore/Integration/test/ESTestAnalyzers.cc b/FWCore/Integration/test/ESTestAnalyzers.cc index 0aa116926c1e0..1a14fb4fb867d 100644 --- a/FWCore/Integration/test/ESTestAnalyzers.cc +++ b/FWCore/Integration/test/ESTestAnalyzers.cc @@ -1,4 +1,6 @@ #include "FWCore/Framework/interface/EDAnalyzer.h" +#include "FWCore/Framework/interface/one/EDAnalyzer.h" +#include "FWCore/Framework/interface/global/EDAnalyzer.h" #include "FWCore/Framework/interface/stream/EDAnalyzer.h" #include "DataFormats/Provenance/interface/ModuleDescription.h" #include "DataFormats/TestObjects/interface/ToyProducts.h" @@ -66,7 +68,7 @@ namespace edmtest { descriptions.addDefault(desc); } - class ESTestAnalyzerB : public edm::EDAnalyzer { + class ESTestAnalyzerB : public edm::one::EDAnalyzer<> { public: explicit ESTestAnalyzerB(edm::ParameterSet const&); virtual void analyze(const edm::Event&, const edm::EventSetup&); @@ -74,21 +76,21 @@ namespace edmtest { static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); private: - std::vector runsToGetDataFor_; - std::vector expectedValues_; + const std::vector runsToGetDataFor_; + const std::vector expectedValues_; + const edm::ESGetToken dataBToken_; unsigned int expectedIndex_ = 0; }; ESTestAnalyzerB::ESTestAnalyzerB(edm::ParameterSet const& pset) : runsToGetDataFor_(pset.getParameter>("runsToGetDataFor")), - expectedValues_(pset.getUntrackedParameter>("expectedValues")) {} + expectedValues_(pset.getUntrackedParameter>("expectedValues")), + dataBToken_(esConsumes()) {} void ESTestAnalyzerB::analyze(edm::Event const& ev, edm::EventSetup const& es) { if (std::find(runsToGetDataFor_.begin(), runsToGetDataFor_.end(), ev.run()) != runsToGetDataFor_.end()) { - ESTestRecordB const& rec = es.get(); - edm::ESHandle dataB; - rec.get(dataB); + edm::ESHandle dataB = es.getHandle(dataBToken_); edm::LogAbsolute("ESTestAnalyzerB") << "ESTestAnalyzerB: process = " << moduleDescription().processName() << ": Data value = " << dataB->value(); @@ -112,32 +114,31 @@ namespace edmtest { descriptions.addDefault(desc); } - class ESTestAnalyzerK : public edm::EDAnalyzer { + class ESTestAnalyzerK : public edm::global::EDAnalyzer<> { public: explicit ESTestAnalyzerK(edm::ParameterSet const&); - virtual void analyze(const edm::Event&, const edm::EventSetup&); + void analyze(edm::StreamID, const edm::Event&, const edm::EventSetup&) const override; private: - std::vector runsToGetDataFor_; + const std::vector runsToGetDataFor_; + const edm::ESGetToken dataKToken_; }; ESTestAnalyzerK::ESTestAnalyzerK(edm::ParameterSet const& pset) - : runsToGetDataFor_(pset.getParameter>("runsToGetDataFor")) {} + : runsToGetDataFor_(pset.getParameter>("runsToGetDataFor")), dataKToken_(esConsumes()) {} - void ESTestAnalyzerK::analyze(edm::Event const& ev, edm::EventSetup const& es) { + void ESTestAnalyzerK::analyze(edm::StreamID, edm::Event const& ev, edm::EventSetup const& es) const { if (std::find(runsToGetDataFor_.begin(), runsToGetDataFor_.end(), ev.run()) != runsToGetDataFor_.end()) { - ESTestRecordK const& rec = es.get(); - edm::ESHandle dataK; - rec.get(dataK); + ESTestDataK const& dataK = es.getData(dataKToken_); edm::LogAbsolute("ESTestAnalyzerK") - << "ESTestAnalyzerK: process = " << moduleDescription().processName() << ": Data value = " << dataK->value(); + << "ESTestAnalyzerK: process = " << moduleDescription().processName() << ": Data value = " << dataK.value(); } } - class ESTestAnalyzerAZ : public edm::EDAnalyzer { + class ESTestAnalyzerAZ : public edm::global::EDAnalyzer<> { public: explicit ESTestAnalyzerAZ(edm::ParameterSet const&); - virtual void analyze(const edm::Event&, const edm::EventSetup&); + void analyze(edm::StreamID, const edm::Event&, const edm::EventSetup&) const override; static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); @@ -145,44 +146,44 @@ namespace edmtest { std::vector const runsToGetDataFor_; std::vector const expectedValuesA_; std::vector const expectedValuesZ_; + edm::ESGetToken dataAToken_; + edm::ESGetToken dataZToken_; }; ESTestAnalyzerAZ::ESTestAnalyzerAZ(edm::ParameterSet const& pset) : runsToGetDataFor_(pset.getParameter>("runsToGetDataFor")), expectedValuesA_(pset.getUntrackedParameter>("expectedValuesA")), - expectedValuesZ_(pset.getUntrackedParameter>("expectedValuesZ")) { + expectedValuesZ_(pset.getUntrackedParameter>("expectedValuesZ")), + dataAToken_(esConsumes(edm::ESInputTag("", "foo"))), + dataZToken_(esConsumes(edm::ESInputTag("", "foo"))) { assert(expectedValuesA_.empty() or expectedValuesA_.size() == runsToGetDataFor_.size()); assert(expectedValuesZ_.empty() or expectedValuesZ_.size() == runsToGetDataFor_.size()); } - void ESTestAnalyzerAZ::analyze(edm::Event const& ev, edm::EventSetup const& es) { + void ESTestAnalyzerAZ::analyze(edm::StreamID, edm::Event const& ev, edm::EventSetup const& es) const { auto found = std::find(runsToGetDataFor_.begin(), runsToGetDataFor_.end(), ev.run()); if (found != runsToGetDataFor_.end()) { - ESTestRecordA const& recA = es.get(); - edm::ESHandle dataA; - recA.get("foo", dataA); + ESTestDataA const& dataA = es.getData(dataAToken_); - ESTestRecordZ const& recZ = es.get(); - edm::ESHandle dataZ; - recZ.get("foo", dataZ); + ESTestDataZ const& dataZ = es.getData(dataZToken_); edm::LogAbsolute("ESTestAnalyzerAZ") << "ESTestAnalyzerAZ: process = " << moduleDescription().processName() - << ": Data values = " << dataA->value() << " " << dataZ->value(); + << ": Data values = " << dataA.value() << " " << dataZ.value(); if (not expectedValuesA_.empty()) { - if (expectedValuesA_[found - runsToGetDataFor_.begin()] != dataA->value()) { + if (expectedValuesA_[found - runsToGetDataFor_.begin()] != dataA.value()) { throw cms::Exception("TestError") << "Exptected value for A " << expectedValuesA_[found - runsToGetDataFor_.begin()] << " but saw " - << dataA->value(); + << dataA.value(); } } if (not expectedValuesZ_.empty()) { - if (expectedValuesZ_[found - runsToGetDataFor_.begin()] != dataZ->value()) { + if (expectedValuesZ_[found - runsToGetDataFor_.begin()] != dataZ.value()) { throw cms::Exception("TestError") << "Exptected value for Z " << expectedValuesZ_[found - runsToGetDataFor_.begin()] << " but saw " - << dataZ->value(); + << dataZ.value(); } } } @@ -202,16 +203,17 @@ namespace edmtest { class ESTestAnalyzerJ : public edm::stream::EDAnalyzer<> { public: - explicit ESTestAnalyzerJ(edm::ParameterSet const&) {} + explicit ESTestAnalyzerJ(edm::ParameterSet const&) : dataJToken_(esConsumes()) {} void analyze(const edm::Event&, const edm::EventSetup&) override; + + private: + const edm::ESGetToken dataJToken_; }; void ESTestAnalyzerJ::analyze(edm::Event const& ev, edm::EventSetup const& es) { - ESTestRecordJ const& recJ = es.get(); - edm::ESHandle dataJ; - recJ.get(dataJ); + ESTestDataJ const& dataJ = es.getData(dataJToken_); edm::LogAbsolute("ESTestAnalyzerJ") << "ESTestAnalyzerJ: process = " << moduleDescription().processName() - << ": Data values = " << dataJ->value(); + << ": Data values = " << dataJ.value(); } class ESTestAnalyzerL : public edm::stream::EDAnalyzer<> { diff --git a/FWCore/Integration/test/ThinningThingProducer.cc b/FWCore/Integration/test/ThinningThingProducer.cc index 9291a455d93c1..1345c5e32e537 100644 --- a/FWCore/Integration/test/ThinningThingProducer.cc +++ b/FWCore/Integration/test/ThinningThingProducer.cc @@ -40,6 +40,8 @@ namespace edmtest { private: edm::EDGetTokenT trackToken_; + edm::ESGetToken whatsItToken_; + std::set keysToSave_; unsigned int offsetToThinnedKey_; unsigned int offsetToValue_; @@ -49,6 +51,7 @@ namespace edmtest { ThinningThingSelector::ThinningThingSelector(edm::ParameterSet const& pset, edm::ConsumesCollector&& cc) { trackToken_ = cc.consumes(pset.getParameter("trackTag")); + whatsItToken_ = cc.esConsumes(); offsetToThinnedKey_ = pset.getParameter("offsetToThinnedKey"); offsetToValue_ = pset.getParameter("offsetToValue"); expectedCollectionSize_ = pset.getParameter("expectedCollectionSize"); @@ -80,8 +83,7 @@ namespace edmtest { } // Just checking to see the EventSetup works from here. Not really using it for anything. - edm::ESHandle pSetup; - es.get().get(pSetup); + edm::ESHandle pSetup = es.getHandle(whatsItToken_); pSetup.isValid(); } diff --git a/FWCore/Integration/test/WhatsItAnalyzer.cc b/FWCore/Integration/test/WhatsItAnalyzer.cc index 1b067576bab0c..6b41976599f28 100644 --- a/FWCore/Integration/test/WhatsItAnalyzer.cc +++ b/FWCore/Integration/test/WhatsItAnalyzer.cc @@ -22,7 +22,7 @@ #include // user include files -#include "FWCore/Framework/interface/EDAnalyzer.h" +#include "FWCore/Framework/interface/one/EDAnalyzer.h" #include "FWCore/Framework/interface/MakerMacros.h" @@ -39,7 +39,7 @@ namespace edmtest { - class WhatsItAnalyzer : public edm::EDAnalyzer { + class WhatsItAnalyzer : public edm::one::EDAnalyzer<> { public: explicit WhatsItAnalyzer(const edm::ParameterSet&); ~WhatsItAnalyzer(); @@ -47,10 +47,14 @@ namespace edmtest { virtual void analyze(const edm::Event&, const edm::EventSetup&); private: - void getAndTest(GadgetRcd const& record, edm::ESHandle& handle, int expectedValue, const char* label); + void getAndTest(edm::EventSetup const&, + edm::ESGetToken token, + int expectedValue, + const char* label); // ----------member data --------------------------- std::vector expectedValues_; + std::vector, const char*>> tokenAndLabel_; unsigned int index_; }; @@ -66,9 +70,15 @@ namespace edmtest { // constructors and destructor // WhatsItAnalyzer::WhatsItAnalyzer(const edm::ParameterSet& iConfig) - : expectedValues_(iConfig.getUntrackedParameter >("expectedValues", std::vector())), + : expectedValues_(iConfig.getUntrackedParameter>("expectedValues", std::vector())), + tokenAndLabel_(5), index_(0) { //now do what ever initialization is needed + int i = 0; + for (auto l : std::vector({"", "A", "B", "C", "D"})) { + tokenAndLabel_[i].first = esConsumes(edm::ESInputTag("", l)); + tokenAndLabel_[i++].second = l; + } } WhatsItAnalyzer::~WhatsItAnalyzer() { @@ -82,27 +92,22 @@ namespace edmtest { // ------------ method called to produce the data ------------ void WhatsItAnalyzer::analyze(const edm::Event& /*iEvent*/, const edm::EventSetup& iSetup) { - edm::ESHandle pSetup; - GadgetRcd const& gadgetRcd = iSetup.get(); - if (index_ < expectedValues_.size()) { int expectedValue = expectedValues_.at(index_); - getAndTest(gadgetRcd, pSetup, expectedValue, ""); - getAndTest(gadgetRcd, pSetup, expectedValue, "A"); - getAndTest(gadgetRcd, pSetup, expectedValue, "B"); - getAndTest(gadgetRcd, pSetup, expectedValue, "C"); - getAndTest(gadgetRcd, pSetup, expectedValue, "D"); + for (auto const& tl : tokenAndLabel_) { + getAndTest(iSetup, tl.first, expectedValue, tl.second); + } ++index_; } } - void WhatsItAnalyzer::getAndTest(GadgetRcd const& record, - edm::ESHandle& handle, + void WhatsItAnalyzer::getAndTest(const edm::EventSetup& iSetup, + edm::ESGetToken token, int expectedValue, const char* label) { - record.get(label, handle); - if (expectedValue != handle->a) { - throw cms::Exception("TestFail") << label << ": expected value " << expectedValue << " but got " << handle->a; + auto const& v = iSetup.getData(token); + if (expectedValue != v.a) { + throw cms::Exception("TestFail") << label << ": expected value " << expectedValue << " but got " << v.a; } } } // namespace edmtest diff --git a/FWCore/Integration/test/WhatsItWatcherAnalyzer.cc b/FWCore/Integration/test/WhatsItWatcherAnalyzer.cc index 64d74c6a792ac..f1e6c0718c426 100644 --- a/FWCore/Integration/test/WhatsItWatcherAnalyzer.cc +++ b/FWCore/Integration/test/WhatsItWatcherAnalyzer.cc @@ -53,6 +53,8 @@ namespace edmtest { edm::ESWatcher watch1_; edm::ESWatcher watch2_; edm::ESWatcher watchBool_; + + edm::ESGetToken token_; }; // @@ -69,7 +71,8 @@ namespace edmtest { WhatsItWatcherAnalyzer::WhatsItWatcherAnalyzer(const edm::ParameterSet& /*iConfig*/) : watch1_(this, &WhatsItWatcherAnalyzer::watch1), watch2_(std::bind(&WhatsItWatcherAnalyzer::watch2, this, std::placeholders::_1)), - watchBool_() { + watchBool_(), + token_(esConsumes()) { //now do what ever initialization is needed } @@ -92,15 +95,13 @@ namespace edmtest { } void WhatsItWatcherAnalyzer::watch1(const GadgetRcd& iRcd) { - edm::ESHandle pSetup; - iRcd.get(pSetup); + edm::ESHandle pSetup = iRcd.getHandle(token_); std::cout << "watch1: WhatsIt " << pSetup->a << " changed" << std::endl; } void WhatsItWatcherAnalyzer::watch2(const GadgetRcd& iRcd) { - edm::ESHandle pSetup; - iRcd.get(pSetup); + edm::ESHandle pSetup = iRcd.getHandle(token_); std::cout << "watch2: WhatsIt " << pSetup->a << " changed" << std::endl; } diff --git a/FWCore/Integration/test/testSubProcessEventSetup_cfg.py b/FWCore/Integration/test/testSubProcessEventSetup_cfg.py index 1b97b507bb7bc..22f58781279db 100644 --- a/FWCore/Integration/test/testSubProcessEventSetup_cfg.py +++ b/FWCore/Integration/test/testSubProcessEventSetup_cfg.py @@ -258,9 +258,9 @@ process4.esTestAnalyzerAZ = cms.EDAnalyzer("ESTestAnalyzerAZ", runsToGetDataFor = cms.vint32(3,4,5,6,7,8,9,10), - #NOTE: This module does NOT do prefetching - expectedValuesA=cms.untracked.vint32(1,2,3,4,5,6,7,7), - expectedValuesZ=cms.untracked.vint32(1,1,2,2,3,3,4,4) + #NOTE: This module does do prefetching + expectedValuesA=cms.untracked.vint32(3,4,5,6,7,8,9,9), + expectedValuesZ=cms.untracked.vint32(3,3,4,4,5,5,6,6) ) process4.path1 = cms.Path(process4.esTestAnalyzerA*process4.esTestAnalyzerAZ) @@ -311,9 +311,9 @@ process5.esTestAnalyzerAZ = cms.EDAnalyzer("ESTestAnalyzerAZ", runsToGetDataFor = cms.vint32(5,6,7,8,9,10), - #NOTE: This module does NOT do prefetching - expectedValuesA=cms.untracked.vint32(3,4,5,6,7,7), - expectedValuesZ=cms.untracked.vint32(2,2,3,3,4,4) + #NOTE: This module does do prefetching + expectedValuesA=cms.untracked.vint32(5,6,7,8,9,9), + expectedValuesZ=cms.untracked.vint32(4,4,5,5,6,6) ) process5.path1 = cms.Path(process5.esTestAnalyzerA*process5.esTestAnalyzerAZ) diff --git a/FWCore/Integration/test/unit_test_outputs/testSubProcessEventSetup1.grep.txt b/FWCore/Integration/test/unit_test_outputs/testSubProcessEventSetup1.grep.txt index d8140f99571a2..48a022c95aab1 100644 --- a/FWCore/Integration/test/unit_test_outputs/testSubProcessEventSetup1.grep.txt +++ b/FWCore/Integration/test/unit_test_outputs/testSubProcessEventSetup1.grep.txt @@ -16,67 +16,67 @@ ESTestAnalyzerB: process = TEST4: Data value = 3 ESTestAnalyzerB: process = TEST10: Data value = 3 ESTestAnalyzerB: process = TEST: Data value = 4 ESTestAnalyzerB: process = TEST1: Data value = 4 -ESTestAnalyzerB: process = TEST2: Data value = 3 -ESTestAnalyzerB: process = TEST5: Data value = 1 +ESTestAnalyzerB: process = TEST2: Data value = 4 +ESTestAnalyzerB: process = TEST5: Data value = 4 ESTestAnalyzerB: process = TEST10: Data value = 4 ESTestAnalyzerB: process = TEST: Data value = 5 ESTestAnalyzerB: process = TEST1: Data value = 5 -ESTestAnalyzerB: process = TEST2: Data value = 4 -ESTestAnalyzerB: process = TEST3: Data value = 4 -ESTestAnalyzerB: process = TEST5: Data value = 2 -ESTestAnalyzerB: process = TEST6: Data value = 1 +ESTestAnalyzerB: process = TEST2: Data value = 5 +ESTestAnalyzerB: process = TEST3: Data value = 5 +ESTestAnalyzerB: process = TEST5: Data value = 5 +ESTestAnalyzerB: process = TEST6: Data value = 5 ESTestAnalyzerB: process = TEST10: Data value = 5 ESTestAnalyzerB: process = TEST: Data value = 6 ESTestAnalyzerB: process = TEST1: Data value = 6 -ESTestAnalyzerB: process = TEST2: Data value = 5 -ESTestAnalyzerB: process = TEST3: Data value = 5 -ESTestAnalyzerB: process = TEST4: Data value = 5 -ESTestAnalyzerB: process = TEST5: Data value = 3 -ESTestAnalyzerB: process = TEST6: Data value = 2 -ESTestAnalyzerB: process = TEST7: Data value = 1 -ESTestAnalyzerB: process = TEST: Data value = 7 -ESTestAnalyzerB: process = TEST1: Data value = 7 ESTestAnalyzerB: process = TEST2: Data value = 6 ESTestAnalyzerB: process = TEST3: Data value = 6 ESTestAnalyzerB: process = TEST4: Data value = 6 -ESTestAnalyzerB: process = TEST5: Data value = 4 -ESTestAnalyzerB: process = TEST6: Data value = 3 -ESTestAnalyzerB: process = TEST7: Data value = 2 -ESTestAnalyzerB: process = TEST8: Data value = 1 -ESTestAnalyzerB: process = TEST10: Data value = 6 -ESTestAnalyzerB: process = TEST: Data value = 8 -ESTestAnalyzerB: process = TEST1: Data value = 8 +ESTestAnalyzerB: process = TEST5: Data value = 6 +ESTestAnalyzerB: process = TEST6: Data value = 6 +ESTestAnalyzerB: process = TEST7: Data value = 6 +ESTestAnalyzerB: process = TEST: Data value = 7 +ESTestAnalyzerB: process = TEST1: Data value = 7 ESTestAnalyzerB: process = TEST2: Data value = 7 ESTestAnalyzerB: process = TEST3: Data value = 7 ESTestAnalyzerB: process = TEST4: Data value = 7 -ESTestAnalyzerB: process = TEST5: Data value = 5 -ESTestAnalyzerB: process = TEST6: Data value = 4 -ESTestAnalyzerB: process = TEST7: Data value = 3 -ESTestAnalyzerB: process = TEST8: Data value = 2 -ESTestAnalyzerB: process = TEST9: Data value = 1 +ESTestAnalyzerB: process = TEST5: Data value = 7 +ESTestAnalyzerB: process = TEST6: Data value = 7 +ESTestAnalyzerB: process = TEST7: Data value = 7 +ESTestAnalyzerB: process = TEST8: Data value = 7 ESTestAnalyzerB: process = TEST10: Data value = 7 -ESTestAnalyzerB: process = TEST: Data value = 9 -ESTestAnalyzerB: process = TEST1: Data value = 9 +ESTestAnalyzerB: process = TEST: Data value = 8 +ESTestAnalyzerB: process = TEST1: Data value = 8 ESTestAnalyzerB: process = TEST2: Data value = 8 ESTestAnalyzerB: process = TEST3: Data value = 8 ESTestAnalyzerB: process = TEST4: Data value = 8 -ESTestAnalyzerB: process = TEST5: Data value = 6 -ESTestAnalyzerB: process = TEST6: Data value = 5 -ESTestAnalyzerB: process = TEST7: Data value = 4 -ESTestAnalyzerB: process = TEST8: Data value = 3 -ESTestAnalyzerB: process = TEST9: Data value = 2 +ESTestAnalyzerB: process = TEST5: Data value = 8 +ESTestAnalyzerB: process = TEST6: Data value = 8 +ESTestAnalyzerB: process = TEST7: Data value = 8 +ESTestAnalyzerB: process = TEST8: Data value = 8 +ESTestAnalyzerB: process = TEST9: Data value = 8 ESTestAnalyzerB: process = TEST10: Data value = 8 ESTestAnalyzerB: process = TEST: Data value = 9 ESTestAnalyzerB: process = TEST1: Data value = 9 -ESTestAnalyzerB: process = TEST2: Data value = 8 -ESTestAnalyzerB: process = TEST3: Data value = 8 -ESTestAnalyzerB: process = TEST4: Data value = 8 -ESTestAnalyzerB: process = TEST5: Data value = 6 -ESTestAnalyzerB: process = TEST6: Data value = 5 -ESTestAnalyzerB: process = TEST7: Data value = 4 -ESTestAnalyzerB: process = TEST8: Data value = 3 -ESTestAnalyzerB: process = TEST9: Data value = 2 -ESTestAnalyzerB: process = TEST10: Data value = 8 +ESTestAnalyzerB: process = TEST2: Data value = 9 +ESTestAnalyzerB: process = TEST3: Data value = 9 +ESTestAnalyzerB: process = TEST4: Data value = 9 +ESTestAnalyzerB: process = TEST5: Data value = 9 +ESTestAnalyzerB: process = TEST6: Data value = 9 +ESTestAnalyzerB: process = TEST7: Data value = 9 +ESTestAnalyzerB: process = TEST8: Data value = 9 +ESTestAnalyzerB: process = TEST9: Data value = 9 +ESTestAnalyzerB: process = TEST10: Data value = 9 +ESTestAnalyzerB: process = TEST: Data value = 9 +ESTestAnalyzerB: process = TEST1: Data value = 9 +ESTestAnalyzerB: process = TEST2: Data value = 9 +ESTestAnalyzerB: process = TEST3: Data value = 9 +ESTestAnalyzerB: process = TEST4: Data value = 9 +ESTestAnalyzerB: process = TEST5: Data value = 9 +ESTestAnalyzerB: process = TEST6: Data value = 9 +ESTestAnalyzerB: process = TEST7: Data value = 9 +ESTestAnalyzerB: process = TEST8: Data value = 9 +ESTestAnalyzerB: process = TEST9: Data value = 9 +ESTestAnalyzerB: process = TEST10: Data value = 9 ESTestAnalyzerK: process = TEST: Data value = 1 ESTestAnalyzerK: process = TEST1: Data value = 1 ESTestAnalyzerK: process = TEST2: Data value = 1 @@ -85,25 +85,25 @@ ESTestAnalyzerK: process = TEST: Data value = 3 ESTestAnalyzerK: process = TEST1: Data value = 3 ESTestAnalyzerK: process = TEST: Data value = 4 ESTestAnalyzerK: process = TEST1: Data value = 4 -ESTestAnalyzerK: process = TEST2: Data value = 2 +ESTestAnalyzerK: process = TEST2: Data value = 4 ESTestAnalyzerK: process = TEST: Data value = 5 ESTestAnalyzerK: process = TEST1: Data value = 5 -ESTestAnalyzerK: process = TEST2: Data value = 3 +ESTestAnalyzerK: process = TEST2: Data value = 5 ESTestAnalyzerK: process = TEST: Data value = 6 ESTestAnalyzerK: process = TEST1: Data value = 6 -ESTestAnalyzerK: process = TEST2: Data value = 4 +ESTestAnalyzerK: process = TEST2: Data value = 6 ESTestAnalyzerK: process = TEST: Data value = 7 ESTestAnalyzerK: process = TEST1: Data value = 7 -ESTestAnalyzerK: process = TEST2: Data value = 5 +ESTestAnalyzerK: process = TEST2: Data value = 7 ESTestAnalyzerK: process = TEST: Data value = 8 ESTestAnalyzerK: process = TEST1: Data value = 8 -ESTestAnalyzerK: process = TEST2: Data value = 6 +ESTestAnalyzerK: process = TEST2: Data value = 8 ESTestAnalyzerK: process = TEST: Data value = 9 ESTestAnalyzerK: process = TEST1: Data value = 9 -ESTestAnalyzerK: process = TEST2: Data value = 7 +ESTestAnalyzerK: process = TEST2: Data value = 9 ESTestAnalyzerK: process = TEST: Data value = 9 ESTestAnalyzerK: process = TEST1: Data value = 9 -ESTestAnalyzerK: process = TEST2: Data value = 7 +ESTestAnalyzerK: process = TEST2: Data value = 9 Sharing ESSource: class=EmptyESSource label='emptyESSourceB' Sharing ESSource: class=EmptyESSource label='emptyESSourceC' Sharing ESSource: class=EmptyESSource label='emptyESSourceD' diff --git a/FWCore/MessageLogger/python/MessageLogger_cfi.py b/FWCore/MessageLogger/python/MessageLogger_cfi.py index 03fbc08480b71..3047fb252bcb7 100644 --- a/FWCore/MessageLogger/python/MessageLogger_cfi.py +++ b/FWCore/MessageLogger/python/MessageLogger_cfi.py @@ -1,4 +1,2 @@ -import FWCore.ParameterSet.Config as cms - -from FWCore.MessageService.MessageLogger_cfi import * +from FWCore.ParameterSet.MessageLogger import * diff --git a/FWCore/MessageService/python/MessageLogger_cfi.py b/FWCore/MessageService/python/MessageLogger_cfi.py index 88fa79fac2eb5..28523953bf054 100644 --- a/FWCore/MessageService/python/MessageLogger_cfi.py +++ b/FWCore/MessageService/python/MessageLogger_cfi.py @@ -1,91 +1 @@ -import FWCore.ParameterSet.Config as cms - -_category = cms.optional.untracked.PSetTemplate( - reportEvery = cms.untracked.int32(1), - limit = cms.optional.untracked.int32, - timespan = cms.optional.untracked.int32 -) - -_destination_base = cms.untracked.PSet( - noLineBreaks = cms.optional.untracked.bool, - noTimeStamps = cms.optional.untracked.bool, - lineLength = cms.optional.untracked.int32, - threshold = cms.optional.untracked.string, - statisticsThreshold = cms.optional.untracked.string, - allowAnyLabel_ = _category -) -_destination_no_stat = _destination_base.clone( - enableStatistics = cms.untracked.bool(False), - resetStatistics = cms.untracked.bool(False) -) - -_file_destination = cms.optional.untracked.PSetTemplate( - noLineBreaks = cms.optional.untracked.bool, - noTimeStamps = cms.optional.untracked.bool, - lineLength = cms.optional.untracked.int32, - threshold = cms.optional.untracked.string, - statisticsThreshold = cms.optional.untracked.string, - enableStatistics = cms.untracked.bool(False), - resetStatistics = cms.untracked.bool(False), - filename = cms.optional.untracked.string, - extension = cms.optional.untracked.string, - output = cms.optional.untracked.string, - allowAnyLabel_ = _category -) - -_default_pset = cms.untracked.PSet( - reportEvery = cms.untracked.int32(1), - limit = cms.optional.untracked.int32, - timespan = cms.optional.untracked.int32, - - noLineBreaks = cms.untracked.bool(False), - noTimeStamps = cms.untracked.bool(False), - lineLength = cms.untracked.int32(80), - threshold = cms.untracked.string("INFO"), - statisticsThreshold = cms.untracked.string("INFO"), - allowAnyLabel_ = _category -) - - -MessageLogger = cms.Service("MessageLogger", - suppressWarning = cms.untracked.vstring(), - suppressFwkInfo = cms.untracked.vstring(), - suppressInfo = cms.untracked.vstring(), - suppressDebug = cms.untracked.vstring(), - debugModules = cms.untracked.vstring(), - cout = _destination_no_stat.clone( - enable = cms.untracked.bool(False) - ), - default = _default_pset.clone(), - cerr = _destination_base.clone( - enable = cms.untracked.bool(True), - enableStatistics = cms.untracked.bool(True), - resetStatistics = cms.untracked.bool(False), - statisticsThreshold = cms.untracked.string('WARNING'), - INFO = cms.untracked.PSet( - limit = cms.untracked.int32(0) - ), - noTimeStamps = cms.untracked.bool(False), - FwkReport = cms.untracked.PSet( - reportEvery = cms.untracked.int32(1), - limit = cms.untracked.int32(10000000) - ), - default = cms.untracked.PSet( - limit = cms.untracked.int32(10000000) - ), - Root_NoDictionary = cms.untracked.PSet( - limit = cms.untracked.int32(0) - ), - FwkSummary = cms.untracked.PSet( - reportEvery = cms.untracked.int32(1), - limit = cms.untracked.int32(10000000) - ), - threshold = cms.untracked.string('INFO') - ), - files = cms.untracked.PSet( - allowAnyLabel_ = _file_destination - ), - allowAnyLabel_ = _category -) - - +from FWCore.ParameterSet.MessageLogger import MessageLogger diff --git a/FWCore/MessageService/test/fmt_test.cppunit.cpp b/FWCore/MessageService/test/fmt_test.cppunit.cpp index d322975bff237..2ae6644312e4a 100644 --- a/FWCore/MessageService/test/fmt_test.cppunit.cpp +++ b/FWCore/MessageService/test/fmt_test.cppunit.cpp @@ -55,10 +55,10 @@ void test_fmt_external::test_fmt() CPPUNIT_ASSERT(s_check == s); auto args = capture("{} {}", 42, "foo"); std::apply(print_message, args); - fmt::memory_buffer buf; - format_to(buf, "{}", 42); // replaces itoa(42, buffer, 10) + auto buf = fmt::memory_buffer(); + format_to(std::back_inserter(buf), "{}", 42); // replaces itoa(42, buffer, 10) fmt::print(to_string(buf)); - format_to(buf, "{:x}", 42); // replaces itoa(42, buffer, 16) + format_to(std::back_inserter(buf), "{:x}", 42); // replaces itoa(42, buffer, 16) fmt::print(to_string(buf)); } #include diff --git a/FWCore/Modules/src/EventContentAnalyzer.cc b/FWCore/Modules/src/EventContentAnalyzer.cc index 447bc64694335..ca813d12bd36d 100644 --- a/FWCore/Modules/src/EventContentAnalyzer.cc +++ b/FWCore/Modules/src/EventContentAnalyzer.cc @@ -436,11 +436,6 @@ namespace edm { for (nameMap::const_iterator it = cumulates_.begin(), itEnd = cumulates_.end(); it != itEnd; ++it) { LogAbsolute("EventContent") << std::setw(6) << it->second << " occurrences of key " << it->first << std::endl; } - - // Test boost::lexical_cast We don't need this right now so comment it out. - // int k = 137; - // std::string ktext = boost::lexical_cast(k); - // std::cout << "\nInteger " << k << " expressed as a string is |" << ktext << "|" << std::endl; } void EventContentAnalyzer::fillDescriptions(ConfigurationDescriptions& descriptions) { diff --git a/FWCore/Modules/src/LogErrorHarvester.cc b/FWCore/Modules/src/LogErrorHarvester.cc index 85439397c18cb..dce5163639078 100644 --- a/FWCore/Modules/src/LogErrorHarvester.cc +++ b/FWCore/Modules/src/LogErrorHarvester.cc @@ -50,7 +50,7 @@ namespace edm { EDPutTokenT> token_; }; - LogErrorHarvester::LogErrorHarvester(ParameterSet const& iPSet) : token_{produces>()} { + LogErrorHarvester::LogErrorHarvester(ParameterSet const& iPSet) : token_{produces()} { const edm::TypeID endPathStatusType{typeid(edm::EndPathStatus)}; const edm::TypeID pathStatusType{typeid(edm::PathStatus)}; const edm::TypeID triggerResultsType{typeid(edm::TriggerResults)}; diff --git a/FWCore/ParameterSet/python/Config.py b/FWCore/ParameterSet/python/Config.py index e4fdcb0367e82..c6d198ba04ed6 100644 --- a/FWCore/ParameterSet/python/Config.py +++ b/FWCore/ParameterSet/python/Config.py @@ -18,6 +18,7 @@ from .SequenceTypes import * from .SequenceTypes import _ModuleSequenceType, _Sequenceable #extend needs it from .SequenceVisitors import PathValidator, EndPathValidator, ScheduleTaskValidator, NodeVisitor, CompositeVisitor, ModuleNamesFromGlobalsVisitor +from .MessageLogger import MessageLogger from . import DictTypes from .ExceptionHandling import * @@ -137,6 +138,11 @@ def __init__(self,name,*Mods): self.options = Process.defaultOptions_() self.maxEvents = Process.defaultMaxEvents_() self.maxLuminosityBlocks = Process.defaultMaxLuminosityBlocks_() + # intentionally not cloned to ensure that everyone taking + # MessageLogger still via + # FWCore.Message(Logger|Service).MessageLogger_cfi + # use the very same MessageLogger object. + self.MessageLogger = MessageLogger for m in self.__modifiers: m._setChosen() @@ -1479,6 +1485,14 @@ def __init__(self,process, SelectEvents = untracked.PSet(), outputCommands = unt self.__process = process self.__SelectEvents = SelectEvents self.__outputCommands = outputCommands + # Need to remove MessageLogger from the subprocess now that MessageLogger is always present + if self.__process.MessageLogger is not MessageLogger: + print("""Warning: You have reconfigured service +'edm::MessageLogger' in a subprocess. +This service has already been configured. +This particular service may not be reconfigured in a subprocess. +The reconfiguration will be ignored.""") + del self.__process.MessageLogger def dumpPython(self, options=PrintOptions()): out = "parentProcess"+str(hash(self))+" = process\n" out += self.__process.dumpPython() @@ -1885,9 +1899,9 @@ def testProcessInsertion(self): p.a = EDAnalyzer("MyAnalyzer") self.assertTrue( 'a' in p.analyzers_() ) self.assertTrue( 'a' in p.analyzers) - p.add_(Service("MessageLogger")) - self.assertTrue('MessageLogger' in p.services_()) - self.assertEqual(p.MessageLogger.type_(), "MessageLogger") + p.add_(Service("SomeService")) + self.assertTrue('SomeService' in p.services_()) + self.assertEqual(p.SomeService.type_(), "SomeService") p.Tracer = Service("Tracer") self.assertTrue('Tracer' in p.services_()) self.assertRaises(TypeError, setattr, *(p,'b',"this should fail")) @@ -2036,6 +2050,101 @@ def testProcessDumpPython(self): wantSummary = cms.untracked.bool(False) ) +process.MessageLogger = cms.Service("MessageLogger", + cerr = cms.untracked.PSet( + FwkReport = cms.untracked.PSet( + limit = cms.untracked.int32(10000000), + reportEvery = cms.untracked.int32(1) + ), + FwkSummary = cms.untracked.PSet( + limit = cms.untracked.int32(10000000), + reportEvery = cms.untracked.int32(1) + ), + INFO = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ), + Root_NoDictionary = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ), + default = cms.untracked.PSet( + limit = cms.untracked.int32(10000000) + ), + enable = cms.untracked.bool(True), + enableStatistics = cms.untracked.bool(True), + lineLength = cms.optional.untracked.int32, + noLineBreaks = cms.optional.untracked.bool, + noTimeStamps = cms.untracked.bool(False), + resetStatistics = cms.untracked.bool(False), + statisticsThreshold = cms.untracked.string('WARNING'), + threshold = cms.untracked.string('INFO'), + allowAnyLabel_=cms.optional.untracked.PSetTemplate( + limit = cms.optional.untracked.int32, + reportEvery = cms.untracked.int32(1), + timespan = cms.optional.untracked.int32 + ) + ), + cout = cms.untracked.PSet( + enable = cms.untracked.bool(False), + enableStatistics = cms.untracked.bool(False), + lineLength = cms.optional.untracked.int32, + noLineBreaks = cms.optional.untracked.bool, + noTimeStamps = cms.optional.untracked.bool, + resetStatistics = cms.untracked.bool(False), + statisticsThreshold = cms.optional.untracked.string, + threshold = cms.optional.untracked.string, + allowAnyLabel_=cms.optional.untracked.PSetTemplate( + limit = cms.optional.untracked.int32, + reportEvery = cms.untracked.int32(1), + timespan = cms.optional.untracked.int32 + ) + ), + debugModules = cms.untracked.vstring(), + default = cms.untracked.PSet( + limit = cms.optional.untracked.int32, + lineLength = cms.untracked.int32(80), + noLineBreaks = cms.untracked.bool(False), + noTimeStamps = cms.untracked.bool(False), + reportEvery = cms.untracked.int32(1), + statisticsThreshold = cms.untracked.string('INFO'), + threshold = cms.untracked.string('INFO'), + timespan = cms.optional.untracked.int32, + allowAnyLabel_=cms.optional.untracked.PSetTemplate( + limit = cms.optional.untracked.int32, + reportEvery = cms.untracked.int32(1), + timespan = cms.optional.untracked.int32 + ) + ), + files = cms.untracked.PSet( + allowAnyLabel_=cms.optional.untracked.PSetTemplate( + enableStatistics = cms.untracked.bool(False), + extension = cms.optional.untracked.string, + filename = cms.optional.untracked.string, + lineLength = cms.optional.untracked.int32, + noLineBreaks = cms.optional.untracked.bool, + noTimeStamps = cms.optional.untracked.bool, + output = cms.optional.untracked.string, + resetStatistics = cms.untracked.bool(False), + statisticsThreshold = cms.optional.untracked.string, + threshold = cms.optional.untracked.string, + allowAnyLabel_=cms.optional.untracked.PSetTemplate( + limit = cms.optional.untracked.int32, + reportEvery = cms.untracked.int32(1), + timespan = cms.optional.untracked.int32 + ) + ) + ), + suppressDebug = cms.untracked.vstring(), + suppressFwkInfo = cms.untracked.vstring(), + suppressInfo = cms.untracked.vstring(), + suppressWarning = cms.untracked.vstring(), + allowAnyLabel_=cms.optional.untracked.PSetTemplate( + limit = cms.optional.untracked.int32, + reportEvery = cms.untracked.int32(1), + timespan = cms.optional.untracked.int32 + ) +) + + """) p = Process("test") p.a = EDAnalyzer("MyAnalyzer") @@ -2842,7 +2951,19 @@ def testSubProcess(self): process.addSubProcess(cms.SubProcess(process = childProcess, SelectEvents = cms.untracked.PSet( ), outputCommands = cms.untracked.vstring()))""" equalD = equalD.replace("parentProcess","parentProcess"+str(hash(process.subProcesses_()[0]))) - self.assertEqual(_lineDiff(d,Process('Parent').dumpPython()+Process('Child').dumpPython()),equalD) + # SubProcesses are dumped before Services, so in order to + # craft the dump of the Parent and Child manually the dump + # of the Parent needs to be split at the MessageLogger + # boundary (now when it is part of Process by default), + # and insert the dump of the Child between the top part of + # the Parent (before MessageLogger) and the bottom part of + # the Parent (after and including MessageLogger) + messageLoggerSplit = 'process.MessageLogger = cms.Service' + parentDumpSplit = Process('Parent').dumpPython().split(messageLoggerSplit) + childProcess = Process('Child') + del childProcess.MessageLogger + combinedDump = parentDumpSplit[0] + childProcess.dumpPython() + messageLoggerSplit + parentDumpSplit[1] + self.assertEqual(_lineDiff(d, combinedDump), equalD) p = TestMakePSet() process.fillProcessDesc(p) self.assertEqual((True,['a']),p.values["subProcesses"][1][0].values["process"][1].values['@all_modules']) diff --git a/FWCore/ParameterSet/python/MessageLogger.py b/FWCore/ParameterSet/python/MessageLogger.py new file mode 100644 index 0000000000000..9f7f25796c971 --- /dev/null +++ b/FWCore/ParameterSet/python/MessageLogger.py @@ -0,0 +1,93 @@ +#import FWCore.ParameterSet.Config as cms +from .Types import * +from .Modules import Service + +_category = optional.untracked.PSetTemplate( + reportEvery = untracked.int32(1), + limit = optional.untracked.int32, + timespan = optional.untracked.int32 +) + +_destination_base = untracked.PSet( + noLineBreaks = optional.untracked.bool, + noTimeStamps = optional.untracked.bool, + lineLength = optional.untracked.int32, + threshold = optional.untracked.string, + statisticsThreshold = optional.untracked.string, + allowAnyLabel_ = _category +) +_destination_no_stat = _destination_base.clone( + enableStatistics = untracked.bool(False), + resetStatistics = untracked.bool(False) +) + +_file_destination = optional.untracked.PSetTemplate( + noLineBreaks = optional.untracked.bool, + noTimeStamps = optional.untracked.bool, + lineLength = optional.untracked.int32, + threshold = optional.untracked.string, + statisticsThreshold = optional.untracked.string, + enableStatistics = untracked.bool(False), + resetStatistics = untracked.bool(False), + filename = optional.untracked.string, + extension = optional.untracked.string, + output = optional.untracked.string, + allowAnyLabel_ = _category +) + +_default_pset = untracked.PSet( + reportEvery = untracked.int32(1), + limit = optional.untracked.int32, + timespan = optional.untracked.int32, + + noLineBreaks = untracked.bool(False), + noTimeStamps = untracked.bool(False), + lineLength = untracked.int32(80), + threshold = untracked.string("INFO"), + statisticsThreshold = untracked.string("INFO"), + allowAnyLabel_ = _category +) + + +MessageLogger = Service("MessageLogger", + suppressWarning = untracked.vstring(), + suppressFwkInfo = untracked.vstring(), + suppressInfo = untracked.vstring(), + suppressDebug = untracked.vstring(), + debugModules = untracked.vstring(), + cout = _destination_no_stat.clone( + enable = untracked.bool(False) + ), + default = _default_pset.clone(), + cerr = _destination_base.clone( + enable = untracked.bool(True), + enableStatistics = untracked.bool(True), + resetStatistics = untracked.bool(False), + statisticsThreshold = untracked.string('WARNING'), + INFO = untracked.PSet( + limit = untracked.int32(0) + ), + noTimeStamps = untracked.bool(False), + FwkReport = untracked.PSet( + reportEvery = untracked.int32(1), + limit = untracked.int32(10000000) + ), + default = untracked.PSet( + limit = untracked.int32(10000000) + ), + Root_NoDictionary = untracked.PSet( + limit = untracked.int32(0) + ), + FwkSummary = untracked.PSet( + reportEvery = untracked.int32(1), + limit = untracked.int32(10000000) + ), + threshold = untracked.string('INFO') + ), + files = untracked.PSet( + allowAnyLabel_ = _file_destination + ), + allowAnyLabel_ = _category +) + + diff --git a/FWCore/ParameterSet/src/types.cc b/FWCore/ParameterSet/src/types.cc index d5b81cf890cec..bb62c1c6f41e8 100644 --- a/FWCore/ParameterSet/src/types.cc +++ b/FWCore/ParameterSet/src/types.cc @@ -8,7 +8,6 @@ #include "FWCore/ParameterSet/interface/types.h" -#include "boost/lexical_cast.hpp" #include "FWCore/ParameterSet/src/split.h" #include "FWCore/Utilities/interface/Parse.h" #include @@ -459,9 +458,9 @@ bool edm::decode(double& to, std::string const& from) { else { try { // std::cerr << "from:" << from << std::endl; - to = boost::lexical_cast(from); + to = std::stod(from); // std::cerr << "to:" << to << std::endl; - } catch (boost::bad_lexical_cast&) { + } catch (const std::exception&) { return false; } } @@ -472,7 +471,7 @@ bool edm::decode(double& to, std::string const& from) { bool edm::encode(std::string& to, double from) { std::ostringstream ost; - ost.precision(std::numeric_limits::digits10 + 1); + ost.precision(std::numeric_limits::max_digits10); ost << from; if (!ost) return false; diff --git a/FWCore/PluginManager/src/PluginFactoryBase.cc b/FWCore/PluginManager/src/PluginFactoryBase.cc index 7949753961be4..5a6cc55ac7607 100644 --- a/FWCore/PluginManager/src/PluginFactoryBase.cc +++ b/FWCore/PluginManager/src/PluginFactoryBase.cc @@ -149,7 +149,12 @@ namespace edmplugin { void PluginFactoryBase::registerPMaker(void* iPMaker, const std::string& iName) { assert(nullptr != iPMaker); - m_plugins[iName].push_back(PluginMakerInfo(iPMaker, PluginManager::loadingFile())); + PMakers newMakers; + newMakers.emplace_back(iPMaker, PluginManager::loadingFile()); + if (not m_plugins.emplace(iName, std::move(newMakers)).second) { + //the item was already added + m_plugins[iName].push_back(PluginMakerInfo(iPMaker, PluginManager::loadingFile())); + } newPlugin(iName); } diff --git a/FWCore/PythonParameterSet/test/makeprocess_t.cppunit.cc b/FWCore/PythonParameterSet/test/makeprocess_t.cppunit.cc index eb807819edd5c..45a1b188c8ce9 100644 --- a/FWCore/PythonParameterSet/test/makeprocess_t.cppunit.cc +++ b/FWCore/PythonParameterSet/test/makeprocess_t.cppunit.cc @@ -288,27 +288,10 @@ void testmakeprocess::taskTest() { for (auto const& pset : vpsetServices) { serviceNames.insert(pset.getParameter("@service_type")); } - std::vector expectedServiceNames; - expectedServiceNames.emplace_back("serv1"); - expectedServiceNames.emplace_back("serv2"); - expectedServiceNames.emplace_back("serv11"); - expectedServiceNames.emplace_back("serv12"); - expectedServiceNames.emplace_back("serv13"); - expectedServiceNames.emplace_back("serv14"); - expectedServiceNames.emplace_back("serv15"); - expectedServiceNames.emplace_back("serv16"); - expectedServiceNames.emplace_back("serv17"); - expectedServiceNames.emplace_back("serv18"); - expectedServiceNames.emplace_back("serv19"); - expectedServiceNames.emplace_back("serv20"); - expectedServiceNames.emplace_back("serv21"); - expectedServiceNames.emplace_back("serv22"); - expectedServiceNames.emplace_back("serv23"); - expectedServiceNames.emplace_back("serv24"); - expectedServiceNames.emplace_back("serv25"); - expectedServiceNames.emplace_back("serv26"); - expectedServiceNames.emplace_back("serv27"); - expectedServiceNames.emplace_back("serv28"); + std::vector expectedServiceNames{"MessageLogger", "serv1", "serv2", "serv11", "serv12", "serv13", + "serv14", "serv15", "serv16", "serv17", "serv18", "serv19", + "serv20", "serv21", "serv22", "serv23", "serv24", "serv25", + "serv26", "serv27", "serv28"}; bool result = true; for (auto const& name : expectedServiceNames) { if (serviceNames.find(name) == serviceNames.end()) { @@ -407,11 +390,7 @@ void testmakeprocess::taskTestWithEmptySchedule() { for (auto const& pset : vpsetServices) { serviceNames.insert(pset.getParameter("@service_type")); } - std::vector expectedServiceNames; - expectedServiceNames.emplace_back("serv1"); - expectedServiceNames.emplace_back("serv2"); - expectedServiceNames.emplace_back("serv27"); - expectedServiceNames.emplace_back("serv28"); + std::vector expectedServiceNames{"MessageLogger", "serv1", "serv2", "serv27", "serv28"}; bool result = true; for (auto const& name : expectedServiceNames) { if (serviceNames.find(name) == serviceNames.end()) { @@ -516,29 +495,10 @@ void testmakeprocess::taskTestWithSchedule() { for (auto const& pset : vpsetServices) { serviceNames.insert(pset.getParameter("@service_type")); } - std::vector expectedServiceNames; - expectedServiceNames.emplace_back("serv1"); - expectedServiceNames.emplace_back("serv2"); - expectedServiceNames.emplace_back("serv3"); - expectedServiceNames.emplace_back("serv4"); - expectedServiceNames.emplace_back("serv11"); - expectedServiceNames.emplace_back("serv12"); - expectedServiceNames.emplace_back("serv13"); - expectedServiceNames.emplace_back("serv14"); - expectedServiceNames.emplace_back("serv15"); - expectedServiceNames.emplace_back("serv16"); - expectedServiceNames.emplace_back("serv17"); - expectedServiceNames.emplace_back("serv18"); - expectedServiceNames.emplace_back("serv19"); - expectedServiceNames.emplace_back("serv20"); - expectedServiceNames.emplace_back("serv21"); - expectedServiceNames.emplace_back("serv22"); - expectedServiceNames.emplace_back("serv23"); - expectedServiceNames.emplace_back("serv24"); - expectedServiceNames.emplace_back("serv25"); - expectedServiceNames.emplace_back("serv26"); - expectedServiceNames.emplace_back("serv27"); - expectedServiceNames.emplace_back("serv28"); + std::vector expectedServiceNames{"MessageLogger", "serv1", "serv2", "serv3", "serv4", "serv11", + "serv12", "serv13", "serv14", "serv15", "serv16", "serv17", + "serv18", "serv19", "serv20", "serv21", "serv22", "serv23", + "serv24", "serv25", "serv26", "serv27", "serv28"}; bool result = true; for (auto const& name : expectedServiceNames) { if (serviceNames.find(name) == serviceNames.end()) { diff --git a/FWCore/ServiceRegistry/interface/ModuleCallingContext.h b/FWCore/ServiceRegistry/interface/ModuleCallingContext.h index 3dba2fe27add7..e025e55464bbb 100644 --- a/FWCore/ServiceRegistry/interface/ModuleCallingContext.h +++ b/FWCore/ServiceRegistry/interface/ModuleCallingContext.h @@ -18,6 +18,9 @@ Services as an argument to their callback functions. #include +namespace cms { + class Exception; +} namespace edm { class GlobalContext; @@ -81,6 +84,7 @@ namespace edm { State state_; }; + void exceptionContext(cms::Exception&, ModuleCallingContext const&); std::ostream& operator<<(std::ostream&, ModuleCallingContext const&); } // namespace edm #endif diff --git a/FWCore/ServiceRegistry/interface/TypeInfoHolder.h b/FWCore/ServiceRegistry/interface/TypeInfoHolder.h deleted file mode 100644 index f09e6d65b49fb..0000000000000 --- a/FWCore/ServiceRegistry/interface/TypeInfoHolder.h +++ /dev/null @@ -1,45 +0,0 @@ -#ifndef ServiceRegistry_TypeInfoHolder_h -#define ServiceRegistry_TypeInfoHolder_h - -#include -// -*- C++ -*- -// -// Package: ServiceRegistry -// Class : TypeInfoHolder -// -/**\class TypeInfoHolder TypeInfoHolder.h FWCore/ServiceRegistry/interface/TypeInfoHolder.h - - Description: wrapper to allow std::type_info to be used as a key to a std::map - - Usage: - - -*/ -// -// Original Author: Chris Jones -// Created: Mon Sep 5 14:38:42 EDT 2005 -// - -// system include files - -// user include files - -// forward declarations -namespace edm { - namespace serviceregistry { - - class TypeInfoHolder { - public: - TypeInfoHolder(const std::type_info& iInfo) : m_info(iInfo) {} - const std::type_info& info() const { return m_info;} - - bool operator<(const TypeInfoHolder& iRHS) const { - return m_info.before(iRHS.m_info) ; - } - private: - const std::type_info& m_info; - }; - } -} - -#endif diff --git a/FWCore/ServiceRegistry/src/ModuleCallingContext.cc b/FWCore/ServiceRegistry/src/ModuleCallingContext.cc index 691b6c6b68950..9b3817f8526e8 100644 --- a/FWCore/ServiceRegistry/src/ModuleCallingContext.cc +++ b/FWCore/ServiceRegistry/src/ModuleCallingContext.cc @@ -2,6 +2,8 @@ #include "FWCore/ServiceRegistry/interface/InternalContext.h" #include "FWCore/ServiceRegistry/interface/PathContext.h" #include "FWCore/ServiceRegistry/interface/PlaceInPathContext.h" +#include "FWCore/ServiceRegistry/interface/StreamContext.h" +#include "FWCore/ServiceRegistry/interface/GlobalContext.h" #include "FWCore/Utilities/interface/EDMException.h" #include "DataFormats/Provenance/interface/ModuleDescription.h" @@ -81,6 +83,58 @@ namespace edm { return depth; } + void exceptionContext(cms::Exception& ex, ModuleCallingContext const& mcc) { + ModuleCallingContext const* imcc = &mcc; + while ((imcc->type() == ParentContext::Type::kModule) or (imcc->type() == ParentContext::Type::kInternal)) { + std::ostringstream iost; + if (imcc->state() == ModuleCallingContext::State::kPrefetching) { + iost << "Prefetching for module "; + } else { + iost << "Calling method for module "; + } + iost << imcc->moduleDescription()->moduleName() << "/'" << imcc->moduleDescription()->moduleLabel() << "'"; + + if (imcc->type() == ParentContext::Type::kInternal) { + iost << " (probably inside some kind of mixing module)"; + imcc = imcc->internalContext()->moduleCallingContext(); + } else { + imcc = imcc->moduleCallingContext(); + } + ex.addContext(iost.str()); + } + std::ostringstream ost; + if (imcc->state() == ModuleCallingContext::State::kPrefetching) { + ost << "Prefetching for module "; + } else { + ost << "Calling method for module "; + } + ost << imcc->moduleDescription()->moduleName() << "/'" << imcc->moduleDescription()->moduleLabel() << "'"; + ex.addContext(ost.str()); + + if (imcc->type() == ParentContext::Type::kPlaceInPath) { + ost.str(""); + ost << "Running path '"; + ost << imcc->placeInPathContext()->pathContext()->pathName() << "'"; + ex.addContext(ost.str()); + auto streamContext = imcc->placeInPathContext()->pathContext()->streamContext(); + if (streamContext) { + ost.str(""); + edm::exceptionContext(ost, *streamContext); + ex.addContext(ost.str()); + } + } else { + if (imcc->type() == ParentContext::Type::kStream) { + ost.str(""); + edm::exceptionContext(ost, *(imcc->streamContext())); + ex.addContext(ost.str()); + } else if (imcc->type() == ParentContext::Type::kGlobal) { + ost.str(""); + edm::exceptionContext(ost, *(imcc->globalContext())); + ex.addContext(ost.str()); + } + } + } + std::ostream& operator<<(std::ostream& os, ModuleCallingContext const& mcc) { os << "ModuleCallingContext state = "; switch (mcc.state()) { diff --git a/FWCore/Services/bin/cmsGetFnConnect.cc b/FWCore/Services/bin/cmsGetFnConnect.cc index c3ada5e5b4d4d..602a3679b4d4c 100644 --- a/FWCore/Services/bin/cmsGetFnConnect.cc +++ b/FWCore/Services/bin/cmsGetFnConnect.cc @@ -13,8 +13,7 @@ #include "FWCore/Catalog/interface/SiteLocalConfig.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "FWCore/ServiceRegistry/interface/Service.h" -#include "FWCore/Services/src/SiteLocalConfigService.h" -#include "FWCore/ServiceRegistry/interface/ServiceRegistry.h" +#include "FWCore/Services/interface/setupSiteLocalConfig.h" #include "FWCore/Utilities/interface/Exception.h" #include #include @@ -27,11 +26,7 @@ int main(int argc, char* argv[]) { } try { - std::unique_ptr slcptr = - std::make_unique(edm::ParameterSet()); - auto slc = std::make_shared >(std::move(slcptr)); - edm::ServiceToken slcToken = edm::ServiceRegistry::createContaining(slc); - edm::ServiceRegistry::Operate operate(slcToken); + auto operate = edm::setupSiteLocalConfig(); edm::Service localconfservice; diff --git a/FWCore/Services/interface/setupSiteLocalConfig.h b/FWCore/Services/interface/setupSiteLocalConfig.h new file mode 100644 index 0000000000000..e87466a791095 --- /dev/null +++ b/FWCore/Services/interface/setupSiteLocalConfig.h @@ -0,0 +1,16 @@ +#ifndef FWCore_Services_setupSiteLocalConfig_h +#define FWCore_Services_setupSiteLocalConfig_h + +/** \function edm::setupSiteLocalConfig + + Description: Setups up the SiteLocalConfig service. + + Usage: +*/ + +#include "FWCore/ServiceRegistry/interface/ServiceRegistry.h" + +namespace edm { + ServiceRegistry::Operate setupSiteLocalConfig(); +} // namespace edm +#endif diff --git a/FWCore/Services/plugins/ProcInfoFetcher.cc b/FWCore/Services/plugins/ProcInfoFetcher.cc index aac69f4e7d359..83d270b2aba85 100644 --- a/FWCore/Services/plugins/ProcInfoFetcher.cc +++ b/FWCore/Services/plugins/ProcInfoFetcher.cc @@ -23,7 +23,6 @@ #include //#include #include -#include #include #include @@ -96,27 +95,27 @@ namespace { int getInt() { const char* t = getItem(); //std::cout <<"int '"<(t); + return std::stoi(t); } long getLong() { const char* t = getItem(); //std::cout <<"long '"<(t); + return std::stol(t); } unsigned int getUInt() { const char* t = getItem(); //std::cout <<"uint '"<(t); + return std::stoul(t); } unsigned long getULong() { const char* t = getItem(); //std::cout <<"ulong '"<(t); + return std::stoul(t); } unsigned long long getULongLong() { const char* t = getItem(); //std::cout <<"ulong '"<(t); + return std::stoull(t); } char getChar() { return *getItem(); } std::string getString() { return std::string(getItem()); } @@ -210,7 +209,7 @@ namespace edm { pinfo.num_threads >> pinfo.itrealvalue >> pinfo.starttime >> pinfo.vsize >> pinfo.rss >> pinfo.rlim >> pinfo.startcode >> pinfo.endcode >> pinfo.startstack >> pinfo.kstkesp >> pinfo.kstkeip >> pinfo.signal >> pinfo.blocked >> pinfo.sigignore >> pinfo.sigcatch >> pinfo.wchan; - } catch (boost::bad_lexical_cast& iE) { + } catch (const std::exception& iE) { LogWarning("ProcInfoFetcher") << "Parsing of Prof file failed:" << iE.what() << std::endl; return ProcInfo(); } diff --git a/FWCore/Services/plugins/SimpleMemoryCheck.cc b/FWCore/Services/plugins/SimpleMemoryCheck.cc index da81b98c76b39..8ed7fcd4de984 100644 --- a/FWCore/Services/plugins/SimpleMemoryCheck.cc +++ b/FWCore/Services/plugins/SimpleMemoryCheck.cc @@ -52,7 +52,6 @@ //#include #include //#include -#include #include #include diff --git a/FWCore/Services/plugins/Timing.cc b/FWCore/Services/plugins/Timing.cc index 911ea28eec42f..d4550cb1a9c5f 100644 --- a/FWCore/Services/plugins/Timing.cc +++ b/FWCore/Services/plugins/Timing.cc @@ -104,8 +104,8 @@ namespace edm { double curr_job_cpu_; // seconds std::atomic extra_job_cpu_; //seconds //use last run time for determining end of processing - std::atomic last_run_time_; - std::atomic last_run_cpu_; + std::atomic end_loop_time_; + std::atomic end_loop_cpu_; std::vector curr_events_time_; // seconds bool summary_only_; bool report_summary_; @@ -161,6 +161,16 @@ namespace edm { return static_cast(t.tv_sec) + (static_cast(t.tv_usec) * 1E-6); } + static double getChildrenCPU() { + struct rusage usage; + + getrusage(RUSAGE_CHILDREN, &usage); + double totalCPUTime = (double)usage.ru_utime.tv_sec + (double(usage.ru_utime.tv_usec) * 1E-6); + totalCPUTime += (double)usage.ru_stime.tv_sec + (double(usage.ru_stime.tv_usec) * 1E-6); + + return totalCPUTime; + } + static double getCPU() { struct rusage usage; getrusage(RUSAGE_SELF, &usage); @@ -208,8 +218,8 @@ namespace edm { : curr_job_time_(0.), curr_job_cpu_(0.), extra_job_cpu_(0.0), - last_run_time_(0.0), - last_run_cpu_(0.0), + end_loop_time_(0.0), + end_loop_cpu_(0.0), curr_events_time_(), summary_only_(iPS.getUntrackedParameter("summaryOnly")), report_summary_(iPS.getUntrackedParameter("useJobReport")), @@ -228,6 +238,10 @@ namespace edm { nSubProcesses_{0} { iRegistry.watchPreBeginJob(this, &Timing::preBeginJob); iRegistry.watchPostBeginJob(this, &Timing::postBeginJob); + iRegistry.preEndJobSignal_.connect([this]() { + end_loop_time_ = getTime(); + end_loop_cpu_ = getCPU(); + }); iRegistry.watchPostEndJob(this, &Timing::postEndJob); iRegistry.watchPreEvent(this, &Timing::preEvent); @@ -311,11 +325,6 @@ namespace edm { countSubProcessesPostEvent_.emplace_back(std::make_unique>(0)); } }); - - iRegistry.postGlobalEndRunSignal_.connect([this](edm::GlobalContext const&) { - last_run_time_ = getTime(); - last_run_cpu_ = getCPU(); - }); } Timing::~Timing() {} @@ -383,6 +392,8 @@ namespace edm { double total_job_cpu = job_end_cpu + extra_job_cpu_; + const double job_end_children_cpu = getChildrenCPU(); + const double total_initialization_time = curr_job_time_ - jobStartTime(); const double total_initialization_cpu = curr_job_cpu_; @@ -395,10 +406,10 @@ namespace edm { double min_event_time = *(std::min_element(min_events_time_.begin(), min_events_time_.end())); double max_event_time = *(std::max_element(max_events_time_.begin(), max_events_time_.end())); - auto total_loop_time = last_run_time_ - curr_job_time_; - auto total_loop_cpu = last_run_cpu_ + extra_job_cpu_ - curr_job_cpu_; + auto total_loop_time = end_loop_time_ - curr_job_time_; + auto total_loop_cpu = end_loop_cpu_ + extra_job_cpu_ - curr_job_cpu_; - if (last_run_time_ == 0.0) { + if (end_loop_time_ == 0.0) { total_loop_time = 0.0; total_loop_cpu = 0.0; } @@ -427,14 +438,15 @@ namespace edm { << " - Total loop: " << total_loop_time << "\n" << " - Total init: " << total_initialization_time << "\n" << " - Total job: " << total_job_time << "\n" - << " - EventSetup Lock: " << accumulatedTimeForLock_ << "\n" - << " - EventSetup Get: " << accumulatedTimeForGet_ << "\n" + << " - EventSetup Lock: " << accumulatedTimeForLock_ << "\n" + << " - EventSetup Get: " << accumulatedTimeForGet_ << "\n" << " Event Throughput: " << event_throughput << " ev/s\n" << " CPU Summary: \n" - << " - Total loop: " << total_loop_cpu << "\n" - << " - Total init: " << total_initialization_cpu << "\n" - << " - Total extra: " << extra_job_cpu_ << "\n" - << " - Total job: " << total_job_cpu << "\n" + << " - Total loop: " << total_loop_cpu << "\n" + << " - Total init: " << total_initialization_cpu << "\n" + << " - Total extra: " << extra_job_cpu_ << "\n" + << " - Total children: " << job_end_children_cpu << "\n" + << " - Total job: " << total_job_cpu << "\n" << " Processing Summary: \n" << " - Number of Events: " << total_event_count_ << "\n" << " - Number of Global Begin Lumi Calls: " << begin_lumi_count_ << "\n" @@ -450,6 +462,7 @@ namespace edm { reportData.insert(std::make_pair("EventThroughput", d2str(event_throughput))); reportData.insert(std::make_pair("TotalJobTime", d2str(total_job_time))); reportData.insert(std::make_pair("TotalJobCPU", d2str(total_job_cpu))); + reportData.insert(std::make_pair("TotalJobChildrenCPU", d2str(job_end_children_cpu))); reportData.insert(std::make_pair("TotalLoopTime", d2str(total_loop_time))); reportData.insert(std::make_pair("TotalLoopCPU", d2str(total_loop_cpu))); reportData.insert(std::make_pair("TotalInitTime", d2str(total_initialization_time))); diff --git a/FWCore/Services/src/setupSiteLocalConfig.cc b/FWCore/Services/src/setupSiteLocalConfig.cc new file mode 100644 index 0000000000000..ce65681fc07fe --- /dev/null +++ b/FWCore/Services/src/setupSiteLocalConfig.cc @@ -0,0 +1,22 @@ +/////////////////////////////////////// +// +// data catalogs are filled in "parse" +// +/////////////////////////////////////// + +//<<<<<< INCLUDES >>>>>> + +#include "FWCore/Services/src/SiteLocalConfigService.h" +#include "FWCore/Services/interface/setupSiteLocalConfig.h" + +#include + +namespace edm { + ServiceRegistry::Operate setupSiteLocalConfig() { + std::unique_ptr slcptr = + std::make_unique(edm::ParameterSet()); + auto slc = std::make_shared >(std::move(slcptr)); + edm::ServiceToken slcToken = edm::ServiceRegistry::createContaining(slc); + return edm::ServiceRegistry::Operate(slcToken); + } +} // namespace edm diff --git a/FWCore/Sources/interface/VectorInputSourceDescription.h b/FWCore/Sources/interface/VectorInputSourceDescription.h index 1d170327aa649..42b8874ed23fa 100644 --- a/FWCore/Sources/interface/VectorInputSourceDescription.h +++ b/FWCore/Sources/interface/VectorInputSourceDescription.h @@ -7,7 +7,7 @@ VectorInputSourceDescription : the stuff that is needed to configure a VectorinputSource that does not come in through the ParameterSet ----------------------------------------------------------------------*/ -#include "FWCore/Framework/src/PreallocationConfiguration.h" +#include "FWCore/Framework/interface/PreallocationConfiguration.h" #include diff --git a/FWCore/TestProcessor/interface/TestProcessor.h b/FWCore/TestProcessor/interface/TestProcessor.h index aa8f11dcf984c..6ddff5bba5bb3 100644 --- a/FWCore/TestProcessor/interface/TestProcessor.h +++ b/FWCore/TestProcessor/interface/TestProcessor.h @@ -29,10 +29,10 @@ // user include files #include "FWCore/Common/interface/FWCoreCommonFwd.h" #include "FWCore/Framework/interface/SharedResourcesAcquirer.h" -#include "FWCore/Framework/src/PrincipalCache.h" -#include "FWCore/Framework/src/SignallingProductRegistry.h" -#include "FWCore/Framework/src/PreallocationConfiguration.h" -#include "FWCore/Framework/src/ModuleRegistry.h" +#include "FWCore/Framework/interface/PrincipalCache.h" +#include "FWCore/Framework/interface/SignallingProductRegistry.h" +#include "FWCore/Framework/interface/PreallocationConfiguration.h" +#include "FWCore/Framework/interface/ModuleRegistry.h" #include "FWCore/Framework/interface/Schedule.h" #include "FWCore/Framework/interface/EventSetupRecordKey.h" #include "FWCore/Framework/interface/DataKey.h" diff --git a/FWCore/TestProcessor/src/TestProcessor.cc b/FWCore/TestProcessor/src/TestProcessor.cc index 34f6c3b913670..1893faaddcc17 100644 --- a/FWCore/TestProcessor/src/TestProcessor.cc +++ b/FWCore/TestProcessor/src/TestProcessor.cc @@ -26,11 +26,11 @@ #include "FWCore/Framework/interface/PathsAndConsumesOfModules.h" #include "FWCore/Framework/interface/RunPrincipal.h" #include "FWCore/Framework/interface/ESRecordsToProxyIndices.h" -#include "FWCore/Framework/src/EventSetupsController.h" -#include "FWCore/Framework/src/globalTransitionAsync.h" -#include "FWCore/Framework/src/streamTransitionAsync.h" -#include "FWCore/Framework/src/TransitionInfoTypes.h" -#include "FWCore/Framework/src/ProductPutterBase.h" +#include "FWCore/Framework/interface/EventSetupsController.h" +#include "FWCore/Framework/interface/globalTransitionAsync.h" +#include "FWCore/Framework/interface/streamTransitionAsync.h" +#include "FWCore/Framework/interface/TransitionInfoTypes.h" +#include "FWCore/Framework/interface/ProductPutterBase.h" #include "FWCore/Framework/interface/DelayedReader.h" #include "FWCore/ServiceRegistry/interface/ServiceRegistry.h" diff --git a/FWCore/Utilities/interface/ChildrenCPUTimer.h b/FWCore/Utilities/interface/ChildrenCPUTimer.h new file mode 100644 index 0000000000000..4f10777a8e3f5 --- /dev/null +++ b/FWCore/Utilities/interface/ChildrenCPUTimer.h @@ -0,0 +1,59 @@ +#ifndef FWCore_Utilities_ChildrenCPUTimer_h +#define FWCore_Utilities_ChildrenCPUTimer_h +// -*- C++ -*- +// +// Package: Utilities +// Class : ChildrenCPUTimer +// +/**\class ChildrenCPUTimer ChildrenCPUTimer.h FWCore/Utilities/interface/ChildrenCPUTimer.h + + Description: Timer which measures the CPU time for child processes + + Usage: + + +*/ +// +// Original Author: Chris Jones +// Created: Sun Apr 16 20:32:13 EDT 2006 +// + +// system include files +#include + +// user include files + +// forward declarations +namespace edm { + class ChildrenCPUTimer { + public: + ChildrenCPUTimer(); + ~ChildrenCPUTimer(); + ChildrenCPUTimer(ChildrenCPUTimer&&) = default; + ChildrenCPUTimer(const ChildrenCPUTimer&) = delete; + ChildrenCPUTimer& operator=(const ChildrenCPUTimer&) = delete; + + // ---------- const member functions --------------------- + double cpuTime() const; + + // ---------- static member functions -------------------- + + // ---------- member functions --------------------------- + void start(); + double stop(); //returns delta time + void reset(); + + void add(double t); + + private: + double calculateDeltaTime() const; + + // ---------- member data -------------------------------- + enum State { kRunning, kStopped } state_; + struct timeval startCPUTime_; + + double accumulatedCPUTime_; + }; +} // namespace edm + +#endif diff --git a/FWCore/Utilities/interface/EDPutToken.h b/FWCore/Utilities/interface/EDPutToken.h index de878e3ccf289..7bb124c435b23 100644 --- a/FWCore/Utilities/interface/EDPutToken.h +++ b/FWCore/Utilities/interface/EDPutToken.h @@ -41,22 +41,22 @@ namespace edm { public: using value_type = unsigned int; - EDPutToken() : m_value{s_uninitializedValue} {} + constexpr EDPutToken() noexcept : m_value{s_uninitializedValue} {} template - EDPutToken(EDPutTokenT iOther) : m_value{iOther.m_value} {} + constexpr EDPutToken(EDPutTokenT iOther) noexcept : m_value{iOther.m_value} {} // ---------- const member functions --------------------- - value_type index() const { return m_value; } - bool isUninitialized() const { return m_value == s_uninitializedValue; } + constexpr value_type index() const noexcept { return m_value; } + constexpr bool isUninitialized() const noexcept { return m_value == s_uninitializedValue; } private: //for testing friend class TestEDPutToken; - static const unsigned int s_uninitializedValue = 0xFFFFFFFF; + static constexpr unsigned int s_uninitializedValue = 0xFFFFFFFF; - explicit EDPutToken(unsigned int iValue) : m_value(iValue) {} + explicit constexpr EDPutToken(unsigned int iValue) noexcept : m_value(iValue) {} // ---------- member data -------------------------------- value_type m_value; @@ -71,19 +71,42 @@ namespace edm { public: using value_type = EDPutToken::value_type; - EDPutTokenT() : m_value{s_uninitializedValue} {} + constexpr EDPutTokenT() noexcept : m_value{s_uninitializedValue} {} + + constexpr EDPutTokenT(const EDPutTokenT&) noexcept = default; + constexpr EDPutTokenT(EDPutTokenT&&) noexcept = default; + constexpr EDPutTokenT(EDPutTokenT& iToken) noexcept : EDPutTokenT(const_cast const&>(iToken)) {} + + template + constexpr explicit EDPutTokenT(ADAPTER&& iAdapter) noexcept : EDPutTokenT(iAdapter.template produces()) {} + + constexpr EDPutTokenT& operator=(const EDPutTokenT&) noexcept = default; + constexpr EDPutTokenT& operator=(EDPutTokenT&&) noexcept = default; + constexpr EDPutTokenT& operator=(EDPutTokenT& iOther) noexcept { + m_value = iOther.m_value; + return *this; + } + + template + constexpr EDPutTokenT& operator=(ADAPTER&& iAdapter) noexcept { + EDPutTokenT temp(iAdapter.template produces()); + m_value = temp.m_value; + + return *this; + } // ---------- const member functions --------------------- - value_type index() const { return m_value; } - bool isUninitialized() const { return m_value == s_uninitializedValue; } + constexpr value_type index() const noexcept { return m_value; } + constexpr bool isUninitialized() const noexcept { return m_value == s_uninitializedValue; } private: //for testing friend class TestEDPutToken; - static const unsigned int s_uninitializedValue = 0xFFFFFFFF; + static constexpr unsigned int s_uninitializedValue = 0xFFFFFFFF; - explicit EDPutTokenT(unsigned int iValue) : m_value(iValue) {} + constexpr explicit EDPutTokenT(unsigned int iValue) noexcept : m_value(iValue) {} + constexpr explicit EDPutTokenT(unsigned long int iValue) noexcept : m_value(iValue) {} // ---------- member data -------------------------------- value_type m_value; diff --git a/FWCore/Utilities/src/Guid.h b/FWCore/Utilities/interface/Guid.h similarity index 100% rename from FWCore/Utilities/src/Guid.h rename to FWCore/Utilities/interface/Guid.h diff --git a/FWCore/Utilities/interface/bit_cast.h b/FWCore/Utilities/interface/bit_cast.h new file mode 100644 index 0000000000000..d8301a7100b06 --- /dev/null +++ b/FWCore/Utilities/interface/bit_cast.h @@ -0,0 +1,36 @@ +#ifndef FWCore_Utilities_bit_cast_h +#define FWCore_Utilities_bit_cast_h +// -*- C++ -*- +// +// Package: FWCore/Utilities +// Class : bit_cast +// +/**\function edm::bit_cast bit_cast.h "FWCore/Utilities/interface/bit_cast.h" + + Description: C++ 20 std::bit_cast stand-in + + Usage: + See documentation on std::bit_cast in C++ 20 + +*/ +// +// Original Author: Christopher Jones +// Created: Wed, 01 Sep 2021 19:11:41 GMT +// + +// system include files +#include + +// user include files + +namespace edm { + //in C++20 we can use std::bit_cast which is constexpr + template + inline To bit_cast(const From &src) noexcept { + static_assert(sizeof(To) == sizeof(From), "incompatible types"); + To dst; + std::memcpy(&dst, &src, sizeof(To)); + return dst; + } +} // namespace edm +#endif diff --git a/FWCore/Utilities/interface/getAnyPtr.h b/FWCore/Utilities/interface/getAnyPtr.h index 7e2c60a35bdbb..0daed4cbe2414 100644 --- a/FWCore/Utilities/interface/getAnyPtr.h +++ b/FWCore/Utilities/interface/getAnyPtr.h @@ -6,18 +6,8 @@ namespace edm { template - inline std::unique_ptr getAnyPtr(void* p, int offset) { - // A union is used to avoid possible copies during the triple cast that would otherwise be needed. - // std::unique_ptr edp(static_cast(static_cast(static_cast(p) + offset))); - union { - void* vp; - unsigned char* ucp; - T* tp; - } pointerUnion; - assert(p != nullptr); - pointerUnion.vp = p; - pointerUnion.ucp += offset; - return std::unique_ptr(pointerUnion.tp); + inline std::unique_ptr getAnyPtr(void *p, int offset) { + return std::unique_ptr(static_cast(static_cast(static_cast(p) + offset))); } } // namespace edm diff --git a/FWCore/Utilities/src/ChildrenCPUTimer.cc b/FWCore/Utilities/src/ChildrenCPUTimer.cc new file mode 100644 index 0000000000000..ad59ee040f614 --- /dev/null +++ b/FWCore/Utilities/src/ChildrenCPUTimer.cc @@ -0,0 +1,95 @@ +// -*- C++ -*- +// +// Package: Utilities +// Class : ChildrenCPUTimer +// +// Implementation: +// +// +// Original Author: Chris Jones +// Created: Sun Apr 16 20:32:20 EDT 2006 +// + +// system include files +#include +#include + +// user include files +#include "FWCore/Utilities/interface/ChildrenCPUTimer.h" +#include "FWCore/Utilities/interface/Exception.h" + +// +// constants, enums and typedefs +// +using namespace edm; + +// +// static data member definitions +// + +// +// constructors and destructor +// +ChildrenCPUTimer::ChildrenCPUTimer() : state_(kStopped), startCPUTime_(), accumulatedCPUTime_(0) { + startCPUTime_.tv_sec = 0; + startCPUTime_.tv_usec = 0; +} + +ChildrenCPUTimer::~ChildrenCPUTimer() {} + +// +// member functions +// +void ChildrenCPUTimer::start() { + if (kStopped == state_) { + rusage theUsage; + if (0 != getrusage(RUSAGE_CHILDREN, &theUsage)) { + throw cms::Exception("ChildrenCPUTimerFailed") << errno; + } + startCPUTime_.tv_sec = theUsage.ru_stime.tv_sec + theUsage.ru_utime.tv_sec; + startCPUTime_.tv_usec = theUsage.ru_stime.tv_usec + theUsage.ru_utime.tv_usec; + state_ = kRunning; + } +} + +double ChildrenCPUTimer::stop() { + if (kRunning == state_) { + auto t = calculateDeltaTime(); + accumulatedCPUTime_ += t; + + state_ = kStopped; + return t; + } + return 0.; +} + +void ChildrenCPUTimer::reset() { accumulatedCPUTime_ = 0; } + +void ChildrenCPUTimer::add(double t) { accumulatedCPUTime_ += t; } + +double ChildrenCPUTimer::calculateDeltaTime() const { + double returnValue; + double const microsecToSec = 1E-6; + + rusage theUsage; + if (0 != getrusage(RUSAGE_CHILDREN, &theUsage)) { + throw cms::Exception("CPUTimerFailed") << errno; + } + + returnValue = theUsage.ru_stime.tv_sec + theUsage.ru_utime.tv_sec - startCPUTime_.tv_sec + + microsecToSec * (theUsage.ru_stime.tv_usec + theUsage.ru_utime.tv_usec - startCPUTime_.tv_usec); + return returnValue; +} +// +// const member functions +// +double ChildrenCPUTimer::cpuTime() const { + if (kStopped == state_) { + return accumulatedCPUTime_; + } + return accumulatedCPUTime_ + calculateDeltaTime(); +} + +// +// static member functions +// diff --git a/FWCore/Utilities/src/GlobalIdentifier.cc b/FWCore/Utilities/src/GlobalIdentifier.cc index d83fd800ee88a..a4117e08a791f 100644 --- a/FWCore/Utilities/src/GlobalIdentifier.cc +++ b/FWCore/Utilities/src/GlobalIdentifier.cc @@ -1,5 +1,5 @@ #include "FWCore/Utilities/interface/GlobalIdentifier.h" -#include "Guid.h" +#include "FWCore/Utilities/interface/Guid.h" namespace edm { std::string createGlobalIdentifier(bool binary) { diff --git a/FWCore/Utilities/src/Guid.cc b/FWCore/Utilities/src/Guid.cc index fc8796402f980..fe482ea2f45a4 100644 --- a/FWCore/Utilities/src/Guid.cc +++ b/FWCore/Utilities/src/Guid.cc @@ -9,7 +9,7 @@ // Author : Markus Frank // // ==================================================================== -#include "Guid.h" +#include "FWCore/Utilities/interface/Guid.h" #include #include diff --git a/FWCore/Utilities/src/ReleaseVersion.cc b/FWCore/Utilities/src/ReleaseVersion.cc index eefd8da07d4a4..4fd4c4bcbe9ff 100644 --- a/FWCore/Utilities/src/ReleaseVersion.cc +++ b/FWCore/Utilities/src/ReleaseVersion.cc @@ -1,7 +1,6 @@ #include "FWCore/Utilities/interface/ReleaseVersion.h" #include "boost/algorithm/string.hpp" -#include "boost/lexical_cast.hpp" #include #include @@ -33,17 +32,17 @@ namespace edm { /* if(parts.size() == 4) { if(releaseVersion.find("patch") != std::string::npos) { - patch_ = boost::lexical_cast(parts[3]); + patch_ = std::stoul(parts[3]); } else if(releaseVersion.find("pre") != std::string::npos) { - pre_ = boost::lexical_cast(parts[3]); + pre_ = std::stoul(parts[3]); } else { return; } } */ - major_ = boost::lexical_cast(parts[0]); - minor_ = boost::lexical_cast(parts[1]); - // point_ = boost::lexical_cast(parts[2]); + major_ = std::stoul(parts[0]); + minor_ = std::stoul(parts[1]); + // point_ = std::stoul(parts[2]); irregular_ = false; } catch (std::exception const&) { } diff --git a/FWCore/Utilities/test/Guid_t.cpp b/FWCore/Utilities/test/Guid_t.cpp index d1845a48285c3..af52b8c880843 100644 --- a/FWCore/Utilities/test/Guid_t.cpp +++ b/FWCore/Utilities/test/Guid_t.cpp @@ -1,4 +1,4 @@ -#include "FWCore/Utilities/src/Guid.h" +#include "FWCore/Utilities/interface/Guid.h" #include #include diff --git a/FastSimulation/CaloGeometryTools/src/CaloPoint.cc b/FastSimulation/CaloGeometryTools/src/CaloPoint.cc index 9cc1aa453b304..052fa1e3bd5cd 100644 --- a/FastSimulation/CaloGeometryTools/src/CaloPoint.cc +++ b/FastSimulation/CaloGeometryTools/src/CaloPoint.cc @@ -24,10 +24,12 @@ CaloPoint::CaloPoint(const DetId& cell, CaloDirection side, const XYZPoint& posi CaloPoint::CaloPoint(DetId::Detector det, const XYZPoint& position) : XYZPoint(position), detector_(det) { subdetector_ = 0; layer_ = 0; + side_ = CaloDirection::NONE; } //preshower CaloPoint::CaloPoint(DetId::Detector detector, int subdetn, int layer, const XYZPoint& position) : XYZPoint(position), detector_(detector), subdetector_(subdetn), layer_(layer) { cellid_ = DetId(); + side_ = CaloDirection::NONE; } diff --git a/FastSimulation/Calorimetry/interface/CalorimetryManager.h b/FastSimulation/Calorimetry/interface/CalorimetryManager.h index 47c2ab9e62d41..5922c664a3f45 100644 --- a/FastSimulation/Calorimetry/interface/CalorimetryManager.h +++ b/FastSimulation/Calorimetry/interface/CalorimetryManager.h @@ -15,6 +15,8 @@ #include "FastSimulation/Calorimetry/interface/KKCorrectionFactors.h" +#include "FWCore/Framework/interface/FrameworkfwdMostUsed.h" + // For the uint32_t //#include #include @@ -37,10 +39,6 @@ class GflashAntiProtonShowerProfile; // FastHFshowerLibrary class FastHFShowerLibrary; -namespace edm { - class ParameterSet; -} - class CalorimetryManager { public: CalorimetryManager(); @@ -48,7 +46,8 @@ class CalorimetryManager { const edm::ParameterSet& fastCalo, const edm::ParameterSet& MuonECALPars, const edm::ParameterSet& MuonHCALPars, - const edm::ParameterSet& fastGflash); + const edm::ParameterSet& fastGflash, + edm::ConsumesCollector&&); ~CalorimetryManager(); // Does the real job diff --git a/FastSimulation/Calorimetry/src/CalorimetryManager.cc b/FastSimulation/Calorimetry/src/CalorimetryManager.cc index 95c6b50d166db..31dd5bfe00988 100644 --- a/FastSimulation/Calorimetry/src/CalorimetryManager.cc +++ b/FastSimulation/Calorimetry/src/CalorimetryManager.cc @@ -2,6 +2,7 @@ //Framework headers #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" +#include "FWCore/Utilities/interface/EDMException.h" // Fast Simulation headers #include "FastSimulation/ParticlePropagator/interface/ParticlePropagator.h" @@ -56,9 +57,6 @@ //#include "DataFormats/EcalDetId/interface/EcalDetId.h" #include "Geometry/HcalTowerAlgo/interface/HcalGeometry.h" -#include "FWCore/MessageLogger/interface/MessageLogger.h" -#include "FWCore/Utilities/interface/EDMException.h" - //ROOT headers #include "TROOT.h" #include "TH1.h" @@ -77,7 +75,8 @@ CalorimetryManager::CalorimetryManager(FSimEvent* aSimEvent, const edm::ParameterSet& fastCalo, const edm::ParameterSet& fastMuECAL, const edm::ParameterSet& fastMuHCAL, - const edm::ParameterSet& parGflash) + const edm::ParameterSet& parGflash, + edm::ConsumesCollector&& iC) : mySimEvent(aSimEvent), initialized_(false), theMuonEcalEffects(nullptr), @@ -93,7 +92,7 @@ CalorimetryManager::CalorimetryManager(FSimEvent* aSimEvent, theAntiProtonProfile = new GflashAntiProtonShowerProfile(parGflash); // FastHFShowerLibrary - theHFShowerLibrary = new FastHFShowerLibrary(fastCalo); + theHFShowerLibrary = new FastHFShowerLibrary(fastCalo, std::move(iC)); readParameters(fastCalo); diff --git a/FastSimulation/EventProducer/BuildFile.xml b/FastSimulation/EventProducer/BuildFile.xml deleted file mode 100644 index 8e1402c1ef46f..0000000000000 --- a/FastSimulation/EventProducer/BuildFile.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - - - - - - - - - diff --git a/FastSimulation/EventProducer/interface/FamosManager.h b/FastSimulation/EventProducer/interface/FamosManager.h deleted file mode 100644 index aad3a9291c4a5..0000000000000 --- a/FastSimulation/EventProducer/interface/FamosManager.h +++ /dev/null @@ -1,68 +0,0 @@ -#ifndef FastSimulation_EventProducer_FamosManager_H -#define FastSimulation_EventProducer_FamosManager_H - -#include "DataFormats/HepMCCandidate/interface/GenParticleFwd.h" -#include "SimDataFormats/CrossingFrame/interface/CrossingFrame.h" -#include - -namespace HepMC { - class GenEvent; -} - -namespace edm { - class ParameterSet; - class EventSetup; - class Run; - class HepMCProduct; -} // namespace edm - -class FSimEvent; -class TrajectoryManager; -class PileUpSimulator; -class MagneticField; -class CalorimetryManager; -class RandomEngineAndDistribution; -class TrackerTopology; - -// using trailing _ for private data members, m_p prefix for PSet variables (MSt) - -class FamosManager { -public: - /// Constructor - FamosManager(edm::ParameterSet const& p); - - /// Destructor - ~FamosManager(); - - /// Get information from the Event Setup - void setupGeometryAndField(edm::Run const& run, const edm::EventSetup& es); - - /// The simulated event - FSimEvent* simEvent() const { return mySimEvent; } - - /// The real thing is done here - void reconstruct(const HepMC::GenEvent* evt, const TrackerTopology* tTopo, RandomEngineAndDistribution const*); - - /// The tracker - TrajectoryManager* trackerManager() const { return myTrajectoryManager; } - - /// The calorimeter - CalorimetryManager* calorimetryManager() const { return myCalorimetry; } - -private: - int iEvent; - // const HepMC::GenEvent* myGenEvent; - FSimEvent* mySimEvent; - TrajectoryManager* myTrajectoryManager; - CalorimetryManager* myCalorimetry; - -private: - bool m_pUseMagneticField; - bool m_Tracking; - bool m_Calorimetry; - bool m_Alignment; - double weight_; - int m_pRunNumber; - int m_pVerbose; -}; -#endif diff --git a/FastSimulation/EventProducer/interface/FamosProducer.h b/FastSimulation/EventProducer/interface/FamosProducer.h deleted file mode 100644 index a46b5cd869587..0000000000000 --- a/FastSimulation/EventProducer/interface/FamosProducer.h +++ /dev/null @@ -1,33 +0,0 @@ -#ifndef FastSimulation_EventProducer_FamosProducer_H -#define FastSimulation_EventProducer_FamosProducer_H - -#include "FWCore/Framework/interface/stream/EDProducer.h" - -#include "SimDataFormats/GeneratorProducts/interface/HepMCProduct.h" - -class FamosManager; -class ParameterSet; -class Event; -class EventSetup; - -namespace HepMC { - class GenEvent; -} - -class FamosProducer : public edm::stream::EDProducer<> { -public: - explicit FamosProducer(edm::ParameterSet const& p); - ~FamosProducer() override; - void beginRun(edm::Run const& run, const edm::EventSetup& es) override; - void produce(edm::Event& e, const edm::EventSetup& c) override; - -private: - FamosManager* famosManager_; - HepMC::GenEvent* evt_; - bool simulateMuons; - - // token for hepmc from signal event - edm::EDGetTokenT sourceToken; -}; - -#endif diff --git a/FastSimulation/EventProducer/python/FamosSimHits_cff.py b/FastSimulation/EventProducer/python/FamosSimHits_cff.py deleted file mode 100644 index 66f3bb0015080..0000000000000 --- a/FastSimulation/EventProducer/python/FamosSimHits_cff.py +++ /dev/null @@ -1,51 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -from FastSimulation.Event.ParticleFilter_cfi import * -from FastSimulation.MaterialEffects.MaterialEffects_cfi import * -from FastSimulation.TrajectoryManager.ActivateDecays_cfi import * -from FastSimulation.TrajectoryManager.TrackerSimHits_cfi import * -from FastSimulation.Calorimetry.Calorimetry_cff import * - -MaterialEffectsForMuonsBlock.MaterialEffectsForMuons.use_hardcoded_geometry = True -MaterialEffectsBlock.MaterialEffects.use_hardcoded_geometry = True - - -famosSimHits = cms.EDProducer("FamosProducer", - # FastCalorimetry - FamosCalorimetryBlock, - # Conditions to save Tracker SimHits - TrackerSimHitsBlock, - # Material effects to be simulated in the tracker material and associated cuts - MaterialEffectsBlock, - # Material effects for muons in ECAL - MaterialEffectsForMuonsInECALBlock, - # Material effects for muons in HCAL - MaterialEffectsForMuonsInHCALBlock, - # (De)activate decays of unstable particles (K0S, etc...) - ActivateDecaysBlock, - # Kinematic cuts for the particle filter in the SimEvent - ParticleFilterBlock, - # The HepMCProduct source - SourceLabel = cms.InputTag("generatorSmeared"), - # The genParticle source (in case there is no HepMCProduct) - GenParticleLabel = cms.InputTag("genParticles"), - # If false, no SimTrack collection for Muons is stored - SimulateMuons = cms.bool(True), - # The beam spot source - BeamSpotLabel = cms.InputTag("offlineBeamSpot"), - # Run Number - RunNumber = cms.untracked.int32(1001), - Verbosity = cms.untracked.int32(0), - # If false, no misalignment can be applied in the tracker - ApplyAlignment = cms.bool(True), - # If false, no SimHits are simulated in the tracker - # (but the tracker material is still here) - SimulateTracking = cms.bool(True), - # If false, no PCaloHits are produced - SimulateCalorimetry = cms.bool(True), - # If the following is false, no B field map is used, - # and B is set to 4 T altogether - UseMagneticField = cms.bool(True), -) - - diff --git a/FastSimulation/EventProducer/src/FamosManager.cc b/FastSimulation/EventProducer/src/FamosManager.cc deleted file mode 100644 index af8f99e7b8fd3..0000000000000 --- a/FastSimulation/EventProducer/src/FamosManager.cc +++ /dev/null @@ -1,159 +0,0 @@ -// CMSSW Header -#include "FWCore/Framework/interface/EventSetup.h" -#include "FWCore/Framework/interface/Run.h" -#include "FWCore/ParameterSet/interface/ParameterSet.h" -#include "FWCore/Framework/interface/ESHandle.h" -#include "FWCore/Utilities/interface/Exception.h" -#include "FWCore/MessageLogger/interface/MessageLogger.h" -#include "DataFormats/Provenance/interface/EventID.h" -#include "DataFormats/TrackerCommon/interface/TrackerTopology.h" - -#include "SimGeneral/HepPDTRecord/interface/ParticleDataTable.h" - -#include "MagneticField/Records/interface/IdealMagneticFieldRecord.h" - -//#include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h" -//#include "RecoTracker/TkDetLayers/interface/GeometricSearchTracker.h" -#include "RecoTracker/Record/interface/TrackerRecoGeometryRecord.h" -#include "Geometry/Records/interface/TrackerDigiGeometryRecord.h" -#include "FastSimulation/TrackerSetup/interface/TrackerInteractionGeometryRecord.h" -#include "FastSimulation/ParticlePropagator/interface/MagneticFieldMapRecord.h" - -#include "Geometry/Records/interface/CaloGeometryRecord.h" -#include "Geometry/CaloGeometry/interface/CaloGeometry.h" -#include "Geometry/Records/interface/CaloTopologyRecord.h" -//#include "Geometry/CaloTopology/interface/CaloTopology.h" - -// HepMC headers -//#include "HepMC/GenEvent.h" - -// FAMOS Header -#include "FastSimulation/EventProducer/interface/FamosManager.h" -#include "FastSimulation/TrajectoryManager/interface/TrajectoryManager.h" -#include "FastSimulation/Event/interface/FSimEvent.h" -#include "FastSimulation/ParticlePropagator/interface/MagneticFieldMap.h" -#include "FastSimulation/Calorimetry/interface/CalorimetryManager.h" -#include "FastSimulation/CaloGeometryTools/interface/CaloGeometryHelper.h" -#include "SimDataFormats/CrossingFrame/interface/CrossingFrame.h" -#include "FastSimulation/ShowerDevelopment/interface/FastHFShowerLibrary.h" -#include -#include -#include - -using namespace HepMC; - -FamosManager::FamosManager(edm::ParameterSet const& p) - : iEvent(0), - myCalorimetry(nullptr), - m_pUseMagneticField(p.getParameter("UseMagneticField")), - m_Tracking(p.getParameter("SimulateTracking")), - m_Calorimetry(p.getParameter("SimulateCalorimetry")), - m_Alignment(p.getParameter("ApplyAlignment")), - m_pRunNumber(p.getUntrackedParameter("RunNumber", 1)), - m_pVerbose(p.getUntrackedParameter("Verbosity", 1)) { - // Initialize the FSimEvent - mySimEvent = new FSimEvent(p.getParameter("ParticleFilter")); - - /// Initialize the TrajectoryManager - myTrajectoryManager = new TrajectoryManager(mySimEvent, - p.getParameter("MaterialEffects"), - p.getParameter("TrackerSimHits"), - p.getParameter("ActivateDecays")); - - // Initialize Calorimetry Fast Simulation (if requested) - if (m_Calorimetry) - myCalorimetry = new CalorimetryManager(mySimEvent, - p.getParameter("Calorimetry"), - p.getParameter("MaterialEffectsForMuonsInECAL"), - p.getParameter("MaterialEffectsForMuonsInHCAL"), - p.getParameter("GFlash")); -} - -FamosManager::~FamosManager() { - if (mySimEvent) - delete mySimEvent; - if (myTrajectoryManager) - delete myTrajectoryManager; - if (myCalorimetry) - delete myCalorimetry; -} - -void FamosManager::setupGeometryAndField(edm::Run const& run, const edm::EventSetup& es) { - // Particle data table (from Pythia) - edm::ESHandle pdt; - es.getData(pdt); - mySimEvent->initializePdt(&(*pdt)); - - // Initialize the full (misaligned) tracker geometry - // (only if tracking is requested) - std::string misAligned = m_Alignment ? "MisAligned" : ""; - // 1) By default, the aligned geometry is chosen (m_Alignment = false) - // 2) By default, the misaligned geometry is aligned - edm::ESHandle tracker; - es.get().get(misAligned, tracker); - if (m_Tracking) - myTrajectoryManager->initializeTrackerGeometry(&(*tracker)); - - // Initialize the tracker misaligned reco geometry (always needed) - // By default, the misaligned geometry is aligned - edm::ESHandle theGeomSearchTracker; - es.get().get(misAligned, theGeomSearchTracker); - - // Initialize the misaligned tracker interaction geometry - edm::ESHandle theTrackerInteractionGeometry; - es.get().get(misAligned, theTrackerInteractionGeometry); - - // Initialize the magnetic field - double bField000 = 0.; - if (m_pUseMagneticField) { - edm::ESHandle theMagneticFieldMap; - es.get().get(misAligned, theMagneticFieldMap); - const GlobalPoint g(0., 0., 0.); - bField000 = theMagneticFieldMap->inTeslaZ(g); - myTrajectoryManager->initializeRecoGeometry( - &(*theGeomSearchTracker), &(*theTrackerInteractionGeometry), &(*theMagneticFieldMap)); - } else { - myTrajectoryManager->initializeRecoGeometry(&(*theGeomSearchTracker), &(*theTrackerInteractionGeometry), nullptr); - bField000 = 4.0; - } - // The following should be on LogInfo - //std::cout << "B-field(T) at (0,0,0)(cm): " << bField000 << std::endl; - - // Initialize the calorimeter geometry - if (myCalorimetry) { - edm::ESHandle pG; - es.get().get(pG); - myCalorimetry->getCalorimeter()->setupGeometry(*pG); - - edm::ESHandle theCaloTopology; - es.get().get(theCaloTopology); - myCalorimetry->getCalorimeter()->setupTopology(*theCaloTopology); - myCalorimetry->getCalorimeter()->initialize(bField000); - - myCalorimetry->getHFShowerLibrary()->initHFShowerLibrary(es); - } - - m_pRunNumber = run.run(); -} - -void FamosManager::reconstruct(const HepMC::GenEvent* evt, - const TrackerTopology* tTopo, - RandomEngineAndDistribution const* random) { - // myGenEvent = evt; - - iEvent++; - edm::EventID id(m_pRunNumber, 1U, iEvent); - - // Fill the event from the original generated event - mySimEvent->fill(*evt, id); - - // And propagate the particles through the detector - myTrajectoryManager->reconstruct(tTopo, random); - - if (myCalorimetry) - myCalorimetry->reconstruct(random); - - edm::LogInfo("FamosManager") << " saved : Event " << iEvent << " of weight " << mySimEvent->weight() << " with " - << mySimEvent->nTracks() << " tracks and " << mySimEvent->nVertices() - << " vertices, generated by " << mySimEvent->nGenParts() << " particles " << std::endl; -} diff --git a/FastSimulation/EventProducer/src/FamosProducer.cc b/FastSimulation/EventProducer/src/FamosProducer.cc deleted file mode 100644 index 2ca8833441c71..0000000000000 --- a/FastSimulation/EventProducer/src/FamosProducer.cc +++ /dev/null @@ -1,118 +0,0 @@ -#include "FWCore/Framework/interface/Event.h" -#include "FWCore/Framework/interface/MakerMacros.h" -#include "FWCore/Framework/interface/EventSetup.h" -#include "FWCore/Framework/interface/ESHandle.h" -#include "FWCore/MessageLogger/interface/MessageLogger.h" - -#include "SimDataFormats/CaloHit/interface/PCaloHitContainer.h" -#include "SimDataFormats/TrackingHit/interface/PSimHitContainer.h" - -#include "FastSimDataFormats/NuclearInteractions/interface/FSimVertexTypeFwd.h" - -#include "DataFormats/Common/interface/Handle.h" -#include "DataFormats/Candidate/interface/CandidateFwd.h" -#include "DataFormats/Provenance/interface/EventID.h" - -#include "FastSimulation/EventProducer/interface/FamosProducer.h" -#include "FastSimulation/EventProducer/interface/FamosManager.h" -#include "FastSimulation/Event/interface/FSimEvent.h" -#include "FastSimulation/Event/interface/KineParticleFilter.h" -#include "FastSimulation/Calorimetry/interface/CalorimetryManager.h" -#include "FastSimulation/TrajectoryManager/interface/TrajectoryManager.h" -#include "FastSimulation/Utilities/interface/RandomEngineAndDistribution.h" -#include "Geometry/Records/interface/TrackerTopologyRcd.h" - -#include "HepMC/GenVertex.h" -#include "HepMC/GenEvent.h" - -#include -#include -#include - -FamosProducer::FamosProducer(edm::ParameterSet const& p) { - produces(); - produces(); - produces("VertexTypes"); - produces("TrackerHits"); - produces("EcalHitsEB"); - produces("EcalHitsEE"); - produces("EcalHitsES"); - produces("HcalHits"); - // Temporary facility to allow for the crossing frame to work... - simulateMuons = p.getParameter("SimulateMuons"); - if (simulateMuons) - produces("MuonSimTracks"); - - // hepmc event from signal event - edm::InputTag sourceLabel = p.getParameter("SourceLabel"); - sourceToken = consumes(sourceLabel); - - // famos manager - famosManager_ = new FamosManager(p); -} - -FamosProducer::~FamosProducer() { delete famosManager_; } - -void FamosProducer::beginRun(edm::Run const& run, const edm::EventSetup& es) { - famosManager_->setupGeometryAndField(run, es); -} - -void FamosProducer::produce(edm::Event& iEvent, const edm::EventSetup& es) { - using namespace edm; - - RandomEngineAndDistribution random(iEvent.streamID()); - - //Retrieve tracker topology from geometry - edm::ESHandle tTopoHand; - es.get().get(tTopoHand); - const TrackerTopology* tTopo = tTopoHand.product(); - - // get the signal event - Handle theHepMCProduct; - iEvent.getByToken(sourceToken, theHepMCProduct); - const HepMC::GenEvent* myGenEvent = theHepMCProduct->GetEvent(); - - // do the simulation - famosManager_->reconstruct(myGenEvent, tTopo, &random); - - // get the hits, simtracks and simvertices and put in the event - CalorimetryManager* calo = famosManager_->calorimetryManager(); - TrajectoryManager* tracker = famosManager_->trackerManager(); - - std::unique_ptr p1(new edm::SimTrackContainer); - std::unique_ptr m1(new edm::SimTrackContainer); - std::unique_ptr p2(new edm::SimVertexContainer); - std::unique_ptr v1(new FSimVertexTypeCollection); - std::unique_ptr p3(new edm::PSimHitContainer); - std::unique_ptr p4(new edm::PCaloHitContainer); - std::unique_ptr p5(new edm::PCaloHitContainer); - std::unique_ptr p6(new edm::PCaloHitContainer); - std::unique_ptr p7(new edm::PCaloHitContainer); - - FSimEvent* fevt = famosManager_->simEvent(); - fevt->load(*p1, *m1); - fevt->load(*p2); - fevt->load(*v1); - tracker->loadSimHits(*p3); - - if (calo) { - calo->loadFromEcalBarrel(*p4); - calo->loadFromEcalEndcap(*p5); - calo->loadFromPreshower(*p6); - calo->loadFromHcal(*p7); - calo->loadMuonSimTracks(*m1); - } - - if (simulateMuons) - iEvent.put(std::move(m1), "MuonSimTracks"); - iEvent.put(std::move(p1)); - iEvent.put(std::move(p2)); - iEvent.put(std::move(p3), "TrackerHits"); - iEvent.put(std::move(v1), "VertexTypes"); - iEvent.put(std::move(p4), "EcalHitsEB"); - iEvent.put(std::move(p5), "EcalHitsEE"); - iEvent.put(std::move(p6), "EcalHitsES"); - iEvent.put(std::move(p7), "HcalHits"); -} - -DEFINE_FWK_MODULE(FamosProducer); diff --git a/FastSimulation/ForwardDetectors/test/CastorTowerProducerTest_cfg.py b/FastSimulation/ForwardDetectors/test/CastorTowerProducerTest_cfg.py deleted file mode 100644 index c55d4a4bf1157..0000000000000 --- a/FastSimulation/ForwardDetectors/test/CastorTowerProducerTest_cfg.py +++ /dev/null @@ -1,80 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -process = cms.Process("PROD") - -# The number of events to be processed. -process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(100) ) - -# For valgrind studies -# process.ProfilerService = cms.Service("ProfilerService", -# lastEvent = cms.untracked.int32(13), -# firstEvent = cms.untracked.int32(3), -# paths = cms.untracked.vstring('p1') -#) - -# Include the RandomNumberGeneratorService definition -process.load("IOMC.RandomEngine.IOMC_cff") - -# Generate H -> ZZ -> l+l- l'+l'- (l,l'=e or mu), with mH=200GeV/c2 -#process.load("Configuration.Generator.H200ZZ4L_cfi") -# Generate ttbar events -# process.load("FastSimulation/Configuration/ttbar_cfi") -# Generate multijet events with different ptHAT bins -# process.load("FastSimulation/Configuration/QCDpt80-120_cfi") -# process.load("FastSimulation/Configuration/QCDpt600-800_cfi") -# Generate Minimum Bias Events -process.load("FastSimulation/Configuration/MinBiasEvents_cfi") -# Generate muons with a flat pT particle gun, and with pT=10. -# process.load("FastSimulation/Configuration/FlatPtMuonGun_cfi") -# replace FlatRandomPtGunProducer.PGunParameters.PartID={130} -# Generate di-electrons with pT=35 GeV -#process.load("FastSimulation/Configuration/DiElectrons_cfi") - -# Famos sequences (Frontier conditions) -process.load("FastSimulation/Configuration/CommonInputs_cff") -process.GlobalTag.globaltag = "IDEAL_30X::All" -process.load("FastSimulation/Configuration/FamosSequences_cff") - -# Parametrized magnetic field (new mapping, 4.0 and 3.8T) -#process.load("Configuration.StandardSequences.MagneticField_40T_cff") -process.load("Configuration.StandardSequences.MagneticField_38T_cff") -process.VolumeBasedMagneticFieldESProducer.useParametrizedTrackerField = True - -# If you want to turn on/off pile-up -#process.famosPileUp.PileUpSimulator.averageNumber = 5.0 -# You may not want to simulate everything for your study -process.fastSimProducer.SimulateCalorimetry = True -for layer in process.fastSimProducer.detectorDefinition.BarrelLayers: - layer.interactionModels = cms.untracked.vstring("pairProduction", "nuclearInteraction", "bremsstrahlung", "energyLoss", "multipleScattering", "trackerSimHits") -for layer in process.fastSimProducer.detectorDefinition.ForwardLayers: - layer.interactionModels = cms.untracked.vstring("pairProduction", "nuclearInteraction", "bremsstrahlung", "energyLoss", "multipleScattering", "trackerSimHits") -# process.fastSimProducer.SimulateMuons = False - -# include Castor fast sim -process.load("FastSimulation.ForwardDetectors.CastorFastReco_cff") - -# Produce Tracks and Clusters -process.p1 = cms.Path(process.ProductionFilterSequence*process.famosWithEverything*process.CastorFastReco) - -# To write out events (not need: FastSimulation _is_ fast!) -process.o1 = cms.OutputModule( - "PoolOutputModule", - fileName = cms.untracked.string("MyFirstFamosFile.root"), - outputCommands = cms.untracked.vstring("keep *_Castor*Reco_*_*", - "drop *_mix_*_*") - ) - -process.outpath = cms.EndPath(process.o1) - -# Keep the logging output to a nice level # - -#process.Timing = cms.Service("Timing") -#process.load("FWCore/MessageService/MessageLogger_cfi") -#process.MessageLogger.destinations = cms.untracked.vstring("pyDetailedInfo.txt","cout") -# -#process.MessageLogger.cout = cms.untracked.PSet(threshold=cms.untracked.string("INFO"), -# default=cms.untracked.PSet(limit=cms.untracked.int32(0)), -# FamosManager=cms.untracked.PSet(limit=cms.untracked.int32(100000))) - -# Make the job crash in case of missing product -process.options = cms.untracked.PSet( Rethrow = cms.untracked.vstring('ProductNotFound') ) diff --git a/FastSimulation/MuonSimHitProducer/plugins/MuonSimHitProducer.cc b/FastSimulation/MuonSimHitProducer/plugins/MuonSimHitProducer.cc index 37a4dd4d24eb6..afd790060d624 100644 --- a/FastSimulation/MuonSimHitProducer/plugins/MuonSimHitProducer.cc +++ b/FastSimulation/MuonSimHitProducer/plugins/MuonSimHitProducer.cc @@ -93,6 +93,12 @@ class MuonSimHitProducer : public edm::stream::EDProducer<> { // tokens edm::EDGetTokenT > simMuonToken; edm::EDGetTokenT > simVertexToken; + + const edm::ESGetToken magneticFieldESToken_; + const edm::ESGetToken dtGeometryESToken_; + const edm::ESGetToken cscGeometryESToken_; + const edm::ESGetToken rpcGeometryESToken_; + const edm::ESGetToken particleDataTableESToken_; }; //for debug only @@ -102,7 +108,13 @@ class MuonSimHitProducer : public edm::stream::EDProducer<> { // constructors and destructor // MuonSimHitProducer::MuonSimHitProducer(const edm::ParameterSet& iConfig) - : theEstimator(iConfig.getParameter("Chi2EstimatorCut")), propagatorWithoutMaterial(nullptr) { + : theEstimator(iConfig.getParameter("Chi2EstimatorCut")), + propagatorWithoutMaterial(nullptr), + magneticFieldESToken_(esConsumes()), + dtGeometryESToken_(esConsumes(edm::ESInputTag("", "MisAligned"))), + cscGeometryESToken_(esConsumes(edm::ESInputTag("", "MisAligned"))), + rpcGeometryESToken_(esConsumes()), + particleDataTableESToken_(esConsumes()) { // Read relevant parameters readParameters(iConfig.getParameter("MUONS"), iConfig.getParameter("TRACKS"), @@ -126,21 +138,10 @@ MuonSimHitProducer::MuonSimHitProducer(const edm::ParameterSet& iConfig) // ---- method called once each job just before starting event loop ---- void MuonSimHitProducer::beginRun(edm::Run const& run, const edm::EventSetup& es) { //services - edm::ESHandle magField; - edm::ESHandle dtGeometry; - edm::ESHandle cscGeometry; - edm::ESHandle rpcGeometry; - edm::ESHandle propagator; - - es.get().get(magField); - es.get().get("MisAligned", dtGeometry); - es.get().get("MisAligned", cscGeometry); - es.get().get(rpcGeometry); - - magfield = &(*magField); - dtGeom = &(*dtGeometry); - cscGeom = &(*cscGeometry); - rpcGeom = &(*rpcGeometry); + magfield = &es.getData(magneticFieldESToken_); + dtGeom = &es.getData(dtGeometryESToken_); + cscGeom = &es.getData(cscGeometryESToken_); + rpcGeom = &es.getData(rpcGeometryESToken_); bool duringEvent = false; theService->update(es, duringEvent); @@ -160,10 +161,7 @@ void MuonSimHitProducer::beginRun(edm::Run const& run, const edm::EventSetup& es // ------------ method called to produce the data ------------ void MuonSimHitProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) { - // using namespace edm; - // using namespace std; - edm::ESHandle pdg; - iSetup.getData(pdg); + auto pdg = iSetup.getHandle(particleDataTableESToken_); RandomEngineAndDistribution random(iEvent.streamID()); diff --git a/FastSimulation/Muons/plugins/FastTSGFromL2Muon.cc b/FastSimulation/Muons/plugins/FastTSGFromL2Muon.cc index 23256f54071f1..624d09739ea33 100644 --- a/FastSimulation/Muons/plugins/FastTSGFromL2Muon.cc +++ b/FastSimulation/Muons/plugins/FastTSGFromL2Muon.cc @@ -17,7 +17,7 @@ #include -FastTSGFromL2Muon::FastTSGFromL2Muon(const edm::ParameterSet& cfg) : theConfig(cfg) { +FastTSGFromL2Muon::FastTSGFromL2Muon(const edm::ParameterSet& cfg) { produces(); edm::ParameterSet serviceParameters = cfg.getParameter("ServiceParameters"); @@ -28,15 +28,14 @@ FastTSGFromL2Muon::FastTSGFromL2Muon(const edm::ParameterSet& cfg) : theConfig(c theSeedCollectionLabels = cfg.getParameter >("SeedCollectionLabels"); theSimTrackCollectionLabel = cfg.getParameter("SimTrackCollectionLabel"); // useTFileService_ = cfg.getUntrackedParameter("UseTFileService",false); + edm::ParameterSet regionBuilderPSet = cfg.getParameter("MuonTrackingRegionBuilder"); + theRegionBuilder = std::make_unique(regionBuilderPSet, consumesCollector()); } FastTSGFromL2Muon::~FastTSGFromL2Muon() {} void FastTSGFromL2Muon::beginRun(edm::Run const& run, edm::EventSetup const& es) { //region builder - edm::ParameterSet regionBuilderPSet = theConfig.getParameter("MuonTrackingRegionBuilder"); - edm::ConsumesCollector iC = consumesCollector(); - theRegionBuilder = new MuonTrackingRegionBuilder(regionBuilderPSet, iC); /* if(useTFileService_) { diff --git a/FastSimulation/Muons/plugins/FastTSGFromL2Muon.h b/FastSimulation/Muons/plugins/FastTSGFromL2Muon.h index 26a618c3a8e72..ffb56f5b4c11c 100644 --- a/FastSimulation/Muons/plugins/FastTSGFromL2Muon.h +++ b/FastSimulation/Muons/plugins/FastTSGFromL2Muon.h @@ -37,7 +37,6 @@ class FastTSGFromL2Muon : public edm::stream::EDProducer<> { const SimTrack& theSimTrack); private: - edm::ParameterSet theConfig; edm::InputTag theSimTrackCollectionLabel; edm::InputTag theL2CollectionLabel; std::vector theSeedCollectionLabels; @@ -46,7 +45,7 @@ class FastTSGFromL2Muon : public edm::stream::EDProducer<> { MuonServiceProxy* theService; double thePtCut; - MuonTrackingRegionBuilder* theRegionBuilder; + std::unique_ptr theRegionBuilder; // TH1F* h_nSeedPerTrack; // TH1F* h_nGoodSeedPerTrack; diff --git a/FastSimulation/Muons/plugins/FastTSGFromPropagation.cc b/FastSimulation/Muons/plugins/FastTSGFromPropagation.cc index 4b336ea86d502..2b9f331f48ebd 100644 --- a/FastSimulation/Muons/plugins/FastTSGFromPropagation.cc +++ b/FastSimulation/Muons/plugins/FastTSGFromPropagation.cc @@ -52,7 +52,6 @@ FastTSGFromPropagation::FastTSGFromPropagation(const edm::ParameterSet& iConfig, const MuonServiceProxy* service, edm::ConsumesCollector& iC) : theCategory("FastSimulation|Muons|FastTSGFromPropagation"), - theTracker(), theNavigation(), theService(service), theUpdator(), @@ -65,7 +64,10 @@ FastTSGFromPropagation::FastTSGFromPropagation(const edm::ParameterSet& iConfig, iC.consumes(theConfig.getParameter("HitProducer"))), beamSpot_(iC.consumes(iConfig.getParameter("beamSpot"))), theMeasurementTrackerEventToken_( - iC.consumes(iConfig.getParameter("MeasurementTrackerEvent"))) {} + iC.consumes(iConfig.getParameter("MeasurementTrackerEvent"))), + theGeometryToken(iC.esConsumes()), + theTTRHBuilderToken(iC.esConsumes(edm::ESInputTag("", "WithTrackAngle"))), + theTrackerToken(iC.esConsumes()) {} FastTSGFromPropagation::~FastTSGFromPropagation() { LogTrace(theCategory) << " FastTSGFromPropagation dtor called "; } @@ -320,8 +322,6 @@ void FastTSGFromPropagation::init(const MuonServiceProxy* service) { theEstimator = std::make_unique(theMaxChi2); - theCacheId_MT = 0; - theCacheId_TG = 0; thePropagatorName = theConfig.getParameter("Propagator"); @@ -347,14 +347,9 @@ void FastTSGFromPropagation::init(const MuonServiceProxy* service) { theErrorMatrixAdjuster.reset(); } - theService->eventSetup().get().get(theTracker); - theNavigation = std::make_unique(theTracker); - - edm::ESHandle geometry; - theService->eventSetup().get().get(geometry); - theGeometry = &(*geometry); + theGeometry = &theService->eventSetup().getData(theGeometryToken); - theService->eventSetup().get().get("WithTrackAngle", theTTRHBuilder); + theTTRHBuilder = theService->eventSetup().getHandle(theTTRHBuilderToken); } void FastTSGFromPropagation::setEvent(const edm::Event& iEvent) { @@ -364,30 +359,16 @@ void FastTSGFromPropagation::setEvent(const edm::Event& iEvent) { iEvent.getByToken(theSimTrackCollectionToken_, theSimTracks); iEvent.getByToken(recHitCombinationsToken_, recHitCombinations); - unsigned long long newCacheId_MT = theService->eventSetup().get().cacheIdentifier(); - - if (theUpdateStateFlag && newCacheId_MT != theCacheId_MT) { - LogTrace(theCategory) << "Measurment Tracker Geometry changed!"; - theCacheId_MT = newCacheId_MT; - theService->eventSetup().get().get(theMeasTracker); - } - if (theUpdateStateFlag) { iEvent.getByToken(theMeasurementTrackerEventToken_, theMeasTrackerEvent); } - bool trackerGeomChanged = false; - unsigned long long newCacheId_TG = theService->eventSetup().get().cacheIdentifier(); if (newCacheId_TG != theCacheId_TG) { LogTrace(theCategory) << "Tracker Reco Geometry changed!"; theCacheId_TG = newCacheId_TG; - theService->eventSetup().get().get(theTracker); - trackerGeomChanged = true; - } - - if (trackerGeomChanged && theTracker.product()) { + auto theTracker = theService->eventSetup().getHandle(theTrackerToken); theNavigation = std::make_unique(theTracker); } } diff --git a/FastSimulation/Muons/plugins/FastTSGFromPropagation.h b/FastSimulation/Muons/plugins/FastTSGFromPropagation.h index 0ebc8ba23216e..5f812d6ff5830 100644 --- a/FastSimulation/Muons/plugins/FastTSGFromPropagation.h +++ b/FastSimulation/Muons/plugins/FastTSGFromPropagation.h @@ -44,6 +44,9 @@ struct TrajectoryStateTransform; class SimTrack; class TrackerGeometry; class TrackerTopology; +class TransientRecHitRecord; +class CkfComponentsRecord; +class TrackerRecoGeometryRecord; class FastTSGFromPropagation : public TrackerSeedGenerator { public: @@ -123,15 +126,10 @@ class FastTSGFromPropagation : public TrackerSeedGenerator { } }; - unsigned long long theCacheId_MT; unsigned long long theCacheId_TG; std::string theCategory; - edm::ESHandle theTracker; - - edm::ESHandle theMeasTracker; - std::unique_ptr theNavigation; const TrackerGeometry* theGeometry; @@ -175,6 +173,13 @@ class FastTSGFromPropagation : public TrackerSeedGenerator { edm::Handle recHitCombinations; edm::Handle theMeasTrackerEvent; edm::ESHandle theTTRHBuilder; + + //from init + edm::ESGetToken theGeometryToken; + edm::ESGetToken theTTRHBuilderToken; + + //from setEvent + edm::ESGetToken theTrackerToken; }; #endif diff --git a/FastSimulation/ShowerDevelopment/interface/FastHFShowerLibrary.h b/FastSimulation/ShowerDevelopment/interface/FastHFShowerLibrary.h index 1c382617ef749..596186392abf7 100644 --- a/FastSimulation/ShowerDevelopment/interface/FastHFShowerLibrary.h +++ b/FastSimulation/ShowerDevelopment/interface/FastHFShowerLibrary.h @@ -6,9 +6,8 @@ /////////////////////////////////////////////////////////////////////////////// #include "FWCore/ParameterSet/interface/ParameterSet.h" -#include "FWCore/MessageLogger/interface/MessageLogger.h" -#include "FWCore/Framework/interface/Event.h" -#include "FWCore/Framework/interface/EventSetup.h" +#include "FWCore/Framework/interface/FrameworkfwdMostUsed.h" +#include "FWCore/Utilities/interface/ESGetToken.h" #include "FastSimulation/Utilities/interface/FamosDebug.h" @@ -18,6 +17,8 @@ #include "SimG4CMS/Calo/interface/CaloHitID.h" #include "Geometry/HcalCommonData/interface/HcalNumberingFromDDD.h" #include "Geometry/HcalCommonData/interface/HcalDDDSimConstants.h" +#include "Geometry/HcalCommonData/interface/HcalSimulationConstants.h" +#include "Geometry/Records/interface/HcalSimNumberingRecord.h" #include "SimG4CMS/Calo/interface/HcalNumberingScheme.h" #include "G4ThreeVector.hh" @@ -38,8 +39,8 @@ class RandomEngineAndDistribution; class FastHFShowerLibrary { public: // Constructor and Destructor - FastHFShowerLibrary(edm::ParameterSet const& p); - ~FastHFShowerLibrary() { ; } + FastHFShowerLibrary(edm::ParameterSet const&, edm::ConsumesCollector&&); + ~FastHFShowerLibrary() {} public: void const initHFShowerLibrary(const edm::EventSetup&); @@ -60,5 +61,8 @@ class FastHFShowerLibrary { bool applyFidCut; std::string name; + + const edm::ESGetToken hcalDDDSimConstantsESToken_; + const edm::ESGetToken hcalSimulationConstantsESToken_; }; #endif diff --git a/FastSimulation/ShowerDevelopment/src/FastHFShowerLibrary.cc b/FastSimulation/ShowerDevelopment/src/FastHFShowerLibrary.cc index 8162e2ab791f8..311eeb2c2cd98 100644 --- a/FastSimulation/ShowerDevelopment/src/FastHFShowerLibrary.cc +++ b/FastSimulation/ShowerDevelopment/src/FastHFShowerLibrary.cc @@ -8,13 +8,12 @@ #include "FastSimulation/Event/interface/FSimTrack.h" #include "FastSimulation/Utilities/interface/RandomEngineAndDistribution.h" #include "SimG4CMS/Calo/interface/HFFibreFiducial.h" +#include "FWCore/Framework/interface/ConsumesCollector.h" #include "FWCore/Framework/interface/ESTransientHandle.h" -#include "FWCore/Framework/interface/ESHandle.h" +#include "FWCore/Framework/interface/EventSetup.h" +#include "FWCore/MessageLogger/interface/MessageLogger.h" #include "Geometry/Records/interface/IdealGeometryRecord.h" #include "Geometry/Records/interface/HcalParametersRcd.h" -#include "Geometry/Records/interface/HcalSimNumberingRecord.h" -#include "Geometry/HcalCommonData/interface/HcalDDDSimConstants.h" -#include "Geometry/HcalCommonData/interface/HcalSimulationConstants.h" #include "FWCore/Utilities/interface/Exception.h" #include "DataFormats/HcalDetId/interface/HcalDetId.h" #include "DataFormats/HcalDetId/interface/HcalSubdetector.h" @@ -31,8 +30,6 @@ #include "G4ParticleTypes.hh" // STL headers -#include - #include #include #include @@ -41,7 +38,8 @@ static std::once_flag initializeOnce; -FastHFShowerLibrary::FastHFShowerLibrary(edm::ParameterSet const& p) : fast(p) { +FastHFShowerLibrary::FastHFShowerLibrary(edm::ParameterSet const& p, edm::ConsumesCollector&& iC) + : fast(p), hcalDDDSimConstantsESToken_(iC.esConsumes()), hcalSimulationConstantsESToken_(iC.esConsumes()) { edm::ParameterSet m_HS = p.getParameter("HFShowerLibrary"); applyFidCut = m_HS.getParameter("ApplyFiducialCut"); } @@ -49,13 +47,8 @@ FastHFShowerLibrary::FastHFShowerLibrary(edm::ParameterSet const& p) : fast(p) { void const FastHFShowerLibrary::initHFShowerLibrary(const edm::EventSetup& iSetup) { edm::LogInfo("FastCalorimetry") << "initHFShowerLibrary::initialization"; - edm::ESHandle hdc; - iSetup.get().get(hdc); - hcalConstants = hdc.product(); - - edm::ESHandle hdsc; - iSetup.get().get(hdsc); - const HcalSimulationConstants* hsps = hdsc.product(); + hcalConstants = &iSetup.getData(hcalDDDSimConstantsESToken_); + const HcalSimulationConstants* hsps = &iSetup.getData(hcalSimulationConstantsESToken_); std::string name = "HcalHits"; numberingFromDDD = std::make_unique(hcalConstants); diff --git a/FastSimulation/SimplifiedGeometryPropagator/interface/Geometry.h b/FastSimulation/SimplifiedGeometryPropagator/interface/Geometry.h index b3627fb134dec..17e84209b9d79 100644 --- a/FastSimulation/SimplifiedGeometryPropagator/interface/Geometry.h +++ b/FastSimulation/SimplifiedGeometryPropagator/interface/Geometry.h @@ -4,23 +4,21 @@ #include "DataFormats/Math/interface/LorentzVector.h" #include "FastSimulation/SimplifiedGeometryPropagator/interface/ForwardSimplifiedGeometry.h" #include "FastSimulation/SimplifiedGeometryPropagator/interface/BarrelSimplifiedGeometry.h" +#include "FWCore/Framework/interface/FrameworkfwdMostUsed.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/Utilities/interface/ESGetToken.h" +#include "MagneticField/Engine/interface/MagneticField.h" +#include "MagneticField/Records/interface/IdealMagneticFieldRecord.h" +#include "RecoTracker/Record/interface/TrackerRecoGeometryRecord.h" +#include "RecoTracker/TkDetLayers/interface/GeometricSearchTracker.h" /////////////////////////////////////////////// // Author: L. Vanelderen, S. Kurz // Date: 29 May 2017 ////////////////////////////////////////////////////////// -class GeometricSearchTracker; -class MagneticField; - #include -namespace edm { - //class ParameterSet; - class EventSetup; -} // namespace edm - namespace fastsim { class InteractionModel; @@ -32,7 +30,7 @@ namespace fastsim { class Geometry { public: //! Constructor. - Geometry(const edm::ParameterSet& cfg); + Geometry(const edm::ParameterSet&, edm::ConsumesCollector&&); //! Default destructor. ~Geometry(); @@ -168,6 +166,9 @@ namespace fastsim { const bool forwardBoundary_; //!< Hack to interface "old" calo to "new" tracking const edm::ParameterSet trackerBarrelBoundaryCfg_; //!< Hack to interface "old" calo to "new" tracking const edm::ParameterSet trackerForwardBoundaryCfg_; //!< Hack to interface "old" calo to "new" tracking + + edm::ESGetToken geometricSearchTrackerESToken_; + edm::ESGetToken magneticFieldESToken_; }; std::ostream& operator<<(std::ostream& os, const fastsim::Geometry& geometry); } // namespace fastsim diff --git a/FastSimulation/SimplifiedGeometryPropagator/plugins/FastSimProducer.cc b/FastSimulation/SimplifiedGeometryPropagator/plugins/FastSimProducer.cc index 6a974f6c1d202..62af05ae4bf50 100644 --- a/FastSimulation/SimplifiedGeometryPropagator/plugins/FastSimProducer.cc +++ b/FastSimulation/SimplifiedGeometryPropagator/plugins/FastSimProducer.cc @@ -3,6 +3,7 @@ #include // framework +#include "FWCore/Framework/interface/ConsumesCollector.h" #include "FWCore/Framework/interface/Frameworkfwd.h" #include "FWCore/Framework/interface/stream/EDProducer.h" #include "FWCore/Framework/interface/EventSetup.h" @@ -10,7 +11,6 @@ #include "FWCore/Framework/interface/MakerMacros.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "FWCore/Utilities/interface/StreamID.h" -#include "FWCore/Framework/interface/ESHandle.h" #include "FWCore/Framework/interface/LuminosityBlock.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" #include "FWCore/Framework/interface/ESWatcher.h" @@ -92,20 +92,29 @@ class FastSimProducer : public edm::stream::EDProducer<> { std::vector > interactionModels_; //!< All defined interaction models std::map interactionModelMap_; //!< Each interaction model has a unique name static const std::string MESSAGECATEGORY; //!< Category of debugging messages ("FastSimulation") + const edm::ESGetToken particleDataTableESToken_; + edm::ESGetToken caloGeometryESToken_; + edm::ESGetToken caloTopologyESToken_; }; const std::string FastSimProducer::MESSAGECATEGORY = "FastSimulation"; FastSimProducer::FastSimProducer(const edm::ParameterSet& iConfig) : genParticlesToken_(consumes(iConfig.getParameter("src"))), - geometry_(iConfig.getParameter("trackerDefinition")), - caloGeometry_(iConfig.getParameter("caloDefinition")), + geometry_(iConfig.getParameter("trackerDefinition"), consumesCollector()), + caloGeometry_(iConfig.getParameter("caloDefinition"), consumesCollector()), beamPipeRadius_(iConfig.getParameter("beamPipeRadius")), deltaRchargedMother_(iConfig.getParameter("deltaRchargedMother")), particleFilter_(iConfig.getParameter("particleFilter")), _randomEngine(nullptr), simulateCalorimetry(iConfig.getParameter("simulateCalorimetry")), - simulateMuons(iConfig.getParameter("simulateMuons")) { + simulateMuons(iConfig.getParameter("simulateMuons")), + particleDataTableESToken_(esConsumes()) { + if (simulateCalorimetry) { + caloGeometryESToken_ = esConsumes(); + caloTopologyESToken_ = esConsumes(); + } + //---------------- // define interaction models //--------------- @@ -136,7 +145,8 @@ FastSimProducer::FastSimProducer(const edm::ParameterSet& iConfig) iConfig.getParameter("Calorimetry"), iConfig.getParameter("MaterialEffectsForMuonsInECAL"), iConfig.getParameter("MaterialEffectsForMuonsInHCAL"), - iConfig.getParameter("GFlash")); + iConfig.getParameter("GFlash"), + consumesCollector()); } //---------------- @@ -172,8 +182,7 @@ void FastSimProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) std::unique_ptr simVertices_(new edm::SimVertexContainer); // Get the particle data table (in case lifetime or charge of GenParticles not set) - edm::ESHandle pdt; - iSetup.getData(pdt); + auto const& pdt = iSetup.getData(particleDataTableESToken_); // Get the GenParticle collection edm::Handle genParticles; @@ -182,7 +191,7 @@ void FastSimProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) // Load the ParticleManager which returns the particles that have to be propagated // Creates a fastsim::Particle out of a GenParticle/secondary fastsim::ParticleManager particleManager(*genParticles->GetEvent(), - *pdt, + pdt, beamPipeRadius_, deltaRchargedMother_, particleFilter_, @@ -192,13 +201,11 @@ void FastSimProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) // Initialize the calorimeter geometry if (simulateCalorimetry) { if (watchCaloGeometry_.check(iSetup) || watchCaloTopology_.check(iSetup)) { - edm::ESHandle pG; - iSetup.get().get(pG); - myCalorimetry->getCalorimeter()->setupGeometry(*pG); + auto const& pG = iSetup.getData(caloGeometryESToken_); + myCalorimetry->getCalorimeter()->setupGeometry(pG); - edm::ESHandle theCaloTopology; - iSetup.get().get(theCaloTopology); - myCalorimetry->getCalorimeter()->setupTopology(*theCaloTopology); + auto const& theCaloTopology = iSetup.getData(caloTopologyESToken_); + myCalorimetry->getCalorimeter()->setupTopology(theCaloTopology); myCalorimetry->getCalorimeter()->initialize(geometry_.getMagneticFieldZ(math::XYZTLorentzVector(0., 0., 0., 0.))); myCalorimetry->getHFShowerLibrary()->initHFShowerLibrary(iSetup); @@ -306,7 +313,7 @@ void FastSimProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) LogDebug(MESSAGECATEGORY) << "\n moving particle to calorimetry: " << *particle; // create FSimTrack (this is the object the old propagation uses) - myFSimTracks.push_back(createFSimTrack(particle.get(), &particleManager, *pdt)); + myFSimTracks.push_back(createFSimTrack(particle.get(), &particleManager, pdt)); // particle was decayed if (!particle->isStable() && particle->remainingProperLifeTimeC() < 1E-10) { continue; diff --git a/FastSimulation/SimplifiedGeometryPropagator/plugins/FastTrackDeDxProducer.cc b/FastSimulation/SimplifiedGeometryPropagator/plugins/FastTrackDeDxProducer.cc index 6d6bc02b8b6a6..1f128ddf632e8 100644 --- a/FastSimulation/SimplifiedGeometryPropagator/plugins/FastTrackDeDxProducer.cc +++ b/FastSimulation/SimplifiedGeometryPropagator/plugins/FastTrackDeDxProducer.cc @@ -26,13 +26,13 @@ #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/MakerMacros.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" -#include "FWCore/Framework/interface/ESHandle.h" #include "FWCore/Framework/interface/ConsumesCollector.h" #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h" #include "Geometry/TrackerGeometryBuilder/interface/StripGeomDetUnit.h" #include "Geometry/CommonDetUnit/interface/PixelGeomDetUnit.h" #include "Geometry/CommonDetUnit/interface/GluedGeomDet.h" +#include "Geometry/Records/interface/TrackerDigiGeometryRecord.h" #include "DataFormats/Common/interface/ValueMap.h" #include "DataFormats/TrackReco/interface/DeDxData.h" @@ -71,7 +71,7 @@ class FastTrackDeDxProducer : public edm::stream::EDProducer<> { static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); private: - void beginRun(edm::Run const& run, const edm::EventSetup&) override; + void beginRun(edm::Run const&, const edm::EventSetup&) override; void produce(edm::Event&, const edm::EventSetup&) override; void makeCalibrationMap(const TrackerGeometry& tkGeom); @@ -82,7 +82,6 @@ class FastTrackDeDxProducer : public edm::stream::EDProducer<> { int& NClusterSaturating); // ----------member data --------------------------- - //BaseDeDxEstimator* m_estimator; std::unique_ptr m_estimator; @@ -100,7 +99,7 @@ class FastTrackDeDxProducer : public edm::stream::EDProducer<> { edm::EDGetTokenT simHitsToken; edm::EDGetTokenT simHit2RecHitMapToken; - const edm::ESGetToken tkGeomToken; + edm::ESGetToken tkGeomToken; bool usePixel; bool useStrip; @@ -139,8 +138,7 @@ void FastTrackDeDxProducer::fillDescriptions(edm::ConfigurationDescriptions& des FastTrackDeDxProducer::FastTrackDeDxProducer(const edm::ParameterSet& iConfig) : simHitsToken(consumes(iConfig.getParameter("simHits"))), simHit2RecHitMapToken( - consumes(iConfig.getParameter("simHit2RecHitMap"))), - tkGeomToken(esConsumes()) { + consumes(iConfig.getParameter("simHit2RecHitMap"))) { produces>(); auto cCollector = consumesCollector(); @@ -183,22 +181,25 @@ FastTrackDeDxProducer::FastTrackDeDxProducer(const edm::ParameterSet& iConfig) if (!usePixel && !useStrip) throw cms::Exception("fastsim::SimplifiedGeometry::FastTrackDeDxProducer.cc") << " neither pixel hits nor strips hits will be used to compute de/dx"; + + if (useCalibration) { + tkGeomToken = esConsumes(); + } } // ------------ method called once each job just before starting event loop ------------ void FastTrackDeDxProducer::beginRun(edm::Run const& run, const edm::EventSetup& iSetup) { if (useCalibration && calibGains.empty()) { - edm::ESHandle tkGeom; - iSetup.get().get(tkGeom); - m_off = tkGeom->offsetDU(GeomDetEnumerators::PixelBarrel); //index start at the first pixel + auto const& tkGeom = iSetup.getData(tkGeomToken); + m_off = tkGeom.offsetDU(GeomDetEnumerators::PixelBarrel); //index start at the first pixel - DeDxTools::makeCalibrationMap(m_calibrationPath, *tkGeom, calibGains, m_off); + DeDxTools::makeCalibrationMap(m_calibrationPath, tkGeom, calibGains, m_off); } m_estimator->beginRun(run, iSetup); } -void FastTrackDeDxProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) { +void FastTrackDeDxProducer::produce(edm::Event& iEvent, const edm::EventSetup&) { auto trackDeDxEstimateAssociation = std::make_unique>(); ValueMap::Filler filler(*trackDeDxEstimateAssociation); diff --git a/FastSimulation/SimplifiedGeometryPropagator/src/Geometry.cc b/FastSimulation/SimplifiedGeometryPropagator/src/Geometry.cc index 2c2cd821c6ff1..902934253a738 100644 --- a/FastSimulation/SimplifiedGeometryPropagator/src/Geometry.cc +++ b/FastSimulation/SimplifiedGeometryPropagator/src/Geometry.cc @@ -1,16 +1,14 @@ //Framework Headers -#include "FWCore/Utilities/interface/Exception.h" +#include "FWCore/Framework/interface/ConsumesCollector.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" -#include "FWCore/Framework/interface/ESHandle.h" +#include "FWCore/Utilities/interface/ESInputTag.h" +#include "FWCore/Utilities/interface/Exception.h" #include "FastSimulation/SimplifiedGeometryPropagator/interface/SimplifiedGeometryFactory.h" #include "FastSimulation/SimplifiedGeometryPropagator/interface/ForwardSimplifiedGeometry.h" #include "FastSimulation/SimplifiedGeometryPropagator/interface/BarrelSimplifiedGeometry.h" -#include "RecoTracker/Record/interface/TrackerRecoGeometryRecord.h" -#include "MagneticField/Engine/interface/MagneticField.h" #include "MagneticField/UniformEngine/interface/UniformMagneticField.h" -#include "MagneticField/Records/interface/IdealMagneticFieldRecord.h" #include "FastSimulation/SimplifiedGeometryPropagator/interface/Geometry.h" #include @@ -21,7 +19,7 @@ using namespace fastsim; Geometry::~Geometry() { ; } -Geometry::Geometry(const edm::ParameterSet& cfg) +Geometry::Geometry(const edm::ParameterSet& cfg, edm::ConsumesCollector&& iC) : cacheIdentifierTrackerRecoGeometry_(0), cacheIdentifierIdealMagneticField_(0), geometricSearchTracker_(nullptr), @@ -45,7 +43,14 @@ Geometry::Geometry(const edm::ParameterSet& cfg) trackerForwardBoundaryCfg_(forwardBoundary_ ? cfg.getParameter("trackerForwardBoundary") : edm::ParameterSet()) // Hack to interface "old" calo to "new" tracking - {}; +{ + if (useTrackerRecoGeometryRecord_) { + geometricSearchTrackerESToken_ = iC.esConsumes(edm::ESInputTag("", trackerAlignmentLabel_)); + } + if (!useFixedMagneticFieldZ_) { + magneticFieldESToken_ = iC.esConsumes(); + } +} void Geometry::update(const edm::EventSetup& iSetup, const std::map& interactionModelMap) { @@ -59,9 +64,7 @@ void Geometry::update(const edm::EventSetup& iSetup, //---------------- if (iSetup.get().cacheIdentifier() != cacheIdentifierTrackerRecoGeometry_) { if (useTrackerRecoGeometryRecord_) { - edm::ESHandle geometricSearchTrackerHandle; - iSetup.get().get(trackerAlignmentLabel_, geometricSearchTrackerHandle); - geometricSearchTracker_ = &(*geometricSearchTrackerHandle); + geometricSearchTracker_ = &iSetup.getData(geometricSearchTrackerESToken_); } } @@ -75,9 +78,7 @@ void Geometry::update(const edm::EventSetup& iSetup, magneticField_ = ownedMagneticField_.get(); } else // get magnetic field from EventSetup { - edm::ESHandle magneticField; - iSetup.get().get(magneticField); - magneticField_ = &(*magneticField); + magneticField_ = &iSetup.getData(magneticFieldESToken_); } } diff --git a/FastSimulation/Tracking/interface/SeedFinderSelector.h b/FastSimulation/Tracking/interface/SeedFinderSelector.h index 77e21b4ab799e..2b472ba8ab492 100644 --- a/FastSimulation/Tracking/interface/SeedFinderSelector.h +++ b/FastSimulation/Tracking/interface/SeedFinderSelector.h @@ -6,32 +6,29 @@ #include #include "DataFormats/TrackerCommon/interface/TrackerTopology.h" +#include "Geometry/Records/interface/TrackerTopologyRcd.h" #include "TrackingTools/TransientTrackingRecHit/interface/SeedingLayerSetsHits.h" +#include "RecoTracker/MeasurementDet/interface/MeasurementTracker.h" +#include "RecoTracker/Record/interface/CkfComponentsRecord.h" #include "RecoTracker/TkSeedingLayers/interface/SeedingLayerSetsBuilder.h" +#include "FWCore/Framework/interface/FrameworkfwdMostUsed.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/Utilities/interface/ESGetToken.h" class TrackingRegion; class FastTrackerRecHit; class MultiHitGeneratorFromPairAndLayers; class HitTripletGeneratorFromPairAndLayers; -class MeasurementTracker; class CAHitTripletGenerator; class CAHitQuadrupletGenerator; -namespace edm { - class Event; - class EventSetup; - class ParameterSet; - class ConsumesCollector; -} // namespace edm - class SeedFinderSelector { public: - SeedFinderSelector(const edm::ParameterSet& cfg, edm::ConsumesCollector&& consumesCollector); + SeedFinderSelector(const edm::ParameterSet&, edm::ConsumesCollector&&); ~SeedFinderSelector(); - void initEvent(const edm::Event& ev, const edm::EventSetup& es); + void initEvent(const edm::Event&, const edm::EventSetup&); void setTrackingRegion(const TrackingRegion* trackingRegion) { trackingRegion_ = trackingRegion; } @@ -46,12 +43,14 @@ class SeedFinderSelector { const edm::EventSetup* eventSetup_; const MeasurementTracker* measurementTracker_; const std::string measurementTrackerLabel_; + const edm::ESGetToken measurementTrackerESToken_; + const edm::ESGetToken trackerTopologyESToken_; + const TrackerTopology* trackerTopology_ = nullptr; std::unique_ptr CAHitTriplGenerator_; std::unique_ptr CAHitQuadGenerator_; std::unique_ptr seedingLayers_; std::unique_ptr seedingLayer; std::vector layerPairs_; - edm::ESHandle trackerTopology; std::vector seedingLayerIds; }; diff --git a/FastSimulation/Tracking/plugins/PixelTracksProducer.cc b/FastSimulation/Tracking/plugins/PixelTracksProducer.cc index 3692c8a4d4bd8..b3f478202f9e3 100644 --- a/FastSimulation/Tracking/plugins/PixelTracksProducer.cc +++ b/FastSimulation/Tracking/plugins/PixelTracksProducer.cc @@ -4,16 +4,12 @@ #include "FWCore/Framework/interface/Event.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "FWCore/Framework/interface/ConsumesCollector.h" -#include "FWCore/Framework/interface/ESHandle.h" #include "DataFormats/Common/interface/Handle.h" #include "DataFormats/Common/interface/OwnVector.h" #include "DataFormats/TrackingRecHit/interface/TrackingRecHit.h" -#include "DataFormats/TrackerCommon/interface/TrackerTopology.h" -#include "Geometry/Records/interface/TrackerTopologyRcd.h" - //Pixel Specific stuff #include "RecoTracker/TkTrackingRegions/interface/TrackingRegionProducer.h" #include "RecoTracker/TkTrackingRegions/interface/TrackingRegionProducerFactory.h" @@ -32,7 +28,8 @@ using namespace pixeltrackfitting; -PixelTracksProducer::PixelTracksProducer(const edm::ParameterSet& conf) : theRegionProducer(nullptr) { +PixelTracksProducer::PixelTracksProducer(const edm::ParameterSet& conf) + : theRegionProducer(nullptr), ttopoToken(esConsumes()) { produces(); produces(); produces(); @@ -62,9 +59,7 @@ void PixelTracksProducer::produce(edm::Event& e, const edm::EventSetup& es) { TracksWithRecHits pixeltracks; TracksWithRecHits cleanedTracks; - edm::ESHandle httopo; - es.get().get(httopo); - const TrackerTopology& ttopo = *httopo; + const TrackerTopology& ttopo = es.getData(ttopoToken); edm::Handle hfitter; e.getByToken(fitterToken, hfitter); @@ -107,7 +102,7 @@ void PixelTracksProducer::produce(edm::Event& e, const edm::EventSetup& es) { } // fitting the triplet - std::unique_ptr track = fitter.run(TripletHits, region, es); + std::unique_ptr track = fitter.run(TripletHits, region); // decide if track should be skipped according to filter if (!theFilter(track.get(), TripletHits)) { diff --git a/FastSimulation/Tracking/plugins/PixelTracksProducer.h b/FastSimulation/Tracking/plugins/PixelTracksProducer.h index ca5ebac6635c6..fa314e712c4f5 100644 --- a/FastSimulation/Tracking/plugins/PixelTracksProducer.h +++ b/FastSimulation/Tracking/plugins/PixelTracksProducer.h @@ -1,23 +1,21 @@ #ifndef FastSimulation_Tracking_PixelTracksProducer_H #define FastSimulation_Tracking_PixelTracksProducer_H +#include "FWCore/Framework/interface/FrameworkfwdMostUsed.h" #include "FWCore/Framework/interface/stream/EDProducer.h" #include "FWCore/Utilities/interface/InputTag.h" #include "DataFormats/TrajectorySeed/interface/TrajectorySeedCollection.h" +#include "DataFormats/TrackerCommon/interface/TrackerTopology.h" +#include "Geometry/Records/interface/TrackerTopologyRcd.h" + #include class PixelFitter; class PixelTrackFilter; class TrackingRegionProducer; -namespace edm { - class ParameterSet; - class Event; - class EventSetup; -} // namespace edm - class PixelTracksProducer : public edm::stream::EDProducer<> { public: explicit PixelTracksProducer(const edm::ParameterSet& conf); @@ -32,5 +30,6 @@ class PixelTracksProducer : public edm::stream::EDProducer<> { edm::EDGetTokenT seedProducerToken; edm::EDGetTokenT filterToken; + edm::ESGetToken ttopoToken; }; #endif diff --git a/FastSimulation/Tracking/plugins/TrackCandidateProducer.cc b/FastSimulation/Tracking/plugins/TrackCandidateProducer.cc index bd6ac5afad9b9..974ab0079d196 100644 --- a/FastSimulation/Tracking/plugins/TrackCandidateProducer.cc +++ b/FastSimulation/Tracking/plugins/TrackCandidateProducer.cc @@ -43,7 +43,7 @@ class TrackCandidateProducer : public edm::stream::EDProducer<> { public: explicit TrackCandidateProducer(const edm::ParameterSet& conf); - void produce(edm::Event& e, const edm::EventSetup& es) override; + void produce(edm::Event&, const edm::EventSetup&) override; private: // tokens & labels @@ -52,6 +52,10 @@ class TrackCandidateProducer : public edm::stream::EDProducer<> { edm::EDGetTokenT > hitMasksToken; edm::EDGetTokenT simTrackToken; std::string propagatorLabel; + const edm::ESGetToken magneticFieldESToken_; + const edm::ESGetToken trackerGeometryESToken_; + const edm::ESGetToken trackerTopologyESToken_; + const edm::ESGetToken propagatorESToken_; // other data bool rejectOverlaps; @@ -60,7 +64,13 @@ class TrackCandidateProducer : public edm::stream::EDProducer<> { double maxSeedMatchEstimator; }; -TrackCandidateProducer::TrackCandidateProducer(const edm::ParameterSet& conf) : hitSplitter() { +TrackCandidateProducer::TrackCandidateProducer(const edm::ParameterSet& conf) + : propagatorLabel(conf.getParameter("propagator")), + magneticFieldESToken_(esConsumes()), + trackerGeometryESToken_(esConsumes()), + trackerTopologyESToken_(esConsumes()), + propagatorESToken_(esConsumes(edm::ESInputTag("", propagatorLabel))), + hitSplitter() { // produces produces(); @@ -77,22 +87,14 @@ TrackCandidateProducer::TrackCandidateProducer(const edm::ParameterSet& conf) : maxSeedMatchEstimator = conf.getUntrackedParameter("maxSeedMatchEstimator", 0); rejectOverlaps = conf.getParameter("OverlapCleaning"); splitHits = conf.getParameter("SplitHits"); - propagatorLabel = conf.getParameter("propagator"); } void TrackCandidateProducer::produce(edm::Event& e, const edm::EventSetup& es) { // get records - edm::ESHandle magneticField; - es.get().get(magneticField); - - edm::ESHandle trackerGeometry; - es.get().get(trackerGeometry); - - edm::ESHandle trackerTopology; - es.get().get(trackerTopology); - - edm::ESHandle propagator; - es.get().get(propagatorLabel, propagator); + auto const& magneticField = es.getData(magneticFieldESToken_); + auto const& trackerGeometry = es.getData(trackerGeometryESToken_); + auto const& trackerTopology = es.getData(trackerTopologyESToken_); + auto const& propagator = es.getData(propagatorESToken_); // get products edm::Handle > seeds; @@ -120,7 +122,7 @@ void TrackCandidateProducer::produce(edm::Event& e, const edm::EventSetup& es) { // match hitless seeds to simTracks and find corresponding recHitCombination if (seed.nHits() == 0) { recHitCombinationIndices = SeedMatcher::matchRecHitCombinations( - seed, *recHitCombinations, *simTracks, maxSeedMatchEstimator, *propagator, *magneticField, *trackerGeometry); + seed, *recHitCombinations, *simTracks, maxSeedMatchEstimator, propagator, magneticField, trackerGeometry); } // for normal seeds, retrieve the corresponding recHitCombination from the seed hits else { @@ -176,8 +178,8 @@ void TrackCandidateProducer::produce(edm::Event& e, const edm::EventSetup& es) { // always accept the first hit // also accept a hit if it is not on the layer of the previous hit if (!rejectOverlaps || selectedRecHits.empty() || - (TrackingLayer::createFromDetId(selectedRecHits.back()->geographicalId(), *trackerTopology.product()) != - TrackingLayer::createFromDetId(selectedRecHit->geographicalId(), *trackerTopology.product()))) { + (TrackingLayer::createFromDetId(selectedRecHits.back()->geographicalId(), trackerTopology) != + TrackingLayer::createFromDetId(selectedRecHit->geographicalId(), trackerTopology))) { selectedRecHits.push_back(selectedRecHit); } // else: @@ -207,12 +209,12 @@ void TrackCandidateProducer::produce(edm::Event& e, const edm::EventSetup& es) { // create track candidate state // 1. get seed state (defined on the surface of the most outer hit) DetId seedDetId(seed.startingState().detId()); - const GeomDet* gdet = trackerGeometry->idToDet(seedDetId); + const GeomDet* gdet = trackerGeometry.idToDet(seedDetId); TrajectoryStateOnSurface seedTSOS = - trajectoryStateTransform::transientState(seed.startingState(), &(gdet->surface()), magneticField.product()); + trajectoryStateTransform::transientState(seed.startingState(), &(gdet->surface()), &magneticField); // 2. backPropagate the seedState to the surfuce of the most inner hit - const GeomDet* initialLayer = trackerGeometry->idToDet(hitsForTrackCandidate.front().geographicalId()); - const TrajectoryStateOnSurface initialTSOS = propagator->propagate(seedTSOS, initialLayer->surface()); + const GeomDet* initialLayer = trackerGeometry.idToDet(hitsForTrackCandidate.front().geographicalId()); + const TrajectoryStateOnSurface initialTSOS = propagator.propagate(seedTSOS, initialLayer->surface()); // 3. check validity and transform if (!initialTSOS.isValid()) continue; diff --git a/FastSimulation/Tracking/plugins/TrajectorySeedProducer.cc b/FastSimulation/Tracking/plugins/TrajectorySeedProducer.cc index 82ad2b52231f4..98091eec00090 100644 --- a/FastSimulation/Tracking/plugins/TrajectorySeedProducer.cc +++ b/FastSimulation/Tracking/plugins/TrajectorySeedProducer.cc @@ -27,7 +27,6 @@ #include "FWCore/Framework/interface/stream/EDProducer.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/EventSetup.h" -#include "FWCore/Framework/interface/ESHandle.h" #include "FWCore/Framework/interface/ConsumesCollector.h" #include "FWCore/Utilities/interface/InputTag.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" @@ -63,6 +62,7 @@ class TrajectorySeedProducer : public edm::stream::EDProducer<> { edm::EDGetTokenT recHitCombinationsToken; edm::EDGetTokenT> hitMasksToken; edm::EDGetTokenT> trackingRegionToken; + const edm::ESGetToken trackerTopologyESToken_; // other data members unsigned int nHitsPerSeed_; @@ -78,13 +78,13 @@ class TrajectorySeedProducer : public edm::stream::EDProducer<> { public: TrajectorySeedProducer(const edm::ParameterSet& conf); - void produce(edm::Event& e, const edm::EventSetup& es) override; + void produce(edm::Event&, const edm::EventSetup&) override; }; template class SeedingTree; template class SeedingNode; -TrajectorySeedProducer::TrajectorySeedProducer(const edm::ParameterSet& conf) { +TrajectorySeedProducer::TrajectorySeedProducer(const edm::ParameterSet& conf) : trackerTopologyESToken_(esConsumes()) { // products produces(); @@ -133,14 +133,12 @@ TrajectorySeedProducer::TrajectorySeedProducer(const edm::ParameterSet& conf) { // seed creator const edm::ParameterSet& seedCreatorPSet = conf.getParameter("SeedCreatorPSet"); std::string seedCreatorName = seedCreatorPSet.getParameter("ComponentName"); - seedCreator = SeedCreatorFactory::get()->create(seedCreatorName, seedCreatorPSet); + seedCreator = SeedCreatorFactory::get()->create(seedCreatorName, seedCreatorPSet, consumesCollector()); } void TrajectorySeedProducer::produce(edm::Event& e, const edm::EventSetup& es) { // services - edm::ESHandle trackerTopology; - - es.get().get(trackerTopology); + auto const& trackerTopology = es.getData(trackerTopologyESToken_); // input data edm::Handle recHitCombinations; @@ -166,7 +164,7 @@ void TrajectorySeedProducer::produce(edm::Event& e, const edm::EventSetup& es) { } // instantiate the seed finder - SeedFinder seedFinder(_seedingTree, *trackerTopology.product()); + SeedFinder seedFinder(_seedingTree, trackerTopology); if (seedFinderSelector) { seedFinderSelector->initEvent(e, es); seedFinder.addHitSelector(seedFinderSelector.get(), nHitsPerSeed_); diff --git a/FastSimulation/Tracking/src/SeedFinderSelector.cc b/FastSimulation/Tracking/src/SeedFinderSelector.cc index 9983f4e62bc15..b352bef2eabd8 100644 --- a/FastSimulation/Tracking/src/SeedFinderSelector.cc +++ b/FastSimulation/Tracking/src/SeedFinderSelector.cc @@ -1,17 +1,16 @@ #include "FastSimulation/Tracking/interface/SeedFinderSelector.h" // framework +#include "FWCore/Framework/interface/ConsumesCollector.h" #include "FWCore/Framework/interface/EventSetup.h" #include "FWCore/Framework/interface/Event.h" // track reco -#include "RecoTracker/MeasurementDet/interface/MeasurementTracker.h" #include "RecoTracker/TkHitPairs/interface/RecHitsSortedInPhi.h" #include "RecoTracker/TkHitPairs/interface/HitPairGeneratorFromLayerPair.h" #include "DataFormats/SiPixelDetId/interface/PixelSubdetector.h" #include "RecoTracker/TkSeedGenerator/interface/MultiHitGeneratorFromPairAndLayers.h" #include "RecoTracker/TkSeedGenerator/interface/MultiHitGeneratorFromPairAndLayersFactory.h" -#include "RecoTracker/Record/interface/CkfComponentsRecord.h" #include "RecoPixelVertexing/PixelTriplets/interface/HitTripletGeneratorFromPairAndLayers.h" #include "RecoPixelVertexing/PixelTriplets/interface/HitTripletGeneratorFromPairAndLayersFactory.h" #include "RecoPixelVertexing/PixelTriplets/interface/CAHitTripletGenerator.h" @@ -25,7 +24,9 @@ SeedFinderSelector::SeedFinderSelector(const edm::ParameterSet &cfg, edm::Consum : trackingRegion_(nullptr), eventSetup_(nullptr), measurementTracker_(nullptr), - measurementTrackerLabel_(cfg.getParameter("measurementTracker")) { + measurementTrackerLabel_(cfg.getParameter("measurementTracker")), + measurementTrackerESToken_(consumesCollector.esConsumes(edm::ESInputTag("", measurementTrackerLabel_))), + trackerTopologyESToken_(consumesCollector.esConsumes()) { if (cfg.exists("pixelTripletGeneratorFactory")) { const edm::ParameterSet &tripletConfig = cfg.getParameter("pixelTripletGeneratorFactory"); pixelTripletGenerator_ = HitTripletGeneratorFromPairAndLayersFactory::get()->create( @@ -35,7 +36,7 @@ SeedFinderSelector::SeedFinderSelector(const edm::ParameterSet &cfg, edm::Consum if (cfg.exists("MultiHitGeneratorFactory")) { const edm::ParameterSet &tripletConfig = cfg.getParameter("MultiHitGeneratorFactory"); multiHitGenerator_ = MultiHitGeneratorFromPairAndLayersFactory::get()->create( - tripletConfig.getParameter("ComponentName"), tripletConfig); + tripletConfig.getParameter("ComponentName"), tripletConfig, consumesCollector); } if (cfg.exists("CAHitTripletGeneratorFactory")) { @@ -77,10 +78,8 @@ SeedFinderSelector::~SeedFinderSelector() { ; } void SeedFinderSelector::initEvent(const edm::Event &ev, const edm::EventSetup &es) { eventSetup_ = &es; - edm::ESHandle measurementTrackerHandle; - es.get().get(measurementTrackerLabel_, measurementTrackerHandle); - es.get().get(trackerTopology); - measurementTracker_ = &(*measurementTrackerHandle); + measurementTracker_ = &es.getData(measurementTrackerESToken_); + trackerTopology_ = &es.getData(trackerTopologyESToken_); if (multiHitGenerator_) { multiHitGenerator_->initES(es); @@ -224,7 +223,7 @@ bool SeedFinderSelector::pass(const std::vector &hits for (auto &ntuplet : tripletresult) ntuplet.reserve(3); //calling the function from the class, modifies tripletresult - CAHitTriplGenerator_->hitNtuplets(ihd, tripletresult, *eventSetup_, *seedingLayer); + CAHitTriplGenerator_->hitNtuplets(ihd, tripletresult, *seedingLayer); return !tripletresult[0].empty(); } } @@ -311,7 +310,7 @@ bool SeedFinderSelector::pass(const std::vector &hits for (auto &ntuplet : quadrupletresult) ntuplet.reserve(4); //calling the function from the class, modifies quadrupletresult - CAHitQuadGenerator_->hitNtuplets(ihd, quadrupletresult, *eventSetup_, *seedingLayer); + CAHitQuadGenerator_->hitNtuplets(ihd, quadrupletresult, *seedingLayer); return !quadrupletresult[0].empty(); } @@ -320,7 +319,6 @@ bool SeedFinderSelector::pass(const std::vector &hits //new for Phase1 SeedingLayerSetsBuilder::SeedingLayerId SeedFinderSelector::Layer_tuple(const FastTrackerRecHit *hit) const { - const TrackerTopology *const tTopo = trackerTopology.product(); GeomDetEnumerators::SubDetector subdet = GeomDetEnumerators::invalidDet; TrackerDetSide side = TrackerDetSide::Barrel; int idLayer = 0; @@ -328,11 +326,11 @@ SeedingLayerSetsBuilder::SeedingLayerId SeedFinderSelector::Layer_tuple(const Fa if ((hit->det()->geographicalId()).subdetId() == PixelSubdetector::PixelBarrel) { subdet = GeomDetEnumerators::PixelBarrel; side = TrackerDetSide::Barrel; - idLayer = tTopo->pxbLayer(hit->det()->geographicalId()); + idLayer = trackerTopology_->pxbLayer(hit->det()->geographicalId()); } else if ((hit->det()->geographicalId()).subdetId() == PixelSubdetector::PixelEndcap) { subdet = GeomDetEnumerators::PixelEndcap; - idLayer = tTopo->pxfDisk(hit->det()->geographicalId()); - if (tTopo->pxfSide(hit->det()->geographicalId()) == 1) { + idLayer = trackerTopology_->pxfDisk(hit->det()->geographicalId()); + if (trackerTopology_->pxfSide(hit->det()->geographicalId()) == 1) { side = TrackerDetSide::NegEndcap; } else { side = TrackerDetSide::PosEndcap; diff --git a/FastSimulation/TrackingRecHitProducer/interface/TrackerDetIdSelector.h b/FastSimulation/TrackingRecHitProducer/interface/TrackerDetIdSelector.h index d7dccb00540c8..a20d021fcdc55 100644 --- a/FastSimulation/TrackingRecHitProducer/interface/TrackerDetIdSelector.h +++ b/FastSimulation/TrackingRecHitProducer/interface/TrackerDetIdSelector.h @@ -15,8 +15,20 @@ struct BinaryOP; struct UnaryOP; +struct ExpressionAST; struct Nil {}; +namespace detail { + ExpressionAST opLesser(ExpressionAST const& lhs, ExpressionAST const& rhs); + ExpressionAST opLesserEq(ExpressionAST const& lhs, ExpressionAST const& rhs); + ExpressionAST opEq(ExpressionAST const& lhs, ExpressionAST const& rhs); + ExpressionAST opNotEq(ExpressionAST const& lhs, ExpressionAST const& rhs); + ExpressionAST opGreater(ExpressionAST const& lhs, ExpressionAST const& rhs); + ExpressionAST opGreaterEq(ExpressionAST const& lhs, ExpressionAST const& rhs); + ExpressionAST opAnd(ExpressionAST const& lhs, ExpressionAST const& rhs); + ExpressionAST opOr(ExpressionAST const& lhs, ExpressionAST const& rhs); +} // namespace detail + struct ExpressionAST { typedef boost::variant(ExpressionAST const& lhs, ExpressionAST const& rhs); -ExpressionAST operator>=(ExpressionAST const& lhs, ExpressionAST const& rhs); -ExpressionAST operator==(ExpressionAST const& lhs, ExpressionAST const& rhs); -ExpressionAST operator<=(ExpressionAST const& lhs, ExpressionAST const& rhs); -ExpressionAST operator<(ExpressionAST const& lhs, ExpressionAST const& rhs); -ExpressionAST operator!=(ExpressionAST const& lhs, ExpressionAST const& rhs); -ExpressionAST operator&&(ExpressionAST const& lhs, ExpressionAST const& rhs); -ExpressionAST operator||(ExpressionAST const& lhs, ExpressionAST const& rhs); + friend ExpressionAST operator>(ExpressionAST const& lhs, ExpressionAST const& rhs) { + return detail::opGreater(lhs, rhs); + } + friend ExpressionAST operator>=(ExpressionAST const& lhs, ExpressionAST const& rhs) { + return detail::opGreaterEq(lhs, rhs); + } + friend ExpressionAST operator==(ExpressionAST const& lhs, ExpressionAST const& rhs) { return detail::opEq(lhs, rhs); } + friend ExpressionAST operator!=(ExpressionAST const& lhs, ExpressionAST const& rhs) { + return detail::opNotEq(lhs, rhs); + } + friend ExpressionAST operator<(ExpressionAST const& lhs, ExpressionAST const& rhs) { + return detail::opLesser(lhs, rhs); + } + friend ExpressionAST operator<=(ExpressionAST const& lhs, ExpressionAST const& rhs) { + return detail::opLesserEq(lhs, rhs); + } + friend ExpressionAST operator&&(ExpressionAST const& lhs, ExpressionAST const& rhs) { + return detail::opAnd(lhs, rhs); + } + friend ExpressionAST operator||(ExpressionAST const& lhs, ExpressionAST const& rhs) { return detail::opOr(lhs, rhs); } +}; struct BinaryOP { enum class OP { GREATER, GREATER_EQUAL, EQUAL, LESS_EQUAL, LESS, NOT_EQUAL, AND, OR } op; diff --git a/FastSimulation/TrackingRecHitProducer/interface/TrackingRecHitAlgorithm.h b/FastSimulation/TrackingRecHitProducer/interface/TrackingRecHitAlgorithm.h index 59e7ebc6f22f4..806d3a0c73734 100644 --- a/FastSimulation/TrackingRecHitProducer/interface/TrackingRecHitAlgorithm.h +++ b/FastSimulation/TrackingRecHitProducer/interface/TrackingRecHitAlgorithm.h @@ -2,8 +2,12 @@ #define FastSimulation_TrackingRecHitProducer_TrackingRecHitAlgorithm_H #include "DataFormats/TrackerCommon/interface/TrackerTopology.h" +#include "Geometry/Records/interface/TrackerDigiGeometryRecord.h" +#include "Geometry/Records/interface/TrackerTopologyRcd.h" #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h" +#include "FWCore/Framework/interface/FrameworkfwdMostUsed.h" #include "FWCore/Framework/interface/ProducerBase.h" +#include "FWCore/Utilities/interface/ESGetToken.h" #include "FastSimulation/TrackingRecHitProducer/interface/TrackingRecHitProduct.h" #include "FastSimulation/Utilities/interface/RandomEngineAndDistribution.h" @@ -15,14 +19,6 @@ #include #include -namespace edm { - class Event; - class EventSetup; - class ParameterSet; - class ConsumesCollector; - class Stream; -} // namespace edm - class TrackingRecHitAlgorithm { private: const std::string _name; @@ -30,6 +26,9 @@ class TrackingRecHitAlgorithm { const TrackerTopology* _trackerTopology; const TrackerGeometry* _trackerGeometry; const TrackerGeometry* _misalignedTrackerGeometry; + const edm::ESGetToken trackerTopologyESToken_; + const edm::ESGetToken trackerGeometryESToken_; + const edm::ESGetToken misalignedTrackerGeometryESToken_; std::shared_ptr _randomEngine; public: diff --git a/FastSimulation/TrackingRecHitProducer/plugins/FastTrackerRecHitMatcher.cc b/FastSimulation/TrackingRecHitProducer/plugins/FastTrackerRecHitMatcher.cc index 823e470c854cc..cfc11c5b614b6 100644 --- a/FastSimulation/TrackingRecHitProducer/plugins/FastTrackerRecHitMatcher.cc +++ b/FastSimulation/TrackingRecHitProducer/plugins/FastTrackerRecHitMatcher.cc @@ -8,7 +8,6 @@ #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/MakerMacros.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" -#include "FWCore/Framework/interface/ESHandle.h" // fast tracker rechits #include "DataFormats/TrackerRecHit2D/interface/FastTrackerRecHit.h" @@ -72,11 +71,11 @@ class FastTrackerRecHitMatcher : public edm::stream::EDProducer<> { // ----------member data --------------------------- edm::EDGetTokenT simHitsToken; edm::EDGetTokenT simHit2RecHitMapToken; + const edm::ESGetToken trackerGeometryESToken; }; FastTrackerRecHitMatcher::FastTrackerRecHitMatcher(const edm::ParameterSet& iConfig) - -{ + : trackerGeometryESToken(esConsumes()) { simHitsToken = consumes(iConfig.getParameter("simHits")); simHit2RecHitMapToken = consumes(iConfig.getParameter("simHit2RecHitMap")); @@ -87,8 +86,7 @@ FastTrackerRecHitMatcher::FastTrackerRecHitMatcher(const edm::ParameterSet& iCon void FastTrackerRecHitMatcher::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) { // services - edm::ESHandle geometry; - iSetup.get().get(geometry); + auto const& geometry = iSetup.getData(trackerGeometryESToken); // input edm::Handle simHits; @@ -150,7 +148,7 @@ void FastTrackerRecHitMatcher::produce(edm::Event& iEvent, const edm::EventSetup // - transform to global coordinates GlobalVector globalSimTrackDir = recHit->det()->surface().toGlobal(localSimTrackDir); // - transform to local coordinates of glued module - const GluedGeomDet* gluedDet = (const GluedGeomDet*)geometry->idToDet(DetId(stripSubDetId.glued())); + const GluedGeomDet* gluedDet = (const GluedGeomDet*)geometry.idToDet(DetId(stripSubDetId.glued())); LocalVector gluedLocalSimTrackDir = gluedDet->surface().toLocal(globalSimTrackDir); // check whether next hit is partner @@ -181,7 +179,7 @@ void FastTrackerRecHitMatcher::produce(edm::Event& iEvent, const edm::EventSetup } // else: create projected hit else { - newRecHit = projectOnly(recHit, geometry->idToDet(detid), gluedDet, gluedLocalSimTrackDir); + newRecHit = projectOnly(recHit, geometry.idToDet(detid), gluedDet, gluedLocalSimTrackDir); } output_recHits->push_back(std::move(newRecHit)); (*output_simHit2RecHitMap)[simHitCounter] = diff --git a/FastSimulation/TrackingRecHitProducer/plugins/TrackingRecHitProducer.cc b/FastSimulation/TrackingRecHitProducer/plugins/TrackingRecHitProducer.cc index d50cb877010b2..a0487ba7d33d6 100644 --- a/FastSimulation/TrackingRecHitProducer/plugins/TrackingRecHitProducer.cc +++ b/FastSimulation/TrackingRecHitProducer/plugins/TrackingRecHitProducer.cc @@ -2,7 +2,6 @@ #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/EventSetup.h" -#include "FWCore/Framework/interface/ESHandle.h" #include "FWCore/Framework/interface/MakerMacros.h" #include "FWCore/Framework/interface/ConsumesCollector.h" #include "FWCore/Framework/interface/Run.h" @@ -50,6 +49,9 @@ class TrackingRecHitProducer : public edm::stream::EDProducer<> { std::map _detIdPipes; void setupDetIdPipes(const edm::EventSetup& eventSetup); std::vector _pixelTempStore; // pixel template storage + const edm::ESGetToken siPixelTemplateDBObjectESToken_; + const edm::ESGetToken trackerGeometryESToken_; + const edm::ESGetToken trackerTopologyESToken_; public: TrackingRecHitProducer(const edm::ParameterSet& config); @@ -65,7 +67,10 @@ class TrackingRecHitProducer : public edm::stream::EDProducer<> { ~TrackingRecHitProducer() override; }; -TrackingRecHitProducer::TrackingRecHitProducer(const edm::ParameterSet& config) { +TrackingRecHitProducer::TrackingRecHitProducer(const edm::ParameterSet& config) + : siPixelTemplateDBObjectESToken_(esConsumes()), + trackerGeometryESToken_(esConsumes()), + trackerTopologyESToken_(esConsumes()) { edm::ConsumesCollector consumeCollector = consumesCollector(); const std::vector& pluginConfigs = config.getParameter>("plugins"); @@ -109,20 +114,18 @@ void TrackingRecHitProducer::beginRun(edm::Run const& run, const edm::EventSetup // the pixel algorithms implement beginRun(), for the strip tracker this defaults // to a no-op. - edm::ESHandle templateDBobject; - eventSetup.get().get(templateDBobject); - const SiPixelTemplateDBObject* pixelTemplateDBObject = templateDBobject.product(); + const SiPixelTemplateDBObject& pixelTemplateDBObject = eventSetup.getData(siPixelTemplateDBObjectESToken_); //--- Now that we have the DB object, load the correct templates from the DB. // (They are needed for data and full sim MC, so in a production FastSim // run, everything should already be in the DB.) - if (!SiPixelTemplate::pushfile(*pixelTemplateDBObject, _pixelTempStore)) { + if (!SiPixelTemplate::pushfile(pixelTemplateDBObject, _pixelTempStore)) { throw cms::Exception("TrackingRecHitProducer:") << "SiPixel Templates not loaded correctly from the DB object!" << std::endl; } for (auto& algo : _recHitAlgorithms) { - algo->beginRun(run, eventSetup, pixelTemplateDBObject, _pixelTempStore); + algo->beginRun(run, eventSetup, &pixelTemplateDBObject, _pixelTempStore); } } @@ -133,21 +136,18 @@ void TrackingRecHitProducer::setupDetIdPipes(const edm::EventSetup& eventSetup) trackerTopoRec.cacheIdentifier() != _trackerTopologyCacheID) { _trackerGeometryCacheID = trackerGeomRec.cacheIdentifier(); _trackerTopologyCacheID = trackerTopoRec.cacheIdentifier(); - edm::ESHandle trackerGeometryHandle; - edm::ESHandle trackerTopologyHandle; - trackerGeomRec.get(trackerGeometryHandle); - trackerTopoRec.get(trackerTopologyHandle); - const TrackerGeometry* trackerGeometry = trackerGeometryHandle.product(); - const TrackerTopology* trackerTopology = trackerTopologyHandle.product(); + + const TrackerGeometry& trackerGeometry = trackerGeomRec.get(trackerGeometryESToken_); + const TrackerTopology& trackerTopology = trackerTopoRec.get(trackerTopologyESToken_); _detIdPipes.clear(); //build pipes for all detIds - const std::vector& detIds = trackerGeometry->detIds(); + const std::vector& detIds = trackerGeometry.detIds(); std::vector numberOfDetIdsPerAlgorithm(_recHitAlgorithms.size(), 0); for (const DetId& detId : detIds) { - TrackerDetIdSelector selector(detId, *trackerTopology); + TrackerDetIdSelector selector(detId, trackerTopology); TrackingRecHitPipe pipe; for (unsigned int ialgo = 0; ialgo < _recHitAlgorithms.size(); ++ialgo) { @@ -159,7 +159,7 @@ void TrackingRecHitProducer::setupDetIdPipes(const edm::EventSetup& eventSetup) } if (pipe.size() == 0) { throw cms::Exception("FastSimulation/TrackingRecHitProducer: DetId not configured! (" + - trackerTopology->print(detId) + ")"); + trackerTopology.print(detId) + ")"); } _detIdPipes[detId.rawId()] = pipe; } diff --git a/FastSimulation/TrackingRecHitProducer/src/TrackerDetIdSelector.cc b/FastSimulation/TrackingRecHitProducer/src/TrackerDetIdSelector.cc index 8839f28e03b9f..4780c3389b3fd 100644 --- a/FastSimulation/TrackingRecHitProducer/src/TrackerDetIdSelector.cc +++ b/FastSimulation/TrackingRecHitProducer/src/TrackerDetIdSelector.cc @@ -80,46 +80,40 @@ const TrackerDetIdSelector::StringFunctionMap TrackerDetIdSelector::functionTabl } ; -ExpressionAST operator>(ExpressionAST const& lhs, ExpressionAST const& rhs) { - ExpressionAST ast = BinaryOP(BinaryOP::OP::GREATER, lhs, rhs); - return ast; -} +namespace detail { + ExpressionAST opGreater(ExpressionAST const& lhs, ExpressionAST const& rhs) { + return BinaryOP(BinaryOP::OP::GREATER, lhs, rhs); + } -ExpressionAST operator>=(ExpressionAST const& lhs, ExpressionAST const& rhs) { - ExpressionAST ast = BinaryOP(BinaryOP::OP::GREATER_EQUAL, lhs, rhs); - return ast; -} + ExpressionAST opGreaterEq(ExpressionAST const& lhs, ExpressionAST const& rhs) { + return BinaryOP(BinaryOP::OP::GREATER_EQUAL, lhs, rhs); + } -ExpressionAST operator==(ExpressionAST const& lhs, ExpressionAST const& rhs) { - ExpressionAST ast = BinaryOP(BinaryOP::OP::EQUAL, lhs, rhs); - return ast; -} + ExpressionAST opEq(ExpressionAST const& lhs, ExpressionAST const& rhs) { + return BinaryOP(BinaryOP::OP::EQUAL, lhs, rhs); + } -ExpressionAST operator<=(ExpressionAST const& lhs, ExpressionAST const& rhs) { - ExpressionAST ast = BinaryOP(BinaryOP::OP::LESS_EQUAL, lhs, rhs); - return ast; -} + ExpressionAST opLesserEq(ExpressionAST const& lhs, ExpressionAST const& rhs) { + return BinaryOP(BinaryOP::OP::LESS_EQUAL, lhs, rhs); + } -ExpressionAST operator<(ExpressionAST const& lhs, ExpressionAST const& rhs) { - ExpressionAST ast = BinaryOP(::BinaryOP::OP::LESS, lhs, rhs); - return ast; -} + ExpressionAST opLesser(ExpressionAST const& lhs, ExpressionAST const& rhs) { + return BinaryOP(::BinaryOP::OP::LESS, lhs, rhs); + } -ExpressionAST operator!=(ExpressionAST const& lhs, ExpressionAST const& rhs) { - ExpressionAST ast = BinaryOP(BinaryOP::OP::NOT_EQUAL, lhs, rhs); - return ast; -} + ExpressionAST opNotEq(ExpressionAST const& lhs, ExpressionAST const& rhs) { + return BinaryOP(BinaryOP::OP::NOT_EQUAL, lhs, rhs); + } -ExpressionAST operator&&(ExpressionAST const& lhs, ExpressionAST const& rhs) { - ExpressionAST ast = BinaryOP(BinaryOP::OP::AND, lhs, rhs); - return ast; -} + ExpressionAST opAnd(ExpressionAST const& lhs, ExpressionAST const& rhs) { + return BinaryOP(BinaryOP::OP::AND, lhs, rhs); + } -ExpressionAST operator||(ExpressionAST const& lhs, ExpressionAST const& rhs) { - ExpressionAST ast = BinaryOP(BinaryOP::OP::OR, lhs, rhs); - return ast; -} + ExpressionAST opOr(ExpressionAST const& lhs, ExpressionAST const& rhs) { + return BinaryOP(BinaryOP::OP::OR, lhs, rhs); + } +} // namespace detail ExpressionAST& ExpressionAST::operator!() { expr = UnaryOP(UnaryOP::OP::NEG, expr); return *this; diff --git a/FastSimulation/TrackingRecHitProducer/src/TrackingRecHitAlgorithm.cc b/FastSimulation/TrackingRecHitProducer/src/TrackingRecHitAlgorithm.cc index ae9b47aa585b3..2ac1c9f781d45 100644 --- a/FastSimulation/TrackingRecHitProducer/src/TrackingRecHitAlgorithm.cc +++ b/FastSimulation/TrackingRecHitProducer/src/TrackingRecHitAlgorithm.cc @@ -4,7 +4,6 @@ #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/EventSetup.h" #include "FWCore/Framework/interface/ConsumesCollector.h" -#include "FWCore/Framework/interface/ESHandle.h" #include "FWCore/ServiceRegistry/interface/Service.h" #include "FWCore/Utilities/interface/RandomNumberGenerator.h" @@ -15,9 +14,6 @@ #include "FastSimulation/TrackingRecHitProducer/interface/TrackingRecHitProduct.h" -#include "Geometry/Records/interface/TrackerDigiGeometryRecord.h" -#include "Geometry/Records/interface/TrackerTopologyRcd.h" - #include "FWCore/Utilities/interface/Exception.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" @@ -30,6 +26,9 @@ TrackingRecHitAlgorithm::TrackingRecHitAlgorithm(const std::string& name, _trackerTopology(nullptr), _trackerGeometry(nullptr), _misalignedTrackerGeometry(nullptr), + trackerTopologyESToken_(consumesCollector.esConsumes()), + trackerGeometryESToken_(consumesCollector.esConsumes()), + misalignedTrackerGeometryESToken_(consumesCollector.esConsumes(edm::ESInputTag("", "MisAligned"))), _randomEngine(nullptr) {} const TrackerTopology& TrackingRecHitAlgorithm::getTrackerTopology() const { @@ -72,17 +71,9 @@ void TrackingRecHitAlgorithm::beginRun(edm::Run const& run, } void TrackingRecHitAlgorithm::beginEvent(edm::Event& event, const edm::EventSetup& eventSetup) { - edm::ESHandle trackerTopologyHandle; - edm::ESHandle trackerGeometryHandle; - edm::ESHandle misalignedGeometryHandle; - - eventSetup.get().get(trackerTopologyHandle); - eventSetup.get().get(trackerGeometryHandle); - eventSetup.get().get("MisAligned", misalignedGeometryHandle); - - _trackerTopology = trackerTopologyHandle.product(); - _trackerGeometry = trackerGeometryHandle.product(); - _misalignedTrackerGeometry = misalignedGeometryHandle.product(); + _trackerTopology = &eventSetup.getData(trackerTopologyESToken_); + _trackerGeometry = &eventSetup.getData(trackerGeometryESToken_); + _misalignedTrackerGeometry = &eventSetup.getData(misalignedTrackerGeometryESToken_); } TrackingRecHitProductPtr TrackingRecHitAlgorithm::process(TrackingRecHitProductPtr product) const { return product; } diff --git a/FastSimulation/TrajectoryManager/interface/LocalMagneticField.h b/FastSimulation/TrajectoryManager/interface/LocalMagneticField.h index ba7966e9e80fe..1b30c0875c17d 100644 --- a/FastSimulation/TrajectoryManager/interface/LocalMagneticField.h +++ b/FastSimulation/TrajectoryManager/interface/LocalMagneticField.h @@ -12,7 +12,7 @@ #include "MagneticField/Engine/interface/MagneticField.h" -class LocalMagneticField : public MagneticField { +class LocalMagneticField final : public MagneticField { public: ///Construct passing the Z field component in Tesla LocalMagneticField(double value); diff --git a/FastSimulation/TrajectoryManager/src/LocalMagneticField.cc b/FastSimulation/TrajectoryManager/src/LocalMagneticField.cc index 7934ab368e800..4824f4987c08c 100644 --- a/FastSimulation/TrajectoryManager/src/LocalMagneticField.cc +++ b/FastSimulation/TrajectoryManager/src/LocalMagneticField.cc @@ -7,6 +7,6 @@ #include "FastSimulation/TrajectoryManager/interface/LocalMagneticField.h" #include "DataFormats/GeometryVector/interface/GlobalVector.h" -LocalMagneticField::LocalMagneticField(double value) : theField(0., 0., value) {} +LocalMagneticField::LocalMagneticField(double value) : theField(0., 0., value) { setNominalValue(); } GlobalVector LocalMagneticField::inTesla(const GlobalPoint& gp) const { return theField; } diff --git a/FastSimulation/Utilities/BuildFile.xml b/FastSimulation/Utilities/BuildFile.xml index 6cf11edfdbbda..13a0ff56a36dd 100644 --- a/FastSimulation/Utilities/BuildFile.xml +++ b/FastSimulation/Utilities/BuildFile.xml @@ -1,6 +1,5 @@ - diff --git a/FastSimulation/Utilities/src/RandomEngineAndDistribution.cc b/FastSimulation/Utilities/src/RandomEngineAndDistribution.cc index f6fcfd88b0405..2b4c9e3a428c5 100644 --- a/FastSimulation/Utilities/src/RandomEngineAndDistribution.cc +++ b/FastSimulation/Utilities/src/RandomEngineAndDistribution.cc @@ -3,7 +3,6 @@ #include "FWCore/ServiceRegistry/interface/Service.h" #include "FWCore/Utilities/interface/RandomNumberGenerator.h" #include "FWCore/Utilities/interface/Exception.h" -#include "IOMC/RandomEngine/src/TRandomAdaptor.h" #include "CLHEP/Random/RandomEngine.h" diff --git a/Fireworks/Calo/interface/FWCaloDataHistProxyBuilder.h b/Fireworks/Calo/interface/FWCaloDataHistProxyBuilder.h index 1c209b298ca3c..fee11abfbd940 100644 --- a/Fireworks/Calo/interface/FWCaloDataHistProxyBuilder.h +++ b/Fireworks/Calo/interface/FWCaloDataHistProxyBuilder.h @@ -2,7 +2,7 @@ #define Fireworks_Calo_FWCaloHistDataProxyBuilder_h #include "Fireworks/Calo/interface/FWCaloDataProxyBuilderBase.h" -#include "Fireworks/Calo/src/FWFromTEveCaloDataSelector.h" +#include "Fireworks/Calo/interface/FWFromTEveCaloDataSelector.h" class TH2F; class FWHistSliceSelector; diff --git a/Fireworks/Calo/interface/FWECALDetailViewBase.h b/Fireworks/Calo/interface/FWECALDetailViewBase.h index 2b6600c56c629..36e894cfc81b9 100644 --- a/Fireworks/Calo/interface/FWECALDetailViewBase.h +++ b/Fireworks/Calo/interface/FWECALDetailViewBase.h @@ -28,6 +28,6 @@ class FWECALDetailViewBase : public FWDetailViewGL { void setTextInfo(const FWModelId &id, const T *) override; }; -#include "Fireworks/Calo/src/FWECALDetailViewBase.icc" +#include "Fireworks/Calo/interface/FWECALDetailViewBase.icc" #endif diff --git a/Fireworks/Calo/src/FWECALDetailViewBase.icc b/Fireworks/Calo/interface/FWECALDetailViewBase.icc similarity index 100% rename from Fireworks/Calo/src/FWECALDetailViewBase.icc rename to Fireworks/Calo/interface/FWECALDetailViewBase.icc diff --git a/Fireworks/Calo/src/FWFromSliceSelector.h b/Fireworks/Calo/interface/FWFromSliceSelector.h similarity index 100% rename from Fireworks/Calo/src/FWFromSliceSelector.h rename to Fireworks/Calo/interface/FWFromSliceSelector.h diff --git a/Fireworks/Calo/src/FWFromTEveCaloDataSelector.h b/Fireworks/Calo/interface/FWFromTEveCaloDataSelector.h similarity index 96% rename from Fireworks/Calo/src/FWFromTEveCaloDataSelector.h rename to Fireworks/Calo/interface/FWFromTEveCaloDataSelector.h index 734cd8e8200c0..fdd75159d8941 100644 --- a/Fireworks/Calo/src/FWFromTEveCaloDataSelector.h +++ b/Fireworks/Calo/interface/FWFromTEveCaloDataSelector.h @@ -23,7 +23,7 @@ // user include files #include "Fireworks/Core/interface/FWFromEveSelectorBase.h" -#include "Fireworks/Calo/src/FWFromSliceSelector.h" +#include "Fireworks/Calo/interface/FWFromSliceSelector.h" // forward declarations class FWEventItem; diff --git a/Fireworks/Calo/interface/FWHistSliceSelector.h b/Fireworks/Calo/interface/FWHistSliceSelector.h index fda3544aaf7fb..c346053002167 100644 --- a/Fireworks/Calo/interface/FWHistSliceSelector.h +++ b/Fireworks/Calo/interface/FWHistSliceSelector.h @@ -1,7 +1,7 @@ #ifndef Fireworks_Calo_FWHistSliceSelector_h #define Fireworks_Calo_FWHistSliceSelector_h -#include "Fireworks/Calo/src/FWFromSliceSelector.h" +#include "Fireworks/Calo/interface/FWFromSliceSelector.h" class TH2F; class FWHistSliceSelector : public FWFromSliceSelector { diff --git a/Fireworks/Calo/plugins/FWCaloTowerProxyBuilder.h b/Fireworks/Calo/plugins/FWCaloTowerProxyBuilder.h index 2ef006a44c028..233cff8e5b89a 100644 --- a/Fireworks/Calo/plugins/FWCaloTowerProxyBuilder.h +++ b/Fireworks/Calo/plugins/FWCaloTowerProxyBuilder.h @@ -22,7 +22,7 @@ #include #include "Fireworks/Calo/interface/FWCaloDataHistProxyBuilder.h" -#include "Fireworks/Calo/src/FWFromTEveCaloDataSelector.h" +#include "Fireworks/Calo/interface/FWFromTEveCaloDataSelector.h" #include "DataFormats/CaloTowers/interface/CaloTower.h" #include "DataFormats/CaloTowers/interface/CaloTowerDefs.h" diff --git a/Fireworks/Calo/plugins/FWHFTowerProxyBuilder.h b/Fireworks/Calo/plugins/FWHFTowerProxyBuilder.h index 1f89d4153a11e..dd808f6bb3984 100644 --- a/Fireworks/Calo/plugins/FWHFTowerProxyBuilder.h +++ b/Fireworks/Calo/plugins/FWHFTowerProxyBuilder.h @@ -22,7 +22,7 @@ // user include files #include "Fireworks/Calo/interface/FWCaloDataProxyBuilderBase.h" -#include "Fireworks/Calo/src/FWFromTEveCaloDataSelector.h" +#include "Fireworks/Calo/interface/FWFromTEveCaloDataSelector.h" #include "DataFormats/HcalRecHit/interface/HFRecHit.h" #include "DataFormats/HcalRecHit/interface/HcalRecHitCollections.h" diff --git a/Fireworks/Calo/plugins/FWHFTowerSliceSelector.h b/Fireworks/Calo/plugins/FWHFTowerSliceSelector.h index f971bd2f3b94b..d5d010239452c 100644 --- a/Fireworks/Calo/plugins/FWHFTowerSliceSelector.h +++ b/Fireworks/Calo/plugins/FWHFTowerSliceSelector.h @@ -24,7 +24,7 @@ class HcalDetId; class TEveCaloDataVec; -#include "Fireworks/Calo/src/FWFromSliceSelector.h" +#include "Fireworks/Calo/interface/FWFromSliceSelector.h" // forward declarations diff --git a/Fireworks/Calo/plugins/FWHGTowerProxyBuilder.h b/Fireworks/Calo/plugins/FWHGTowerProxyBuilder.h index 60f764f70e975..fd1e8ab47d26d 100644 --- a/Fireworks/Calo/plugins/FWHGTowerProxyBuilder.h +++ b/Fireworks/Calo/plugins/FWHGTowerProxyBuilder.h @@ -22,7 +22,7 @@ // user include files #include "Fireworks/Calo/interface/FWCaloDataProxyBuilderBase.h" -#include "Fireworks/Calo/src/FWFromTEveCaloDataSelector.h" +#include "Fireworks/Calo/interface/FWFromTEveCaloDataSelector.h" // #include "DataFormats/HGCRecHit/interface/HGRecHit.h" #include "DataFormats/HGCRecHit/interface/HGCRecHitCollections.h" diff --git a/Fireworks/Calo/plugins/FWHGTowerSliceSelector.h b/Fireworks/Calo/plugins/FWHGTowerSliceSelector.h index e5d4418da2fc8..74c8b314887cc 100644 --- a/Fireworks/Calo/plugins/FWHGTowerSliceSelector.h +++ b/Fireworks/Calo/plugins/FWHGTowerSliceSelector.h @@ -24,7 +24,7 @@ class DetId; class TEveCaloDataVec; -#include "Fireworks/Calo/src/FWFromSliceSelector.h" +#include "Fireworks/Calo/interface/FWFromSliceSelector.h" // forward declarations diff --git a/Fireworks/Calo/src/FWCaloDataProxyBuilderBase.cc b/Fireworks/Calo/src/FWCaloDataProxyBuilderBase.cc index 84f00c0f967bd..40f3943eb37e0 100644 --- a/Fireworks/Calo/src/FWCaloDataProxyBuilderBase.cc +++ b/Fireworks/Calo/src/FWCaloDataProxyBuilderBase.cc @@ -25,7 +25,7 @@ #include "Fireworks/Core/interface/FWEventItem.h" #include "Fireworks/Calo/interface/FWCaloDataProxyBuilderBase.h" -#include "Fireworks/Calo/src/FWFromTEveCaloDataSelector.h" +#include "Fireworks/Calo/interface/FWFromTEveCaloDataSelector.h" #include "DataFormats/CaloTowers/interface/CaloTower.h" diff --git a/Fireworks/Calo/src/FWFromSliceSelector.cc b/Fireworks/Calo/src/FWFromSliceSelector.cc index 2cef90802459a..17d6aa43eb8a8 100644 --- a/Fireworks/Calo/src/FWFromSliceSelector.cc +++ b/Fireworks/Calo/src/FWFromSliceSelector.cc @@ -13,7 +13,7 @@ // system include files // user include files -#include "Fireworks/Calo/src/FWFromSliceSelector.h" +#include "Fireworks/Calo/interface/FWFromSliceSelector.h" #include "Fireworks/Core/interface/FWEventItem.h" // diff --git a/Fireworks/Calo/src/FWFromTEveCaloDataSelector.cc b/Fireworks/Calo/src/FWFromTEveCaloDataSelector.cc index 671a8368a64d9..c6d86198119c9 100644 --- a/Fireworks/Calo/src/FWFromTEveCaloDataSelector.cc +++ b/Fireworks/Calo/src/FWFromTEveCaloDataSelector.cc @@ -16,7 +16,7 @@ #include // user include files -#include "Fireworks/Calo/src/FWFromTEveCaloDataSelector.h" +#include "Fireworks/Calo/interface/FWFromTEveCaloDataSelector.h" #include "Fireworks/Core/interface/FWModelChangeManager.h" #include "Fireworks/Core/interface/FWEventItem.h" diff --git a/Fireworks/Core/interface/CmsShowTaskExecutor.h b/Fireworks/Core/interface/CmsShowTaskExecutor.h index bf1de8c87a39f..27e54b79faa56 100644 --- a/Fireworks/Core/interface/CmsShowTaskExecutor.h +++ b/Fireworks/Core/interface/CmsShowTaskExecutor.h @@ -23,7 +23,7 @@ #include // user include files -#include "Fireworks/Core/src/CmsShowTaskExecutorBase.h" +#include "Fireworks/Core/interface/CmsShowTaskExecutorBase.h" // forward declarations diff --git a/Fireworks/Core/src/CmsShowTaskExecutorBase.h b/Fireworks/Core/interface/CmsShowTaskExecutorBase.h similarity index 100% rename from Fireworks/Core/src/CmsShowTaskExecutorBase.h rename to Fireworks/Core/interface/CmsShowTaskExecutorBase.h diff --git a/Fireworks/Core/interface/FWDetailViewCanvas.h b/Fireworks/Core/interface/FWDetailViewCanvas.h index e396137f7ef9e..5d0b5f66c0b18 100644 --- a/Fireworks/Core/interface/FWDetailViewCanvas.h +++ b/Fireworks/Core/interface/FWDetailViewCanvas.h @@ -21,5 +21,5 @@ class FWDetailViewCanvas : public FWDetailView { TCanvas* m_viewCanvas; }; -#include "Fireworks/Core/src/FWDetailViewCanvas.icc" +#include "Fireworks/Core/interface/FWDetailViewCanvas.icc" #endif diff --git a/Fireworks/Core/src/FWDetailViewCanvas.icc b/Fireworks/Core/interface/FWDetailViewCanvas.icc similarity index 100% rename from Fireworks/Core/src/FWDetailViewCanvas.icc rename to Fireworks/Core/interface/FWDetailViewCanvas.icc diff --git a/Fireworks/Core/interface/FWDetailViewGL.h b/Fireworks/Core/interface/FWDetailViewGL.h index 6896d5f80f5c7..c51cd08dd98a9 100644 --- a/Fireworks/Core/interface/FWDetailViewGL.h +++ b/Fireworks/Core/interface/FWDetailViewGL.h @@ -29,6 +29,6 @@ class FWDetailViewGL : public FWDetailView { TEveScene *m_eveScene; }; -#include "Fireworks/Core/src/FWDetailViewGL.icc" +#include "Fireworks/Core/interface/FWDetailViewGL.icc" #endif diff --git a/Fireworks/Core/src/FWDetailViewGL.icc b/Fireworks/Core/interface/FWDetailViewGL.icc similarity index 100% rename from Fireworks/Core/src/FWDetailViewGL.icc rename to Fireworks/Core/interface/FWDetailViewGL.icc diff --git a/Fireworks/Core/interface/FWHLTValidator.h b/Fireworks/Core/interface/FWHLTValidator.h index e82a9df129702..07804593594e7 100644 --- a/Fireworks/Core/interface/FWHLTValidator.h +++ b/Fireworks/Core/interface/FWHLTValidator.h @@ -6,7 +6,7 @@ // Class : FWHLTValidator // -#include "Fireworks/Core/src/FWValidatorBase.h" +#include "Fireworks/Core/interface/FWValidatorBase.h" namespace edm { class TriggerNames; diff --git a/Fireworks/Core/interface/FWItemAccessorRegistry.h b/Fireworks/Core/interface/FWItemAccessorRegistry.h index efdbf34938f4b..37be3f5100c91 100644 --- a/Fireworks/Core/interface/FWItemAccessorRegistry.h +++ b/Fireworks/Core/interface/FWItemAccessorRegistry.h @@ -5,7 +5,7 @@ // Package: Core // Class : FWItemAccessorRegistry // -/**\class FWItemAccessorRegistry FWItemAccessorRegistry.h Fireworks/Core/src/FWItemAccessorRegistry.h +/**\class FWItemAccessorRegistry FWItemAccessorRegistry.h Fireworks/Core/interface/FWItemAccessorRegistry.h Description: Registry for all th FWItemAccessorBase derived classes that can be loaded via the plugin manager. Those classes are to be used to have specialized versions of diff --git a/Fireworks/Core/interface/FWTEventList.h b/Fireworks/Core/interface/FWTEventList.h index da4ce1cec4b8d..432e768bcbb56 100644 --- a/Fireworks/Core/interface/FWTEventList.h +++ b/Fireworks/Core/interface/FWTEventList.h @@ -2,7 +2,7 @@ #define Fireworks_Core_FWTEventList_h // There was a bug in ROOT ... fixed on Dec 9 2009: -// http://root.cern.ch/viewcvs/trunk/tree/tree/src/TEventList.cxx?view=log +// http://root.cern.ch/viewcvs/trunk/tree/tree/interface/TEventList.cxx?view=log // // We need to keep this intermediate class until we switch to // root-5.26 or later. diff --git a/Fireworks/Core/src/FWValidatorBase.h b/Fireworks/Core/interface/FWValidatorBase.h similarity index 100% rename from Fireworks/Core/src/FWValidatorBase.h rename to Fireworks/Core/interface/FWValidatorBase.h diff --git a/Fireworks/Core/interface/FWXMLConfigParser.h b/Fireworks/Core/interface/FWXMLConfigParser.h index befebb5e2f10d..d265a399091bc 100644 --- a/Fireworks/Core/interface/FWXMLConfigParser.h +++ b/Fireworks/Core/interface/FWXMLConfigParser.h @@ -2,7 +2,7 @@ #define Fireworks_Core_FWXMLConfigParser #include #include -#include "Fireworks/Core/src/SimpleSAXParser.h" +#include "Fireworks/Core/interface/SimpleSAXParser.h" #include "Fireworks/Core/interface/FWConfiguration.h" diff --git a/Fireworks/Core/src/SimpleSAXParser.h b/Fireworks/Core/interface/SimpleSAXParser.h similarity index 100% rename from Fireworks/Core/src/SimpleSAXParser.h rename to Fireworks/Core/interface/SimpleSAXParser.h diff --git a/Fireworks/Core/src/CmsShowMainBase.cc b/Fireworks/Core/src/CmsShowMainBase.cc index 42f88fe97da45..0e430b14d5b87 100644 --- a/Fireworks/Core/src/CmsShowMainBase.cc +++ b/Fireworks/Core/src/CmsShowMainBase.cc @@ -41,7 +41,7 @@ #include "Fireworks/Core/interface/FWViewManagerManager.h" #include "Fireworks/Core/interface/CmsShowTaskExecutor.h" #include "Fireworks/Core/src/FWColorSelect.h" -#include "Fireworks/Core/src/SimpleSAXParser.h" +#include "Fireworks/Core/interface/SimpleSAXParser.h" #include "Fireworks/Core/interface/CmsShowCommon.h" #include "Fireworks/Core/interface/fwLog.h" #include "Fireworks/Core/interface/fwPaths.h" diff --git a/Fireworks/Core/src/CmsShowTaskExecutorBase.cc b/Fireworks/Core/src/CmsShowTaskExecutorBase.cc index 0aa49a8c1d583..193a5d2654b49 100644 --- a/Fireworks/Core/src/CmsShowTaskExecutorBase.cc +++ b/Fireworks/Core/src/CmsShowTaskExecutorBase.cc @@ -15,7 +15,7 @@ #include // user include files -#include "Fireworks/Core/src/CmsShowTaskExecutorBase.h" +#include "Fireworks/Core/interface/CmsShowTaskExecutorBase.h" #include "Fireworks/Core/src/CmsShowTaskTimer.h" // diff --git a/Fireworks/Core/src/CmsShowTaskTimer.cc b/Fireworks/Core/src/CmsShowTaskTimer.cc index a664ab16e995a..7cc58497b2f3b 100644 --- a/Fireworks/Core/src/CmsShowTaskTimer.cc +++ b/Fireworks/Core/src/CmsShowTaskTimer.cc @@ -14,7 +14,7 @@ // user include files #include "Fireworks/Core/src/CmsShowTaskTimer.h" -#include "Fireworks/Core/src/CmsShowTaskExecutorBase.h" +#include "Fireworks/Core/interface/CmsShowTaskExecutorBase.h" // // constants, enums and typedefs diff --git a/Fireworks/Core/src/FWConfigurationManager.cc b/Fireworks/Core/src/FWConfigurationManager.cc index 2d7ad9fb6c84c..84419b634c208 100644 --- a/Fireworks/Core/src/FWConfigurationManager.cc +++ b/Fireworks/Core/src/FWConfigurationManager.cc @@ -24,7 +24,7 @@ #include "Fireworks/Core/interface/FWConfiguration.h" #include "Fireworks/Core/interface/FWConfigurable.h" #include "Fireworks/Core/interface/fwLog.h" -#include "Fireworks/Core/src/SimpleSAXParser.h" +#include "Fireworks/Core/interface/SimpleSAXParser.h" #include "Fireworks/Core/interface/FWJobMetadataManager.h" #include "Fireworks/Core/interface/fwLog.h" #include "Fireworks/Core/interface/FWXMLConfigParser.h" diff --git a/Fireworks/Core/src/FWExpressionValidator.h b/Fireworks/Core/src/FWExpressionValidator.h index 061fda44955b7..c5100d45156bb 100644 --- a/Fireworks/Core/src/FWExpressionValidator.h +++ b/Fireworks/Core/src/FWExpressionValidator.h @@ -24,7 +24,7 @@ #include "FWCore/Reflection/interface/TypeWithDict.h" // user include files -#include "Fireworks/Core/src/FWValidatorBase.h" +#include "Fireworks/Core/interface/FWValidatorBase.h" // forward declarations namespace fireworks { diff --git a/Fireworks/Core/src/FWGeometryTableManagerBase.cc b/Fireworks/Core/src/FWGeometryTableManagerBase.cc index 8769954bf96df..b46fd417b0095 100644 --- a/Fireworks/Core/src/FWGeometryTableManagerBase.cc +++ b/Fireworks/Core/src/FWGeometryTableManagerBase.cc @@ -34,7 +34,6 @@ #include "TVirtualX.h" #include "TGFrame.h" #include "TEveUtil.h" -#include "boost/lexical_cast.hpp" const char* FWGeometryTableManagerBase::NodeInfo::name() const { return m_node->GetName(); } @@ -224,10 +223,8 @@ void FWGeometryTableManagerBase::showEditor(int row) { void FWGeometryTableManagerBase::applyTransparencyFromEditor() { printf("transparency idx %d opaci %s \n", m_editTransparencyIdx, m_editor->GetText()); if (m_editTransparencyIdx >= 0) { - using boost::bad_lexical_cast; - using boost::lexical_cast; try { - int t = lexical_cast(m_editor->GetText()); + int t = std::stoi(m_editor->GetText()); if (t > 100 || t < 0) { fwLog(fwlog::kError) << "Transparency must be set in procentage [0-100]."; return; @@ -235,7 +232,7 @@ void FWGeometryTableManagerBase::applyTransparencyFromEditor() { m_entries[m_editTransparencyIdx].m_transparency = 100 - t; printf("SET !! \n"); cancelEditor(true); - } catch (bad_lexical_cast&) { + } catch (const std::exception&) { fwLog(fwlog::kError) << "Bad Lexical cast. Transparency must be set in procentage [0-100]."; } } diff --git a/Fireworks/Core/src/FWGeometryTableView.cc b/Fireworks/Core/src/FWGeometryTableView.cc index da3efb88b6e17..0d4f9cf1e82cd 100644 --- a/Fireworks/Core/src/FWGeometryTableView.cc +++ b/Fireworks/Core/src/FWGeometryTableView.cc @@ -27,7 +27,7 @@ #include "Fireworks/Core/src/FWGUIValidatingTextEntry.h" #include "Fireworks/Core/interface/FWGUIManager.h" -#include "Fireworks/Core/src/FWValidatorBase.h" +#include "Fireworks/Core/interface/FWValidatorBase.h" #include "Fireworks/Core/src/FWEveDetectorGeo.h" #include "KeySymbols.h" diff --git a/Fireworks/Core/src/FWOverlapTableView.cc b/Fireworks/Core/src/FWOverlapTableView.cc index 6495366a3283c..ba85b65fb732a 100644 --- a/Fireworks/Core/src/FWOverlapTableView.cc +++ b/Fireworks/Core/src/FWOverlapTableView.cc @@ -24,7 +24,7 @@ #include "Fireworks/Core/interface/fwLog.h" #include "Fireworks/Core/src/FWGUIValidatingTextEntry.h" -#include "Fireworks/Core/src/FWValidatorBase.h" +#include "Fireworks/Core/interface/FWValidatorBase.h" #include "Fireworks/Core/src/FWEveDigitSetScalableMarker.h" #include "TEveScene.h" diff --git a/Fireworks/Core/src/FWPartialConfig.cc b/Fireworks/Core/src/FWPartialConfig.cc index 94a4ce7e22a86..aeb0fff0ee700 100644 --- a/Fireworks/Core/src/FWPartialConfig.cc +++ b/Fireworks/Core/src/FWPartialConfig.cc @@ -8,7 +8,7 @@ #include "TSystem.h" #include "TROOT.h" -#include "Fireworks/Core/src/SimpleSAXParser.h" +#include "Fireworks/Core/interface/SimpleSAXParser.h" #include "Fireworks/Core/interface/FWXMLConfigParser.h" #include "Fireworks/Core/interface/FWEventItemsManager.h" #include "Fireworks/Core/interface/FWGUIManager.h" diff --git a/Fireworks/Core/src/SimpleSAXParser.cc b/Fireworks/Core/src/SimpleSAXParser.cc index f9608ff89bda9..6ba1997a76ef4 100644 --- a/Fireworks/Core/src/SimpleSAXParser.cc +++ b/Fireworks/Core/src/SimpleSAXParser.cc @@ -1,4 +1,4 @@ -#include "Fireworks/Core/src/SimpleSAXParser.h" +#include "Fireworks/Core/interface/SimpleSAXParser.h" /** Helper function to handle entities, i.e. characters specified with the "&label;" syntax. diff --git a/Fireworks/Geometry/src/FWRecoGeometryESProducer.cc b/Fireworks/Geometry/src/FWRecoGeometryESProducer.cc index ff6fcb790d3ae..b0820b0b10e81 100644 --- a/Fireworks/Geometry/src/FWRecoGeometryESProducer.cc +++ b/Fireworks/Geometry/src/FWRecoGeometryESProducer.cc @@ -60,36 +60,39 @@ void FWRecoGeometryESProducer::ADD_PIXEL_TOPOLOGY(unsigned int rawid, using Phase2TrackerGeomDetUnit = PixelGeomDetUnit; using Phase2TrackerTopology = PixelTopology; -#define ADD_SISTRIP_TOPOLOGY(rawid, detUnit) \ - const StripGeomDetUnit* det = dynamic_cast(detUnit); \ - if (det) { \ - if (const StripTopology* topo = dynamic_cast(&det->specificTopology())) { \ - fwRecoGeometry.idToName[rawid].topology[0] = 0; \ - fwRecoGeometry.idToName[rawid].topology[1] = topo->nstrips(); \ - fwRecoGeometry.idToName[rawid].topology[2] = topo->stripLength(); \ - } else if (const RadialStripTopology* rtop = \ - dynamic_cast(&(det->specificType().specificTopology()))) { \ - fwRecoGeometry.idToName[rawid].topology[0] = 1; \ - fwRecoGeometry.idToName[rawid].topology[3] = rtop->yAxisOrientation(); \ - fwRecoGeometry.idToName[rawid].topology[4] = rtop->originToIntersection(); \ - fwRecoGeometry.idToName[rawid].topology[5] = rtop->phiOfOneEdge(); \ - fwRecoGeometry.idToName[rawid].topology[6] = rtop->angularWidth(); \ - } else if (dynamic_cast(&(det->specificType().specificTopology()))) { \ - fwRecoGeometry.idToName[rawid].topology[0] = 2; \ - fwRecoGeometry.idToName[rawid].topology[3] = topo->pitch(); \ - } else if (dynamic_cast(&(det->specificType().specificTopology()))) { \ - fwRecoGeometry.idToName[rawid].topology[0] = 3; \ - fwRecoGeometry.idToName[rawid].topology[3] = topo->pitch(); \ - } \ - } else { \ - const Phase2TrackerGeomDetUnit* det = dynamic_cast(detUnit); \ - if (det) { \ - if (const Phase2TrackerTopology* topo = \ - dynamic_cast(&(det->specificTopology()))) { \ - fwRecoGeometry.idToName[rawid].topology[0] = topo->pitch().first; \ - fwRecoGeometry.idToName[rawid].topology[1] = topo->pitch().second; \ - } \ - } \ +#define ADD_SISTRIP_TOPOLOGY(rawid, detUnit) \ + const StripGeomDetUnit* det = dynamic_cast(detUnit); \ + if (det) { \ + if (const StripTopology* topo = dynamic_cast(&det->specificTopology())) { \ + fwRecoGeometry.idToName[rawid].topology[0] = 0; \ + fwRecoGeometry.idToName[rawid].topology[1] = topo->nstrips(); \ + fwRecoGeometry.idToName[rawid].topology[2] = topo->stripLength(); \ + } \ + if (const RadialStripTopology* rtop = \ + dynamic_cast(&(det->specificType().specificTopology()))) { \ + fwRecoGeometry.idToName[rawid].topology[0] = 1; \ + fwRecoGeometry.idToName[rawid].topology[3] = rtop->yAxisOrientation(); \ + fwRecoGeometry.idToName[rawid].topology[4] = rtop->originToIntersection(); \ + fwRecoGeometry.idToName[rawid].topology[5] = rtop->phiOfOneEdge(); \ + fwRecoGeometry.idToName[rawid].topology[6] = rtop->angularWidth(); \ + } else if (const RectangularStripTopology* topo = \ + dynamic_cast(&(det->specificType().specificTopology()))) { \ + fwRecoGeometry.idToName[rawid].topology[0] = 2; \ + fwRecoGeometry.idToName[rawid].topology[3] = topo->pitch(); \ + } else if (const TrapezoidalStripTopology* topo = \ + dynamic_cast(&(det->specificType().specificTopology()))) { \ + fwRecoGeometry.idToName[rawid].topology[0] = 3; \ + fwRecoGeometry.idToName[rawid].topology[3] = topo->pitch(); \ + } \ + } else { \ + const Phase2TrackerGeomDetUnit* det = dynamic_cast(detUnit); \ + if (det) { \ + if (const Phase2TrackerTopology* topo = \ + dynamic_cast(&(det->specificTopology()))) { \ + fwRecoGeometry.idToName[rawid].topology[0] = topo->pitch().first; \ + fwRecoGeometry.idToName[rawid].topology[1] = topo->pitch().second; \ + } \ + } \ } namespace { diff --git a/GeneratorInterface/AMPTInterface/src/AMPTHadronizer.cc b/GeneratorInterface/AMPTInterface/src/AMPTHadronizer.cc index 4a18e8ca5f48c..5ac1499f42c5c 100644 --- a/GeneratorInterface/AMPTInterface/src/AMPTHadronizer.cc +++ b/GeneratorInterface/AMPTInterface/src/AMPTHadronizer.cc @@ -1,8 +1,6 @@ #include #include -#include "boost/lexical_cast.hpp" - #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/Run.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" diff --git a/GeneratorInterface/Core/bin/externalGenerator.cc b/GeneratorInterface/Core/bin/externalGenerator.cc index c48f60eb2cc96..08ed2d0eb8374 100644 --- a/GeneratorInterface/Core/bin/externalGenerator.cc +++ b/GeneratorInterface/Core/bin/externalGenerator.cc @@ -5,6 +5,8 @@ #include #include #include +#include +#include #include "FWCore/TestProcessor/interface/TestProcessor.h" @@ -75,6 +77,18 @@ class Harness { template using Serializer = ROOTSerializer; +namespace { + //needed for atexit handling + boost::interprocess::scoped_lock* s_sharedLock = nullptr; + + void atexit_handler() { + if (s_sharedLock) { + std::cerr << "early exit called: unlock\n"; + s_sharedLock->unlock(); + } + } +} // namespace + int main(int argc, char* argv[]) { std::string descString(argv[0]); descString += " [--"; @@ -83,10 +97,9 @@ int main(int argc, char* argv[]) { boost::program_options::options_description desc(descString); desc.add_options()(kHelpCommandOpt, "produce help message")( - kMemoryNameCommandOpt, - boost::program_options::value(), - "memory name")(kUniqueIDCommandOpt, boost::program_options::value(), "unique id")(kVerboseCommandOpt, - "verbose output"); + kMemoryNameCommandOpt, boost::program_options::value(), "memory name")( + kUniqueIDCommandOpt, boost::program_options::value(), "unique id")(kVerboseCommandOpt, + "verbose output"); boost::program_options::positional_options_description p; p.add(kMemoryNameOpt, 1); @@ -125,6 +138,13 @@ int main(int argc, char* argv[]) { return 1; } + using namespace std::string_literals; + using namespace std::filesystem; + + auto newDir = path("thread"s + vm[kUniqueIDOpt].as()); + create_directory(newDir); + current_path(newDir); + WorkerMonitorThread monitorThread; monitorThread.startThread(); @@ -142,6 +162,7 @@ int main(int argc, char* argv[]) { //The lock must be released if there is a catastrophic signal auto lockPtr = communicationChannel.accessLock(); + monitorThread.setAction([lockPtr]() { if (lockPtr) { std::cerr << "SIGNAL CAUGHT: unlock\n"; @@ -149,6 +170,28 @@ int main(int argc, char* argv[]) { } }); + //be sure to unset the address of the shared lock before the lock goes away + s_sharedLock = lockPtr; + auto unsetLockPtr = [](void*) { s_sharedLock = nullptr; }; + std::unique_ptr sharedLockGuard{&s_sharedLock, unsetLockPtr}; + std::atexit(atexit_handler); + auto releaseLock = []() { + if (s_sharedLock) { + std::cerr << "terminate called: unlock\n"; + s_sharedLock->unlock(); + s_sharedLock = nullptr; + //deactivate the abort signal + + struct sigaction act; + act.sa_sigaction = nullptr; + act.sa_flags = SA_SIGINFO; + sigemptyset(&act.sa_mask); + sigaction(SIGABRT, &act, nullptr); + std::abort(); + } + }; + std::set_terminate(releaseLock); + Serializer serializer(sm_buffer); Serializer bl_serializer(sm_buffer); Serializer el_serializer(sm_buffer); @@ -175,8 +218,9 @@ int main(int argc, char* argv[]) { edm::ServiceRegistry::createContaining(std::unique_ptr(randomService)); Harness harness(configuration, serviceToken); - //Either ROOT or the Framework are overriding the signal handlers + //Some generator libraries override the signal handlers monitorThread.setupSignalHandling(); + std::set_terminate(releaseLock); if (verbose) { std::cerr << uniqueID << " process: done initializing" << std::endl; diff --git a/GeneratorInterface/Core/plugins/ExternalGeneratorFilter.cc b/GeneratorInterface/Core/plugins/ExternalGeneratorFilter.cc index 77d0e7c1c3c01..9a8960f10fdb7 100644 --- a/GeneratorInterface/Core/plugins/ExternalGeneratorFilter.cc +++ b/GeneratorInterface/Core/plugins/ExternalGeneratorFilter.cc @@ -46,22 +46,15 @@ namespace externalgen { channel_.setupWorker([&]() { using namespace std::string_literals; - using namespace std::filesystem; edm::LogSystem("ExternalProcess") << id_ << " starting external process \n"; std::string verboseCommand; if (verbose) { verboseCommand = "--verbose "; } - auto curDir = current_path(); - auto newDir = path("thread"s + std::to_string(id_)); - create_directory(newDir); - current_path(newDir); pipe_ = popen(("cmsExternalGenerator "s + verboseCommand + channel_.sharedMemoryName() + " " + channel_.uniqueID()) .c_str(), "w"); - current_path(curDir); - if (nullptr == pipe_) { abort(); } @@ -247,7 +240,7 @@ process = TestProcess() config += "process."s + label + "=" + config_ + "\n"; config += "process.moduleToTest(process."s + label + ")\n"; config += R"_( -process.add_(cms.Service("InitRootHandlers", UnloadRootSigHandler=cms.untracked.bool(True))) +process.add_(cms.Service("InitRootHandlers", AbortOnSignal=cms.untracked.bool(False))) )_"; if (not extraConfig_.empty()) { config += "\n"; diff --git a/GeneratorInterface/Core/test/BuildFile.xml b/GeneratorInterface/Core/test/BuildFile.xml new file mode 100644 index 0000000000000..c2e13b58e6190 --- /dev/null +++ b/GeneratorInterface/Core/test/BuildFile.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/GeneratorInterface/Core/test/FailingGeneratorFilter.cc b/GeneratorInterface/Core/test/FailingGeneratorFilter.cc new file mode 100644 index 0000000000000..0717a728a199d --- /dev/null +++ b/GeneratorInterface/Core/test/FailingGeneratorFilter.cc @@ -0,0 +1,128 @@ +// -*- C++ -*- +// +// Package: GeneratorInterface/Core +// Class : FailingGeneratorFilter +// +// Implementation: +// [Notes on implementation] +// +// Original Author: Christopher Jones +// Created: Wed, 08 Sep 2021 15:58:11 GMT +// + +// system include files + +// user include files +#include "GeneratorInterface/Core/interface/GeneratorFilter.h" +#include "FWCore/Framework/interface/MakerMacros.h" +#include "FWCore/Utilities/interface/Exception.h" + +#include +namespace test { + class FailingHad { + public: + FailingHad(const edm::ParameterSet& iPSet) + : failAt_(iPSet.getParameter("failAt")), failureType_(iPSet.getParameter("failureType")) {} + + std::vector sharedResources() const { + if (failAt_ == 0) { + fail("Constructor"); + } + return {}; + } + + void setEDMEvent(edm::Event&) { event_ = std::make_unique(); } + + bool generatePartonsAndHadronize() const { + if (failAt_ == 2) { + fail("Event"); + } + return true; + } + bool decay() const { return true; } + + std::unique_ptr getGenEvent() { return std::move(event_); } + + bool select(HepMC::GenEvent*) const { return true; } + void resetEvent(std::unique_ptr iEvent) { event_ = std::move(iEvent); } + bool residualDecay() const { return true; } + void finalizeEvent() const {} + std::unique_ptr getGenEventInfo() const { return std::make_unique(); } + + //caled at endRunProduce, endLumiProduce + void statistics() const {} + GenRunInfoProduct getGenRunInfo() const { return GenRunInfoProduct(); } + + //called begin Lumi Produce + template + void randomizeIndex(edm::LuminosityBlock const&, T&&) const { + if (failAt_ == 1) { + fail("BeginLumi"); + } + } + template + void generateLHE(edm::LuminosityBlock const&, T, unsigned int) const {} + + bool readSettings(int) const { return true; } + std::string classname() const { return ""; } + template + bool declareStableParticles(T&&) const { + return true; + } + template + bool declareSpecialSettings(T&&) const { + return true; + } + bool initializeForInternalPartons() const { return true; } + std::unique_ptr getGenLumiInfoHeader() const { return std::make_unique(); } + + //called end lumi + void cleanLHE() const {}; + + template + void setRandomEngine(T&&) const {} + + private: + void fail(std::string const& iName) const { + switch (failureType_) { + case 0: { + throw cms::Exception(iName); + } + case 1: { + std::raise(SIGSEGV); + break; + } + case 2: { + std::terminate(); + break; + } + default: { + std::exit(-1); + } + } + } + std::unique_ptr event_; + int failAt_; + int failureType_; + }; + + class DummyDec { + public: + DummyDec(const edm::ParameterSet&) {} + std::vector sharedResources() const { return {}; } + + HepMC::GenEvent* decay(HepMC::GenEvent const*) { return nullptr; } + void statistics() const {} + + void init(const edm::EventSetup&) const {} + bool operatesOnParticles() const { return false; } + bool specialSettings() const { return false; } + + template + void setRandomEngine(T&&) const {} + }; +} // namespace test + +using FailingGeneratorFilter = edm::GeneratorFilter; + +DEFINE_FWK_MODULE(FailingGeneratorFilter); diff --git a/GeneratorInterface/Core/test/test_FailingGeneratorFilter.sh b/GeneratorInterface/Core/test/test_FailingGeneratorFilter.sh new file mode 100755 index 0000000000000..2473d46bbbcee --- /dev/null +++ b/GeneratorInterface/Core/test/test_FailingGeneratorFilter.sh @@ -0,0 +1,47 @@ +# Pass in name and status +function die { echo $1: status $2 ; exit $2; } + + +echo "******************" +echo "Signal in constructor" +(cmsRun ${LOCALTOP}/src/GeneratorInterface/Core/test/test_FailingGeneratorFilter_cfg.py 0 1) && die "signal in constructor didn't fail" 1 +echo "******************" +echo "Signal in beginLumi" +(cmsRun ${LOCALTOP}/src/GeneratorInterface/Core/test/test_FailingGeneratorFilter_cfg.py 1 1) && die "signal in begin lumi didn't fail" 1 +echo "******************" +echo "Signal in event" +(cmsRun ${LOCALTOP}/src/GeneratorInterface/Core/test/test_FailingGeneratorFilter_cfg.py 2 1) && die "signal in event didn't fail" 1 + + +echo "******************" +echo "Exception in constructor" +(cmsRun ${LOCALTOP}/src/GeneratorInterface/Core/test/test_FailingGeneratorFilter_cfg.py 0 0) && die "exception in constructor didn't fail" 1 +echo "******************" +echo "Exception in beginLumi" +(cmsRun ${LOCALTOP}/src/GeneratorInterface/Core/test/test_FailingGeneratorFilter_cfg.py 1 0) && die "exception in begin lumi didn't fail" 1 +echo "******************" +echo "Exception in event" +(cmsRun ${LOCALTOP}/src/GeneratorInterface/Core/test/test_FailingGeneratorFilter_cfg.py 2 0) && die "exception in event didn't fail" 1 + +echo "******************" +echo "terminate in constructor" +(cmsRun ${LOCALTOP}/src/GeneratorInterface/Core/test/test_FailingGeneratorFilter_cfg.py 0 2) && die "signal in constructor didn't fail" 1 +echo "******************" +echo "terminate in beginLumi" +(cmsRun ${LOCALTOP}/src/GeneratorInterface/Core/test/test_FailingGeneratorFilter_cfg.py 1 2) && die "signal in begin lumi didn't fail" 1 +echo "******************" +echo "terminate in event" +(cmsRun ${LOCALTOP}/src/GeneratorInterface/Core/test/test_FailingGeneratorFilter_cfg.py 2 2) && die "signal in event didn't fail" 1 + +echo "******************" +echo "exit in constructor" +(cmsRun ${LOCALTOP}/src/GeneratorInterface/Core/test/test_FailingGeneratorFilter_cfg.py 0 3) && die "signal in constructor didn't fail" 1 +echo "******************" +echo "exit in beginLumi" +(cmsRun ${LOCALTOP}/src/GeneratorInterface/Core/test/test_FailingGeneratorFilter_cfg.py 1 3) && die "signal in begin lumi didn't fail" 1 +echo "******************" +echo "exit in event" +(cmsRun ${LOCALTOP}/src/GeneratorInterface/Core/test/test_FailingGeneratorFilter_cfg.py 2 3) && die "signal in event didn't fail" 1 + + +exit 0 diff --git a/GeneratorInterface/Core/test/test_FailingGeneratorFilter_cfg.py b/GeneratorInterface/Core/test/test_FailingGeneratorFilter_cfg.py new file mode 100644 index 0000000000000..489285dcb58de --- /dev/null +++ b/GeneratorInterface/Core/test/test_FailingGeneratorFilter_cfg.py @@ -0,0 +1,27 @@ +import FWCore.ParameterSet.Config as cms +import sys + +process = cms.Process("TEST") + +process.source = cms.Source("EmptySource") + +process.maxEvents.input=10 + +from GeneratorInterface.Core.ExternalGeneratorFilter import * +process.generator = ExternalGeneratorFilter( + cms.EDFilter("FailingGeneratorFilter", + failAt=cms.int32(int(sys.argv[2])), + failureType = cms.int32(int(sys.argv[3]))), + _external_process_waitTime_ = cms.untracked.uint32(5), + _external_process_verbose_ = cms.untracked.bool(True), + _external_process_components_ =cms.vstring() +) + +process.p = cms.Path(process.generator) + +process.add_(cms.Service("RandomNumberGeneratorService", + generator = cms.PSet( + initialSeed = cms.untracked.uint32(123), + engineName = cms.untracked.string('HepJamesRandom') + ) +)) diff --git a/GeneratorInterface/CosmicMuonGenerator/src/Point5MaterialMap.cc b/GeneratorInterface/CosmicMuonGenerator/interface/Point5MaterialMap.h similarity index 100% rename from GeneratorInterface/CosmicMuonGenerator/src/Point5MaterialMap.cc rename to GeneratorInterface/CosmicMuonGenerator/interface/Point5MaterialMap.h diff --git a/GeneratorInterface/CosmicMuonGenerator/interface/SingleParticleEvent.h b/GeneratorInterface/CosmicMuonGenerator/interface/SingleParticleEvent.h index 35dcee9214c97..d1ebf906808d9 100644 --- a/GeneratorInterface/CosmicMuonGenerator/interface/SingleParticleEvent.h +++ b/GeneratorInterface/CosmicMuonGenerator/interface/SingleParticleEvent.h @@ -6,7 +6,7 @@ // include files #include "GeneratorInterface/CosmicMuonGenerator/interface/CosmicMuonParameters.h" -#include "GeneratorInterface/CosmicMuonGenerator/src/Point5MaterialMap.cc" +#include "GeneratorInterface/CosmicMuonGenerator/interface/Point5MaterialMap.h" #include class SingleParticleEvent { diff --git a/GeneratorInterface/HiGenCommon/plugins/BetaBoostEvtVtxGenerator.cc b/GeneratorInterface/HiGenCommon/plugins/BetaBoostEvtVtxGenerator.cc index c6bd8f7f2015e..4c642e15aae1b 100644 --- a/GeneratorInterface/HiGenCommon/plugins/BetaBoostEvtVtxGenerator.cc +++ b/GeneratorInterface/HiGenCommon/plugins/BetaBoostEvtVtxGenerator.cc @@ -24,8 +24,7 @@ #include "FWCore/Utilities/interface/Exception.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" -#include "FWCore/Framework/interface/EDProducer.h" -#include "FWCore/Framework/interface/ConsumesCollector.h" +#include "FWCore/Framework/interface/global/EDProducer.h" #include "FWCore/Utilities/interface/InputTag.h" #include "FWCore/ServiceRegistry/interface/Service.h" #include "FWCore/Utilities/interface/RandomNumberGenerator.h" @@ -49,80 +48,58 @@ namespace CLHEP { class HepRandomEngine; } -class BetaBoostEvtVtxGenerator : public edm::EDProducer { +class BetaBoostEvtVtxGenerator : public edm::global::EDProducer<> { public: BetaBoostEvtVtxGenerator(const edm::ParameterSet& p); /** Copy constructor */ BetaBoostEvtVtxGenerator(const BetaBoostEvtVtxGenerator& p) = delete; /** Copy assignment operator */ BetaBoostEvtVtxGenerator& operator=(const BetaBoostEvtVtxGenerator& rhs) = delete; - ~BetaBoostEvtVtxGenerator() override; + ~BetaBoostEvtVtxGenerator() override = default; /// return a new event vertex - //virtual CLHEP::Hep3Vector * newVertex(); - virtual HepMC::FourVector* newVertex(CLHEP::HepRandomEngine*); - void produce(edm::Event&, const edm::EventSetup&) override; - virtual TMatrixD* GetInvLorentzBoost(); - - /// set resolution in Z in cm - void sigmaZ(double s = 1.0); - - /// set mean in X in cm - void X0(double m = 0) { fX0 = m; } - /// set mean in Y in cm - void Y0(double m = 0) { fY0 = m; } - /// set mean in Z in cm - void Z0(double m = 0) { fZ0 = m; } - - /// set half crossing angle - void Phi(double m = 0) { phi_ = m; } - /// angle between crossing plane and horizontal plane - void Alpha(double m = 0) { alpha_ = m; } - void Beta(double m = 0) { beta_ = m; } - - /// set beta_star - void betastar(double m = 0) { fbetastar = m; } - /// emittance (no the normalized) - void emittance(double m = 0) { femittance = m; } + HepMC::FourVector newVertex(CLHEP::HepRandomEngine*) const; + void produce(edm::StreamID, edm::Event&, const edm::EventSetup&) const override; + TMatrixD GetInvLorentzBoost() const; /// beta function - double BetaFunction(double z, double z0); + double BetaFunction(double z, double z0) const; private: - double alpha_, phi_; - //TMatrixD boost_; - double beta_; - double fX0, fY0, fZ0; - double fSigmaZ; + const double alpha_; // angle between crossing plane and horizontal plane + const double phi_; // half crossing angle + const double beta_; + const double fX0; // mean in X in cm + const double fY0; // mean in Y in cm + const double fZ0; // mean in Z in cm + const double fSigmaZ; // resolution in Z in cm //double fdxdz, fdydz; - double fbetastar, femittance; - double falpha; + const double fbetastar; + const double femittance; // emittance (no the normalized)a - HepMC::FourVector* fVertex; - TMatrixD* boost_; - double fTimeOffset; + const double fTimeOffset; - edm::EDGetTokenT sourceLabel; + const TMatrixD boost_; - bool verbosity_; + const edm::EDGetTokenT sourceLabel; + + const bool verbosity_; }; BetaBoostEvtVtxGenerator::BetaBoostEvtVtxGenerator(const edm::ParameterSet& p) - : fVertex(nullptr), - boost_(nullptr), - fTimeOffset(0), + : alpha_(p.getParameter("Alpha") * radian), + phi_(p.getParameter("Phi") * radian), + beta_(p.getParameter("Beta")), + fX0(p.getParameter("X0") * cm), + fY0(p.getParameter("Y0") * cm), + fZ0(p.getParameter("Z0") * cm), + fSigmaZ(p.getParameter("SigmaZ") * cm), + fbetastar(p.getParameter("BetaStar") * cm), + femittance(p.getParameter("Emittance") * cm), // this is not the normalized emittance + fTimeOffset(p.getParameter("TimeOffset") * ns * c_light), // HepMC time units are mm + boost_(GetInvLorentzBoost()), sourceLabel(consumes(p.getParameter("src"))), verbosity_(p.getUntrackedParameter("verbosity", false)) { - fX0 = p.getParameter("X0") * cm; - fY0 = p.getParameter("Y0") * cm; - fZ0 = p.getParameter("Z0") * cm; - fSigmaZ = p.getParameter("SigmaZ") * cm; - alpha_ = p.getParameter("Alpha") * radian; - phi_ = p.getParameter("Phi") * radian; - fbetastar = p.getParameter("BetaStar") * cm; - femittance = p.getParameter("Emittance") * cm; // this is not the normalized emittance - fTimeOffset = p.getParameter("TimeOffset") * ns * c_light; // HepMC time units are mm - beta_ = p.getParameter("Beta"); if (fSigmaZ <= 0) { throw cms::Exception("Configuration") << "Error in BetaBoostEvtVtxGenerator: " << "Illegal resolution in Z (SigmaZ is negative)"; @@ -131,14 +108,7 @@ BetaBoostEvtVtxGenerator::BetaBoostEvtVtxGenerator(const edm::ParameterSet& p) produces(); } -BetaBoostEvtVtxGenerator::~BetaBoostEvtVtxGenerator() { - delete fVertex; - if (boost_ != nullptr) - delete boost_; -} - -//Hep3Vector* BetaBoostEvtVtxGenerator::newVertex() { -HepMC::FourVector* BetaBoostEvtVtxGenerator::newVertex(CLHEP::HepRandomEngine* engine) { +HepMC::FourVector BetaBoostEvtVtxGenerator::newVertex(CLHEP::HepRandomEngine* engine) const { double X, Y, Z; double tmp_sigz = CLHEP::RandGaussQ::shoot(engine, 0.0, fSigmaZ); @@ -157,27 +127,14 @@ HepMC::FourVector* BetaBoostEvtVtxGenerator::newVertex(CLHEP::HepRandomEngine* e double tmp_sigt = CLHEP::RandGaussQ::shoot(engine, 0.0, fSigmaZ); double T = tmp_sigt + fTimeOffset; - if (fVertex == nullptr) - fVertex = new HepMC::FourVector(); - fVertex->set(X, Y, Z, T); - - return fVertex; + return HepMC::FourVector(X, Y, Z, T); } -double BetaBoostEvtVtxGenerator::BetaFunction(double z, double z0) { +double BetaBoostEvtVtxGenerator::BetaFunction(double z, double z0) const { return sqrt(femittance * (fbetastar + (((z - z0) * (z - z0)) / fbetastar))); } -void BetaBoostEvtVtxGenerator::sigmaZ(double s) { - if (s >= 0) { - fSigmaZ = s; - } else { - throw cms::Exception("LogicError") << "Error in BetaBoostEvtVtxGenerator::sigmaZ: " - << "Illegal resolution in Z (negative)"; - } -} - -TMatrixD* BetaBoostEvtVtxGenerator::GetInvLorentzBoost() { +TMatrixD BetaBoostEvtVtxGenerator::GetInvLorentzBoost() const { //alpha_ = 0; //phi_ = 142.e-6; // if (boost_ != 0 ) return boost_; @@ -232,15 +189,14 @@ TMatrixD* BetaBoostEvtVtxGenerator::GetInvLorentzBoost() { tmpboostXYZ = tmpboostZ * tmpboost; tmpboostXYZ.Invert(); - boost_ = new TMatrixD(tmpboostXYZ); if (verbosity_) { - boost_->Print(); + tmpboostXYZ.Print(); } - return boost_; + return tmpboostXYZ; } -void BetaBoostEvtVtxGenerator::produce(Event& evt, const EventSetup&) { +void BetaBoostEvtVtxGenerator::produce(edm::StreamID, Event& evt, const EventSetup&) const { edm::Service rng; if (!rng.isAvailable()) { throw cms::Exception("Configuration") @@ -249,23 +205,20 @@ void BetaBoostEvtVtxGenerator::produce(Event& evt, const EventSetup&) { } CLHEP::HepRandomEngine* engine = &rng->getEngine(evt.streamID()); - Handle HepUnsmearedMCEvt; - evt.getByToken(sourceLabel, HepUnsmearedMCEvt); + const auto& HepUnsmearedMCEvt = evt.get(sourceLabel); // Copy the HepMC::GenEvent - HepMC::GenEvent* genevt = new HepMC::GenEvent(*HepUnsmearedMCEvt->GetEvent()); - std::unique_ptr HepMCEvt(new edm::HepMCProduct(genevt)); + auto HepMCEvt = std::make_unique(new HepMC::GenEvent(*HepUnsmearedMCEvt.GetEvent())); // generate new vertex & apply the shift // - HepMCEvt->applyVtxGen(newVertex(engine)); + auto vertex = newVertex(engine); + HepMCEvt->applyVtxGen(&vertex); //HepMCEvt->LorentzBoost( 0., 142.e-6 ); - HepMCEvt->boostToLab(GetInvLorentzBoost(), "vertex"); - HepMCEvt->boostToLab(GetInvLorentzBoost(), "momentum"); + HepMCEvt->boostToLab(&boost_, "vertex"); + HepMCEvt->boostToLab(&boost_, "momentum"); evt.put(std::move(HepMCEvt)); - - return; } #include "FWCore/Framework/interface/MakerMacros.h" diff --git a/GeneratorInterface/HiGenCommon/plugins/GenHIEventProducer.cc b/GeneratorInterface/HiGenCommon/plugins/GenHIEventProducer.cc index f7e25e7fd358f..875af0b0e55df 100644 --- a/GeneratorInterface/HiGenCommon/plugins/GenHIEventProducer.cc +++ b/GeneratorInterface/HiGenCommon/plugins/GenHIEventProducer.cc @@ -23,7 +23,7 @@ Description: // user include files #include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/EDProducer.h" +#include "FWCore/Framework/interface/global/EDProducer.h" #include "FWCore/Framework/interface/EventSetup.h" #include "FWCore/Framework/interface/Event.h" @@ -46,58 +46,43 @@ using namespace std; // class decleration // -class GenHIEventProducer : public edm::EDProducer { +class GenHIEventProducer : public edm::global::EDProducer<> { public: explicit GenHIEventProducer(const edm::ParameterSet&); - ~GenHIEventProducer() override; + ~GenHIEventProducer() override = default; private: - void produce(edm::Event&, const edm::EventSetup&) override; - edm::EDGetTokenT > hepmcSrc_; - edm::ESHandle pdt; - edm::ESGetToken pdtToken_; + void produce(edm::StreamID, edm::Event&, const edm::EventSetup&) const override; + const edm::EDGetTokenT > hepmcSrc_; + const edm::ESGetToken pdtToken_; + const edm::EDPutTokenT putToken_; double ptCut_; - bool doParticleInfo_; + const bool doParticleInfo_; }; -// -// constants, enums and typedefs -// - -// -// static data member definitions -// - // // constructors and destructor // -GenHIEventProducer::GenHIEventProducer(const edm::ParameterSet& iConfig) { - produces(); - hepmcSrc_ = consumes >(iConfig.getParameter("src")); - pdtToken_ = esConsumes(); - doParticleInfo_ = iConfig.getUntrackedParameter("doParticleInfo", false); +GenHIEventProducer::GenHIEventProducer(const edm::ParameterSet& iConfig) + : hepmcSrc_(consumes >(iConfig.getParameter("src"))), + pdtToken_(esConsumes()), + putToken_(produces()), + doParticleInfo_(iConfig.getUntrackedParameter("doParticleInfo", false)) { if (doParticleInfo_) { ptCut_ = iConfig.getParameter("ptCut"); } } -GenHIEventProducer::~GenHIEventProducer() { - // do anything here that needs to be done at desctruction time - // (e.g. close files, deallocate resources etc.) -} - // // member functions // // ------------ method called to produce the data ------------ -void GenHIEventProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) { +void GenHIEventProducer::produce(edm::StreamID, edm::Event& iEvent, const edm::EventSetup& iSetup) const { using namespace edm; - if (!(pdt.isValid())) { - pdt = iSetup.getHandle(pdtToken_); - } + const auto& pdt = iSetup.getData(pdtToken_); double b = -1; int npart = -1; @@ -116,9 +101,8 @@ void GenHIEventProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSet double EtMR = 0; // Normalized of total energy bym double TotEnergy = 0; // Total energy bym - Handle > hepmc; - iEvent.getByToken(hepmcSrc_, hepmc); - MixCollection mix(hepmc.product()); + const auto& hepmc = iEvent.get(hepmcSrc_); + MixCollection mix(&hepmc); if (mix.size() < 1) { throw cms::Exception("MatchVtx") << "Mixing has " << mix.size() << " sub-events, should have been at least 1" @@ -134,7 +118,7 @@ void GenHIEventProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSet if ((*it)->status() != 1) continue; int pdg_id = (*it)->pdg_id(); - const ParticleData* part = pdt->particle(pdg_id); + const ParticleData* part = pdt.particle(pdg_id); int charge = static_cast(part->charge()); if (charge == 0) @@ -189,10 +173,20 @@ void GenHIEventProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSet meanPt /= nCharged; } - std::unique_ptr pGenHI(new edm::GenHIEvent( - b, npart, ncoll, nhard, phi, ecc, nCharged, nChargedMR, meanPt, meanPtMR, EtMR, nChargedPtCut, nChargedPtCutMR)); - - iEvent.put(std::move(pGenHI)); + iEvent.emplace(putToken_, + b, + npart, + ncoll, + nhard, + phi, + ecc, + nCharged, + nChargedMR, + meanPt, + meanPtMR, + EtMR, + nChargedPtCut, + nChargedPtCutMR); } //define this as a plug-in diff --git a/GeneratorInterface/HijingInterface/src/HijingHadronizer.cc b/GeneratorInterface/HijingInterface/src/HijingHadronizer.cc index b2ddcb856aeb8..9b7eb31613573 100644 --- a/GeneratorInterface/HijingInterface/src/HijingHadronizer.cc +++ b/GeneratorInterface/HijingInterface/src/HijingHadronizer.cc @@ -1,8 +1,6 @@ #include #include -#include "boost/lexical_cast.hpp" - #include "FWCore/Concurrency/interface/SharedResourceNames.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/Run.h" diff --git a/GeneratorInterface/Hydjet2Interface/interface/EquationSolver.h b/GeneratorInterface/Hydjet2Interface/interface/EquationSolver.h index 0dd890e3ae93a..1e37d8e74de74 100644 --- a/GeneratorInterface/Hydjet2Interface/interface/EquationSolver.h +++ b/GeneratorInterface/Hydjet2Interface/interface/EquationSolver.h @@ -64,6 +64,6 @@ class NAEquationSolver { bool Brent(Function& theFunction); }; -#include "GeneratorInterface/Hydjet2Interface/src/EquationSolver.icc" +#include "GeneratorInterface/Hydjet2Interface/interface/EquationSolver.icc" #endif diff --git a/GeneratorInterface/Hydjet2Interface/src/EquationSolver.icc b/GeneratorInterface/Hydjet2Interface/interface/EquationSolver.icc similarity index 100% rename from GeneratorInterface/Hydjet2Interface/src/EquationSolver.icc rename to GeneratorInterface/Hydjet2Interface/interface/EquationSolver.icc diff --git a/GeneratorInterface/Hydjet2Interface/src/Hydjet2Hadronizer.cc b/GeneratorInterface/Hydjet2Interface/src/Hydjet2Hadronizer.cc index a3afdb504d6ce..e79c20562f6af 100644 --- a/GeneratorInterface/Hydjet2Interface/src/Hydjet2Hadronizer.cc +++ b/GeneratorInterface/Hydjet2Interface/src/Hydjet2Hadronizer.cc @@ -52,7 +52,6 @@ #include #include #include -#include "boost/lexical_cast.hpp" #include "FWCore/Concurrency/interface/SharedResourceNames.h" #include "FWCore/Framework/interface/Event.h" diff --git a/GeneratorInterface/HydjetInterface/src/HydjetHadronizer.cc b/GeneratorInterface/HydjetInterface/src/HydjetHadronizer.cc index 33c045cce71eb..a391d67780ef9 100644 --- a/GeneratorInterface/HydjetInterface/src/HydjetHadronizer.cc +++ b/GeneratorInterface/HydjetInterface/src/HydjetHadronizer.cc @@ -7,8 +7,6 @@ #include #include -#include "boost/lexical_cast.hpp" - #include "FWCore/Concurrency/interface/SharedResourceNames.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/Run.h" diff --git a/GeneratorInterface/SherpaInterface/src/SherpaHadronizer.cc b/GeneratorInterface/SherpaInterface/src/SherpaHadronizer.cc index ac884b9111958..ba1b488d80f36 100644 --- a/GeneratorInterface/SherpaInterface/src/SherpaHadronizer.cc +++ b/GeneratorInterface/SherpaInterface/src/SherpaHadronizer.cc @@ -23,6 +23,8 @@ #include "CLHEP/Random/RandomEngine.h" +#include "FWCore/Utilities/interface/Exception.h" + //This unnamed namespace is used (instead of static variables) to pass the //randomEngine passed to doSetRandomEngine to the External Random //Number Generator CMS_SHERPA_RNG of sherpa @@ -95,8 +97,11 @@ void SherpaHadronizer::doSetRandomEngine(CLHEP::HepRandomEngine *v) { SetExternalEngine(v); // Throw exception if there is no reference to an external RNG and it is not the first call! } else { - throw edm::Exception(edm::errors::LogicError) << "The Sherpa interface got a randomEngine reference but there is " - "no reference to the external RNG to hand it over to\n"; + if (isInitialized and v != nullptr) { + throw edm::Exception(edm::errors::LogicError) + << "The Sherpa interface got a randomEngine reference but there is " + "no reference to the external RNG to hand it over to\n"; + } } } else { cmsSherpaRng->setRandomEngine(v); @@ -199,6 +204,9 @@ SherpaHadronizer::SherpaHadronizer(const edm::ParameterSet ¶ms) arguments.push_back(shRng); isInitialized = false; //initialization of Sherpa moved to initializeForInternalPartons +#ifdef USING__MPI + MPI::Init(); +#endif } SherpaHadronizer::~SherpaHadronizer() { @@ -215,9 +223,6 @@ bool SherpaHadronizer::initializeForInternalPartons() { char *argv[argc]; for (int l = 0; l < argc; l++) argv[l] = (char *)arguments[l].c_str(); -#ifdef USING__MPI - MPI::Init(); -#endif Generator->InitializeTheRun(argc, argv); Generator->InitializeTheEventHandler(); isInitialized = true; diff --git a/GeneratorInterface/TauolaInterface/interface/TauolaWrapper.h b/GeneratorInterface/TauolaInterface/interface/TauolaWrapper.h deleted file mode 100644 index 9a998a1a68c58..0000000000000 --- a/GeneratorInterface/TauolaInterface/interface/TauolaWrapper.h +++ /dev/null @@ -1,105 +0,0 @@ -#ifndef gen_ExternalDecays_TauolaWrapper_h -#define gen_ExternalDecays_TauolaWrapper_h - -/********** TauolaWrapper - * - * Wrapper to Fortran functions in TAUOLA tau decay library - * - * Christian Veelken - * 04/17/07 - * - * Modified to contain access to individual decays (COMMON TAUBRA), and - * force polarization like in case of particle gun taus (SUBROUTINE DEXAY - * and COMMON MOMDEC) - * 23.2.2009/S.Lehti - * - * Modified to remove everything related to pythia6 or pretauola; - * all pythia6-related functionalities and/or ties are moving back - * to Pythia6Interface; - * the concept will ensure transparent use of Tauola with ANY - * multi-purpose generator - * J.V.Yarba, Feb.26, 2009 - * - ***************************************/ - -// -//------------------------------------------------------------------------------- -// - -// main function(s) of TAUOLA/pretauola tau decay library - -extern "C" { - void tauola_(int*, int*); - void tauola_srs_(int*,int*); - void taurep_(int*); - void ranmar_(float*,int*); - void rmarin_(int*, int*, int*); -} -#define tauola tauola_ - -void inline call_tauola (int mode, int polarization) { tauola(&mode, &polarization); } - -extern "C" { - extern void dexay_(int*, float[4]); -} -#define dexay dexay_ - -void inline call_dexay (int mode, float polarization[4]) { dexay(&mode, polarization); } - -// -//------------------------------------------------------------------------------- -// - -// common block with steering parameters for CMS specific Fortran interface to TAUOLA - -extern "C" { - extern struct { - int pjak1; - int pjak2; - int mdtau; - } ki_taumod_; -} -#define ki_taumod ki_taumod_ - -extern "C" { - extern struct { - int jak1; - int jak2; - int itdkrc; - int ifphot; - int ifhadm; - int ifhadp; - } libra_ ; -} -#define libra libra_ - -extern "C" { - extern struct { - float gamprt[30]; - int jlist[30]; - int nchan; - } taubra_; -} -#define taubra taubra_ - -extern "C" { - extern struct { - double q1[4]; - double q2[4]; - double p1[4]; - double p2[4]; - double p3[4]; - double p4[4]; - } momdec_; -} -#define momdec momdec_ - -extern "C" { - extern struct { - int np1; - int np2; - } taupos_; -} -#define taupos taupos_ - -#endif diff --git a/Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2021.xml b/Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2021.xml index 7027b81b1fdee..739123843dce2 100644 --- a/Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2021.xml +++ b/Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2021.xml @@ -4,8 +4,8 @@ - - + + @@ -39,7 +39,7 @@ - + @@ -53,8 +53,8 @@ - - + + @@ -87,7 +87,7 @@ - + @@ -110,7 +110,7 @@ - + @@ -261,35 +261,33 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -299,7 +297,6 @@ - @@ -309,23 +306,22 @@ - - - - - - - - - - + + + + + + + + + - + @@ -338,21 +334,22 @@ - - - - - + + + + + + + - - - - - - - - - + + + + + + + + diff --git a/Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2021FlatMinus05Percent.xml b/Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2021FlatMinus05Percent.xml index c41d03751f415..525be1e4e7264 100644 --- a/Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2021FlatMinus05Percent.xml +++ b/Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2021FlatMinus05Percent.xml @@ -261,35 +261,33 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -299,7 +297,6 @@ - @@ -309,23 +306,22 @@ - - - - - - - - - - + + + + + + + + + - + @@ -338,21 +334,22 @@ - - - - - + + + + + + + - - - - - - - - - + + + + + + + + diff --git a/Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2021FlatMinus10Percent.xml b/Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2021FlatMinus10Percent.xml index 6b0d7f3e95cda..82bde8e4551b1 100644 --- a/Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2021FlatMinus10Percent.xml +++ b/Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2021FlatMinus10Percent.xml @@ -261,35 +261,33 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -299,7 +297,6 @@ - @@ -309,23 +306,22 @@ - - - - - - - - - - + + + + + + + + + - + @@ -338,21 +334,22 @@ - - - - - + + + + + + + - - - - - - - - - + + + + + + + + diff --git a/Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2021FlatPlus05Percent.xml b/Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2021FlatPlus05Percent.xml index 27e6d28ae6465..a9427b197d39b 100644 --- a/Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2021FlatPlus05Percent.xml +++ b/Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2021FlatPlus05Percent.xml @@ -261,35 +261,33 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -299,7 +297,6 @@ - @@ -309,23 +306,22 @@ - - - - - - - - - - + + + + + + + + + - + @@ -338,21 +334,22 @@ - - - - - + + + + + + + - - - - - - - - - + + + + + + + + diff --git a/Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2021FlatPlus10Percent.xml b/Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2021FlatPlus10Percent.xml index 5ded176316ff6..ad0c052cb673e 100644 --- a/Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2021FlatPlus10Percent.xml +++ b/Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2021FlatPlus10Percent.xml @@ -261,35 +261,33 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -299,7 +297,6 @@ - @@ -309,23 +306,22 @@ - - - - - - - - - - + + + + + + + + + - + @@ -338,21 +334,22 @@ - - - - - + + + + + + + - - - - - - - - - + + + + + + + + diff --git a/Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2021ZeroMaterial.xml b/Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2021ZeroMaterial.xml index dccbe55b3b91d..a6d645f71cd3b 100644 --- a/Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2021ZeroMaterial.xml +++ b/Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2021ZeroMaterial.xml @@ -261,35 +261,33 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -299,7 +297,6 @@ - @@ -309,23 +306,22 @@ - - - - - - - - - - + + + + + + + + + - + @@ -338,21 +334,22 @@ - - - - - + + + + + + + - - - - - - - - - + + + + + + + + diff --git a/Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2026D86.xml b/Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2026D86.xml index feda0018c382c..d014f9a63c8f8 100644 --- a/Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2026D86.xml +++ b/Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2026D86.xml @@ -44,7 +44,7 @@ - + diff --git a/Geometry/CMSCommonData/data/materials/2021/v3/materials.xml b/Geometry/CMSCommonData/data/materials/2021/v3/materials.xml new file mode 100644 index 0000000000000..ca9b104e5ae63 --- /dev/null +++ b/Geometry/CMSCommonData/data/materials/2021/v3/materials.xml @@ -0,0 +1,4405 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Geometry/CMSCommonData/python/cmsExtendedGeometry2021FlatMinus05PercentXML_cfi.py b/Geometry/CMSCommonData/python/cmsExtendedGeometry2021FlatMinus05PercentXML_cfi.py index 13341bd7e345e..47c97877cce62 100644 --- a/Geometry/CMSCommonData/python/cmsExtendedGeometry2021FlatMinus05PercentXML_cfi.py +++ b/Geometry/CMSCommonData/python/cmsExtendedGeometry2021FlatMinus05PercentXML_cfi.py @@ -264,35 +264,33 @@ 'Geometry/ForwardCommonData/data/zdc/2021/v1/zdc.xml', 'Geometry/ForwardCommonData/data/zdclumi/2021/v2/zdclumi.xml', 'Geometry/ForwardCommonData/data/cmszdc.xml', - 'Geometry/ForwardCommonData/data/Run2/totemMaterials.xml', - 'Geometry/ForwardCommonData/data/totemRotations.xml', 'Geometry/VeryForwardData/data/RP_Box.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_000.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_001.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_002.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_003.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_004.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_005.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_020.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_021.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_022.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_023.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_024.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_025.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_100.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_101.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_102.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_103.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_104.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_105.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_120.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_121.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_122.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_123.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_124.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_125.xml', - 'Geometry/VeryForwardData/data/RP_Hybrid/v1/RP_Hybrid.xml', - 'Geometry/VeryForwardData/data/RP_Materials/v3/RP_Materials.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_000.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_001.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_002.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_003.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_004.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_005.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_020.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_021.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_022.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_023.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_024.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_025.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_100.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_101.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_102.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_103.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_104.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_105.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_120.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_121.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_122.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_123.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_124.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_125.xml', + 'Geometry/VeryForwardData/data/RP_Hybrid/v2/RP_Hybrid.xml', + 'Geometry/VeryForwardData/data/RP_Materials/v4/RP_Materials.xml', 'Geometry/VeryForwardData/data/RP_Transformations.xml', 'Geometry/VeryForwardData/data/RP_Detectors_Assembly.xml', 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_000.xml', @@ -302,7 +300,6 @@ 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_005.xml', 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_020.xml', 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_021.xml', - 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_022.xml', 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_024.xml', 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_025.xml', 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_100.xml', @@ -312,23 +309,22 @@ 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_105.xml', 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_120.xml', 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_121.xml', - 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_122.xml', 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_124.xml', 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_125.xml', - 'Geometry/VeryForwardData/data/RP_Device.xml', - 'Geometry/VeryForwardData/data/RP_Vertical_Device/2021/v1/RP_Vertical_Device.xml', - 'Geometry/VeryForwardData/data/RP_Horizontal_Device/2021/v1/RP_Horizontal_Device.xml', - 'Geometry/VeryForwardData/data/CTPPS_2018/CTPPS_220_Right_Station/v2/CTPPS_220_Right_Station.xml', - 'Geometry/VeryForwardData/data/CTPPS_2018/CTPPS_220_Left_Station/v2/CTPPS_220_Left_Station.xml', - 'Geometry/VeryForwardData/data/CTPPS_2018/CTPPS_210_Right_Station/v2/CTPPS_210_Right_Station.xml', - 'Geometry/VeryForwardData/data/CTPPS_2018/CTPPS_210_Left_Station/v2/CTPPS_210_Left_Station.xml', - 'Geometry/VeryForwardData/data/CTPPS_Stations_Assembly.xml', - 'Geometry/VeryForwardData/data/CTPPS_Cuts_Per_Region.xml', + 'Geometry/VeryForwardData/data/RP_Device/v1/RP_Device.xml', + 'Geometry/VeryForwardData/data/RP_Vertical_Device/2021/Simu/v2/RP_Vertical_Device.xml', + 'Geometry/VeryForwardData/data/RP_Horizontal_Device/2021/Simu/v2/RP_Horizontal_Device.xml', + 'Geometry/VeryForwardData/data/CTPPS_2021/Stations/Simu/v3/CTPPS_220_Right_Station.xml', + 'Geometry/VeryForwardData/data/CTPPS_2021/Stations/Simu/v3/CTPPS_220_Left_Station.xml', + 'Geometry/VeryForwardData/data/CTPPS_2021/Stations/Simu/v3/CTPPS_210_Right_Station.xml', + 'Geometry/VeryForwardData/data/CTPPS_2021/Stations/Simu/v3/CTPPS_210_Left_Station.xml', + 'Geometry/VeryForwardData/data/CTPPS_2021/Stations/Simu/v3/CTPPS_Stations_Assembly.xml', + 'Geometry/VeryForwardData/data/CTPPS_2021/Cuts_Per_Region/Simu/v1/CTPPS_Cuts_Per_Region.xml', 'Geometry/VeryForwardData/data/RP_Sensitive_Dets.xml', 'Geometry/VeryForwardData/data/CTPPS_Diamond_Transformations.xml', 'Geometry/VeryForwardData/data/CTPPS_Diamond_Parameters.xml', 'Geometry/VeryForwardData/data/CTPPS_Timing_Station_Parameters.xml', - 'Geometry/VeryForwardData/data/CTPPS_Timing_Horizontal_Pot/v1/CTPPS_Timing_Horizontal_Pot.xml', + 'Geometry/VeryForwardData/data/CTPPS_Timing_Horizontal_Pot/v2/CTPPS_Timing_Horizontal_Pot.xml', 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern1_Segment1.xml', 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern2_Segment1.xml', 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern2_Segment2.xml', @@ -341,21 +337,22 @@ 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern4_Segment3.xml', 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern4_Segment4.xml', 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern4_Segment5.xml', - 'Geometry/VeryForwardData/data/CTPPS_Diamond_2018/CTPPS_Diamond_Planes/CTPPS_Diamond_Plane1.xml', - 'Geometry/VeryForwardData/data/CTPPS_Diamond_2018/CTPPS_Diamond_Planes/CTPPS_Diamond_Plane2.xml', - 'Geometry/VeryForwardData/data/CTPPS_Diamond_2018/CTPPS_Diamond_Planes/CTPPS_Diamond_Plane3.xml', - 'Geometry/VeryForwardData/data/CTPPS_Diamond_2018/CTPPS_Diamond_Planes/CTPPS_Diamond_Plane4.xml', - 'Geometry/VeryForwardData/data/CTPPS_Diamond_2018/CTPPS_Diamond_Detector_Assembly/2021/v1/CTPPS_Diamond_Detector_Assembly.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_2021/CTPPS_Diamond_Planes/CTPPS_Diamond_Plane1.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_2021/CTPPS_Diamond_Planes/CTPPS_Diamond_Plane2.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_2021/CTPPS_Diamond_Planes/CTPPS_Diamond_Plane3.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_2021/CTPPS_Diamond_Planes/CTPPS_Diamond_Plane4.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_2021/CTPPS_Diamond_Detector_Assembly/v1/CTPPS_Diamond_Detector_Assembly.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_2021/Simu/v1/CTPPS_Detectors_Assembly_022.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_2021/Simu/v1/CTPPS_Detectors_Assembly_122.xml', 'Geometry/VeryForwardData/data/CTPPS_Diamond_Sensitive_Dets_TimingHits.xml', - 'Geometry/VeryForwardData/data/ppstrackerMaterials/v2/ppstrackerMaterials.xml', - 'Geometry/VeryForwardData/data/CTPPS_Pixel_Module/v3/CTPPS_Pixel_Module.xml', - 'Geometry/VeryForwardData/data/CTPPS_Pixel_Module_2x2/v3/CTPPS_Pixel_Module_2x2.xml', - 'Geometry/VeryForwardData/data/CTPPS_Pixel_2018/CTPPS_Pixel_Assembly_Box_Real_003.xml', - 'Geometry/VeryForwardData/data/CTPPS_Pixel_2018/CTPPS_Pixel_Assembly_Box_Real_023.xml', - 'Geometry/VeryForwardData/data/CTPPS_Pixel_2018/CTPPS_Pixel_Assembly_Box_Real_103.xml', - 'Geometry/VeryForwardData/data/CTPPS_Pixel_2018/CTPPS_Pixel_Assembly_Box_Real_123.xml', - 'Geometry/VeryForwardData/data/CTPPS_Pixel_Sens.xml', - 'Geometry/VeryForwardData/data/CTPPS_2018/RP_Dist_Beam_Cent.xml', + 'Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Modules/v2/ppstrackerMaterials.xml', + 'Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Modules/v2/PPS_Pixel_Module_2x2_Run3.xml', + 'Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Modules/v2/PPS_Pixel_Sens.xml', + 'Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Assembly/v1/CTPPS_Pixel_Assembly_Box_Real_003.xml', + 'Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Assembly/v1/CTPPS_Pixel_Assembly_Box_Real_023.xml', + 'Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Assembly/v1/CTPPS_Pixel_Assembly_Box_Real_103.xml', + 'Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Assembly/v1/CTPPS_Pixel_Assembly_Box_Real_123.xml', + 'Geometry/VeryForwardData/data/CTPPS_2021/RP_Dist_Beam_Cent/Simu/v1/RP_Dist_Beam_Cent.xml', 'Geometry/EcalSimData/data/ecalsens.xml', 'Geometry/HcalCommonData/data/hcalsens/2021/v1/hcalsenspmf.xml', 'Geometry/HcalSimData/data/hf.xml', diff --git a/Geometry/CMSCommonData/python/cmsExtendedGeometry2021FlatMinus10PercentXML_cfi.py b/Geometry/CMSCommonData/python/cmsExtendedGeometry2021FlatMinus10PercentXML_cfi.py index 3421543e9b38c..e1ae94c3c4542 100644 --- a/Geometry/CMSCommonData/python/cmsExtendedGeometry2021FlatMinus10PercentXML_cfi.py +++ b/Geometry/CMSCommonData/python/cmsExtendedGeometry2021FlatMinus10PercentXML_cfi.py @@ -264,35 +264,33 @@ 'Geometry/ForwardCommonData/data/zdc/2021/v1/zdc.xml', 'Geometry/ForwardCommonData/data/zdclumi/2021/v2/zdclumi.xml', 'Geometry/ForwardCommonData/data/cmszdc.xml', - 'Geometry/ForwardCommonData/data/Run2/totemMaterials.xml', - 'Geometry/ForwardCommonData/data/totemRotations.xml', 'Geometry/VeryForwardData/data/RP_Box.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_000.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_001.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_002.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_003.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_004.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_005.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_020.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_021.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_022.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_023.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_024.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_025.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_100.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_101.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_102.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_103.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_104.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_105.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_120.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_121.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_122.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_123.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_124.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_125.xml', - 'Geometry/VeryForwardData/data/RP_Hybrid/v1/RP_Hybrid.xml', - 'Geometry/VeryForwardData/data/RP_Materials/v3/RP_Materials.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_000.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_001.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_002.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_003.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_004.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_005.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_020.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_021.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_022.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_023.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_024.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_025.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_100.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_101.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_102.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_103.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_104.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_105.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_120.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_121.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_122.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_123.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_124.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_125.xml', + 'Geometry/VeryForwardData/data/RP_Hybrid/v2/RP_Hybrid.xml', + 'Geometry/VeryForwardData/data/RP_Materials/v4/RP_Materials.xml', 'Geometry/VeryForwardData/data/RP_Transformations.xml', 'Geometry/VeryForwardData/data/RP_Detectors_Assembly.xml', 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_000.xml', @@ -302,7 +300,6 @@ 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_005.xml', 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_020.xml', 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_021.xml', - 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_022.xml', 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_024.xml', 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_025.xml', 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_100.xml', @@ -312,23 +309,22 @@ 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_105.xml', 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_120.xml', 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_121.xml', - 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_122.xml', 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_124.xml', 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_125.xml', - 'Geometry/VeryForwardData/data/RP_Device.xml', - 'Geometry/VeryForwardData/data/RP_Vertical_Device/2021/v1/RP_Vertical_Device.xml', - 'Geometry/VeryForwardData/data/RP_Horizontal_Device/2021/v1/RP_Horizontal_Device.xml', - 'Geometry/VeryForwardData/data/CTPPS_2018/CTPPS_220_Right_Station/v2/CTPPS_220_Right_Station.xml', - 'Geometry/VeryForwardData/data/CTPPS_2018/CTPPS_220_Left_Station/v2/CTPPS_220_Left_Station.xml', - 'Geometry/VeryForwardData/data/CTPPS_2018/CTPPS_210_Right_Station/v2/CTPPS_210_Right_Station.xml', - 'Geometry/VeryForwardData/data/CTPPS_2018/CTPPS_210_Left_Station/v2/CTPPS_210_Left_Station.xml', - 'Geometry/VeryForwardData/data/CTPPS_Stations_Assembly.xml', - 'Geometry/VeryForwardData/data/CTPPS_Cuts_Per_Region.xml', + 'Geometry/VeryForwardData/data/RP_Device/v1/RP_Device.xml', + 'Geometry/VeryForwardData/data/RP_Vertical_Device/2021/Simu/v2/RP_Vertical_Device.xml', + 'Geometry/VeryForwardData/data/RP_Horizontal_Device/2021/Simu/v2/RP_Horizontal_Device.xml', + 'Geometry/VeryForwardData/data/CTPPS_2021/Stations/Simu/v3/CTPPS_220_Right_Station.xml', + 'Geometry/VeryForwardData/data/CTPPS_2021/Stations/Simu/v3/CTPPS_220_Left_Station.xml', + 'Geometry/VeryForwardData/data/CTPPS_2021/Stations/Simu/v3/CTPPS_210_Right_Station.xml', + 'Geometry/VeryForwardData/data/CTPPS_2021/Stations/Simu/v3/CTPPS_210_Left_Station.xml', + 'Geometry/VeryForwardData/data/CTPPS_2021/Stations/Simu/v3/CTPPS_Stations_Assembly.xml', + 'Geometry/VeryForwardData/data/CTPPS_2021/Cuts_Per_Region/Simu/v1/CTPPS_Cuts_Per_Region.xml', 'Geometry/VeryForwardData/data/RP_Sensitive_Dets.xml', 'Geometry/VeryForwardData/data/CTPPS_Diamond_Transformations.xml', 'Geometry/VeryForwardData/data/CTPPS_Diamond_Parameters.xml', 'Geometry/VeryForwardData/data/CTPPS_Timing_Station_Parameters.xml', - 'Geometry/VeryForwardData/data/CTPPS_Timing_Horizontal_Pot/v1/CTPPS_Timing_Horizontal_Pot.xml', + 'Geometry/VeryForwardData/data/CTPPS_Timing_Horizontal_Pot/v2/CTPPS_Timing_Horizontal_Pot.xml', 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern1_Segment1.xml', 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern2_Segment1.xml', 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern2_Segment2.xml', @@ -341,21 +337,22 @@ 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern4_Segment3.xml', 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern4_Segment4.xml', 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern4_Segment5.xml', - 'Geometry/VeryForwardData/data/CTPPS_Diamond_2018/CTPPS_Diamond_Planes/CTPPS_Diamond_Plane1.xml', - 'Geometry/VeryForwardData/data/CTPPS_Diamond_2018/CTPPS_Diamond_Planes/CTPPS_Diamond_Plane2.xml', - 'Geometry/VeryForwardData/data/CTPPS_Diamond_2018/CTPPS_Diamond_Planes/CTPPS_Diamond_Plane3.xml', - 'Geometry/VeryForwardData/data/CTPPS_Diamond_2018/CTPPS_Diamond_Planes/CTPPS_Diamond_Plane4.xml', - 'Geometry/VeryForwardData/data/CTPPS_Diamond_2018/CTPPS_Diamond_Detector_Assembly/2021/v1/CTPPS_Diamond_Detector_Assembly.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_2021/CTPPS_Diamond_Planes/CTPPS_Diamond_Plane1.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_2021/CTPPS_Diamond_Planes/CTPPS_Diamond_Plane2.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_2021/CTPPS_Diamond_Planes/CTPPS_Diamond_Plane3.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_2021/CTPPS_Diamond_Planes/CTPPS_Diamond_Plane4.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_2021/CTPPS_Diamond_Detector_Assembly/v1/CTPPS_Diamond_Detector_Assembly.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_2021/Simu/v1/CTPPS_Detectors_Assembly_022.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_2021/Simu/v1/CTPPS_Detectors_Assembly_122.xml', 'Geometry/VeryForwardData/data/CTPPS_Diamond_Sensitive_Dets_TimingHits.xml', - 'Geometry/VeryForwardData/data/ppstrackerMaterials/v2/ppstrackerMaterials.xml', - 'Geometry/VeryForwardData/data/CTPPS_Pixel_Module/v3/CTPPS_Pixel_Module.xml', - 'Geometry/VeryForwardData/data/CTPPS_Pixel_Module_2x2/v3/CTPPS_Pixel_Module_2x2.xml', - 'Geometry/VeryForwardData/data/CTPPS_Pixel_2018/CTPPS_Pixel_Assembly_Box_Real_003.xml', - 'Geometry/VeryForwardData/data/CTPPS_Pixel_2018/CTPPS_Pixel_Assembly_Box_Real_023.xml', - 'Geometry/VeryForwardData/data/CTPPS_Pixel_2018/CTPPS_Pixel_Assembly_Box_Real_103.xml', - 'Geometry/VeryForwardData/data/CTPPS_Pixel_2018/CTPPS_Pixel_Assembly_Box_Real_123.xml', - 'Geometry/VeryForwardData/data/CTPPS_Pixel_Sens.xml', - 'Geometry/VeryForwardData/data/CTPPS_2018/RP_Dist_Beam_Cent.xml', + 'Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Modules/v2/ppstrackerMaterials.xml', + 'Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Modules/v2/PPS_Pixel_Module_2x2_Run3.xml', + 'Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Modules/v2/PPS_Pixel_Sens.xml', + 'Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Assembly/v1/CTPPS_Pixel_Assembly_Box_Real_003.xml', + 'Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Assembly/v1/CTPPS_Pixel_Assembly_Box_Real_023.xml', + 'Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Assembly/v1/CTPPS_Pixel_Assembly_Box_Real_103.xml', + 'Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Assembly/v1/CTPPS_Pixel_Assembly_Box_Real_123.xml', + 'Geometry/VeryForwardData/data/CTPPS_2021/RP_Dist_Beam_Cent/Simu/v1/RP_Dist_Beam_Cent.xml', 'Geometry/EcalSimData/data/ecalsens.xml', 'Geometry/HcalCommonData/data/hcalsens/2021/v1/hcalsenspmf.xml', 'Geometry/HcalSimData/data/hf.xml', diff --git a/Geometry/CMSCommonData/python/cmsExtendedGeometry2021FlatPlus05PercentXML_cfi.py b/Geometry/CMSCommonData/python/cmsExtendedGeometry2021FlatPlus05PercentXML_cfi.py index bf5635935257b..f428caa2944a6 100644 --- a/Geometry/CMSCommonData/python/cmsExtendedGeometry2021FlatPlus05PercentXML_cfi.py +++ b/Geometry/CMSCommonData/python/cmsExtendedGeometry2021FlatPlus05PercentXML_cfi.py @@ -264,35 +264,33 @@ 'Geometry/ForwardCommonData/data/zdc/2021/v1/zdc.xml', 'Geometry/ForwardCommonData/data/zdclumi/2021/v2/zdclumi.xml', 'Geometry/ForwardCommonData/data/cmszdc.xml', - 'Geometry/ForwardCommonData/data/Run2/totemMaterials.xml', - 'Geometry/ForwardCommonData/data/totemRotations.xml', 'Geometry/VeryForwardData/data/RP_Box.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_000.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_001.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_002.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_003.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_004.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_005.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_020.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_021.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_022.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_023.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_024.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_025.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_100.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_101.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_102.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_103.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_104.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_105.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_120.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_121.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_122.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_123.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_124.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_125.xml', - 'Geometry/VeryForwardData/data/RP_Hybrid/v1/RP_Hybrid.xml', - 'Geometry/VeryForwardData/data/RP_Materials/v3/RP_Materials.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_000.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_001.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_002.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_003.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_004.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_005.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_020.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_021.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_022.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_023.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_024.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_025.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_100.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_101.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_102.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_103.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_104.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_105.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_120.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_121.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_122.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_123.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_124.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_125.xml', + 'Geometry/VeryForwardData/data/RP_Hybrid/v2/RP_Hybrid.xml', + 'Geometry/VeryForwardData/data/RP_Materials/v4/RP_Materials.xml', 'Geometry/VeryForwardData/data/RP_Transformations.xml', 'Geometry/VeryForwardData/data/RP_Detectors_Assembly.xml', 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_000.xml', @@ -302,7 +300,6 @@ 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_005.xml', 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_020.xml', 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_021.xml', - 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_022.xml', 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_024.xml', 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_025.xml', 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_100.xml', @@ -312,23 +309,22 @@ 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_105.xml', 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_120.xml', 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_121.xml', - 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_122.xml', 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_124.xml', 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_125.xml', - 'Geometry/VeryForwardData/data/RP_Device.xml', - 'Geometry/VeryForwardData/data/RP_Vertical_Device/2021/v1/RP_Vertical_Device.xml', - 'Geometry/VeryForwardData/data/RP_Horizontal_Device/2021/v1/RP_Horizontal_Device.xml', - 'Geometry/VeryForwardData/data/CTPPS_2018/CTPPS_220_Right_Station/v2/CTPPS_220_Right_Station.xml', - 'Geometry/VeryForwardData/data/CTPPS_2018/CTPPS_220_Left_Station/v2/CTPPS_220_Left_Station.xml', - 'Geometry/VeryForwardData/data/CTPPS_2018/CTPPS_210_Right_Station/v2/CTPPS_210_Right_Station.xml', - 'Geometry/VeryForwardData/data/CTPPS_2018/CTPPS_210_Left_Station/v2/CTPPS_210_Left_Station.xml', - 'Geometry/VeryForwardData/data/CTPPS_Stations_Assembly.xml', - 'Geometry/VeryForwardData/data/CTPPS_Cuts_Per_Region.xml', + 'Geometry/VeryForwardData/data/RP_Device/v1/RP_Device.xml', + 'Geometry/VeryForwardData/data/RP_Vertical_Device/2021/Simu/v2/RP_Vertical_Device.xml', + 'Geometry/VeryForwardData/data/RP_Horizontal_Device/2021/Simu/v2/RP_Horizontal_Device.xml', + 'Geometry/VeryForwardData/data/CTPPS_2021/Stations/Simu/v3/CTPPS_220_Right_Station.xml', + 'Geometry/VeryForwardData/data/CTPPS_2021/Stations/Simu/v3/CTPPS_220_Left_Station.xml', + 'Geometry/VeryForwardData/data/CTPPS_2021/Stations/Simu/v3/CTPPS_210_Right_Station.xml', + 'Geometry/VeryForwardData/data/CTPPS_2021/Stations/Simu/v3/CTPPS_210_Left_Station.xml', + 'Geometry/VeryForwardData/data/CTPPS_2021/Stations/Simu/v3/CTPPS_Stations_Assembly.xml', + 'Geometry/VeryForwardData/data/CTPPS_2021/Cuts_Per_Region/Simu/v1/CTPPS_Cuts_Per_Region.xml', 'Geometry/VeryForwardData/data/RP_Sensitive_Dets.xml', 'Geometry/VeryForwardData/data/CTPPS_Diamond_Transformations.xml', 'Geometry/VeryForwardData/data/CTPPS_Diamond_Parameters.xml', 'Geometry/VeryForwardData/data/CTPPS_Timing_Station_Parameters.xml', - 'Geometry/VeryForwardData/data/CTPPS_Timing_Horizontal_Pot/v1/CTPPS_Timing_Horizontal_Pot.xml', + 'Geometry/VeryForwardData/data/CTPPS_Timing_Horizontal_Pot/v2/CTPPS_Timing_Horizontal_Pot.xml', 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern1_Segment1.xml', 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern2_Segment1.xml', 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern2_Segment2.xml', @@ -341,21 +337,22 @@ 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern4_Segment3.xml', 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern4_Segment4.xml', 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern4_Segment5.xml', - 'Geometry/VeryForwardData/data/CTPPS_Diamond_2018/CTPPS_Diamond_Planes/CTPPS_Diamond_Plane1.xml', - 'Geometry/VeryForwardData/data/CTPPS_Diamond_2018/CTPPS_Diamond_Planes/CTPPS_Diamond_Plane2.xml', - 'Geometry/VeryForwardData/data/CTPPS_Diamond_2018/CTPPS_Diamond_Planes/CTPPS_Diamond_Plane3.xml', - 'Geometry/VeryForwardData/data/CTPPS_Diamond_2018/CTPPS_Diamond_Planes/CTPPS_Diamond_Plane4.xml', - 'Geometry/VeryForwardData/data/CTPPS_Diamond_2018/CTPPS_Diamond_Detector_Assembly/2021/v1/CTPPS_Diamond_Detector_Assembly.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_2021/CTPPS_Diamond_Planes/CTPPS_Diamond_Plane1.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_2021/CTPPS_Diamond_Planes/CTPPS_Diamond_Plane2.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_2021/CTPPS_Diamond_Planes/CTPPS_Diamond_Plane3.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_2021/CTPPS_Diamond_Planes/CTPPS_Diamond_Plane4.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_2021/CTPPS_Diamond_Detector_Assembly/v1/CTPPS_Diamond_Detector_Assembly.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_2021/Simu/v1/CTPPS_Detectors_Assembly_022.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_2021/Simu/v1/CTPPS_Detectors_Assembly_122.xml', 'Geometry/VeryForwardData/data/CTPPS_Diamond_Sensitive_Dets_TimingHits.xml', - 'Geometry/VeryForwardData/data/ppstrackerMaterials/v2/ppstrackerMaterials.xml', - 'Geometry/VeryForwardData/data/CTPPS_Pixel_Module/v3/CTPPS_Pixel_Module.xml', - 'Geometry/VeryForwardData/data/CTPPS_Pixel_Module_2x2/v3/CTPPS_Pixel_Module_2x2.xml', - 'Geometry/VeryForwardData/data/CTPPS_Pixel_2018/CTPPS_Pixel_Assembly_Box_Real_003.xml', - 'Geometry/VeryForwardData/data/CTPPS_Pixel_2018/CTPPS_Pixel_Assembly_Box_Real_023.xml', - 'Geometry/VeryForwardData/data/CTPPS_Pixel_2018/CTPPS_Pixel_Assembly_Box_Real_103.xml', - 'Geometry/VeryForwardData/data/CTPPS_Pixel_2018/CTPPS_Pixel_Assembly_Box_Real_123.xml', - 'Geometry/VeryForwardData/data/CTPPS_Pixel_Sens.xml', - 'Geometry/VeryForwardData/data/CTPPS_2018/RP_Dist_Beam_Cent.xml', + 'Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Modules/v2/ppstrackerMaterials.xml', + 'Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Modules/v2/PPS_Pixel_Module_2x2_Run3.xml', + 'Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Modules/v2/PPS_Pixel_Sens.xml', + 'Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Assembly/v1/CTPPS_Pixel_Assembly_Box_Real_003.xml', + 'Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Assembly/v1/CTPPS_Pixel_Assembly_Box_Real_023.xml', + 'Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Assembly/v1/CTPPS_Pixel_Assembly_Box_Real_103.xml', + 'Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Assembly/v1/CTPPS_Pixel_Assembly_Box_Real_123.xml', + 'Geometry/VeryForwardData/data/CTPPS_2021/RP_Dist_Beam_Cent/Simu/v1/RP_Dist_Beam_Cent.xml', 'Geometry/EcalSimData/data/ecalsens.xml', 'Geometry/HcalCommonData/data/hcalsens/2021/v1/hcalsenspmf.xml', 'Geometry/HcalSimData/data/hf.xml', diff --git a/Geometry/CMSCommonData/python/cmsExtendedGeometry2021FlatPlus10PercentXML_cfi.py b/Geometry/CMSCommonData/python/cmsExtendedGeometry2021FlatPlus10PercentXML_cfi.py index 5c39d8884d31f..6526a5d00febd 100644 --- a/Geometry/CMSCommonData/python/cmsExtendedGeometry2021FlatPlus10PercentXML_cfi.py +++ b/Geometry/CMSCommonData/python/cmsExtendedGeometry2021FlatPlus10PercentXML_cfi.py @@ -264,35 +264,33 @@ 'Geometry/ForwardCommonData/data/zdc/2021/v1/zdc.xml', 'Geometry/ForwardCommonData/data/zdclumi/2021/v2/zdclumi.xml', 'Geometry/ForwardCommonData/data/cmszdc.xml', - 'Geometry/ForwardCommonData/data/Run2/totemMaterials.xml', - 'Geometry/ForwardCommonData/data/totemRotations.xml', 'Geometry/VeryForwardData/data/RP_Box.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_000.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_001.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_002.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_003.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_004.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_005.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_020.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_021.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_022.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_023.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_024.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_025.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_100.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_101.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_102.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_103.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_104.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_105.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_120.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_121.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_122.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_123.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_124.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_125.xml', - 'Geometry/VeryForwardData/data/RP_Hybrid/v1/RP_Hybrid.xml', - 'Geometry/VeryForwardData/data/RP_Materials/v3/RP_Materials.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_000.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_001.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_002.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_003.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_004.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_005.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_020.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_021.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_022.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_023.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_024.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_025.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_100.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_101.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_102.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_103.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_104.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_105.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_120.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_121.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_122.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_123.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_124.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_125.xml', + 'Geometry/VeryForwardData/data/RP_Hybrid/v2/RP_Hybrid.xml', + 'Geometry/VeryForwardData/data/RP_Materials/v4/RP_Materials.xml', 'Geometry/VeryForwardData/data/RP_Transformations.xml', 'Geometry/VeryForwardData/data/RP_Detectors_Assembly.xml', 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_000.xml', @@ -302,7 +300,6 @@ 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_005.xml', 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_020.xml', 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_021.xml', - 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_022.xml', 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_024.xml', 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_025.xml', 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_100.xml', @@ -312,23 +309,22 @@ 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_105.xml', 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_120.xml', 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_121.xml', - 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_122.xml', 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_124.xml', 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_125.xml', - 'Geometry/VeryForwardData/data/RP_Device.xml', - 'Geometry/VeryForwardData/data/RP_Vertical_Device/2021/v1/RP_Vertical_Device.xml', - 'Geometry/VeryForwardData/data/RP_Horizontal_Device/2021/v1/RP_Horizontal_Device.xml', - 'Geometry/VeryForwardData/data/CTPPS_2018/CTPPS_220_Right_Station/v2/CTPPS_220_Right_Station.xml', - 'Geometry/VeryForwardData/data/CTPPS_2018/CTPPS_220_Left_Station/v2/CTPPS_220_Left_Station.xml', - 'Geometry/VeryForwardData/data/CTPPS_2018/CTPPS_210_Right_Station/v2/CTPPS_210_Right_Station.xml', - 'Geometry/VeryForwardData/data/CTPPS_2018/CTPPS_210_Left_Station/v2/CTPPS_210_Left_Station.xml', - 'Geometry/VeryForwardData/data/CTPPS_Stations_Assembly.xml', - 'Geometry/VeryForwardData/data/CTPPS_Cuts_Per_Region.xml', + 'Geometry/VeryForwardData/data/RP_Device/v1/RP_Device.xml', + 'Geometry/VeryForwardData/data/RP_Vertical_Device/2021/Simu/v2/RP_Vertical_Device.xml', + 'Geometry/VeryForwardData/data/RP_Horizontal_Device/2021/Simu/v2/RP_Horizontal_Device.xml', + 'Geometry/VeryForwardData/data/CTPPS_2021/Stations/Simu/v3/CTPPS_220_Right_Station.xml', + 'Geometry/VeryForwardData/data/CTPPS_2021/Stations/Simu/v3/CTPPS_220_Left_Station.xml', + 'Geometry/VeryForwardData/data/CTPPS_2021/Stations/Simu/v3/CTPPS_210_Right_Station.xml', + 'Geometry/VeryForwardData/data/CTPPS_2021/Stations/Simu/v3/CTPPS_210_Left_Station.xml', + 'Geometry/VeryForwardData/data/CTPPS_2021/Stations/Simu/v3/CTPPS_Stations_Assembly.xml', + 'Geometry/VeryForwardData/data/CTPPS_2021/Cuts_Per_Region/Simu/v1/CTPPS_Cuts_Per_Region.xml', 'Geometry/VeryForwardData/data/RP_Sensitive_Dets.xml', 'Geometry/VeryForwardData/data/CTPPS_Diamond_Transformations.xml', 'Geometry/VeryForwardData/data/CTPPS_Diamond_Parameters.xml', 'Geometry/VeryForwardData/data/CTPPS_Timing_Station_Parameters.xml', - 'Geometry/VeryForwardData/data/CTPPS_Timing_Horizontal_Pot/v1/CTPPS_Timing_Horizontal_Pot.xml', + 'Geometry/VeryForwardData/data/CTPPS_Timing_Horizontal_Pot/v2/CTPPS_Timing_Horizontal_Pot.xml', 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern1_Segment1.xml', 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern2_Segment1.xml', 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern2_Segment2.xml', @@ -341,21 +337,22 @@ 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern4_Segment3.xml', 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern4_Segment4.xml', 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern4_Segment5.xml', - 'Geometry/VeryForwardData/data/CTPPS_Diamond_2018/CTPPS_Diamond_Planes/CTPPS_Diamond_Plane1.xml', - 'Geometry/VeryForwardData/data/CTPPS_Diamond_2018/CTPPS_Diamond_Planes/CTPPS_Diamond_Plane2.xml', - 'Geometry/VeryForwardData/data/CTPPS_Diamond_2018/CTPPS_Diamond_Planes/CTPPS_Diamond_Plane3.xml', - 'Geometry/VeryForwardData/data/CTPPS_Diamond_2018/CTPPS_Diamond_Planes/CTPPS_Diamond_Plane4.xml', - 'Geometry/VeryForwardData/data/CTPPS_Diamond_2018/CTPPS_Diamond_Detector_Assembly/2021/v1/CTPPS_Diamond_Detector_Assembly.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_2021/CTPPS_Diamond_Planes/CTPPS_Diamond_Plane1.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_2021/CTPPS_Diamond_Planes/CTPPS_Diamond_Plane2.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_2021/CTPPS_Diamond_Planes/CTPPS_Diamond_Plane3.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_2021/CTPPS_Diamond_Planes/CTPPS_Diamond_Plane4.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_2021/CTPPS_Diamond_Detector_Assembly/v1/CTPPS_Diamond_Detector_Assembly.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_2021/Simu/v1/CTPPS_Detectors_Assembly_022.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_2021/Simu/v1/CTPPS_Detectors_Assembly_122.xml', 'Geometry/VeryForwardData/data/CTPPS_Diamond_Sensitive_Dets_TimingHits.xml', - 'Geometry/VeryForwardData/data/ppstrackerMaterials/v2/ppstrackerMaterials.xml', - 'Geometry/VeryForwardData/data/CTPPS_Pixel_Module/v3/CTPPS_Pixel_Module.xml', - 'Geometry/VeryForwardData/data/CTPPS_Pixel_Module_2x2/v3/CTPPS_Pixel_Module_2x2.xml', - 'Geometry/VeryForwardData/data/CTPPS_Pixel_2018/CTPPS_Pixel_Assembly_Box_Real_003.xml', - 'Geometry/VeryForwardData/data/CTPPS_Pixel_2018/CTPPS_Pixel_Assembly_Box_Real_023.xml', - 'Geometry/VeryForwardData/data/CTPPS_Pixel_2018/CTPPS_Pixel_Assembly_Box_Real_103.xml', - 'Geometry/VeryForwardData/data/CTPPS_Pixel_2018/CTPPS_Pixel_Assembly_Box_Real_123.xml', - 'Geometry/VeryForwardData/data/CTPPS_Pixel_Sens.xml', - 'Geometry/VeryForwardData/data/CTPPS_2018/RP_Dist_Beam_Cent.xml', + 'Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Modules/v2/ppstrackerMaterials.xml', + 'Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Modules/v2/PPS_Pixel_Module_2x2_Run3.xml', + 'Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Modules/v2/PPS_Pixel_Sens.xml', + 'Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Assembly/v1/CTPPS_Pixel_Assembly_Box_Real_003.xml', + 'Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Assembly/v1/CTPPS_Pixel_Assembly_Box_Real_023.xml', + 'Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Assembly/v1/CTPPS_Pixel_Assembly_Box_Real_103.xml', + 'Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Assembly/v1/CTPPS_Pixel_Assembly_Box_Real_123.xml', + 'Geometry/VeryForwardData/data/CTPPS_2021/RP_Dist_Beam_Cent/Simu/v1/RP_Dist_Beam_Cent.xml', 'Geometry/EcalSimData/data/ecalsens.xml', 'Geometry/HcalCommonData/data/hcalsens/2021/v1/hcalsenspmf.xml', 'Geometry/HcalSimData/data/hf.xml', diff --git a/Geometry/CMSCommonData/python/cmsExtendedGeometry2021XML_cfi.py b/Geometry/CMSCommonData/python/cmsExtendedGeometry2021XML_cfi.py index f9b563cc5be65..b9882cdacf1ea 100644 --- a/Geometry/CMSCommonData/python/cmsExtendedGeometry2021XML_cfi.py +++ b/Geometry/CMSCommonData/python/cmsExtendedGeometry2021XML_cfi.py @@ -5,8 +5,8 @@ XMLIdealGeometryESSource = cms.ESSource("XMLIdealGeometryESSource", geomXMLFiles = cms.vstring( - 'Geometry/CMSCommonData/data/materials/2021/v2/materials.xml', - 'Geometry/TrackerCommonData/data/trackermaterial/2021/v1/trackermaterial.xml', + 'Geometry/CMSCommonData/data/materials/2021/v3/materials.xml', + 'Geometry/TrackerCommonData/data/trackermaterial/2021/v2/trackermaterial.xml', 'Geometry/CMSCommonData/data/rotations.xml', 'Geometry/CMSCommonData/data/extend/v3/cmsextent.xml', 'Geometry/CMSCommonData/data/cavernData/2021/v1/cavernData.xml', @@ -40,7 +40,7 @@ 'Geometry/TrackerCommonData/data/PhaseI/v2/pixfwdbladeInnerZminus.xml', 'Geometry/TrackerCommonData/data/PhaseI/v2/pixfwdbladeOuterZplus.xml', 'Geometry/TrackerCommonData/data/PhaseI/v2/pixfwdbladeOuterZminus.xml', - 'Geometry/TrackerCommonData/data/PhaseI/v2/pixbarmaterial.xml', + 'Geometry/TrackerCommonData/data/PhaseI/v3/pixbarmaterial.xml', 'Geometry/TrackerCommonData/data/PhaseI/v2/pixbarladder.xml', 'Geometry/TrackerCommonData/data/PhaseI/v2/pixbarladderfull0.xml', 'Geometry/TrackerCommonData/data/PhaseI/v2/pixbarladderfull1.xml', @@ -54,8 +54,8 @@ 'Geometry/TrackerCommonData/data/PhaseI/v2/pixbar.xml', 'Geometry/TrackerCommonData/data/Run2/trackerpatchpannel.xml', 'Geometry/TrackerCommonData/data/Run2/trackerpixelnose.xml', - 'Geometry/TrackerCommonData/data/tibtidcommonmaterial/2021/v1/tibtidcommonmaterial.xml', - 'Geometry/TrackerCommonData/data/tibmaterial/2021/v1/tibmaterial.xml', + 'Geometry/TrackerCommonData/data/tibtidcommonmaterial/2021/v2/tibtidcommonmaterial.xml', + 'Geometry/TrackerCommonData/data/tibmaterial/2021/v2/tibmaterial.xml', 'Geometry/TrackerCommonData/data/tibmodpar.xml', 'Geometry/TrackerCommonData/data/tibmodule0.xml', 'Geometry/TrackerCommonData/data/tibmodule0a.xml', @@ -88,7 +88,7 @@ 'Geometry/TrackerCommonData/data/tiblayer2.xml', 'Geometry/TrackerCommonData/data/tiblayer3.xml', 'Geometry/TrackerCommonData/data/tib.xml', - 'Geometry/TrackerCommonData/data/tidmaterial/2021/v1/tidmaterial.xml', + 'Geometry/TrackerCommonData/data/tidmaterial/2021/v2/tidmaterial.xml', 'Geometry/TrackerCommonData/data/tidmodpar.xml', 'Geometry/TrackerCommonData/data/tidmodule0.xml', 'Geometry/TrackerCommonData/data/tidmodule0r.xml', @@ -111,7 +111,7 @@ 'Geometry/TrackerCommonData/data/tibtidservices.xml', 'Geometry/TrackerCommonData/data/tibtidservicesf.xml', 'Geometry/TrackerCommonData/data/tibtidservicesb.xml', - 'Geometry/TrackerCommonData/data/tobmaterial/2021/v1/tobmaterial.xml', + 'Geometry/TrackerCommonData/data/tobmaterial/2021/v2/tobmaterial.xml', 'Geometry/TrackerCommonData/data/tobmodpar.xml', 'Geometry/TrackerCommonData/data/tobmodule0.xml', 'Geometry/TrackerCommonData/data/tobmodule2.xml', @@ -264,35 +264,33 @@ 'Geometry/ForwardCommonData/data/zdc/2021/v1/zdc.xml', 'Geometry/ForwardCommonData/data/zdclumi/2021/v2/zdclumi.xml', 'Geometry/ForwardCommonData/data/cmszdc.xml', - 'Geometry/ForwardCommonData/data/Run2/totemMaterials.xml', - 'Geometry/ForwardCommonData/data/totemRotations.xml', 'Geometry/VeryForwardData/data/RP_Box.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_000.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_001.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_002.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_003.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_004.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_005.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_020.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_021.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_022.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_023.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_024.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_025.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_100.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_101.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_102.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_103.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_104.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_105.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_120.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_121.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_122.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_123.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_124.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_125.xml', - 'Geometry/VeryForwardData/data/RP_Hybrid/v1/RP_Hybrid.xml', - 'Geometry/VeryForwardData/data/RP_Materials/v3/RP_Materials.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_000.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_001.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_002.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_003.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_004.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_005.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_020.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_021.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_022.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_023.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_024.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_025.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_100.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_101.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_102.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_103.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_104.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_105.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_120.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_121.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_122.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_123.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_124.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_125.xml', + 'Geometry/VeryForwardData/data/RP_Hybrid/v2/RP_Hybrid.xml', + 'Geometry/VeryForwardData/data/RP_Materials/v4/RP_Materials.xml', 'Geometry/VeryForwardData/data/RP_Transformations.xml', 'Geometry/VeryForwardData/data/RP_Detectors_Assembly.xml', 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_000.xml', @@ -302,7 +300,6 @@ 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_005.xml', 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_020.xml', 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_021.xml', - 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_022.xml', 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_024.xml', 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_025.xml', 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_100.xml', @@ -312,23 +309,22 @@ 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_105.xml', 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_120.xml', 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_121.xml', - 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_122.xml', 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_124.xml', 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_125.xml', - 'Geometry/VeryForwardData/data/RP_Device.xml', - 'Geometry/VeryForwardData/data/RP_Vertical_Device/2021/v1/RP_Vertical_Device.xml', - 'Geometry/VeryForwardData/data/RP_Horizontal_Device/2021/v1/RP_Horizontal_Device.xml', - 'Geometry/VeryForwardData/data/CTPPS_2018/CTPPS_220_Right_Station/v2/CTPPS_220_Right_Station.xml', - 'Geometry/VeryForwardData/data/CTPPS_2018/CTPPS_220_Left_Station/v2/CTPPS_220_Left_Station.xml', - 'Geometry/VeryForwardData/data/CTPPS_2018/CTPPS_210_Right_Station/v2/CTPPS_210_Right_Station.xml', - 'Geometry/VeryForwardData/data/CTPPS_2018/CTPPS_210_Left_Station/v2/CTPPS_210_Left_Station.xml', - 'Geometry/VeryForwardData/data/CTPPS_Stations_Assembly.xml', - 'Geometry/VeryForwardData/data/CTPPS_Cuts_Per_Region.xml', + 'Geometry/VeryForwardData/data/RP_Device/v1/RP_Device.xml', + 'Geometry/VeryForwardData/data/RP_Vertical_Device/2021/Simu/v2/RP_Vertical_Device.xml', + 'Geometry/VeryForwardData/data/RP_Horizontal_Device/2021/Simu/v2/RP_Horizontal_Device.xml', + 'Geometry/VeryForwardData/data/CTPPS_2021/Stations/Simu/v3/CTPPS_220_Right_Station.xml', + 'Geometry/VeryForwardData/data/CTPPS_2021/Stations/Simu/v3/CTPPS_220_Left_Station.xml', + 'Geometry/VeryForwardData/data/CTPPS_2021/Stations/Simu/v3/CTPPS_210_Right_Station.xml', + 'Geometry/VeryForwardData/data/CTPPS_2021/Stations/Simu/v3/CTPPS_210_Left_Station.xml', + 'Geometry/VeryForwardData/data/CTPPS_2021/Stations/Simu/v3/CTPPS_Stations_Assembly.xml', + 'Geometry/VeryForwardData/data/CTPPS_2021/Cuts_Per_Region/Simu/v1/CTPPS_Cuts_Per_Region.xml', 'Geometry/VeryForwardData/data/RP_Sensitive_Dets.xml', 'Geometry/VeryForwardData/data/CTPPS_Diamond_Transformations.xml', 'Geometry/VeryForwardData/data/CTPPS_Diamond_Parameters.xml', 'Geometry/VeryForwardData/data/CTPPS_Timing_Station_Parameters.xml', - 'Geometry/VeryForwardData/data/CTPPS_Timing_Horizontal_Pot/v1/CTPPS_Timing_Horizontal_Pot.xml', + 'Geometry/VeryForwardData/data/CTPPS_Timing_Horizontal_Pot/v2/CTPPS_Timing_Horizontal_Pot.xml', 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern1_Segment1.xml', 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern2_Segment1.xml', 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern2_Segment2.xml', @@ -341,21 +337,22 @@ 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern4_Segment3.xml', 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern4_Segment4.xml', 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern4_Segment5.xml', - 'Geometry/VeryForwardData/data/CTPPS_Diamond_2018/CTPPS_Diamond_Planes/CTPPS_Diamond_Plane1.xml', - 'Geometry/VeryForwardData/data/CTPPS_Diamond_2018/CTPPS_Diamond_Planes/CTPPS_Diamond_Plane2.xml', - 'Geometry/VeryForwardData/data/CTPPS_Diamond_2018/CTPPS_Diamond_Planes/CTPPS_Diamond_Plane3.xml', - 'Geometry/VeryForwardData/data/CTPPS_Diamond_2018/CTPPS_Diamond_Planes/CTPPS_Diamond_Plane4.xml', - 'Geometry/VeryForwardData/data/CTPPS_Diamond_2018/CTPPS_Diamond_Detector_Assembly/2021/v1/CTPPS_Diamond_Detector_Assembly.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_2021/CTPPS_Diamond_Planes/CTPPS_Diamond_Plane1.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_2021/CTPPS_Diamond_Planes/CTPPS_Diamond_Plane2.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_2021/CTPPS_Diamond_Planes/CTPPS_Diamond_Plane3.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_2021/CTPPS_Diamond_Planes/CTPPS_Diamond_Plane4.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_2021/CTPPS_Diamond_Detector_Assembly/v1/CTPPS_Diamond_Detector_Assembly.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_2021/Simu/v1/CTPPS_Detectors_Assembly_022.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_2021/Simu/v1/CTPPS_Detectors_Assembly_122.xml', 'Geometry/VeryForwardData/data/CTPPS_Diamond_Sensitive_Dets_TimingHits.xml', - 'Geometry/VeryForwardData/data/ppstrackerMaterials/v2/ppstrackerMaterials.xml', - 'Geometry/VeryForwardData/data/CTPPS_Pixel_Module/v3/CTPPS_Pixel_Module.xml', - 'Geometry/VeryForwardData/data/CTPPS_Pixel_Module_2x2/v3/CTPPS_Pixel_Module_2x2.xml', - 'Geometry/VeryForwardData/data/CTPPS_Pixel_2018/CTPPS_Pixel_Assembly_Box_Real_003.xml', - 'Geometry/VeryForwardData/data/CTPPS_Pixel_2018/CTPPS_Pixel_Assembly_Box_Real_023.xml', - 'Geometry/VeryForwardData/data/CTPPS_Pixel_2018/CTPPS_Pixel_Assembly_Box_Real_103.xml', - 'Geometry/VeryForwardData/data/CTPPS_Pixel_2018/CTPPS_Pixel_Assembly_Box_Real_123.xml', - 'Geometry/VeryForwardData/data/CTPPS_Pixel_Sens.xml', - 'Geometry/VeryForwardData/data/CTPPS_2018/RP_Dist_Beam_Cent.xml', + 'Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Modules/v2/ppstrackerMaterials.xml', + 'Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Modules/v2/PPS_Pixel_Module_2x2_Run3.xml', + 'Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Modules/v2/PPS_Pixel_Sens.xml', + 'Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Assembly/v1/CTPPS_Pixel_Assembly_Box_Real_003.xml', + 'Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Assembly/v1/CTPPS_Pixel_Assembly_Box_Real_023.xml', + 'Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Assembly/v1/CTPPS_Pixel_Assembly_Box_Real_103.xml', + 'Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Assembly/v1/CTPPS_Pixel_Assembly_Box_Real_123.xml', + 'Geometry/VeryForwardData/data/CTPPS_2021/RP_Dist_Beam_Cent/Simu/v1/RP_Dist_Beam_Cent.xml', 'Geometry/EcalSimData/data/ecalsens.xml', 'Geometry/HcalCommonData/data/hcalsens/2021/v1/hcalsenspmf.xml', 'Geometry/HcalSimData/data/hf.xml', diff --git a/Geometry/CMSCommonData/python/cmsExtendedGeometry2021ZeroMaterialXML_cfi.py b/Geometry/CMSCommonData/python/cmsExtendedGeometry2021ZeroMaterialXML_cfi.py index fa1db67bae0d7..df12abc056279 100644 --- a/Geometry/CMSCommonData/python/cmsExtendedGeometry2021ZeroMaterialXML_cfi.py +++ b/Geometry/CMSCommonData/python/cmsExtendedGeometry2021ZeroMaterialXML_cfi.py @@ -264,35 +264,33 @@ 'Geometry/ForwardCommonData/data/zdc/2021/v1/zdc.xml', 'Geometry/ForwardCommonData/data/zdclumi/2021/v2/zdclumi.xml', 'Geometry/ForwardCommonData/data/cmszdc.xml', - 'Geometry/ForwardCommonData/data/Run2/totemMaterials.xml', - 'Geometry/ForwardCommonData/data/totemRotations.xml', 'Geometry/VeryForwardData/data/RP_Box.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_000.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_001.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_002.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_003.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_004.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_005.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_020.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_021.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_022.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_023.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_024.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_025.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_100.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_101.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_102.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_103.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_104.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_105.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_120.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_121.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_122.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_123.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_124.xml', - 'Geometry/VeryForwardData/data/RP_Box/v2/RP_Box_125.xml', - 'Geometry/VeryForwardData/data/RP_Hybrid/v1/RP_Hybrid.xml', - 'Geometry/VeryForwardData/data/RP_Materials/v3/RP_Materials.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_000.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_001.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_002.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_003.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_004.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_005.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_020.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_021.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_022.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_023.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_024.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_025.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_100.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_101.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_102.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_103.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_104.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_105.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_120.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_121.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_122.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_123.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_124.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_125.xml', + 'Geometry/VeryForwardData/data/RP_Hybrid/v2/RP_Hybrid.xml', + 'Geometry/VeryForwardData/data/RP_Materials/v4/RP_Materials.xml', 'Geometry/VeryForwardData/data/RP_Transformations.xml', 'Geometry/VeryForwardData/data/RP_Detectors_Assembly.xml', 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_000.xml', @@ -302,7 +300,6 @@ 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_005.xml', 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_020.xml', 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_021.xml', - 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_022.xml', 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_024.xml', 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_025.xml', 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_100.xml', @@ -312,23 +309,22 @@ 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_105.xml', 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_120.xml', 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_121.xml', - 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_122.xml', 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_124.xml', 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_125.xml', - 'Geometry/VeryForwardData/data/RP_Device.xml', - 'Geometry/VeryForwardData/data/RP_Vertical_Device/2021/v1/RP_Vertical_Device.xml', - 'Geometry/VeryForwardData/data/RP_Horizontal_Device/2021/v1/RP_Horizontal_Device.xml', - 'Geometry/VeryForwardData/data/CTPPS_2018/CTPPS_220_Right_Station/v2/CTPPS_220_Right_Station.xml', - 'Geometry/VeryForwardData/data/CTPPS_2018/CTPPS_220_Left_Station/v2/CTPPS_220_Left_Station.xml', - 'Geometry/VeryForwardData/data/CTPPS_2018/CTPPS_210_Right_Station/v2/CTPPS_210_Right_Station.xml', - 'Geometry/VeryForwardData/data/CTPPS_2018/CTPPS_210_Left_Station/v2/CTPPS_210_Left_Station.xml', - 'Geometry/VeryForwardData/data/CTPPS_Stations_Assembly.xml', - 'Geometry/VeryForwardData/data/CTPPS_Cuts_Per_Region.xml', + 'Geometry/VeryForwardData/data/RP_Device/v1/RP_Device.xml', + 'Geometry/VeryForwardData/data/RP_Vertical_Device/2021/Simu/v2/RP_Vertical_Device.xml', + 'Geometry/VeryForwardData/data/RP_Horizontal_Device/2021/Simu/v2/RP_Horizontal_Device.xml', + 'Geometry/VeryForwardData/data/CTPPS_2021/Stations/Simu/v3/CTPPS_220_Right_Station.xml', + 'Geometry/VeryForwardData/data/CTPPS_2021/Stations/Simu/v3/CTPPS_220_Left_Station.xml', + 'Geometry/VeryForwardData/data/CTPPS_2021/Stations/Simu/v3/CTPPS_210_Right_Station.xml', + 'Geometry/VeryForwardData/data/CTPPS_2021/Stations/Simu/v3/CTPPS_210_Left_Station.xml', + 'Geometry/VeryForwardData/data/CTPPS_2021/Stations/Simu/v3/CTPPS_Stations_Assembly.xml', + 'Geometry/VeryForwardData/data/CTPPS_2021/Cuts_Per_Region/Simu/v1/CTPPS_Cuts_Per_Region.xml', 'Geometry/VeryForwardData/data/RP_Sensitive_Dets.xml', 'Geometry/VeryForwardData/data/CTPPS_Diamond_Transformations.xml', 'Geometry/VeryForwardData/data/CTPPS_Diamond_Parameters.xml', 'Geometry/VeryForwardData/data/CTPPS_Timing_Station_Parameters.xml', - 'Geometry/VeryForwardData/data/CTPPS_Timing_Horizontal_Pot/v1/CTPPS_Timing_Horizontal_Pot.xml', + 'Geometry/VeryForwardData/data/CTPPS_Timing_Horizontal_Pot/v2/CTPPS_Timing_Horizontal_Pot.xml', 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern1_Segment1.xml', 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern2_Segment1.xml', 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern2_Segment2.xml', @@ -341,21 +337,22 @@ 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern4_Segment3.xml', 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern4_Segment4.xml', 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern4_Segment5.xml', - 'Geometry/VeryForwardData/data/CTPPS_Diamond_2018/CTPPS_Diamond_Planes/CTPPS_Diamond_Plane1.xml', - 'Geometry/VeryForwardData/data/CTPPS_Diamond_2018/CTPPS_Diamond_Planes/CTPPS_Diamond_Plane2.xml', - 'Geometry/VeryForwardData/data/CTPPS_Diamond_2018/CTPPS_Diamond_Planes/CTPPS_Diamond_Plane3.xml', - 'Geometry/VeryForwardData/data/CTPPS_Diamond_2018/CTPPS_Diamond_Planes/CTPPS_Diamond_Plane4.xml', - 'Geometry/VeryForwardData/data/CTPPS_Diamond_2018/CTPPS_Diamond_Detector_Assembly/2021/v1/CTPPS_Diamond_Detector_Assembly.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_2021/CTPPS_Diamond_Planes/CTPPS_Diamond_Plane1.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_2021/CTPPS_Diamond_Planes/CTPPS_Diamond_Plane2.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_2021/CTPPS_Diamond_Planes/CTPPS_Diamond_Plane3.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_2021/CTPPS_Diamond_Planes/CTPPS_Diamond_Plane4.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_2021/CTPPS_Diamond_Detector_Assembly/v1/CTPPS_Diamond_Detector_Assembly.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_2021/Simu/v1/CTPPS_Detectors_Assembly_022.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_2021/Simu/v1/CTPPS_Detectors_Assembly_122.xml', 'Geometry/VeryForwardData/data/CTPPS_Diamond_Sensitive_Dets_TimingHits.xml', - 'Geometry/VeryForwardData/data/ppstrackerMaterials/v2/ppstrackerMaterials.xml', - 'Geometry/VeryForwardData/data/CTPPS_Pixel_Module/v3/CTPPS_Pixel_Module.xml', - 'Geometry/VeryForwardData/data/CTPPS_Pixel_Module_2x2/v3/CTPPS_Pixel_Module_2x2.xml', - 'Geometry/VeryForwardData/data/CTPPS_Pixel_2018/CTPPS_Pixel_Assembly_Box_Real_003.xml', - 'Geometry/VeryForwardData/data/CTPPS_Pixel_2018/CTPPS_Pixel_Assembly_Box_Real_023.xml', - 'Geometry/VeryForwardData/data/CTPPS_Pixel_2018/CTPPS_Pixel_Assembly_Box_Real_103.xml', - 'Geometry/VeryForwardData/data/CTPPS_Pixel_2018/CTPPS_Pixel_Assembly_Box_Real_123.xml', - 'Geometry/VeryForwardData/data/CTPPS_Pixel_Sens.xml', - 'Geometry/VeryForwardData/data/CTPPS_2018/RP_Dist_Beam_Cent.xml', + 'Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Modules/v2/ppstrackerMaterials.xml', + 'Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Modules/v2/PPS_Pixel_Module_2x2_Run3.xml', + 'Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Modules/v2/PPS_Pixel_Sens.xml', + 'Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Assembly/v1/CTPPS_Pixel_Assembly_Box_Real_003.xml', + 'Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Assembly/v1/CTPPS_Pixel_Assembly_Box_Real_023.xml', + 'Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Assembly/v1/CTPPS_Pixel_Assembly_Box_Real_103.xml', + 'Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Assembly/v1/CTPPS_Pixel_Assembly_Box_Real_123.xml', + 'Geometry/VeryForwardData/data/CTPPS_2021/RP_Dist_Beam_Cent/Simu/v1/RP_Dist_Beam_Cent.xml', 'Geometry/EcalSimData/data/ecalsens.xml', 'Geometry/HcalCommonData/data/hcalsens/2021/v1/hcalsenspmf.xml', 'Geometry/HcalSimData/data/hf.xml', diff --git a/Geometry/CMSCommonData/python/cmsExtendedGeometry2026D86XML_cfi.py b/Geometry/CMSCommonData/python/cmsExtendedGeometry2026D86XML_cfi.py index aaed012b14ef0..965b77ff33df9 100644 --- a/Geometry/CMSCommonData/python/cmsExtendedGeometry2026D86XML_cfi.py +++ b/Geometry/CMSCommonData/python/cmsExtendedGeometry2026D86XML_cfi.py @@ -45,7 +45,7 @@ 'Geometry/TrackerSimData/data/trackerProdCutsBEAM.xml', 'Geometry/EcalCommonData/data/eregalgo/2026/v2/eregalgo.xml', 'Geometry/EcalCommonData/data/ectkcable/2026/v1/ectkcable.xml', - 'Geometry/EcalCommonData/data/ectkcablemat/2026/v1/ectkcablemat.xml', + 'Geometry/EcalCommonData/data/ectkcablemat/2026/v2/ectkcablemat.xml', 'Geometry/EcalCommonData/data/ebalgo.xml', 'Geometry/EcalCommonData/data/ebcon/2021/v1/ebcon.xml', 'Geometry/EcalCommonData/data/ebrot.xml', diff --git a/Geometry/CSCGeometry/src/CSCWireGrouping.h b/Geometry/CSCGeometry/interface/CSCWireGrouping.h similarity index 100% rename from Geometry/CSCGeometry/src/CSCWireGrouping.h rename to Geometry/CSCGeometry/interface/CSCWireGrouping.h diff --git a/Geometry/CSCGeometry/interface/CSCWireTopology.h b/Geometry/CSCGeometry/interface/CSCWireTopology.h index afcb2d7b94807..14dc2c4cd5774 100644 --- a/Geometry/CSCGeometry/interface/CSCWireTopology.h +++ b/Geometry/CSCGeometry/interface/CSCWireTopology.h @@ -11,7 +11,7 @@ #include "Geometry/CSCGeometry/interface/WireTopology.h" #include "Geometry/CSCGeometry/interface/CSCWireGeometry.h" -#include "Geometry/CSCGeometry/src/CSCWireGrouping.h" +#include "Geometry/CSCGeometry/interface/CSCWireGrouping.h" #include "Geometry/CSCGeometry/interface/CSCWireGroupPackage.h" #include // for std::pair diff --git a/Geometry/CSCGeometry/src/CSCGangedWireGrouping.h b/Geometry/CSCGeometry/src/CSCGangedWireGrouping.h index c8bb22942a563..c81693675529f 100644 --- a/Geometry/CSCGeometry/src/CSCGangedWireGrouping.h +++ b/Geometry/CSCGeometry/src/CSCGangedWireGrouping.h @@ -12,7 +12,7 @@ * */ -#include "Geometry/CSCGeometry/src/CSCWireGrouping.h" +#include "Geometry/CSCGeometry/interface/CSCWireGrouping.h" #include class CSCGangedWireGrouping : public CSCWireGrouping { diff --git a/Geometry/CSCGeometry/src/CSCUngangedWireGrouping.h b/Geometry/CSCGeometry/src/CSCUngangedWireGrouping.h index d278e4cb8d1d9..c75ee94dcb020 100644 --- a/Geometry/CSCGeometry/src/CSCUngangedWireGrouping.h +++ b/Geometry/CSCGeometry/src/CSCUngangedWireGrouping.h @@ -8,13 +8,12 @@ * */ -#include "Geometry/CSCGeometry/src/CSCWireGrouping.h" +#include "Geometry/CSCGeometry/interface/CSCWireGrouping.h" class CSCUngangedWireGrouping : public CSCWireGrouping { - public: +public: virtual ~CSCUngangedWireGrouping() {} - explicit CSCUngangedWireGrouping( int nwires ) : - theNumberOfWires( nwires ) {} + explicit CSCUngangedWireGrouping(int nwires) : theNumberOfWires(nwires) {} /** * Total number of (virtual) wires. @@ -22,26 +21,22 @@ class CSCUngangedWireGrouping : public CSCWireGrouping { * This is the number which would fill the region covered * by wires, assuming the constant wire spacing. */ - int numberOfWires() const { - return theNumberOfWires; } + int numberOfWires() const { return theNumberOfWires; } /** * How many wire groups. Unganged so #groups = #wires. */ - int numberOfWireGroups() const { - return numberOfWires(); } + int numberOfWireGroups() const { return numberOfWires(); } /** * How many wires in a wiregroup. Unganged so 1 wire/group. */ - int numberOfWiresPerGroup( int wireGroup ) const { - return 1; } + int numberOfWiresPerGroup(int wireGroup) const { return 1; } /** * Wire group containing a given wire. Unganged means wire group is wire. */ - int wireGroup(int wire) const { - return wire; } + int wireGroup(int wire) const { return wire; } /** * Middle of wire-group. @@ -50,20 +45,16 @@ class CSCUngangedWireGrouping : public CSCWireGrouping { * Accordingly, it is non-integer. * Unganged, wire group is wire is middle! */ - float middleWireOfGroup( int wireGroup ) const { - return static_cast( wireGroup ); } + float middleWireOfGroup(int wireGroup) const { return static_cast(wireGroup); } - /** + /** * Clone to handle correct copy of component objects referenced * by base class pointer. */ - CSCWireGrouping* clone() const { - return new CSCUngangedWireGrouping(*this); - } + CSCWireGrouping* clone() const { return new CSCUngangedWireGrouping(*this); } - private: +private: int theNumberOfWires; - }; #endif diff --git a/Geometry/CommonTopologies/test/ValidateRadial.cc b/Geometry/CommonTopologies/test/ValidateRadial.cc index f23d65b092620..eb811cdd98ddf 100644 --- a/Geometry/CommonTopologies/test/ValidateRadial.cc +++ b/Geometry/CommonTopologies/test/ValidateRadial.cc @@ -7,7 +7,6 @@ #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h" #include "Geometry/TrackerGeometryBuilder/interface/ProxyStripTopology.h" #include "Geometry/CommonTopologies/interface/TkRadialStripTopology.h" -#include "boost/lexical_cast.hpp" #include "TFile.h" #include "TProfile.h" diff --git a/Geometry/EcalCommonData/data/ectkcablemat/2026/v2/ectkcablemat.xml b/Geometry/EcalCommonData/data/ectkcablemat/2026/v2/ectkcablemat.xml new file mode 100644 index 0000000000000..cd51c633bb87e --- /dev/null +++ b/Geometry/EcalCommonData/data/ectkcablemat/2026/v2/ectkcablemat.xml @@ -0,0 +1,154 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Geometry/HcalCommonData/python/hcalDDDSimConstants_cff.py b/Geometry/HcalCommonData/python/hcalDDDSimConstants_cff.py index ed450728bbf4e..50663626e0dfd 100644 --- a/Geometry/HcalCommonData/python/hcalDDDSimConstants_cff.py +++ b/Geometry/HcalCommonData/python/hcalDDDSimConstants_cff.py @@ -4,4 +4,4 @@ from Geometry.HcalCommonData.hcalSimulationParameters_cff import * from Geometry.HcalCommonData.hcalSimulationConstants_cfi import * from Geometry.HcalCommonData.caloSimulationParameters_cff import * -from Geometry.HcalCommonData.hcalDDDSimConstants_cfi import * +from Geometry.HcalCommonData.hcalDBConstants_cff import * diff --git a/Geometry/HcalCommonData/python/hcalSimDBConstants_cff.py b/Geometry/HcalCommonData/python/hcalSimDBConstants_cff.py index b9c2efa9f9e2b..bc851f1c7a76a 100644 --- a/Geometry/HcalCommonData/python/hcalSimDBConstants_cff.py +++ b/Geometry/HcalCommonData/python/hcalSimDBConstants_cff.py @@ -4,5 +4,3 @@ from Geometry.HcalCommonData.hcalSimulationConstants_cfi import * from Geometry.HcalCommonData.hcalDBConstants_cff import * from Geometry.HcalCommonData.caloSimulationParameters_cff import * -from Geometry.HcalCommonData.hcalDDDSimConstants_cfi import * -from Geometry.HcalCommonData.hcalDDDRecConstants_cfi import * diff --git a/Geometry/HcalCommonData/src/HcalDDDRecConstants.cc b/Geometry/HcalCommonData/src/HcalDDDRecConstants.cc index 5f3abf37f5ea1..aacc352ce8d51 100644 --- a/Geometry/HcalCommonData/src/HcalDDDRecConstants.cc +++ b/Geometry/HcalCommonData/src/HcalDDDRecConstants.cc @@ -5,6 +5,7 @@ #include "DataFormats/Math/interface/GeantUnits.h" #include "CLHEP/Units/GlobalPhysicalConstants.h" #include "CLHEP/Units/GlobalSystemOfUnits.h" +#include #include //#define EDM_ML_DEBUG diff --git a/Geometry/HcalSimData/python/HFParameters_cff.py b/Geometry/HcalSimData/python/HFParameters_cff.py index b126e42e620f5..a4c925fd28075 100644 --- a/Geometry/HcalSimData/python/HFParameters_cff.py +++ b/Geometry/HcalSimData/python/HFParameters_cff.py @@ -33,5 +33,5 @@ ## Change for the new HFShowerLibrary file to be used for Run 3 ## from Configuration.Eras.Modifier_run3_HFSL_cff import run3_HFSL -run3_HFSL.toModify( HFLibraryFileBlock, FileName = 'SimG4CMS/Calo/data/HFShowerLibrary_run3_v5.root', FileVersion = 1 ) +run3_HFSL.toModify( HFLibraryFileBlock, FileName = 'SimG4CMS/Calo/data/HFShowerLibrary_run3_v6.root', FileVersion = 2 ) run3_HFSL.toModify( HFShowerBlock, EqualizeTimeShift = True ) diff --git a/Geometry/MuonNumbering/src/LevelBaseNumber.h b/Geometry/MuonNumbering/interface/LevelBaseNumber.h similarity index 100% rename from Geometry/MuonNumbering/src/LevelBaseNumber.h rename to Geometry/MuonNumbering/interface/LevelBaseNumber.h diff --git a/Geometry/MuonNumbering/interface/MuonBaseNumber.h b/Geometry/MuonNumbering/interface/MuonBaseNumber.h index d9378f4028aa0..d248297befc33 100644 --- a/Geometry/MuonNumbering/interface/MuonBaseNumber.h +++ b/Geometry/MuonNumbering/interface/MuonBaseNumber.h @@ -16,7 +16,7 @@ #include -#include "Geometry/MuonNumbering/src/LevelBaseNumber.h" +#include "Geometry/MuonNumbering/interface/LevelBaseNumber.h" class MuonBaseNumber { public: diff --git a/Geometry/TrackerCommonData/data/FlatMinus05Percent/2021/v2/tibmaterial.xml b/Geometry/TrackerCommonData/data/FlatMinus05Percent/2021/v2/tibmaterial.xml new file mode 100644 index 0000000000000..ec561662889c4 --- /dev/null +++ b/Geometry/TrackerCommonData/data/FlatMinus05Percent/2021/v2/tibmaterial.xml @@ -0,0 +1,326 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Geometry/TrackerCommonData/data/FlatMinus05Percent/2021/v2/tibtidcommonmaterial.xml b/Geometry/TrackerCommonData/data/FlatMinus05Percent/2021/v2/tibtidcommonmaterial.xml new file mode 100644 index 0000000000000..0b09f69dfefb1 --- /dev/null +++ b/Geometry/TrackerCommonData/data/FlatMinus05Percent/2021/v2/tibtidcommonmaterial.xml @@ -0,0 +1,486 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Geometry/TrackerCommonData/data/FlatMinus05Percent/2021/v2/tidmaterial.xml b/Geometry/TrackerCommonData/data/FlatMinus05Percent/2021/v2/tidmaterial.xml new file mode 100644 index 0000000000000..e4f8a64362ef1 --- /dev/null +++ b/Geometry/TrackerCommonData/data/FlatMinus05Percent/2021/v2/tidmaterial.xml @@ -0,0 +1,259 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Geometry/TrackerCommonData/data/FlatMinus05Percent/2021/v2/tobmaterial.xml b/Geometry/TrackerCommonData/data/FlatMinus05Percent/2021/v2/tobmaterial.xml new file mode 100644 index 0000000000000..5b5308affed2f --- /dev/null +++ b/Geometry/TrackerCommonData/data/FlatMinus05Percent/2021/v2/tobmaterial.xml @@ -0,0 +1,1648 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Geometry/TrackerCommonData/data/FlatMinus05Percent/2021/v2/trackermaterial.xml b/Geometry/TrackerCommonData/data/FlatMinus05Percent/2021/v2/trackermaterial.xml new file mode 100644 index 0000000000000..ef1615696f8ed --- /dev/null +++ b/Geometry/TrackerCommonData/data/FlatMinus05Percent/2021/v2/trackermaterial.xml @@ -0,0 +1,582 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Geometry/TrackerCommonData/data/PhaseI/v3/pixbarmaterial.xml b/Geometry/TrackerCommonData/data/PhaseI/v3/pixbarmaterial.xml new file mode 100644 index 0000000000000..872bc8761850c --- /dev/null +++ b/Geometry/TrackerCommonData/data/PhaseI/v3/pixbarmaterial.xml @@ -0,0 +1,826 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Geometry/TrackerCommonData/data/tibmaterial/2021/v2/tibmaterial.xml b/Geometry/TrackerCommonData/data/tibmaterial/2021/v2/tibmaterial.xml new file mode 100644 index 0000000000000..af60f500a285c --- /dev/null +++ b/Geometry/TrackerCommonData/data/tibmaterial/2021/v2/tibmaterial.xml @@ -0,0 +1,326 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Geometry/TrackerCommonData/data/tibtidcommonmaterial/2021/v2/tibtidcommonmaterial.xml b/Geometry/TrackerCommonData/data/tibtidcommonmaterial/2021/v2/tibtidcommonmaterial.xml new file mode 100644 index 0000000000000..b52b0228e070f --- /dev/null +++ b/Geometry/TrackerCommonData/data/tibtidcommonmaterial/2021/v2/tibtidcommonmaterial.xml @@ -0,0 +1,486 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Geometry/TrackerCommonData/data/tidmaterial/2021/v2/tidmaterial.xml b/Geometry/TrackerCommonData/data/tidmaterial/2021/v2/tidmaterial.xml new file mode 100644 index 0000000000000..f38b0c8acd281 --- /dev/null +++ b/Geometry/TrackerCommonData/data/tidmaterial/2021/v2/tidmaterial.xml @@ -0,0 +1,259 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Geometry/TrackerCommonData/data/tobmaterial/2021/v2/tobmaterial.xml b/Geometry/TrackerCommonData/data/tobmaterial/2021/v2/tobmaterial.xml new file mode 100644 index 0000000000000..c264abdb596f0 --- /dev/null +++ b/Geometry/TrackerCommonData/data/tobmaterial/2021/v2/tobmaterial.xml @@ -0,0 +1,1648 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Geometry/TrackerCommonData/data/trackermaterial/2021/v2/trackermaterial.xml b/Geometry/TrackerCommonData/data/trackermaterial/2021/v2/trackermaterial.xml new file mode 100644 index 0000000000000..da0002a9f1cf6 --- /dev/null +++ b/Geometry/TrackerCommonData/data/trackermaterial/2021/v2/trackermaterial.xml @@ -0,0 +1,582 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Geometry/TrackerCommonData/data/trackermaterial/2026/v1/trackermaterial.xml b/Geometry/TrackerCommonData/data/trackermaterial/2026/v1/trackermaterial.xml new file mode 100644 index 0000000000000..5cb050e0b453b --- /dev/null +++ b/Geometry/TrackerCommonData/data/trackermaterial/2026/v1/trackermaterial.xml @@ -0,0 +1,563 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Geometry/TrackerCommonData/data/zeroMaterial/2021/v2/tibmaterial.xml b/Geometry/TrackerCommonData/data/zeroMaterial/2021/v2/tibmaterial.xml new file mode 100644 index 0000000000000..bbb0b96aec2a0 --- /dev/null +++ b/Geometry/TrackerCommonData/data/zeroMaterial/2021/v2/tibmaterial.xml @@ -0,0 +1,326 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Geometry/TrackerCommonData/data/zeroMaterial/2021/v2/tibtidcommonmaterial.xml b/Geometry/TrackerCommonData/data/zeroMaterial/2021/v2/tibtidcommonmaterial.xml new file mode 100644 index 0000000000000..e2e201e72f521 --- /dev/null +++ b/Geometry/TrackerCommonData/data/zeroMaterial/2021/v2/tibtidcommonmaterial.xml @@ -0,0 +1,486 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Geometry/TrackerCommonData/data/zeroMaterial/2021/v2/tidmaterial.xml b/Geometry/TrackerCommonData/data/zeroMaterial/2021/v2/tidmaterial.xml new file mode 100644 index 0000000000000..39ea394a44ad6 --- /dev/null +++ b/Geometry/TrackerCommonData/data/zeroMaterial/2021/v2/tidmaterial.xml @@ -0,0 +1,259 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Geometry/TrackerCommonData/data/zeroMaterial/2021/v2/tobmaterial.xml b/Geometry/TrackerCommonData/data/zeroMaterial/2021/v2/tobmaterial.xml new file mode 100644 index 0000000000000..9650d4d90c3b6 --- /dev/null +++ b/Geometry/TrackerCommonData/data/zeroMaterial/2021/v2/tobmaterial.xml @@ -0,0 +1,1648 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Geometry/TrackerCommonData/data/zeroMaterial/2021/v2/trackermaterial.xml b/Geometry/TrackerCommonData/data/zeroMaterial/2021/v2/trackermaterial.xml new file mode 100644 index 0000000000000..6840fde52bd39 --- /dev/null +++ b/Geometry/TrackerCommonData/data/zeroMaterial/2021/v2/trackermaterial.xml @@ -0,0 +1,582 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Geometry/TrackerCommonData/plugins/dd4hep/DDCutTubsFromPoints.cc b/Geometry/TrackerCommonData/plugins/dd4hep/DDCutTubsFromPoints.cc index 65876a8e3188d..a47686ce0b66b 100644 --- a/Geometry/TrackerCommonData/plugins/dd4hep/DDCutTubsFromPoints.cc +++ b/Geometry/TrackerCommonData/plugins/dd4hep/DDCutTubsFromPoints.cc @@ -192,6 +192,9 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext segments[segments.size() - 1], dd4hep::Position(0., 0., offsets[segments.size() - 1] - shift)); + edm::LogVerbatim("TrackerGeom") << "DDCutTubsFromPoints: " << solid.name() << " Union solid with " << segments.size() + << " segments"; + // remove the common offset from the input, to get sth. aligned at z=0. float offset = -shift + (min_z + 0.5 * (max_z - min_z)); diff --git a/Geometry/TrackerCommonData/plugins/dd4hep/DDPixBarLayerAlgo.cc b/Geometry/TrackerCommonData/plugins/dd4hep/DDPixBarLayerAlgo.cc index 033f1c6a203eb..ee2ba9af28c93 100644 --- a/Geometry/TrackerCommonData/plugins/dd4hep/DDPixBarLayerAlgo.cc +++ b/Geometry/TrackerCommonData/plugins/dd4hep/DDPixBarLayerAlgo.cc @@ -14,7 +14,7 @@ static long algorithm(Detector& description, cms::DDParsingContext& ctxt, xml_h DDAlgoArguments args(ctxt, e); string parentName = args.parentName(); - LogDebug("PixelGeom") << "+++ Parsing arguments for Algorithm:" << args.name << " rParent:" << parentName; + edm::LogVerbatim("PixelGeom") << "+++ Parsing arguments for Algorithm:" << args.name << " rParent:" << parentName; string genMat = args.value("GeneralMaterial"); int number = args.value("Ladders"); double layerDz = args.value("LayerDz"); @@ -26,18 +26,18 @@ static long algorithm(Detector& description, cms::DDParsingContext& ctxt, xml_h double coolDist = args.value("CoolDist"); string coolMat = args.value("CoolMaterial"); string tubeMat = args.value("CoolTubeMaterial"); - LogDebug("PixelGeom") << "Parent " << parentName << " NameSpace " << ns.name() << "\n" - << "\tLadders " << number << "\tGeneral Material " << genMat << "\tLength " << layerDz - << "\tSensorEdge " << sensorEdge << "\tSpecification of Cooling Pieces:\n" - << "\tLength " << coolDz << " Width " << coolWidth << " Side " << coolSide - << " Thickness of Shell " << coolThick << " Radial distance " << coolDist << " Materials " - << coolMat << ", " << tubeMat; + edm::LogVerbatim("PixelGeom") << "Parent " << parentName << " NameSpace " << ns.name() << "\n" + << "\tLadders " << number << "\tGeneral Material " << genMat << "\tLength " << layerDz + << "\tSensorEdge " << sensorEdge << "\tSpecification of Cooling Pieces:\n" + << "\tLength " << coolDz << " Width " << coolWidth << " Side " << coolSide + << " Thickness of Shell " << coolThick << " Radial distance " << coolDist + << " Materials " << coolMat << ", " << tubeMat; vector ladder = args.value >("LadderName"); vector ladderWidth = args.value >("LadderWidth"); vector ladderThick = args.value >("LadderThick"); - LogDebug("PixelGeom") << "Full Ladder " << ladder[0] << " width/thickness " << ladderWidth[0] << ", " - << ladderThick[0] << "\tHalf Ladder " << ladder[1] << " width/thickness " << ladderWidth[1] - << ", " << ladderThick[1]; + edm::LogVerbatim("PixelGeom") << "Full Ladder " << ladder[0] << " width/thickness " << ladderWidth[0] << ", " + << ladderThick[0] << "\tHalf Ladder " << ladder[1] << " width/thickness " + << ladderWidth[1] << ", " << ladderThick[1]; const std::string idName = ns.objName(parentName); double dphi = 2_pi / number; @@ -48,39 +48,40 @@ static long algorithm(Detector& description, cms::DDParsingContext& ctxt, xml_h double rmin = (coolDist - 0.5 * (d1 + d2)) * cos(0.5 * dphi) - 0.5 * ladderThick[0]; double rmax = (coolDist + 0.5 * (d1 + d2)) * cos(0.5 * dphi) + 0.5 * ladderThick[0]; double rmxh = rmax - 0.5 * ladderThick[0] + ladderThick[1]; - LogDebug("PixelGeom") << "Rmin/Rmax " << rmin << ", " << rmax << " d1/d2 " << d1 << ", " << d2 << " x1/x2 " << x1 - << ", " << x2; + edm::LogVerbatim("PixelGeom") << "Rmin/Rmax " << rmin << ", " << rmax << " d1/d2 " << d1 << ", " << d2 << " x1/x2 " + << x1 << ", " << x2; double rtmi = rmin + 0.5 * ladderThick[0] - ladderThick[1]; double rtmx = sqrt(rmxh * rmxh + ladderWidth[1] * ladderWidth[1]); - Solid solid = ns.addSolid(idName, Tube(rtmi, rtmx, 0.5 * layerDz, 0, 2_pi)); - LogDebug("PixelGeom") << "IDname " << idName << " Tubs made of " << genMat << " from 0 to " << convertRadToDeg(2_pi) - << " with Rin " << rtmi << " Rout " << rtmx << " ZHalf " << 0.5 * layerDz; + Solid solid = ns.addSolid(ns.prepend(idName), Tube(rtmi, rtmx, 0.5 * layerDz, 0, 2_pi)); + edm::LogVerbatim("PixelGeom") << "IDname " << solid.name() << " Tubs made of " << genMat << " from 0 to " + << convertRadToDeg(2_pi) << " with Rin " << rtmi << " Rout " << rtmx << " ZHalf " + << 0.5 * layerDz; - Volume layer = ns.addVolume(Volume(idName, solid, ns.material(genMat))); + Volume layer = ns.addVolume(Volume(solid.name(), solid, ns.material(genMat))); double rr = 0.5 * (rmax + rmin); double dr = 0.5 * (rmax - rmin); double h1 = 0.5 * coolSide * cos(0.5 * dphi); std::string name = idName + "CoolTube"; - solid = ns.addSolid(name, Trap(0.5 * coolDz, 0, 0, h1, d2, d1, 0, h1, d2, d1, 0)); - LogDebug("PixelGeom") << "Solid " << solid.name() << " Trap made of " << tubeMat << " of dimensions " << 0.5 * coolDz - << ", 0, 0, " << h1 << ", " << d2 << ", " << d1 << ", 0, " << h1 << ", " << d2 << ", " << d1 - << ", 0"; + solid = ns.addSolid(ns.prepend(name), Trap(0.5 * coolDz, 0, 0, h1, d2, d1, 0, h1, d2, d1, 0)); + edm::LogVerbatim("PixelGeom") << "Solid " << solid.name() << " Trap made of " << tubeMat << " of dimensions " + << 0.5 * coolDz << ", 0, 0, " << h1 << ", " << d2 << ", " << d1 << ", 0, " << h1 << ", " + << d2 << ", " << d1 << ", 0"; - Volume coolTube = ns.addVolume(Volume(name, solid, description.material(tubeMat))); + Volume coolTube = ns.addVolume(Volume(solid.name(), solid, description.material(tubeMat))); h1 -= coolThick; d1 -= coolThick; d2 -= coolThick; name = idName + "Coolant"; - solid = ns.addSolid(name, Trap(0.5 * coolDz, 0, 0, h1, d2, d1, 0, h1, d2, d1, 0)); - LogDebug("PixelGeom") << "Solid " << solid.name() << " Trap made of " << coolMat << " of dimensions " << 0.5 * coolDz - << ", 0, 0, " << h1 << ", " << d2 << ", " << d1 << ", 0, " << h1 << ", " << d2 << ", " << d1 - << ", 0"; + solid = ns.addSolid(ns.prepend(name), Trap(0.5 * coolDz, 0, 0, h1, d2, d1, 0, h1, d2, d1, 0)); + edm::LogVerbatim("PixelGeom") << "Solid " << solid.name() << " Trap made of " << coolMat << " of dimensions " + << 0.5 * coolDz << ", 0, 0, " << h1 << ", " << d2 << ", " << d1 << ", 0, " << h1 << ", " + << d2 << ", " << d1 << ", 0"; - Volume cool = ns.addVolume(Volume(name, solid, description.material(coolMat))); + Volume cool = ns.addVolume(Volume(solid.name(), solid, description.material(coolMat))); pv = coolTube.placeVolume(cool, 1); - LogDebug("PixelGeom") << "Cool " << cool.name() << " number 1 positioned in " << coolTube.name() - << " at (0,0,0) with no rotation"; + edm::LogVerbatim("PixelGeom") << "Cool " << cool.name() << " number 1 positioned in " << coolTube.name() + << " at (0,0,0) with no rotation"; string ladderFull = ladder[0]; string ladderHalf = ladder[1]; @@ -102,17 +103,17 @@ static long algorithm(Detector& description, cms::DDParsingContext& ctxt, xml_h rots = idName + std::to_string(copy); phix = phi - 90_deg; phiy = 90_deg + phix; - LogDebug("PixelGeom") << "Creating a new " - << "rotation: " << rots << "\t90., " << convertRadToDeg(phix) << ", 90.," - << convertRadToDeg(phiy) << ", 0, 0"; + edm::LogVerbatim("PixelGeom") << "Creating a new " + << "rotation: " << rots << "\t90., " << convertRadToDeg(phix) << ", 90.," + << convertRadToDeg(phiy) << ", 0, 0"; rot = makeRotation3D(90_deg, phix, 90_deg, phiy, 0., 0.); //cpv.position(ladderHalf, layer, copy, tran, rot); pv = layer.placeVolume(ladderHalfVol, copy, Transform3D(rot, tran)); if (!pv.isValid()) { } - LogDebug("PixelGeom") << "ladderHalfVol: " << ladderHalfVol.name() << " number " << copy << " positioned in " - << layer.name() << " at " << tran << " with " << rot; + edm::LogVerbatim("PixelGeom") << "ladderHalfVol: " << ladderHalfVol.name() << " number " << copy + << " positioned in " << layer.name() << " at " << tran << " with " << rot; copy++; iup = -1; rrr = rr - dr - 0.5 * (ladderThick[1] - ladderThick[0]); @@ -120,15 +121,15 @@ static long algorithm(Detector& description, cms::DDParsingContext& ctxt, xml_h rots = idName + std::to_string(copy); phix = phi + 90_deg; phiy = 90_deg + phix; - LogDebug("PixelGeom") << "Creating a new rotation: " << rots << "\t90., " << convertRadToDeg(phix) << ", 90.," - << convertRadToDeg(phiy) << ", 0, 0"; + edm::LogVerbatim("PixelGeom") << "Creating a new rotation: " << rots << "\t90., " << convertRadToDeg(phix) + << ", 90.," << convertRadToDeg(phiy) << ", 0, 0"; rot = makeRotation3D(90_deg, phix, 90_deg, phiy, 0., 0.); //cpv.position(ladderHalf, layer, copy, tran, rot); pv = layer.placeVolume(ladderHalfVol, copy, Transform3D(rot, tran)); if (!pv.isValid()) { } - LogDebug("PixelGeom") << "ladderHalfVol: " << ladderHalfVol.name() << " number " << copy << " positioned in " - << layer.name() << " at " << tran << " with " << rot; + edm::LogVerbatim("PixelGeom") << "ladderHalfVol: " << ladderHalfVol.name() << " number " << copy + << " positioned in " << layer.name() << " at " << tran << " with " << rot; copy++; } else { iup = -iup; @@ -140,17 +141,17 @@ static long algorithm(Detector& description, cms::DDParsingContext& ctxt, xml_h else phix = phi + 90_deg; phiy = phix + 90._deg; - LogDebug("PixelGeom") << "DDPixBarLayerAlgo test: Creating a new " - << "rotation: " << rots << "\t90., " << convertRadToDeg(phix) << ", 90.," - << convertRadToDeg(phiy) << ", 0, 0"; + edm::LogVerbatim("PixelGeom") << "DDPixBarLayerAlgo test: Creating a new " + << "rotation: " << rots << "\t90., " << convertRadToDeg(phix) << ", 90.," + << convertRadToDeg(phiy) << ", 0, 0"; rot = makeRotation3D(90_deg, phix, 90_deg, phiy, 0., 0.); //cpv.position(ladderFull, layer, copy, tran, rot); pv = layer.placeVolume(ladderFullVol, copy, Transform3D(rot, tran)); if (!pv.isValid()) { } - LogDebug("PixelGeom") << "test: " << ladderFullVol.name() << " number " << copy << " positioned in " - << layer.name() << " at " << tran << " with " << rot; + edm::LogVerbatim("PixelGeom") << "test: " << ladderFullVol.name() << " number " << copy << " positioned in " + << layer.name() << " at " << tran << " with " << rot; copy++; } rrr = coolDist * cos(0.5 * dphi); @@ -160,17 +161,17 @@ static long algorithm(Detector& description, cms::DDParsingContext& ctxt, xml_h if (iup > 0) phix += 180_deg; phiy = phix + 90._deg; - LogDebug("PixelGeom") << "Creating a new rotation: " << rots << "\t90., " << convertRadToDeg(phix) << ", 90.," - << convertRadToDeg(phiy) << ", 0, 0"; + edm::LogVerbatim("PixelGeom") << "Creating a new rotation: " << rots << "\t90., " << convertRadToDeg(phix) + << ", 90.," << convertRadToDeg(phiy) << ", 0, 0"; rot = makeRotation3D(90_deg, phix, 90_deg, phiy, 0., 0.); pv = layer.placeVolume(coolTube, i + 1, Transform3D(rot, tran)); if (!pv.isValid()) { } - LogDebug("PixelGeom") << "coolTube: " << coolTube.name() << " number " << i + 1 << " positioned in " << layer.name() - << " at " << tran << " with " << rot; + edm::LogVerbatim("PixelGeom") << "coolTube: " << coolTube.name() << " number " << i + 1 << " positioned in " + << layer.name() << " at " << tran << " with " << rot; } - LogDebug("PixelGeom") << "Layer: " << layer.name(); + edm::LogVerbatim("PixelGeom") << "Layer: " << layer.name(); return 1; } diff --git a/Geometry/TrackerCommonData/plugins/dd4hep/DDPixBarLayerUpgradeAlgo.cc b/Geometry/TrackerCommonData/plugins/dd4hep/DDPixBarLayerUpgradeAlgo.cc index d8dc3312562c9..84e0052e5d327 100644 --- a/Geometry/TrackerCommonData/plugins/dd4hep/DDPixBarLayerUpgradeAlgo.cc +++ b/Geometry/TrackerCommonData/plugins/dd4hep/DDPixBarLayerUpgradeAlgo.cc @@ -35,14 +35,14 @@ static long algorithm(dd4hep::Detector&, cms::DDParsingContext& ctxt, xml_h e) { double ladderOffset = args.value("LadderOffset"); int outerFirst = args.value("OuterFirst"); - LogDebug("PixelGeom") << "DDPixBarLayerUpgradeAlgo debug: Parent " << parentName << " NameSpace " - << ns.objName(parentName) << "\n\tLadders " << number << "\tGeneral Material " << genMat - << "\tLength " << layerDz << "\tSpecification of Cooling Pieces:\n" - << "\tLength " << coolDz << "\tThickness of Shell " << coolThick << "\tRadial distance " - << coolDist << "\tMaterials " << coolMat << ", " << tubeMat << std::endl; + edm::LogVerbatim("PixelGeom") << "DDPixBarLayerUpgradeAlgo debug: Parent " << parentName << " NameSpace " + << ns.objName(parentName) << "\n\tLadders " << number << "\tGeneral Material " << genMat + << "\tLength " << layerDz << "\tSpecification of Cooling Pieces:\n" + << "\tLength " << coolDz << "\tThickness of Shell " << coolThick << "\tRadial distance " + << coolDist << "\tMaterials " << coolMat << ", " << tubeMat << std::endl; - LogDebug("PixelGeom") << "DDPixBarLayerUpgradeAlgo debug: Full Ladder " << ladder << " width/thickness " - << ladderWidth << ", " << ladderThick; + edm::LogVerbatim("PixelGeom") << "DDPixBarLayerUpgradeAlgo debug: Full Ladder " << ladder << " width/thickness " + << ladderWidth << ", " << ladderThick; double dphi = 2_pi / (double)number; double x2 = coolDist * sin(0.5 * dphi); @@ -52,62 +52,63 @@ static long algorithm(dd4hep::Detector&, cms::DDParsingContext& ctxt, xml_h e) { std::string name = ns.objName(parentName); - dd4hep::Solid solid = ns.addSolid(name, dd4hep::Tube(rtmi, rtmx, 0.5 * layerDz, 0., 2._pi)); + dd4hep::Solid solid = ns.addSolid(ns.prepend(name), dd4hep::Tube(rtmi, rtmx, 0.5 * layerDz, 0., 2._pi)); - LogDebug("PixelGeom") << "DDPixBarLayerUpgradeAlgo test: " << ns.name() << " Tubs made of " << genMat - << " from 0. to " << convertRadToDeg(2_pi) << " with Rin " << rtmi << " Rout " << rtmx - << " ZHalf " << 0.5 * layerDz; + edm::LogVerbatim("PixelGeom") << "DDPixBarLayerUpgradeAlgo test: " << solid.name() << " Tubs made of " << genMat + << " from 0. to " << convertRadToDeg(2_pi) << " with Rin " << rtmi << " Rout " << rtmx + << " ZHalf " << 0.5 * layerDz; dd4hep::Volume layer = ns.addVolume(dd4hep::Volume(solid.name(), solid, ns.material(genMat))); // Full Tubes - solid = ns.addSolid(name + "CoolTube", dd4hep::Tube(0., coolRadius, 0.5 * coolDz, 0., 2_pi)); + solid = ns.addSolid(ns.prepend(name + "CoolTube"), dd4hep::Tube(0., coolRadius, 0.5 * coolDz, 0., 2_pi)); - LogDebug("PixelGeom") << "DDPixBarLayerUpgradeAlgo test: " << solid.name() << " Tubs made of " << tubeMat - << " from 0 to " << convertRadToDeg(2_pi) << " with Rout " << coolRadius << " ZHalf " - << 0.5 * coolDz; + edm::LogVerbatim("PixelGeom") << "DDPixBarLayerUpgradeAlgo test: " << solid.name() << " Tubs made of " << tubeMat + << " from 0 to " << convertRadToDeg(2_pi) << " with Rout " << coolRadius << " ZHalf " + << 0.5 * coolDz; dd4hep::Volume coolTube = ns.addVolume(dd4hep::Volume(solid.name(), solid, ns.material(tubeMat))); // Half Tubes - solid = ns.addSolid(name + "CoolTubeHalf", dd4hep::Tube(0., coolRadius, 0.5 * coolDz, 0, 1_pi)); + solid = ns.addSolid(ns.prepend(name + "CoolTubeHalf"), dd4hep::Tube(0., coolRadius, 0.5 * coolDz, 0, 1_pi)); - LogDebug("PixelGeom") << "DDPixBarLayerUpgradeAlgo test: " << solid.name() << " Tubs made of " << tubeMatHalf - << " from 0 to " << convertRadToDeg(2_pi) << " with Rout " << coolRadius << " ZHalf " - << 0.5 * coolDz; + edm::LogVerbatim("PixelGeom") << "DDPixBarLayerUpgradeAlgo test: " << solid.name() << " Tubs made of " << tubeMatHalf + << " from 0 to " << convertRadToDeg(2_pi) << " with Rout " << coolRadius << " ZHalf " + << 0.5 * coolDz; dd4hep::Volume coolTubeHalf = ns.addVolume(dd4hep::Volume(solid.name(), solid, ns.material(tubeMatHalf))); // Full Coolant name = ns.objName(parentName); - solid = ns.addSolid(name + "Coolant", dd4hep::Tube(0., coolRadius - coolThick, 0.5 * coolDz, 0., 2_pi)); + solid = ns.addSolid(ns.prepend(name + "Coolant"), dd4hep::Tube(0., coolRadius - coolThick, 0.5 * coolDz, 0., 2_pi)); - LogDebug("PixelGeom") << "DDPixBarLayerUpgradeAlgo test: " << solid.name() << " Tubs made of " << tubeMat - << " from 0 to " << convertRadToDeg(2._pi) << " with Rout " << coolRadius - coolThick - << " ZHalf " << 0.5 * coolDz; + edm::LogVerbatim("PixelGeom") << "DDPixBarLayerUpgradeAlgo test: " << solid.name() << " Tubs made of " << tubeMat + << " from 0 to " << convertRadToDeg(2._pi) << " with Rout " << coolRadius - coolThick + << " ZHalf " << 0.5 * coolDz; dd4hep::Volume cool = ns.addVolume(dd4hep::Volume(solid.name(), solid, ns.material(coolMat))); coolTube.placeVolume(cool, 1, dd4hep::Transform3D(dd4hep::Rotation3D(), dd4hep::Position(0., 0., 0.))); - LogDebug("PixelGeom") << "DDPixBarLayerUpgradeAlgo test: " << cool.name() << " number 1 positioned in " - << coolTube.name() << " at (0,0,0) with no rotation"; + edm::LogVerbatim("PixelGeom") << "DDPixBarLayerUpgradeAlgo test: " << cool.name() << " number 1 positioned in " + << coolTube.name() << " at (0,0,0) with no rotation"; // Half Coolant - solid = ns.addSolid(name + "CoolantHalf", dd4hep::Tube(0., coolRadius - coolThick, 0.5 * coolDz, 0., 1._pi)); + solid = + ns.addSolid(ns.prepend(name + "CoolantHalf"), dd4hep::Tube(0., coolRadius - coolThick, 0.5 * coolDz, 0., 1._pi)); - LogDebug("PixelGeom") << "DDPixBarLayerUpgradeAlgo test: " << solid.name() << " Tubs made of " << tubeMatHalf - << " from 0 to " << convertRadToDeg(2._pi) << " with Rout " << coolRadius - coolThick - << " ZHalf " << 0.5 * coolDz; + edm::LogVerbatim("PixelGeom") << "DDPixBarLayerUpgradeAlgo test: " << solid.name() << " Tubs made of " << tubeMatHalf + << " from 0 to " << convertRadToDeg(2._pi) << " with Rout " << coolRadius - coolThick + << " ZHalf " << 0.5 * coolDz; dd4hep::Volume coolHalf = ns.addVolume(dd4hep::Volume(solid.name(), solid, ns.material(coolMatHalf))); coolTubeHalf.placeVolume(coolHalf, 1, dd4hep::Transform3D(dd4hep::Rotation3D(), dd4hep::Position(0., 0., 0.))); - LogDebug("PixelGeom") << "DDPixBarLayerUpgradeAlgo test: " << cool.name() << " number 1 positioned in " - << coolTube.name() << " at (0,0,0) with no rotation"; + edm::LogVerbatim("PixelGeom") << "DDPixBarLayerUpgradeAlgo test: " << cool.name() << " number 1 positioned in " + << coolTube.name() << " at (0,0,0) with no rotation"; int copy = 1, iup = (-1) * outerFirst; int copyoffset = number + 2; @@ -146,17 +147,17 @@ static long algorithm(dd4hep::Detector&, cms::DDParsingContext& ctxt, xml_h e) { phiy = phix + 90._deg; - LogDebug("PixelGeom") << "DDPixBarLayerUpgradeAlgo test: Creating a new " - << "rotation: " << rots << "\t90., " << convertRadToDeg(phix) << ", 90.," - << convertRadToDeg(phiy) << ", 0, 0"; + edm::LogVerbatim("PixelGeom") << "DDPixBarLayerUpgradeAlgo test: Creating a new " + << "rotation: " << rots << "\t90., " << convertRadToDeg(phix) << ", 90.," + << convertRadToDeg(phiy) << ", 0, 0"; rot = cms::makeRotation3D(90._deg, phix, 90._deg, phiy, 0., 0.); // FixMe : Would need ns.vecStr layer.placeVolume(ns.volume(ladder), copy, dd4hep::Transform3D(rot, tran)); - LogDebug("PixelGeom") << "DDPixBarLayerUpgradeAlgo test: " << ladder << " number " << copy << " positioned in " - << layer.name() << " at " << tran << " with " << rot; + edm::LogVerbatim("PixelGeom") << "DDPixBarLayerUpgradeAlgo test: " << ladder << " number " << copy + << " positioned in " << layer.name() << " at " << tran << " with " << rot; copy++; @@ -170,9 +171,9 @@ static long algorithm(dd4hep::Detector&, cms::DDParsingContext& ctxt, xml_h e) { phiy = phix + 90._deg; - LogDebug("PixelGeom") << "DDPixBarLayerUpgradeAlgo test: Creating a new " - << "rotation: " << rots << "\t90., " << convertRadToDeg(phix) << ", 90.," - << convertRadToDeg(phiy) << ", 0, 0"; + edm::LogVerbatim("PixelGeom") << "DDPixBarLayerUpgradeAlgo test: Creating a new " + << "rotation: " << rots << "\t90., " << convertRadToDeg(phix) << ", 90.," + << convertRadToDeg(phiy) << ", 0, 0"; tran = dd4hep::Position(rrr * cos(phi) - x2 * sin(phi), rrr * sin(phi) + x2 * cos(phi), 0.); @@ -196,8 +197,8 @@ static long algorithm(dd4hep::Detector&, cms::DDParsingContext& ctxt, xml_h e) { copyoffset++; } - LogDebug("PixelGeom") << "DDPixBarLayerUpgradeAlgo test: " << coolTube.name() << " number " << i + 1 - << " positioned in " << layer.name() << " at " << tran << " with " << rot; + edm::LogVerbatim("PixelGeom") << "DDPixBarLayerUpgradeAlgo test: " << coolTube.name() << " number " << i + 1 + << " positioned in " << layer.name() << " at " << tran << " with " << rot; } return cms::s_executed; diff --git a/Geometry/TrackerCommonData/plugins/dd4hep/DDPixFwdDiskAlgo.cc b/Geometry/TrackerCommonData/plugins/dd4hep/DDPixFwdDiskAlgo.cc index cc62ea472ea8e..64e4efc988d71 100644 --- a/Geometry/TrackerCommonData/plugins/dd4hep/DDPixFwdDiskAlgo.cc +++ b/Geometry/TrackerCommonData/plugins/dd4hep/DDPixFwdDiskAlgo.cc @@ -51,15 +51,15 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext dd4hep::Volume child = ns.volume(childName); - edm::LogVerbatim("TrackerGeom") << "DDPixFwdDiskAlgo debug: Parent " << mother.name() << "\tChild " << child.name() - << " NameSpace " << ns.name() << "\tRot Name " << rotName << "\tCopyNo (Start/Total) " - << startCopyNo << ", " << nBlades << "\tAngles " << convertRadToDeg(bladeAngle) - << ", " << convertRadToDeg(bladeTilt) << "\tZshifts " << zPlane << "\tAnchor Radius " - << anchorR; + edm::LogVerbatim("PixelGeom") << "DDPixFwdDiskAlgo debug: Parent " << mother.name() << "\tChild " << child.name() + << " NameSpace " << ns.name() << "\tRot Name " << rotName << "\tCopyNo (Start/Total) " + << startCopyNo << ", " << nBlades << "\tAngles " << convertRadToDeg(bladeAngle) << ", " + << convertRadToDeg(bladeTilt) << "\tZshifts " << zPlane << "\tAnchor Radius " + << anchorR; for (int iBlade = 0; iBlade < nBlades; ++iBlade) { - edm::LogVerbatim("TrackerGeom") << "DDPixFwdDiskAlgo: Blade " << iBlade << " flag " << flagString[iBlade] - << " zshift " << bladeZShift[iBlade]; + edm::LogVerbatim("PixelGeom") << "DDPixFwdDiskAlgo: Blade " << iBlade << " flag " << flagString[iBlade] + << " zshift " << bladeZShift[iBlade]; } double deltaPhi = 360.0_deg / (double)nBlades; @@ -86,24 +86,24 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext auto irot = ctxt.rotations.find(ns.prepend(rotstr)); if (irot != ctxt.rotations.end()) { - edm::LogVerbatim("TrackerGeom") << "DDPixFwdDiskAlgo test: Creating a new " - << "rotation: " << rotstr << "\t" << convertRadToDeg(thetx) << ", " - << convertRadToDeg(phix) << ", " << convertRadToDeg(thety) << ", " - << convertRadToDeg(phiy) << ", " << convertRadToDeg(thetz) << ", " - << convertRadToDeg(phiz); - - edm::LogVerbatim("TrackerGeom") << "Rotation Matrix (" << convertRadToDeg(phi) << ", " - << convertRadToDeg(bladeAngle) << ", " << convertRadToDeg(bladeTilt) << ") " - << cos(phi) * cos(bladeAngle) << ", " - << (-sin(phi) * cos(bladeTilt) + cos(phi) * sin(bladeAngle) * sin(bladeTilt)) - << ", " - << (sin(phi) * sin(bladeTilt) + cos(phi) * sin(bladeAngle) * cos(bladeTilt)) - << ", " << sin(phi) * cos(bladeAngle) << ", " - << (cos(phi) * cos(bladeTilt) + sin(phi) * sin(bladeAngle) * sin(bladeTilt)) - << ", " - << (-cos(phi) * sin(bladeTilt) + sin(phi) * sin(bladeAngle) * cos(bladeTilt)) - << ", " << -sin(bladeAngle) << ", " << cos(bladeAngle) * sin(bladeTilt) << ", " - << cos(bladeAngle) * cos(bladeTilt); + edm::LogVerbatim("PixelGeom") << "DDPixFwdDiskAlgo test: Creating a new " + << "rotation: " << rotstr << "\t" << convertRadToDeg(thetx) << ", " + << convertRadToDeg(phix) << ", " << convertRadToDeg(thety) << ", " + << convertRadToDeg(phiy) << ", " << convertRadToDeg(thetz) << ", " + << convertRadToDeg(phiz); + + edm::LogVerbatim("PixelGeom") << "Rotation Matrix (" << convertRadToDeg(phi) << ", " + << convertRadToDeg(bladeAngle) << ", " << convertRadToDeg(bladeTilt) << ") " + << cos(phi) * cos(bladeAngle) << ", " + << (-sin(phi) * cos(bladeTilt) + cos(phi) * sin(bladeAngle) * sin(bladeTilt)) + << ", " + << (sin(phi) * sin(bladeTilt) + cos(phi) * sin(bladeAngle) * cos(bladeTilt)) + << ", " << sin(phi) * cos(bladeAngle) << ", " + << (cos(phi) * cos(bladeTilt) + sin(phi) * sin(bladeAngle) * sin(bladeTilt)) + << ", " + << (-cos(phi) * sin(bladeTilt) + sin(phi) * sin(bladeAngle) * cos(bladeTilt)) + << ", " << -sin(bladeAngle) << ", " << cos(bladeAngle) * sin(bladeTilt) << ", " + << cos(bladeAngle) * cos(bladeTilt); rot = cms::makeRotation3D(thetx, phix, thety, phiy, thetz, phiz); } double xpos = anchorR * (-sin(phi) * cos(bladeTilt) + cos(phi) * sin(bladeAngle) * sin(bladeTilt)); @@ -112,14 +112,14 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext dd4hep::Position tran(xpos, ypos, zpos); pv = mother.placeVolume(child, copyNo, dd4hep::Transform3D(rot, tran)); - edm::LogVerbatim("TrackerGeom") << "DDPixFwdDiskAlgo test: " << pv.name() << ": " << childName << " number " - << copyNo << " positioned in " << mother.name() << " at " << tran << " with " - << rot; + edm::LogVerbatim("PixelGeom") << "DDPixFwdDiskAlgo test: " << pv.name() << ": " << childName << " number " + << copyNo << " positioned in " << mother.name() << " at " << tran << " with " + << rot; } copyNo++; } - edm::LogVerbatim("TrackerGeom") << "Finished...."; + edm::LogVerbatim("PixelGeom") << "Finished...."; return cms::s_executed; } diff --git a/Geometry/TrackerCommonData/plugins/dd4hep/DDPixPhase1FwdDiskAlgo.cc b/Geometry/TrackerCommonData/plugins/dd4hep/DDPixPhase1FwdDiskAlgo.cc index 486e550951737..d782654dd41f2 100644 --- a/Geometry/TrackerCommonData/plugins/dd4hep/DDPixPhase1FwdDiskAlgo.cc +++ b/Geometry/TrackerCommonData/plugins/dd4hep/DDPixPhase1FwdDiskAlgo.cc @@ -35,6 +35,7 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext startCopyNo = args.find("StartCopyNo") ? args.value("StartCopyNo") : 0; nBlades = args.value("NumberOfBlades"); bladeAngle = args.value("BladeAngle"); + bladeTilt = -1. * args.value("BladeTilt"); zPlane = args.value("BladeCommonZ"); anchorR = args.value("AnchorRadius"); @@ -47,15 +48,15 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext dd4hep::Volume child = ns.volume(childName); - edm::LogVerbatim("TrackerGeom") << "DDPixFwdDiskAlgo debug: Parent " << mother.name() << "\tChild " << child.name() - << " NameSpace " << ns.name() << "\tRot Name " << rotName << "\tCopyNo (Start/Total) " - << startCopyNo << ", " << nBlades << "\tAngles " << convertRadToDeg(bladeAngle) - << ", " << convertRadToDeg(bladeTilt) << "\tZshifts " << zPlane << "\tAnchor Radius " - << anchorR; + edm::LogVerbatim("PixelGeom") << "DDPixFwdDiskAlgo debug: Parent " << mother.name() << "\tChild " << child.name() + << " NameSpace " << ns.name() << "\tRot Name " << rotName << "\tCopyNo (Start/Total) " + << startCopyNo << ", " << nBlades << "\tAngles " << convertRadToDeg(bladeAngle) << ", " + << convertRadToDeg(bladeTilt) << "\tZshifts " << zPlane << "\tAnchor Radius " + << anchorR; for (int iBlade = 0; iBlade < nBlades; ++iBlade) { - edm::LogVerbatim("TrackerGeom") << "DDPixFwdDiskAlgo: Blade " << iBlade << " flag " << flagString[iBlade] - << " zshift " << bladeZShift[iBlade]; + edm::LogVerbatim("PixelGeom") << "DDPixFwdDiskAlgo: Blade " << iBlade << " flag " << flagString[iBlade] + << " zshift " << bladeZShift[iBlade]; } double deltaPhi = 360.0_deg / (double)nBlades; diff --git a/Geometry/TrackerCommonData/plugins/dd4hep/DDTECCoolAlgo.cc b/Geometry/TrackerCommonData/plugins/dd4hep/DDTECCoolAlgo.cc index 2c0e1b25ab434..09873bd42c187 100644 --- a/Geometry/TrackerCommonData/plugins/dd4hep/DDTECCoolAlgo.cc +++ b/Geometry/TrackerCommonData/plugins/dd4hep/DDTECCoolAlgo.cc @@ -20,15 +20,15 @@ static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, vector coolInsert = args.value >("CoolInsert"); Volume mother = ns.volume(args.parentName()); - LogDebug("TECGeom") << "DDTECCoolAlgo debug: Parent " << mother.name() << " NameSpace " << ns.name() - << " at radial Position " << rPosition; + edm::LogVerbatim("TECGeom") << "DDTECCoolAlgo debug: Parent " << mother.name() << " NameSpace " << ns.name() + << " at radial Position " << rPosition; if (phiPosition.size() == coolInsert.size()) { for (int i = 0; i < (int)(phiPosition.size()); i++) { - LogDebug("TECGeom") << "DDTECCoolAlgo debug: Insert[" << i << "]: " << coolInsert.at(i) << " at Phi " - << convertRadToDeg(phiPosition.at(i)); + edm::LogVerbatim("TECGeom") << "DDTECCoolAlgo debug: Insert[" << i << "]: " << coolInsert.at(i) << " at Phi " + << convertRadToDeg(phiPosition.at(i)); } } else { - LogDebug("TECGeom") << "DDTECCoolAlgo ERROR: Number of inserts does not match the numer of PhiPositions!"; + edm::LogVerbatim("TECGeom") << "DDTECCoolAlgo ERROR: Number of inserts does not match the numer of PhiPositions!"; } int copyNo = startCopyNo; @@ -41,11 +41,12 @@ static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, // place inserts Position tran(xpos, ypos, 0.0); mother.placeVolume(child, copyNo, tran); - LogDebug("TECGeom") << "DDTECCoolAlgo test " << child.name() << "[" << copyNo << "] positioned in " << mother.name() - << " at " << tran << " phi " << convertRadToDeg(phiPosition.at(i)) << " r " << rPosition; + edm::LogVerbatim("TECGeom") << "DDTECCoolAlgo test " << child.name() << "[" << copyNo << "] positioned in " + << mother.name() << " at " << tran << " phi " << convertRadToDeg(phiPosition.at(i)) + << " r " << rPosition; copyNo++; } - LogDebug("TECGeom") << "DDTECCoolAlgo Finished...."; + edm::LogVerbatim("TECGeom") << "DDTECCoolAlgo Finished...."; return 1; } diff --git a/Geometry/TrackerCommonData/plugins/dd4hep/DDTECModuleAlgo.cc b/Geometry/TrackerCommonData/plugins/dd4hep/DDTECModuleAlgo.cc index 3d5c3285375be..7cf8e84d0d268 100644 --- a/Geometry/TrackerCommonData/plugins/dd4hep/DDTECModuleAlgo.cc +++ b/Geometry/TrackerCommonData/plugins/dd4hep/DDTECModuleAlgo.cc @@ -197,11 +197,11 @@ static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, if (isStereo) bl1 = 0.5 * sideFrameLWidthLow; solid = Trap(dz, thet, 0, h1, bl1, bl1, 0, h1, bl2, bl2, 0); - ns.addSolidNS(name, solid); + ns.addSolidNS(ns.prepend(name), solid); edm::LogVerbatim("TECGeom") << "Solid: " << name << " " << solid.name() << " Trap made of " << sideFrameMat << " of dimensions " << dz << ", " << thet << ", 0, " << h1 << ", " << bl1 << ", " << bl1 << ", 0, " << h1 << ", " << bl2 << ", " << bl2 << ", 0"; - Volume sideFrameLeft(name, solid, ns.material(sideFrameMat)); + Volume sideFrameLeft(ns.prepend(name), solid, ns.material(sideFrameMat)); ns.addVolumeNS(sideFrameLeft); //translate double xpos = -0.5 * topFrameBotWidth + bl2 + tan(fabs(thet)) * dz; @@ -235,11 +235,11 @@ static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, if (isStereo) bl1 = 0.5 * sideFrameRWidthLow; solid = Trap(dz, thet, 0, h1, bl1, bl1, 0, h1, bl2, bl2, 0); - ns.addSolidNS(name, solid); + ns.addSolidNS(ns.prepend(name), solid); edm::LogVerbatim("TECGeom") << "Solid:\t" << name << " " << solid.name() << " Trap made of " << sideFrameMat << " of dimensions " << dz << ", " << thet << ", 0, " << h1 << ", " << bl1 << ", " << bl1 << ", 0, " << h1 << ", " << bl2 << ", " << bl2 << ", 0"; - Volume sideFrameRight(name, solid, ns.material(sideFrameMat)); + Volume sideFrameRight(ns.prepend(name), solid, ns.material(sideFrameMat)); ns.addVolumeNS(sideFrameRight); //translate xpos = 0.5 * topFrameBotWidth - bl2 - tan(fabs(thet)) * dz; @@ -275,10 +275,11 @@ static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, // ^-- this calculates the lower left angel of the tipped trapezoid, which is the SideFframe... solid = Trap(dz, thet, 0, h1, bl1, bl1, 0, h1, bl2, bl2, 0); + ns.addSolidNS(ns.prepend(name), solid); edm::LogVerbatim("TECGeom") << "Solid:\t" << name << " " << solid.name() << " Trap made of " << siFrSuppBoxMat << " of dimensions " << dz << ", 0, 0, " << h1 << ", " << bl1 << ", " << bl1 << ", 0, " << h1 << ", " << bl2 << ", " << bl2 << ", 0"; - Volume siFrSuppBox(name, solid, matter); + Volume siFrSuppBox(ns.prepend(name), solid, matter); ns.addVolumeNS(siFrSuppBox); //translate xpos = 0.5 * topFrameBotWidth - sideFrameRWidth - bl1 - siFrSuppBoxYPos[i] * tan(fabs(thet)); @@ -311,10 +312,10 @@ static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, double dy = 0.5 * hybridThick; dz = 0.5 * hybridHeight; solid = Box(dx, dy, dz); - ns.addSolidNS(name, solid); + ns.addSolidNS(ns.prepend(name), solid); edm::LogVerbatim("TECGeom") << "Solid:\t" << name << " " << solid.name() << " Box made of " << hybridMat << " of dimensions " << dx << ", " << dy << ", " << dz; - Volume hybrid(name, solid, ns.material(hybridMat)); + Volume hybrid(ns.prepend(name), solid, ns.material(hybridMat)); ns.addVolumeNS(hybrid); ypos = hybridZ; @@ -335,7 +336,7 @@ static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, h1 = 0.5 * waferThick; dz = 0.5 * fullHeight; solid = Trap(dz, 0, 0, h1, bl1, bl1, 0, h1, bl2, bl2, 0); - ns.addSolidNS(name, solid); + ns.addSolidNS(ns.prepend(name), solid); edm::LogVerbatim("TECGeom") << "Solid:\t" << name << " " << solid.name() << " Trap made of " << waferMat << " of dimensions " << dz << ", 0, 0, " << h1 << ", " << bl1 << ", " << bl1 << ", 0, " << h1 << ", " << bl2 << ", " << bl2 << ", 0"; @@ -364,11 +365,11 @@ static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, bl1 = tmp; } solid = Trap(dz, 0, 0, h1, bl2, bl1, 0, h1, bl2, bl1, 0); - ns.addSolidNS(name, solid); + ns.addSolidNS(ns.prepend(name), solid); edm::LogVerbatim("TECGeom") << "Solid:\t" << name << " " << solid.name() << " Trap made of " << activeMat << " of dimensions " << dz << ", 0, 0, " << h1 << ", " << bl2 << ", " << bl1 << ", 0, " << h1 << ", " << bl2 << ", " << bl1 << ", 0"; - Volume active(name, solid, ns.material(activeMat)); + Volume active(ns.prepend(name), solid, ns.material(activeMat)); ns.addVolumeNS(active); wafer.placeVolume( @@ -392,11 +393,11 @@ static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, bl1 = tmp; } solid = Trap(dz, 0, 0, h1, bl2, bl1, 0, h1, bl2, bl1, 0); - ns.addSolidNS(name, solid); + ns.addSolidNS(ns.prepend(name), solid); edm::LogVerbatim("TECGeom") << "Solid:\t" << name << " " << solid.name() << " Trap made of " << inactiveMat << " of dimensions " << dz << ", 0, 0, " << h1 << ", " << bl2 << ", " << bl1 << ", 0, " << h1 << ", " << bl2 << ", " << bl1 << ", 0"; - Volume inactive(name, solid, ns.material(inactiveMat)); + Volume inactive(ns.prepend(name), solid, ns.material(inactiveMat)); ns.addVolumeNS(inactive); ypos = inactivePos - 0.5 * activeHeight; @@ -454,11 +455,11 @@ static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, } solid = Trap(dz, 0, 0, h1, bl1, bl1, 0, h1, bl2, bl2, 0); - ns.addSolid(name, solid); + ns.addSolid(ns.prepend(name), solid); edm::LogVerbatim("TECGeom") << "Solid:\t" << name << " " << solid.name() << " Trap made of " << topFrameMat << " of dimensions " << dz << ", 0, 0, " << h1 << ", " << bl1 << ", " << bl1 << ", 0, " << h1 << ", " << bl2 << ", " << bl2 << ", 0"; - Volume topFrame(name, solid, ns.material(topFrameMat)); + Volume topFrame(ns.prepend(name), solid, ns.material(topFrameMat)); ns.addVolumeNS(topFrame); if (isStereo) { @@ -471,7 +472,7 @@ static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, thet = atan((bl1 - bl2) / (2. * dz)); solid = Trap(dz, thet, 0, h1, bl1, bl1, 0, h1, bl2, bl2, 0); - ns.addSolid(name, solid); + ns.addSolid(ns.prepend(name), solid); edm::LogVerbatim("TECGeom") << "Solid:\t" << name << " " << solid.name() << " Trap made of " << topFrameMat << " of dimensions " << dz << ", " << convertRadToDeg(thet) << ", 0, " << h1 << ", " << bl1 << ", " << bl1 << ", 0, " << h1 << ", " << bl2 << ", " << bl2 << ", 0"; @@ -507,10 +508,11 @@ static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, dz = 0.5 * siReenforceHeight[i]; bl1 = bl2 = 0.5 * siReenforceWidth[i]; solid = Trap(dz, 0, 0, h1, bl1, bl1, 0, h1, bl2, bl2, 0); + ns.addSolid(ns.prepend(name), solid); edm::LogVerbatim("TECGeom") << "Solid:\t" << name << " " << solid.name() << " Trap made of " << matter.name() << " of dimensions " << dz << ", 0, 0, " << h1 << ", " << bl1 << ", " << bl1 << ", 0, " << h1 << ", " << bl2 << ", " << bl2 << ", 0"; - Volume siReenforce(name, solid, matter); + Volume siReenforce(ns.prepend(name), solid, matter); ns.addVolumeNS(siReenforce); //translate xpos = 0; @@ -542,18 +544,20 @@ static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, h1 = 0.5 * bridgeThick; dz = 0.5 * bridgeHeight; solid = Trap(dz, 0, 0, h1, bl1, bl1, 0, h1, bl2, bl2, 0); + ns.addSolid(ns.prepend(name), solid); edm::LogVerbatim("TECGeom") << "Solid:\t" << name << " " << solid.name() << " Trap made of " << bridgeMat << " of dimensions " << dz << ", 0, 0, " << h1 << ", " << bl1 << ", " << bl1 << ", 0, " << h1 << ", " << bl2 << ", " << bl2 << ", 0"; - Volume bridge(name, solid, ns.material(bridgeMat)); + Volume bridge(ns.prepend(name), solid, ns.material(bridgeMat)); ns.addVolumeNS(bridge); name = idName + "BridgeGap"; bl1 = 0.5 * bridgeSep; solid = Box(bl1, h1, dz); + ns.addSolid(ns.prepend(name), solid); edm::LogVerbatim("TECGeom") << "Solid:\t" << name << " " << solid.name() << " Box made of " << genMat << " of dimensions " << bl1 << ", " << h1 << ", " << dz; - Volume bridgeGap(name, solid, ns.material(genMat)); + Volume bridgeGap(ns.prepend(name), solid, ns.material(genMat)); ns.addVolumeNS(bridgeGap); /* PlacedVolume pv = */ bridge.placeVolume(bridgeGap, 1); edm::LogVerbatim("TECGeom") << "Solid: " << bridgeGap.name() << " number 1 positioned in " << bridge.name() diff --git a/Geometry/TrackerCommonData/plugins/dd4hep/DDTECOptoHybAlgo.cc b/Geometry/TrackerCommonData/plugins/dd4hep/DDTECOptoHybAlgo.cc index dbb0849494589..e44f3e0cde58f 100644 --- a/Geometry/TrackerCommonData/plugins/dd4hep/DDTECOptoHybAlgo.cc +++ b/Geometry/TrackerCommonData/plugins/dd4hep/DDTECOptoHybAlgo.cc @@ -20,9 +20,9 @@ static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, Volume child = ns.volume(args.value("ChildName")); Volume mother = ns.volume(args.parentName()); - LogDebug("TECGeom") << "Parent " << mother.name() << " Child " << child.name() << " NameSpace " << ns.name(); - LogDebug("TECGeom") << "Height of the Hybrid " << optoHeight << " and Width " << optoWidth << "Rpos " << rpos - << " Zpos " << zpos << " StartCopyNo " << startCopyNo << " Number " << angles.size(); + edm::LogVerbatim("TECGeom") << "Parent " << mother.name() << " Child " << child.name() << " NameSpace " << ns.name(); + edm::LogVerbatim("TECGeom") << "Height of the Hybrid " << optoHeight << " and Width " << optoWidth << "Rpos " << rpos + << " Zpos " << zpos << " StartCopyNo " << startCopyNo << " Number " << angles.size(); // given r positions are for the lower left corner rpos += optoHeight / 2; @@ -45,18 +45,18 @@ static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, rotation = ns.rotation(ns.prepend(rotstr)); } else { double theta = 90._deg; - LogDebug("TECGeom") << "test: Creating a new " - << "rotation: " << rotstr << "\t90., " << convertRadToDeg(phix) << ", 90.," - << convertRadToDeg(phiy) << ", 0, 0"; + edm::LogVerbatim("TECGeom") << "test: Creating a new " + << "rotation: " << rotstr << "\t90., " << convertRadToDeg(phix) << ", 90.," + << convertRadToDeg(phiy) << ", 0, 0"; rotation = makeRotation3D(theta, phix, theta, phiy, 0., 0.); } } mother.placeVolume(child, copyNo, Transform3D(rotation, tran)); - LogDebug("TECGeom") << "test " << child.name() << " number " << copyNo << " positioned in " << mother.name() - << " at " << tran << " with " << rotation; + edm::LogVerbatim("TECGeom") << "test " << child.name() << " number " << copyNo << " positioned in " << mother.name() + << " at " << tran << " with " << rotation; copyNo++; } - LogDebug("TECGeom") << "<<== End of DDTECOptoHybAlgo construction ..."; + edm::LogVerbatim("TECGeom") << "<<== End of DDTECOptoHybAlgo construction ..."; return 1; } diff --git a/Geometry/TrackerCommonData/plugins/dd4hep/DDTECPhiAlgo.cc b/Geometry/TrackerCommonData/plugins/dd4hep/DDTECPhiAlgo.cc index 755a242d1960d..d03e66ce3eb8c 100644 --- a/Geometry/TrackerCommonData/plugins/dd4hep/DDTECPhiAlgo.cc +++ b/Geometry/TrackerCommonData/plugins/dd4hep/DDTECPhiAlgo.cc @@ -21,12 +21,13 @@ static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, int startCopyNo = args.find("StartCopyNo") ? args.value("StartCopyNo") : 1; //Start copy number int incrCopyNo = args.find("IncrCopyNo") ? args.value("IncrCopyNo") : 1; //Increment in copy number - LogDebug("TECGeom") << "debug: Parameters for " - << "positioning--" - << "\tStartAngle " << convertRadToDeg(startAngle) << "\tIncrAngle " << convertRadToDeg(incrAngle) - << "\tZ in/out " << zIn << ", " << zOut << "\tCopy Numbers " << number << " Start/Increment " - << startCopyNo << ", " << incrCopyNo; - LogDebug("TECGeom") << "debug: Parent " << mother.name() << "\tChild " << child.name() << " NameSpace " << ns.name(); + edm::LogVerbatim("TECGeom") << "debug: Parameters for " + << "positioning--" + << "\tStartAngle " << convertRadToDeg(startAngle) << "\tIncrAngle " + << convertRadToDeg(incrAngle) << "\tZ in/out " << zIn << ", " << zOut << "\tCopy Numbers " + << number << " Start/Increment " << startCopyNo << ", " << incrCopyNo; + edm::LogVerbatim("TECGeom") << "debug: Parent " << mother.name() << "\tChild " << child.name() << " NameSpace " + << ns.name(); if (number > 0) { double theta = 90._deg; @@ -37,8 +38,8 @@ static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, Rotation3D rotation = makeRotation3D(theta, phix, theta, phiy, 0, 0); Position tran(0., 0., (i % 2 == 0) ? zIn : zOut); /* PlacedVolume pv = */ mother.placeVolume(child, copyNo, Transform3D(rotation, tran)); - LogDebug("TECGeom") << "test: " << child.name() << " number " << copyNo << " positioned in " << mother.name() - << " at " << tran << " with " << rotation; + edm::LogVerbatim("TECGeom") << "test: " << child.name() << " number " << copyNo << " positioned in " + << mother.name() << " at " << tran << " with " << rotation; copyNo += incrCopyNo; } } diff --git a/Geometry/TrackerCommonData/plugins/dd4hep/DDTECPhiAltAlgo.cc b/Geometry/TrackerCommonData/plugins/dd4hep/DDTECPhiAltAlgo.cc index f917bfda3a6b1..2250e2d3ee095 100644 --- a/Geometry/TrackerCommonData/plugins/dd4hep/DDTECPhiAltAlgo.cc +++ b/Geometry/TrackerCommonData/plugins/dd4hep/DDTECPhiAltAlgo.cc @@ -22,12 +22,13 @@ static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, int startCopyNo = args.find("StartCopyNo") ? args.value("StartCopyNo") : 1; //Start copy number int incrCopyNo = args.find("IncrCopyNo") ? args.value("IncrCopyNo") : 1; //Increment in copy number - LogDebug("TECGeom") << "debug: Parameters for " - << "positioning--" - << "\tStartAngle " << convertRadToDeg(startAngle) << "\tIncrAngle " << convertRadToDeg(incrAngle) - << "\tZ in/out " << zIn << ", " << zOut << "\tCopy Numbers " << number << " Start/Increment " - << startCopyNo << ", " << incrCopyNo; - LogDebug("TECGeom") << "debug: Parent " << mother.name() << "\tChild " << child.name() << " NameSpace " << ns.name(); + edm::LogVerbatim("TECGeom") << "debug: Parameters for " + << "positioning--" + << "\tStartAngle " << convertRadToDeg(startAngle) << "\tIncrAngle " + << convertRadToDeg(incrAngle) << "\tZ in/out " << zIn << ", " << zOut << "\tCopy Numbers " + << number << " Start/Increment " << startCopyNo << ", " << incrCopyNo; + edm::LogVerbatim("TECGeom") << "debug: Parent " << mother.name() << "\tChild " << child.name() << " NameSpace " + << ns.name(); if (number > 0) { double theta = 90._deg; @@ -38,8 +39,8 @@ static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, Rotation3D rotation = makeRotation3D(theta, phix, 0e0, 0e0, theta, phiz); Position tran(radius * cos(phiz), radius * sin(phiz), (i % 2 == 0) ? zIn : zOut); mother.placeVolume(child, copyNo, Transform3D(rotation, tran)); - LogDebug("TECGeom") << "test: " << child.name() << " number " << copyNo << " positioned in " << mother.name() - << " at " << tran << " with " << rotation; + edm::LogVerbatim("TECGeom") << "test: " << child.name() << " number " << copyNo << " positioned in " + << mother.name() << " at " << tran << " with " << rotation; copyNo += incrCopyNo; } } diff --git a/Geometry/TrackerCommonData/plugins/dd4hep/DDTIBLayerAlgo.cc b/Geometry/TrackerCommonData/plugins/dd4hep/DDTIBLayerAlgo.cc index 77eb4d493534c..2777ac977bdce 100644 --- a/Geometry/TrackerCommonData/plugins/dd4hep/DDTIBLayerAlgo.cc +++ b/Geometry/TrackerCommonData/plugins/dd4hep/DDTIBLayerAlgo.cc @@ -93,73 +93,75 @@ static long algorithm(Detector& /* description */, cms::DDParsingContext& contex << " positioned: " << pvl.motherVol()->GetName() << " " << pvl.position(); }; - LogDebug("TIBGeom") << "Parent " << mother << " NameSpace " << ns.name() << " General Material " << genMat; - LogDebug("TIBGeom") << "Lower layer Radius " << radiusLo << " Number " << stringsLo << " String " << detectorLo; - LogDebug("TIBGeom") << "Upper layer Radius " << radiusUp << " Number " << stringsUp << " String " << detectorUp; - LogDebug("TIBGeom") << "Cylinder Material/thickness " << cylinderMat << " " << cylinderT << " Rib Material " << ribMat - << " at " << ribW.size() << " positions with width/phi"; + edm::LogVerbatim("TIBGeom") << "Parent " << mother << " NameSpace " << ns.name() << " General Material " << genMat; + edm::LogVerbatim("TIBGeom") << "Lower layer Radius " << radiusLo << " Number " << stringsLo << " String " + << detectorLo; + edm::LogVerbatim("TIBGeom") << "Upper layer Radius " << radiusUp << " Number " << stringsUp << " String " + << detectorUp; + edm::LogVerbatim("TIBGeom") << "Cylinder Material/thickness " << cylinderMat << " " << cylinderT << " Rib Material " + << ribMat << " at " << ribW.size() << " positions with width/phi"; for (unsigned int i = 0; i < ribW.size(); i++) { - LogDebug("TIBGeom") << "\tribW[" << i << "] = " << ribW[i] << "\tribPhi[" << i - << "] = " << convertRadToDeg(ribPhi[i]); + edm::LogVerbatim("TIBGeom") << "\tribW[" << i << "] = " << ribW[i] << "\tribPhi[" << i + << "] = " << convertRadToDeg(ribPhi[i]); } - LogDebug("TIBGeom") << "DOHM Primary " - << " Material " << dohmPrimMaterial << " Length " << dohmPrimL; - LogDebug("TIBGeom") << "DOHM Aux " - << " Material " << dohmAuxMaterial << " Length " << dohmAuxL; + edm::LogVerbatim("TIBGeom") << "DOHM Primary " + << " Material " << dohmPrimMaterial << " Length " << dohmPrimL; + edm::LogVerbatim("TIBGeom") << "DOHM Aux " + << " Material " << dohmAuxMaterial << " Length " << dohmAuxL; for (double i : dohmListFW) { if (i > 0.) - LogDebug("TIBGeom") << "DOHM Primary at FW Position " << i; + edm::LogVerbatim("TIBGeom") << "DOHM Primary at FW Position " << i; if (i < 0.) - LogDebug("TIBGeom") << "DOHM Aux at FW Position " << -i; + edm::LogVerbatim("TIBGeom") << "DOHM Aux at FW Position " << -i; } for (double i : dohmListBW) { if (i > 0.) - LogDebug("TIBGeom") << "DOHM Primary at BW Position " << i; + edm::LogVerbatim("TIBGeom") << "DOHM Primary at BW Position " << i; if (i < 0.) - LogDebug("TIBGeom") << "DOHM Aux at BW Position " << -i; + edm::LogVerbatim("TIBGeom") << "DOHM Aux at BW Position " << -i; } - LogDebug("TIBGeom") << "FW Internal Pillar [Dz, DPhi] " << fwIntPillarDz << ", " << fwIntPillarDPhi; + edm::LogVerbatim("TIBGeom") << "FW Internal Pillar [Dz, DPhi] " << fwIntPillarDz << ", " << fwIntPillarDPhi; for (unsigned int i = 0; i < fwIntPillarZ.size(); i++) { if (fwIntPillarPhi[i] > 0.) { - LogDebug("TIBGeom") << " at positions [z, phi] " << fwIntPillarZ[i] << " " << fwIntPillarPhi[i]; + edm::LogVerbatim("TIBGeom") << " at positions [z, phi] " << fwIntPillarZ[i] << " " << fwIntPillarPhi[i]; } } - LogDebug("TIBGeom") << "BW Internal Pillar [Dz, DPhi] " << bwIntPillarDz << ", " << bwIntPillarDPhi; + edm::LogVerbatim("TIBGeom") << "BW Internal Pillar [Dz, DPhi] " << bwIntPillarDz << ", " << bwIntPillarDPhi; for (unsigned int i = 0; i < bwIntPillarZ.size(); i++) { if (bwIntPillarPhi[i] > 0.) { - LogDebug("TIBGeom") << " at positions [z, phi] " << bwIntPillarZ[i] << " " << bwIntPillarPhi[i]; + edm::LogVerbatim("TIBGeom") << " at positions [z, phi] " << bwIntPillarZ[i] << " " << bwIntPillarPhi[i]; } } - LogDebug("TIBGeom") << "FW External Pillar [Dz, DPhi] " << fwExtPillarDz << ", " << fwExtPillarDPhi; + edm::LogVerbatim("TIBGeom") << "FW External Pillar [Dz, DPhi] " << fwExtPillarDz << ", " << fwExtPillarDPhi; for (unsigned int i = 0; i < fwExtPillarZ.size(); i++) { if (fwExtPillarPhi[i] > 0.) { - LogDebug("TIBGeom") << " at positions [z, phi] " << fwExtPillarZ[i] << " " << fwExtPillarPhi[i]; + edm::LogVerbatim("TIBGeom") << " at positions [z, phi] " << fwExtPillarZ[i] << " " << fwExtPillarPhi[i]; } } - LogDebug("TIBGeom") << "BW External Pillar [Dz, DPhi] " << bwExtPillarDz << ", " << bwExtPillarDPhi; + edm::LogVerbatim("TIBGeom") << "BW External Pillar [Dz, DPhi] " << bwExtPillarDz << ", " << bwExtPillarDPhi; for (unsigned int i = 0; i < bwExtPillarZ.size(); i++) { if (bwExtPillarPhi[i] > 0.) { - LogDebug("TIBGeom") << " at positions [z, phi] " << bwExtPillarZ[i] << " " << bwExtPillarPhi[i]; + edm::LogVerbatim("TIBGeom") << " at positions [z, phi] " << bwExtPillarZ[i] << " " << bwExtPillarPhi[i]; } } const string& idName = mother; double rmin = MFRingInR; double rmax = MFRingOutR; - Solid solid = ns.addSolidNS(idName, Tube(rmin, rmax, 0.5 * layerL)); - LogDebug("TIBGeom") << solid.name() << " Tubs made of " << genMat << " from 0 to " << convertRadToDeg(2_pi) - << " with Rin " << rmin << " Rout " << rmax << " ZHalf " << 0.5 * layerL; - Volume layer = ns.addVolumeNS(Volume(idName, solid, ns.material(genMat))); + Solid solid = ns.addSolidNS(ns.prepend(idName), Tube(rmin, rmax, 0.5 * layerL)); + edm::LogVerbatim("TIBGeom") << solid.name() << " Tubs made of " << genMat << " from 0 to " << convertRadToDeg(2_pi) + << " with Rin " << rmin << " Rout " << rmax << " ZHalf " << 0.5 * layerL; + Volume layer = ns.addVolumeNS(Volume(ns.prepend(idName), solid, ns.material(genMat))); //Internal layer first double rin = rmin + MFRingT; // double rout = 0.5*(radiusLo+radiusUp-cylinderT); double rout = cylinderInR; string name = idName + "Down"; - solid = ns.addSolidNS(name, Tube(rin, rout, 0.5 * layerL)); - LogDebug("TIBGeom") << solid.name() << " Tubs made of " << genMat << " from 0 to " << convertRadToDeg(2_pi) - << " with Rin " << rin << " Rout " << rout << " ZHalf " << 0.5 * layerL; - Volume layerIn = ns.addVolumeNS(Volume(name, solid, ns.material(genMat))); + solid = ns.addSolidNS(ns.prepend(name), Tube(rin, rout, 0.5 * layerL)); + edm::LogVerbatim("TIBGeom") << solid.name() << " Tubs made of " << genMat << " from 0 to " << convertRadToDeg(2_pi) + << " with Rin " << rin << " Rout " << rout << " ZHalf " << 0.5 * layerL; + Volume layerIn = ns.addVolumeNS(Volume(ns.prepend(name), solid, ns.material(genMat))); pv = layer.placeVolume(layerIn, 1); LogPosition(pv); @@ -180,10 +182,10 @@ static long algorithm(Detector& /* description */, cms::DDParsingContext& contex rin = cylinderInR + cylinderT; rout = rmax - MFRingT; name = idName + "Up"; - solid = ns.addSolidNS(name, Tube(rin, rout, 0.5 * layerL)); - LogDebug("TIBGeom") << solid.name() << " Tubs made of " << genMat << " from 0 to " << convertRadToDeg(2_pi) - << " with Rin " << rin << " Rout " << rout << " ZHalf " << 0.5 * layerL; - Volume layerOut = ns.addVolumeNS(Volume(name, solid, ns.material(genMat))); + solid = ns.addSolidNS(ns.prepend(name), Tube(rin, rout, 0.5 * layerL)); + edm::LogVerbatim("TIBGeom") << solid.name() << " Tubs made of " << genMat << " from 0 to " << convertRadToDeg(2_pi) + << " with Rin " << rin << " Rout " << rout << " ZHalf " << 0.5 * layerL; + Volume layerOut = ns.addVolumeNS(Volume(ns.prepend(name), solid, ns.material(genMat))); pv = layer.placeVolume(layerOut, 1); LogPosition(pv); @@ -208,10 +210,11 @@ static long algorithm(Detector& /* description */, cms::DDParsingContext& contex rin = cylinderInR; rout = cylinderInR + cylinderT; name = idName + "Cylinder"; - solid = ns.addSolidNS(name, Tube(rin, rout, 0.5 * layerL)); - LogDebug("TIBGeom") << solid.name() << " Tubs made of " << cylinderMat << " from 0 to " << convertRadToDeg(2_pi) - << " with Rin " << rin << " Rout " << rout << " ZHalf " << 0.5 * layerL; - Volume cylinder = ns.addVolumeNS(Volume(name, solid, ns.material(cylinderMat))); + solid = ns.addSolidNS(ns.prepend(name), Tube(rin, rout, 0.5 * layerL)); + edm::LogVerbatim("TIBGeom") << solid.name() << " Tubs made of " << cylinderMat << " from 0 to " + << convertRadToDeg(2_pi) << " with Rin " << rin << " Rout " << rout << " ZHalf " + << 0.5 * layerL; + Volume cylinder = ns.addVolumeNS(Volume(ns.prepend(name), solid, ns.material(cylinderMat))); pv = layer.placeVolume(cylinder, 1); LogPosition(pv); @@ -221,10 +224,10 @@ static long algorithm(Detector& /* description */, cms::DDParsingContext& contex rin += supportT; rout -= supportT; name = idName + "CylinderIn"; - solid = ns.addSolidNS(name, Tube(rin, rout, 0.5 * layerL)); - LogDebug("TIBGeom") << solid.name() << " Tubs made of " << genMat << " from 0 to " << convertRadToDeg(2_pi) - << " with Rin " << rin << " Rout " << rout << " ZHalf " << 0.5 * layerL; - Volume cylinderIn = ns.addVolumeNS(Volume(name, solid, ns.material(genMat))); + solid = ns.addSolidNS(ns.prepend(name), Tube(rin, rout, 0.5 * layerL)); + edm::LogVerbatim("TIBGeom") << solid.name() << " Tubs made of " << genMat << " from 0 to " << convertRadToDeg(2_pi) + << " with Rin " << rin << " Rout " << rout << " ZHalf " << 0.5 * layerL; + Volume cylinderIn = ns.addVolumeNS(Volume(ns.prepend(name), solid, ns.material(genMat))); pv = cylinder.placeVolume(cylinderIn, 1); LogPosition(pv); @@ -232,10 +235,11 @@ static long algorithm(Detector& /* description */, cms::DDParsingContext& contex // Filler Rings // name = idName + "Filler"; - solid = ns.addSolidNS(name, Tube(rin, rout, fillerDz)); - LogDebug("TIBGeom") << solid.name() << " Tubs made of " << fillerMat << " from " << 0. << " to " - << convertRadToDeg(2_pi) << " with Rin " << rin << " Rout " << rout << " ZHalf " << fillerDz; - Volume cylinderFiller = ns.addVolumeNS(Volume(name, solid, ns.material(fillerMat))); + solid = ns.addSolidNS(ns.prepend(name), Tube(rin, rout, fillerDz)); + edm::LogVerbatim("TIBGeom") << solid.name() << " Tubs made of " << fillerMat << " from " << 0. << " to " + << convertRadToDeg(2_pi) << " with Rin " << rin << " Rout " << rout << " ZHalf " + << fillerDz; + Volume cylinderFiller = ns.addVolumeNS(Volume(ns.prepend(name), solid, ns.material(fillerMat))); pv = cylinderIn.placeVolume(cylinderFiller, 1, Position(0.0, 0.0, 0.5 * layerL - fillerDz)); LogPosition(pv); @@ -252,11 +256,12 @@ static long algorithm(Detector& /* description */, cms::DDParsingContext& contex double dz = 0.5 * layerL - 2. * fillerDz; double _rmi = std::min(rin + 0.5 * dd4hep::mm, rout - 0.5 * dd4hep::mm); double _rma = std::max(rin + 0.5 * dd4hep::mm, rout - 0.5 * dd4hep::mm); - solid = ns.addSolidNS(name, Tube(_rmi, _rma, dz, -0.5 * width, 0.5 * width)); - LogDebug("TIBGeom") << solid.name() << " Tubs made of " << ribMat << " from " << -0.5 * convertRadToDeg(width) - << " to " << 0.5 * convertRadToDeg(width) << " with Rin " << rin + 0.5 * dd4hep::mm << " Rout " - << rout - 0.5 * dd4hep::mm << " ZHalf " << dz; - Volume cylinderRib = ns.addVolumeNS(Volume(name, solid, matrib)); + solid = ns.addSolidNS(ns.prepend(name), Tube(_rmi, _rma, dz, -0.5 * width, 0.5 * width)); + edm::LogVerbatim("TIBGeom") << solid.name() << " Tubs made of " << ribMat << " from " + << -0.5 * convertRadToDeg(width) << " to " << 0.5 * convertRadToDeg(width) + << " with Rin " << rin + 0.5 * dd4hep::mm << " Rout " << rout - 0.5 * dd4hep::mm + << " ZHalf " << dz; + Volume cylinderRib = ns.addVolumeNS(Volume(ns.prepend(name), solid, matrib)); double phix = ribPhi[i]; double theta = 90_deg; double phiy = phix + 90._deg; @@ -273,11 +278,12 @@ static long algorithm(Detector& /* description */, cms::DDParsingContext& contex rin = MFRingInR; rout = rin + MFRingT; name = idName + "InnerMFRing"; - solid = ns.addSolidNS(name, Tube(rin, rout, MFRingDz)); - LogDebug("TIBGeom") << solid.name() << " Tubs made of " << MFIntRingMat << " from 0 to " << convertRadToDeg(2_pi) - << " with Rin " << rin << " Rout " << rout << " ZHalf " << MFRingDz; + solid = ns.addSolidNS(ns.prepend(name), Tube(rin, rout, MFRingDz)); + edm::LogVerbatim("TIBGeom") << solid.name() << " Tubs made of " << MFIntRingMat << " from 0 to " + << convertRadToDeg(2_pi) << " with Rin " << rin << " Rout " << rout << " ZHalf " + << MFRingDz; - Volume inmfr = ns.addVolumeNS(Volume(name, solid, ns.material(MFIntRingMat))); + Volume inmfr = ns.addVolumeNS(Volume(ns.prepend(name), solid, ns.material(MFIntRingMat))); pv = layer.placeVolume(inmfr, 1, Position(0.0, 0.0, -0.5 * layerL + MFRingDz)); LogPosition(pv); @@ -289,11 +295,12 @@ static long algorithm(Detector& /* description */, cms::DDParsingContext& contex rout = MFRingOutR; rin = rout - MFRingT; name = idName + "OuterMFRing"; - solid = ns.addSolidNS(name, Tube(rin, rout, MFRingDz)); - LogDebug("TIBGeom") << solid.name() << " Tubs made of " << MFExtRingMat << " from 0 to " << convertRadToDeg(2_pi) - << " with Rin " << rin << " Rout " << rout << " ZHalf " << MFRingDz; + solid = ns.addSolidNS(ns.prepend(name), Tube(rin, rout, MFRingDz)); + edm::LogVerbatim("TIBGeom") << solid.name() << " Tubs made of " << MFExtRingMat << " from 0 to " + << convertRadToDeg(2_pi) << " with Rin " << rin << " Rout " << rout << " ZHalf " + << MFRingDz; - Volume outmfr = ns.addVolumeNS(Volume(name, solid, ns.material(MFExtRingMat))); + Volume outmfr = ns.addVolumeNS(Volume(ns.prepend(name), solid, ns.material(MFExtRingMat))); pv = layer.placeVolume(outmfr, 1, Position(0.0, 0.0, -0.5 * layerL + MFRingDz)); LogPosition(pv); pv = layer.placeVolume(outmfr, 2, Position(0.0, 0.0, +0.5 * layerL - MFRingDz)); @@ -308,12 +315,12 @@ static long algorithm(Detector& /* description */, cms::DDParsingContext& contex rin = centRing1par[2]; rout = centRing1par[3]; name = idName + "CentRing1"; - solid = ns.addSolidNS(name, Tube(rin, rout, centDz)); + solid = ns.addSolidNS(ns.prepend(name), Tube(rin, rout, centDz)); - LogDebug("TIBGeom") << solid.name() << " Tubs made of " << centMat << " from 0 to " << convertRadToDeg(2_pi) - << " with Rin " << rin << " Rout " << rout << " ZHalf " << centDz; + edm::LogVerbatim("TIBGeom") << solid.name() << " Tubs made of " << centMat << " from 0 to " << convertRadToDeg(2_pi) + << " with Rin " << rin << " Rout " << rout << " ZHalf " << centDz; - Volume cent1 = ns.addVolumeNS(Volume(name, solid, ns.material(centMat))); + Volume cent1 = ns.addVolumeNS(Volume(ns.prepend(name), solid, ns.material(centMat))); pv = layer.placeVolume(cent1, 1, Position(0.0, 0.0, centZ)); LogPosition(pv); // Ring 2 @@ -322,11 +329,11 @@ static long algorithm(Detector& /* description */, cms::DDParsingContext& contex rin = centRing2par[2]; rout = centRing2par[3]; name = idName + "CentRing2"; - solid = ns.addSolidNS(name, Tube(rin, rout, centDz)); - LogDebug("TIBGeom") << solid.name() << " Tubs made of " << centMat << " from 0 to " << convertRadToDeg(2_pi) - << " with Rin " << rin << " Rout " << rout << " ZHalf " << centDz; + solid = ns.addSolidNS(ns.prepend(name), Tube(rin, rout, centDz)); + edm::LogVerbatim("TIBGeom") << solid.name() << " Tubs made of " << centMat << " from 0 to " << convertRadToDeg(2_pi) + << " with Rin " << rin << " Rout " << rout << " ZHalf " << centDz; - Volume cent2 = ns.addVolumeNS(Volume(name, solid, ns.material(centMat))); + Volume cent2 = ns.addVolumeNS(Volume(ns.prepend(name), solid, ns.material(centMat))); pv = layer.placeVolume(cent2, 1, Position(0e0, 0e0, centZ)); LogPosition(pv); @@ -342,10 +349,11 @@ static long algorithm(Detector& /* description */, cms::DDParsingContext& contex double dohmCarrierZ = 0.5 * layerL - 2. * MFRingDz - dohmCarrierDz; solid = ns.addSolidNS( - name, Tube(dohmCarrierRin, dohmCarrierRout, dohmCarrierDz, dohmCarrierPhiOff, 180._deg - dohmCarrierPhiOff)); - LogDebug("TIBGeom") << solid.name() << " Tubs made of " << dohmCarrierMaterial << " from " << dohmCarrierPhiOff - << " to " << 180._deg - dohmCarrierPhiOff << " with Rin " << dohmCarrierRin << " Rout " - << MFRingOutR << " ZHalf " << dohmCarrierDz; + ns.prepend(name), + Tube(dohmCarrierRin, dohmCarrierRout, dohmCarrierDz, dohmCarrierPhiOff, 180._deg - dohmCarrierPhiOff)); + edm::LogVerbatim("TIBGeom") << solid.name() << " Tubs made of " << dohmCarrierMaterial << " from " + << dohmCarrierPhiOff << " to " << 180._deg - dohmCarrierPhiOff << " with Rin " + << dohmCarrierRin << " Rout " << MFRingOutR << " ZHalf " << dohmCarrierDz; // Define FW and BW carrier logical volume and // place DOHM Primary and auxiliary modules inside it @@ -367,7 +375,7 @@ static long algorithm(Detector& /* description */, cms::DDParsingContext& contex switch (j) { case 0: name = idName + "DOHMCarrierFW"; - dohmCarrier = ns.addVolumeNS(Volume(name, solid, ns.material(dohmCarrierMaterial))); + dohmCarrier = ns.addVolumeNS(Volume(ns.prepend(name), solid, ns.material(dohmCarrierMaterial))); dohmList = dohmListFW; tran = Position(0., 0., dohmCarrierZ); rotstr = idName + "FwUp"; @@ -387,7 +395,7 @@ static long algorithm(Detector& /* description */, cms::DDParsingContext& contex break; case 2: name = idName + "DOHMCarrierBW"; - dohmCarrier = ns.addVolumeNS(Volume(name, solid, ns.material(dohmCarrierMaterial))); + dohmCarrier = ns.addVolumeNS(Volume(ns.prepend(name), solid, ns.material(dohmCarrierMaterial))); dohmList = dohmListBW; tran = Position(0., 0., -dohmCarrierZ); rotstr = idName + "BwUp"; @@ -490,10 +498,11 @@ static long algorithm(Detector& /* description */, cms::DDParsingContext& contex break; } - solid = ns.addSolidNS(name, Tube(pillarRin, pillarRout, pillarDz, -pillarDPhi, pillarDPhi)); - Volume Pillar = ns.addVolumeNS(Volume(name, solid, ns.material(pillarMaterial))); - LogDebug("TIBGeom") << solid.name() << " Tubs made of " << pillarMaterial << " from " << -pillarDPhi << " to " - << pillarDPhi << " with Rin " << pillarRin << " Rout " << pillarRout << " ZHalf " << pillarDz; + solid = ns.addSolidNS(ns.prepend(name), Tube(pillarRin, pillarRout, pillarDz, -pillarDPhi, pillarDPhi)); + Volume Pillar = ns.addVolumeNS(Volume(ns.prepend(name), solid, ns.material(pillarMaterial))); + edm::LogVerbatim("TIBGeom") << solid.name() << " Tubs made of " << pillarMaterial << " from " << -pillarDPhi + << " to " << pillarDPhi << " with Rin " << pillarRin << " Rout " << pillarRout + << " ZHalf " << pillarDz; Position pillarTran; Rotation3D pillarRota; int pillarReplica = 0; diff --git a/Geometry/TrackerCommonData/plugins/dd4hep/DDTIDAxialCableAlgo.cc b/Geometry/TrackerCommonData/plugins/dd4hep/DDTIDAxialCableAlgo.cc index 07fdc959f2695..daf7c3ab9c92f 100644 --- a/Geometry/TrackerCommonData/plugins/dd4hep/DDTIDAxialCableAlgo.cc +++ b/Geometry/TrackerCommonData/plugins/dd4hep/DDTIDAxialCableAlgo.cc @@ -107,7 +107,7 @@ namespace { std::string name = childName + std::to_string(k); - Solid solid = ns.addSolid(name, Polycone(-0.5 * width, width, pconRmin, pconRmax, pconZ)); + Solid solid = ns.addSolid(ns.prepend(name), Polycone(-0.5 * width, width, pconRmin, pconRmax, pconZ)); LogVerbatim("TIDGeom") << "DDTIDAxialCableAlgo test: " << solid.name() << " Polycone made of " << matIn << " from " << convertRadToDeg(-0.5 * width) << " to " << convertRadToDeg(0.5 * width) @@ -142,7 +142,7 @@ namespace { std::string name = childName + std::to_string(zposWheel.size()); - Solid solid = ns.addSolid(name, Polycone(-0.5 * width, width, pconRmin, pconRmax, pconZ)); + Solid solid = ns.addSolid(ns.prepend(name), Polycone(-0.5 * width, width, pconRmin, pconRmax, pconZ)); LogVerbatim("TIDGeom") << "DDTIDAxialCableAlgo test: " << solid.name() << " Polycone made of " << matIn << " from " << convertRadToDeg(-0.5 * width) << " to " << convertRadToDeg(0.5 * width) << " and with " @@ -157,7 +157,7 @@ namespace { // Cable in the outer part name = childName + std::to_string(zposWheel.size() + 1); r = rTop - r; - solid = ns.addSolid(name, Tube(r, rTop, 0.5 * (zEnd - zBend), -0.5 * width, width)); + solid = ns.addSolid(ns.prepend(name), Tube(r, rTop, 0.5 * (zEnd - zBend), -0.5 * width, width)); LogVerbatim("TIDGeom") << "DDTIDAxialCableAlgo test: " << solid.name() << " Tubs made of " << matOut << " from " << convertRadToDeg(-0.5 * width) << " to " << convertRadToDeg(0.5 * width) << " with Rin " diff --git a/Geometry/TrackerCommonData/plugins/dd4hep/DDTIDModuleAlgo.cc b/Geometry/TrackerCommonData/plugins/dd4hep/DDTIDModuleAlgo.cc index 7c89675fac138..a00d7d8ccf3b1 100644 --- a/Geometry/TrackerCommonData/plugins/dd4hep/DDTIDModuleAlgo.cc +++ b/Geometry/TrackerCommonData/plugins/dd4hep/DDTIDModuleAlgo.cc @@ -73,42 +73,44 @@ static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, double coolThick = args.dble("CoolInsertThick"); // thickness double coolWidth = args.dble("CoolInsertWidth"); // width - LogDebug("TIDGeom") << "Parent " << mother << " General Material " << genMat << " Detector Planes " << detectorN; + edm::LogVerbatim("TIDGeom") << "Parent " << mother << " General Material " << genMat << " Detector Planes " + << detectorN; - LogDebug("TIDGeom") << "ModuleThick " << moduleThick << " Detector Tilt " << convertRadToDeg(detTilt) << " Height " - << fullHeight << " dl(Top) " << dlTop << " dl(Bottom) " << dlBottom << " dl(Hybrid) " << dlHybrid - << " doComponents " << doComponents; - LogDebug("TIDGeom") << "" << boxFrameName << " Material " << boxFrameMat << " Thickness " << boxFrameThick - << " width " << boxFrameWidth << " height " << boxFrameHeight << " Extra Height at Bottom " - << bottomFrameHeight << " Overlap " << bottomFrameOver; + edm::LogVerbatim("TIDGeom") << "ModuleThick " << moduleThick << " Detector Tilt " << convertRadToDeg(detTilt) + << " Height " << fullHeight << " dl(Top) " << dlTop << " dl(Bottom) " << dlBottom + << " dl(Hybrid) " << dlHybrid << " doComponents " << doComponents; + edm::LogVerbatim("TIDGeom") << "" << boxFrameName << " Material " << boxFrameMat << " Thickness " << boxFrameThick + << " width " << boxFrameWidth << " height " << boxFrameHeight + << " Extra Height at Bottom " << bottomFrameHeight << " Overlap " << bottomFrameOver; for (int i = 0; i < detectorN; i++) - LogDebug("TIDGeom") << sideFrameName[i] << " Material " << sideFrameMat << " Width " << sideFrameWidth - << " Thickness " << sideFrameThick << " Overlap " << sideFrameOver << " Hole " - << holeFrameName[i]; + edm::LogVerbatim("TIDGeom") << sideFrameName[i] << " Material " << sideFrameMat << " Width " << sideFrameWidth + << " Thickness " << sideFrameThick << " Overlap " << sideFrameOver << " Hole " + << holeFrameName[i]; for (int i = 0; i < detectorN; i++) - LogDebug("TIDGeom") << kaptonName[i] << " Material " << kaptonMat << " Thickness " << kaptonThick << " Overlap " - << kaptonOver << " Hole " << holeKaptonName[i]; + edm::LogVerbatim("TIDGeom") << kaptonName[i] << " Material " << kaptonMat << " Thickness " << kaptonThick + << " Overlap " << kaptonOver << " Hole " << holeKaptonName[i]; - LogDebug("TIDGeom") << "Wafer Material " << waferMat << " Side Width Top " << sideWidthTop << " Side Width Bottom " - << sideWidthBottom; + edm::LogVerbatim("TIDGeom") << "Wafer Material " << waferMat << " Side Width Top " << sideWidthTop + << " Side Width Bottom " << sideWidthBottom; for (int i = 0; i < detectorN; i++) - LogDebug("TIDGeom") << "\twaferName[" << i << "] = " << waferName[i]; + edm::LogVerbatim("TIDGeom") << "\twaferName[" << i << "] = " << waferName[i]; - LogDebug("TIDGeom") << "Active Material " << activeMat << " Height " << activeHeight << " rotated by " << activeRot; + edm::LogVerbatim("TIDGeom") << "Active Material " << activeMat << " Height " << activeHeight << " rotated by " + << activeRot; for (int i = 0; i < detectorN; i++) - LogDebug("TIDGeom") << " translated by (0," << -0.5 * backplaneThick[i] << ",0)\tactiveName[" << i - << "] = " << activeName[i] << " of thickness " << waferThick[i] - backplaneThick[i]; + edm::LogVerbatim("TIDGeom") << " translated by (0," << -0.5 * backplaneThick[i] << ",0)\tactiveName[" << i + << "] = " << activeName[i] << " of thickness " << waferThick[i] - backplaneThick[i]; - LogDebug("TIDGeom") << "" << hybridName << " Material " << hybridMat << " Height " << hybridHeight << " Width " - << hybridWidth << " Thickness " << hybridThick; - LogDebug("TIDGeom") << "Pitch Adapter Material " << pitchMat << " Height " << pitchHeight << " Thickness " - << pitchThick; + edm::LogVerbatim("TIDGeom") << "" << hybridName << " Material " << hybridMat << " Height " << hybridHeight + << " Width " << hybridWidth << " Thickness " << hybridThick; + edm::LogVerbatim("TIDGeom") << "Pitch Adapter Material " << pitchMat << " Height " << pitchHeight << " Thickness " + << pitchThick; for (int i = 0; i < detectorN; i++) - LogDebug("TIDGeom") << "\tpitchName[" << i << "] = " << pitchName[i]; - LogDebug("TIDGeom") << "Cool Element Material " << coolMat << " Height " << coolHeight << " Thickness " << coolThick - << " Width " << coolWidth; + edm::LogVerbatim("TIDGeom") << "\tpitchName[" << i << "] = " << pitchName[i]; + edm::LogVerbatim("TIDGeom") << "Cool Element Material " << coolMat << " Height " << coolHeight << " Thickness " + << coolThick << " Width " << coolWidth; string name = mother; double sidfr = sideFrameWidth - sideFrameOver; // width of side frame on the sides of module @@ -150,10 +152,11 @@ static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, double dx, dy; double dz = 0.5 * (boxFrameHeight + sideFrameHeight); - Solid solid = ns.addSolidNS(name, Trap(dz, 0, 0, h1, bl1, bl1, 0, h1, bl2, bl2, 0)); - /* Volume module = */ ns.addVolumeNS(Volume(name, solid, ns.material(genMat))); - LogDebug("TIDGeom") << solid.name() << " Trap made of " << genMat << " of dimensions " << dz << ", 0, 0, " << h1 - << ", " << bl1 << ", " << bl1 << ", 0, " << h1 << ", " << bl2 << ", " << bl2 << ", 0"; + Solid solid = ns.addSolidNS(ns.prepend(name), Trap(dz, 0, 0, h1, bl1, bl1, 0, h1, bl2, bl2, 0)); + /* Volume module = */ ns.addVolumeNS(Volume(ns.prepend(name), solid, ns.material(genMat))); + edm::LogVerbatim("TIDGeom") << solid.name() << " Trap made of " << genMat << " of dimensions " << dz << ", 0, 0, " + << h1 << ", " << bl1 << ", " << bl1 << ", 0, " << h1 << ", " << bl2 << ", " << bl2 + << ", 0"; if (doComponents) { //Box frame @@ -161,30 +164,30 @@ static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, dx = 0.5 * boxFrameWidth; dy = 0.5 * boxFrameThick; dz = 0.5 * boxFrameHeight; - solid = ns.addSolidNS(name, Box(dx, dy, dz)); - LogDebug("TIDGeom") << solid.name() << " Box made of " << boxFrameMat << " of dimensions " << dx << ", " << dy - << ", " << dz; - /* Volume boxFrame = */ ns.addVolumeNS(Volume(name, solid, ns.material(boxFrameMat))); + solid = ns.addSolidNS(ns.prepend(name), Box(dx, dy, dz)); + edm::LogVerbatim("TIDGeom") << solid.name() << " Box made of " << boxFrameMat << " of dimensions " << dx << ", " + << dy << ", " << dz; + /* Volume boxFrame = */ ns.addVolumeNS(Volume(ns.prepend(name), solid, ns.material(boxFrameMat))); // Hybrid name = hybridName; dx = 0.5 * hybridWidth; dy = 0.5 * hybridThick; dz = 0.5 * hybridHeight; - solid = ns.addSolidNS(name, Box(dx, dy, dz)); - LogDebug("TIDGeom") << solid.name() << " Box made of " << hybridMat << " of dimensions " << dx << ", " << dy << ", " - << dz; - /* Volume hybrid = */ ns.addVolumeNS(Volume(name, solid, ns.material(hybridMat))); + solid = ns.addSolidNS(ns.prepend(name), Box(dx, dy, dz)); + edm::LogVerbatim("TIDGeom") << solid.name() << " Box made of " << hybridMat << " of dimensions " << dx << ", " << dy + << ", " << dz; + /* Volume hybrid = */ ns.addVolumeNS(Volume(ns.prepend(name), solid, ns.material(hybridMat))); // Cool Insert name = coolName; dx = 0.5 * coolWidth; dy = 0.5 * coolThick; dz = 0.5 * coolHeight; - solid = ns.addSolidNS(name, Box(dx, dy, dz)); - LogDebug("TIDGeom") << solid.name() << " Box made of " << coolMat << " of dimensions " << dx << ", " << dy << ", " - << dz; - /* Volume cool = */ ns.addVolumeNS(Volume(name, solid, ns.material(coolMat))); + solid = ns.addSolidNS(ns.prepend(name), Box(dx, dy, dz)); + edm::LogVerbatim("TIDGeom") << solid.name() << " Box made of " << coolMat << " of dimensions " << dx << ", " << dy + << ", " << dz; + /* Volume cool = */ ns.addVolumeNS(Volume(ns.prepend(name), solid, ns.material(coolMat))); // Loop over detectors to be placed for (int k = 0; k < detectorN; k++) { @@ -202,11 +205,11 @@ static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, } h1 = 0.5 * sideFrameThick; dz = 0.5 * sideFrameHeight; - solid = ns.addSolidNS(name, Trap(dz, 0., 0., h1, bbl1, bbl1, 0., h1, bbl2, bbl2, 0.)); - LogDebug("TIDGeom") << solid.name() << " Trap made of " << sideFrameMat << " of dimensions " << dz << ", 0, 0, " - << h1 << ", " << bbl1 << ", " << bbl1 << ", 0, " << h1 << ", " << bbl2 << ", " << bbl2 - << ", 0"; - Volume sideFrame = ns.addVolumeNS(Volume(name, solid, ns.material(sideFrameMat))); + solid = ns.addSolidNS(ns.prepend(name), Trap(dz, 0., 0., h1, bbl1, bbl1, 0., h1, bbl2, bbl2, 0.)); + edm::LogVerbatim("TIDGeom") << solid.name() << " Trap made of " << sideFrameMat << " of dimensions " << dz + << ", 0, 0, " << h1 << ", " << bbl1 << ", " << bbl1 << ", 0, " << h1 << ", " << bbl2 + << ", " << bbl2 << ", 0"; + Volume sideFrame = ns.addVolumeNS(Volume(ns.prepend(name), solid, ns.material(sideFrameMat))); std::string rotstr, rotns; Rotation3D rot; @@ -225,15 +228,16 @@ static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, zpos = bottomFrameHeight + 0.5 * dz - 0.5 * sideFrameHeight; } dz /= 2.; - solid = ns.addSolidNS(name, Trap(dz, 0, 0, h1, bbl1, bbl1, 0, h1, bbl2, bbl2, 0)); - LogDebug("TIDGeom") << solid.name() << " Trap made of " << genMat << " of dimensions " << dz << ", 0, 0, " << h1 - << ", " << bbl1 << ", " << bbl1 << ", 0, " << h1 << ", " << bbl2 << ", " << bbl2 << ", 0"; - Volume holeFrame = ns.addVolumeNS(Volume(name, solid, ns.material(genMat))); + solid = ns.addSolidNS(ns.prepend(name), Trap(dz, 0, 0, h1, bbl1, bbl1, 0, h1, bbl2, bbl2, 0)); + edm::LogVerbatim("TIDGeom") << solid.name() << " Trap made of " << genMat << " of dimensions " << dz << ", 0, 0, " + << h1 << ", " << bbl1 << ", " << bbl1 << ", 0, " << h1 << ", " << bbl2 << ", " << bbl2 + << ", 0"; + Volume holeFrame = ns.addVolumeNS(Volume(ns.prepend(name), solid, ns.material(genMat))); rot = ns.rotation(holeFrameRot[k]); sideFrame.placeVolume(holeFrame, 1, Transform3D(rot, Position(0e0, 0e0, zpos))); // copyNr=1 - LogDebug("TIDGeom") << holeFrame.name() << " number 1 positioned in " << sideFrame.name() << " at (0,0," << zpos - << ") with no rotation"; + edm::LogVerbatim("TIDGeom") << holeFrame.name() << " number 1 positioned in " << sideFrame.name() << " at (0,0," + << zpos << ") with no rotation"; // Kapton circuit double kaptonExtraHeight = 0; // kapton extra height in the stereo @@ -265,7 +269,7 @@ static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, if (k == 1) { // Uncut solid Solid solidUncut = - ns.addSolidNS(kaptonName[k] + "Uncut", Trap(dz, 0., 0., h1, bbl1, bbl1, 0., h1, bbl2, bbl2, 0)); + ns.addSolidNS(ns.prepend(kaptonName[k] + "Uncut"), Trap(dz, 0., 0., h1, bbl1, bbl1, 0., h1, bbl2, bbl2, 0)); // Piece to be cut dz = (dlHybrid > dlTop) ? 0.5 * dlTop : 0.5 * dlBottom; @@ -274,24 +278,24 @@ static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, bbl2 = bbl1 * 0.000001; double thet = atan((bbl1 - bbl2) / (2 * dz)); Solid solidCut = - ns.addSolidNS(kaptonName[k] + "Cut", Trap(dz, thet, 0., h1, bbl1, bbl1, 0., h1, bbl2, bbl2, 0)); + ns.addSolidNS(ns.prepend(kaptonName[k] + "Cut"), Trap(dz, thet, 0., h1, bbl1, bbl1, 0., h1, bbl2, bbl2, 0)); // Subtraction Solid name = kaptonName[k]; rot = ns.rotation("tidmodpar:9PYX"); xpos = -0.5 * fullHeight * sin(detTilt); zpos = 0.5 * kaptonHeight - bbl2; - solid = - ns.addSolidNS(name, SubtractionSolid(solidUncut, solidCut, Transform3D(rot, Position(xpos, 0.0, zpos)))); + solid = ns.addSolidNS(ns.prepend(name), + SubtractionSolid(solidUncut, solidCut, Transform3D(rot, Position(xpos, 0.0, zpos)))); } else { name = kaptonName[k]; - solid = ns.addSolidNS(name, Trap(dz, 0., 0., h1, bbl1, bbl1, 0., h1, bbl2, bbl2, 0.)); + solid = ns.addSolidNS(ns.prepend(name), Trap(dz, 0., 0., h1, bbl1, bbl1, 0., h1, bbl2, bbl2, 0.)); } - Volume kapton = ns.addVolumeNS(Volume(name, solid, ns.material(kaptonMat))); - LogDebug("TIDGeom") << solid.name() << " SUBTRACTION SOLID Trap made of " << kaptonMat << " of dimensions " << dz - << ", 0, 0, " << h1 << ", " << bbl1 << ", " << bbl1 << ", 0, " << h1 << ", " << bbl2 << ", " - << bbl2 << ", 0"; + Volume kapton = ns.addVolumeNS(Volume(ns.prepend(name), solid, ns.material(kaptonMat))); + edm::LogVerbatim("TIDGeom") << solid.name() << " SUBTRACTION SOLID Trap made of " << kaptonMat + << " of dimensions " << dz << ", 0, 0, " << h1 << ", " << bbl1 << ", " << bbl1 + << ", 0, " << h1 << ", " << bbl2 << ", " << bbl2 << ", 0"; // Hole in the kapton below the wafer name = holeKaptonName[k]; @@ -313,15 +317,16 @@ static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, zpos = -0.5 * (kaptonHeight - kaptonExtraHeight - dz); } dz /= 2.; - solid = ns.addSolidNS(name, Trap(dz, 0., 0., h1, bbl1, bbl1, 0., h1, bbl2, bbl2, 0.)); - LogDebug("TIDGeom") << solid.name() << " Trap made of " << genMat << " of dimensions " << dz << ", 0, 0, " << h1 - << ", " << bbl1 << ", " << bbl1 << ", 0, " << h1 << ", " << bbl2 << ", " << bbl2 << ", 0"; - Volume holeKapton = ns.addVolumeNS(Volume(name, solid, ns.material(genMat))); + solid = ns.addSolidNS(ns.prepend(name), Trap(dz, 0., 0., h1, bbl1, bbl1, 0., h1, bbl2, bbl2, 0.)); + edm::LogVerbatim("TIDGeom") << solid.name() << " Trap made of " << genMat << " of dimensions " << dz << ", 0, 0, " + << h1 << ", " << bbl1 << ", " << bbl1 << ", 0, " << h1 << ", " << bbl2 << ", " << bbl2 + << ", 0"; + Volume holeKapton = ns.addVolumeNS(Volume(ns.prepend(name), solid, ns.material(genMat))); rot = ns.rotation(holeKaptonRot[k]); kapton.placeVolume(holeKapton, 1, Transform3D(rot, Position(xpos, 0.0, zpos))); - LogDebug("TIDGeom") << holeKapton.name() << " number 1 positioned in " << kapton.name() << " at (0,0," << zpos - << ") with no rotation"; + edm::LogVerbatim("TIDGeom") << holeKapton.name() << " number 1 positioned in " << kapton.name() << " at (0,0," + << zpos << ") with no rotation"; // Wafer name = waferName[k]; @@ -334,10 +339,11 @@ static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, } h1 = 0.5 * waferThick[k]; dz = 0.5 * fullHeight; - solid = ns.addSolidNS(name, Trap(dz, 0, 0, h1, bl1, bl1, 0, h1, bl2, bl2, 0)); - LogDebug("TIDGeom") << solid.name() << " Trap made of " << waferMat << " of dimensions " << dz << ", 0, 0, " << h1 - << ", " << bl1 << ", " << bl1 << ", 0, " << h1 << ", " << bl2 << ", " << bl2 << ", 0"; - Volume wafer = ns.addVolumeNS(Volume(name, solid, ns.material(waferMat))); + solid = ns.addSolidNS(ns.prepend(name), Trap(dz, 0, 0, h1, bl1, bl1, 0, h1, bl2, bl2, 0)); + edm::LogVerbatim("TIDGeom") << solid.name() << " Trap made of " << waferMat << " of dimensions " << dz + << ", 0, 0, " << h1 << ", " << bl1 << ", " << bl1 << ", 0, " << h1 << ", " << bl2 + << ", " << bl2 << ", 0"; + Volume wafer = ns.addVolumeNS(Volume(ns.prepend(name), solid, ns.material(waferMat))); // Active name = activeName[k]; @@ -350,15 +356,16 @@ static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, } dz = 0.5 * (waferThick[k] - backplaneThick[k]); // inactive backplane h1 = 0.5 * activeHeight; - solid = ns.addSolidNS(name, Trap(dz, 0, 0, h1, bl2, bl1, 0, h1, bl2, bl1, 0)); - LogDebug("TIDGeom") << solid.name() << " Trap made of " << activeMat << " of dimensions " << dz << ", 0, 0, " - << h1 << ", " << bl2 << ", " << bl1 << ", 0, " << h1 << ", " << bl2 << ", " << bl1 << ", 0"; - Volume active = ns.addVolumeNS(Volume(name, solid, ns.material(activeMat))); + solid = ns.addSolidNS(ns.prepend(name), Trap(dz, 0, 0, h1, bl2, bl1, 0, h1, bl2, bl1, 0)); + edm::LogVerbatim("TIDGeom") << solid.name() << " Trap made of " << activeMat << " of dimensions " << dz + << ", 0, 0, " << h1 << ", " << bl2 << ", " << bl1 << ", 0, " << h1 << ", " << bl2 + << ", " << bl1 << ", 0"; + Volume active = ns.addVolumeNS(Volume(ns.prepend(name), solid, ns.material(activeMat))); rot = ns.rotation(activeRot); Position tran(0.0, -0.5 * backplaneThick[k], 0.0); // from the definition of the wafer local axes wafer.placeVolume(active, 1, Transform3D(rot, tran)); // inactive backplane copyNr=1 - LogDebug("TIDGeom") << "DDTIDModuleAlgo test: " << active.name() << " number 1 positioned in " << wafer.name() - << " at " << tran << " with " << rot; + edm::LogVerbatim("TIDGeom") << "DDTIDModuleAlgo test: " << active.name() << " number 1 positioned in " + << wafer.name() << " at " << tran << " with " << rot; //Pitch Adapter name = pitchName[k]; @@ -371,9 +378,9 @@ static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, dx = dz; dy = 0.5 * pitchThick; dz = 0.5 * pitchHeight; - solid = ns.addSolidNS(name, Box(dx, dy, dz)); - LogDebug("TIDGeom") << solid.name() << " Box made of " << pitchMat << " of dimensions" - << " " << dx << ", " << dy << ", " << dz; + solid = ns.addSolidNS(ns.prepend(name), Box(dx, dy, dz)); + edm::LogVerbatim("TIDGeom") << solid.name() << " Box made of " << pitchMat << " of dimensions" + << " " << dx << ", " << dy << ", " << dz; } else { h1 = 0.5 * pitchThick; bl1 = 0.5 * pitchHeight + 0.5 * dz * sin(detTilt); @@ -384,15 +391,15 @@ static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, bl2 -= pitchStereoTol; double thet = atan((bl1 - bl2) / (2. * dz)); - solid = ns.addSolidNS(name, Trap(dz, thet, 0, h1, bl1, bl1, 0, h1, bl2, bl2, 0)); - LogDebug("TIDGeom") << solid.name() << " Trap made of " << pitchMat << " of " - << "dimensions " << dz << ", " << convertRadToDeg(thet) << ", 0, " << h1 << ", " << bl1 - << ", " << bl1 << ", 0, " << h1 << ", " << bl2 << ", " << bl2 << ", 0"; + solid = ns.addSolidNS(ns.prepend(name), Trap(dz, thet, 0, h1, bl1, bl1, 0, h1, bl2, bl2, 0)); + edm::LogVerbatim("TIDGeom") << solid.name() << " Trap made of " << pitchMat << " of " + << "dimensions " << dz << ", " << convertRadToDeg(thet) << ", 0, " << h1 << ", " + << bl1 << ", " << bl1 << ", 0, " << h1 << ", " << bl2 << ", " << bl2 << ", 0"; } - /* Volume pa = */ ns.addVolumeNS(Volume(name, solid, ns.material(pitchMat))); + /* Volume pa = */ ns.addVolumeNS(Volume(ns.prepend(name), solid, ns.material(pitchMat))); } } - LogDebug("TIDGeom") << "<<== End of DDTIDModuleAlgo construction ..."; + edm::LogVerbatim("TIDGeom") << "<<== End of DDTIDModuleAlgo construction ..."; return 1; } diff --git a/Geometry/TrackerCommonData/plugins/dd4hep/DDTIDModulePosAlgo.cc b/Geometry/TrackerCommonData/plugins/dd4hep/DDTIDModulePosAlgo.cc index 90930bfec9a77..13ac75c25b683 100644 --- a/Geometry/TrackerCommonData/plugins/dd4hep/DDTIDModulePosAlgo.cc +++ b/Geometry/TrackerCommonData/plugins/dd4hep/DDTIDModulePosAlgo.cc @@ -65,27 +65,27 @@ static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, double sidSpacersWidth = args.dble("SideSpacersWidth"); // width double sidSpacersRadShift = args.dble("SideSpacersShift"); // - LogDebug("TIDGeom") << "Parent " << parentName << " Detector Planes " << detectorN; - LogDebug("TIDGeom") << "Detector Tilt " << convertRadToDeg(detTilt) << " Height " << fullHeight << " dl(Top) " - << dlTop << " dl(Bottom) " << dlBottom << " dl(Hybrid) " << dlHybrid; - LogDebug("TIDGeom") << boxFrameName << " positioned at Z"; + edm::LogVerbatim("TIDGeom") << "Parent " << parentName << " Detector Planes " << detectorN; + edm::LogVerbatim("TIDGeom") << "Detector Tilt " << convertRadToDeg(detTilt) << " Height " << fullHeight << " dl(Top) " + << dlTop << " dl(Bottom) " << dlBottom << " dl(Hybrid) " << dlHybrid; + edm::LogVerbatim("TIDGeom") << boxFrameName << " positioned at Z"; for (int i = 0; i < detectorN; i++) - LogDebug("TIDGeom") << "\tboxFrameZ[" << i << "] = " << boxFrameZ[i]; - LogDebug("TIDGeom") << "\t Extra Height at Bottom " << bottomFrameHeight << " Overlap " << bottomFrameOver; + edm::LogVerbatim("TIDGeom") << "\tboxFrameZ[" << i << "] = " << boxFrameZ[i]; + edm::LogVerbatim("TIDGeom") << "\t Extra Height at Bottom " << bottomFrameHeight << " Overlap " << bottomFrameOver; for (int i = 0; i < detectorN; i++) - LogDebug("TIDGeom") << "\tsideFrame[" << i << "] = " << sideFrameName[i] << " positioned at Z " << sideFrameZ[i] - << " with rotation " << sideFrameRot[i]; + edm::LogVerbatim("TIDGeom") << "\tsideFrame[" << i << "] = " << sideFrameName[i] << " positioned at Z " + << sideFrameZ[i] << " with rotation " << sideFrameRot[i]; for (int i = 0; i < detectorN; i++) - LogDebug("TIDGeom") << "\tkapton[" << i << "] = " << kaptonName[i] << " positioned at Z " << kaptonZ[i] - << " with rotation " << kaptonRot[i]; + edm::LogVerbatim("TIDGeom") << "\tkapton[" << i << "] = " << kaptonName[i] << " positioned at Z " << kaptonZ[i] + << " with rotation " << kaptonRot[i]; for (int i = 0; i < detectorN; i++) - LogDebug("TIDGeom") << waferName[i] << " positioned at Z " << waferZ[i] << " with rotation " << waferRot[i]; - LogDebug("TIDGeom") << hybridName << " Height " << hybridHeight << " Z"; + edm::LogVerbatim("TIDGeom") << waferName[i] << " positioned at Z " << waferZ[i] << " with rotation " << waferRot[i]; + edm::LogVerbatim("TIDGeom") << hybridName << " Height " << hybridHeight << " Z"; for (int i = 0; i < detectorN; i++) - LogDebug("TIDGeom") << "\thybridZ[" << i << "] = " << hybridZ[i]; - LogDebug("TIDGeom") << "Pitch Adapter Height " << pitchHeight; + edm::LogVerbatim("TIDGeom") << "\thybridZ[" << i << "] = " << hybridZ[i]; + edm::LogVerbatim("TIDGeom") << "Pitch Adapter Height " << pitchHeight; for (int i = 0; i < detectorN; i++) - LogDebug("TIDGeom") << pitchName[i] << " position at Z " << pitchZ[i] << " with rotation " << pitchRot[i]; + edm::LogVerbatim("TIDGeom") << pitchName[i] << " position at Z " << pitchZ[i] << " with rotation " << pitchRot[i]; string name; double botfr; // width of side frame at the the bottom of the modules @@ -162,8 +162,8 @@ static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, for (int j2 = 0; j2 < 2; j2++) { copy++; parentVol.placeVolume(ns.volume(name), copy, Position(xpos, ypos, zpos)); - LogDebug("TIDGeom") << name << " number " << copy << " positioned in " << parentName << " at " - << Position(xpos, ypos, zpos) << " with " << rot; + edm::LogVerbatim("TIDGeom") << name << " number " << copy << " positioned in " << parentName << " at " + << Position(xpos, ypos, zpos) << " with " << rot; xpos = -xpos; } } @@ -180,8 +180,8 @@ static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, } zpos = zBotSpacers - zCenter; parentVol.placeVolume(ns.volume(name), 1, Position(0.0, ypos, zpos)); - LogDebug("TIDGeom") << name << " number " << 1 << " positioned in " << parentName << " at " - << Position(0.0, ypos, zpos) << " with no rotation"; + edm::LogVerbatim("TIDGeom") << name << " number " << 1 << " positioned in " << parentName << " at " + << Position(0.0, ypos, zpos) << " with no rotation"; // Side Spacers (Alumina) name = sidSpacersName; ypos = sidSpacersZ; @@ -211,8 +211,8 @@ static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, thetax = 90._deg + thetaz; rot = makeRotation3D(thetax, phix, thetay, phiy, thetaz, phiz); parentVol.placeVolume(ns.volume(name), copy, Transform3D(rot, Position(xpos, ypos, zpos))); - LogDebug("TIDGeom") << name << " number " << copy << " positioned in " << parentName << " at " - << Position(xpos, ypos, zpos) << " with " << rot; + edm::LogVerbatim("TIDGeom") << name << " number " << copy << " positioned in " << parentName << " at " + << Position(xpos, ypos, zpos) << " with " << rot; xpos = -xpos; thetaz = -thetaz; } @@ -235,8 +235,8 @@ static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, rot = ns.rotation(waferRot[k]); parentVol.placeVolume(ns.volume(name), k + 1, Transform3D(rot, tran)); // copyNr=k+1 - LogDebug("TIDGeom") << name << " number " << k + 1 << " positioned in " << parentName << " at " << tran << " with " - << rot; + edm::LogVerbatim("TIDGeom") << name << " number " << k + 1 << " positioned in " << parentName << " at " << tran + << " with " << rot; //Pitch Adapter name = pitchName[k]; @@ -256,8 +256,8 @@ static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, rot = ns.rotation(pitchRot[k]); tran = Position(xpos, ypos, zpos); parentVol.placeVolume(ns.volume(name), k + 1, Transform3D(rot, tran)); // copyNr=k+1 - LogDebug("TIDGeom") << name << " number " << k + 1 << " positioned in " << parentName << " at " << tran << " with " - << rot; + edm::LogVerbatim("TIDGeom") << name << " number " << k + 1 << " positioned in " << parentName << " at " << tran + << " with " << rot; // Hybrid name = hybridName; @@ -271,7 +271,7 @@ static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, zpos = zHybrid - zCenter; tran = Position(0, ypos, zpos); parentVol.placeVolume(ns.volume(name), k + 1, tran); // copyNr=k+1 - LogDebug("TIDGeom") << name << " number " << k + 1 << " positioned in " << parentName << " at " << tran; + edm::LogVerbatim("TIDGeom") << name << " number " << k + 1 << " positioned in " << parentName << " at " << tran; // Box frame name = boxFrameName; @@ -285,7 +285,7 @@ static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, zpos = zBoxFrame - zCenter; tran = Position(0, ypos, zpos); parentVol.placeVolume(ns.volume(name), k + 1, tran); // copyNr=k+1 - LogDebug("TIDGeom") << name << " number " << k + 1 << " positioned in " << parentName << " at " << tran; + edm::LogVerbatim("TIDGeom") << name << " number " << k + 1 << " positioned in " << parentName << " at " << tran; // Side frame name = sideFrameName[k]; @@ -300,8 +300,8 @@ static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, rot = ns.rotation(sideFrameRot[k]); tran = Position(0, ypos, zpos); parentVol.placeVolume(ns.volume(name), k + 1, Transform3D(rot, tran)); - LogDebug("TIDGeom") << name << " number " << k + 1 << " positioned in " << parentName << " at " << tran << " with " - << rot; + edm::LogVerbatim("TIDGeom") << name << " number " << k + 1 << " positioned in " << parentName << " at " << tran + << " with " << rot; // Kapton circuit name = kaptonName[k]; ypos = kaptonZ[k]; @@ -322,10 +322,10 @@ static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, rot = ns.rotation(kaptonRot[k]); tran = Position(0, ypos, zpos); parentVol.placeVolume(ns.volume(name), k + 1, Transform3D(rot, tran)); - LogDebug("TIDGeom") << name << " number " << k + 1 << " positioned in " << parentName << " at " << tran << " with " - << rot; + edm::LogVerbatim("TIDGeom") << name << " number " << k + 1 << " positioned in " << parentName << " at " << tran + << " with " << rot; } - LogDebug("TIDGeom") << "<<== End of DDTIDModulePosAlgo positioning ..."; + edm::LogVerbatim("TIDGeom") << "<<== End of DDTIDModulePosAlgo positioning ..."; return 1; } diff --git a/Geometry/TrackerCommonData/plugins/dd4hep/DDTIDRingAlgo.cc b/Geometry/TrackerCommonData/plugins/dd4hep/DDTIDRingAlgo.cc index 88faaf5ac6668..50f4a47ea7331 100644 --- a/Geometry/TrackerCommonData/plugins/dd4hep/DDTIDRingAlgo.cc +++ b/Geometry/TrackerCommonData/plugins/dd4hep/DDTIDRingAlgo.cc @@ -22,12 +22,12 @@ static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, double sICC = args.value("ICCShift"); //Shift of ICC per to R vector zICC = args.value >("ICCZ"); // in Z - LogDebug("TIDGeom") << "Parent " << mother.name() << "\tModule " << moduleName[0] << ", " << moduleName[1] << "\tICC " - << iccName << "\tNameSpace " << ns.name(); - LogDebug("TIDGeom") << "Parameters for positioning--" - << " StartAngle " << convertRadToDeg(startAngle) << " Copy Numbers " << number << " Modules at R " - << rModule << " Z " << zModule[0] << ", " << zModule[1] << " ICCs at R " << rICC << " Z " - << zICC[0] << ", " << zICC[1]; + edm::LogVerbatim("TIDGeom") << "Parent " << mother.name() << "\tModule " << moduleName[0] << ", " << moduleName[1] + << "\tICC " << iccName << "\tNameSpace " << ns.name(); + edm::LogVerbatim("TIDGeom") << "Parameters for positioning--" + << " StartAngle " << convertRadToDeg(startAngle) << " Copy Numbers " << number + << " Modules at R " << rModule << " Z " << zModule[0] << ", " << zModule[1] + << " ICCs at R " << rICC << " Z " << zICC[0] << ", " << zICC[1]; double theta = 90._deg; double phiy = 0._deg; double dphi = 2_pi / number; @@ -63,8 +63,8 @@ static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, Rotation3D rotation = makeRotation3D(theta, phix, thetay, phiy, theta, phiz); // int copyNr = i+1; /* PlacedVolume pv = */ mother.placeVolume(module, i + 1, Transform3D(rotation, trmod)); - LogDebug("TIDGeom") << module.name() << " number " << i + 1 << " positioned in " << mother.name() << " at " << trmod - << " with " << rotation; + edm::LogVerbatim("TIDGeom") << module.name() << " number " << i + 1 << " positioned in " << mother.name() << " at " + << trmod << " with " << rotation; //Now the ICC if (i % 2 == 0) { zpos = zICC[0]; @@ -78,8 +78,8 @@ static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, // int copyNr = i+1; Position tricc(xpos, ypos, zpos); /* PlacedVolume pv = */ mother.placeVolume(icc, i + 1, Transform3D(rotation, tricc)); - LogDebug("TIDGeom") << iccName << " number " << i + 1 << " positioned in " << mother.name() << " at " << tricc - << " with " << rotation; + edm::LogVerbatim("TIDGeom") << icc.name() << " number " << i + 1 << " positioned in " << mother.name() << " at " + << tricc << " with " << rotation; } return 1; } diff --git a/Geometry/TrackerCommonData/plugins/dd4hep/DDTOBAxCableAlgo.cc b/Geometry/TrackerCommonData/plugins/dd4hep/DDTOBAxCableAlgo.cc index c59c9f268e94e..e20a0aa80f93f 100644 --- a/Geometry/TrackerCommonData/plugins/dd4hep/DDTOBAxCableAlgo.cc +++ b/Geometry/TrackerCommonData/plugins/dd4hep/DDTOBAxCableAlgo.cc @@ -22,25 +22,25 @@ static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, vector sectorMaterial_C = args.vecStr("SectorMaterial_C"); // Material for the C sectors for (int i = 0; i < (int)(sectorNumber.size()); i++) - LogDebug("TOBGeom") << "DDTOBAxCableAlgo debug: sectorNumber[" << i << "] = " << sectorNumber[i]; + edm::LogVerbatim("TOBGeom") << "DDTOBAxCableAlgo debug: sectorNumber[" << i << "] = " << sectorNumber[i]; - LogDebug("TOBGeom") << "DDTOBAxCableAlgo debug: Axial Service Sectors half-length " << sectorDz << "\tRin " - << sectorRin << "\tRout = " << sectorRout << "\tPhi of sectors position:"; + edm::LogVerbatim("TOBGeom") << "DDTOBAxCableAlgo debug: Axial Service Sectors half-length " << sectorDz << "\tRin " + << sectorRin << "\tRout = " << sectorRout << "\tPhi of sectors position:"; for (int i = 0; i < (int)(sectorNumber.size()); i++) - LogDebug("TOBGeom") << "\t[" << i << "]\tPhi = " << sectorStartPhi[i]; - LogDebug("TOBGeom") << "DDTOBAxCableAlgo debug: List of materials for the sectors/3 parts"; + edm::LogVerbatim("TOBGeom") << "\t[" << i << "]\tPhi = " << sectorStartPhi[i]; + edm::LogVerbatim("TOBGeom") << "DDTOBAxCableAlgo debug: List of materials for the sectors/3 parts"; // - LogDebug("TOBGeom") << "DDTOBAxCableAlgo debug: Sector/3 A"; + edm::LogVerbatim("TOBGeom") << "DDTOBAxCableAlgo debug: Sector/3 A"; for (int i = 0; i < (int)(sectorNumber.size()); i++) - LogDebug("TOBGeom") << "\t[" << i << "]\tsectorMaterial_A = " << sectorMaterial_A[i]; + edm::LogVerbatim("TOBGeom") << "\t[" << i << "]\tsectorMaterial_A = " << sectorMaterial_A[i]; // - LogDebug("TOBGeom") << "DDTOBAxCableAlgo debug: Sector/3 B"; + edm::LogVerbatim("TOBGeom") << "DDTOBAxCableAlgo debug: Sector/3 B"; for (int i = 0; i < (int)(sectorNumber.size()); i++) - LogDebug("TOBGeom") << "\t[" << i << "]\tsectorMaterial_B = " << sectorMaterial_B[i]; + edm::LogVerbatim("TOBGeom") << "\t[" << i << "]\tsectorMaterial_B = " << sectorMaterial_B[i]; // - LogDebug("TOBGeom") << "DDTOBAxCableAlgo debug: Sector/3 C"; + edm::LogVerbatim("TOBGeom") << "DDTOBAxCableAlgo debug: Sector/3 C"; for (int i = 0; i < (int)(sectorNumber.size()); i++) - LogDebug("TOBGeom") << "\t[" << i << "]\tsectorMaterial_C = " << sectorMaterial_C[i]; + edm::LogVerbatim("TOBGeom") << "\t[" << i << "]\tsectorMaterial_C = " << sectorMaterial_C[i]; string tubsName = args.parentName(); Volume tubsVol = ns.volume(tubsName); @@ -62,43 +62,43 @@ static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, rout = sectorRout; startphi = sectorStartPhi[i]; deltaphi = 0.5 * (widthphi - sectorDeltaPhi_B); - solid = ns.addSolid(name, Tube(rin, rout, dz, startphi, startphi + deltaphi)); - LogDebug("TOBGeom") << solid.name() << " Tubs made of " << sectorMaterial_A[i] << " from " - << convertRadToDeg(startphi) << " to " << convertRadToDeg((startphi + deltaphi)) << " with Rin " - << rin << " Rout " << rout << " ZHalf " << dz; - Volume sectorLogic = ns.addVolume(Volume(name, solid, ns.material(sectorMaterial_A[i]))); + solid = ns.addSolid(ns.prepend(name), Tube(rin, rout, dz, startphi, startphi + deltaphi)); + edm::LogVerbatim("TOBGeom") << solid.name() << " Tubs made of " << sectorMaterial_A[i] << " from " + << convertRadToDeg(startphi) << " to " << convertRadToDeg((startphi + deltaphi)) + << " with Rin " << rin << " Rout " << rout << " ZHalf " << dz; + Volume sectorLogic = ns.addVolume(Volume(solid.name(), solid, ns.material(sectorMaterial_A[i]))); tubsVol.placeVolume(sectorLogic, i + 1); // copyNr: i+1 - LogDebug("TOBGeom") << sectorLogic.name() << " number " << i + 1 << " positioned in " << tubsName - << " with no translation and no rotation"; + edm::LogVerbatim("TOBGeom") << sectorLogic.name() << " number " << i + 1 << " positioned in " << tubsName + << " with no translation and no rotation"; // Second Part: B name = "TOBAxService_" + sectorNumber[i] + "B"; startphi += deltaphi; deltaphi = sectorDeltaPhi_B; - solid = ns.addSolid(name, Tube(rin, rout, dz, startphi, startphi + deltaphi)); - LogDebug("TOBGeom") << solid.name() << " Tubs made of " << sectorMaterial_B[i] << " from " - << convertRadToDeg(startphi) << " to " << convertRadToDeg((startphi + deltaphi)) << " with Rin " - << rin << " Rout " << rout << " ZHalf " << dz; + solid = ns.addSolid(ns.prepend(name), Tube(rin, rout, dz, startphi, startphi + deltaphi)); + edm::LogVerbatim("TOBGeom") << solid.name() << " Tubs made of " << sectorMaterial_B[i] << " from " + << convertRadToDeg(startphi) << " to " << convertRadToDeg((startphi + deltaphi)) + << " with Rin " << rin << " Rout " << rout << " ZHalf " << dz; - sectorLogic = ns.addVolume(Volume(name, solid, ns.material(sectorMaterial_B[i]))); + sectorLogic = ns.addVolume(Volume(solid.name(), solid, ns.material(sectorMaterial_B[i]))); tubsVol.placeVolume(sectorLogic, i + 1); // copyNr: i+1 - LogDebug("TOBGeom") << sectorLogic.name() << " number " << i + 1 << " positioned in " << tubsName - << " with no translation and no rotation"; + edm::LogVerbatim("TOBGeom") << sectorLogic.name() << " number " << i + 1 << " positioned in " << tubsName + << " with no translation and no rotation"; // Third Part: C name = "TOBAxService_" + sectorNumber[i] + "C"; startphi += deltaphi; deltaphi = 0.5 * (widthphi - sectorDeltaPhi_B); - solid = ns.addSolid(name, Tube(rin, rout, dz, startphi, startphi + deltaphi)); - LogDebug("TOBGeom") << solid.name() << " Tubs made of " << sectorMaterial_C[i] << " from " - << convertRadToDeg(startphi) << " to " << convertRadToDeg((startphi + deltaphi)) << " with Rin " - << rin << " Rout " << rout << " ZHalf " << dz; - sectorLogic = ns.addVolume(Volume(name, solid, ns.material(sectorMaterial_C[i]))); + solid = ns.addSolid(ns.prepend(name), Tube(rin, rout, dz, startphi, startphi + deltaphi)); + edm::LogVerbatim("TOBGeom") << solid.name() << " Tubs made of " << sectorMaterial_C[i] << " from " + << convertRadToDeg(startphi) << " to " << convertRadToDeg((startphi + deltaphi)) + << " with Rin " << rin << " Rout " << rout << " ZHalf " << dz; + sectorLogic = ns.addVolume(Volume(solid.name(), solid, ns.material(sectorMaterial_C[i]))); tubsVol.placeVolume(sectorLogic, i + 1); // copyNr: i+1 - LogDebug("TOBGeom") << sectorLogic.name() << " number " << i + 1 << " positioned in " << tubsName - << " with no translation and no rotation"; + edm::LogVerbatim("TOBGeom") << sectorLogic.name() << " number " << i + 1 << " positioned in " << tubsName + << " with no translation and no rotation"; } - LogDebug("TOBGeom") << "<<== End of DDTOBAxCableAlgo construction ..."; + edm::LogVerbatim("TOBGeom") << "<<== End of DDTOBAxCableAlgo construction ..."; return 1; } diff --git a/Geometry/TrackerCommonData/plugins/dd4hep/DDTOBRadCableAlgo.cc b/Geometry/TrackerCommonData/plugins/dd4hep/DDTOBRadCableAlgo.cc index 2fc9115960983..0d793b05d9e8c 100644 --- a/Geometry/TrackerCommonData/plugins/dd4hep/DDTOBRadCableAlgo.cc +++ b/Geometry/TrackerCommonData/plugins/dd4hep/DDTOBRadCableAlgo.cc @@ -34,31 +34,34 @@ static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, vector names = args.vecStr("RingName"); // Names of layers string parentName = args.parentName(); - LogDebug("TOBGeom") << "DDTOBRadCableAlgo debug: Parent " << parentName << " NameSpace " << ns.name(); - LogDebug("TOBGeom") << "DDTOBRadCableAlgo debug: Disk Half width " << diskDz << "\tRMax " << rMax - << "\tCable Thickness " << cableT << "\tRadii of disk position and cable materials:"; + edm::LogVerbatim("TOBGeom") << "DDTOBRadCableAlgo debug: Parent " << parentName << " NameSpace " << ns.name(); + edm::LogVerbatim("TOBGeom") << "DDTOBRadCableAlgo debug: Disk Half width " << diskDz << "\tRMax " << rMax + << "\tCable Thickness " << cableT << "\tRadii of disk position and cable materials:"; for (int i = 0; i < (int)(rodRin.size()); i++) - LogDebug("TOBGeom") << "\t[" << i << "]\tRin = " << rodRin[i] << "\tRout = " << rodRout[i] << " " << cableM[i]; - LogDebug("TOBGeom") << "DDTOBRadCableAlgo debug: Connector Width = " << connW << "\tThickness = " << connT - << "\tMaterials: "; + edm::LogVerbatim("TOBGeom") << "\t[" << i << "]\tRin = " << rodRin[i] << "\tRout = " << rodRout[i] << " " + << cableM[i]; + edm::LogVerbatim("TOBGeom") << "DDTOBRadCableAlgo debug: Connector Width = " << connW << "\tThickness = " << connT + << "\tMaterials: "; for (int i = 0; i < (int)(connM.size()); i++) - LogDebug("TOBGeom") << "\tconnM[" << i << "] = " << connM[i]; - LogDebug("TOBGeom") << "DDTOBRadCableAlgo debug: Cool Manifold Torus Rin = " << coolRin << " Rout = " << coolRout1 - << "\t Phi start = " << coolStartPhi1 << " Phi Range = " << coolDeltaPhi1 - << "\t Material = " << coolM1 << "\t Radial positions:"; + edm::LogVerbatim("TOBGeom") << "\tconnM[" << i << "] = " << connM[i]; + edm::LogVerbatim("TOBGeom") << "DDTOBRadCableAlgo debug: Cool Manifold Torus Rin = " << coolRin + << " Rout = " << coolRout1 << "\t Phi start = " << coolStartPhi1 + << " Phi Range = " << coolDeltaPhi1 << "\t Material = " << coolM1 + << "\t Radial positions:"; for (int i = 0; i < (int)(coolR1.size()); i++) - LogDebug("TOBGeom") << "\t[" << i << "]\tR = " << coolR1[i]; + edm::LogVerbatim("TOBGeom") << "\t[" << i << "]\tR = " << coolR1[i]; for (int i = 0; i < (int)(coolR2.size()); i++) - LogDebug("TOBGeom") << "\t[" << i << "]\tR = " << coolR2[i]; - LogDebug("TOBGeom") << "DDTOBRadCableAlgo debug: Cooling Fluid Torus Rin = " << coolRin << " Rout = " << coolRout2 - << "\t Phi start = " << coolStartPhi2 << " Phi Range = " << coolDeltaPhi2 - << "\t Material = " << coolM2 << "\t Radial positions:"; + edm::LogVerbatim("TOBGeom") << "\t[" << i << "]\tR = " << coolR2[i]; + edm::LogVerbatim("TOBGeom") << "DDTOBRadCableAlgo debug: Cooling Fluid Torus Rin = " << coolRin + << " Rout = " << coolRout2 << "\t Phi start = " << coolStartPhi2 + << " Phi Range = " << coolDeltaPhi2 << "\t Material = " << coolM2 + << "\t Radial positions:"; for (int i = 0; i < (int)(coolR1.size()); i++) - LogDebug("TOBGeom") << "\t[" << i << "]\tR = " << coolR1[i]; + edm::LogVerbatim("TOBGeom") << "\t[" << i << "]\tR = " << coolR1[i]; for (int i = 0; i < (int)(coolR2.size()); i++) - LogDebug("TOBGeom") << "\t[" << i << "]\tR = " << coolR2[i]; + edm::LogVerbatim("TOBGeom") << "\t[" << i << "]\tR = " << coolR2[i]; for (int i = 0; i < (int)(names.size()); i++) - LogDebug("TOBGeom") << "DDTOBRadCableAlgo debug: names[" << i << "] = " << names[i]; + edm::LogVerbatim("TOBGeom") << "DDTOBRadCableAlgo debug: names[" << i << "] = " << names[i]; Volume disk = ns.volume(parentName); // Loop over sub disks @@ -70,63 +73,67 @@ static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, // Cooling Manifolds name = "TOBCoolingManifold" + names[i] + "a"; dz = coolRout1; - solid = ns.addSolid(name, Torus(coolR1[i], coolRin, coolRout1, coolStartPhi1, coolDeltaPhi1)); - LogDebug("TOBGeom") << name << " Torus made of " << coolM1 << " from " << convertRadToDeg(coolStartPhi1) << " to " - << convertRadToDeg((coolStartPhi1 + coolDeltaPhi1)) << " with Rin " << coolRin << " Rout " - << coolRout1 << " R torus " << coolR1[i]; - Volume coolManifoldLogic_a = ns.addVolume(Volume(name, solid, ns.material(coolM1))); + solid = ns.addSolid(ns.prepend(name), Torus(coolR1[i], coolRin, coolRout1, coolStartPhi1, coolDeltaPhi1)); + edm::LogVerbatim("TOBGeom") << solid.name() << " Torus made of " << coolM1 << " from " + << convertRadToDeg(coolStartPhi1) << " to " + << convertRadToDeg((coolStartPhi1 + coolDeltaPhi1)) << " with Rin " << coolRin + << " Rout " << coolRout1 << " R torus " << coolR1[i]; + Volume coolManifoldLogic_a = ns.addVolume(Volume(solid.name(), solid, ns.material(coolM1))); Position r1(0, 0, (dz - diskDz)); disk.placeVolume(coolManifoldLogic_a, i + 1, r1); // i+1 - LogDebug("TOBGeom") << name << " number " << i + 1 << " positioned in " << disk.name() << " at " << r1 - << " with no rotation"; + edm::LogVerbatim("TOBGeom") << solid.name() << " number " << i + 1 << " positioned in " << disk.name() << " at " + << r1 << " with no rotation"; // Cooling Fluid (in Cooling Manifold) name = "TOBCoolingManifoldFluid" + names[i] + "a"; - solid = ns.addSolid(name, Torus(coolR1[i], coolRin, coolRout2, coolStartPhi2, coolDeltaPhi2)); - LogDebug("TOBGeom") << name << " Torus made of " << coolM2 << " from " << convertRadToDeg(coolStartPhi2) << " to " - << convertRadToDeg((coolStartPhi2 + coolDeltaPhi2)) << " with Rin " << coolRin << " Rout " - << coolRout2 << " R torus " << coolR1[i]; - Volume coolManifoldFluidLogic_a = ns.addVolume(Volume(name, solid, ns.material(coolM2))); + solid = ns.addSolid(ns.prepend(name), Torus(coolR1[i], coolRin, coolRout2, coolStartPhi2, coolDeltaPhi2)); + edm::LogVerbatim("TOBGeom") << solid.name() << " Torus made of " << coolM2 << " from " + << convertRadToDeg(coolStartPhi2) << " to " + << convertRadToDeg((coolStartPhi2 + coolDeltaPhi2)) << " with Rin " << coolRin + << " Rout " << coolRout2 << " R torus " << coolR1[i]; + Volume coolManifoldFluidLogic_a = ns.addVolume(Volume(solid.name(), solid, ns.material(coolM2))); coolManifoldLogic_a.placeVolume(coolManifoldFluidLogic_a, i + 1); // i+1 - LogDebug("TOBGeom") << name << " number " << i + 1 << " positioned in " << coolM2 - << " with no translation and no rotation"; + edm::LogVerbatim("TOBGeom") << solid.name() << " number " << i + 1 << " positioned in " << coolM2 + << " with no translation and no rotation"; name = "TOBCoolingManifold" + names[i] + "r"; dz = coolRout1; - solid = ns.addSolid(name, Torus(coolR2[i], coolRin, coolRout1, coolStartPhi1, coolDeltaPhi1)); - LogDebug("TOBGeom") << name << " Torus made of " << coolM1 << " from " << convertRadToDeg(coolStartPhi1) << " to " - << convertRadToDeg((coolStartPhi1 + coolDeltaPhi1)) << " with Rin " << coolRin << " Rout " - << coolRout1 << " R torus " << coolR2[i]; - Volume coolManifoldLogic_r = ns.addVolume(Volume(name, solid, ns.material(coolM1))); + solid = ns.addSolid(ns.prepend(name), Torus(coolR2[i], coolRin, coolRout1, coolStartPhi1, coolDeltaPhi1)); + edm::LogVerbatim("TOBGeom") << solid.name() << " Torus made of " << coolM1 << " from " + << convertRadToDeg(coolStartPhi1) << " to " + << convertRadToDeg((coolStartPhi1 + coolDeltaPhi1)) << " with Rin " << coolRin + << " Rout " << coolRout1 << " R torus " << coolR2[i]; + Volume coolManifoldLogic_r = ns.addVolume(Volume(solid.name(), solid, ns.material(coolM1))); r1 = Position(0, 0, (dz - diskDz)); disk.placeVolume(coolManifoldLogic_r, i + 1, r1); // i+1 - LogDebug("TOBGeom") << name << " number " << i + 1 << " positioned in " << disk.name() << " at " << r1 - << " with no rotation"; + edm::LogVerbatim("TOBGeom") << solid.name() << " number " << i + 1 << " positioned in " << disk.name() << " at " + << r1 << " with no rotation"; // Cooling Fluid (in Cooling Manifold) name = "TOBCoolingManifoldFluid" + names[i] + "r"; - solid = ns.addSolid(name, Torus(coolR2[i], coolRin, coolRout2, coolStartPhi2, coolDeltaPhi2)); - LogDebug("TOBGeom") << name << " Torus made of " << coolM2 << " from " << convertRadToDeg(coolStartPhi2) << " to " - << convertRadToDeg((coolStartPhi2 + coolDeltaPhi2)) << " with Rin " << coolRin << " Rout " - << coolRout2 << " R torus " << coolR2[i]; - Volume coolManifoldFluidLogic_r = ns.addVolume(Volume(name, solid, ns.material(coolM2))); + solid = ns.addSolid(ns.prepend(name), Torus(coolR2[i], coolRin, coolRout2, coolStartPhi2, coolDeltaPhi2)); + edm::LogVerbatim("TOBGeom") << solid.name() << " Torus made of " << coolM2 << " from " + << convertRadToDeg(coolStartPhi2) << " to " + << convertRadToDeg((coolStartPhi2 + coolDeltaPhi2)) << " with Rin " << coolRin + << " Rout " << coolRout2 << " R torus " << coolR2[i]; + Volume coolManifoldFluidLogic_r = ns.addVolume(Volume(solid.name(), solid, ns.material(coolM2))); coolManifoldLogic_r.placeVolume(coolManifoldFluidLogic_r, i + 1); // i+1 - LogDebug("TOBGeom") << name << " number " << i + 1 << " positioned in " << coolM2 - << " with no translation and no rotation"; + edm::LogVerbatim("TOBGeom") << solid.name() << " number " << i + 1 << " positioned in " << coolM2 + << " with no translation and no rotation"; // Connectors name = "TOBConn" + names[i]; dz = 0.5 * connT; rin = 0.5 * (rodRin[i] + rodRout[i]) - 0.5 * connW; rout = 0.5 * (rodRin[i] + rodRout[i]) + 0.5 * connW; - solid = ns.addSolid(name, Tube(rin, rout, dz)); - LogDebug("TOBGeom") << name << " Tubs made of " << connM[i] << " from 0 to " << convertRadToDeg(2_pi) - << " with Rin " << rin << " Rout " << rout << " ZHalf " << dz; - Volume connLogic = ns.addVolume(Volume(name, solid, ns.material(connM[i]))); + solid = ns.addSolid(ns.prepend(name), Tube(rin, rout, dz)); + edm::LogVerbatim("TOBGeom") << solid.name() << " Tubs made of " << connM[i] << " from 0 to " + << convertRadToDeg(2_pi) << " with Rin " << rin << " Rout " << rout << " ZHalf " << dz; + Volume connLogic = ns.addVolume(Volume(solid.name(), solid, ns.material(connM[i]))); Position r2(0, 0, (dz - diskDz)); disk.placeVolume(connLogic, i + 1, r2); // i+1 - LogDebug("TOBGeom") << name << " number " << i + 1 << " positioned in " << disk.name() << " at " << r2 - << " with no rotation"; + edm::LogVerbatim("TOBGeom") << solid.name() << " number " << i + 1 << " positioned in " << disk.name() << " at " + << r2 << " with no rotation"; // Now the radial cable name = "TOBRadServices" + names[i]; @@ -144,19 +151,19 @@ static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, pgonRmax.emplace_back(rout); pgonRmax.emplace_back(rout); pgonRmax.emplace_back(rout); - solid = ns.addSolid(name, Polycone(0, 2_pi, pgonRmin, pgonRmax, pgonZ)); - LogDebug("TOBGeom") << name << " Polycone made of " << cableM[i] << " from 0 to " << convertRadToDeg(2_pi) - << " and with " << pgonZ.size() << " sections"; + solid = ns.addSolid(ns.prepend(name), Polycone(0, 2_pi, pgonRmin, pgonRmax, pgonZ)); + edm::LogVerbatim("TOBGeom") << solid.name() << " Polycone made of " << cableM[i] << " from 0 to " + << convertRadToDeg(2_pi) << " and with " << pgonZ.size() << " sections"; for (int ii = 0; ii < (int)(pgonZ.size()); ii++) - LogDebug("TOBGeom") << "\t[" << ii << "]\tZ = " << pgonZ[ii] << "\tRmin = " << pgonRmin[ii] - << "\tRmax = " << pgonRmax[ii]; - Volume cableLogic = ns.addVolume(Volume(name, solid, ns.material(cableM[i]))); + edm::LogVerbatim("TOBGeom") << "\t[" << ii << "]\tZ = " << pgonZ[ii] << "\tRmin = " << pgonRmin[ii] + << "\tRmax = " << pgonRmax[ii]; + Volume cableLogic = ns.addVolume(Volume(solid.name(), solid, ns.material(cableM[i]))); Position r3(0, 0, (diskDz - (i + 0.5) * cableT)); disk.placeVolume(cableLogic, i + 1, r3); // i+1 - LogDebug("TOBGeom") << name << " number " << i + 1 << " positioned in " << disk.name() << " at " << r3 - << " with no rotation"; + edm::LogVerbatim("TOBGeom") << solid.name() << " number " << i + 1 << " positioned in " << disk.name() << " at " + << r3 << " with no rotation"; } - LogDebug("TOBGeom") << "<<== End of DDTOBRadCableAlgo construction ..."; + edm::LogVerbatim("TOBGeom") << "<<== End of DDTOBRadCableAlgo construction ..."; return 1; } diff --git a/Geometry/TrackerCommonData/plugins/dd4hep/DDTOBRodAlgo.cc b/Geometry/TrackerCommonData/plugins/dd4hep/DDTOBRodAlgo.cc index 7fc4c111a3d57..f4bb6591017a0 100644 --- a/Geometry/TrackerCommonData/plugins/dd4hep/DDTOBRodAlgo.cc +++ b/Geometry/TrackerCommonData/plugins/dd4hep/DDTOBRodAlgo.cc @@ -65,56 +65,56 @@ static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, vector aohY = args.vecDble("AOHy"); // AOH translation with respect small-ICC center (Y) vector aohZ = args.vecDble("AOHz"); // AOH translation with respect small-ICC center (Z) - LogDebug("TOBGeom") << "Parent " << parentName << " Central " << central << " NameSpace " << ns.name() << "\tShift " - << shift; + edm::LogVerbatim("TOBGeom") << "Parent " << parentName << " Central " << central << " NameSpace " << ns.name() + << "\tShift " << shift; for (int i = 0; i < (int)(sideRod.size()); i++) { - LogDebug("TOBGeom") << sideRod[i] << " to be positioned " << sideRodX.size() << " times at y = " << sideRodY[i] - << " z = " << sideRodZ[i] << " and x"; + edm::LogVerbatim("TOBGeom") << sideRod[i] << " to be positioned " << sideRodX.size() + << " times at y = " << sideRodY[i] << " z = " << sideRodZ[i] << " and x"; for (double j : sideRodX) - LogDebug("TOBGeom") << "\tsideRodX[" << i << "] = " << j; + edm::LogVerbatim("TOBGeom") << "\tsideRodX[" << i << "] = " << j; } - LogDebug("TOBGeom") << endRod1 << " to be " - << "positioned " << endRod1Y.size() << " times at"; + edm::LogVerbatim("TOBGeom") << endRod1 << " to be " + << "positioned " << endRod1Y.size() << " times at"; for (int i = 0; i < (int)(endRod1Y.size()); i++) - LogDebug("TOBGeom") << "\t[" << i << "]\ty = " << endRod1Y[i] << "\tz = " << endRod1Z[i]; - LogDebug("TOBGeom") << endRod2 << " to be " - << "positioned at y = " << endRod2Y << " z = " << endRod2Z; - LogDebug("TOBGeom") << cable << " to be " - << "positioned at z = " << cableZ; - LogDebug("TOBGeom") << clamp << " to be " - << "positioned " << clampX.size() << " times at"; + edm::LogVerbatim("TOBGeom") << "\t[" << i << "]\ty = " << endRod1Y[i] << "\tz = " << endRod1Z[i]; + edm::LogVerbatim("TOBGeom") << endRod2 << " to be " + << "positioned at y = " << endRod2Y << " z = " << endRod2Z; + edm::LogVerbatim("TOBGeom") << cable << " to be " + << "positioned at z = " << cableZ; + edm::LogVerbatim("TOBGeom") << clamp << " to be " + << "positioned " << clampX.size() << " times at"; for (int i = 0; i < (int)(clampX.size()); i++) - LogDebug("TOBGeom") << "\t[" << i << "]\tx = " << clampX[i] << "\tz = " << clampZ[i]; - LogDebug("TOBGeom") << sideCool << " to be " - << "positioned " << sideCoolX.size() << " times at"; + edm::LogVerbatim("TOBGeom") << "\t[" << i << "]\tx = " << clampX[i] << "\tz = " << clampZ[i]; + edm::LogVerbatim("TOBGeom") << sideCool << " to be " + << "positioned " << sideCoolX.size() << " times at"; for (int i = 0; i < (int)(sideCoolX.size()); i++) - LogDebug("TOBGeom") << "\t[" << i << "]\tx = " << sideCoolX[i] << "\ty = " << sideCoolY[i] - << "\tz = " << sideCoolZ[i]; - LogDebug("TOBGeom") << endCool << " to be " - << "positioned with " << endCoolRot << " rotation at" - << " y = " << endCoolY << " z = " << endCoolZ; - LogDebug("TOBGeom") << optFibre << " to be " - << "positioned " << optFibreX.size() << " times at"; + edm::LogVerbatim("TOBGeom") << "\t[" << i << "]\tx = " << sideCoolX[i] << "\ty = " << sideCoolY[i] + << "\tz = " << sideCoolZ[i]; + edm::LogVerbatim("TOBGeom") << endCool << " to be " + << "positioned with " << endCoolRot << " rotation at" + << " y = " << endCoolY << " z = " << endCoolZ; + edm::LogVerbatim("TOBGeom") << optFibre << " to be " + << "positioned " << optFibreX.size() << " times at"; for (int i = 0; i < (int)(optFibreX.size()); i++) - LogDebug("TOBGeom") << "\t[" << i << "]\tx = " << optFibreX[i] << "\tz = " << optFibreZ[i]; - LogDebug("TOBGeom") << sideClamp1 << " to be " - << "positioned " << sideClampX.size() << " times at"; + edm::LogVerbatim("TOBGeom") << "\t[" << i << "]\tx = " << optFibreX[i] << "\tz = " << optFibreZ[i]; + edm::LogVerbatim("TOBGeom") << sideClamp1 << " to be " + << "positioned " << sideClampX.size() << " times at"; for (int i = 0; i < (int)(sideClampX.size()); i++) - LogDebug("TOBGeom") << "\t[" << i << "]\tx = " << sideClampX[i] << "\tdz = " << sideClamp1DZ[i]; - LogDebug("TOBGeom") << sideClamp2 << " to be " - << "positioned " << sideClampX.size() << " times at"; + edm::LogVerbatim("TOBGeom") << "\t[" << i << "]\tx = " << sideClampX[i] << "\tdz = " << sideClamp1DZ[i]; + edm::LogVerbatim("TOBGeom") << sideClamp2 << " to be " + << "positioned " << sideClampX.size() << " times at"; for (int i = 0; i < (int)(sideClampX.size()); i++) - LogDebug("TOBGeom") << "\t[" << i << "]\tx = " << sideClampX[i] << "\tdz = " << sideClamp2DZ[i]; - LogDebug("TOBGeom") << "DDTOBRodAlgo debug:\t" << module << " positioned " << moduleRot.size() << " times"; + edm::LogVerbatim("TOBGeom") << "\t[" << i << "]\tx = " << sideClampX[i] << "\tdz = " << sideClamp2DZ[i]; + edm::LogVerbatim("TOBGeom") << "DDTOBRodAlgo debug:\t" << module << " positioned " << moduleRot.size() << " times"; for (int i = 0; i < (int)(moduleRot.size()); i++) - LogDebug("TOBGeom") << "\tRotation " << moduleRot[i] << "\ty = " << moduleY[i] << "\tz = " << moduleZ[i]; - LogDebug("TOBGeom") << "DDTOBRodAlgo debug:\t" << connect.size() << " ICC positioned with no rotation"; + edm::LogVerbatim("TOBGeom") << "\tRotation " << moduleRot[i] << "\ty = " << moduleY[i] << "\tz = " << moduleZ[i]; + edm::LogVerbatim("TOBGeom") << "DDTOBRodAlgo debug:\t" << connect.size() << " ICC positioned with no rotation"; for (int i = 0; i < (int)(connect.size()); i++) - LogDebug("TOBGeom") << "\t" << connect[i] << "\ty = " << connectY[i] << "\tz = " << connectZ[i]; - LogDebug("TOBGeom") << "DDTOBRodAlgo debug:\t" << aohName << " AOH will be positioned on ICC's"; + edm::LogVerbatim("TOBGeom") << "\t" << connect[i] << "\ty = " << connectY[i] << "\tz = " << connectZ[i]; + edm::LogVerbatim("TOBGeom") << "DDTOBRodAlgo debug:\t" << aohName << " AOH will be positioned on ICC's"; for (int i = 0; i < (int)(aohCopies.size()); i++) - LogDebug("TOBGeom") << " copies " << aohCopies[i] << "\tx = " << aohX[i] << "\ty = " << aohY[i] - << "\tz = " << aohZ[i]; + edm::LogVerbatim("TOBGeom") << " copies " << aohCopies[i] << "\tx = " << aohX[i] << "\ty = " << aohY[i] + << "\tz = " << aohZ[i]; const string& centName = central; string child; @@ -127,8 +127,8 @@ static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, Position r(sideRodX[j], sideRodY[i], sideRodZ[i]); child = sideRod[i]; rod.placeVolume(ns.volume(child), j + 1, r); - LogDebug("TOBGeom") << child << " number " << j + 1 << " positioned in " << rodName << " at " << r - << " with no rotation"; + edm::LogVerbatim("TOBGeom") << child << " number " << j + 1 << " positioned in " << rodName << " at " << r + << " with no rotation"; } } // Clamps @@ -136,24 +136,24 @@ static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, Position r(clampX[i], 0, shift + clampZ[i]); child = clamp; rod.placeVolume(ns.volume(child), i + 1, r); - LogDebug("TOBGeom") << child << " number " << i + 1 << " positioned in " << rodName << " at " << r - << " with no rotation"; + edm::LogVerbatim("TOBGeom") << child << " number " << i + 1 << " positioned in " << rodName << " at " << r + << " with no rotation"; } // Side Cooling tubes for (int i = 0; i < (int)(sideCoolX.size()); i++) { Position r(sideCoolX[i], sideCoolY[i], shift + sideCoolZ[i]); child = sideCool; rod.placeVolume(ns.volume(child), i + 1, r); - LogDebug("TOBGeom") << child << " number " << i + 1 << " positioned in " << rodName << " at " << r - << " with no rotation"; + edm::LogVerbatim("TOBGeom") << child << " number " << i + 1 << " positioned in " << rodName << " at " << r + << " with no rotation"; } // Optical Fibres for (int i = 0; i < (int)(optFibreX.size()); i++) { Position r(optFibreX[i], 0, shift + optFibreZ[i]); child = optFibre; rod.placeVolume(ns.volume(child), i + 1, r); - LogDebug("TOBGeom") << child << " number " << i + 1 << " positioned in " << rodName << " at " << r - << " with no rotation"; + edm::LogVerbatim("TOBGeom") << child << " number " << i + 1 << " positioned in " << rodName << " at " << r + << " with no rotation"; } // Side Clamps @@ -162,16 +162,16 @@ static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, Position r(sideClampX[i], moduleY[j], shift + moduleZ[j] + sideClamp1DZ[i]); child = sideClamp1; rod.placeVolume(ns.volume(child), i + 1, r); - LogDebug("TOBGeom") << child << " number " << i + 1 << " positioned in " << rodName << " at " << r - << " with no rotation"; + edm::LogVerbatim("TOBGeom") << child << " number " << i + 1 << " positioned in " << rodName << " at " << r + << " with no rotation"; } for (int i = 0; i < (int)(sideClamp2DZ.size()); i++) { int j = i / 2; Position r(sideClampX[i], moduleY[j], shift + moduleZ[j] + sideClamp2DZ[i]); child = sideClamp2; rod.placeVolume(ns.volume(child), i + 1, r); - LogDebug("TOBGeom") << child << " number " << i + 1 << " positioned in " << rodName << " at " << r - << " with no rotation"; + edm::LogVerbatim("TOBGeom") << child << " number " << i + 1 << " positioned in " << rodName << " at " << r + << " with no rotation"; } Volume cent = ns.volume(centName); @@ -180,29 +180,29 @@ static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, Position r(0, endRod1Y[i], shift + endRod1Z[i]); child = endRod1; cent.placeVolume(ns.volume(child), i + 1, r); - LogDebug("TOBGeom") << child << " number " << i + 1 << " positioned in " << centName << " at " << r - << " with no rotation"; + edm::LogVerbatim("TOBGeom") << child << " number " << i + 1 << " positioned in " << centName << " at " << r + << " with no rotation"; } Position r1(0, endRod2Y, shift + endRod2Z); child = endRod2; cent.placeVolume(ns.volume(child), 1, r1); - LogDebug("TOBGeom") << child << " number 1 " - << "positioned in " << centName << " at " << r1 << " with no rotation"; + edm::LogVerbatim("TOBGeom") << child << " number 1 " + << "positioned in " << centName << " at " << r1 << " with no rotation"; // End cooling tubes Position r2(0, endCoolY, shift + endCoolZ); const Rotation3D& rot2 = ns.rotation(endCoolRot); child = endCool; cent.placeVolume(ns.volume(child), 1, Transform3D(rot2, r2)); - LogDebug("TOBGeom") << child << " number 1 " - << "positioned in " << centName << " at " << r2 << " with " << rot2; + edm::LogVerbatim("TOBGeom") << child << " number 1 " + << "positioned in " << centName << " at " << r2 << " with " << rot2; //Mother cable Position r3(0, 0, shift + cableZ); child = cable; cent.placeVolume(ns.volume(child), 1, r3); - LogDebug("TOBGeom") << child << " number 1 " - << "positioned in " << centName << " at " << r3 << " with no rotation"; + edm::LogVerbatim("TOBGeom") << child << " number 1 " + << "positioned in " << centName << " at " << r3 << " with no rotation"; //Modules for (int i = 0; i < (int)(moduleRot.size()); i++) { @@ -210,8 +210,8 @@ static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, const Rotation3D& rot = ns.rotation(moduleRot[i]); child = module; cent.placeVolume(ns.volume(child), i + 1, Transform3D(rot, r)); - LogDebug("TOBGeom") << child << " number " << i + 1 << " positioned in " << centName << " at " << r << " with " - << rot; + edm::LogVerbatim("TOBGeom") << child << " number " << i + 1 << " positioned in " << centName << " at " << r + << " with " << rot; } //Connectors (ICC, CCUM, ...) @@ -219,8 +219,8 @@ static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, Position r(0, connectY[i], shift + connectZ[i]); child = connect[i]; cent.placeVolume(ns.volume(child), i + 1, r); - LogDebug("TOBGeom") << child << " number " << i + 1 << " positioned in " << centName << " at " << r - << " with no rotation"; + edm::LogVerbatim("TOBGeom") << child << " number " << i + 1 << " positioned in " << centName << " at " << r + << " with no rotation"; } //AOH (only on ICCs) @@ -232,16 +232,16 @@ static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, Position r(aohX[i] + 0, aohY[i] + connectY[i], aohZ[i] + shift + connectZ[i]); child = aohName; cent.placeVolume(ns.volume(child), copyNumber, r); - LogDebug("TOBGeom") << child << " number " << copyNumber << " positioned in " << centName << " at " << r - << " with no rotation"; + edm::LogVerbatim("TOBGeom") << child << " number " << copyNumber << " positioned in " << centName << " at " << r + << " with no rotation"; // if two copies add a copy with (-aohX,-aohZ) translation if (aohCopies[i] == 2) { copyNumber++; r = Position(-aohX[i] + 0, aohY[i] + connectY[i], -aohZ[i] + shift + connectZ[i]); child = aohName; cent.placeVolume(ns.volume(child), copyNumber, r); - LogDebug("TOBGeom") << child << " number " << copyNumber << " positioned in " << centName << " at " << r - << " with no rotation"; + edm::LogVerbatim("TOBGeom") << child << " number " << copyNumber << " positioned in " << centName << " at " << r + << " with no rotation"; } // if four copies add 3 copies with (-aohX,+aohZ) (-aohX,-aohZ) (+aohX,+aohZ) and translations if (aohCopies[i] == 4) { @@ -263,13 +263,13 @@ static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, cent.placeVolume(ns.volume(child), copyNumber, rr); // copyNumber break; } - LogDebug("TOBGeom") << child << " number " << copyNumber << " positioned in " << centName << " at " << rr - << " with no rotation"; + edm::LogVerbatim("TOBGeom") << child << " number " << copyNumber << " positioned in " << centName << " at " + << rr << " with no rotation"; } } } } - LogDebug("TOBGeom") << "<<== End of DDTOBRodAlgo construction ..."; + edm::LogVerbatim("TOBGeom") << "<<== End of DDTOBRodAlgo construction ..."; return 1; } diff --git a/Geometry/TrackerCommonData/plugins/dd4hep/DDTrackerLinear.cc b/Geometry/TrackerCommonData/plugins/dd4hep/DDTrackerLinear.cc index 98ee3d30f2838..8a512cf1e49b2 100644 --- a/Geometry/TrackerCommonData/plugins/dd4hep/DDTrackerLinear.cc +++ b/Geometry/TrackerCommonData/plugins/dd4hep/DDTrackerLinear.cc @@ -21,11 +21,12 @@ static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, Volume mother = ns.volume(args.parentName()); Volume child = ns.volume(args.value("ChildName")); - LogDebug("TrackerGeom") << "DDTrackerLinear +++ Executing Algorithm. rParent:" << mother.name(); - LogDebug("TrackerGeom") << "debug: Parent " << mother.name() << "\tChild " << child.name() << " NameSpace " - << ns.name() << "\tNumber " << number << "\tAxis (theta/phi) " << theta / dd4hep::deg << ", " - << phi / dd4hep::deg << "\t(Offset/Delta) " << offset << ", " << delta << "\tCentre " - << centre[0] << ", " << centre[1] << ", " << centre[2] << "\tRotation " << rotMat; + edm::LogVerbatim("TrackerGeom") << "DDTrackerLinear +++ Executing Algorithm. rParent:" << mother.name(); + edm::LogVerbatim("TrackerGeom") << "debug: Parent " << mother.name() << "\tChild " << child.name() << " NameSpace " + << ns.name() << "\tNumber " << number << "\tAxis (theta/phi) " << theta / dd4hep::deg + << ", " << phi / dd4hep::deg << "\t(Offset/Delta) " << offset << ", " << delta + << "\tCentre " << centre[0] << ", " << centre[1] << ", " << centre[2] << "\tRotation " + << rotMat; Position direction(sin(theta) * cos(phi), sin(theta) * sin(phi), cos(theta)); Position base(centre[0], centre[1], centre[2]); @@ -36,8 +37,8 @@ static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, Position tran = base + (offset + double(i) * delta) * direction; mother.placeVolume(child, ci, Transform3D(rot, tran)); - LogDebug("TrackerGeom") << child.name() << " number " << ci << " positioned in " << mother.name() << " at " << tran - << " with " << rot; + edm::LogVerbatim("TrackerGeom") << child.name() << " number " << ci << " positioned in " << mother.name() << " at " + << tran << " with " << rot; } return cms::s_executed; } diff --git a/Geometry/TrackerCommonData/plugins/dd4hep/DDTrackerPhiAlgo.cc b/Geometry/TrackerCommonData/plugins/dd4hep/DDTrackerPhiAlgo.cc index 02112cab990d4..23bdb2141ca9c 100644 --- a/Geometry/TrackerCommonData/plugins/dd4hep/DDTrackerPhiAlgo.cc +++ b/Geometry/TrackerCommonData/plugins/dd4hep/DDTrackerPhiAlgo.cc @@ -22,19 +22,19 @@ static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, double tilt = args.value("Tilt"); if (numcopies != int(phi.size())) { - LogDebug("TrackerGeom") << "error: Parameter " - << "NumCopies does not agree with the size " - << "of the Phi vector. It was adjusted to " - << "be the size of the Phi vector and may " - << "lead to crashes or errors."; + edm::LogVerbatim("TrackerGeom") << "error: Parameter " + << "NumCopies does not agree with the size " + << "of the Phi vector. It was adjusted to " + << "be the size of the Phi vector and may " + << "lead to crashes or errors."; } - LogDebug("TrackerGeom") << "debug: Parameters for position" - << "ing:: " - << " Radius " << radius << " Tilt " << tilt << " Copies " << phi.size() << " at"; + edm::LogVerbatim("TrackerGeom") << "debug: Parameters for position" + << "ing:: " + << " Radius " << radius << " Tilt " << tilt << " Copies " << phi.size() << " at"; for (int i = 0; i < (int)(phi.size()); i++) - LogDebug("TrackerGeom") << "\t[" << i << "] phi = " << phi[i] << " z = " << zpos[i]; - LogDebug("TrackerGeom") << "debug: Parent " << mother.name() << "\tChild " << child.name() << " NameSpace " - << ns.name(); + edm::LogVerbatim("TrackerGeom") << "\t[" << i << "] phi = " << phi[i] << " z = " << zpos[i]; + edm::LogVerbatim("TrackerGeom") << "debug: Parent " << mother.name() << "\tChild " << child.name() << " NameSpace " + << ns.name(); double theta = 90._deg; int ci = startcn; @@ -46,8 +46,8 @@ static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, Rotation3D rot = makeRotation3D(theta, phix, theta, phiy, 0., 0.); Position tran(xpos, ypos, zpos[i]); /* PlacedVolume pv = */ mother.placeVolume(child, ci, Transform3D(rot, tran)); - LogDebug("TrackerGeom") << "test: " << child.name() << " number " << ci << " positioned in " << mother.name() - << " at " << tran << " with " << rot; + edm::LogVerbatim("TrackerGeom") << "test: " << child.name() << " number " << ci << " positioned in " + << mother.name() << " at " << tran << " with " << rot; ci = ci + incrcn; } return 1; diff --git a/Geometry/TrackerCommonData/plugins/dd4hep/DDTrackerPhiAltAlgo.cc b/Geometry/TrackerCommonData/plugins/dd4hep/DDTrackerPhiAltAlgo.cc index df4961a5775d8..591f20cb799a2 100644 --- a/Geometry/TrackerCommonData/plugins/dd4hep/DDTrackerPhiAltAlgo.cc +++ b/Geometry/TrackerCommonData/plugins/dd4hep/DDTrackerPhiAltAlgo.cc @@ -23,11 +23,13 @@ static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, int startCopyNo = args.find("StartCopyNo") ? args.value("StartCopyNo") : 1; //Start copy number int incrCopyNo = args.find("IncrCopyNo") ? args.value("IncrCopyNo") : 1; //Increment in copy number - LogDebug("TrackerGeom") << "Parent " << mother.name() << "\tChild " << child.name() << " NameSpace " << ns.name(); - LogDebug("TrackerGeom") << "Parameters for positioning-- Tilt " << tilt << "\tStartAngle " - << convertRadToDeg(startAngle) << "\tRangeAngle " << convertRadToDeg(rangeAngle) << "\tRin " - << radiusIn << "\tRout " << radiusOut << "\t ZPos " << zpos << "\tCopy Numbers " << number - << " Start/Increment " << startCopyNo << ", " << incrCopyNo; + edm::LogVerbatim("TrackerGeom") << "Parent " << mother.name() << "\tChild " << child.name() << " NameSpace " + << ns.name(); + edm::LogVerbatim("TrackerGeom") << "Parameters for positioning-- Tilt " << tilt << "\tStartAngle " + << convertRadToDeg(startAngle) << "\tRangeAngle " << convertRadToDeg(rangeAngle) + << "\tRin " << radiusIn << "\tRout " << radiusOut << "\t ZPos " << zpos + << "\tCopy Numbers " << number << " Start/Increment " << startCopyNo << ", " + << incrCopyNo; if (number > 0) { double theta = 90._deg; @@ -59,8 +61,8 @@ static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, } Position tran(xpos, ypos, zpos); /* PlacedVolume pv = */ mother.placeVolume(child, copyNo, Transform3D(rotation, tran)); - LogDebug("TrackerGeom") << "" << child.name() << " number " << copyNo << " positioned in " << mother.name() - << " at " << tran << " with " << rotation; + edm::LogVerbatim("TrackerGeom") << "" << child.name() << " number " << copyNo << " positioned in " + << mother.name() << " at " << tran << " with " << rotation; copyNo += incrCopyNo; } } diff --git a/Geometry/TrackerCommonData/plugins/dd4hep/DDTrackerRingAlgo.cc b/Geometry/TrackerCommonData/plugins/dd4hep/DDTrackerRingAlgo.cc index 3423bb31fd81d..45239a3631533 100644 --- a/Geometry/TrackerCommonData/plugins/dd4hep/DDTrackerRingAlgo.cc +++ b/Geometry/TrackerCommonData/plugins/dd4hep/DDTrackerRingAlgo.cc @@ -39,37 +39,37 @@ namespace { } } - LogDebug("TrackerGeom") << "DDTrackerRingAlgo debug: Parameters for position" - << "ing:: n " << n << " Start, Range, Delta " << convertRadToDeg(startAngle) << " " - << convertRadToDeg(rangeAngle) << " " << convertRadToDeg(delta) << " Radius " << radius - << " Centre " << center[0] << ", " << center[1] << ", " << center[2]; + edm::LogVerbatim("TrackerGeom") << "DDTrackerRingAlgo debug: Parameters for position" + << "ing:: n " << n << " Start, Range, Delta " << convertRadToDeg(startAngle) << " " + << convertRadToDeg(rangeAngle) << " " << convertRadToDeg(delta) << " Radius " + << radius << " Centre " << center[0] << ", " << center[1] << ", " << center[2]; - LogDebug("TrackerGeom") << "DDTrackerRingAlgo debug: Parent " << parentName << "\tChild " << childName - << " NameSpace " << ns.name(); + edm::LogVerbatim("TrackerGeom") << "DDTrackerRingAlgo debug: Parent " << parentName << "\tChild " << childName + << " NameSpace " << ns.name(); Rotation3D flipMatrix, tiltMatrix, phiRotMatrix, globalRotMatrix; // Identity matrix // flipMatrix calculus if (isFlipped) { - LogDebug("TrackerGeom") << "DDTrackerRingAlgo test: Creating a new rotation: " - << "\t90., 180., " - << "90., 90., " - << "180., 0."; + edm::LogVerbatim("TrackerGeom") << "DDTrackerRingAlgo test: Creating a new rotation: " + << "\t90., 180., " + << "90., 90., " + << "180., 0."; flipMatrix = makeRotation3D(90._deg, 180._deg, 90._deg, 90._deg, 180._deg, 0._deg); } // tiltMatrix calculus if (isZPlus) { - LogDebug("TrackerGeom") << "DDTrackerRingAlgo test: Creating a new rotation: " - << "\t90., 90., " << convertRadToDeg(tiltAngle) << ", 180., " - << convertRadToDeg(90._deg - tiltAngle) << ", 0."; + edm::LogVerbatim("TrackerGeom") << "DDTrackerRingAlgo test: Creating a new rotation: " + << "\t90., 90., " << convertRadToDeg(tiltAngle) << ", 180., " + << convertRadToDeg(90._deg - tiltAngle) << ", 0."; tiltMatrix = makeRotation3D(90._deg, 90._deg, tiltAngle, 180._deg, 90._deg - tiltAngle, 0._deg); if (isFlipped) { tiltMatrix *= flipMatrix; } } else { - LogDebug("TrackerGeom") << "DDTrackerRingAlgo test: Creating a new rotation: " - << "\t90., 90., " << convertRadToDeg(tiltAngle) << ", 0., " - << convertRadToDeg(90._deg + tiltAngle) << ", 0."; + edm::LogVerbatim("TrackerGeom") << "DDTrackerRingAlgo test: Creating a new rotation: " + << "\t90., 90., " << convertRadToDeg(tiltAngle) << ", 0., " + << convertRadToDeg(90._deg + tiltAngle) << ", 0."; tiltMatrix = makeRotation3D(90._deg, 90._deg, tiltAngle, 0._deg, 90._deg + tiltAngle, 0._deg); if (isFlipped) { tiltMatrix *= flipMatrix; @@ -86,9 +86,9 @@ namespace { double phix = phi; double phiy = phix + 90._deg; if (phix != 0.) { - LogDebug("TrackerGeom") << "DDTrackerRingAlgo test: Creating a new rotation: " - << "\t90., " << convertRadToDeg(phix) << ", 90.," << convertRadToDeg(phiy) - << ", 0., 0."; + edm::LogVerbatim("TrackerGeom") << "DDTrackerRingAlgo test: Creating a new rotation: " + << "\t90., " << convertRadToDeg(phix) << ", 90.," << convertRadToDeg(phiy) + << ", 0., 0."; phiRotMatrix = makeRotation3D(theta, phix, theta, phiy, 0., 0.); } @@ -102,9 +102,9 @@ namespace { // Positions child with respect to parent mother.placeVolume(child, copy, Transform3D(globalRotMatrix, tran)); - LogDebug("TrackerGeom") << "DDTrackerRingAlgo test " << child.data()->GetName() << " number " << copy - << " positioned in " << mother.data()->GetName() << " at " << tran << " with " - << globalRotMatrix; + edm::LogVerbatim("TrackerGeom") << "DDTrackerRingAlgo test " << child.data()->GetName() << " number " << copy + << " positioned in " << mother.data()->GetName() << " at " << tran << " with " + << globalRotMatrix; copy += incrCopyNo; phi += delta; diff --git a/Geometry/TrackerCommonData/plugins/dd4hep/DDTrackerXYZPosAlgo.cc b/Geometry/TrackerCommonData/plugins/dd4hep/DDTrackerXYZPosAlgo.cc index 3261a1b2afc25..c653ee9dc95d8 100644 --- a/Geometry/TrackerCommonData/plugins/dd4hep/DDTrackerXYZPosAlgo.cc +++ b/Geometry/TrackerCommonData/plugins/dd4hep/DDTrackerXYZPosAlgo.cc @@ -18,12 +18,12 @@ static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, vector zvec = args.value >("ZPositions"); // Z positions vector rotMat = args.value >("Rotations"); // Names of rotation matrices - LogDebug("TrackerGeom") << "debug: Parent " << mother.name() << "\tChild " << child.name() << " NameSpace " - << ns.name() << "\tCopyNo (Start/Increment) " << startCopyNo << ", " << incrCopyNo - << "\tNumber " << xvec.size() << ", " << yvec.size() << ", " << zvec.size(); + edm::LogVerbatim("TrackerGeom") << "debug: Parent " << mother.name() << "\tChild " << child.name() << " NameSpace " + << ns.name() << "\tCopyNo (Start/Increment) " << startCopyNo << ", " << incrCopyNo + << "\tNumber " << xvec.size() << ", " << yvec.size() << ", " << zvec.size(); for (int i = 0; i < (int)(zvec.size()); i++) { - LogDebug("TrackerGeom") << "\t[" << i << "]\tX = " << xvec[i] << "\t[" << i << "]\tY = " << yvec[i] << "\t[" << i - << "]\tZ = " << zvec[i] << ", Rot.Matrix = " << rotMat[i]; + edm::LogVerbatim("TrackerGeom") << "\t[" << i << "]\tX = " << xvec[i] << "\t[" << i << "]\tY = " << yvec[i] << "\t[" + << i << "]\tZ = " << zvec[i] << ", Rot.Matrix = " << rotMat[i]; } for (int i = 0, copy = startCopyNo; i < (int)(zvec.size()); i++, copy += incrCopyNo) { @@ -32,8 +32,8 @@ static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, /* PlacedVolume pv = */ rotMat[i] != "NULL" ? mother.placeVolume(child, copy, Transform3D(ns.rotation(rotMat[i]), tran)) : mother.placeVolume(child, tran); - LogDebug("TrackerGeom") << "test: " << child.name() << " number " << copy << " positioned in " << mother.name() - << " at " << tran << " with " << rot; + edm::LogVerbatim("TrackerGeom") << "test: " << child.name() << " number " << copy << " positioned in " + << mother.name() << " at " << tran << " with " << rot; } return 1; } diff --git a/Geometry/TrackerCommonData/plugins/dd4hep/DDTrackerZPosAlgo.cc b/Geometry/TrackerCommonData/plugins/dd4hep/DDTrackerZPosAlgo.cc index 59a2e07564480..0a32d96ad7099 100644 --- a/Geometry/TrackerCommonData/plugins/dd4hep/DDTrackerZPosAlgo.cc +++ b/Geometry/TrackerCommonData/plugins/dd4hep/DDTrackerZPosAlgo.cc @@ -16,11 +16,11 @@ static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, vector zvec = args.value >("ZPositions"); // Z positions vector rotMat = args.value >("Rotations"); // Names of rotation matrices - LogDebug("TrackerGeom") << "debug: Parent " << mother.name() << "\tChild " << child.name() << " NameSpace " - << ns.name() << "\tCopyNo (Start/Increment) " << startCopyNo << ", " << incrCopyNo - << "\tNumber " << zvec.size(); + edm::LogVerbatim("TrackerGeom") << "debug: Parent " << mother.name() << "\tChild " << child.name() << " NameSpace " + << ns.name() << "\tCopyNo (Start/Increment) " << startCopyNo << ", " << incrCopyNo + << "\tNumber " << zvec.size(); for (int i = 0; i < (int)(zvec.size()); i++) - LogDebug("TrackerGeom") << "\t[" << i << "]\tZ = " << zvec[i] << ", Rot.Matrix = " << rotMat[i]; + edm::LogVerbatim("TrackerGeom") << "\t[" << i << "]\tZ = " << zvec[i] << ", Rot.Matrix = " << rotMat[i]; for (int i = 0, copy = startCopyNo; i < (int)(zvec.size()); i++, copy += incrCopyNo) { Position tran(0, 0, zvec[i]); @@ -28,8 +28,8 @@ static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, /* PlacedVolume pv = */ rotMat[i] != "NULL" ? mother.placeVolume(child, copy, Transform3D(ns.rotation(rotMat[i]), tran)) : mother.placeVolume(child, copy, tran); - LogDebug("TrackerGeom") << "test: " << child.name() << " number " << copy << " positioned in " << mother.name() - << " at " << tran << " with " << rot; + edm::LogVerbatim("TrackerGeom") << "test: " << child.name() << " number " << copy << " positioned in " + << mother.name() << " at " << tran << " with " << rot; } return 1; } diff --git a/Geometry/TrackerCommonData/python/cmsExtendedGeometry2021FlatMinus05PercentXML_cfi.py b/Geometry/TrackerCommonData/python/cmsExtendedGeometry2021FlatMinus05PercentXML_cfi.py index 71d73315b8f9a..93a39f40563aa 100644 --- a/Geometry/TrackerCommonData/python/cmsExtendedGeometry2021FlatMinus05PercentXML_cfi.py +++ b/Geometry/TrackerCommonData/python/cmsExtendedGeometry2021FlatMinus05PercentXML_cfi.py @@ -1,10 +1,13 @@ import FWCore.ParameterSet.Config as cms +# This config was generated automatically using generate2021Geometry.py +# If you notice a mistake, please update the generating script, not just this config + XMLIdealGeometryESSource = cms.ESSource("XMLIdealGeometryESSource", geomXMLFiles = cms.vstring( 'Geometry/CMSCommonData/data/materials/2021/v2/materials.xml', 'Geometry/CMSCommonData/data/rotations.xml', - 'Geometry/CMSCommonData/data/extend/v2/cmsextent.xml', + 'Geometry/CMSCommonData/data/extend/v3/cmsextent.xml', 'Geometry/CMSCommonData/data/cavernData/2021/v1/cavernData.xml', 'Geometry/CMSCommonData/data/cms/2021/v3/cms.xml', 'Geometry/CMSCommonData/data/cmsMother.xml', @@ -22,13 +25,13 @@ 'Geometry/CMSCommonData/data/cavern/2021/v1/cavern.xml', 'Geometry/CMSCommonData/data/cavernFloor/2017/v1/cavernFloor.xml', 'Geometry/TrackerCommonData/data/PhaseI/trackerParameters.xml', - 'Geometry/TrackerCommonData/data/FlatMinus05Percent/2021/trackermaterial.xml', + 'Geometry/TrackerCommonData/data/FlatMinus05Percent/2021/v2/trackermaterial.xml', 'Geometry/TrackerCommonData/data/FlatMinus05Percent/2021/pixfwdMaterials.xml', 'Geometry/TrackerCommonData/data/FlatMinus05Percent/2021/pixbarmaterial.xml', - 'Geometry/TrackerCommonData/data/FlatMinus05Percent/2021/tibtidcommonmaterial.xml', - 'Geometry/TrackerCommonData/data/FlatMinus05Percent/2021/tibmaterial.xml', - 'Geometry/TrackerCommonData/data/FlatMinus05Percent/2021/tidmaterial.xml', - 'Geometry/TrackerCommonData/data/FlatMinus05Percent/2021/tobmaterial.xml', + 'Geometry/TrackerCommonData/data/FlatMinus05Percent/2021/v2/tibtidcommonmaterial.xml', + 'Geometry/TrackerCommonData/data/FlatMinus05Percent/2021/v2/tibmaterial.xml', + 'Geometry/TrackerCommonData/data/FlatMinus05Percent/2021/v2/tidmaterial.xml', + 'Geometry/TrackerCommonData/data/FlatMinus05Percent/2021/v2/tobmaterial.xml', 'Geometry/TrackerCommonData/data/FlatMinus05Percent/2021/tecmaterial.xml', 'Geometry/TrackerCommonData/data/pixfwdCommon.xml', 'Geometry/TrackerCommonData/data/PhaseI/v2/pixfwdCylinder.xml', @@ -206,19 +209,19 @@ 'Geometry/TrackerCommonData/data/trackerother.xml', 'Geometry/TrackerCommonData/data/PhaseI/trackerStructureTopology.xml', 'Geometry/TrackerSimData/data/PhaseI/trackersens.xml', - 'Geometry/TrackerRecoData/data/PhaseI/trackerRecoMaterial.xml', - 'SimTracker/TrackerMaterialAnalysis/data/trackingMaterialGroups_ForPhaseI.xml', + 'Geometry/TrackerRecoData/data/PhaseI/v1/trackerRecoMaterial.xml', + 'SimTracker/TrackerMaterialAnalysis/data/trackingMaterialGroups_ForPhaseI/v1/trackingMaterialGroups_ForPhaseI.xml', 'Geometry/TrackerSimData/data/PhaseI/trackerProdCuts.xml', 'Geometry/TrackerSimData/data/trackerProdCutsBEAM.xml', + 'Geometry/EcalCommonData/data/ebcon/2021/v1/ebcon.xml', + 'Geometry/EcalCommonData/data/eecon.xml', + 'Geometry/EcalCommonData/data/escon.xml', 'Geometry/EcalCommonData/data/eregalgo/2017/v1/eregalgo.xml', 'Geometry/EcalCommonData/data/ebalgo.xml', - 'Geometry/EcalCommonData/data/ebcon.xml', 'Geometry/EcalCommonData/data/ebrot.xml', - 'Geometry/EcalCommonData/data/eecon.xml', 'Geometry/EcalCommonData/data/eefixed/2021/v1/eefixed.xml', 'Geometry/EcalCommonData/data/eehier.xml', 'Geometry/EcalCommonData/data/eealgo.xml', - 'Geometry/EcalCommonData/data/escon.xml', 'Geometry/EcalCommonData/data/esalgo.xml', 'Geometry/EcalCommonData/data/eeF.xml', 'Geometry/EcalCommonData/data/eeB.xml', @@ -228,68 +231,66 @@ 'Geometry/HcalCommonData/data/hcalcablealgo.xml', 'Geometry/HcalCommonData/data/hcalbarrelalgo.xml', 'Geometry/HcalCommonData/data/hcalendcap/PhaseI/hcalendcapalgo.xml', - 'Geometry/HcalCommonData/data/hcalouteralgo.xml', + 'Geometry/HcalCommonData/data/hcalouteralgo/v1/hcalouteralgo.xml', 'Geometry/HcalCommonData/data/hcalforwardalgo.xml', 'Geometry/HcalCommonData/data/average/hcalforwardmaterial.xml', - 'Geometry/HcalCommonData/data/hcalSimNumbering/2021/hcalSimNumbering.xml', + 'Geometry/HcalCommonData/data/hcalSimNumbering/2021/v1/hcalSimNumbering.xml', 'Geometry/HcalCommonData/data/hcalRecNumbering/2021/hcalRecNumbering.xml', - 'Geometry/MuonCommonData/data/mbCommon/2021/v1/mbCommon.xml', - 'Geometry/MuonCommonData/data/mb1/2015/v2/mb1.xml', - 'Geometry/MuonCommonData/data/mb2/2015/v2/mb2.xml', - 'Geometry/MuonCommonData/data/mb3/2015/v2/mb3.xml', + 'Geometry/MuonCommonData/data/mbCommon/2021/v2/mbCommon.xml', + 'Geometry/MuonCommonData/data/mb1/2021/v1/mb1.xml', + 'Geometry/MuonCommonData/data/mb2/2021/v1/mb2.xml', + 'Geometry/MuonCommonData/data/mb3/2021/v1/mb3.xml', 'Geometry/MuonCommonData/data/mb4/2015/v2/mb4.xml', 'Geometry/MuonCommonData/data/mb4Shield/2021/v1/mb4Shield.xml', - 'Geometry/MuonCommonData/data/muonYoke/2021/v3/muonYoke.xml', + 'Geometry/MuonCommonData/data/muonYoke/2021/v5/muonYoke.xml', 'Geometry/MuonCommonData/data/mf/2021/v2/mf.xml', 'Geometry/MuonCommonData/data/rpcf/2015/v1/rpcf.xml', 'Geometry/MuonCommonData/data/gemf/TDR_BaseLine/gemf.xml', 'Geometry/MuonCommonData/data/gem11/TDR_BaseLine/gem11.xml', - 'Geometry/MuonCommonData/data/csc/2021/v2/csc.xml', + 'Geometry/MuonCommonData/data/csc/2021/v3/csc.xml', 'Geometry/MuonCommonData/data/mfshield/2017/v2/mfshield.xml', )+ cms.vstring( - 'Geometry/MuonCommonData/data/muonNumbering/2021/v2/muonNumbering.xml', + 'Geometry/MuonCommonData/data/muonNumbering/2021/v3/muonNumbering.xml', 'Geometry/ForwardCommonData/data/forward/2021/v1/forward.xml', 'Geometry/ForwardCommonData/data/totemt2/2021/v1/totemt2.xml', 'Geometry/ForwardCommonData/data/forwardshield/2021/v1/forwardshield.xml', 'Geometry/ForwardCommonData/data/brmrotations.xml', 'Geometry/ForwardCommonData/data/brm/2021/v1/brm.xml', - 'Geometry/ForwardCommonData/data/zdcmaterials.xml', + 'Geometry/ForwardCommonData/data/zdcmaterials/2021/v1/zdcmaterials.xml', 'Geometry/ForwardCommonData/data/lumimaterials.xml', 'Geometry/ForwardCommonData/data/zdcrotations.xml', 'Geometry/ForwardCommonData/data/lumirotations.xml', 'Geometry/ForwardCommonData/data/zdc/2021/v1/zdc.xml', - 'Geometry/ForwardCommonData/data/zdclumi/2021/v1/zdclumi.xml', + 'Geometry/ForwardCommonData/data/zdclumi/2021/v2/zdclumi.xml', 'Geometry/ForwardCommonData/data/cmszdc.xml', - 'Geometry/ForwardCommonData/data/Run2/totemMaterials.xml', - 'Geometry/ForwardCommonData/data/totemRotations.xml', 'Geometry/VeryForwardData/data/RP_Box.xml', - 'Geometry/VeryForwardData/data/RP_Box/RP_Box_000.xml', - 'Geometry/VeryForwardData/data/RP_Box/RP_Box_001.xml', - 'Geometry/VeryForwardData/data/RP_Box/RP_Box_002.xml', - 'Geometry/VeryForwardData/data/RP_Box/RP_Box_003.xml', - 'Geometry/VeryForwardData/data/RP_Box/RP_Box_004.xml', - 'Geometry/VeryForwardData/data/RP_Box/RP_Box_005.xml', - 'Geometry/VeryForwardData/data/RP_Box/RP_Box_020.xml', - 'Geometry/VeryForwardData/data/RP_Box/RP_Box_021.xml', - 'Geometry/VeryForwardData/data/RP_Box/RP_Box_022.xml', - 'Geometry/VeryForwardData/data/RP_Box/RP_Box_023.xml', - 'Geometry/VeryForwardData/data/RP_Box/RP_Box_024.xml', - 'Geometry/VeryForwardData/data/RP_Box/RP_Box_025.xml', - 'Geometry/VeryForwardData/data/RP_Box/RP_Box_100.xml', - 'Geometry/VeryForwardData/data/RP_Box/RP_Box_101.xml', - 'Geometry/VeryForwardData/data/RP_Box/RP_Box_102.xml', - 'Geometry/VeryForwardData/data/RP_Box/RP_Box_103.xml', - 'Geometry/VeryForwardData/data/RP_Box/RP_Box_104.xml', - 'Geometry/VeryForwardData/data/RP_Box/RP_Box_105.xml', - 'Geometry/VeryForwardData/data/RP_Box/RP_Box_120.xml', - 'Geometry/VeryForwardData/data/RP_Box/RP_Box_121.xml', - 'Geometry/VeryForwardData/data/RP_Box/RP_Box_122.xml', - 'Geometry/VeryForwardData/data/RP_Box/RP_Box_123.xml', - 'Geometry/VeryForwardData/data/RP_Box/RP_Box_124.xml', - 'Geometry/VeryForwardData/data/RP_Box/RP_Box_125.xml', - 'Geometry/VeryForwardData/data/RP_Hybrid.xml', - 'Geometry/VeryForwardData/data/RP_Materials.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_000.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_001.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_002.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_003.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_004.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_005.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_020.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_021.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_022.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_023.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_024.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_025.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_100.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_101.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_102.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_103.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_104.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_105.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_120.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_121.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_122.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_123.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_124.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_125.xml', + 'Geometry/VeryForwardData/data/RP_Hybrid/v2/RP_Hybrid.xml', + 'Geometry/VeryForwardData/data/RP_Materials/v4/RP_Materials.xml', 'Geometry/VeryForwardData/data/RP_Transformations.xml', 'Geometry/VeryForwardData/data/RP_Detectors_Assembly.xml', 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_000.xml', @@ -299,7 +300,6 @@ 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_005.xml', 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_020.xml', 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_021.xml', - 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_022.xml', 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_024.xml', 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_025.xml', 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_100.xml', @@ -309,24 +309,22 @@ 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_105.xml', 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_120.xml', 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_121.xml', - 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_122.xml', 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_124.xml', 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_125.xml', - 'Geometry/VeryForwardData/data/RP_Device.xml', - 'Geometry/VeryForwardData/data/RP_Vertical_Device.xml', - 'Geometry/VeryForwardData/data/RP_Horizontal_Device.xml', - 'Geometry/VeryForwardData/data/CTPPS_2018/CTPPS_220_Right_Station.xml', - 'Geometry/VeryForwardData/data/CTPPS_2018/CTPPS_220_Left_Station.xml', - 'Geometry/VeryForwardData/data/CTPPS_2018/CTPPS_210_Right_Station.xml', - 'Geometry/VeryForwardData/data/CTPPS_2018/CTPPS_210_Left_Station.xml', - 'Geometry/VeryForwardData/data/CTPPS_Stations_Assembly.xml', - 'Geometry/VeryForwardData/data/CTPPS_Cuts_Per_Region.xml', + 'Geometry/VeryForwardData/data/RP_Device/v1/RP_Device.xml', + 'Geometry/VeryForwardData/data/RP_Vertical_Device/2021/Simu/v2/RP_Vertical_Device.xml', + 'Geometry/VeryForwardData/data/RP_Horizontal_Device/2021/Simu/v2/RP_Horizontal_Device.xml', + 'Geometry/VeryForwardData/data/CTPPS_2021/Stations/Simu/v3/CTPPS_220_Right_Station.xml', + 'Geometry/VeryForwardData/data/CTPPS_2021/Stations/Simu/v3/CTPPS_220_Left_Station.xml', + 'Geometry/VeryForwardData/data/CTPPS_2021/Stations/Simu/v3/CTPPS_210_Right_Station.xml', + 'Geometry/VeryForwardData/data/CTPPS_2021/Stations/Simu/v3/CTPPS_210_Left_Station.xml', + 'Geometry/VeryForwardData/data/CTPPS_2021/Stations/Simu/v3/CTPPS_Stations_Assembly.xml', + 'Geometry/VeryForwardData/data/CTPPS_2021/Cuts_Per_Region/Simu/v1/CTPPS_Cuts_Per_Region.xml', 'Geometry/VeryForwardData/data/RP_Sensitive_Dets.xml', - 'Geometry/VeryForwardData/data/CTPPS_Diamond_Materials.xml', 'Geometry/VeryForwardData/data/CTPPS_Diamond_Transformations.xml', 'Geometry/VeryForwardData/data/CTPPS_Diamond_Parameters.xml', 'Geometry/VeryForwardData/data/CTPPS_Timing_Station_Parameters.xml', - 'Geometry/VeryForwardData/data/CTPPS_Timing_Horizontal_Pot.xml', + 'Geometry/VeryForwardData/data/CTPPS_Timing_Horizontal_Pot/v2/CTPPS_Timing_Horizontal_Pot.xml', 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern1_Segment1.xml', 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern2_Segment1.xml', 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern2_Segment2.xml', @@ -339,27 +337,28 @@ 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern4_Segment3.xml', 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern4_Segment4.xml', 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern4_Segment5.xml', - 'Geometry/VeryForwardData/data/CTPPS_Diamond_2018/CTPPS_Diamond_Planes/CTPPS_Diamond_Plane1.xml', - 'Geometry/VeryForwardData/data/CTPPS_Diamond_2018/CTPPS_Diamond_Planes/CTPPS_Diamond_Plane2.xml', - 'Geometry/VeryForwardData/data/CTPPS_Diamond_2018/CTPPS_Diamond_Planes/CTPPS_Diamond_Plane3.xml', - 'Geometry/VeryForwardData/data/CTPPS_Diamond_2018/CTPPS_Diamond_Planes/CTPPS_Diamond_Plane4.xml', - 'Geometry/VeryForwardData/data/CTPPS_Diamond_2018/CTPPS_Diamond_Detector_Assembly.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_2021/CTPPS_Diamond_Planes/CTPPS_Diamond_Plane1.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_2021/CTPPS_Diamond_Planes/CTPPS_Diamond_Plane2.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_2021/CTPPS_Diamond_Planes/CTPPS_Diamond_Plane3.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_2021/CTPPS_Diamond_Planes/CTPPS_Diamond_Plane4.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_2021/CTPPS_Diamond_Detector_Assembly/v1/CTPPS_Diamond_Detector_Assembly.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_2021/Simu/v1/CTPPS_Detectors_Assembly_022.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_2021/Simu/v1/CTPPS_Detectors_Assembly_122.xml', 'Geometry/VeryForwardData/data/CTPPS_Diamond_Sensitive_Dets_TimingHits.xml', - 'Geometry/VeryForwardData/data/ppstrackerMaterials/v1/ppstrackerMaterials.xml', - 'Geometry/VeryForwardData/data/CTPPS_Pixel_Module/v1/CTPPS_Pixel_Module.xml', - 'Geometry/VeryForwardData/data/CTPPS_Pixel_Module_2x2/v1/CTPPS_Pixel_Module_2x2.xml', - 'Geometry/VeryForwardData/data/CTPPS_Pixel_2018/CTPPS_Pixel_Assembly_Box_Real_003.xml', - 'Geometry/VeryForwardData/data/CTPPS_Pixel_2018/CTPPS_Pixel_Assembly_Box_Real_023.xml', - 'Geometry/VeryForwardData/data/CTPPS_Pixel_2018/CTPPS_Pixel_Assembly_Box_Real_103.xml', - 'Geometry/VeryForwardData/data/CTPPS_Pixel_2018/CTPPS_Pixel_Assembly_Box_Real_123.xml', - 'Geometry/VeryForwardData/data/CTPPS_Pixel_Sens.xml', - 'Geometry/VeryForwardData/data/CTPPS_2018/RP_Dist_Beam_Cent.xml', + 'Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Modules/v2/ppstrackerMaterials.xml', + 'Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Modules/v2/PPS_Pixel_Module_2x2_Run3.xml', + 'Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Modules/v2/PPS_Pixel_Sens.xml', + 'Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Assembly/v1/CTPPS_Pixel_Assembly_Box_Real_003.xml', + 'Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Assembly/v1/CTPPS_Pixel_Assembly_Box_Real_023.xml', + 'Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Assembly/v1/CTPPS_Pixel_Assembly_Box_Real_103.xml', + 'Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Assembly/v1/CTPPS_Pixel_Assembly_Box_Real_123.xml', + 'Geometry/VeryForwardData/data/CTPPS_2021/RP_Dist_Beam_Cent/Simu/v1/RP_Dist_Beam_Cent.xml', 'Geometry/EcalSimData/data/ecalsens.xml', - 'Geometry/HcalCommonData/data/hcalsenspmf.xml', + 'Geometry/HcalCommonData/data/hcalsens/2021/v1/hcalsenspmf.xml', 'Geometry/HcalSimData/data/hf.xml', 'Geometry/HcalSimData/data/hfpmt.xml', 'Geometry/HcalSimData/data/hffibrebundle.xml', - 'Geometry/HcalSimData/data/CaloUtil.xml', + 'Geometry/HcalSimData/data/CaloUtil/2021/v1/CaloUtil.xml', 'Geometry/MuonSimData/data/v2/muonSens.xml', 'Geometry/DTGeometryBuilder/data/dtSpecsFilter/2021/v1/dtSpecsFilter.xml', 'Geometry/CSCGeometryBuilder/data/cscSpecsFilter.xml', @@ -370,11 +369,11 @@ 'Geometry/ForwardCommonData/data/brmsens.xml', 'Geometry/ForwardSimData/data/totemsensT2/2021/totemsensT2.xml', 'Geometry/ForwardSimData/data/zdcsens.xml', - 'Geometry/HcalSimData/data/HcalProdCuts.xml', + 'Geometry/HcalSimData/data/HcalProdCuts/2021/v2/HcalProdCuts.xml', 'Geometry/EcalSimData/data/EcalProdCuts.xml', 'Geometry/EcalSimData/data/ESProdCuts.xml', 'Geometry/MuonSimData/data/muonProdCuts/2021/v1/muonProdCuts.xml', - 'Geometry/ForwardSimData/data/zdcProdCuts.xml', + 'Geometry/ForwardSimData/data/zdcProdCuts/2021/v2/zdcProdCuts.xml', 'Geometry/ForwardSimData/data/ForwardShieldProdCuts.xml', 'Geometry/CMSCommonData/data/FieldParameters.xml', ), diff --git a/Geometry/TrackerCommonData/python/cmsExtendedGeometry2021XML_cfi.py b/Geometry/TrackerCommonData/python/cmsExtendedGeometry2021XML_cfi.py index 4571d9f669537..f036c8be47612 100644 --- a/Geometry/TrackerCommonData/python/cmsExtendedGeometry2021XML_cfi.py +++ b/Geometry/TrackerCommonData/python/cmsExtendedGeometry2021XML_cfi.py @@ -2,10 +2,10 @@ XMLIdealGeometryESSource = cms.ESSource("XMLIdealGeometryESSource", geomXMLFiles = cms.vstring( - 'Geometry/CMSCommonData/data/materials/2021/v2/materials.xml', - 'Geometry/TrackerCommonData/data/trackermaterial/2021/v1/trackermaterial.xml', + 'Geometry/CMSCommonData/data/materials/2021/v3/materials.xml', + 'Geometry/TrackerCommonData/data/trackermaterial/2021/v2/trackermaterial.xml', 'Geometry/CMSCommonData/data/rotations.xml', - 'Geometry/CMSCommonData/data/extend/v2/cmsextent.xml', + 'Geometry/CMSCommonData/data/extend/v3/cmsextent.xml', 'Geometry/CMSCommonData/data/cavernData/2021/v1/cavernData.xml', 'Geometry/CMSCommonData/data/cms/2021/v3/cms.xml', 'Geometry/CMSCommonData/data/cmsMother.xml', @@ -23,7 +23,7 @@ 'Geometry/CMSCommonData/data/cavern/2021/v1/cavern.xml', 'Geometry/CMSCommonData/data/cavernFloor/2017/v1/cavernFloor.xml', 'Geometry/TrackerCommonData/data/PhaseI/trackerParameters.xml', - 'Geometry/TrackerCommonData/data/pixfwdMaterials/2021/v2/pixfwdMaterials.xml', + 'Geometry/TrackerCommonData/data/pixfwdMaterials/2021/v3/pixfwdMaterials.xml', 'Geometry/TrackerCommonData/data/pixfwdCommon.xml', 'Geometry/TrackerCommonData/data/PhaseI/v2/pixfwdCylinder.xml', 'Geometry/TrackerCommonData/data/PhaseI/v2/pixfwdDisks.xml', @@ -37,7 +37,7 @@ 'Geometry/TrackerCommonData/data/PhaseI/v2/pixfwdbladeInnerZminus.xml', 'Geometry/TrackerCommonData/data/PhaseI/v2/pixfwdbladeOuterZplus.xml', 'Geometry/TrackerCommonData/data/PhaseI/v2/pixfwdbladeOuterZminus.xml', - 'Geometry/TrackerCommonData/data/PhaseI/v2/pixbarmaterial.xml', + 'Geometry/TrackerCommonData/data/PhaseI/v3/pixbarmaterial.xml', 'Geometry/TrackerCommonData/data/PhaseI/v2/pixbarladder.xml', 'Geometry/TrackerCommonData/data/PhaseI/v2/pixbarladderfull0.xml', 'Geometry/TrackerCommonData/data/PhaseI/v2/pixbarladderfull1.xml', @@ -51,8 +51,8 @@ 'Geometry/TrackerCommonData/data/PhaseI/v2/pixbar.xml', 'Geometry/TrackerCommonData/data/Run2/trackerpatchpannel.xml', 'Geometry/TrackerCommonData/data/Run2/trackerpixelnose.xml', - 'Geometry/TrackerCommonData/data/tibtidcommonmaterial//2021/v1/tibtidcommonmaterial.xml', - 'Geometry/TrackerCommonData/data/tibmaterial/2021/v1/tibmaterial.xml', + 'Geometry/TrackerCommonData/data/tibtidcommonmaterial/2021/v2/tibtidcommonmaterial.xml', + 'Geometry/TrackerCommonData/data/tibmaterial/2021/v2/tibmaterial.xml', 'Geometry/TrackerCommonData/data/tibmodpar.xml', 'Geometry/TrackerCommonData/data/tibmodule0.xml', 'Geometry/TrackerCommonData/data/tibmodule0a.xml', @@ -85,7 +85,7 @@ 'Geometry/TrackerCommonData/data/tiblayer2.xml', 'Geometry/TrackerCommonData/data/tiblayer3.xml', 'Geometry/TrackerCommonData/data/tib.xml', - 'Geometry/TrackerCommonData/data/tidmaterial/2021/v1/tidmaterial.xml', + 'Geometry/TrackerCommonData/data/tidmaterial/2021/v2/tidmaterial.xml', 'Geometry/TrackerCommonData/data/tidmodpar.xml', 'Geometry/TrackerCommonData/data/tidmodule0.xml', 'Geometry/TrackerCommonData/data/tidmodule0r.xml', @@ -108,7 +108,7 @@ 'Geometry/TrackerCommonData/data/tibtidservices.xml', 'Geometry/TrackerCommonData/data/tibtidservicesf.xml', 'Geometry/TrackerCommonData/data/tibtidservicesb.xml', - 'Geometry/TrackerCommonData/data/tobmaterial/2021/v1/tobmaterial.xml', + 'Geometry/TrackerCommonData/data/tobmaterial/2021/v2/tobmaterial.xml', 'Geometry/TrackerCommonData/data/tobmodpar.xml', 'Geometry/TrackerCommonData/data/tobmodule0.xml', 'Geometry/TrackerCommonData/data/tobmodule2.xml', @@ -206,19 +206,19 @@ 'Geometry/TrackerCommonData/data/trackerother.xml', 'Geometry/TrackerCommonData/data/PhaseI/trackerStructureTopology.xml', 'Geometry/TrackerSimData/data/PhaseI/trackersens.xml', - 'Geometry/TrackerRecoData/data/PhaseI/trackerRecoMaterial.xml', - 'SimTracker/TrackerMaterialAnalysis/data/trackingMaterialGroups_ForPhaseI.xml', + 'Geometry/TrackerRecoData/data/PhaseI/v1/trackerRecoMaterial.xml', + 'SimTracker/TrackerMaterialAnalysis/data/trackingMaterialGroups_ForPhaseI/v1/trackingMaterialGroups_ForPhaseI.xml', 'Geometry/TrackerSimData/data/PhaseI/trackerProdCuts.xml', 'Geometry/TrackerSimData/data/trackerProdCutsBEAM.xml', + 'Geometry/EcalCommonData/data/ebcon/2021/v1/ebcon.xml', + 'Geometry/EcalCommonData/data/eecon.xml', + 'Geometry/EcalCommonData/data/escon.xml', 'Geometry/EcalCommonData/data/eregalgo/2017/v1/eregalgo.xml', 'Geometry/EcalCommonData/data/ebalgo.xml', - 'Geometry/EcalCommonData/data/ebcon.xml', 'Geometry/EcalCommonData/data/ebrot.xml', - 'Geometry/EcalCommonData/data/eecon.xml', 'Geometry/EcalCommonData/data/eefixed/2021/v1/eefixed.xml', 'Geometry/EcalCommonData/data/eehier.xml', 'Geometry/EcalCommonData/data/eealgo.xml', - 'Geometry/EcalCommonData/data/escon.xml', 'Geometry/EcalCommonData/data/esalgo.xml', 'Geometry/EcalCommonData/data/eeF.xml', 'Geometry/EcalCommonData/data/eeB.xml', @@ -228,68 +228,66 @@ 'Geometry/HcalCommonData/data/hcalcablealgo.xml', 'Geometry/HcalCommonData/data/hcalbarrelalgo.xml', 'Geometry/HcalCommonData/data/hcalendcap/PhaseI/hcalendcapalgo.xml', - 'Geometry/HcalCommonData/data/hcalouteralgo.xml', + 'Geometry/HcalCommonData/data/hcalouteralgo/v1/hcalouteralgo.xml', 'Geometry/HcalCommonData/data/hcalforwardalgo.xml', 'Geometry/HcalCommonData/data/average/hcalforwardmaterial.xml', - 'Geometry/HcalCommonData/data/hcalSimNumbering/2021/hcalSimNumbering.xml', + 'Geometry/HcalCommonData/data/hcalSimNumbering/2021/v1/hcalSimNumbering.xml', 'Geometry/HcalCommonData/data/hcalRecNumbering/2021/hcalRecNumbering.xml', - 'Geometry/MuonCommonData/data/mbCommon/2021/v1/mbCommon.xml', - 'Geometry/MuonCommonData/data/mb1/2015/v2/mb1.xml', - 'Geometry/MuonCommonData/data/mb2/2015/v2/mb2.xml', - 'Geometry/MuonCommonData/data/mb3/2015/v2/mb3.xml', + 'Geometry/MuonCommonData/data/mbCommon/2021/v2/mbCommon.xml', + 'Geometry/MuonCommonData/data/mb1/2021/v1/mb1.xml', + 'Geometry/MuonCommonData/data/mb2/2021/v1/mb2.xml', + 'Geometry/MuonCommonData/data/mb3/2021/v1/mb3.xml', 'Geometry/MuonCommonData/data/mb4/2015/v2/mb4.xml', 'Geometry/MuonCommonData/data/mb4Shield/2021/v1/mb4Shield.xml', - 'Geometry/MuonCommonData/data/muonYoke/2021/v3/muonYoke.xml', + 'Geometry/MuonCommonData/data/muonYoke/2021/v5/muonYoke.xml', 'Geometry/MuonCommonData/data/mf/2021/v2/mf.xml', 'Geometry/MuonCommonData/data/rpcf/2015/v1/rpcf.xml', 'Geometry/MuonCommonData/data/gemf/TDR_BaseLine/gemf.xml', 'Geometry/MuonCommonData/data/gem11/TDR_BaseLine/gem11.xml', - 'Geometry/MuonCommonData/data/csc/2021/v2/csc.xml', + 'Geometry/MuonCommonData/data/csc/2021/v3/csc.xml', 'Geometry/MuonCommonData/data/mfshield/2017/v2/mfshield.xml', )+ cms.vstring( - 'Geometry/MuonCommonData/data/muonNumbering/2021/v2/muonNumbering.xml', + 'Geometry/MuonCommonData/data/muonNumbering/2021/v3/muonNumbering.xml', 'Geometry/ForwardCommonData/data/forward/2021/v1/forward.xml', 'Geometry/ForwardCommonData/data/totemt2/2021/v1/totemt2.xml', 'Geometry/ForwardCommonData/data/forwardshield/2021/v1/forwardshield.xml', 'Geometry/ForwardCommonData/data/brmrotations.xml', 'Geometry/ForwardCommonData/data/brm/2021/v1/brm.xml', - 'Geometry/ForwardCommonData/data/zdcmaterials.xml', + 'Geometry/ForwardCommonData/data/zdcmaterials/2021/v1/zdcmaterials.xml', 'Geometry/ForwardCommonData/data/lumimaterials.xml', 'Geometry/ForwardCommonData/data/zdcrotations.xml', 'Geometry/ForwardCommonData/data/lumirotations.xml', 'Geometry/ForwardCommonData/data/zdc/2021/v1/zdc.xml', - 'Geometry/ForwardCommonData/data/zdclumi/2021/v1/zdclumi.xml', + 'Geometry/ForwardCommonData/data/zdclumi/2021/v2/zdclumi.xml', 'Geometry/ForwardCommonData/data/cmszdc.xml', - 'Geometry/ForwardCommonData/data/Run2/totemMaterials.xml', - 'Geometry/ForwardCommonData/data/totemRotations.xml', 'Geometry/VeryForwardData/data/RP_Box.xml', - 'Geometry/VeryForwardData/data/RP_Box/RP_Box_000.xml', - 'Geometry/VeryForwardData/data/RP_Box/RP_Box_001.xml', - 'Geometry/VeryForwardData/data/RP_Box/RP_Box_002.xml', - 'Geometry/VeryForwardData/data/RP_Box/RP_Box_003.xml', - 'Geometry/VeryForwardData/data/RP_Box/RP_Box_004.xml', - 'Geometry/VeryForwardData/data/RP_Box/RP_Box_005.xml', - 'Geometry/VeryForwardData/data/RP_Box/RP_Box_020.xml', - 'Geometry/VeryForwardData/data/RP_Box/RP_Box_021.xml', - 'Geometry/VeryForwardData/data/RP_Box/RP_Box_022.xml', - 'Geometry/VeryForwardData/data/RP_Box/RP_Box_023.xml', - 'Geometry/VeryForwardData/data/RP_Box/RP_Box_024.xml', - 'Geometry/VeryForwardData/data/RP_Box/RP_Box_025.xml', - 'Geometry/VeryForwardData/data/RP_Box/RP_Box_100.xml', - 'Geometry/VeryForwardData/data/RP_Box/RP_Box_101.xml', - 'Geometry/VeryForwardData/data/RP_Box/RP_Box_102.xml', - 'Geometry/VeryForwardData/data/RP_Box/RP_Box_103.xml', - 'Geometry/VeryForwardData/data/RP_Box/RP_Box_104.xml', - 'Geometry/VeryForwardData/data/RP_Box/RP_Box_105.xml', - 'Geometry/VeryForwardData/data/RP_Box/RP_Box_120.xml', - 'Geometry/VeryForwardData/data/RP_Box/RP_Box_121.xml', - 'Geometry/VeryForwardData/data/RP_Box/RP_Box_122.xml', - 'Geometry/VeryForwardData/data/RP_Box/RP_Box_123.xml', - 'Geometry/VeryForwardData/data/RP_Box/RP_Box_124.xml', - 'Geometry/VeryForwardData/data/RP_Box/RP_Box_125.xml', - 'Geometry/VeryForwardData/data/RP_Hybrid.xml', - 'Geometry/VeryForwardData/data/RP_Materials.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_000.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_001.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_002.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_003.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_004.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_005.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_020.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_021.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_022.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_023.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_024.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_025.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_100.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_101.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_102.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_103.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_104.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_105.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_120.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_121.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_122.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_123.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_124.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_125.xml', + 'Geometry/VeryForwardData/data/RP_Hybrid/v2/RP_Hybrid.xml', + 'Geometry/VeryForwardData/data/RP_Materials/v4/RP_Materials.xml', 'Geometry/VeryForwardData/data/RP_Transformations.xml', 'Geometry/VeryForwardData/data/RP_Detectors_Assembly.xml', 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_000.xml', @@ -299,7 +297,6 @@ 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_005.xml', 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_020.xml', 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_021.xml', - 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_022.xml', 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_024.xml', 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_025.xml', 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_100.xml', @@ -309,24 +306,22 @@ 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_105.xml', 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_120.xml', 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_121.xml', - 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_122.xml', 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_124.xml', 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_125.xml', - 'Geometry/VeryForwardData/data/RP_Device.xml', - 'Geometry/VeryForwardData/data/RP_Vertical_Device.xml', - 'Geometry/VeryForwardData/data/RP_Horizontal_Device.xml', - 'Geometry/VeryForwardData/data/CTPPS_2018/CTPPS_220_Right_Station.xml', - 'Geometry/VeryForwardData/data/CTPPS_2018/CTPPS_220_Left_Station.xml', - 'Geometry/VeryForwardData/data/CTPPS_2018/CTPPS_210_Right_Station.xml', - 'Geometry/VeryForwardData/data/CTPPS_2018/CTPPS_210_Left_Station.xml', - 'Geometry/VeryForwardData/data/CTPPS_Stations_Assembly.xml', - 'Geometry/VeryForwardData/data/CTPPS_Cuts_Per_Region.xml', + 'Geometry/VeryForwardData/data/RP_Device/v1/RP_Device.xml', + 'Geometry/VeryForwardData/data/RP_Vertical_Device/2021/Simu/v2/RP_Vertical_Device.xml', + 'Geometry/VeryForwardData/data/RP_Horizontal_Device/2021/Simu/v2/RP_Horizontal_Device.xml', + 'Geometry/VeryForwardData/data/CTPPS_2021/Stations/Simu/v3/CTPPS_220_Right_Station.xml', + 'Geometry/VeryForwardData/data/CTPPS_2021/Stations/Simu/v3/CTPPS_220_Left_Station.xml', + 'Geometry/VeryForwardData/data/CTPPS_2021/Stations/Simu/v3/CTPPS_210_Right_Station.xml', + 'Geometry/VeryForwardData/data/CTPPS_2021/Stations/Simu/v3/CTPPS_210_Left_Station.xml', + 'Geometry/VeryForwardData/data/CTPPS_2021/Stations/Simu/v3/CTPPS_Stations_Assembly.xml', + 'Geometry/VeryForwardData/data/CTPPS_2021/Cuts_Per_Region/Simu/v1/CTPPS_Cuts_Per_Region.xml', 'Geometry/VeryForwardData/data/RP_Sensitive_Dets.xml', - 'Geometry/VeryForwardData/data/CTPPS_Diamond_Materials.xml', 'Geometry/VeryForwardData/data/CTPPS_Diamond_Transformations.xml', 'Geometry/VeryForwardData/data/CTPPS_Diamond_Parameters.xml', 'Geometry/VeryForwardData/data/CTPPS_Timing_Station_Parameters.xml', - 'Geometry/VeryForwardData/data/CTPPS_Timing_Horizontal_Pot.xml', + 'Geometry/VeryForwardData/data/CTPPS_Timing_Horizontal_Pot/v2/CTPPS_Timing_Horizontal_Pot.xml', 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern1_Segment1.xml', 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern2_Segment1.xml', 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern2_Segment2.xml', @@ -339,27 +334,28 @@ 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern4_Segment3.xml', 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern4_Segment4.xml', 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern4_Segment5.xml', - 'Geometry/VeryForwardData/data/CTPPS_Diamond_2018/CTPPS_Diamond_Planes/CTPPS_Diamond_Plane1.xml', - 'Geometry/VeryForwardData/data/CTPPS_Diamond_2018/CTPPS_Diamond_Planes/CTPPS_Diamond_Plane2.xml', - 'Geometry/VeryForwardData/data/CTPPS_Diamond_2018/CTPPS_Diamond_Planes/CTPPS_Diamond_Plane3.xml', - 'Geometry/VeryForwardData/data/CTPPS_Diamond_2018/CTPPS_Diamond_Planes/CTPPS_Diamond_Plane4.xml', - 'Geometry/VeryForwardData/data/CTPPS_Diamond_2018/CTPPS_Diamond_Detector_Assembly.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_2021/CTPPS_Diamond_Planes/CTPPS_Diamond_Plane1.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_2021/CTPPS_Diamond_Planes/CTPPS_Diamond_Plane2.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_2021/CTPPS_Diamond_Planes/CTPPS_Diamond_Plane3.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_2021/CTPPS_Diamond_Planes/CTPPS_Diamond_Plane4.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_2021/CTPPS_Diamond_Detector_Assembly/v1/CTPPS_Diamond_Detector_Assembly.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_2021/Simu/v1/CTPPS_Detectors_Assembly_022.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_2021/Simu/v1/CTPPS_Detectors_Assembly_122.xml', 'Geometry/VeryForwardData/data/CTPPS_Diamond_Sensitive_Dets_TimingHits.xml', - 'Geometry/VeryForwardData/data/ppstrackerMaterials/v1/ppstrackerMaterials.xml', - 'Geometry/VeryForwardData/data/CTPPS_Pixel_Module/v1/CTPPS_Pixel_Module.xml', - 'Geometry/VeryForwardData/data/CTPPS_Pixel_Module_2x2/v1/CTPPS_Pixel_Module_2x2.xml', - 'Geometry/VeryForwardData/data/CTPPS_Pixel_2018/CTPPS_Pixel_Assembly_Box_Real_003.xml', - 'Geometry/VeryForwardData/data/CTPPS_Pixel_2018/CTPPS_Pixel_Assembly_Box_Real_023.xml', - 'Geometry/VeryForwardData/data/CTPPS_Pixel_2018/CTPPS_Pixel_Assembly_Box_Real_103.xml', - 'Geometry/VeryForwardData/data/CTPPS_Pixel_2018/CTPPS_Pixel_Assembly_Box_Real_123.xml', - 'Geometry/VeryForwardData/data/CTPPS_Pixel_Sens.xml', - 'Geometry/VeryForwardData/data/CTPPS_2018/RP_Dist_Beam_Cent.xml', + 'Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Modules/v2/ppstrackerMaterials.xml', + 'Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Modules/v2/PPS_Pixel_Module_2x2_Run3.xml', + 'Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Modules/v2/PPS_Pixel_Sens.xml', + 'Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Assembly/v1/CTPPS_Pixel_Assembly_Box_Real_003.xml', + 'Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Assembly/v1/CTPPS_Pixel_Assembly_Box_Real_023.xml', + 'Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Assembly/v1/CTPPS_Pixel_Assembly_Box_Real_103.xml', + 'Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Assembly/v1/CTPPS_Pixel_Assembly_Box_Real_123.xml', + 'Geometry/VeryForwardData/data/CTPPS_2021/RP_Dist_Beam_Cent/Simu/v1/RP_Dist_Beam_Cent.xml', 'Geometry/EcalSimData/data/ecalsens.xml', - 'Geometry/HcalCommonData/data/hcalsenspmf.xml', + 'Geometry/HcalCommonData/data/hcalsens/2021/v1/hcalsenspmf.xml', 'Geometry/HcalSimData/data/hf.xml', 'Geometry/HcalSimData/data/hfpmt.xml', 'Geometry/HcalSimData/data/hffibrebundle.xml', - 'Geometry/HcalSimData/data/CaloUtil.xml', + 'Geometry/HcalSimData/data/CaloUtil/2021/v1/CaloUtil.xml', 'Geometry/MuonSimData/data/v2/muonSens.xml', 'Geometry/DTGeometryBuilder/data/dtSpecsFilter/2021/v1/dtSpecsFilter.xml', 'Geometry/CSCGeometryBuilder/data/cscSpecsFilter.xml', @@ -370,11 +366,11 @@ 'Geometry/ForwardCommonData/data/brmsens.xml', 'Geometry/ForwardSimData/data/totemsensT2/2021/totemsensT2.xml', 'Geometry/ForwardSimData/data/zdcsens.xml', - 'Geometry/HcalSimData/data/HcalProdCuts.xml', + 'Geometry/HcalSimData/data/HcalProdCuts/2021/v2/HcalProdCuts.xml', 'Geometry/EcalSimData/data/EcalProdCuts.xml', 'Geometry/EcalSimData/data/ESProdCuts.xml', 'Geometry/MuonSimData/data/muonProdCuts/2021/v1/muonProdCuts.xml', - 'Geometry/ForwardSimData/data/zdcProdCuts.xml', + 'Geometry/ForwardSimData/data/zdcProdCuts/2021/v2/zdcProdCuts.xml', 'Geometry/ForwardSimData/data/ForwardShieldProdCuts.xml', 'Geometry/CMSCommonData/data/FieldParameters.xml', ), diff --git a/Geometry/TrackerCommonData/python/cmsExtendedGeometry2021ZeroMaterialXML_cfi.py b/Geometry/TrackerCommonData/python/cmsExtendedGeometry2021ZeroMaterialXML_cfi.py index 1f662c3016125..a616d9f9fc103 100644 --- a/Geometry/TrackerCommonData/python/cmsExtendedGeometry2021ZeroMaterialXML_cfi.py +++ b/Geometry/TrackerCommonData/python/cmsExtendedGeometry2021ZeroMaterialXML_cfi.py @@ -1,10 +1,14 @@ import FWCore.ParameterSet.Config as cms + +# This config was generated automatically using generate2021Geometry.py +# If you notice a mistake, please update the generating script, not just this config + XMLIdealGeometryESSource = cms.ESSource("XMLIdealGeometryESSource", geomXMLFiles = cms.vstring( 'Geometry/CMSCommonData/data/materials/2021/v2/materials.xml', - 'Geometry/TrackerCommonData/data/zeroMaterial/2021/v1/trackermaterial.xml', + 'Geometry/TrackerCommonData/data/zeroMaterial/2021/v2/trackermaterial.xml', 'Geometry/CMSCommonData/data/rotations.xml', - 'Geometry/CMSCommonData/data/extend/v2/cmsextent.xml', + 'Geometry/CMSCommonData/data/extend/v3/cmsextent.xml', 'Geometry/CMSCommonData/data/cavernData/2021/v1/cavernData.xml', 'Geometry/CMSCommonData/data/cms/2021/v3/cms.xml', 'Geometry/CMSCommonData/data/cmsMother.xml', @@ -50,8 +54,8 @@ 'Geometry/TrackerCommonData/data/PhaseI/v2/pixbar.xml', 'Geometry/TrackerCommonData/data/Run2/trackerpatchpannel.xml', 'Geometry/TrackerCommonData/data/Run2/trackerpixelnose.xml', - 'Geometry/TrackerCommonData/data/zeroMaterial/2021/v1/tibtidcommonmaterial.xml', - 'Geometry/TrackerCommonData/data/zeroMaterial/2021/v1/tibmaterial.xml', + 'Geometry/TrackerCommonData/data/zeroMaterial/2021/v2/tibtidcommonmaterial.xml', + 'Geometry/TrackerCommonData/data/zeroMaterial/2021/v2/tibmaterial.xml', 'Geometry/TrackerCommonData/data/tibmodpar.xml', 'Geometry/TrackerCommonData/data/tibmodule0.xml', 'Geometry/TrackerCommonData/data/tibmodule0a.xml', @@ -84,7 +88,7 @@ 'Geometry/TrackerCommonData/data/tiblayer2.xml', 'Geometry/TrackerCommonData/data/tiblayer3.xml', 'Geometry/TrackerCommonData/data/tib.xml', - 'Geometry/TrackerCommonData/data/zeroMaterial/2021/v1/tidmaterial.xml', + 'Geometry/TrackerCommonData/data/zeroMaterial/2021/v2/tidmaterial.xml', 'Geometry/TrackerCommonData/data/tidmodpar.xml', 'Geometry/TrackerCommonData/data/tidmodule0.xml', 'Geometry/TrackerCommonData/data/tidmodule0r.xml', @@ -107,7 +111,7 @@ 'Geometry/TrackerCommonData/data/tibtidservices.xml', 'Geometry/TrackerCommonData/data/tibtidservicesf.xml', 'Geometry/TrackerCommonData/data/tibtidservicesb.xml', - 'Geometry/TrackerCommonData/data/zeroMaterial/2021/v1/tobmaterial.xml', + 'Geometry/TrackerCommonData/data/zeroMaterial/2021/v2/tobmaterial.xml', 'Geometry/TrackerCommonData/data/tobmodpar.xml', 'Geometry/TrackerCommonData/data/tobmodule0.xml', 'Geometry/TrackerCommonData/data/tobmodule2.xml', @@ -205,18 +209,19 @@ 'Geometry/TrackerCommonData/data/trackerother.xml', 'Geometry/TrackerCommonData/data/PhaseI/trackerStructureTopology.xml', 'Geometry/TrackerSimData/data/PhaseI/trackersens.xml', - 'Geometry/TrackerRecoData/data/PhaseI/trackerRecoMaterial.xml', + 'Geometry/TrackerRecoData/data/PhaseI/v1/trackerRecoMaterial.xml', + 'SimTracker/TrackerMaterialAnalysis/data/trackingMaterialGroups_ForPhaseI/v1/trackingMaterialGroups_ForPhaseI.xml', 'Geometry/TrackerSimData/data/PhaseI/trackerProdCuts.xml', 'Geometry/TrackerSimData/data/trackerProdCutsBEAM.xml', + 'Geometry/EcalCommonData/data/ebcon/2021/v1/ebcon.xml', + 'Geometry/EcalCommonData/data/eecon.xml', + 'Geometry/EcalCommonData/data/escon.xml', 'Geometry/EcalCommonData/data/eregalgo/2017/v1/eregalgo.xml', 'Geometry/EcalCommonData/data/ebalgo.xml', - 'Geometry/EcalCommonData/data/ebcon.xml', 'Geometry/EcalCommonData/data/ebrot.xml', - 'Geometry/EcalCommonData/data/eecon.xml', 'Geometry/EcalCommonData/data/eefixed/2021/v1/eefixed.xml', 'Geometry/EcalCommonData/data/eehier.xml', 'Geometry/EcalCommonData/data/eealgo.xml', - 'Geometry/EcalCommonData/data/escon.xml', 'Geometry/EcalCommonData/data/esalgo.xml', 'Geometry/EcalCommonData/data/eeF.xml', 'Geometry/EcalCommonData/data/eeB.xml', @@ -226,68 +231,66 @@ 'Geometry/HcalCommonData/data/hcalcablealgo.xml', 'Geometry/HcalCommonData/data/hcalbarrelalgo.xml', 'Geometry/HcalCommonData/data/hcalendcap/PhaseI/hcalendcapalgo.xml', - 'Geometry/HcalCommonData/data/hcalouteralgo.xml', + 'Geometry/HcalCommonData/data/hcalouteralgo/v1/hcalouteralgo.xml', 'Geometry/HcalCommonData/data/hcalforwardalgo.xml', 'Geometry/HcalCommonData/data/average/hcalforwardmaterial.xml', - 'Geometry/HcalCommonData/data/hcalSimNumbering/2021/hcalSimNumbering.xml', + 'Geometry/HcalCommonData/data/hcalSimNumbering/2021/v1/hcalSimNumbering.xml', 'Geometry/HcalCommonData/data/hcalRecNumbering/2021/hcalRecNumbering.xml', - 'Geometry/MuonCommonData/data/mbCommon/2021/v1/mbCommon.xml', - 'Geometry/MuonCommonData/data/mb1/2015/v2/mb1.xml', - 'Geometry/MuonCommonData/data/mb2/2015/v2/mb2.xml', - 'Geometry/MuonCommonData/data/mb3/2015/v2/mb3.xml', + 'Geometry/MuonCommonData/data/mbCommon/2021/v2/mbCommon.xml', + 'Geometry/MuonCommonData/data/mb1/2021/v1/mb1.xml', + 'Geometry/MuonCommonData/data/mb2/2021/v1/mb2.xml', + 'Geometry/MuonCommonData/data/mb3/2021/v1/mb3.xml', 'Geometry/MuonCommonData/data/mb4/2015/v2/mb4.xml', 'Geometry/MuonCommonData/data/mb4Shield/2021/v1/mb4Shield.xml', - 'Geometry/MuonCommonData/data/muonYoke/2021/v3/muonYoke.xml', + 'Geometry/MuonCommonData/data/muonYoke/2021/v5/muonYoke.xml', 'Geometry/MuonCommonData/data/mf/2021/v2/mf.xml', 'Geometry/MuonCommonData/data/rpcf/2015/v1/rpcf.xml', 'Geometry/MuonCommonData/data/gemf/TDR_BaseLine/gemf.xml', 'Geometry/MuonCommonData/data/gem11/TDR_BaseLine/gem11.xml', - 'Geometry/MuonCommonData/data/csc/2021/v2/csc.xml', + 'Geometry/MuonCommonData/data/csc/2021/v3/csc.xml', 'Geometry/MuonCommonData/data/mfshield/2017/v2/mfshield.xml', )+ cms.vstring( - 'Geometry/MuonCommonData/data/muonNumbering/2021/v2/muonNumbering.xml', + 'Geometry/MuonCommonData/data/muonNumbering/2021/v3/muonNumbering.xml', 'Geometry/ForwardCommonData/data/forward/2021/v1/forward.xml', 'Geometry/ForwardCommonData/data/totemt2/2021/v1/totemt2.xml', 'Geometry/ForwardCommonData/data/forwardshield/2021/v1/forwardshield.xml', 'Geometry/ForwardCommonData/data/brmrotations.xml', 'Geometry/ForwardCommonData/data/brm/2021/v1/brm.xml', - 'Geometry/ForwardCommonData/data/zdcmaterials.xml', + 'Geometry/ForwardCommonData/data/zdcmaterials/2021/v1/zdcmaterials.xml', 'Geometry/ForwardCommonData/data/lumimaterials.xml', 'Geometry/ForwardCommonData/data/zdcrotations.xml', 'Geometry/ForwardCommonData/data/lumirotations.xml', 'Geometry/ForwardCommonData/data/zdc/2021/v1/zdc.xml', - 'Geometry/ForwardCommonData/data/zdclumi/2021/v1/zdclumi.xml', + 'Geometry/ForwardCommonData/data/zdclumi/2021/v2/zdclumi.xml', 'Geometry/ForwardCommonData/data/cmszdc.xml', - 'Geometry/ForwardCommonData/data/Run2/totemMaterials.xml', - 'Geometry/ForwardCommonData/data/totemRotations.xml', 'Geometry/VeryForwardData/data/RP_Box.xml', - 'Geometry/VeryForwardData/data/RP_Box/RP_Box_000.xml', - 'Geometry/VeryForwardData/data/RP_Box/RP_Box_001.xml', - 'Geometry/VeryForwardData/data/RP_Box/RP_Box_002.xml', - 'Geometry/VeryForwardData/data/RP_Box/RP_Box_003.xml', - 'Geometry/VeryForwardData/data/RP_Box/RP_Box_004.xml', - 'Geometry/VeryForwardData/data/RP_Box/RP_Box_005.xml', - 'Geometry/VeryForwardData/data/RP_Box/RP_Box_020.xml', - 'Geometry/VeryForwardData/data/RP_Box/RP_Box_021.xml', - 'Geometry/VeryForwardData/data/RP_Box/RP_Box_022.xml', - 'Geometry/VeryForwardData/data/RP_Box/RP_Box_023.xml', - 'Geometry/VeryForwardData/data/RP_Box/RP_Box_024.xml', - 'Geometry/VeryForwardData/data/RP_Box/RP_Box_025.xml', - 'Geometry/VeryForwardData/data/RP_Box/RP_Box_100.xml', - 'Geometry/VeryForwardData/data/RP_Box/RP_Box_101.xml', - 'Geometry/VeryForwardData/data/RP_Box/RP_Box_102.xml', - 'Geometry/VeryForwardData/data/RP_Box/RP_Box_103.xml', - 'Geometry/VeryForwardData/data/RP_Box/RP_Box_104.xml', - 'Geometry/VeryForwardData/data/RP_Box/RP_Box_105.xml', - 'Geometry/VeryForwardData/data/RP_Box/RP_Box_120.xml', - 'Geometry/VeryForwardData/data/RP_Box/RP_Box_121.xml', - 'Geometry/VeryForwardData/data/RP_Box/RP_Box_122.xml', - 'Geometry/VeryForwardData/data/RP_Box/RP_Box_123.xml', - 'Geometry/VeryForwardData/data/RP_Box/RP_Box_124.xml', - 'Geometry/VeryForwardData/data/RP_Box/RP_Box_125.xml', - 'Geometry/VeryForwardData/data/RP_Hybrid.xml', - 'Geometry/VeryForwardData/data/RP_Materials.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_000.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_001.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_002.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_003.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_004.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_005.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_020.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_021.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_022.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_023.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_024.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_025.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_100.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_101.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_102.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_103.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_104.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_105.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_120.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_121.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_122.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_123.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_124.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_125.xml', + 'Geometry/VeryForwardData/data/RP_Hybrid/v2/RP_Hybrid.xml', + 'Geometry/VeryForwardData/data/RP_Materials/v4/RP_Materials.xml', 'Geometry/VeryForwardData/data/RP_Transformations.xml', 'Geometry/VeryForwardData/data/RP_Detectors_Assembly.xml', 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_000.xml', @@ -297,7 +300,6 @@ 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_005.xml', 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_020.xml', 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_021.xml', - 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_022.xml', 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_024.xml', 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_025.xml', 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_100.xml', @@ -307,24 +309,22 @@ 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_105.xml', 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_120.xml', 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_121.xml', - 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_122.xml', 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_124.xml', 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_125.xml', - 'Geometry/VeryForwardData/data/RP_Device.xml', - 'Geometry/VeryForwardData/data/RP_Vertical_Device.xml', - 'Geometry/VeryForwardData/data/RP_Horizontal_Device.xml', - 'Geometry/VeryForwardData/data/CTPPS_2018/CTPPS_220_Right_Station.xml', - 'Geometry/VeryForwardData/data/CTPPS_2018/CTPPS_220_Left_Station.xml', - 'Geometry/VeryForwardData/data/CTPPS_2018/CTPPS_210_Right_Station.xml', - 'Geometry/VeryForwardData/data/CTPPS_2018/CTPPS_210_Left_Station.xml', - 'Geometry/VeryForwardData/data/CTPPS_Stations_Assembly.xml', - 'Geometry/VeryForwardData/data/CTPPS_Cuts_Per_Region.xml', + 'Geometry/VeryForwardData/data/RP_Device/v1/RP_Device.xml', + 'Geometry/VeryForwardData/data/RP_Vertical_Device/2021/Simu/v2/RP_Vertical_Device.xml', + 'Geometry/VeryForwardData/data/RP_Horizontal_Device/2021/Simu/v2/RP_Horizontal_Device.xml', + 'Geometry/VeryForwardData/data/CTPPS_2021/Stations/Simu/v3/CTPPS_220_Right_Station.xml', + 'Geometry/VeryForwardData/data/CTPPS_2021/Stations/Simu/v3/CTPPS_220_Left_Station.xml', + 'Geometry/VeryForwardData/data/CTPPS_2021/Stations/Simu/v3/CTPPS_210_Right_Station.xml', + 'Geometry/VeryForwardData/data/CTPPS_2021/Stations/Simu/v3/CTPPS_210_Left_Station.xml', + 'Geometry/VeryForwardData/data/CTPPS_2021/Stations/Simu/v3/CTPPS_Stations_Assembly.xml', + 'Geometry/VeryForwardData/data/CTPPS_2021/Cuts_Per_Region/Simu/v1/CTPPS_Cuts_Per_Region.xml', 'Geometry/VeryForwardData/data/RP_Sensitive_Dets.xml', - 'Geometry/VeryForwardData/data/CTPPS_Diamond_Materials.xml', 'Geometry/VeryForwardData/data/CTPPS_Diamond_Transformations.xml', 'Geometry/VeryForwardData/data/CTPPS_Diamond_Parameters.xml', 'Geometry/VeryForwardData/data/CTPPS_Timing_Station_Parameters.xml', - 'Geometry/VeryForwardData/data/CTPPS_Timing_Horizontal_Pot.xml', + 'Geometry/VeryForwardData/data/CTPPS_Timing_Horizontal_Pot/v2/CTPPS_Timing_Horizontal_Pot.xml', 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern1_Segment1.xml', 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern2_Segment1.xml', 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern2_Segment2.xml', @@ -337,27 +337,28 @@ 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern4_Segment3.xml', 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern4_Segment4.xml', 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern4_Segment5.xml', - 'Geometry/VeryForwardData/data/CTPPS_Diamond_2018/CTPPS_Diamond_Planes/CTPPS_Diamond_Plane1.xml', - 'Geometry/VeryForwardData/data/CTPPS_Diamond_2018/CTPPS_Diamond_Planes/CTPPS_Diamond_Plane2.xml', - 'Geometry/VeryForwardData/data/CTPPS_Diamond_2018/CTPPS_Diamond_Planes/CTPPS_Diamond_Plane3.xml', - 'Geometry/VeryForwardData/data/CTPPS_Diamond_2018/CTPPS_Diamond_Planes/CTPPS_Diamond_Plane4.xml', - 'Geometry/VeryForwardData/data/CTPPS_Diamond_2018/CTPPS_Diamond_Detector_Assembly.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_2021/CTPPS_Diamond_Planes/CTPPS_Diamond_Plane1.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_2021/CTPPS_Diamond_Planes/CTPPS_Diamond_Plane2.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_2021/CTPPS_Diamond_Planes/CTPPS_Diamond_Plane3.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_2021/CTPPS_Diamond_Planes/CTPPS_Diamond_Plane4.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_2021/CTPPS_Diamond_Detector_Assembly/v1/CTPPS_Diamond_Detector_Assembly.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_2021/Simu/v1/CTPPS_Detectors_Assembly_022.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_2021/Simu/v1/CTPPS_Detectors_Assembly_122.xml', 'Geometry/VeryForwardData/data/CTPPS_Diamond_Sensitive_Dets_TimingHits.xml', - 'Geometry/VeryForwardData/data/ppstrackerMaterials/v1/ppstrackerMaterials.xml', - 'Geometry/VeryForwardData/data/CTPPS_Pixel_Module/v1/CTPPS_Pixel_Module.xml', - 'Geometry/VeryForwardData/data/CTPPS_Pixel_Module_2x2/v1/CTPPS_Pixel_Module_2x2.xml', - 'Geometry/VeryForwardData/data/CTPPS_Pixel_2018/CTPPS_Pixel_Assembly_Box_Real_003.xml', - 'Geometry/VeryForwardData/data/CTPPS_Pixel_2018/CTPPS_Pixel_Assembly_Box_Real_023.xml', - 'Geometry/VeryForwardData/data/CTPPS_Pixel_2018/CTPPS_Pixel_Assembly_Box_Real_103.xml', - 'Geometry/VeryForwardData/data/CTPPS_Pixel_2018/CTPPS_Pixel_Assembly_Box_Real_123.xml', - 'Geometry/VeryForwardData/data/CTPPS_Pixel_Sens.xml', - 'Geometry/VeryForwardData/data/CTPPS_2018/RP_Dist_Beam_Cent.xml', + 'Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Modules/v2/ppstrackerMaterials.xml', + 'Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Modules/v2/PPS_Pixel_Module_2x2_Run3.xml', + 'Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Modules/v2/PPS_Pixel_Sens.xml', + 'Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Assembly/v1/CTPPS_Pixel_Assembly_Box_Real_003.xml', + 'Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Assembly/v1/CTPPS_Pixel_Assembly_Box_Real_023.xml', + 'Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Assembly/v1/CTPPS_Pixel_Assembly_Box_Real_103.xml', + 'Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Assembly/v1/CTPPS_Pixel_Assembly_Box_Real_123.xml', + 'Geometry/VeryForwardData/data/CTPPS_2021/RP_Dist_Beam_Cent/Simu/v1/RP_Dist_Beam_Cent.xml', 'Geometry/EcalSimData/data/ecalsens.xml', - 'Geometry/HcalCommonData/data/hcalsenspmf.xml', + 'Geometry/HcalCommonData/data/hcalsens/2021/v1/hcalsenspmf.xml', 'Geometry/HcalSimData/data/hf.xml', 'Geometry/HcalSimData/data/hfpmt.xml', 'Geometry/HcalSimData/data/hffibrebundle.xml', - 'Geometry/HcalSimData/data/CaloUtil.xml', + 'Geometry/HcalSimData/data/CaloUtil/2021/v1/CaloUtil.xml', 'Geometry/MuonSimData/data/v2/muonSens.xml', 'Geometry/DTGeometryBuilder/data/dtSpecsFilter/2021/v1/dtSpecsFilter.xml', 'Geometry/CSCGeometryBuilder/data/cscSpecsFilter.xml', @@ -368,11 +369,11 @@ 'Geometry/ForwardCommonData/data/brmsens.xml', 'Geometry/ForwardSimData/data/totemsensT2/2021/totemsensT2.xml', 'Geometry/ForwardSimData/data/zdcsens.xml', - 'Geometry/HcalSimData/data/HcalProdCuts.xml', + 'Geometry/HcalSimData/data/HcalProdCuts/2021/v2/HcalProdCuts.xml', 'Geometry/EcalSimData/data/EcalProdCuts.xml', 'Geometry/EcalSimData/data/ESProdCuts.xml', 'Geometry/MuonSimData/data/muonProdCuts/2021/v1/muonProdCuts.xml', - 'Geometry/ForwardSimData/data/zdcProdCuts.xml', + 'Geometry/ForwardSimData/data/zdcProdCuts/2021/v2/zdcProdCuts.xml', 'Geometry/ForwardSimData/data/ForwardShieldProdCuts.xml', 'Geometry/CMSCommonData/data/FieldParameters.xml', ), diff --git a/Geometry/TrackerCommonData/python/cmsExtendedGeometry2026D77XML_cfi.py b/Geometry/TrackerCommonData/python/cmsExtendedGeometry2026D77XML_cfi.py new file mode 100644 index 0000000000000..30b00f5004b01 --- /dev/null +++ b/Geometry/TrackerCommonData/python/cmsExtendedGeometry2026D77XML_cfi.py @@ -0,0 +1,127 @@ +import FWCore.ParameterSet.Config as cms + +XMLIdealGeometryESSource = cms.ESSource("XMLIdealGeometryESSource", + geomXMLFiles = cms.vstring( + 'Geometry/CMSCommonData/data/materials/2021/v1/materials.xml', + 'Geometry/CMSCommonData/data/rotations.xml', + 'Geometry/CMSCommonData/data/extend/v2/cmsextent.xml', + 'Geometry/CMSCommonData/data/cavernData/2021/v1/cavernData.xml', + 'Geometry/CMSCommonData/data/cms/2026/v5/cms.xml', + 'Geometry/CMSCommonData/data/cmsMother.xml', + 'Geometry/CMSCommonData/data/eta3/etaMax.xml', + 'Geometry/CMSCommonData/data/cmsTracker.xml', + 'Geometry/CMSCommonData/data/caloBase/2026/v5/caloBase.xml', + 'Geometry/CMSCommonData/data/cmsCalo.xml', + 'Geometry/CMSCommonData/data/muonBase/2026/v5/muonBase.xml', + 'Geometry/CMSCommonData/data/cmsMuon.xml', + 'Geometry/CMSCommonData/data/mgnt.xml', + 'Geometry/CMSCommonData/data/beampipe/2026/v3/beampipe.xml', + 'Geometry/CMSCommonData/data/cmsBeam/2026/v1/cmsBeam.xml', + 'Geometry/CMSCommonData/data/muonMB.xml', + 'Geometry/CMSCommonData/data/muonMagnet.xml', + 'Geometry/CMSCommonData/data/cavern/2021/v1/cavern.xml', + 'Geometry/CMSCommonData/data/cavernFloor/2017/v1/cavernFloor.xml', + 'Geometry/TrackerCommonData/data/PhaseII/trackerParameters.xml', + 'Geometry/TrackerCommonData/data/pixfwdCommon.xml', + 'Geometry/TrackerCommonData/data/PhaseII/Tracker_DD4hep_compatible_2021_02/pixfwd.xml', + 'Geometry/TrackerCommonData/data/PhaseII/OuterTracker616_2020_04/pixbar.xml', + 'Geometry/TrackerCommonData/data/trackermaterial/2026/v1/trackermaterial.xml', + 'Geometry/TrackerCommonData/data/PhaseII/OuterTracker616_2020_04/otst.xml', + 'Geometry/TrackerCommonData/data/PhaseII/Tracker_DD4hep_compatible_2021_02/tracker.xml', + 'Geometry/TrackerCommonData/data/PhaseII/Tracker_DD4hep_compatible_2021_02/pixel.xml', + 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker404/trackerbar.xml', + 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker404/trackerfwd.xml', + 'Geometry/TrackerCommonData/data/PhaseII/Tracker_DD4hep_compatible_2021_02/trackerStructureTopology.xml', + 'Geometry/TrackerCommonData/data/PhaseII/Tracker_DD4hep_compatible_2021_02/pixelStructureTopology.xml', + 'Geometry/TrackerSimData/data/PhaseII/Tracker_DD4hep_compatible_2021_02/trackersens.xml', + 'Geometry/TrackerSimData/data/PhaseII/Tracker_DD4hep_compatible_2021_02/pixelsens.xml', + 'Geometry/TrackerRecoData/data/PhaseII/Tracker_DD4hep_compatible_2021_02/trackerRecoMaterial.xml', + 'SimTracker/TrackerMaterialAnalysis/data/trackingMaterialGroups_ForPhaseII/v1/trackingMaterialGroups_ForPhaseII.xml', + 'Geometry/TrackerSimData/data/PhaseII/Tracker_DD4hep_compatible_2021_02/trackerProdCuts.xml', + 'Geometry/TrackerSimData/data/PhaseII/Tracker_DD4hep_compatible_2021_02/pixelProdCuts.xml', + 'Geometry/TrackerSimData/data/trackerProdCutsBEAM.xml', + 'Geometry/EcalCommonData/data/eregalgo/2026/v2/eregalgo.xml', + 'Geometry/EcalCommonData/data/ectkcable/2026/v1/ectkcable.xml', + 'Geometry/EcalCommonData/data/ectkcablemat/2026/v2/ectkcablemat.xml', + 'Geometry/EcalCommonData/data/ebalgo.xml', + 'Geometry/EcalCommonData/data/ebcon.xml', + 'Geometry/EcalCommonData/data/ebrot.xml', + 'Geometry/HcalCommonData/data/hcalrotations.xml', + 'Geometry/HcalCommonData/data/hcal/v2/hcalalgo.xml', + 'Geometry/HcalCommonData/data/hcalbarrelalgo.xml', + 'Geometry/HcalCommonData/data/hcalcablealgo/v2/hcalcablealgo.xml', + 'Geometry/HcalCommonData/data/hcalouteralgo/v1/hcalouteralgo.xml', + 'Geometry/HcalCommonData/data/hcalforwardalgo.xml', + 'Geometry/HcalCommonData/data/hcalSimNumbering/NoHE/hcalSimNumbering.xml', + 'Geometry/HcalCommonData/data/hcalRecNumbering/NoHE/hcalRecNumbering.xml', + 'Geometry/HcalCommonData/data/average/hcalforwardmaterial.xml', + 'Geometry/HGCalCommonData/data/hgcalMaterial/v1/hgcalMaterial.xml', + 'Geometry/HGCalCommonData/data/hgcal/v14/hgcal.xml', + 'Geometry/HGCalCommonData/data/hgcalcell/v9/hgcalcell.xml', + 'Geometry/HGCalCommonData/data/hgcalwafer/v9/hgcalwafer.xml', + 'Geometry/HGCalCommonData/data/hgcalEE/v14/hgcalEE.xml', + 'Geometry/HGCalCommonData/data/hgcalHEsil/v14/hgcalHEsil.xml', + 'Geometry/HGCalCommonData/data/hgcalHEmix/v14/hgcalHEmix.xml', + 'Geometry/HGCalCommonData/data/hgcalCons/v14/hgcalCons.xml', + 'Geometry/HGCalCommonData/data/hgcalConsData/v13/hgcalConsData.xml', + 'Geometry/MuonCommonData/data/mbCommon/2021/v1/mbCommon.xml', + 'Geometry/MuonCommonData/data/mb1/2015/v2/mb1.xml', + 'Geometry/MuonCommonData/data/mb2/2015/v2/mb2.xml', + 'Geometry/MuonCommonData/data/mb3/2015/v2/mb3.xml', + 'Geometry/MuonCommonData/data/mb4/2015/v2/mb4.xml', + 'Geometry/MuonCommonData/data/mb4Shield/2021/v1/mb4Shield.xml', + 'Geometry/MuonCommonData/data/muonYoke/2026/v1/muonYoke.xml', + 'Geometry/MuonCommonData/data/mf/2026/v7/mf.xml', + 'Geometry/MuonCommonData/data/csc/2021/v2/csc.xml', + 'Geometry/MuonCommonData/data/rpcf/2026/v3/rpcf.xml', + 'Geometry/MuonCommonData/data/gemf/TDR_BaseLine/gemf.xml', + 'Geometry/MuonCommonData/data/gem11/TDR_BaseLine/gem11.xml', + 'Geometry/MuonCommonData/data/gem21/TDR_Eta16/gem21.xml', + 'Geometry/MuonCommonData/data/mfshield/2026/v5/mfshield.xml', + 'Geometry/MuonCommonData/data/ge0/TDR_Dev/v3/ge0.xml', + 'Geometry/ForwardCommonData/data/forwardshield/2026/v4/forwardshield.xml', + 'Geometry/ForwardCommonData/data/brmrotations.xml', + 'Geometry/ForwardCommonData/data/brm/2026/v1/brm.xml', + 'Geometry/ForwardCommonData/data/zdcmaterials.xml', + 'Geometry/ForwardCommonData/data/lumimaterials.xml', + 'Geometry/ForwardCommonData/data/zdcrotations.xml', + 'Geometry/ForwardCommonData/data/lumirotations.xml', + 'Geometry/ForwardCommonData/data/zdc.xml', + 'Geometry/ForwardCommonData/data/zdclumi.xml', + 'Geometry/ForwardCommonData/data/cmszdc.xml', + 'Geometry/MTDCommonData/data/mtdMaterial/v2/mtdMaterial.xml', + 'Geometry/MTDCommonData/data/btl/v1/btl.xml', + 'Geometry/MTDCommonData/data/etl/v5/etl.xml', + 'Geometry/MTDCommonData/data/mtdParameters/v3/mtdStructureTopology.xml', + 'Geometry/MTDCommonData/data/mtdParameters/v2/mtdParameters.xml', + )+ + cms.vstring( + 'Geometry/MuonCommonData/data/muonNumbering/TDR_DeV/v5/muonNumbering.xml', + 'Geometry/EcalSimData/data/PhaseII/ecalsens.xml', + 'Geometry/HcalCommonData/data/hcalsens/NoHE/hcalsenspmf.xml', + 'Geometry/HcalSimData/data/hf.xml', + 'Geometry/HcalSimData/data/hfpmt.xml', + 'Geometry/HcalSimData/data/hffibrebundle.xml', + 'Geometry/HcalSimData/data/CaloUtil/2026/v2c/CaloUtil.xml', + 'Geometry/HGCalSimData/data/hgcsensv9.xml', + 'Geometry/MuonSimData/data/PhaseII/v2/muonSens.xml', + 'Geometry/DTGeometryBuilder/data/dtSpecsFilter.xml', + 'Geometry/CSCGeometryBuilder/data/cscSpecsFilter.xml', + 'Geometry/CSCGeometryBuilder/data/cscSpecs.xml', + 'Geometry/RPCGeometryBuilder/data/2026/v1/RPCSpecs.xml', + 'Geometry/GEMGeometryBuilder/data/v12/GEMSpecsFilter.xml', + 'Geometry/GEMGeometryBuilder/data/v12/GEMSpecs.xml', + 'Geometry/ForwardCommonData/data/brmsens.xml', + 'Geometry/ForwardSimData/data/zdcsens.xml', + 'Geometry/MTDSimData/data/v2/mtdsens.xml', + 'Geometry/HcalSimData/data/HcalProdCuts/2021/v1/HcalProdCuts.xml', + 'Geometry/EcalSimData/data/EcalProdCuts.xml', + 'Geometry/HGCalSimData/data/hgcProdCutsv9.xml', + 'Geometry/MuonSimData/data/PhaseII/muonProdCuts.xml', + 'Geometry/ForwardSimData/data/zdcProdCuts.xml', + 'Geometry/ForwardSimData/data/ForwardShieldProdCuts.xml', + 'Geometry/MTDSimData/data/v2/mtdProdCuts.xml', + 'Geometry/CMSCommonData/data/FieldParameters.xml', + ), + rootNodeName = cms.string('cms:OCMS') +) diff --git a/Geometry/TrackerCommonData/test/python/dd4hepRun3_cfg.py b/Geometry/TrackerCommonData/test/python/dd4hepRun3_cfg.py new file mode 100644 index 0000000000000..676d3c3568a9b --- /dev/null +++ b/Geometry/TrackerCommonData/test/python/dd4hepRun3_cfg.py @@ -0,0 +1,171 @@ +import FWCore.ParameterSet.Config as cms + +from Configuration.Eras.Era_Run3_dd4hep_cff import Run3_dd4hep + +process = cms.Process('SIM',Run3_dd4hep) + +# import of standard configurations +process.load('Configuration.StandardSequences.Services_cff') +process.load('SimGeneral.HepPDTESSource.pythiapdt_cfi') +process.load('FWCore.MessageService.MessageLogger_cfi') +process.load('Configuration.EventContent.EventContent_cff') +process.load('SimGeneral.MixingModule.mixNoPU_cfi') +process.load('Configuration.Geometry.GeometryDD4hepExtended2021Reco_cff') +process.load('Configuration.StandardSequences.MagneticField_cff') +process.load('Configuration.StandardSequences.Generator_cff') +process.load('IOMC.EventVertexGenerators.VtxSmearedHLLHC14TeV_cfi') +process.load('GeneratorInterface.Core.genFilterSummary_cff') +process.load('Configuration.StandardSequences.SimIdeal_cff') +process.load('Configuration.StandardSequences.EndOfProcess_cff') +process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') + +process.maxEvents = cms.untracked.PSet( + input = cms.untracked.int32(10), + output = cms.optional.untracked.allowed(cms.int32,cms.PSet) +) + +if 'MessageLogger' in process.__dict__: + process.MessageLogger.TrackerGeom=dict() + process.MessageLogger.PixelGeom=dict() + process.MessageLogger.TIBGeom=dict() + process.MessageLogger.TIDGeom=dict() + process.MessageLogger.TOBGeom=dict() + process.MessageLogger.TECGeom=dict() + +# Input source +process.source = cms.Source("EmptySource") + +process.options = cms.untracked.PSet( + FailPath = cms.untracked.vstring(), + IgnoreCompletely = cms.untracked.vstring(), + Rethrow = cms.untracked.vstring(), + SkipEvent = cms.untracked.vstring(), + allowUnscheduled = cms.obsolete.untracked.bool, + canDeleteEarly = cms.untracked.vstring(), + emptyRunLumiMode = cms.obsolete.untracked.string, + eventSetup = cms.untracked.PSet( + forceNumberOfConcurrentIOVs = cms.untracked.PSet( + + ), + numberOfConcurrentIOVs = cms.untracked.uint32(1) + ), + fileMode = cms.untracked.string('FULLMERGE'), + forceEventSetupCacheClearOnNewRun = cms.untracked.bool(False), + makeTriggerResults = cms.obsolete.untracked.bool, + numberOfConcurrentLuminosityBlocks = cms.untracked.uint32(1), + numberOfConcurrentRuns = cms.untracked.uint32(1), + numberOfStreams = cms.untracked.uint32(0), + numberOfThreads = cms.untracked.uint32(1), + printDependencies = cms.untracked.bool(False), + sizeOfStackForThreadsInKB = cms.optional.untracked.uint32, + throwIfIllegalParameter = cms.untracked.bool(True), + wantSummary = cms.untracked.bool(False) +) + +# Production Info +process.configurationMetadata = cms.untracked.PSet( + annotation = cms.untracked.string('TTbar_14TeV_TuneCP5_cfi nevts:10'), + name = cms.untracked.string('Applications'), + version = cms.untracked.string('$Revision: 1.19 $') +) + +# Output definition + +process.FEVTDEBUGoutput = cms.OutputModule("PoolOutputModule", + SelectEvents = cms.untracked.PSet( + SelectEvents = cms.vstring('generation_step') + ), + dataset = cms.untracked.PSet( + dataTier = cms.untracked.string('GEN-SIM'), + filterName = cms.untracked.string('') + ), + fileName = cms.untracked.string('file:step1.root'), + outputCommands = process.FEVTDEBUGEventContent.outputCommands, + splitLevel = cms.untracked.int32(0) +) + +# Additional output definition + +# Other statements +process.genstepfilter.triggerConditions=cms.vstring("generation_step") +from Configuration.AlCa.GlobalTag import GlobalTag +process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase1_2021_realistic', '') + +process.generator = cms.EDFilter("Pythia8GeneratorFilter", + PythiaParameters = cms.PSet( + parameterSets = cms.vstring( + 'pythia8CommonSettings', + 'pythia8CP5Settings', + 'processParameters' + ), + processParameters = cms.vstring( + 'Top:gg2ttbar = on ', + 'Top:qqbar2ttbar = on ', + '6:m0 = 175 ' + ), + pythia8CP5Settings = cms.vstring( + 'Tune:pp 14', + 'Tune:ee 7', + 'MultipartonInteractions:ecmPow=0.03344', + 'MultipartonInteractions:bProfile=2', + 'MultipartonInteractions:pT0Ref=1.41', + 'MultipartonInteractions:coreRadius=0.7634', + 'MultipartonInteractions:coreFraction=0.63', + 'ColourReconnection:range=5.176', + 'SigmaTotal:zeroAXB=off', + 'SpaceShower:alphaSorder=2', + 'SpaceShower:alphaSvalue=0.118', + 'SigmaProcess:alphaSvalue=0.118', + 'SigmaProcess:alphaSorder=2', + 'MultipartonInteractions:alphaSvalue=0.118', + 'MultipartonInteractions:alphaSorder=2', + 'TimeShower:alphaSorder=2', + 'TimeShower:alphaSvalue=0.118', + 'SigmaTotal:mode = 0', + 'SigmaTotal:sigmaEl = 21.89', + 'SigmaTotal:sigmaTot = 100.309', + 'PDF:pSet=LHAPDF6:NNPDF31_nnlo_as_0118' + ), + pythia8CommonSettings = cms.vstring( + 'Tune:preferLHAPDF = 2', + 'Main:timesAllowErrors = 10000', + 'Check:epTolErr = 0.01', + 'Beams:setProductionScalesFromLHEF = off', + 'SLHA:minMassSM = 1000.', + 'ParticleDecays:limitTau0 = on', + 'ParticleDecays:tau0Max = 10', + 'ParticleDecays:allowPhotonRadiation = on' + ) + ), + comEnergy = cms.double(14000.0), + filterEfficiency = cms.untracked.double(1.0), + maxEventsToPrint = cms.untracked.int32(0), + pythiaHepMCVerbosity = cms.untracked.bool(False), + pythiaPylistVerbosity = cms.untracked.int32(0) +) + + +process.ProductionFilterSequence = cms.Sequence(process.generator) + +# Path and EndPath definitions +process.generation_step = cms.Path(process.pgen) +process.simulation_step = cms.Path(process.psim) +process.genfiltersummary_step = cms.EndPath(process.genFilterSummary) +process.endjob_step = cms.EndPath(process.endOfProcess) +process.FEVTDEBUGoutput_step = cms.EndPath(process.FEVTDEBUGoutput) + +# Schedule definition +process.schedule = cms.Schedule(process.generation_step,process.genfiltersummary_step,process.simulation_step,process.endjob_step,process.FEVTDEBUGoutput_step) +from PhysicsTools.PatAlgos.tools.helpers import associatePatAlgosToolsTask +associatePatAlgosToolsTask(process) +# filter all path with the production filter sequence +for path in process.paths: + getattr(process,path).insert(0, process.ProductionFilterSequence) + + +# Customisation from command line + +# Add early deletion of temporary data products to reduce peak memory need +from Configuration.StandardSequences.earlyDeleteSettings_cff import customiseEarlyDelete +process = customiseEarlyDelete(process) +# End adding early deletion diff --git a/Geometry/TrackerCommonData/test/python/run21Zero.py b/Geometry/TrackerCommonData/test/python/run21Zero.py index a710db18a258a..bd68808a10fdb 100644 --- a/Geometry/TrackerCommonData/test/python/run21Zero.py +++ b/Geometry/TrackerCommonData/test/python/run21Zero.py @@ -14,6 +14,7 @@ process.load('Geometry.TrackerNumberingBuilder.trackerNumberingGeometry_cfi') process.load('Geometry.EcalCommonData.ecalSimulationParameters_cff') process.load('Geometry.HcalCommonData.hcalDDDSimConstants_cff') +process.load('Geometry.HcalCommonData.hcalDDDRecConstants_cfi') process.load('Geometry.MuonNumbering.muonGeometryConstants_cff') process.load('Configuration.StandardSequences.MagneticField_cff') process.load('Configuration.StandardSequences.Generator_cff') @@ -90,59 +91,7 @@ from Configuration.AlCa.GlobalTag import GlobalTag process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase1_2021_realistic', '') -process.generator = cms.EDFilter("Pythia8GeneratorFilter", - PythiaParameters = cms.PSet( - parameterSets = cms.vstring( - 'pythia8CommonSettings', - 'pythia8CP5Settings', - 'processParameters' - ), - processParameters = cms.vstring( - 'Top:gg2ttbar = on ', - 'Top:qqbar2ttbar = on ', - '6:m0 = 175 ' - ), - pythia8CP5Settings = cms.vstring( - 'Tune:pp 14', - 'Tune:ee 7', - 'MultipartonInteractions:ecmPow=0.03344', - 'MultipartonInteractions:bProfile=2', - 'MultipartonInteractions:pT0Ref=1.41', - 'MultipartonInteractions:coreRadius=0.7634', - 'MultipartonInteractions:coreFraction=0.63', - 'ColourReconnection:range=5.176', - 'SigmaTotal:zeroAXB=off', - 'SpaceShower:alphaSorder=2', - 'SpaceShower:alphaSvalue=0.118', - 'SigmaProcess:alphaSvalue=0.118', - 'SigmaProcess:alphaSorder=2', - 'MultipartonInteractions:alphaSvalue=0.118', - 'MultipartonInteractions:alphaSorder=2', - 'TimeShower:alphaSorder=2', - 'TimeShower:alphaSvalue=0.118', - 'SigmaTotal:mode = 0', - 'SigmaTotal:sigmaEl = 21.89', - 'SigmaTotal:sigmaTot = 100.309', - 'PDF:pSet=LHAPDF6:NNPDF31_nnlo_as_0118' - ), - pythia8CommonSettings = cms.vstring( - 'Tune:preferLHAPDF = 2', - 'Main:timesAllowErrors = 10000', - 'Check:epTolErr = 0.01', - 'Beams:setProductionScalesFromLHEF = off', - 'SLHA:minMassSM = 1000.', - 'ParticleDecays:limitTau0 = on', - 'ParticleDecays:tau0Max = 10', - 'ParticleDecays:allowPhotonRadiation = on' - ) - ), - comEnergy = cms.double(14000.0), - filterEfficiency = cms.untracked.double(1.0), - maxEventsToPrint = cms.untracked.int32(0), - pythiaHepMCVerbosity = cms.untracked.bool(False), - pythiaPylistVerbosity = cms.untracked.int32(0) -) - +process.load('Configuration.Generator.TTbar_14TeV_TuneCP5_cfi') process.ProductionFilterSequence = cms.Sequence(process.generator) # Path and EndPath definitions diff --git a/Geometry/TrackerCommonData/test/python/run21flat.py b/Geometry/TrackerCommonData/test/python/run21flat.py new file mode 100644 index 0000000000000..b8ee620d1d858 --- /dev/null +++ b/Geometry/TrackerCommonData/test/python/run21flat.py @@ -0,0 +1,142 @@ +import FWCore.ParameterSet.Config as cms +import FWCore.ParameterSet.VarParsing as VarParsing +import os, sys, imp, re + +from Configuration.Eras.Era_Run3_cff import Run3 +process = cms.Process('SIM',Run3) + +############################################################ +### SETUP OPTIONS +options = VarParsing.VarParsing('standard') +options.register('geometry', + "Minus05", + VarParsing.VarParsing.multiplicity.singleton, + VarParsing.VarParsing.varType.string, + "geometry of operations: Minus05, Minus10, Plus05, Plus10") +### get and parse the command line arguments +options.parseArguments() + +print(options) +############################################################ +# Use the options +if (options.geometry == "Plus05"): + process.load('Geometry.TrackerCommonData.cmsExtendedGeometry2021FlatPlus05PercentXML_cfi') +elif (options.geometry == "Plus10"): + process.load('Geometry.TrackerCommonData.cmsExtendedGeometry2021FlatPlus10PercentXML_cfi') +elif (options.geometry == "Minus10"): + process.load('Geometry.TrackerCommonData.cmsExtendedGeometry2021FlatMinus10PercentXML_cfi') +else: + process.load('Geometry.TrackerCommonData.cmsExtendedGeometry2021FlatMinus05PercentXML_cfi') + +# import of standard configurations +process.load('Configuration.StandardSequences.Services_cff') +process.load('SimGeneral.HepPDTESSource.pythiapdt_cfi') +process.load('FWCore.MessageService.MessageLogger_cfi') +process.load('Configuration.EventContent.EventContent_cff') +process.load('SimGeneral.MixingModule.mixNoPU_cfi') +process.load('Geometry.TrackerNumberingBuilder.trackerNumberingGeometry_cfi') +process.load('Geometry.EcalCommonData.ecalSimulationParameters_cff') +process.load('Geometry.HcalCommonData.hcalDDDSimConstants_cff') +process.load('Geometry.HcalCommonData.hcalDDDRecConstants_cfi') +process.load('Geometry.MuonNumbering.muonGeometryConstants_cff') +process.load('Configuration.StandardSequences.MagneticField_cff') +process.load('Configuration.StandardSequences.Generator_cff') +process.load('IOMC.EventVertexGenerators.VtxSmearedRun3RoundOptics25ns13TeVLowSigmaZ_cfi') +process.load('GeneratorInterface.Core.genFilterSummary_cff') +process.load('Configuration.StandardSequences.SimIdeal_cff') +process.load('Configuration.StandardSequences.EndOfProcess_cff') +process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') + +process.maxEvents = cms.untracked.PSet( + input = cms.untracked.int32(10), + output = cms.optional.untracked.allowed(cms.int32,cms.PSet) +) + +#if hasattr(process,'MessageLogger'): +# process.MessageLogger.SimG4CoreGeometry=dict() + +# Input source +process.source = cms.Source("EmptySource") + +process.options = cms.untracked.PSet( + FailPath = cms.untracked.vstring(), + IgnoreCompletely = cms.untracked.vstring(), + Rethrow = cms.untracked.vstring(), + SkipEvent = cms.untracked.vstring(), + allowUnscheduled = cms.obsolete.untracked.bool, + canDeleteEarly = cms.untracked.vstring(), + emptyRunLumiMode = cms.obsolete.untracked.string, + eventSetup = cms.untracked.PSet( + forceNumberOfConcurrentIOVs = cms.untracked.PSet( + + ), + numberOfConcurrentIOVs = cms.untracked.uint32(1) + ), + fileMode = cms.untracked.string('FULLMERGE'), + forceEventSetupCacheClearOnNewRun = cms.untracked.bool(False), + makeTriggerResults = cms.obsolete.untracked.bool, + numberOfConcurrentLuminosityBlocks = cms.untracked.uint32(1), + numberOfConcurrentRuns = cms.untracked.uint32(1), + numberOfStreams = cms.untracked.uint32(0), + numberOfThreads = cms.untracked.uint32(1), + printDependencies = cms.untracked.bool(False), + sizeOfStackForThreadsInKB = cms.optional.untracked.uint32, + throwIfIllegalParameter = cms.untracked.bool(True), + wantSummary = cms.untracked.bool(False) +) + +# Production Info +process.configurationMetadata = cms.untracked.PSet( + annotation = cms.untracked.string('TTbar_14TeV_TuneCP5_cfi nevts:10'), + name = cms.untracked.string('Applications'), + version = cms.untracked.string('$Revision: 1.19 $') +) + +# Output definition + +process.FEVTDEBUGoutput = cms.OutputModule("PoolOutputModule", + SelectEvents = cms.untracked.PSet( + SelectEvents = cms.vstring('generation_step') + ), + dataset = cms.untracked.PSet( + dataTier = cms.untracked.string('GEN-SIM'), + filterName = cms.untracked.string('') + ), + fileName = cms.untracked.string('file:ttbar21.root'), + outputCommands = process.FEVTDEBUGEventContent.outputCommands, + splitLevel = cms.untracked.int32(0) +) + +# Additional output definition + +# Other statements +process.genstepfilter.triggerConditions=cms.vstring("generation_step") +from Configuration.AlCa.GlobalTag import GlobalTag +process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase1_2021_realistic', '') + +process.load('Configuration.Generator.TTbar_14TeV_TuneCP5_cfi') +process.ProductionFilterSequence = cms.Sequence(process.generator) + +# Path and EndPath definitions +process.generation_step = cms.Path(process.pgen) +process.simulation_step = cms.Path(process.psim) +process.genfiltersummary_step = cms.EndPath(process.genFilterSummary) +process.endjob_step = cms.EndPath(process.endOfProcess) +process.FEVTDEBUGoutput_step = cms.EndPath(process.FEVTDEBUGoutput) + +# Schedule definition +process.schedule = cms.Schedule(process.generation_step,process.genfiltersummary_step,process.simulation_step,process.endjob_step,process.FEVTDEBUGoutput_step) +from PhysicsTools.PatAlgos.tools.helpers import associatePatAlgosToolsTask +associatePatAlgosToolsTask(process) +# filter all path with the production filter sequence +for path in process.paths: + getattr(process,path).insert(0, process.ProductionFilterSequence) + + + +# Customisation from command line + +# Add early deletion of temporary data products to reduce peak memory need +from Configuration.StandardSequences.earlyDeleteSettings_cff import customiseEarlyDelete +process = customiseEarlyDelete(process) +# End adding early deletion diff --git a/Geometry/TrackerGeometryBuilder/interface/phase1PixelTopology.h b/Geometry/TrackerGeometryBuilder/interface/phase1PixelTopology.h index c2b5bc9d95f83..4e70cd86e1524 100644 --- a/Geometry/TrackerGeometryBuilder/interface/phase1PixelTopology.h +++ b/Geometry/TrackerGeometryBuilder/interface/phase1PixelTopology.h @@ -19,6 +19,10 @@ namespace phase1PixelTopology { constexpr int16_t xOffset = -81; constexpr int16_t yOffset = -54 * 4; + constexpr uint16_t pixelThickness = 285; + constexpr uint16_t pixelPitchX = 100; + constexpr uint16_t pixelPitchY = 150; + constexpr uint32_t numPixsInModule = uint32_t(numRowsInModule) * uint32_t(numColsInModule); constexpr uint32_t numberOfModules = 1856; diff --git a/Geometry/TrackerGeometryBuilder/test/python/testTrackerHierarchy_cfg.py b/Geometry/TrackerGeometryBuilder/test/python/testTrackerHierarchy_cfg.py index 177eec759fc3a..a10920d3b0946 100644 --- a/Geometry/TrackerGeometryBuilder/test/python/testTrackerHierarchy_cfg.py +++ b/Geometry/TrackerGeometryBuilder/test/python/testTrackerHierarchy_cfg.py @@ -15,6 +15,9 @@ fromDDD = cms.bool(True) ) +process.load("Alignment.CommonAlignmentProducer.FakeAlignmentSource_cfi") +process.preferFakeAlign = cms.ESPrefer("FakeAlignmentSource") + process.p1 = cms.Path(process.prod) diff --git a/Geometry/TrackerGeometryBuilder/test/python/testTrackerModuleInfoDDD_cfg.py b/Geometry/TrackerGeometryBuilder/test/python/testTrackerModuleInfoDDD_cfg.py index 343f1f18b639a..27fc74a1bc1e2 100644 --- a/Geometry/TrackerGeometryBuilder/test/python/testTrackerModuleInfoDDD_cfg.py +++ b/Geometry/TrackerGeometryBuilder/test/python/testTrackerModuleInfoDDD_cfg.py @@ -16,6 +16,8 @@ process.es_prefer_geomdet = cms.ESPrefer("TrackerGeometricDetESModule","") +process.load("Geometry.TrackerGeometryBuilder.TrackerAdditionalParametersPerDet_cfi") + process.load("Alignment.CommonAlignmentProducer.FakeAlignmentSource_cfi") process.preferFakeAlign = cms.ESPrefer("FakeAlignmentSource") diff --git a/Geometry/TrackerGeometryBuilder/test/python/testTracker_cfg.py b/Geometry/TrackerGeometryBuilder/test/python/testTracker_cfg.py index 438d450d03449..95ce466cfb13a 100644 --- a/Geometry/TrackerGeometryBuilder/test/python/testTracker_cfg.py +++ b/Geometry/TrackerGeometryBuilder/test/python/testTracker_cfg.py @@ -5,6 +5,9 @@ process.source = cms.Source("EmptySource") +process.load("Alignment.CommonAlignmentProducer.FakeAlignmentSource_cfi") +process.preferFakeAlign = cms.ESPrefer("FakeAlignmentSource") + process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(1) ) diff --git a/Geometry/VeryForwardData/data/CTPPS_2021/Stations/Simu/v3/CTPPS_210_Left_Station.xml b/Geometry/VeryForwardData/data/CTPPS_2021/Stations/Simu/v3/CTPPS_210_Left_Station.xml new file mode 100644 index 0000000000000..a0d910ecf39a1 --- /dev/null +++ b/Geometry/VeryForwardData/data/CTPPS_2021/Stations/Simu/v3/CTPPS_210_Left_Station.xml @@ -0,0 +1,235 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Geometry/VeryForwardData/data/CTPPS_2021/Stations/Simu/v3/CTPPS_210_Right_Station.xml b/Geometry/VeryForwardData/data/CTPPS_2021/Stations/Simu/v3/CTPPS_210_Right_Station.xml new file mode 100644 index 0000000000000..80adbd70bbfbb --- /dev/null +++ b/Geometry/VeryForwardData/data/CTPPS_2021/Stations/Simu/v3/CTPPS_210_Right_Station.xml @@ -0,0 +1,236 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Geometry/VeryForwardData/data/CTPPS_2021/Stations/Simu/v3/CTPPS_220_Left_Station.xml b/Geometry/VeryForwardData/data/CTPPS_2021/Stations/Simu/v3/CTPPS_220_Left_Station.xml new file mode 100644 index 0000000000000..a0bf4a7c1cdc0 --- /dev/null +++ b/Geometry/VeryForwardData/data/CTPPS_2021/Stations/Simu/v3/CTPPS_220_Left_Station.xml @@ -0,0 +1,212 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Geometry/VeryForwardData/data/CTPPS_2021/Stations/Simu/v3/CTPPS_220_Right_Station.xml b/Geometry/VeryForwardData/data/CTPPS_2021/Stations/Simu/v3/CTPPS_220_Right_Station.xml new file mode 100644 index 0000000000000..e992c23e05597 --- /dev/null +++ b/Geometry/VeryForwardData/data/CTPPS_2021/Stations/Simu/v3/CTPPS_220_Right_Station.xml @@ -0,0 +1,213 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Geometry/VeryForwardData/data/CTPPS_2021/Stations/Simu/v3/CTPPS_Stations_Assembly.xml b/Geometry/VeryForwardData/data/CTPPS_2021/Stations/Simu/v3/CTPPS_Stations_Assembly.xml new file mode 100644 index 0000000000000..34207037b52e8 --- /dev/null +++ b/Geometry/VeryForwardData/data/CTPPS_2021/Stations/Simu/v3/CTPPS_Stations_Assembly.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Geometry/VeryForwardData/data/CTPPS_Diamond_2021/CTPPS_Diamond_Detector_Assembly/v1/CTPPS_Diamond_Detector_Assembly.xml b/Geometry/VeryForwardData/data/CTPPS_Diamond_2021/CTPPS_Diamond_Detector_Assembly/v1/CTPPS_Diamond_Detector_Assembly.xml new file mode 100644 index 0000000000000..57c1e8cc2ce62 --- /dev/null +++ b/Geometry/VeryForwardData/data/CTPPS_Diamond_2021/CTPPS_Diamond_Detector_Assembly/v1/CTPPS_Diamond_Detector_Assembly.xml @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Assembly/v2/CTPPS_Pixel_Assembly_Box_Real_003.xml b/Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Assembly/v2/CTPPS_Pixel_Assembly_Box_Real_003.xml new file mode 100644 index 0000000000000..3b7b5b744a527 --- /dev/null +++ b/Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Assembly/v2/CTPPS_Pixel_Assembly_Box_Real_003.xml @@ -0,0 +1,104 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Assembly/v2/CTPPS_Pixel_Assembly_Box_Real_023.xml b/Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Assembly/v2/CTPPS_Pixel_Assembly_Box_Real_023.xml new file mode 100644 index 0000000000000..378d4155c893e --- /dev/null +++ b/Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Assembly/v2/CTPPS_Pixel_Assembly_Box_Real_023.xml @@ -0,0 +1,104 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Assembly/v2/CTPPS_Pixel_Assembly_Box_Real_103.xml b/Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Assembly/v2/CTPPS_Pixel_Assembly_Box_Real_103.xml new file mode 100644 index 0000000000000..aa2bec0580c4e --- /dev/null +++ b/Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Assembly/v2/CTPPS_Pixel_Assembly_Box_Real_103.xml @@ -0,0 +1,104 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Assembly/v2/CTPPS_Pixel_Assembly_Box_Real_123.xml b/Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Assembly/v2/CTPPS_Pixel_Assembly_Box_Real_123.xml new file mode 100644 index 0000000000000..081ad41552b3d --- /dev/null +++ b/Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Assembly/v2/CTPPS_Pixel_Assembly_Box_Real_123.xml @@ -0,0 +1,104 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Modules/v1/ppstrackerMaterials.xml b/Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Modules/v1/ppstrackerMaterials.xml index 9ee4b14612bf3..be5ac14bcf300 100644 --- a/Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Modules/v1/ppstrackerMaterials.xml +++ b/Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Modules/v1/ppstrackerMaterials.xml @@ -29,42 +29,12 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -113,6 +83,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Modules/v2/PPS_Pixel_Module_2x2_Run3.xml b/Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Modules/v2/PPS_Pixel_Module_2x2_Run3.xml new file mode 100644 index 0000000000000..72c145d61279d --- /dev/null +++ b/Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Modules/v2/PPS_Pixel_Module_2x2_Run3.xml @@ -0,0 +1,230 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Modules/v2/PPS_Pixel_Sens.xml b/Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Modules/v2/PPS_Pixel_Sens.xml new file mode 100644 index 0000000000000..1a436505ecbf5 --- /dev/null +++ b/Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Modules/v2/PPS_Pixel_Sens.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Modules/v2/ppstrackerMaterials.xml b/Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Modules/v2/ppstrackerMaterials.xml new file mode 100644 index 0000000000000..0c9dd4040863e --- /dev/null +++ b/Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Modules/v2/ppstrackerMaterials.xml @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Modules/v3/PPS_Pixel_Module_2x2_Run3.xml b/Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Modules/v3/PPS_Pixel_Module_2x2_Run3.xml new file mode 100644 index 0000000000000..03e56824cec6e --- /dev/null +++ b/Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Modules/v3/PPS_Pixel_Module_2x2_Run3.xml @@ -0,0 +1,248 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Geometry/VeryForwardData/data/CTPPS_Timing_Horizontal_Pot/v2/CTPPS_Timing_Horizontal_Pot.xml b/Geometry/VeryForwardData/data/CTPPS_Timing_Horizontal_Pot/v2/CTPPS_Timing_Horizontal_Pot.xml new file mode 100644 index 0000000000000..24197a4fb693d --- /dev/null +++ b/Geometry/VeryForwardData/data/CTPPS_Timing_Horizontal_Pot/v2/CTPPS_Timing_Horizontal_Pot.xml @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_000.xml b/Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_000.xml new file mode 100644 index 0000000000000..5bcd35e2b16de --- /dev/null +++ b/Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_000.xml @@ -0,0 +1,163 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_001.xml b/Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_001.xml new file mode 100644 index 0000000000000..922f9546f7a46 --- /dev/null +++ b/Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_001.xml @@ -0,0 +1,163 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_002.xml b/Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_002.xml new file mode 100644 index 0000000000000..5b0d05b9b9b14 --- /dev/null +++ b/Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_002.xml @@ -0,0 +1,163 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_003.xml b/Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_003.xml new file mode 100644 index 0000000000000..528bb7df417e3 --- /dev/null +++ b/Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_003.xml @@ -0,0 +1,163 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_004.xml b/Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_004.xml new file mode 100644 index 0000000000000..8708f0eb22e6d --- /dev/null +++ b/Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_004.xml @@ -0,0 +1,163 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_005.xml b/Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_005.xml new file mode 100644 index 0000000000000..638a91e558093 --- /dev/null +++ b/Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_005.xml @@ -0,0 +1,163 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_020.xml b/Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_020.xml new file mode 100644 index 0000000000000..c26c071ac5ac6 --- /dev/null +++ b/Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_020.xml @@ -0,0 +1,163 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_021.xml b/Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_021.xml new file mode 100644 index 0000000000000..1f486ccff623c --- /dev/null +++ b/Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_021.xml @@ -0,0 +1,163 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_022.xml b/Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_022.xml new file mode 100644 index 0000000000000..e973fb3ef6278 --- /dev/null +++ b/Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_022.xml @@ -0,0 +1,163 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_023.xml b/Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_023.xml new file mode 100644 index 0000000000000..53ceeca6ad6ab --- /dev/null +++ b/Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_023.xml @@ -0,0 +1,163 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_024.xml b/Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_024.xml new file mode 100644 index 0000000000000..8324260559a2f --- /dev/null +++ b/Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_024.xml @@ -0,0 +1,163 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_025.xml b/Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_025.xml new file mode 100644 index 0000000000000..2dabbe3c312a6 --- /dev/null +++ b/Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_025.xml @@ -0,0 +1,163 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_100.xml b/Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_100.xml new file mode 100644 index 0000000000000..f2ec002a15db8 --- /dev/null +++ b/Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_100.xml @@ -0,0 +1,163 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_101.xml b/Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_101.xml new file mode 100644 index 0000000000000..b64dbb963cf55 --- /dev/null +++ b/Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_101.xml @@ -0,0 +1,163 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_102.xml b/Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_102.xml new file mode 100644 index 0000000000000..171a07adf6abe --- /dev/null +++ b/Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_102.xml @@ -0,0 +1,163 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_103.xml b/Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_103.xml new file mode 100644 index 0000000000000..16a38c07d5e98 --- /dev/null +++ b/Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_103.xml @@ -0,0 +1,163 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_104.xml b/Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_104.xml new file mode 100644 index 0000000000000..aa75a3daa5eb7 --- /dev/null +++ b/Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_104.xml @@ -0,0 +1,163 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_105.xml b/Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_105.xml new file mode 100644 index 0000000000000..4d63d087fca13 --- /dev/null +++ b/Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_105.xml @@ -0,0 +1,163 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_120.xml b/Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_120.xml new file mode 100644 index 0000000000000..dd52721773222 --- /dev/null +++ b/Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_120.xml @@ -0,0 +1,163 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_121.xml b/Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_121.xml new file mode 100644 index 0000000000000..ee927f28d403e --- /dev/null +++ b/Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_121.xml @@ -0,0 +1,163 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_122.xml b/Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_122.xml new file mode 100644 index 0000000000000..946efff9a7c90 --- /dev/null +++ b/Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_122.xml @@ -0,0 +1,163 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_123.xml b/Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_123.xml new file mode 100644 index 0000000000000..b95c047735bca --- /dev/null +++ b/Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_123.xml @@ -0,0 +1,163 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_124.xml b/Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_124.xml new file mode 100644 index 0000000000000..28dee2d17d58f --- /dev/null +++ b/Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_124.xml @@ -0,0 +1,163 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_125.xml b/Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_125.xml new file mode 100644 index 0000000000000..e0c1467056557 --- /dev/null +++ b/Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_125.xml @@ -0,0 +1,163 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Geometry/VeryForwardData/data/RP_Device/v1/RP_Device.xml b/Geometry/VeryForwardData/data/RP_Device/v1/RP_Device.xml new file mode 100644 index 0000000000000..651ef664d212e --- /dev/null +++ b/Geometry/VeryForwardData/data/RP_Device/v1/RP_Device.xml @@ -0,0 +1,42 @@ + + + + + + + + + + + + + diff --git a/Geometry/VeryForwardData/data/RP_Horizontal_Device/2021/Simu/v2/RP_Horizontal_Device.xml b/Geometry/VeryForwardData/data/RP_Horizontal_Device/2021/Simu/v2/RP_Horizontal_Device.xml new file mode 100644 index 0000000000000..ce5bed66a2c05 --- /dev/null +++ b/Geometry/VeryForwardData/data/RP_Horizontal_Device/2021/Simu/v2/RP_Horizontal_Device.xml @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Geometry/VeryForwardData/data/RP_Hybrid/v2/RP_Hybrid.xml b/Geometry/VeryForwardData/data/RP_Hybrid/v2/RP_Hybrid.xml new file mode 100644 index 0000000000000..883acca8cabe7 --- /dev/null +++ b/Geometry/VeryForwardData/data/RP_Hybrid/v2/RP_Hybrid.xml @@ -0,0 +1,240 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Geometry/VeryForwardData/data/RP_Materials/v4/RP_Materials.xml b/Geometry/VeryForwardData/data/RP_Materials/v4/RP_Materials.xml new file mode 100644 index 0000000000000..cd1b82ce82e55 --- /dev/null +++ b/Geometry/VeryForwardData/data/RP_Materials/v4/RP_Materials.xml @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Geometry/VeryForwardData/data/RP_Vertical_Device/2021/Simu/v2/RP_Vertical_Device.xml b/Geometry/VeryForwardData/data/RP_Vertical_Device/2021/Simu/v2/RP_Vertical_Device.xml new file mode 100644 index 0000000000000..34b2af92ff314 --- /dev/null +++ b/Geometry/VeryForwardData/data/RP_Vertical_Device/2021/Simu/v2/RP_Vertical_Device.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Geometry/VeryForwardData/data/dd4hep/cmsExtendedGeometry2021.xml b/Geometry/VeryForwardData/data/dd4hep/cmsExtendedGeometry2021.xml new file mode 100644 index 0000000000000..e4ac6d75f7536 --- /dev/null +++ b/Geometry/VeryForwardData/data/dd4hep/cmsExtendedGeometry2021.xml @@ -0,0 +1,377 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Geometry/VeryForwardData/python/cmsExtendedGeometry2021XML_cfi.py b/Geometry/VeryForwardData/python/cmsExtendedGeometry2021XML_cfi.py new file mode 100644 index 0000000000000..deab27a6f6941 --- /dev/null +++ b/Geometry/VeryForwardData/python/cmsExtendedGeometry2021XML_cfi.py @@ -0,0 +1,381 @@ +import FWCore.ParameterSet.Config as cms + +# This config was generated automatically using generate2021Geometry.py +# If you notice a mistake, please update the generating script, not just this config + +XMLIdealGeometryESSource = cms.ESSource("XMLIdealGeometryESSource", + geomXMLFiles = cms.vstring( + 'Geometry/CMSCommonData/data/materials/2021/v3/materials.xml', + 'Geometry/TrackerCommonData/data/trackermaterial/2021/v1/trackermaterial.xml', + 'Geometry/CMSCommonData/data/rotations.xml', + 'Geometry/CMSCommonData/data/extend/v3/cmsextent.xml', + 'Geometry/CMSCommonData/data/cavernData/2021/v1/cavernData.xml', + 'Geometry/CMSCommonData/data/cms/2021/v3/cms.xml', + 'Geometry/CMSCommonData/data/cmsMother.xml', + 'Geometry/CMSCommonData/data/eta3/etaMax.xml', + 'Geometry/CMSCommonData/data/cmsTracker.xml', + 'Geometry/CMSCommonData/data/caloBase/2017/v1/caloBase.xml', + 'Geometry/CMSCommonData/data/cmsCalo.xml', + 'Geometry/CMSCommonData/data/muonBase/2018/v1/muonBase.xml', + 'Geometry/CMSCommonData/data/cmsMuon.xml', + 'Geometry/CMSCommonData/data/mgnt.xml', + 'Geometry/CMSCommonData/data/beampipe/2021/v1/beampipe.xml', + 'Geometry/CMSCommonData/data/cmsBeam/2021/v1/cmsBeam.xml', + 'Geometry/CMSCommonData/data/muonMB.xml', + 'Geometry/CMSCommonData/data/muonMagnet.xml', + 'Geometry/CMSCommonData/data/cavern/2021/v1/cavern.xml', + 'Geometry/CMSCommonData/data/cavernFloor/2017/v1/cavernFloor.xml', + 'Geometry/TrackerCommonData/data/PhaseI/trackerParameters.xml', + 'Geometry/TrackerCommonData/data/pixfwdMaterials/2021/v3/pixfwdMaterials.xml', + 'Geometry/TrackerCommonData/data/pixfwdCommon.xml', + 'Geometry/TrackerCommonData/data/PhaseI/v2/pixfwdCylinder.xml', + 'Geometry/TrackerCommonData/data/PhaseI/v2/pixfwdDisks.xml', + 'Geometry/TrackerCommonData/data/PhaseI/v2/pixfwd.xml', + 'Geometry/TrackerCommonData/data/PhaseI/v2/pixfwdSupportRingParameters.xml', + 'Geometry/TrackerCommonData/data/PhaseI/v2/pixfwdInnerDiskZplus.xml', + 'Geometry/TrackerCommonData/data/PhaseI/v2/pixfwdInnerDiskZminus.xml', + 'Geometry/TrackerCommonData/data/PhaseI/v2/pixfwdOuterDiskZplus.xml', + 'Geometry/TrackerCommonData/data/PhaseI/v2/pixfwdOuterDiskZminus.xml', + 'Geometry/TrackerCommonData/data/PhaseI/v2/pixfwdbladeInnerZplus.xml', + 'Geometry/TrackerCommonData/data/PhaseI/v2/pixfwdbladeInnerZminus.xml', + 'Geometry/TrackerCommonData/data/PhaseI/v2/pixfwdbladeOuterZplus.xml', + 'Geometry/TrackerCommonData/data/PhaseI/v2/pixfwdbladeOuterZminus.xml', + 'Geometry/TrackerCommonData/data/PhaseI/v2/pixbarmaterial.xml', + 'Geometry/TrackerCommonData/data/PhaseI/v2/pixbarladder.xml', + 'Geometry/TrackerCommonData/data/PhaseI/v2/pixbarladderfull0.xml', + 'Geometry/TrackerCommonData/data/PhaseI/v2/pixbarladderfull1.xml', + 'Geometry/TrackerCommonData/data/PhaseI/v2/pixbarladderfull2.xml', + 'Geometry/TrackerCommonData/data/PhaseI/v2/pixbarladderfull3.xml', + 'Geometry/TrackerCommonData/data/PhaseI/v2/pixbarlayer.xml', + 'Geometry/TrackerCommonData/data/PhaseI/v2/pixbarlayer0.xml', + 'Geometry/TrackerCommonData/data/PhaseI/v2/pixbarlayer1.xml', + 'Geometry/TrackerCommonData/data/PhaseI/v2/pixbarlayer2.xml', + 'Geometry/TrackerCommonData/data/PhaseI/v2/pixbarlayer3.xml', + 'Geometry/TrackerCommonData/data/PhaseI/v2/pixbar.xml', + 'Geometry/TrackerCommonData/data/Run2/trackerpatchpannel.xml', + 'Geometry/TrackerCommonData/data/Run2/trackerpixelnose.xml', + 'Geometry/TrackerCommonData/data/tibtidcommonmaterial/2021/v1/tibtidcommonmaterial.xml', + 'Geometry/TrackerCommonData/data/tibmaterial/2021/v1/tibmaterial.xml', + 'Geometry/TrackerCommonData/data/tibmodpar.xml', + 'Geometry/TrackerCommonData/data/tibmodule0.xml', + 'Geometry/TrackerCommonData/data/tibmodule0a.xml', + 'Geometry/TrackerCommonData/data/tibmodule0b.xml', + 'Geometry/TrackerCommonData/data/tibmodule2.xml', + 'Geometry/TrackerCommonData/data/tibstringpar.xml', + 'Geometry/TrackerCommonData/data/tibstring0ll.xml', + 'Geometry/TrackerCommonData/data/tibstring0lr.xml', + 'Geometry/TrackerCommonData/data/tibstring0ul.xml', + 'Geometry/TrackerCommonData/data/tibstring0ur.xml', + 'Geometry/TrackerCommonData/data/tibstring0.xml', + 'Geometry/TrackerCommonData/data/tibstring1ll.xml', + 'Geometry/TrackerCommonData/data/tibstring1lr.xml', + 'Geometry/TrackerCommonData/data/tibstring1ul.xml', + 'Geometry/TrackerCommonData/data/tibstring1ur.xml', + 'Geometry/TrackerCommonData/data/tibstring1.xml', + 'Geometry/TrackerCommonData/data/tibstring2ll.xml', + 'Geometry/TrackerCommonData/data/tibstring2lr.xml', + 'Geometry/TrackerCommonData/data/tibstring2ul.xml', + 'Geometry/TrackerCommonData/data/tibstring2ur.xml', + 'Geometry/TrackerCommonData/data/tibstring2.xml', + 'Geometry/TrackerCommonData/data/tibstring3ll.xml', + 'Geometry/TrackerCommonData/data/tibstring3lr.xml', + 'Geometry/TrackerCommonData/data/tibstring3ul.xml', + 'Geometry/TrackerCommonData/data/tibstring3ur.xml', + 'Geometry/TrackerCommonData/data/tibstring3.xml', + 'Geometry/TrackerCommonData/data/tiblayerpar.xml', + 'Geometry/TrackerCommonData/data/tiblayer0.xml', + 'Geometry/TrackerCommonData/data/tiblayer1.xml', + 'Geometry/TrackerCommonData/data/tiblayer2.xml', + 'Geometry/TrackerCommonData/data/tiblayer3.xml', + 'Geometry/TrackerCommonData/data/tib.xml', + 'Geometry/TrackerCommonData/data/tidmaterial/2021/v1/tidmaterial.xml', + 'Geometry/TrackerCommonData/data/tidmodpar.xml', + 'Geometry/TrackerCommonData/data/tidmodule0.xml', + 'Geometry/TrackerCommonData/data/tidmodule0r.xml', + 'Geometry/TrackerCommonData/data/tidmodule0l.xml', + 'Geometry/TrackerCommonData/data/tidmodule1.xml', + 'Geometry/TrackerCommonData/data/tidmodule1r.xml', + 'Geometry/TrackerCommonData/data/tidmodule1l.xml', + 'Geometry/TrackerCommonData/data/tidmodule2.xml', + 'Geometry/TrackerCommonData/data/tidringpar.xml', + 'Geometry/TrackerCommonData/data/tidring0.xml', + 'Geometry/TrackerCommonData/data/tidring0f.xml', + 'Geometry/TrackerCommonData/data/tidring0b.xml', + 'Geometry/TrackerCommonData/data/tidring1.xml', + 'Geometry/TrackerCommonData/data/tidring1f.xml', + 'Geometry/TrackerCommonData/data/tidring1b.xml', + 'Geometry/TrackerCommonData/data/tidring2.xml', + 'Geometry/TrackerCommonData/data/tid.xml', + 'Geometry/TrackerCommonData/data/tidf.xml', + 'Geometry/TrackerCommonData/data/tidb.xml', + 'Geometry/TrackerCommonData/data/tibtidservices.xml', + 'Geometry/TrackerCommonData/data/tibtidservicesf.xml', + 'Geometry/TrackerCommonData/data/tibtidservicesb.xml', + 'Geometry/TrackerCommonData/data/tobmaterial/2021/v1/tobmaterial.xml', + 'Geometry/TrackerCommonData/data/tobmodpar.xml', + 'Geometry/TrackerCommonData/data/tobmodule0.xml', + 'Geometry/TrackerCommonData/data/tobmodule2.xml', + 'Geometry/TrackerCommonData/data/tobmodule4.xml', + 'Geometry/TrackerCommonData/data/tobrodpar.xml', + 'Geometry/TrackerCommonData/data/tobrod0c.xml', + 'Geometry/TrackerCommonData/data/tobrod0l.xml', + 'Geometry/TrackerCommonData/data/tobrod0h.xml', + 'Geometry/TrackerCommonData/data/tobrod0.xml', + 'Geometry/TrackerCommonData/data/tobrod1l.xml', + 'Geometry/TrackerCommonData/data/tobrod1h.xml', + 'Geometry/TrackerCommonData/data/tobrod1.xml', + 'Geometry/TrackerCommonData/data/tobrod2c.xml', + 'Geometry/TrackerCommonData/data/tobrod2l.xml', + 'Geometry/TrackerCommonData/data/tobrod2h.xml', + 'Geometry/TrackerCommonData/data/tobrod2.xml', + 'Geometry/TrackerCommonData/data/tobrod3l.xml', + 'Geometry/TrackerCommonData/data/tobrod3h.xml', + 'Geometry/TrackerCommonData/data/tobrod3.xml', + 'Geometry/TrackerCommonData/data/tobrod4c.xml', + 'Geometry/TrackerCommonData/data/tobrod4l.xml', + 'Geometry/TrackerCommonData/data/tobrod4h.xml', + 'Geometry/TrackerCommonData/data/tobrod4.xml', + 'Geometry/TrackerCommonData/data/tobrod5l.xml', + 'Geometry/TrackerCommonData/data/tobrod5h.xml', + 'Geometry/TrackerCommonData/data/tobrod5.xml', + 'Geometry/TrackerCommonData/data/tob/v3/tob.xml', + 'Geometry/TrackerCommonData/data/tecmaterial/2021/v1/tecmaterial.xml', + 'Geometry/TrackerCommonData/data/tecmodpar.xml', + 'Geometry/TrackerCommonData/data/tecmodule0.xml', + 'Geometry/TrackerCommonData/data/tecmodule0r.xml', + 'Geometry/TrackerCommonData/data/tecmodule0s.xml', + 'Geometry/TrackerCommonData/data/tecmodule1.xml', + 'Geometry/TrackerCommonData/data/tecmodule1r.xml', + 'Geometry/TrackerCommonData/data/tecmodule1s.xml', + 'Geometry/TrackerCommonData/data/tecmodule2.xml', + 'Geometry/TrackerCommonData/data/tecmodule3.xml', + 'Geometry/TrackerCommonData/data/tecmodule4.xml', + 'Geometry/TrackerCommonData/data/tecmodule4r.xml', + 'Geometry/TrackerCommonData/data/tecmodule4s.xml', + 'Geometry/TrackerCommonData/data/tecmodule5.xml', + 'Geometry/TrackerCommonData/data/tecmodule6.xml', + 'Geometry/TrackerCommonData/data/tecpetpar.xml', + 'Geometry/TrackerCommonData/data/tecring0.xml', + 'Geometry/TrackerCommonData/data/tecring1.xml', + 'Geometry/TrackerCommonData/data/tecring2.xml', + 'Geometry/TrackerCommonData/data/tecring3.xml', + 'Geometry/TrackerCommonData/data/tecring4.xml', + 'Geometry/TrackerCommonData/data/tecring5.xml', + 'Geometry/TrackerCommonData/data/tecring6.xml', + 'Geometry/TrackerCommonData/data/tecring0f.xml', + 'Geometry/TrackerCommonData/data/tecring1f.xml', + 'Geometry/TrackerCommonData/data/tecring2f.xml', + 'Geometry/TrackerCommonData/data/tecring3f.xml', + 'Geometry/TrackerCommonData/data/tecring4f.xml', + 'Geometry/TrackerCommonData/data/tecring5f.xml', + 'Geometry/TrackerCommonData/data/tecring6f.xml', + 'Geometry/TrackerCommonData/data/tecring0b.xml', + 'Geometry/TrackerCommonData/data/tecring1b.xml', + 'Geometry/TrackerCommonData/data/tecring2b.xml', + 'Geometry/TrackerCommonData/data/tecring3b.xml', + 'Geometry/TrackerCommonData/data/tecring4b.xml', + 'Geometry/TrackerCommonData/data/tecring5b.xml', + 'Geometry/TrackerCommonData/data/tecring6b.xml', + 'Geometry/TrackerCommonData/data/tecpetalf.xml', + 'Geometry/TrackerCommonData/data/tecpetalb.xml', + 'Geometry/TrackerCommonData/data/tecpetal0.xml', + 'Geometry/TrackerCommonData/data/tecpetal0f.xml', + 'Geometry/TrackerCommonData/data/tecpetal0b.xml', + 'Geometry/TrackerCommonData/data/tecpetal3.xml', + 'Geometry/TrackerCommonData/data/tecpetal3f.xml', + 'Geometry/TrackerCommonData/data/tecpetal3b.xml', + 'Geometry/TrackerCommonData/data/tecpetal6f.xml', + 'Geometry/TrackerCommonData/data/tecpetal6b.xml', + 'Geometry/TrackerCommonData/data/tecpetal8f.xml', + 'Geometry/TrackerCommonData/data/tecpetal8b.xml', + 'Geometry/TrackerCommonData/data/tecwheel/2021/v1/tecwheel.xml', + 'Geometry/TrackerCommonData/data/tecwheela.xml', + 'Geometry/TrackerCommonData/data/tecwheelb.xml', + 'Geometry/TrackerCommonData/data/tecwheelc.xml', + 'Geometry/TrackerCommonData/data/tecwheeld.xml', + 'Geometry/TrackerCommonData/data/tecwheel6.xml', + 'Geometry/TrackerCommonData/data/tecservices.xml', + 'Geometry/TrackerCommonData/data/tecbackplate.xml', + 'Geometry/TrackerCommonData/data/tec.xml', + 'Geometry/TrackerCommonData/data/Run2/tracker.xml', + 'Geometry/TrackerCommonData/data/trackerpixbar.xml', + 'Geometry/TrackerCommonData/data/PhaseI/trackerpixfwd.xml', + 'Geometry/TrackerCommonData/data/trackertibtidservices.xml', + 'Geometry/TrackerCommonData/data/trackertib.xml', + 'Geometry/TrackerCommonData/data/trackertid.xml', + 'Geometry/TrackerCommonData/data/trackertob.xml', + 'Geometry/TrackerCommonData/data/trackertec.xml', + 'Geometry/TrackerCommonData/data/v2/trackerbulkhead.xml', + 'Geometry/TrackerCommonData/data/trackerother.xml', + 'Geometry/TrackerCommonData/data/PhaseI/trackerStructureTopology.xml', + 'Geometry/TrackerSimData/data/PhaseI/trackersens.xml', + 'Geometry/TrackerRecoData/data/PhaseI/v1/trackerRecoMaterial.xml', + 'SimTracker/TrackerMaterialAnalysis/data/trackingMaterialGroups_ForPhaseI/v1/trackingMaterialGroups_ForPhaseI.xml', + 'Geometry/TrackerSimData/data/PhaseI/trackerProdCuts.xml', + 'Geometry/TrackerSimData/data/trackerProdCutsBEAM.xml', + 'Geometry/EcalCommonData/data/ebcon/2021/v1/ebcon.xml', + 'Geometry/EcalCommonData/data/eecon.xml', + 'Geometry/EcalCommonData/data/escon.xml', + 'Geometry/EcalCommonData/data/eregalgo/2017/v1/eregalgo.xml', + 'Geometry/EcalCommonData/data/ebalgo.xml', + 'Geometry/EcalCommonData/data/ebrot.xml', + 'Geometry/EcalCommonData/data/eefixed/2021/v1/eefixed.xml', + 'Geometry/EcalCommonData/data/eehier.xml', + 'Geometry/EcalCommonData/data/eealgo.xml', + 'Geometry/EcalCommonData/data/esalgo.xml', + 'Geometry/EcalCommonData/data/eeF.xml', + 'Geometry/EcalCommonData/data/eeB.xml', + 'Geometry/EcalCommonData/data/ectkcable.xml', + 'Geometry/HcalCommonData/data/hcalrotations.xml', + 'Geometry/HcalCommonData/data/hcal/PhaseI/hcalalgo.xml', + 'Geometry/HcalCommonData/data/hcalcablealgo.xml', + 'Geometry/HcalCommonData/data/hcalbarrelalgo.xml', + 'Geometry/HcalCommonData/data/hcalendcap/PhaseI/hcalendcapalgo.xml', + 'Geometry/HcalCommonData/data/hcalouteralgo/v1/hcalouteralgo.xml', + 'Geometry/HcalCommonData/data/hcalforwardalgo.xml', + 'Geometry/HcalCommonData/data/average/hcalforwardmaterial.xml', + 'Geometry/HcalCommonData/data/hcalSimNumbering/2021/v1/hcalSimNumbering.xml', + 'Geometry/HcalCommonData/data/hcalRecNumbering/2021/hcalRecNumbering.xml', + 'Geometry/MuonCommonData/data/mbCommon/2021/v2/mbCommon.xml', + 'Geometry/MuonCommonData/data/mb1/2021/v1/mb1.xml', + 'Geometry/MuonCommonData/data/mb2/2021/v1/mb2.xml', + 'Geometry/MuonCommonData/data/mb3/2021/v1/mb3.xml', + 'Geometry/MuonCommonData/data/mb4/2015/v2/mb4.xml', + 'Geometry/MuonCommonData/data/mb4Shield/2021/v1/mb4Shield.xml', + 'Geometry/MuonCommonData/data/muonYoke/2021/v5/muonYoke.xml', + 'Geometry/MuonCommonData/data/mf/2021/v2/mf.xml', + 'Geometry/MuonCommonData/data/rpcf/2015/v1/rpcf.xml', + 'Geometry/MuonCommonData/data/gemf/TDR_BaseLine/gemf.xml', + 'Geometry/MuonCommonData/data/gem11/TDR_BaseLine/gem11.xml', + 'Geometry/MuonCommonData/data/csc/2021/v3/csc.xml', + 'Geometry/MuonCommonData/data/mfshield/2017/v2/mfshield.xml', + )+ + cms.vstring( + 'Geometry/MuonCommonData/data/muonNumbering/2021/v3/muonNumbering.xml', + 'Geometry/ForwardCommonData/data/forward/2021/v1/forward.xml', + 'Geometry/ForwardCommonData/data/totemt2/2021/v1/totemt2.xml', + 'Geometry/ForwardCommonData/data/forwardshield/2021/v1/forwardshield.xml', + 'Geometry/ForwardCommonData/data/brmrotations.xml', + 'Geometry/ForwardCommonData/data/brm/2021/v1/brm.xml', + 'Geometry/ForwardCommonData/data/zdcmaterials/2021/v1/zdcmaterials.xml', + 'Geometry/ForwardCommonData/data/lumimaterials.xml', + 'Geometry/ForwardCommonData/data/zdcrotations.xml', + 'Geometry/ForwardCommonData/data/lumirotations.xml', + 'Geometry/ForwardCommonData/data/zdc/2021/v1/zdc.xml', + 'Geometry/ForwardCommonData/data/zdclumi/2021/v2/zdclumi.xml', + 'Geometry/ForwardCommonData/data/cmszdc.xml', + 'Geometry/VeryForwardData/data/RP_Box.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_000.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_001.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_002.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_003.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_004.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_005.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_020.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_021.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_022.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_023.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_024.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_025.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_100.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_101.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_102.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_103.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_104.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_105.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_120.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_121.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_122.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_123.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_124.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_125.xml', + 'Geometry/VeryForwardData/data/RP_Hybrid/v2/RP_Hybrid.xml', + 'Geometry/VeryForwardData/data/RP_Materials/v4/RP_Materials.xml', + 'Geometry/VeryForwardData/data/RP_Transformations.xml', + 'Geometry/VeryForwardData/data/RP_Detectors_Assembly.xml', + 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_000.xml', + 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_001.xml', + 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_002.xml', + 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_004.xml', + 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_005.xml', + 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_020.xml', + 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_021.xml', + 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_024.xml', + 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_025.xml', + 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_100.xml', + 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_101.xml', + 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_102.xml', + 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_104.xml', + 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_105.xml', + 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_120.xml', + 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_121.xml', + 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_124.xml', + 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_125.xml', + 'Geometry/VeryForwardData/data/RP_Device/v1/RP_Device.xml', + 'Geometry/VeryForwardData/data/RP_Vertical_Device/2021/Simu/v2/RP_Vertical_Device.xml', + 'Geometry/VeryForwardData/data/RP_Horizontal_Device/2021/Simu/v2/RP_Horizontal_Device.xml', + 'Geometry/VeryForwardData/data/CTPPS_2021/Stations/Simu/v3/CTPPS_220_Right_Station.xml', + 'Geometry/VeryForwardData/data/CTPPS_2021/Stations/Simu/v3/CTPPS_220_Left_Station.xml', + 'Geometry/VeryForwardData/data/CTPPS_2021/Stations/Simu/v3/CTPPS_210_Right_Station.xml', + 'Geometry/VeryForwardData/data/CTPPS_2021/Stations/Simu/v3/CTPPS_210_Left_Station.xml', + 'Geometry/VeryForwardData/data/CTPPS_2021/Stations/Simu/v3/CTPPS_Stations_Assembly.xml', + 'Geometry/VeryForwardData/data/CTPPS_2021/Cuts_Per_Region/Simu/v1/CTPPS_Cuts_Per_Region.xml', + 'Geometry/VeryForwardData/data/RP_Sensitive_Dets.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_Transformations.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_Parameters.xml', + 'Geometry/VeryForwardData/data/CTPPS_Timing_Station_Parameters.xml', + 'Geometry/VeryForwardData/data/CTPPS_Timing_Horizontal_Pot/v2/CTPPS_Timing_Horizontal_Pot.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern1_Segment1.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern2_Segment1.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern2_Segment2.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern3_Segment1.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern3_Segment2.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern3_Segment3.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern3_Segment4.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern4_Segment1.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern4_Segment2.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern4_Segment3.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern4_Segment4.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern4_Segment5.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_2021/CTPPS_Diamond_Planes/CTPPS_Diamond_Plane1.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_2021/CTPPS_Diamond_Planes/CTPPS_Diamond_Plane2.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_2021/CTPPS_Diamond_Planes/CTPPS_Diamond_Plane3.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_2021/CTPPS_Diamond_Planes/CTPPS_Diamond_Plane4.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_2021/CTPPS_Diamond_Detector_Assembly/v1/CTPPS_Diamond_Detector_Assembly.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_2021/Simu/v1/CTPPS_Detectors_Assembly_022.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_2021/Simu/v1/CTPPS_Detectors_Assembly_122.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_Sensitive_Dets_TimingHits.xml', + 'Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Modules/v2/ppstrackerMaterials.xml', + 'Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Modules/v3/PPS_Pixel_Module_2x2_Run3.xml', + 'Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Modules/v2/PPS_Pixel_Sens.xml', + 'Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Assembly/v2/CTPPS_Pixel_Assembly_Box_Real_003.xml', + 'Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Assembly/v2/CTPPS_Pixel_Assembly_Box_Real_023.xml', + 'Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Assembly/v2/CTPPS_Pixel_Assembly_Box_Real_103.xml', + 'Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Assembly/v2/CTPPS_Pixel_Assembly_Box_Real_123.xml', + 'Geometry/VeryForwardData/data/CTPPS_2021/RP_Dist_Beam_Cent/Simu/v1/RP_Dist_Beam_Cent.xml', + 'Geometry/EcalSimData/data/ecalsens.xml', + 'Geometry/HcalCommonData/data/hcalsens/2021/v1/hcalsenspmf.xml', + 'Geometry/HcalSimData/data/hf.xml', + 'Geometry/HcalSimData/data/hfpmt.xml', + 'Geometry/HcalSimData/data/hffibrebundle.xml', + 'Geometry/HcalSimData/data/CaloUtil/2021/v1/CaloUtil.xml', + 'Geometry/MuonSimData/data/v2/muonSens.xml', + 'Geometry/DTGeometryBuilder/data/dtSpecsFilter/2021/v1/dtSpecsFilter.xml', + 'Geometry/CSCGeometryBuilder/data/cscSpecsFilter.xml', + 'Geometry/CSCGeometryBuilder/data/cscSpecs.xml', + 'Geometry/RPCGeometryBuilder/data/RPCSpecs.xml', + 'Geometry/GEMGeometryBuilder/data/GEMSpecsFilter17.xml', + 'Geometry/GEMGeometryBuilder/data/v4/GEMSpecs.xml', + 'Geometry/ForwardCommonData/data/brmsens.xml', + 'Geometry/ForwardSimData/data/totemsensT2/2021/totemsensT2.xml', + 'Geometry/ForwardSimData/data/zdcsens.xml', + 'Geometry/HcalSimData/data/HcalProdCuts/2021/v2/HcalProdCuts.xml', + 'Geometry/EcalSimData/data/EcalProdCuts.xml', + 'Geometry/EcalSimData/data/ESProdCuts.xml', + 'Geometry/MuonSimData/data/muonProdCuts/2021/v1/muonProdCuts.xml', + 'Geometry/ForwardSimData/data/zdcProdCuts/2021/v2/zdcProdCuts.xml', + 'Geometry/ForwardSimData/data/ForwardShieldProdCuts.xml', + 'Geometry/CMSCommonData/data/FieldParameters.xml', + ), + rootNodeName = cms.string('cms:OCMS') +) diff --git a/Geometry/VeryForwardGeometry/data/dd4hep/v3/geometryRPFromDD_2021.xml b/Geometry/VeryForwardGeometry/data/dd4hep/v3/geometryRPFromDD_2021.xml new file mode 100644 index 0000000000000..85ecb9391b0f4 --- /dev/null +++ b/Geometry/VeryForwardGeometry/data/dd4hep/v3/geometryRPFromDD_2021.xml @@ -0,0 +1,127 @@ + + + + + + + # common and strip files + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + # diamond files + + + + + + + + + + + + + + + + + + + + + + + + + + + + # Totem Timing files + + + + + + + # pixel files + + + + + + + + + # RP distance + + + + diff --git a/Geometry/VeryForwardGeometry/python/dd4hep/v3/geometryRPFromDD_2021_cfi.py b/Geometry/VeryForwardGeometry/python/dd4hep/v3/geometryRPFromDD_2021_cfi.py new file mode 100644 index 0000000000000..bc2f4549850d9 --- /dev/null +++ b/Geometry/VeryForwardGeometry/python/dd4hep/v3/geometryRPFromDD_2021_cfi.py @@ -0,0 +1,18 @@ +import FWCore.ParameterSet.Config as cms + +DDDetectorESProducer = cms.ESSource("DDDetectorESProducer", + confGeomXMLFiles = cms.FileInPath('Geometry/VeryForwardGeometry/data/dd4hep/v3/geometryRPFromDD_2021.xml'), + appendToDataLabel = cms.string('XMLIdealGeometryESSource_CTPPS') +) + +DDCompactViewESProducer = cms.ESProducer("DDCompactViewESProducer", + appendToDataLabel = cms.string('XMLIdealGeometryESSource_CTPPS') +) + +ctppsGeometryESModule = cms.ESProducer("CTPPSGeometryESModule", + fromDD4hep = cms.untracked.bool(True), + isRun2 = cms.bool(False), + verbosity = cms.untracked.uint32(1), + compactViewTag = cms.string('XMLIdealGeometryESSource_CTPPS') +) + diff --git a/Geometry/VeryForwardGeometry/python/v1/geometryRPFromDD_2021_cfi.py b/Geometry/VeryForwardGeometry/python/v1/geometryRPFromDD_2021_cfi.py new file mode 100644 index 0000000000000..e283ad5c78756 --- /dev/null +++ b/Geometry/VeryForwardGeometry/python/v1/geometryRPFromDD_2021_cfi.py @@ -0,0 +1,142 @@ +import FWCore.ParameterSet.Config as cms + +# common and strip files +totemGeomXMLFiles = cms.vstring( + 'Geometry/CMSCommonData/data/materials.xml', + 'Geometry/CMSCommonData/data/rotations.xml', + 'Geometry/CMSCommonData/data/extend/cmsextent.xml', + 'Geometry/CMSCommonData/data/cms/2017/v1/cms.xml', + 'Geometry/CMSCommonData/data/beampipe/2017/v1/beampipe.xml', + 'Geometry/CMSCommonData/data/cmsBeam.xml', + 'Geometry/CMSCommonData/data/cmsMother.xml', + 'Geometry/CMSCommonData/data/mgnt.xml', + 'Geometry/TrackerCommonData/data/trackermaterial/2021/v1/trackermaterial.xml', + 'Geometry/TrackerCommonData/data/pixfwdMaterials/2021/v2/pixfwdMaterials.xml', + 'Geometry/ForwardCommonData/data/forward.xml', + 'Geometry/ForwardCommonData/data/totemRotations.xml', + 'Geometry/ForwardCommonData/data/totemMaterials.xml', + 'Geometry/VeryForwardData/data/RP_Box.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_000.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_001.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_002.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_003.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_004.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_005.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_020.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_021.xml', +# 'Geometry/VeryForwardData/data/RP_Boxv3//RP_Box_022.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_023.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_024.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_025.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_100.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_101.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_102.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_103.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_104.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_105.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_120.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_121.xml', +# 'Geometry/VeryForwardData/data/RP_Boxv3//RP_Box_122.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_123.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_124.xml', + 'Geometry/VeryForwardData/data/RP_Box/v3/RP_Box_125.xml', + 'Geometry/VeryForwardData/data/RP_Hybrid/v2/RP_Hybrid.xml', + 'Geometry/VeryForwardData/data/RP_Materials/v4/RP_Materials.xml', + 'Geometry/VeryForwardData/data/RP_Transformations.xml', + 'Geometry/VeryForwardData/data/RP_Detectors_Assembly.xml', + 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_000.xml', + 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_001.xml', + 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_002.xml', + 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_004.xml', + 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_005.xml', +# 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_022.xml', + 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_024.xml', + 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_025.xml', + 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_100.xml', + 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_101.xml', + 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_102.xml', + 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_104.xml', + 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_105.xml', +# 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_122.xml', + 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_124.xml', + 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_125.xml', + 'Geometry/VeryForwardData/data/RP_Device.xml', + 'Geometry/VeryForwardData/data/RP_Vertical_Device/2021/Reco/v2/RP_Vertical_Device.xml', + 'Geometry/VeryForwardData/data/RP_Horizontal_Device/2021/Reco/v2/RP_Horizontal_Device.xml', + 'Geometry/VeryForwardData/data/CTPPS_2021/Stations/Reco/v2/RP_220_Right_Station.xml', + 'Geometry/VeryForwardData/data/CTPPS_2021/Stations/Reco/v2/RP_210_Right_Station.xml', + 'Geometry/VeryForwardData/data/CTPPS_2021/Stations/Reco/v2/RP_220_Left_Station.xml', + 'Geometry/VeryForwardData/data/CTPPS_2021/Stations/Reco/v2/RP_210_Left_Station.xml', + 'Geometry/VeryForwardData/data/CTPPS_2021/Stations/Reco/v1/RP_Stations_Assembly.xml', + + 'Geometry/VeryForwardData/data/RP_Sensitive_Dets.xml', + 'Geometry/VeryForwardData/data/CTPPS_2021/Cuts_Per_Region/Reco/v1/RP_Cuts_Per_Region.xml', + + 'Geometry/VeryForwardData/data/CTPPS_2021/RP_Param_Beam_Region/v1/RP_Param_Beam_Region.xml' + ) + +# diamond files +ctppsDiamondGeomXMLFiles = cms.vstring( + 'Geometry/VeryForwardData/data/CTPPS_Diamond_Materials.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_Transformations.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_X_Distance.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_Parameters.xml', + 'Geometry/VeryForwardData/data/CTPPS_Timing_Station_Parameters.xml', + 'Geometry/VeryForwardData/data/CTPPS_Timing_Horizontal_Pot/v2/CTPPS_Timing_Horizontal_Pot.xml', + 'Geometry/VeryForwardData/data/CTPPS_Timing_Positive_Station/v1/CTPPS_Timing_Positive_Station.xml', + 'Geometry/VeryForwardData/data/CTPPS_Timing_Negative_Station/v1/CTPPS_Timing_Negative_Station.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_2021/Reco/v1/CTPPS_Timing_Stations_Assembly.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern1_Segment1.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern2_Segment1.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern2_Segment2.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern3_Segment1.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern3_Segment2.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern3_Segment3.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern3_Segment4.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern4_Segment1.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern4_Segment2.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern4_Segment3.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern4_Segment4.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern4_Segment5.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_2021/CTPPS_Diamond_Planes/CTPPS_Diamond_Plane1.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_2021/CTPPS_Diamond_Planes/CTPPS_Diamond_Plane2.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_2021/CTPPS_Diamond_Planes/CTPPS_Diamond_Plane3.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_2021/CTPPS_Diamond_Planes/CTPPS_Diamond_Plane4.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_2021/CTPPS_Diamond_Detector_Assembly/v1/CTPPS_Diamond_Detector_Assembly.xml' + ) + + +# Totem Timing files +totemTimingGeomXMLFiles = cms.vstring( + # UFSDetectors + 'Geometry/VeryForwardData/data/TotemTiming/TotemTiming_Dist_Beam_Cent.xml', + 'Geometry/VeryForwardData/data/TotemTiming/TotemTiming_DetectorAssembly.xml', + 'Geometry/VeryForwardData/data/TotemTiming/TotemTiming_Parameters.xml', + 'Geometry/VeryForwardData/data/TotemTiming/TotemTiming_Plane.xml', + 'Geometry/VeryForwardData/data/TotemTiming/TotemTiming_Station.xml', + ) + +# pixel files +ctppsPixelGeomXMLFiles = cms.vstring( + 'Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Modules/v2/ppstrackerMaterials.xml', + 'Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Modules/v3/PPS_Pixel_Module_2x2_Run3.xml', + 'Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Modules/v2/PPS_Pixel_Sens.xml', + 'Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Assembly/v2/CTPPS_Pixel_Assembly_Box_Real_003.xml', + 'Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Assembly/v2/CTPPS_Pixel_Assembly_Box_Real_023.xml', + 'Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Assembly/v2/CTPPS_Pixel_Assembly_Box_Real_103.xml', + 'Geometry/VeryForwardData/data/CTPPS_Pixel_2021/Assembly/v2/CTPPS_Pixel_Assembly_Box_Real_123.xml' + ) + +XMLIdealGeometryESSource_CTPPS = cms.ESSource("XMLIdealGeometryESSource", + geomXMLFiles = totemGeomXMLFiles + ctppsDiamondGeomXMLFiles + totemTimingGeomXMLFiles + ctppsPixelGeomXMLFiles, + rootNodeName = cms.string('cms:CMSE') + ) + +# position of RPs +XMLIdealGeometryESSource_CTPPS.geomXMLFiles.append("Geometry/VeryForwardData/data/CTPPS_2021/RP_Dist_Beam_Cent/Reco/v1/RP_Dist_Beam_Cent.xml") + +ctppsGeometryESModule = cms.ESProducer("CTPPSGeometryESModule", + verbosity = cms.untracked.uint32(1), + isRun2 = cms.bool(False), + compactViewTag = cms.string('XMLIdealGeometryESSource_CTPPS') +) diff --git a/HLTrigger/Configuration/python/HLT_FULL_cff.py b/HLTrigger/Configuration/python/HLT_FULL_cff.py index 5b4580f8a598e..521200a36b2fd 100644 --- a/HLTrigger/Configuration/python/HLT_FULL_cff.py +++ b/HLTrigger/Configuration/python/HLT_FULL_cff.py @@ -1,13 +1,13 @@ -# hltGetConfiguration --cff --data /dev/CMSSW_12_0_0/HLT --type FULL +# hltGetConfiguration --cff --data /dev/CMSSW_12_1_0/HLT --type FULL -# /dev/CMSSW_12_0_0/HLT/V8 (CMSSW_12_0_0_pre5) +# /dev/CMSSW_12_1_0/HLT/V3 (CMSSW_12_1_0_pre2) import FWCore.ParameterSet.Config as cms fragment = cms.ProcessFragment( "HLT" ) fragment.HLTConfigVersion = cms.PSet( - tableName = cms.string('/dev/CMSSW_12_0_0/HLT/V8') + tableName = cms.string('/dev/CMSSW_12_1_0/HLT/V3') ) fragment.transferSystem = cms.PSet( @@ -8974,7 +8974,9 @@ useUncertDB = cms.bool( True ), doVdriftCorr = cms.bool( True ), minTime = cms.double( -3.0 ), - tTrigMode = cms.string( "DTTTrigSyncFromDB" ) + tTrigMode = cms.string( "DTTTrigSyncFromDB" ), + readLegacyTTrigDB = cms.bool( True ), + readLegacyVDriftDB = cms.bool( True ) ), recAlgo = cms.string( "DTLinearDriftFromDBAlgo" ), debug = cms.untracked.bool( False ), @@ -9009,7 +9011,9 @@ useUncertDB = cms.bool( True ), doVdriftCorr = cms.bool( True ), minTime = cms.double( -3.0 ), - tTrigMode = cms.string( "DTTTrigSyncFromDB" ) + tTrigMode = cms.string( "DTTTrigSyncFromDB" ), + readLegacyTTrigDB = cms.bool( True ), + readLegacyVDriftDB = cms.bool( True ) ), MaxAllowedHits = cms.uint32( 50 ), nUnSharedHitsMin = cms.int32( 2 ), @@ -9042,7 +9046,9 @@ useUncertDB = cms.bool( True ), doVdriftCorr = cms.bool( True ), minTime = cms.double( -3.0 ), - tTrigMode = cms.string( "DTTTrigSyncFromDB" ) + tTrigMode = cms.string( "DTTTrigSyncFromDB" ), + readLegacyTTrigDB = cms.bool( True ), + readLegacyVDriftDB = cms.bool( True ) ), nUnSharedHitsMin = cms.int32( 2 ), nSharedHitsMax = cms.int32( 2 ), @@ -44032,7 +44038,9 @@ useUncertDB = cms.bool( True ), doVdriftCorr = cms.bool( True ), minTime = cms.double( -3.0 ), - tTrigMode = cms.string( "DTTTrigSyncFromDB" ) + tTrigMode = cms.string( "DTTTrigSyncFromDB" ), + readLegacyTTrigDB = cms.bool( True ), + readLegacyVDriftDB = cms.bool( True ) ), MaxAllowedHits = cms.uint32( 50 ), nUnSharedHitsMin = cms.int32( 2 ), @@ -44065,7 +44073,9 @@ useUncertDB = cms.bool( True ), doVdriftCorr = cms.bool( True ), minTime = cms.double( -3.0 ), - tTrigMode = cms.string( "DTTTrigSyncFromDB" ) + tTrigMode = cms.string( "DTTTrigSyncFromDB" ), + readLegacyTTrigDB = cms.bool( True ), + readLegacyVDriftDB = cms.bool( True ) ), nUnSharedHitsMin = cms.int32( 2 ), nSharedHitsMax = cms.int32( 2 ), diff --git a/HLTrigger/Configuration/python/HLT_Fake1_cff.py b/HLTrigger/Configuration/python/HLT_Fake1_cff.py index 82a303167cc05..e0377ebc022c4 100644 --- a/HLTrigger/Configuration/python/HLT_Fake1_cff.py +++ b/HLTrigger/Configuration/python/HLT_Fake1_cff.py @@ -1,13 +1,13 @@ -# hltGetConfiguration --cff --data /dev/CMSSW_12_0_0/Fake1 --type Fake1 +# hltGetConfiguration --cff --data /dev/CMSSW_12_1_0/Fake1 --type Fake1 -# /dev/CMSSW_12_0_0/Fake1/V5 (CMSSW_12_0_0_pre5) +# /dev/CMSSW_12_1_0/Fake1/V2 (CMSSW_12_1_0_pre2) import FWCore.ParameterSet.Config as cms fragment = cms.ProcessFragment( "HLT" ) fragment.HLTConfigVersion = cms.PSet( - tableName = cms.string('/dev/CMSSW_12_0_0/Fake1/V5') + tableName = cms.string('/dev/CMSSW_12_1_0/Fake1/V2') ) fragment.streams = cms.PSet( A = cms.vstring( 'InitialPD' ) ) diff --git a/HLTrigger/Configuration/python/HLT_Fake2_cff.py b/HLTrigger/Configuration/python/HLT_Fake2_cff.py index f8b93f6dca7c9..f9f2d9bae8171 100644 --- a/HLTrigger/Configuration/python/HLT_Fake2_cff.py +++ b/HLTrigger/Configuration/python/HLT_Fake2_cff.py @@ -1,13 +1,13 @@ -# hltGetConfiguration --cff --data /dev/CMSSW_12_0_0/Fake2 --type Fake2 +# hltGetConfiguration --cff --data /dev/CMSSW_12_1_0/Fake2 --type Fake2 -# /dev/CMSSW_12_0_0/Fake2/V5 (CMSSW_12_0_0_pre5) +# /dev/CMSSW_12_1_0/Fake2/V2 (CMSSW_12_1_0_pre2) import FWCore.ParameterSet.Config as cms fragment = cms.ProcessFragment( "HLT" ) fragment.HLTConfigVersion = cms.PSet( - tableName = cms.string('/dev/CMSSW_12_0_0/Fake2/V5') + tableName = cms.string('/dev/CMSSW_12_1_0/Fake2/V2') ) fragment.streams = cms.PSet( A = cms.vstring( 'InitialPD' ) ) diff --git a/HLTrigger/Configuration/python/HLT_Fake_cff.py b/HLTrigger/Configuration/python/HLT_Fake_cff.py index 5ff5332957f07..f0adf2e1307f0 100644 --- a/HLTrigger/Configuration/python/HLT_Fake_cff.py +++ b/HLTrigger/Configuration/python/HLT_Fake_cff.py @@ -1,13 +1,13 @@ -# hltGetConfiguration --cff --data /dev/CMSSW_12_0_0/Fake --type Fake +# hltGetConfiguration --cff --data /dev/CMSSW_12_1_0/Fake --type Fake -# /dev/CMSSW_12_0_0/Fake/V5 (CMSSW_12_0_0_pre5) +# /dev/CMSSW_12_1_0/Fake/V2 (CMSSW_12_1_0_pre2) import FWCore.ParameterSet.Config as cms fragment = cms.ProcessFragment( "HLT" ) fragment.HLTConfigVersion = cms.PSet( - tableName = cms.string('/dev/CMSSW_12_0_0/Fake/V5') + tableName = cms.string('/dev/CMSSW_12_1_0/Fake/V2') ) fragment.streams = cms.PSet( A = cms.vstring( 'InitialPD' ) ) diff --git a/HLTrigger/Configuration/python/HLT_GRun_cff.py b/HLTrigger/Configuration/python/HLT_GRun_cff.py index 98ecafb08a7a2..847960b671114 100644 --- a/HLTrigger/Configuration/python/HLT_GRun_cff.py +++ b/HLTrigger/Configuration/python/HLT_GRun_cff.py @@ -1,13 +1,13 @@ -# hltGetConfiguration --cff --data /dev/CMSSW_12_0_0/GRun --type GRun +# hltGetConfiguration --cff --data /dev/CMSSW_12_1_0/GRun --type GRun -# /dev/CMSSW_12_0_0/GRun/V5 (CMSSW_12_0_0_pre5) +# /dev/CMSSW_12_1_0/GRun/V1 (CMSSW_12_1_0_pre2) import FWCore.ParameterSet.Config as cms fragment = cms.ProcessFragment( "HLT" ) fragment.HLTConfigVersion = cms.PSet( - tableName = cms.string('/dev/CMSSW_12_0_0/GRun/V5') + tableName = cms.string('/dev/CMSSW_12_1_0/GRun/V1') ) fragment.transferSystem = cms.PSet( @@ -7614,7 +7614,9 @@ useUncertDB = cms.bool( True ), doVdriftCorr = cms.bool( True ), minTime = cms.double( -3.0 ), - tTrigMode = cms.string( "DTTTrigSyncFromDB" ) + tTrigMode = cms.string( "DTTTrigSyncFromDB" ), + readLegacyTTrigDB = cms.bool( True ), + readLegacyVDriftDB = cms.bool( True ) ), recAlgo = cms.string( "DTLinearDriftFromDBAlgo" ), debug = cms.untracked.bool( False ), @@ -7649,7 +7651,9 @@ useUncertDB = cms.bool( True ), doVdriftCorr = cms.bool( True ), minTime = cms.double( -3.0 ), - tTrigMode = cms.string( "DTTTrigSyncFromDB" ) + tTrigMode = cms.string( "DTTTrigSyncFromDB" ), + readLegacyTTrigDB = cms.bool( True ), + readLegacyVDriftDB = cms.bool( True ) ), MaxAllowedHits = cms.uint32( 50 ), nUnSharedHitsMin = cms.int32( 2 ), @@ -7682,7 +7686,9 @@ useUncertDB = cms.bool( True ), doVdriftCorr = cms.bool( True ), minTime = cms.double( -3.0 ), - tTrigMode = cms.string( "DTTTrigSyncFromDB" ) + tTrigMode = cms.string( "DTTTrigSyncFromDB" ), + readLegacyTTrigDB = cms.bool( True ), + readLegacyVDriftDB = cms.bool( True ) ), nUnSharedHitsMin = cms.int32( 2 ), nSharedHitsMax = cms.int32( 2 ), @@ -42202,7 +42208,9 @@ useUncertDB = cms.bool( True ), doVdriftCorr = cms.bool( True ), minTime = cms.double( -3.0 ), - tTrigMode = cms.string( "DTTTrigSyncFromDB" ) + tTrigMode = cms.string( "DTTTrigSyncFromDB" ), + readLegacyTTrigDB = cms.bool( True ), + readLegacyVDriftDB = cms.bool( True ) ), MaxAllowedHits = cms.uint32( 50 ), nUnSharedHitsMin = cms.int32( 2 ), @@ -42235,7 +42243,9 @@ useUncertDB = cms.bool( True ), doVdriftCorr = cms.bool( True ), minTime = cms.double( -3.0 ), - tTrigMode = cms.string( "DTTTrigSyncFromDB" ) + tTrigMode = cms.string( "DTTTrigSyncFromDB" ), + readLegacyTTrigDB = cms.bool( True ), + readLegacyVDriftDB = cms.bool( True ) ), nUnSharedHitsMin = cms.int32( 2 ), nSharedHitsMax = cms.int32( 2 ), diff --git a/HLTrigger/Configuration/python/HLT_HIon_cff.py b/HLTrigger/Configuration/python/HLT_HIon_cff.py index df69c66724c8a..c6b5dd6ee6e3c 100644 --- a/HLTrigger/Configuration/python/HLT_HIon_cff.py +++ b/HLTrigger/Configuration/python/HLT_HIon_cff.py @@ -1,13 +1,13 @@ -# hltGetConfiguration --cff --data /dev/CMSSW_12_0_0/HIon --type HIon +# hltGetConfiguration --cff --data /dev/CMSSW_12_1_0/HIon --type HIon -# /dev/CMSSW_12_0_0/HIon/V5 (CMSSW_12_0_0_pre5) +# /dev/CMSSW_12_1_0/HIon/V1 (CMSSW_12_1_0_pre2) import FWCore.ParameterSet.Config as cms fragment = cms.ProcessFragment( "HLT" ) fragment.HLTConfigVersion = cms.PSet( - tableName = cms.string('/dev/CMSSW_12_0_0/HIon/V5') + tableName = cms.string('/dev/CMSSW_12_1_0/HIon/V1') ) fragment.transferSystem = cms.PSet( @@ -6374,7 +6374,9 @@ useUncertDB = cms.bool( True ), doVdriftCorr = cms.bool( True ), minTime = cms.double( -3.0 ), - tTrigMode = cms.string( "DTTTrigSyncFromDB" ) + tTrigMode = cms.string( "DTTTrigSyncFromDB" ), + readLegacyTTrigDB = cms.bool( True ), + readLegacyVDriftDB = cms.bool( True ) ), recAlgo = cms.string( "DTLinearDriftFromDBAlgo" ), debug = cms.untracked.bool( False ), @@ -6409,7 +6411,9 @@ useUncertDB = cms.bool( True ), doVdriftCorr = cms.bool( True ), minTime = cms.double( -3.0 ), - tTrigMode = cms.string( "DTTTrigSyncFromDB" ) + tTrigMode = cms.string( "DTTTrigSyncFromDB" ), + readLegacyTTrigDB = cms.bool( True ), + readLegacyVDriftDB = cms.bool( True ) ), MaxAllowedHits = cms.uint32( 50 ), nUnSharedHitsMin = cms.int32( 2 ), @@ -6442,7 +6446,9 @@ useUncertDB = cms.bool( True ), doVdriftCorr = cms.bool( True ), minTime = cms.double( -3.0 ), - tTrigMode = cms.string( "DTTTrigSyncFromDB" ) + tTrigMode = cms.string( "DTTTrigSyncFromDB" ), + readLegacyTTrigDB = cms.bool( True ), + readLegacyVDriftDB = cms.bool( True ) ), nUnSharedHitsMin = cms.int32( 2 ), nSharedHitsMax = cms.int32( 2 ), diff --git a/HLTrigger/Configuration/python/HLT_PIon_cff.py b/HLTrigger/Configuration/python/HLT_PIon_cff.py index e0fd7e44c150e..bef79e419742d 100644 --- a/HLTrigger/Configuration/python/HLT_PIon_cff.py +++ b/HLTrigger/Configuration/python/HLT_PIon_cff.py @@ -1,13 +1,13 @@ -# hltGetConfiguration --cff --data /dev/CMSSW_12_0_0/PIon --type PIon +# hltGetConfiguration --cff --data /dev/CMSSW_12_1_0/PIon --type PIon -# /dev/CMSSW_12_0_0/PIon/V5 (CMSSW_12_0_0_pre5) +# /dev/CMSSW_12_1_0/PIon/V1 (CMSSW_12_1_0_pre2) import FWCore.ParameterSet.Config as cms fragment = cms.ProcessFragment( "HLT" ) fragment.HLTConfigVersion = cms.PSet( - tableName = cms.string('/dev/CMSSW_12_0_0/PIon/V5') + tableName = cms.string('/dev/CMSSW_12_1_0/PIon/V1') ) fragment.transferSystem = cms.PSet( diff --git a/HLTrigger/Configuration/python/HLT_PRef_cff.py b/HLTrigger/Configuration/python/HLT_PRef_cff.py index cc28b493c22d3..4fdb372019b0a 100644 --- a/HLTrigger/Configuration/python/HLT_PRef_cff.py +++ b/HLTrigger/Configuration/python/HLT_PRef_cff.py @@ -1,13 +1,13 @@ -# hltGetConfiguration --cff --data /dev/CMSSW_12_0_0/PRef --type PRef +# hltGetConfiguration --cff --data /dev/CMSSW_12_1_0/PRef --type PRef -# /dev/CMSSW_12_0_0/PRef/V5 (CMSSW_12_0_0_pre5) +# /dev/CMSSW_12_1_0/PRef/V1 (CMSSW_12_1_0_pre2) import FWCore.ParameterSet.Config as cms fragment = cms.ProcessFragment( "HLT" ) fragment.HLTConfigVersion = cms.PSet( - tableName = cms.string('/dev/CMSSW_12_0_0/PRef/V5') + tableName = cms.string('/dev/CMSSW_12_1_0/PRef/V1') ) fragment.transferSystem = cms.PSet( @@ -6092,7 +6092,9 @@ useUncertDB = cms.bool( True ), doVdriftCorr = cms.bool( True ), minTime = cms.double( -3.0 ), - tTrigMode = cms.string( "DTTTrigSyncFromDB" ) + tTrigMode = cms.string( "DTTTrigSyncFromDB" ), + readLegacyTTrigDB = cms.bool( True ), + readLegacyVDriftDB = cms.bool( True ) ), recAlgo = cms.string( "DTLinearDriftFromDBAlgo" ), debug = cms.untracked.bool( False ), @@ -6127,7 +6129,9 @@ useUncertDB = cms.bool( True ), doVdriftCorr = cms.bool( True ), minTime = cms.double( -3.0 ), - tTrigMode = cms.string( "DTTTrigSyncFromDB" ) + tTrigMode = cms.string( "DTTTrigSyncFromDB" ), + readLegacyTTrigDB = cms.bool( True ), + readLegacyVDriftDB = cms.bool( True ) ), MaxAllowedHits = cms.uint32( 50 ), nUnSharedHitsMin = cms.int32( 2 ), @@ -6160,7 +6164,9 @@ useUncertDB = cms.bool( True ), doVdriftCorr = cms.bool( True ), minTime = cms.double( -3.0 ), - tTrigMode = cms.string( "DTTTrigSyncFromDB" ) + tTrigMode = cms.string( "DTTTrigSyncFromDB" ), + readLegacyTTrigDB = cms.bool( True ), + readLegacyVDriftDB = cms.bool( True ) ), nUnSharedHitsMin = cms.int32( 2 ), nSharedHitsMax = cms.int32( 2 ), diff --git a/HLTrigger/Configuration/python/HLTrigger_Datasets_GRun_cff.py b/HLTrigger/Configuration/python/HLTrigger_Datasets_GRun_cff.py index 2a3014456bf92..7776918bce6e6 100644 --- a/HLTrigger/Configuration/python/HLTrigger_Datasets_GRun_cff.py +++ b/HLTrigger/Configuration/python/HLTrigger_Datasets_GRun_cff.py @@ -1,4 +1,4 @@ -# /dev/CMSSW_12_0_0/GRun +# /dev/CMSSW_12_1_0/GRun import FWCore.ParameterSet.Config as cms diff --git a/HLTrigger/Configuration/python/HLTrigger_Datasets_HIon_cff.py b/HLTrigger/Configuration/python/HLTrigger_Datasets_HIon_cff.py index d32b5a2c63310..b5e5eb442cd73 100644 --- a/HLTrigger/Configuration/python/HLTrigger_Datasets_HIon_cff.py +++ b/HLTrigger/Configuration/python/HLTrigger_Datasets_HIon_cff.py @@ -1,4 +1,4 @@ -# /dev/CMSSW_12_0_0/HIon +# /dev/CMSSW_12_1_0/HIon import FWCore.ParameterSet.Config as cms diff --git a/HLTrigger/Configuration/python/HLTrigger_Datasets_PIon_cff.py b/HLTrigger/Configuration/python/HLTrigger_Datasets_PIon_cff.py index d9f1def779f35..6bee3e95ed259 100644 --- a/HLTrigger/Configuration/python/HLTrigger_Datasets_PIon_cff.py +++ b/HLTrigger/Configuration/python/HLTrigger_Datasets_PIon_cff.py @@ -1,4 +1,4 @@ -# /dev/CMSSW_12_0_0/PIon +# /dev/CMSSW_12_1_0/PIon import FWCore.ParameterSet.Config as cms diff --git a/HLTrigger/Configuration/python/HLTrigger_Datasets_PRef_cff.py b/HLTrigger/Configuration/python/HLTrigger_Datasets_PRef_cff.py index da4a12b0ee026..fd219e6504c17 100644 --- a/HLTrigger/Configuration/python/HLTrigger_Datasets_PRef_cff.py +++ b/HLTrigger/Configuration/python/HLTrigger_Datasets_PRef_cff.py @@ -1,4 +1,4 @@ -# /dev/CMSSW_12_0_0/PRef +# /dev/CMSSW_12_1_0/PRef import FWCore.ParameterSet.Config as cms diff --git a/HLTrigger/Configuration/python/Tools/confdb.py b/HLTrigger/Configuration/python/Tools/confdb.py index bec45a86a9ba3..7d3c08bc70c1f 100644 --- a/HLTrigger/Configuration/python/Tools/confdb.py +++ b/HLTrigger/Configuration/python/Tools/confdb.py @@ -77,7 +77,8 @@ def getSetupConfigurationFromDB(self): sys.stderr.write(err + "\n\n") sys.exit(1) self.config.setupFile = "setup_"+self.config.setup[1:].replace("/","_")+"_cff" - file(self.config.setupFile+".py","w+").write("# This file is automatically generated by hltGetConfiguration.\n" + data) + outfile = open(self.config.setupFile+".py","w+") + outfile.write("# This file is automatically generated by hltGetConfiguration.\n" + data) def getRawConfigurationFromDB(self): if self.config.menu.run: diff --git a/HLTrigger/Configuration/python/customizeHLTforCMSSW.py b/HLTrigger/Configuration/python/customizeHLTforCMSSW.py index 104df35b34944..4eb68a68084f9 100644 --- a/HLTrigger/Configuration/python/customizeHLTforCMSSW.py +++ b/HLTrigger/Configuration/python/customizeHLTforCMSSW.py @@ -1,5 +1,8 @@ import FWCore.ParameterSet.Config as cms +# modifiers +from Configuration.ProcessModifiers.gpu_cff import gpu + # helper fuctions from HLTrigger.Configuration.common import * @@ -17,7 +20,6 @@ # pset.minGoodStripCharge = cms.PSet(refToPSet_ = cms.string('HLTSiStripClusterChargeCutNone')) # return process - def customiseHCALFor2018Input(process): """Customise the HLT to run on Run 2 data/MC using the old readout for the HCAL barel""" @@ -130,10 +132,30 @@ def customiseFor2018Input(process): return process +def customiseFor35315(process): + """Update the HLT configuration for the changes in #35315""" + for module in filters_by_type(process, "HLTHcalCalibTypeFilter"): + if hasattr(module, "FilterSummary"): + delattr(module, "FilterSummary") + + return process + +# MultipleScatteringParametrisationMakerESProducer +def customiseFor35269(process): + process.load("RecoTracker.TkMSParametrization.multipleScatteringParametrisationMakerESProducer_cfi") + return process + # CMSSW version specific customizations def customizeHLTforCMSSW(process, menuType="GRun"): + # if the gpu modifier is enabled, make the Pixel, ECAL and HCAL reconstruction offloadable to a GPU + from HLTrigger.Configuration.customizeHLTforPatatrack import customizeHLTforPatatrack + gpu.makeProcessModifier(customizeHLTforPatatrack).apply(process) + # add call to action function in proper order: newest last! # process = customiseFor12718(process) + process = customiseFor35315(process) + process = customiseFor35269(process) + return process diff --git a/HLTrigger/Configuration/python/customizeHLTforPatatrack.py b/HLTrigger/Configuration/python/customizeHLTforPatatrack.py new file mode 100644 index 0000000000000..b119a7742f1bb --- /dev/null +++ b/HLTrigger/Configuration/python/customizeHLTforPatatrack.py @@ -0,0 +1,767 @@ +import copy +import FWCore.ParameterSet.Config as cms +from HeterogeneousCore.CUDACore.SwitchProducerCUDA import SwitchProducerCUDA +from HLTrigger.Configuration.common import * +from Configuration.Eras.Modifier_run3_common_cff import run3_common + + +# force the SwitchProducerCUDA choice to pick a specific backend: True for offloading to a gpu, False for running on cpu +def forceGpuOffload(status = True): + import HeterogeneousCore.CUDACore.SwitchProducerCUDA + HeterogeneousCore.CUDACore.SwitchProducerCUDA._cuda_enabled_cached = bool(status) + + +# reset the SwitchProducerCUDA choice to pick a backend depending on the availability of a supported gpu +def resetGpuOffload(): + import HeterogeneousCore.CUDACore.SwitchProducerCUDA + HeterogeneousCore.CUDACore.SwitchProducerCUDA._cuda_enabled_cached = None + HeterogeneousCore.CUDACore.SwitchProducerCUDA._switch_cuda() + + +# customisation for running the Patatrack reconstruction, common parts +def customiseCommon(process): + + # Services + + process.load("HeterogeneousCore.CUDAServices.CUDAService_cfi") + if 'MessageLogger' in process.__dict__: + process.MessageLogger.CUDAService = cms.untracked.PSet() + + # NVProfilerService is broken in CMSSW 12.0.x and later + #process.load("HeterogeneousCore.CUDAServices.NVProfilerService_cfi") + + + # Paths and EndPaths + + # the hltGetConditions module would force gpu-specific ESProducers to run even if no supported gpu is present + if 'hltGetConditions' in process.__dict__: + del process.hltGetConditions + + # produce a boolean to track if the events ar being processed on gpu (true) or cpu (false) + process.statusOnGPU = SwitchProducerCUDA( + cpu = cms.EDProducer("BooleanProducer", value = cms.bool(False)), + cuda = cms.EDProducer("BooleanProducer", value = cms.bool(True)) + ) + + process.statusOnGPUFilter = cms.EDFilter("BooleanFilter", + src = cms.InputTag("statusOnGPU") + ) + + if 'Status_OnCPU' in process.__dict__: + replace_with(process.Status_OnCPU, cms.Path(process.statusOnGPU + ~process.statusOnGPUFilter)) + else: + process.Status_OnCPU = cms.Path(process.statusOnGPU + ~process.statusOnGPUFilter) + if 'HLTSchedule' in process.__dict__: + process.HLTSchedule.append(process.Status_OnCPU) + if process.schedule is not None: + process.schedule.append(process.Status_OnCPU) + + if 'Status_OnGPU' in process.__dict__: + replace_with(process.Status_OnGPU, cms.Path(process.statusOnGPU + process.statusOnGPUFilter)) + else: + process.Status_OnGPU = cms.Path(process.statusOnGPU + process.statusOnGPUFilter) + if 'HLTSchedule' in process.__dict__: + process.HLTSchedule.append(process.Status_OnGPU) + if process.schedule is not None: + process.schedule.append(process.Status_OnGPU) + + + # make the ScoutingCaloMuonOutput endpath compatible with using Tasks in the Scouting paths + if 'hltOutputScoutingCaloMuon' in process.__dict__ and not 'hltPreScoutingCaloMuonOutputSmart' in process.__dict__: + process.hltPreScoutingCaloMuonOutputSmart = cms.EDFilter( "TriggerResultsFilter", + l1tIgnoreMaskAndPrescale = cms.bool( False ), + l1tResults = cms.InputTag( "" ), + hltResults = cms.InputTag( 'TriggerResults','','@currentProcess' ), + triggerConditions = process.hltOutputScoutingCaloMuon.SelectEvents.SelectEvents, + throw = cms.bool( True ) + ) + insert_modules_after(process, process.hltPreScoutingCaloMuonOutput, process.hltPreScoutingCaloMuonOutputSmart) + + # make the ScoutingPFOutput endpath compatible with using Tasks in the Scouting paths + if 'hltOutputScoutingPF' in process.__dict__ and not 'hltPreScoutingPFOutputSmart' in process.__dict__: + process.hltPreScoutingPFOutputSmart = cms.EDFilter( "TriggerResultsFilter", + l1tIgnoreMaskAndPrescale = cms.bool( False ), + l1tResults = cms.InputTag( "" ), + hltResults = cms.InputTag( 'TriggerResults','','@currentProcess' ), + triggerConditions = process.hltOutputScoutingPF.SelectEvents.SelectEvents, + throw = cms.bool( True ) + ) + insert_modules_after(process, process.hltPreScoutingPFOutput, process.hltPreScoutingPFOutputSmart) + + + # done + return process + + +# customisation for running the "Patatrack" pixel local reconstruction +def customisePixelLocalReconstruction(process): + + if not 'HLTDoLocalPixelSequence' in process.__dict__: + return process + + # FIXME replace the Sequences with empty ones to avoid expanding them during the (re)definition of Modules and EDAliases + + process.HLTDoLocalPixelSequence = cms.Sequence() + + + # Event Setup + + process.load("CalibTracker.SiPixelESProducers.siPixelGainCalibrationForHLTGPU_cfi") # this should be used only on GPUs, will crash otherwise + process.load("CalibTracker.SiPixelESProducers.siPixelROCsStatusAndMappingWrapperESProducer_cfi") # this should be used only on GPUs, will crash otherwise + process.load("RecoLocalTracker.SiPixelRecHits.PixelCPEFastESProducer_cfi") + + + # Modules and EDAliases + + # referenced in HLTDoLocalPixelTask + + # transfer the beamspot to the gpu + from RecoVertex.BeamSpotProducer.offlineBeamSpotToCUDA_cfi import offlineBeamSpotToCUDA as _offlineBeamSpotToCUDA + process.hltOnlineBeamSpotToCUDA = _offlineBeamSpotToCUDA.clone( + src = "hltOnlineBeamSpot" + ) + + # reconstruct the pixel digis and clusters on the gpu + from RecoLocalTracker.SiPixelClusterizer.siPixelRawToClusterCUDA_cfi import siPixelRawToClusterCUDA as _siPixelRawToClusterCUDA + process.hltSiPixelClustersCUDA = _siPixelRawToClusterCUDA.clone() + # use the pixel channel calibrations scheme for Run 3 + run3_common.toModify(process.hltSiPixelClustersCUDA, isRun2 = False) + + # copy the pixel digis errors to the host + from EventFilter.SiPixelRawToDigi.siPixelDigiErrorsSoAFromCUDA_cfi import siPixelDigiErrorsSoAFromCUDA as _siPixelDigiErrorsSoAFromCUDA + process.hltSiPixelDigiErrorsSoA = _siPixelDigiErrorsSoAFromCUDA.clone( + src = "hltSiPixelClustersCUDA" + ) + + # copy the pixel digis (except errors) and clusters to the host + from EventFilter.SiPixelRawToDigi.siPixelDigisSoAFromCUDA_cfi import siPixelDigisSoAFromCUDA as _siPixelDigisSoAFromCUDA + process.hltSiPixelDigisSoA = _siPixelDigisSoAFromCUDA.clone( + src = "hltSiPixelClustersCUDA" + ) + + # reconstruct the pixel digis on the cpu + process.hltSiPixelDigisLegacy = process.hltSiPixelDigis.clone() + + # SwitchProducer wrapping a subset of the legacy pixel digis producer, or the conversion of the pixel digis errors to the legacy format + from EventFilter.SiPixelRawToDigi.siPixelDigiErrorsFromSoA_cfi import siPixelDigiErrorsFromSoA as _siPixelDigiErrorsFromSoA + process.hltSiPixelDigis = SwitchProducerCUDA( + # legacy producer + cpu = cms.EDAlias( + hltSiPixelDigisLegacy = cms.VPSet( + cms.PSet(type = cms.string("DetIdedmEDCollection")), + cms.PSet(type = cms.string("SiPixelRawDataErroredmDetSetVector")), + cms.PSet(type = cms.string("PixelFEDChanneledmNewDetSetVector")) + ) + ), + # conversion from SoA to legacy format + cuda = _siPixelDigiErrorsFromSoA.clone( + digiErrorSoASrc = "hltSiPixelDigiErrorsSoA", + UsePhase1 = True + ) + ) + + # reconstruct the pixel clusters on the cpu + process.hltSiPixelClustersLegacy = process.hltSiPixelClusters.clone() + + # SwitchProducer wrapping a subset of the legacy pixel cluster producer, or the conversion of the pixel digis (except errors) and clusters to the legacy format + from RecoLocalTracker.SiPixelClusterizer.siPixelDigisClustersFromSoA_cfi import siPixelDigisClustersFromSoA as _siPixelDigisClustersFromSoA + process.hltSiPixelClusters = SwitchProducerCUDA( + # legacy producer + cpu = cms.EDAlias( + hltSiPixelClustersLegacy = cms.VPSet( + cms.PSet(type = cms.string("SiPixelClusteredmNewDetSetVector")) + ) + ), + # conversion from SoA to legacy format + cuda = _siPixelDigisClustersFromSoA.clone( + src = "hltSiPixelDigisSoA", + produceDigis = False, + storeDigis = False, + ) + ) + + # reconstruct the pixel rechits on the gpu + from RecoLocalTracker.SiPixelRecHits.siPixelRecHitCUDA_cfi import siPixelRecHitCUDA as _siPixelRecHitCUDA + process.hltSiPixelRecHitsCUDA = _siPixelRecHitCUDA.clone( + src = "hltSiPixelClustersCUDA", + beamSpot = "hltOnlineBeamSpotToCUDA" + ) + + # SwitchProducer wrapping the legacy pixel rechit producer or the transfer of the pixel rechits to the host and the conversion from SoA + from RecoLocalTracker.SiPixelRecHits.siPixelRecHitFromCUDA_cfi import siPixelRecHitFromCUDA as _siPixelRecHitFromCUDA + process.hltSiPixelRecHits = SwitchProducerCUDA( + # legacy producer + cpu = process.hltSiPixelRecHits, + # conversion from SoA to legacy format + cuda = _siPixelRecHitFromCUDA.clone( + pixelRecHitSrc = "hltSiPixelRecHitsCUDA", + src = "hltSiPixelClusters" + ) + ) + + + # Tasks and Sequences + + process.HLTDoLocalPixelTask = cms.Task( + process.hltOnlineBeamSpotToCUDA, # transfer the beamspot to the gpu + process.hltSiPixelClustersCUDA, # reconstruct the pixel digis and clusters on the gpu + process.hltSiPixelRecHitsCUDA, # reconstruct the pixel rechits on the gpu + process.hltSiPixelDigisSoA, # copy the pixel digis (except errors) and clusters to the host + process.hltSiPixelDigiErrorsSoA, # copy the pixel digis errors to the host + process.hltSiPixelDigisLegacy, # legacy pixel digis producer + process.hltSiPixelDigis, # SwitchProducer wrapping a subset of the legacy pixel digis producer, or the conversion of the pixel digis errors from SoA + process.hltSiPixelClustersLegacy, # legacy pixel cluster producer + process.hltSiPixelClusters, # SwitchProducer wrapping a subset of the legacy pixel cluster producer, or the conversion of the pixel digis (except errors) and clusters from SoA + process.hltSiPixelClustersCache, # legacy module, used by the legacy pixel quadruplet producer + process.hltSiPixelRecHits) # SwitchProducer wrapping the legacy pixel rechit producer or the transfer of the pixel rechits to the host and the conversion from SoA + + process.HLTDoLocalPixelSequence = cms.Sequence(process.HLTDoLocalPixelTask) + + + # done + return process + + +# customisation for running the "Patatrack" pixel track reconstruction +def customisePixelTrackReconstruction(process): + + if not 'HLTRecoPixelTracksSequence' in process.__dict__: + return process + + hasHLTPixelVertexReco = 'HLTRecopixelvertexingSequence' in process.__dict__ + + # FIXME replace the Sequences with empty ones to avoid expanding them during the (re)definition of Modules and EDAliases + + process.HLTRecoPixelTracksSequence = cms.Sequence() + if hasHLTPixelVertexReco: + process.HLTRecopixelvertexingSequence = cms.Sequence() + + + # Modules and EDAliases + + # referenced in process.HLTRecoPixelTracksTask + + # cpu only: convert the pixel rechits from legacy to SoA format + from RecoLocalTracker.SiPixelRecHits.siPixelRecHitSoAFromLegacy_cfi import siPixelRecHitSoAFromLegacy as _siPixelRecHitSoAFromLegacy + process.hltSiPixelRecHitSoA = _siPixelRecHitSoAFromLegacy.clone( + src = "hltSiPixelClusters", + beamSpot = "hltOnlineBeamSpot", + convertToLegacy = True + ) + + # build pixel ntuplets and pixel tracks in SoA format on gpu + from RecoPixelVertexing.PixelTriplets.pixelTracksCUDA_cfi import pixelTracksCUDA as _pixelTracksCUDA + process.hltPixelTracksCUDA = _pixelTracksCUDA.clone( + idealConditions = False, + pixelRecHitSrc = "hltSiPixelRecHitsCUDA", + onGPU = True + ) + # use quality cuts tuned for Run 2 ideal conditions for all Run 3 workflows + run3_common.toModify(process.hltPixelTracksCUDA, idealConditions = True) + + # SwitchProducer providing the pixel tracks in SoA format on cpu + from RecoPixelVertexing.PixelTrackFitting.pixelTracksSoA_cfi import pixelTracksSoA as _pixelTracksSoA + process.hltPixelTracksSoA = SwitchProducerCUDA( + # build pixel ntuplets and pixel tracks in SoA format on cpu + cpu = _pixelTracksCUDA.clone( + idealConditions = False, + pixelRecHitSrc = "hltSiPixelRecHitSoA", + onGPU = False + ), + # transfer the pixel tracks in SoA format to the host + cuda = _pixelTracksSoA.clone( + src = "hltPixelTracksCUDA" + ) + ) + # use quality cuts tuned for Run 2 ideal conditions for all Run 3 workflows + run3_common.toModify(process.hltPixelTracksSoA.cpu, idealConditions = True) + + # convert the pixel tracks from SoA to legacy format + from RecoPixelVertexing.PixelTrackFitting.pixelTrackProducerFromSoA_cfi import pixelTrackProducerFromSoA as _pixelTrackProducerFromSoA + process.hltPixelTracks = _pixelTrackProducerFromSoA.clone( + beamSpot = "hltOnlineBeamSpot", + pixelRecHitLegacySrc = "hltSiPixelRecHits", + trackSrc = "hltPixelTracksSoA" + ) + + + # referenced in process.HLTRecopixelvertexingTask + if hasHLTPixelVertexReco: + + # build pixel vertices in SoA format on gpu + from RecoPixelVertexing.PixelVertexFinding.pixelVerticesCUDA_cfi import pixelVerticesCUDA as _pixelVerticesCUDA + process.hltPixelVerticesCUDA = _pixelVerticesCUDA.clone( + pixelTrackSrc = "hltPixelTracksCUDA", + onGPU = True + ) + + # build or transfer pixel vertices in SoA format on cpu + from RecoPixelVertexing.PixelVertexFinding.pixelVerticesSoA_cfi import pixelVerticesSoA as _pixelVerticesSoA + process.hltPixelVerticesSoA = SwitchProducerCUDA( + # build pixel vertices in SoA format on cpu + cpu = _pixelVerticesCUDA.clone( + pixelTrackSrc = "hltPixelTracksSoA", + onGPU = False + ), + # transfer the pixel vertices in SoA format to cpu + cuda = _pixelVerticesSoA.clone( + src = "hltPixelVerticesCUDA" + ) + ) + + # convert the pixel vertices from SoA to legacy format + from RecoPixelVertexing.PixelVertexFinding.pixelVertexFromSoA_cfi import pixelVertexFromSoA as _pixelVertexFromSoA + process.hltPixelVertices = _pixelVertexFromSoA.clone( + src = "hltPixelVerticesSoA", + TrackCollection = "hltPixelTracks", + beamSpot = "hltOnlineBeamSpot" + ) + + + # Tasks and Sequences + + process.HLTRecoPixelTracksTask = cms.Task( + process.hltPixelTracksTrackingRegions, # from the original sequence + process.hltSiPixelRecHitSoA, # pixel rechits on cpu, converted to SoA + process.hltPixelTracksCUDA, # pixel ntuplets on gpu, in SoA format + process.hltPixelTracksSoA, # pixel ntuplets on cpu, in SoA format + process.hltPixelTracks) # pixel tracks on cpu, in legacy format + + + process.HLTRecoPixelTracksSequence = cms.Sequence(process.HLTRecoPixelTracksTask) + + if hasHLTPixelVertexReco: + process.HLTRecopixelvertexingTask = cms.Task( + process.HLTRecoPixelTracksTask, + process.hltPixelVerticesCUDA, # pixel vertices on gpu, in SoA format + process.hltPixelVerticesSoA, # pixel vertices on cpu, in SoA format + process.hltPixelVertices, # pixel vertices on cpu, in legacy format + process.hltTrimmedPixelVertices) # from the original sequence + + process.HLTRecopixelvertexingSequence = cms.Sequence( + process.hltPixelTracksFitter + # not used here, kept for compatibility with legacy sequences + process.hltPixelTracksFilter, # not used here, kept for compatibility with legacy sequences + process.HLTRecopixelvertexingTask) + + + # done + return process + + +# customisation for offloading the ECAL local reconstruction via CUDA if a supported gpu is present +def customiseEcalLocalReconstruction(process): + + hasHLTEcalPreshowerSeq = any(seq in process.__dict__ for seq in ['HLTDoFullUnpackingEgammaEcalMFSequence', 'HLTDoFullUnpackingEgammaEcalSequence']) + if not (hasHLTEcalPreshowerSeq or 'HLTDoFullUnpackingEgammaEcalWithoutPreshowerSequence' in process.__dict__): + return process + + # FIXME replace the Sequences with empty ones to avoid expanding them during the (re)definition of Modules and EDAliases + + process.HLTDoFullUnpackingEgammaEcalWithoutPreshowerSequence = cms.Sequence() + if hasHLTEcalPreshowerSeq: + process.HLTDoFullUnpackingEgammaEcalMFSequence = cms.Sequence() + process.HLTDoFullUnpackingEgammaEcalSequence = cms.Sequence() + + + # Event Setup + + process.load("EventFilter.EcalRawToDigi.ecalElectronicsMappingGPUESProducer_cfi") + process.load("RecoLocalCalo.EcalRecProducers.ecalGainRatiosGPUESProducer_cfi") + process.load("RecoLocalCalo.EcalRecProducers.ecalPedestalsGPUESProducer_cfi") + process.load("RecoLocalCalo.EcalRecProducers.ecalPulseCovariancesGPUESProducer_cfi") + process.load("RecoLocalCalo.EcalRecProducers.ecalPulseShapesGPUESProducer_cfi") + process.load("RecoLocalCalo.EcalRecProducers.ecalSamplesCorrelationGPUESProducer_cfi") + process.load("RecoLocalCalo.EcalRecProducers.ecalTimeBiasCorrectionsGPUESProducer_cfi") + process.load("RecoLocalCalo.EcalRecProducers.ecalTimeCalibConstantsGPUESProducer_cfi") + process.load("RecoLocalCalo.EcalRecProducers.ecalMultifitParametersGPUESProducer_cfi") + + process.load("RecoLocalCalo.EcalRecProducers.ecalRechitADCToGeVConstantGPUESProducer_cfi") + process.load("RecoLocalCalo.EcalRecProducers.ecalRechitChannelStatusGPUESProducer_cfi") + process.load("RecoLocalCalo.EcalRecProducers.ecalIntercalibConstantsGPUESProducer_cfi") + process.load("RecoLocalCalo.EcalRecProducers.ecalLaserAPDPNRatiosGPUESProducer_cfi") + process.load("RecoLocalCalo.EcalRecProducers.ecalLaserAPDPNRatiosRefGPUESProducer_cfi") + process.load("RecoLocalCalo.EcalRecProducers.ecalLaserAlphasGPUESProducer_cfi") + process.load("RecoLocalCalo.EcalRecProducers.ecalLinearCorrectionsGPUESProducer_cfi") + process.load("RecoLocalCalo.EcalRecProducers.ecalRecHitParametersGPUESProducer_cfi") + + + # Modules and EDAliases + + # ECAL unpacker running on gpu + from EventFilter.EcalRawToDigi.ecalRawToDigiGPU_cfi import ecalRawToDigiGPU as _ecalRawToDigiGPU + process.hltEcalDigisGPU = _ecalRawToDigiGPU.clone() + + # SwitchProducer wrapping the legacy ECAL unpacker or the ECAL digi converter from SoA format on gpu to legacy format on cpu + process.hltEcalDigisLegacy = process.hltEcalDigis.clone() + from EventFilter.EcalRawToDigi.ecalCPUDigisProducer_cfi import ecalCPUDigisProducer as _ecalCPUDigisProducer + + process.hltEcalDigis = SwitchProducerCUDA( + # legacy producer + cpu = cms.EDAlias( + hltEcalDigisLegacy = cms.VPSet( + cms.PSet(type = cms.string("EBDigiCollection")), + cms.PSet(type = cms.string("EEDigiCollection")), + cms.PSet(type = cms.string("EBDetIdedmEDCollection")), + cms.PSet(type = cms.string("EEDetIdedmEDCollection")), + cms.PSet(type = cms.string("EBSrFlagsSorted")), + cms.PSet(type = cms.string("EESrFlagsSorted")), + cms.PSet(type = cms.string("EcalElectronicsIdedmEDCollection"), fromProductInstance = cms.string("EcalIntegrityBlockSizeErrors")), + cms.PSet(type = cms.string("EcalElectronicsIdedmEDCollection"), fromProductInstance = cms.string("EcalIntegrityTTIdErrors")), + cms.PSet(type = cms.string("EcalElectronicsIdedmEDCollection"), fromProductInstance = cms.string("EcalIntegrityZSXtalIdErrors")), + cms.PSet(type = cms.string("EcalPnDiodeDigisSorted")), + cms.PSet(type = cms.string("EcalPseudoStripInputDigisSorted"), fromProductInstance = cms.string("EcalPseudoStripInputs")), + cms.PSet(type = cms.string("EcalTriggerPrimitiveDigisSorted"), fromProductInstance = cms.string("EcalTriggerPrimitives")), + ) + ), + # convert ECAL digis from SoA format on gpu to legacy format on cpu + cuda = _ecalCPUDigisProducer.clone( + digisInLabelEB = ("hltEcalDigisGPU", "ebDigis"), + digisInLabelEE = ("hltEcalDigisGPU", "eeDigis"), + produceDummyIntegrityCollections = cms.bool(True) + ) + ) + + # ECAL multifit running on gpu + from RecoLocalCalo.EcalRecProducers.ecalUncalibRecHitProducerGPU_cfi import ecalUncalibRecHitProducerGPU as _ecalUncalibRecHitProducerGPU + process.hltEcalUncalibRecHitGPU = _ecalUncalibRecHitProducerGPU.clone( + digisLabelEB = ("hltEcalDigisGPU", "ebDigis"), + digisLabelEE = ("hltEcalDigisGPU", "eeDigis"), + shouldRunTimingComputation = False + ) + + # copy the ECAL uncalibrated rechits from gpu to cpu in SoA format + from RecoLocalCalo.EcalRecProducers.ecalCPUUncalibRecHitProducer_cfi import ecalCPUUncalibRecHitProducer as _ecalCPUUncalibRecHitProducer + process.hltEcalUncalibRecHitSoA = _ecalCPUUncalibRecHitProducer.clone( + recHitsInLabelEB = ("hltEcalUncalibRecHitGPU", "EcalUncalibRecHitsEB"), + recHitsInLabelEE = ("hltEcalUncalibRecHitGPU", "EcalUncalibRecHitsEE"), + ) + + # SwitchProducer wrapping the legacy ECAL uncalibrated rechits producer or a converter from SoA to legacy format + from RecoLocalCalo.EcalRecProducers.ecalUncalibRecHitConvertGPU2CPUFormat_cfi import ecalUncalibRecHitConvertGPU2CPUFormat as _ecalUncalibRecHitConvertGPU2CPUFormat + process.hltEcalUncalibRecHit = SwitchProducerCUDA( + # legacy producer + cpu = process.hltEcalUncalibRecHit, + # convert the ECAL uncalibrated rechits from SoA to legacy format + cuda = _ecalUncalibRecHitConvertGPU2CPUFormat.clone( + recHitsLabelGPUEB = ("hltEcalUncalibRecHitSoA", "EcalUncalibRecHitsEB"), + recHitsLabelGPUEE = ("hltEcalUncalibRecHitSoA", "EcalUncalibRecHitsEE"), + ) + ) + + # Reconstructing the ECAL calibrated rechits on gpu works, but is extremely slow. + # Disable it for the time being, until the performance has been addressed. + """ + from RecoLocalCalo.EcalRecProducers.ecalRecHitGPU_cfi import ecalRecHitGPU as _ecalRecHitGPU + process.hltEcalRecHitGPU = _ecalRecHitGPU.clone( + uncalibrecHitsInLabelEB = ("hltEcalUncalibRecHitGPU","EcalUncalibRecHitsEB"), + uncalibrecHitsInLabelEE = ("hltEcalUncalibRecHitGPU","EcalUncalibRecHitsEE"), + ) + + from RecoLocalCalo.EcalRecProducers.ecalCPURecHitProducer_cfi import ecalCPURecHitProducer as _ecalCPURecHitProducer + process.hltEcalRecHitSoA = _ecalCPURecHitProducer.clone( + recHitsInLabelEB = ("hltEcalRecHitGPU", "EcalRecHitsEB"), + recHitsInLabelEE = ("hltEcalRecHitGPU", "EcalRecHitsEE"), + ) + + # SwitchProducer wrapping the legacy ECAL calibrated rechits producer or a converter from SoA to legacy format + from RecoLocalCalo.EcalRecProducers.ecalRecHitConvertGPU2CPUFormat_cfi import ecalRecHitConvertGPU2CPUFormat as _ecalRecHitConvertGPU2CPUFormat + process.hltEcalRecHit = SwitchProducerCUDA( + # legacy producer + cpu = process.hltEcalRecHit, + # convert the ECAL calibrated rechits from SoA to legacy format + cuda = _ecalRecHitConvertGPU2CPUFormat.clone( + recHitsLabelGPUEB = ("hltEcalRecHitSoA", "EcalRecHitsEB"), + recHitsLabelGPUEE = ("hltEcalRecHitSoA", "EcalRecHitsEE"), + ) + ) + """ + + # SwitchProducer wrapping the legacy ECAL rechits producer + # the gpu unpacker does not produce the TPs used for the recovery, so the SwitchProducer alias does not provide them: + # - the cpu uncalibrated rechit producer may mark them for recovery, read the TPs explicitly from the legacy unpacker + # - the gpu uncalibrated rechit producer does not flag them for recovery, so the TPs are not necessary + process.hltEcalRecHit = SwitchProducerCUDA( + cpu = process.hltEcalRecHit.clone( + triggerPrimitiveDigiCollection = ('hltEcalDigisLegacy', 'EcalTriggerPrimitives') + ), + cuda = process.hltEcalRecHit.clone( + triggerPrimitiveDigiCollection = 'unused' + ) + ) + + # Tasks and Sequences + + process.HLTDoFullUnpackingEgammaEcalWithoutPreshowerTask = cms.Task( + process.hltEcalDigisGPU, # unpack ECAL digis on gpu + process.hltEcalDigisLegacy, # legacy producer, referenced in the SwitchProducer + process.hltEcalDigis, # SwitchProducer + process.hltEcalUncalibRecHitGPU, # run ECAL local reconstruction and multifit on gpu + process.hltEcalUncalibRecHitSoA, # needed by hltEcalPhiSymFilter - copy to host + process.hltEcalUncalibRecHit, # needed by hltEcalPhiSymFilter - convert to legacy format + # process.hltEcalRecHitGPU, # make ECAL calibrated rechits on gpu + # process.hltEcalRecHitSoA, # copy to host + process.hltEcalDetIdToBeRecovered, # legacy producer + process.hltEcalRecHit) # legacy producer + + process.HLTDoFullUnpackingEgammaEcalWithoutPreshowerSequence = cms.Sequence( + process.HLTDoFullUnpackingEgammaEcalWithoutPreshowerTask) + + if hasHLTEcalPreshowerSeq: + process.HLTPreshowerTask = cms.Task( + process.hltEcalPreshowerDigis, # unpack ECAL preshower digis on the host + process.hltEcalPreshowerRecHit) # build ECAL preshower rechits on the host + + process.HLTPreshowerSequence = cms.Sequence(process.HLTPreshowerTask) + + process.HLTDoFullUnpackingEgammaEcalTask = cms.Task( + process.HLTDoFullUnpackingEgammaEcalWithoutPreshowerTask, + process.HLTPreshowerTask) + + process.HLTDoFullUnpackingEgammaEcalSequence = cms.Sequence( + process.HLTDoFullUnpackingEgammaEcalTask) + + process.HLTDoFullUnpackingEgammaEcalMFSequence = cms.Sequence( + process.HLTDoFullUnpackingEgammaEcalTask) + + # done + return process + +# customisation for offloading the HCAL local reconstruction via CUDA if a supported gpu is present +def customiseHcalLocalReconstruction(process): + + hasHLTDoLocalHcalSeq = 'HLTDoLocalHcalSequence' in process.__dict__ + if not (hasHLTDoLocalHcalSeq or 'HLTStoppedHSCPLocalHcalReco' in process.__dict__): + return process + + # FIXME replace the Sequences with empty ones to avoid expanding them during the (re)definition of Modules and EDAliases + + if hasHLTDoLocalHcalSeq: + process.HLTDoLocalHcalSequence = cms.Sequence() + process.HLTStoppedHSCPLocalHcalReco = cms.Sequence() + + + # Event Setup + + process.load("EventFilter.HcalRawToDigi.hcalElectronicsMappingGPUESProducer_cfi") + + process.load("RecoLocalCalo.HcalRecProducers.hcalGainsGPUESProducer_cfi") + process.load("RecoLocalCalo.HcalRecProducers.hcalGainWidthsGPUESProducer_cfi") + process.load("RecoLocalCalo.HcalRecProducers.hcalLUTCorrsGPUESProducer_cfi") + process.load("RecoLocalCalo.HcalRecProducers.hcalConvertedPedestalsGPUESProducer_cfi") + process.load("RecoLocalCalo.HcalRecProducers.hcalConvertedEffectivePedestalsGPUESProducer_cfi") + process.hcalConvertedEffectivePedestalsGPUESProducer.label0 = "withTopoEff" + process.load("RecoLocalCalo.HcalRecProducers.hcalConvertedPedestalWidthsGPUESProducer_cfi") + process.load("RecoLocalCalo.HcalRecProducers.hcalConvertedEffectivePedestalWidthsGPUESProducer_cfi") + process.hcalConvertedEffectivePedestalWidthsGPUESProducer.label0 = "withTopoEff" + process.hcalConvertedEffectivePedestalWidthsGPUESProducer.label1 = "withTopoEff" + process.load("RecoLocalCalo.HcalRecProducers.hcalQIECodersGPUESProducer_cfi") + process.load("RecoLocalCalo.HcalRecProducers.hcalRecoParamsWithPulseShapesGPUESProducer_cfi") + process.load("RecoLocalCalo.HcalRecProducers.hcalRespCorrsGPUESProducer_cfi") + process.load("RecoLocalCalo.HcalRecProducers.hcalTimeCorrsGPUESProducer_cfi") + process.load("RecoLocalCalo.HcalRecProducers.hcalQIETypesGPUESProducer_cfi") + process.load("RecoLocalCalo.HcalRecProducers.hcalSiPMParametersGPUESProducer_cfi") + process.load("RecoLocalCalo.HcalRecProducers.hcalSiPMCharacteristicsGPUESProducer_cfi") + process.load("RecoLocalCalo.HcalRecProducers.hcalMahiPulseOffsetsGPUESProducer_cfi") + + + # Modules and EDAliases + + # The HCAL unpacker running on the gpu supports only the HB and HE digis. + # So, run the legacy unacker on the cpu, then convert the HB and HE digis + # to SoA format and copy them to the gpu. + from EventFilter.HcalRawToDigi.hcalDigisProducerGPU_cfi import hcalDigisProducerGPU as _hcalDigisProducerGPU + process.hltHcalDigisGPU = _hcalDigisProducerGPU.clone( + hbheDigisLabel = "hltHcalDigis", + qie11DigiLabel = "hltHcalDigis", + digisLabelF01HE = "", + digisLabelF5HB = "", + digisLabelF3HB = "" + ) + + # run the HCAL local reconstruction (including Method 0 and MAHI) on gpu + from RecoLocalCalo.HcalRecProducers.hbheRecHitProducerGPU_cfi import hbheRecHitProducerGPU as _hbheRecHitProducerGPU + process.hltHbherecoGPU = _hbheRecHitProducerGPU.clone( + digisLabelF01HE = "hltHcalDigisGPU", + digisLabelF5HB = "hltHcalDigisGPU", + digisLabelF3HB = "hltHcalDigisGPU", + recHitsLabelM0HBHE = "" + ) + + # transfer the HCAL rechits to the cpu, and convert them to the legacy format + from RecoLocalCalo.HcalRecProducers.hcalCPURecHitsProducer_cfi import hcalCPURecHitsProducer as _hcalCPURecHitsProducer + process.hltHbherecoFromGPU = _hcalCPURecHitsProducer.clone( + recHitsM0LabelIn = "hltHbherecoGPU", + recHitsM0LabelOut = "", + recHitsLegacyLabelOut = "" + ) + + # SwitchProducer between the legacy producer and the copy from gpu with conversion + process.hltHbhereco = SwitchProducerCUDA( + # legacy producer + cpu = process.hltHbhereco.clone(), + # alias to the rechits converted to legacy format + cuda = cms.EDAlias( + hltHbherecoFromGPU = cms.VPSet( + cms.PSet(type = cms.string("HBHERecHitsSorted")) + ) + ) + ) + + + # Tasks and Sequences + if hasHLTDoLocalHcalSeq: + process.HLTDoLocalHcalTask = cms.Task( + process.hltHcalDigis, # legacy producer, unpack HCAL digis on cpu + process.hltHcalDigisGPU, # copy to gpu and convert to SoA format + process.hltHbherecoGPU, # run the HCAL local reconstruction (including Method 0 and MAHI) on gpu + process.hltHbherecoFromGPU, # transfer the HCAL rechits to the cpu, and convert them to the legacy format + process.hltHbhereco, # SwitchProducer between the legacy producer and the copy from gpu with conversion + process.hltHfprereco, # legacy producer + process.hltHfreco, # legacy producer + process.hltHoreco) # legacy producer + + process.HLTDoLocalHcalSequence = cms.Sequence( + process.HLTDoLocalHcalTask) + + process.HLTStoppedHSCPLocalHcalRecoTask = cms.Task( + process.hltHcalDigis, # legacy producer, unpack HCAL digis on cpu + process.hltHcalDigisGPU, # copy to gpu and convert to SoA format + process.hltHbherecoGPU, # run the HCAL local reconstruction (including Method 0 and MAHI) on gpu + process.hltHbherecoFromGPU, # transfer the HCAL rechits to the cpu, and convert them to the legacy format + process.hltHbhereco) # SwitchProducer between the legacy producer and the copy from gpu with conversion + + process.HLTStoppedHSCPLocalHcalReco = cms.Sequence( + process.HLTStoppedHSCPLocalHcalRecoTask) + + + # done + return process + + +# customisation to enable pixel triplets instead of quadruplets +def enablePatatrackPixelTriplets(process): + + if 'hltPixelTracksCUDA' in process.__dict__: + # configure GPU pixel tracks for triplets + process.hltPixelTracksCUDA.minHitsPerNtuplet = 3 + process.hltPixelTracksCUDA.includeJumpingForwardDoublets = True + + if 'hltPixelTracksSoA' in process.__dict__: + # configure CPU pixel tracks for triplets + process.hltPixelTracksSoA.cpu.minHitsPerNtuplet = 3 + process.hltPixelTracksSoA.cpu.includeJumpingForwardDoublets = True + + # done + return process + + +# customisation for running the Patatrack reconstruction, with automatic offload via CUDA when a supported gpu is available +def customizeHLTforPatatrack(process): + process = customiseCommon(process) + process = customisePixelLocalReconstruction(process) + process = customisePixelTrackReconstruction(process) + process = customiseEcalLocalReconstruction(process) + process = customiseHcalLocalReconstruction(process) + return process + + +# customisation for running the Patatrack triplets reconstruction, with automatic offload via CUDA when a supported gpu is available +def customizeHLTforPatatrackTriplets(process): + process = customiseCommon(process) + process = customisePixelLocalReconstruction(process) + process = customisePixelTrackReconstruction(process) + process = customiseEcalLocalReconstruction(process) + process = customiseHcalLocalReconstruction(process) + process = enablePatatrackPixelTriplets(process) + return process + + +def _addConsumerPath(process): + # add to a path all consumers and the tasks that define the producers + process.Consumer = cms.Path( + process.HLTBeginSequence + + process.hltPixelConsumer + + process.hltEcalConsumer + + process.hltHbheConsumer, + process.HLTDoLocalPixelTask, + process.HLTRecoPixelTracksTask, + process.HLTRecopixelvertexingTask, + process.HLTDoFullUnpackingEgammaEcalTask, + process.HLTDoLocalHcalTask, + ) + + if 'HLTSchedule' in process.__dict__: + process.HLTSchedule.append(process.Consumer) + if process.schedule is not None: + process.schedule.append(process.Consumer) + + # done + return process + + +def consumeGPUSoAProducts(process): + # consume the Pixel tracks and vertices on the GPU in SoA format + process.hltPixelConsumer = cms.EDAnalyzer("GenericConsumer", + eventProducts = cms.untracked.vstring( 'hltPixelTracksCUDA', 'hltPixelVerticesCUDA' ) + ) + + # consume the ECAL uncalibrated rechits on the GPU in SoA format + process.hltEcalConsumer = cms.EDAnalyzer("GenericConsumer", + eventProducts = cms.untracked.vstring( 'hltEcalUncalibRecHitGPU' ) + ) + + # consume the HCAL rechits on the GPU in SoA format + process.hltHbheConsumer = cms.EDAnalyzer("GenericConsumer", + eventProducts = cms.untracked.vstring( 'hltHbherecoGPU' ) + ) + + # add to a path all consumers and the tasks that define the producers + process = _addConsumerPath(process) + + # done + return process + + +def consumeCPUSoAProducts(process): + # consume the Pixel tracks and vertices on the CPU in SoA format + process.hltPixelConsumer = cms.EDAnalyzer("GenericConsumer", + eventProducts = cms.untracked.vstring( 'hltPixelTracksSoA', 'hltPixelVerticesSoA' ) + ) + + # consume the ECAL uncalibrated rechits on the CPU in SoA format + process.hltEcalConsumer = cms.EDAnalyzer("GenericConsumer", + eventProducts = cms.untracked.vstring( 'hltEcalUncalibRecHitSoA' ) + ) + + # consume the HCAL rechits on the CPU in legacy format + process.hltHbheConsumer = cms.EDAnalyzer("GenericConsumer", + eventProducts = cms.untracked.vstring( 'hltHbhereco' ) + ) + + # add to a path all consumers and the tasks that define the producers + process = _addConsumerPath(process) + + # done + return process + +def consumeCPULegacyProducts(process): + # consume the Pixel tracks and vertices on the CPU in legacy format + process.hltPixelConsumer = cms.EDAnalyzer("GenericConsumer", + eventProducts = cms.untracked.vstring( 'hltPixelTracks', 'hltPixelVertices' ) + ) + + # consume the ECAL runcalibrated echits on the CPU in legacy format + process.hltEcalConsumer = cms.EDAnalyzer("GenericConsumer", + eventProducts = cms.untracked.vstring( 'hltEcalUncalibRecHit' ) + ) + + # consume the HCAL rechits on the CPU in legacy format + process.hltHbheConsumer = cms.EDAnalyzer("GenericConsumer", + eventProducts = cms.untracked.vstring( 'hltHbhereco' ) + ) + + # add to a path all consumers and the tasks that define the producers + process = _addConsumerPath(process) + + # done + return process diff --git a/HLTrigger/Configuration/tables/makeSubTables b/HLTrigger/Configuration/tables/makeSubTables index cfd09b91f2e3b..3614ff2829d2d 100755 --- a/HLTrigger/Configuration/tables/makeSubTables +++ b/HLTrigger/Configuration/tables/makeSubTables @@ -3,8 +3,8 @@ # generate HLT tables from master table in ConfDB # -MASTER="/dev/CMSSW_12_0_0/HLT" # no version, take the latest one -TARGET="/dev/CMSSW_12_0_0/TABLE" # directory where to store the sub-tables +MASTER="/dev/CMSSW_12_1_0/HLT" # no version, take the latest one +TARGET="/dev/CMSSW_12_1_0/TABLE" # directory where to store the sub-tables TABLES="GRun HIon PIon PRef" # which sub-tables to create source subtables.sh diff --git a/HLTrigger/Configuration/test/OnLine_HLT_FULL.py b/HLTrigger/Configuration/test/OnLine_HLT_FULL.py index 487d9e336b0ce..6ad88adeb8a5b 100644 --- a/HLTrigger/Configuration/test/OnLine_HLT_FULL.py +++ b/HLTrigger/Configuration/test/OnLine_HLT_FULL.py @@ -1,13 +1,13 @@ -# hltGetConfiguration --full --data /dev/CMSSW_12_0_0/HLT --type FULL --unprescale --process HLTFULL --globaltag auto:run3_hlt_FULL --input file:RelVal_Raw_FULL_DATA.root +# hltGetConfiguration --full --data /dev/CMSSW_12_1_0/HLT --type FULL --unprescale --process HLTFULL --globaltag auto:run3_hlt_FULL --input file:RelVal_Raw_FULL_DATA.root -# /dev/CMSSW_12_0_0/HLT/V8 (CMSSW_12_0_0_pre5) +# /dev/CMSSW_12_1_0/HLT/V3 (CMSSW_12_1_0_pre2) import FWCore.ParameterSet.Config as cms process = cms.Process( "HLTFULL" ) process.HLTConfigVersion = cms.PSet( - tableName = cms.string('/dev/CMSSW_12_0_0/HLT/V8') + tableName = cms.string('/dev/CMSSW_12_1_0/HLT/V3') ) process.transferSystem = cms.PSet( @@ -9231,7 +9231,9 @@ useUncertDB = cms.bool( True ), doVdriftCorr = cms.bool( True ), minTime = cms.double( -3.0 ), - tTrigMode = cms.string( "DTTTrigSyncFromDB" ) + tTrigMode = cms.string( "DTTTrigSyncFromDB" ), + readLegacyTTrigDB = cms.bool( True ), + readLegacyVDriftDB = cms.bool( True ) ), recAlgo = cms.string( "DTLinearDriftFromDBAlgo" ), debug = cms.untracked.bool( False ), @@ -9266,7 +9268,9 @@ useUncertDB = cms.bool( True ), doVdriftCorr = cms.bool( True ), minTime = cms.double( -3.0 ), - tTrigMode = cms.string( "DTTTrigSyncFromDB" ) + tTrigMode = cms.string( "DTTTrigSyncFromDB" ), + readLegacyTTrigDB = cms.bool( True ), + readLegacyVDriftDB = cms.bool( True ) ), MaxAllowedHits = cms.uint32( 50 ), nUnSharedHitsMin = cms.int32( 2 ), @@ -9299,7 +9303,9 @@ useUncertDB = cms.bool( True ), doVdriftCorr = cms.bool( True ), minTime = cms.double( -3.0 ), - tTrigMode = cms.string( "DTTTrigSyncFromDB" ) + tTrigMode = cms.string( "DTTTrigSyncFromDB" ), + readLegacyTTrigDB = cms.bool( True ), + readLegacyVDriftDB = cms.bool( True ) ), nUnSharedHitsMin = cms.int32( 2 ), nSharedHitsMax = cms.int32( 2 ), @@ -44289,7 +44295,9 @@ useUncertDB = cms.bool( True ), doVdriftCorr = cms.bool( True ), minTime = cms.double( -3.0 ), - tTrigMode = cms.string( "DTTTrigSyncFromDB" ) + tTrigMode = cms.string( "DTTTrigSyncFromDB" ), + readLegacyTTrigDB = cms.bool( True ), + readLegacyVDriftDB = cms.bool( True ) ), MaxAllowedHits = cms.uint32( 50 ), nUnSharedHitsMin = cms.int32( 2 ), @@ -44322,7 +44330,9 @@ useUncertDB = cms.bool( True ), doVdriftCorr = cms.bool( True ), minTime = cms.double( -3.0 ), - tTrigMode = cms.string( "DTTTrigSyncFromDB" ) + tTrigMode = cms.string( "DTTTrigSyncFromDB" ), + readLegacyTTrigDB = cms.bool( True ), + readLegacyVDriftDB = cms.bool( True ) ), nUnSharedHitsMin = cms.int32( 2 ), nSharedHitsMax = cms.int32( 2 ), diff --git a/HLTrigger/Configuration/test/OnLine_HLT_Fake.py b/HLTrigger/Configuration/test/OnLine_HLT_Fake.py index f51d4740afba8..cd37e7c2c440f 100644 --- a/HLTrigger/Configuration/test/OnLine_HLT_Fake.py +++ b/HLTrigger/Configuration/test/OnLine_HLT_Fake.py @@ -1,13 +1,13 @@ -# hltGetConfiguration --full --data /dev/CMSSW_12_0_0/Fake --type Fake --unprescale --process HLTFake --globaltag auto:run1_hlt_Fake --input file:RelVal_Raw_Fake_DATA.root +# hltGetConfiguration --full --data /dev/CMSSW_12_1_0/Fake --type Fake --unprescale --process HLTFake --globaltag auto:run1_hlt_Fake --input file:RelVal_Raw_Fake_DATA.root -# /dev/CMSSW_12_0_0/Fake/V5 (CMSSW_12_0_0_pre5) +# /dev/CMSSW_12_1_0/Fake/V2 (CMSSW_12_1_0_pre2) import FWCore.ParameterSet.Config as cms process = cms.Process( "HLTFake" ) process.HLTConfigVersion = cms.PSet( - tableName = cms.string('/dev/CMSSW_12_0_0/Fake/V5') + tableName = cms.string('/dev/CMSSW_12_1_0/Fake/V2') ) process.streams = cms.PSet( A = cms.vstring( 'InitialPD' ) ) diff --git a/HLTrigger/Configuration/test/OnLine_HLT_Fake1.py b/HLTrigger/Configuration/test/OnLine_HLT_Fake1.py index 76a53fbf3f2bf..11526f6a0f468 100644 --- a/HLTrigger/Configuration/test/OnLine_HLT_Fake1.py +++ b/HLTrigger/Configuration/test/OnLine_HLT_Fake1.py @@ -1,13 +1,13 @@ -# hltGetConfiguration --full --data /dev/CMSSW_12_0_0/Fake1 --type Fake1 --unprescale --process HLTFake1 --globaltag auto:run2_hlt_Fake1 --input file:RelVal_Raw_Fake1_DATA.root +# hltGetConfiguration --full --data /dev/CMSSW_12_1_0/Fake1 --type Fake1 --unprescale --process HLTFake1 --globaltag auto:run2_hlt_Fake1 --input file:RelVal_Raw_Fake1_DATA.root -# /dev/CMSSW_12_0_0/Fake1/V5 (CMSSW_12_0_0_pre5) +# /dev/CMSSW_12_1_0/Fake1/V2 (CMSSW_12_1_0_pre2) import FWCore.ParameterSet.Config as cms process = cms.Process( "HLTFake1" ) process.HLTConfigVersion = cms.PSet( - tableName = cms.string('/dev/CMSSW_12_0_0/Fake1/V5') + tableName = cms.string('/dev/CMSSW_12_1_0/Fake1/V2') ) process.streams = cms.PSet( A = cms.vstring( 'InitialPD' ) ) diff --git a/HLTrigger/Configuration/test/OnLine_HLT_Fake2.py b/HLTrigger/Configuration/test/OnLine_HLT_Fake2.py index 870da09717e7c..4c38c491a0464 100644 --- a/HLTrigger/Configuration/test/OnLine_HLT_Fake2.py +++ b/HLTrigger/Configuration/test/OnLine_HLT_Fake2.py @@ -1,13 +1,13 @@ -# hltGetConfiguration --full --data /dev/CMSSW_12_0_0/Fake2 --type Fake2 --unprescale --process HLTFake2 --globaltag auto:run2_hlt_Fake2 --input file:RelVal_Raw_Fake2_DATA.root +# hltGetConfiguration --full --data /dev/CMSSW_12_1_0/Fake2 --type Fake2 --unprescale --process HLTFake2 --globaltag auto:run2_hlt_Fake2 --input file:RelVal_Raw_Fake2_DATA.root -# /dev/CMSSW_12_0_0/Fake2/V5 (CMSSW_12_0_0_pre5) +# /dev/CMSSW_12_1_0/Fake2/V2 (CMSSW_12_1_0_pre2) import FWCore.ParameterSet.Config as cms process = cms.Process( "HLTFake2" ) process.HLTConfigVersion = cms.PSet( - tableName = cms.string('/dev/CMSSW_12_0_0/Fake2/V5') + tableName = cms.string('/dev/CMSSW_12_1_0/Fake2/V2') ) process.streams = cms.PSet( A = cms.vstring( 'InitialPD' ) ) diff --git a/HLTrigger/Configuration/test/OnLine_HLT_GRun.py b/HLTrigger/Configuration/test/OnLine_HLT_GRun.py index cdb5db2c49fad..f388bc447d86e 100644 --- a/HLTrigger/Configuration/test/OnLine_HLT_GRun.py +++ b/HLTrigger/Configuration/test/OnLine_HLT_GRun.py @@ -1,13 +1,13 @@ -# hltGetConfiguration --full --data /dev/CMSSW_12_0_0/GRun --type GRun --unprescale --process HLTGRun --globaltag auto:run3_hlt_GRun --input file:RelVal_Raw_GRun_DATA.root +# hltGetConfiguration --full --data /dev/CMSSW_12_1_0/GRun --type GRun --unprescale --process HLTGRun --globaltag auto:run3_hlt_GRun --input file:RelVal_Raw_GRun_DATA.root -# /dev/CMSSW_12_0_0/GRun/V5 (CMSSW_12_0_0_pre5) +# /dev/CMSSW_12_1_0/GRun/V1 (CMSSW_12_1_0_pre2) import FWCore.ParameterSet.Config as cms process = cms.Process( "HLTGRun" ) process.HLTConfigVersion = cms.PSet( - tableName = cms.string('/dev/CMSSW_12_0_0/GRun/V5') + tableName = cms.string('/dev/CMSSW_12_1_0/GRun/V1') ) process.transferSystem = cms.PSet( @@ -7871,7 +7871,9 @@ useUncertDB = cms.bool( True ), doVdriftCorr = cms.bool( True ), minTime = cms.double( -3.0 ), - tTrigMode = cms.string( "DTTTrigSyncFromDB" ) + tTrigMode = cms.string( "DTTTrigSyncFromDB" ), + readLegacyTTrigDB = cms.bool( True ), + readLegacyVDriftDB = cms.bool( True ) ), recAlgo = cms.string( "DTLinearDriftFromDBAlgo" ), debug = cms.untracked.bool( False ), @@ -7906,7 +7908,9 @@ useUncertDB = cms.bool( True ), doVdriftCorr = cms.bool( True ), minTime = cms.double( -3.0 ), - tTrigMode = cms.string( "DTTTrigSyncFromDB" ) + tTrigMode = cms.string( "DTTTrigSyncFromDB" ), + readLegacyTTrigDB = cms.bool( True ), + readLegacyVDriftDB = cms.bool( True ) ), MaxAllowedHits = cms.uint32( 50 ), nUnSharedHitsMin = cms.int32( 2 ), @@ -7939,7 +7943,9 @@ useUncertDB = cms.bool( True ), doVdriftCorr = cms.bool( True ), minTime = cms.double( -3.0 ), - tTrigMode = cms.string( "DTTTrigSyncFromDB" ) + tTrigMode = cms.string( "DTTTrigSyncFromDB" ), + readLegacyTTrigDB = cms.bool( True ), + readLegacyVDriftDB = cms.bool( True ) ), nUnSharedHitsMin = cms.int32( 2 ), nSharedHitsMax = cms.int32( 2 ), @@ -42459,7 +42465,9 @@ useUncertDB = cms.bool( True ), doVdriftCorr = cms.bool( True ), minTime = cms.double( -3.0 ), - tTrigMode = cms.string( "DTTTrigSyncFromDB" ) + tTrigMode = cms.string( "DTTTrigSyncFromDB" ), + readLegacyTTrigDB = cms.bool( True ), + readLegacyVDriftDB = cms.bool( True ) ), MaxAllowedHits = cms.uint32( 50 ), nUnSharedHitsMin = cms.int32( 2 ), @@ -42492,7 +42500,9 @@ useUncertDB = cms.bool( True ), doVdriftCorr = cms.bool( True ), minTime = cms.double( -3.0 ), - tTrigMode = cms.string( "DTTTrigSyncFromDB" ) + tTrigMode = cms.string( "DTTTrigSyncFromDB" ), + readLegacyTTrigDB = cms.bool( True ), + readLegacyVDriftDB = cms.bool( True ) ), nUnSharedHitsMin = cms.int32( 2 ), nSharedHitsMax = cms.int32( 2 ), diff --git a/HLTrigger/Configuration/test/OnLine_HLT_HIon.py b/HLTrigger/Configuration/test/OnLine_HLT_HIon.py index f49ea9be77752..d4beb4aa4930e 100644 --- a/HLTrigger/Configuration/test/OnLine_HLT_HIon.py +++ b/HLTrigger/Configuration/test/OnLine_HLT_HIon.py @@ -1,13 +1,13 @@ -# hltGetConfiguration --full --data /dev/CMSSW_12_0_0/HIon --type HIon --unprescale --process HLTHIon --globaltag auto:run3_hlt_HIon --input file:RelVal_Raw_HIon_DATA.root +# hltGetConfiguration --full --data /dev/CMSSW_12_1_0/HIon --type HIon --unprescale --process HLTHIon --globaltag auto:run3_hlt_HIon --input file:RelVal_Raw_HIon_DATA.root -# /dev/CMSSW_12_0_0/HIon/V5 (CMSSW_12_0_0_pre5) +# /dev/CMSSW_12_1_0/HIon/V1 (CMSSW_12_1_0_pre2) import FWCore.ParameterSet.Config as cms process = cms.Process( "HLTHIon" ) process.HLTConfigVersion = cms.PSet( - tableName = cms.string('/dev/CMSSW_12_0_0/HIon/V5') + tableName = cms.string('/dev/CMSSW_12_1_0/HIon/V1') ) process.transferSystem = cms.PSet( @@ -6631,7 +6631,9 @@ useUncertDB = cms.bool( True ), doVdriftCorr = cms.bool( True ), minTime = cms.double( -3.0 ), - tTrigMode = cms.string( "DTTTrigSyncFromDB" ) + tTrigMode = cms.string( "DTTTrigSyncFromDB" ), + readLegacyTTrigDB = cms.bool( True ), + readLegacyVDriftDB = cms.bool( True ) ), recAlgo = cms.string( "DTLinearDriftFromDBAlgo" ), debug = cms.untracked.bool( False ), @@ -6666,7 +6668,9 @@ useUncertDB = cms.bool( True ), doVdriftCorr = cms.bool( True ), minTime = cms.double( -3.0 ), - tTrigMode = cms.string( "DTTTrigSyncFromDB" ) + tTrigMode = cms.string( "DTTTrigSyncFromDB" ), + readLegacyTTrigDB = cms.bool( True ), + readLegacyVDriftDB = cms.bool( True ) ), MaxAllowedHits = cms.uint32( 50 ), nUnSharedHitsMin = cms.int32( 2 ), @@ -6699,7 +6703,9 @@ useUncertDB = cms.bool( True ), doVdriftCorr = cms.bool( True ), minTime = cms.double( -3.0 ), - tTrigMode = cms.string( "DTTTrigSyncFromDB" ) + tTrigMode = cms.string( "DTTTrigSyncFromDB" ), + readLegacyTTrigDB = cms.bool( True ), + readLegacyVDriftDB = cms.bool( True ) ), nUnSharedHitsMin = cms.int32( 2 ), nSharedHitsMax = cms.int32( 2 ), diff --git a/HLTrigger/Configuration/test/OnLine_HLT_PIon.py b/HLTrigger/Configuration/test/OnLine_HLT_PIon.py index 1b5088bd5160b..3e23983d79c56 100644 --- a/HLTrigger/Configuration/test/OnLine_HLT_PIon.py +++ b/HLTrigger/Configuration/test/OnLine_HLT_PIon.py @@ -1,13 +1,13 @@ -# hltGetConfiguration --full --data /dev/CMSSW_12_0_0/PIon --type PIon --unprescale --process HLTPIon --globaltag auto:run3_hlt_PIon --input file:RelVal_Raw_PIon_DATA.root +# hltGetConfiguration --full --data /dev/CMSSW_12_1_0/PIon --type PIon --unprescale --process HLTPIon --globaltag auto:run3_hlt_PIon --input file:RelVal_Raw_PIon_DATA.root -# /dev/CMSSW_12_0_0/PIon/V5 (CMSSW_12_0_0_pre5) +# /dev/CMSSW_12_1_0/PIon/V1 (CMSSW_12_1_0_pre2) import FWCore.ParameterSet.Config as cms process = cms.Process( "HLTPIon" ) process.HLTConfigVersion = cms.PSet( - tableName = cms.string('/dev/CMSSW_12_0_0/PIon/V5') + tableName = cms.string('/dev/CMSSW_12_1_0/PIon/V1') ) process.transferSystem = cms.PSet( diff --git a/HLTrigger/Configuration/test/OnLine_HLT_PRef.py b/HLTrigger/Configuration/test/OnLine_HLT_PRef.py index 090cd884fad83..25ffdb2fe8c67 100644 --- a/HLTrigger/Configuration/test/OnLine_HLT_PRef.py +++ b/HLTrigger/Configuration/test/OnLine_HLT_PRef.py @@ -1,13 +1,13 @@ -# hltGetConfiguration --full --data /dev/CMSSW_12_0_0/PRef --type PRef --unprescale --process HLTPRef --globaltag auto:run3_hlt_PRef --input file:RelVal_Raw_PRef_DATA.root +# hltGetConfiguration --full --data /dev/CMSSW_12_1_0/PRef --type PRef --unprescale --process HLTPRef --globaltag auto:run3_hlt_PRef --input file:RelVal_Raw_PRef_DATA.root -# /dev/CMSSW_12_0_0/PRef/V5 (CMSSW_12_0_0_pre5) +# /dev/CMSSW_12_1_0/PRef/V1 (CMSSW_12_1_0_pre2) import FWCore.ParameterSet.Config as cms process = cms.Process( "HLTPRef" ) process.HLTConfigVersion = cms.PSet( - tableName = cms.string('/dev/CMSSW_12_0_0/PRef/V5') + tableName = cms.string('/dev/CMSSW_12_1_0/PRef/V1') ) process.transferSystem = cms.PSet( @@ -6349,7 +6349,9 @@ useUncertDB = cms.bool( True ), doVdriftCorr = cms.bool( True ), minTime = cms.double( -3.0 ), - tTrigMode = cms.string( "DTTTrigSyncFromDB" ) + tTrigMode = cms.string( "DTTTrigSyncFromDB" ), + readLegacyTTrigDB = cms.bool( True ), + readLegacyVDriftDB = cms.bool( True ) ), recAlgo = cms.string( "DTLinearDriftFromDBAlgo" ), debug = cms.untracked.bool( False ), @@ -6384,7 +6386,9 @@ useUncertDB = cms.bool( True ), doVdriftCorr = cms.bool( True ), minTime = cms.double( -3.0 ), - tTrigMode = cms.string( "DTTTrigSyncFromDB" ) + tTrigMode = cms.string( "DTTTrigSyncFromDB" ), + readLegacyTTrigDB = cms.bool( True ), + readLegacyVDriftDB = cms.bool( True ) ), MaxAllowedHits = cms.uint32( 50 ), nUnSharedHitsMin = cms.int32( 2 ), @@ -6417,7 +6421,9 @@ useUncertDB = cms.bool( True ), doVdriftCorr = cms.bool( True ), minTime = cms.double( -3.0 ), - tTrigMode = cms.string( "DTTTrigSyncFromDB" ) + tTrigMode = cms.string( "DTTTrigSyncFromDB" ), + readLegacyTTrigDB = cms.bool( True ), + readLegacyVDriftDB = cms.bool( True ) ), nUnSharedHitsMin = cms.int32( 2 ), nSharedHitsMax = cms.int32( 2 ), diff --git a/HLTrigger/Configuration/test/cmsDriver.csh b/HLTrigger/Configuration/test/cmsDriver.csh index 333f240b76858..0f77ce781877a 100755 --- a/HLTrigger/Configuration/test/cmsDriver.csh +++ b/HLTrigger/Configuration/test/cmsDriver.csh @@ -221,7 +221,7 @@ foreach gtag ( MC DATA ) set Era = $EraRun3HI set Custom = " " set L1REPACK = L1REPACK:Full - set DIGI = DIGI:pdigi_hi + set DIGI = DIGI:pdigi_hi_nogen else if ( $table == PIon ) then set XL1T = $XL1TPI set XHLT = HLT:PIon diff --git a/HLTrigger/Configuration/test/getFrozenHLT.sh b/HLTrigger/Configuration/test/getFrozenHLT.sh index 7e402f7a0033f..ae051b4a15328 100755 --- a/HLTrigger/Configuration/test/getFrozenHLT.sh +++ b/HLTrigger/Configuration/test/getFrozenHLT.sh @@ -2,9 +2,9 @@ # ConfDB configurations to use TABLES="Fake Fake1 Fake2" -HLT_Fake="/dev/CMSSW_12_0_0/Fake" -HLT_Fake1="/dev/CMSSW_12_0_0/Fake1" -HLT_Fake2="/dev/CMSSW_12_0_0/Fake2" +HLT_Fake="/dev/CMSSW_12_1_0/Fake" +HLT_Fake1="/dev/CMSSW_12_1_0/Fake1" +HLT_Fake2="/dev/CMSSW_12_1_0/Fake2" # print extra messages ? VERBOSE=false diff --git a/HLTrigger/Configuration/test/getHLT.sh b/HLTrigger/Configuration/test/getHLT.sh index ecf99d55dcdfd..5e7e8e4f6c2b4 100755 --- a/HLTrigger/Configuration/test/getHLT.sh +++ b/HLTrigger/Configuration/test/getHLT.sh @@ -1,8 +1,8 @@ #! /bin/bash # ConfDB configurations to use -MASTER="/dev/CMSSW_12_0_0/HLT" # no explicit version, take the most recent -TARGET="/dev/CMSSW_12_0_0/\$TABLE" # no explicit version, take the most recent +MASTER="/dev/CMSSW_12_1_0/HLT" # no explicit version, take the most recent +TARGET="/dev/CMSSW_12_1_0/\$TABLE" # no explicit version, take the most recent TABLES="GRun HIon PIon PRef" # $TABLE in the above variable will be expanded to these TABLES diff --git a/HLTrigger/Egamma/plugins/HLTDisplacedEgammaFilter.cc b/HLTrigger/Egamma/plugins/HLTDisplacedEgammaFilter.cc index efa55e07fa7eb..a47e6bc6283b6 100644 --- a/HLTrigger/Egamma/plugins/HLTDisplacedEgammaFilter.cc +++ b/HLTrigger/Egamma/plugins/HLTDisplacedEgammaFilter.cc @@ -6,14 +6,11 @@ */ #include "HLTDisplacedEgammaFilter.h" - #include "DataFormats/Common/interface/Handle.h" - #include "FWCore/MessageLogger/interface/MessageLogger.h" - +#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" #include "DataFormats/RecoCandidate/interface/RecoEcalCandidate.h" #include "RecoEcal/EgammaCoreTools/interface/EcalClusterTools.h" -#include "RecoTracker/TrackProducer/plugins/TrackProducer.h" #include "DataFormats/Math/interface/LorentzVector.h" // diff --git a/HLTrigger/HLTfilters/plugins/TriggerResultsFilter.cc b/HLTrigger/HLTfilters/plugins/TriggerResultsFilter.cc index 310c483661b71..483eda1b82710 100644 --- a/HLTrigger/HLTfilters/plugins/TriggerResultsFilter.cc +++ b/HLTrigger/HLTfilters/plugins/TriggerResultsFilter.cc @@ -42,11 +42,14 @@ TriggerResultsFilter::~TriggerResultsFilter() { delete m_expression; } void TriggerResultsFilter::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { edm::ParameterSetDescription desc; // # use HLTPathStatus results - desc.add("usePathStatus", false); - // # HLT results - set to empty to ignore HLT - desc.add("hltResults", edm::InputTag("TriggerResults")); + desc.add("usePathStatus", false) + ->setComment("Read the HLT results from the TriggerResults (false) or from the current job's PathStatus (true)."); + // # HLT results - set to empty to ignore HLT + desc.add("hltResults", edm::InputTag("TriggerResults", "", "@skipCurrentProcess")) + ->setComment("HLT TriggerResults. Leave empty to ignore the HLT results. Ignored when usePathStatus is true."); // # L1 uGT results - set to empty to ignore L1T - desc.add("l1tResults", edm::InputTag("hltGtStage2Digis")); + desc.add("l1tResults", edm::InputTag("hltGtStage2Digis")) + ->setComment("uGT digi collection. Leave empty to ignore the L1T results."); // # use initial L1 decision, before masks and prescales desc.add("l1tIgnoreMaskAndPrescale", false); // # OBSOLETE - these parameters are ignored, they are left only not to break old configurations diff --git a/HLTrigger/HLTfilters/test/triggerResultsFilter.py b/HLTrigger/HLTfilters/test/triggerResultsFilter.py index ac487849ef887..fa61b70a28453 100644 --- a/HLTrigger/HLTfilters/test/triggerResultsFilter.py +++ b/HLTrigger/HLTfilters/test/triggerResultsFilter.py @@ -179,6 +179,6 @@ # define an EndPath to analyze all other path results process.hltTrigReport = cms.EDAnalyzer( 'HLTrigReport', - HLTriggerResults = cms.InputTag( 'TriggerResults','','TEST' ) + HLTriggerResults = cms.InputTag( 'TriggerResults', '', 'TEST' ) ) process.HLTAnalyzerEndpath = cms.EndPath( process.hltTrigReport ) diff --git a/HLTrigger/HLTfilters/test/triggerResultsFilter_producer.py b/HLTrigger/HLTfilters/test/triggerResultsFilter_producer.py index 03b3b42bb431a..3d72515f89796 100644 --- a/HLTrigger/HLTfilters/test/triggerResultsFilter_producer.py +++ b/HLTrigger/HLTfilters/test/triggerResultsFilter_producer.py @@ -44,8 +44,8 @@ process.Path_1 = cms.Path(process.scale_1) process.Path_2 = cms.Path(process.scale_2) process.Path_3 = cms.Path(process.scale_3) -process.True = cms.Path(process.success) -process.False = cms.Path(process.fail) +process.AlwaysTrue = cms.Path(process.success) +process.AlwaysFalse = cms.Path(process.fail) process.L1_Path = cms.Path(process.success) # define and EndPath to analyze all other path results diff --git a/HLTrigger/Muon/plugins/BuildFile.xml b/HLTrigger/Muon/plugins/BuildFile.xml index 46ab459e79184..c77c3e955e71a 100644 --- a/HLTrigger/Muon/plugins/BuildFile.xml +++ b/HLTrigger/Muon/plugins/BuildFile.xml @@ -21,4 +21,5 @@ + diff --git a/HLTrigger/Muon/plugins/HLTMuonTrackSelector.h b/HLTrigger/Muon/plugins/HLTMuonTrackSelector.h index fadce10a09059..b6089ba2747fe 100644 --- a/HLTrigger/Muon/plugins/HLTMuonTrackSelector.h +++ b/HLTrigger/Muon/plugins/HLTMuonTrackSelector.h @@ -12,7 +12,7 @@ * */ -#include "RecoTracker/FinalTrackSelectors/src/TrackCollectionCloner.cc" +#include "RecoTracker/FinalTrackSelectors/interface/TrackCollectionCloner.h" #include "FWCore/Framework/interface/global/EDProducer.h" #include "FWCore/Framework/interface/Event.h" diff --git a/HLTrigger/Timer/interface/ProcessCallGraph.h b/HLTrigger/Timer/interface/ProcessCallGraph.h index 1d78e110c8b43..5b7fcea82ef75 100644 --- a/HLTrigger/Timer/interface/ProcessCallGraph.h +++ b/HLTrigger/Timer/interface/ProcessCallGraph.h @@ -29,7 +29,7 @@ class ProcessCallGraph { struct NodeType { edm::ModuleDescription module_; edm::EDMModuleType type_; - bool scheduled_; + bool scheduled_ = false; }; // directed graph, with `NodeType` properties attached to each vertex diff --git a/HLTrigger/special/plugins/HLTHcalCalibTypeFilter.cc b/HLTrigger/special/plugins/HLTHcalCalibTypeFilter.cc index f887fc7f6f5a8..e02ef614f7c73 100644 --- a/HLTrigger/special/plugins/HLTHcalCalibTypeFilter.cc +++ b/HLTrigger/special/plugins/HLTHcalCalibTypeFilter.cc @@ -21,49 +21,51 @@ Description: Filter to select HCAL abort gap events #include #include -// user include files -#include "FWCore/Framework/interface/Frameworkfwd.h" - -#include "HLTrigger/HLTcore/interface/HLTFilter.h" +// CMSSW include files +#include "DataFormats/FEDRawData/interface/FEDNumbering.h" +#include "DataFormats/FEDRawData/interface/FEDRawData.h" +#include "DataFormats/FEDRawData/interface/FEDRawDataCollection.h" +#include "DataFormats/HcalDigi/interface/HcalCalibrationEventTypes.h" +#include "EventFilter/HcalRawToDigi/interface/AMC13Header.h" +#include "EventFilter/HcalRawToDigi/interface/HcalDCCHeader.h" +#include "EventFilter/HcalRawToDigi/interface/HcalUHTRData.h" #include "FWCore/Framework/interface/Event.h" -#include "FWCore/Framework/interface/MakerMacros.h" +#include "FWCore/Framework/interface/global/EDFilter.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" -#include "FWCore/ParameterSet/interface/ParameterSet.h" #include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" #include "FWCore/ParameterSet/interface/ParameterSetDescription.h" +#include "HLTrigger/HLTcore/interface/HLTFilter.h" -#include "DataFormats/FEDRawData/interface/FEDNumbering.h" -#include "DataFormats/HcalDigi/interface/HcalCalibrationEventTypes.h" -#include "EventFilter/HcalRawToDigi/interface/HcalDCCHeader.h" -#include "EventFilter/HcalRawToDigi/interface/HcalUHTRData.h" -#include "EventFilter/HcalRawToDigi/interface/AMC13Header.h" -#include "HLTHcalCalibTypeFilter.h" +// +// class declaration +// + +class HLTHcalCalibTypeFilter : public edm::global::EDFilter<> { +public: + explicit HLTHcalCalibTypeFilter(const edm::ParameterSet&); + ~HLTHcalCalibTypeFilter() override = default; + static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); + +private: + bool filter(edm::StreamID, edm::Event&, const edm::EventSetup&) const override; + + // ----------member data --------------------------- + const edm::EDGetTokenT inputToken_; + const std::vector calibTypes_; +}; // // constructors and destructor // HLTHcalCalibTypeFilter::HLTHcalCalibTypeFilter(const edm::ParameterSet& config) - : DataInputToken_(consumes(config.getParameter("InputTag"))), - CalibTypes_(config.getParameter >("CalibTypes")), - Summary_(config.getUntrackedParameter("FilterSummary", false)), - eventsByType_() { - for (auto& i : eventsByType_) - i = 0; -} - -HLTHcalCalibTypeFilter::~HLTHcalCalibTypeFilter() { - // do anything here that needs to be done at desctruction time - // (e.g. close files, deallocate resources etc.) -} + : inputToken_(consumes(config.getParameter("InputTag"))), + calibTypes_(config.getParameter >("CalibTypes")) {} void HLTHcalCalibTypeFilter::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { edm::ParameterSetDescription desc; desc.add("InputTag", edm::InputTag("source")); - std::vector temp; - for (int i = 1; i <= 5; i++) - temp.push_back(i); - desc.add >("CalibTypes", temp); - desc.addUntracked("FilterSummary", false); + desc.add >("CalibTypes", {1, 2, 3, 4, 5}); descriptions.add("hltHcalCalibTypeFilter", desc); } @@ -73,34 +75,31 @@ void HLTHcalCalibTypeFilter::fillDescriptions(edm::ConfigurationDescriptions& de // ------------ method called on each new Event ------------ bool HLTHcalCalibTypeFilter::filter(edm::StreamID, edm::Event& iEvent, const edm::EventSetup& iSetup) const { - using namespace edm; + auto const& rawdata = iEvent.get(inputToken_); - edm::Handle rawdata; - iEvent.getByToken(DataInputToken_, rawdata); + // some inits + int numZeroes = 0, numPositives = 0; - // some inits - int numZeroes(0), numPositives(0); - - // loop over all HCAL FEDs + // loop over all HCAL FEDs for (int fed = FEDNumbering::MINHCALFEDID; fed <= FEDNumbering::MAXHCALuTCAFEDID; fed++) { - // skip FEDs in between VME and uTCA + // skip FEDs in between VME and uTCA if (fed > FEDNumbering::MAXHCALFEDID && fed < FEDNumbering::MINHCALuTCAFEDID) continue; - // get raw data and check if there are empty feds - const FEDRawData& fedData = rawdata->FEDData(fed); + // get raw data and check if there are empty feds + const FEDRawData& fedData = rawdata.FEDData(fed); if (fedData.size() < 24) continue; if (fed <= FEDNumbering::MAXHCALFEDID) { - // VME get event type + // VME get event type int eventtype = ((const HcalDCCHeader*)(fedData.data()))->getCalibType(); if (eventtype == 0) numZeroes++; else numPositives++; } else { - // UTCA + // UTCA hcal::AMC13Header const* hamc13 = (hcal::AMC13Header const*)fedData.data(); for (int iamc = 0; iamc < hamc13->NAMC(); iamc++) { HcalUHTRData uhtr(hamc13->AMCPayload(iamc), hamc13->AMCSize(iamc)); @@ -113,11 +112,9 @@ bool HLTHcalCalibTypeFilter::filter(edm::StreamID, edm::Event& iEvent, const edm } } - // - // if there are FEDs with Non-Collission event type, check what the majority is - // if calibs - true - // if 0s - false - // + // if there are FEDs with Non-Collision event type, check what the majority is + // if calibs - true + // if 0s - false if (numPositives > 0) { if (numPositives > numZeroes) return true; @@ -125,21 +122,11 @@ bool HLTHcalCalibTypeFilter::filter(edm::StreamID, edm::Event& iEvent, const edm edm::LogWarning("HLTHcalCalibTypeFilter") << "Conflicting Calibration Types found"; } - // return false if there are no positives - // and if the majority has 0 calib type + // return false if there are no positives + // and if the majority has 0 calib type return false; } -// ------------ method called once each job just after ending the event loop ------------ -void HLTHcalCalibTypeFilter::endJob() { - if (Summary_) - edm::LogWarning("HLTHcalCalibTypeFilter") - << "Summary of filter decisions: " << eventsByType_.at(hc_Null) << "(No Calib), " - << eventsByType_.at(hc_Pedestal) << "(Pedestal), " << eventsByType_.at(hc_RADDAM) << "(RADDAM), " - << eventsByType_.at(hc_HBHEHPD) << "(HBHE/HPD), " << eventsByType_.at(hc_HOHPD) << "(HO/HPD), " - << eventsByType_.at(hc_HFPMT) << "(HF/PMT)"; -} - // declare this class as a framework plugin #include "FWCore/Framework/interface/MakerMacros.h" DEFINE_FWK_MODULE(HLTHcalCalibTypeFilter); diff --git a/HLTrigger/special/plugins/HLTHcalCalibTypeFilter.h b/HLTrigger/special/plugins/HLTHcalCalibTypeFilter.h deleted file mode 100644 index 499cc8f19b292..0000000000000 --- a/HLTrigger/special/plugins/HLTHcalCalibTypeFilter.h +++ /dev/null @@ -1,59 +0,0 @@ -#ifndef HLTHcalCalibTypeFilter_h -#define HLTHcalCalibTypeFilter_h -// -*- C++ -*- -// -// Package: HLTHcalCalibTypeFilter -// Class: HLTHcalCalibTypeFilter -// -/**\class HLTHcalCalibTypeFilter HLTHcalCalibTypeFilter.cc filter/HLTHcalCalibTypeFilter/src/HLTHcalCalibTypeFilter.cc - -Description: Filter to select HCAL abort gap events - -Implementation: - -*/ -// -// Original Author: Bryan DAHMES -// Created: Tue Jan 22 13:55:00 CET 2008 -// -// - -// include files -#include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/Event.h" -#include "FWCore/Framework/interface/global/EDFilter.h" -#include "FWCore/ParameterSet/interface/ParameterSet.h" - -#include "DataFormats/FEDRawData/interface/FEDRawData.h" -#include "DataFormats/FEDRawData/interface/FEDRawDataCollection.h" - -#include -#include -#include - -namespace edm { - class ConfigurationDescriptions; -} - -// -// class declaration -// - -class HLTHcalCalibTypeFilter : public edm::global::EDFilter<> { -public: - explicit HLTHcalCalibTypeFilter(const edm::ParameterSet&); - ~HLTHcalCalibTypeFilter() override; - static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); - -private: - bool filter(edm::StreamID, edm::Event&, const edm::EventSetup&) const override; - void endJob(void) override; - - // ----------member data --------------------------- - const edm::EDGetTokenT DataInputToken_; - const std::vector CalibTypes_; - const bool Summary_; - mutable std::array, 8> eventsByType_; -}; - -#endif diff --git a/HLTrigger/special/plugins/HLTPPSCalFilter.cc b/HLTrigger/special/plugins/HLTPPSCalFilter.cc new file mode 100644 index 0000000000000..f650ac9224ea7 --- /dev/null +++ b/HLTrigger/special/plugins/HLTPPSCalFilter.cc @@ -0,0 +1,120 @@ +// Mariana Araujo +// mariana.araujo@cern.ch +// 2020-12-30 +// +// HLT filter module to select events with min and max multiplicity +// in each tracker of the PPS for PCL +// Adapted from a preexisting filter code by Laurent Forthomme +// + +#include "FWCore/Framework/interface/global/EDFilter.h" +#include "FWCore/Framework/interface/Event.h" +#include "FWCore/Framework/interface/EventSetup.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" +#include "FWCore/MessageLogger/interface/MessageLogger.h" +#include "FWCore/Utilities/interface/InputTag.h" + +#include "DataFormats/Common/interface/Ref.h" +#include "DataFormats/Common/interface/Handle.h" +#include "DataFormats/Common/interface/DetSet.h" +#include "DataFormats/Common/interface/DetSetVector.h" + +#include "DataFormats/HLTReco/interface/TriggerTypeDefs.h" +#include "DataFormats/HLTReco/interface/TriggerFilterObjectWithRefs.h" + +#include "DataFormats/CTPPSDetId/interface/CTPPSPixelDetId.h" + +#include "DataFormats/CTPPSReco/interface/CTPPSPixelLocalTrack.h" // pixel + +#include + +class HLTPPSCalFilter : public edm::global::EDFilter<> { +public: + explicit HLTPPSCalFilter(const edm::ParameterSet&); + ~HLTPPSCalFilter() override = default; + + static void fillDescriptions(edm::ConfigurationDescriptions&); + bool filter(edm::StreamID, edm::Event&, const edm::EventSetup&) const override; + +private: + const edm::InputTag pixelLocalTrackInputTag_; // Input tag identifying the pixel detector + const edm::EDGetTokenT> pixelLocalTrackToken_; + + const int minTracks_; + const int maxTracks_; + + const bool do_express_; +}; + +void HLTPPSCalFilter::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { + edm::ParameterSetDescription desc; + + desc.add("pixelLocalTrackInputTag", edm::InputTag("ctppsPixelLocalTracks")) + ->setComment("input tag of the pixel local track collection"); + + desc.add("minTracks", 1)->setComment("minimum number of tracks in pot"); + desc.add("maxTracks", -1)->setComment("maximum number of tracks in pot"); + + desc.add("do_express", true)->setComment("toggle on filter type; true for Express, false for Prompt"); + + desc.add("triggerType", trigger::TriggerTrack); + + descriptions.add("hltPPSCalFilter", desc); +} + +HLTPPSCalFilter::HLTPPSCalFilter(const edm::ParameterSet& iConfig) + : pixelLocalTrackInputTag_(iConfig.getParameter("pixelLocalTrackInputTag")), + pixelLocalTrackToken_(consumes>(pixelLocalTrackInputTag_)), + minTracks_(iConfig.getParameter("minTracks")), + maxTracks_(iConfig.getParameter("maxTracks")), + do_express_(iConfig.getParameter("do_express")) {} + +bool HLTPPSCalFilter::filter(edm::StreamID, edm::Event& iEvent, const edm::EventSetup& iSetup) const { + // Helper tool to count valid tracks + const auto valid_trks = [](const auto& trk) { return trk.isValid(); }; + + // map for assigning filter pass / fail + std::unordered_map pixel_filter_; + + // pixel map definition + pixel_filter_[CTPPSPixelDetId(0, 0, 3)] = false; + pixel_filter_[CTPPSPixelDetId(0, 2, 3)] = false; + pixel_filter_[CTPPSPixelDetId(1, 0, 3)] = false; + pixel_filter_[CTPPSPixelDetId(1, 2, 3)] = false; + + // filter on pixels (2017+) selection + edm::Handle> pixelTracks; + iEvent.getByToken(pixelLocalTrackToken_, pixelTracks); + + for (const auto& rpv : *pixelTracks) { + if (pixel_filter_.count(rpv.id) == 0) { + continue; + } + // assume pass condition if there is at least one track + pixel_filter_.at(rpv.id) = true; + + // count number of valid tracks + const auto ntrks = std::count_if(rpv.begin(), rpv.end(), valid_trks); + // fail condition if ntrks not within minTracks, maxTracks values + if (minTracks_ > 0 && ntrks < minTracks_) + pixel_filter_.at(rpv.id) = false; + if (maxTracks_ > 0 && ntrks > maxTracks_) + pixel_filter_.at(rpv.id) = false; + } + + // compilation of filter conditions + if (do_express_) { + return (pixel_filter_.at(CTPPSPixelDetId(0, 0, 3)) && pixel_filter_.at(CTPPSPixelDetId(0, 2, 3))) || + (pixel_filter_.at(CTPPSPixelDetId(1, 0, 3)) && pixel_filter_.at(CTPPSPixelDetId(1, 2, 3))); + } else { + return (pixel_filter_.at(CTPPSPixelDetId(0, 0, 3)) || pixel_filter_.at(CTPPSPixelDetId(0, 2, 3))) || + (pixel_filter_.at(CTPPSPixelDetId(1, 0, 3)) || pixel_filter_.at(CTPPSPixelDetId(1, 2, 3))); + } + + return false; +} + +// define as a framework module +#include "FWCore/Framework/interface/MakerMacros.h" +DEFINE_FWK_MODULE(HLTPPSCalFilter); diff --git a/HLTrigger/special/plugins/HLTRegionalEcalResonanceFilter.cc b/HLTrigger/special/plugins/HLTRegionalEcalResonanceFilter.cc index 72dc5b0e82eba..6d9ee051402f5 100644 --- a/HLTrigger/special/plugins/HLTRegionalEcalResonanceFilter.cc +++ b/HLTrigger/special/plugins/HLTRegionalEcalResonanceFilter.cc @@ -22,6 +22,8 @@ HLTRegionalEcalResonanceFilter::HLTRegionalEcalResonanceFilter(const edm::Parame endcapHitsToken_ = consumes(endcapHits_); endcapClustersToken_ = consumes(endcapClusters_); + store5x5RecHitEB_ = false; + doSelBarrel_ = iConfig.getParameter("doSelBarrel"); if (doSelBarrel_) { diff --git a/HLTriggerOffline/Egamma/interface/EmDQM.h b/HLTriggerOffline/Egamma/interface/EmDQM.h index 0e222cd97de72..b81aac0219e35 100644 --- a/HLTriggerOffline/Egamma/interface/EmDQM.h +++ b/HLTriggerOffline/Egamma/interface/EmDQM.h @@ -29,7 +29,6 @@ #include "HepMC/GenParticle.h" #include "SimDataFormats/GeneratorProducts/interface/HepMCProduct.h" -#include #include #include "TDirectory.h" diff --git a/HLTriggerOffline/Egamma/src/EmDQM.cc b/HLTriggerOffline/Egamma/src/EmDQM.cc index 56b74445cc52a..0a1fb605a98f2 100644 --- a/HLTriggerOffline/Egamma/src/EmDQM.cc +++ b/HLTriggerOffline/Egamma/src/EmDQM.cc @@ -1215,7 +1215,7 @@ double EmDQM::getPrimaryEtCut(const std::string &path) { boost::smatch what; if (boost::regex_match(path, what, reg, boost::match_extra)) { - minEt = boost::lexical_cast(what[2]); + minEt = std::stod(what[2]); } return minEt; diff --git a/HLTriggerOffline/Higgs/BuildFile.xml b/HLTriggerOffline/Higgs/plugins/BuildFile.xml similarity index 100% rename from HLTriggerOffline/Higgs/BuildFile.xml rename to HLTriggerOffline/Higgs/plugins/BuildFile.xml diff --git a/HLTriggerOffline/Higgs/src/EVTColContainer.cc b/HLTriggerOffline/Higgs/plugins/EVTColContainer.h similarity index 100% rename from HLTriggerOffline/Higgs/src/EVTColContainer.cc rename to HLTriggerOffline/Higgs/plugins/EVTColContainer.h diff --git a/HLTriggerOffline/Higgs/src/HLTHiggsPlotter.cc b/HLTriggerOffline/Higgs/plugins/HLTHiggsPlotter.cc similarity index 98% rename from HLTriggerOffline/Higgs/src/HLTHiggsPlotter.cc rename to HLTriggerOffline/Higgs/plugins/HLTHiggsPlotter.cc index 5e9d69624b746..9571590f3b00b 100644 --- a/HLTriggerOffline/Higgs/src/HLTHiggsPlotter.cc +++ b/HLTriggerOffline/Higgs/plugins/HLTHiggsPlotter.cc @@ -11,9 +11,9 @@ #include "DataFormats/HLTReco/interface/TriggerEvent.h" -#include "HLTriggerOffline/Higgs/interface/HLTHiggsPlotter.h" -#include "HLTriggerOffline/Higgs/interface/HLTHiggsSubAnalysis.h" -#include "HLTriggerOffline/Higgs/src/EVTColContainer.cc" +#include "HLTHiggsPlotter.h" +#include "HLTHiggsSubAnalysis.h" +#include "EVTColContainer.h" #include "TPRegexp.h" diff --git a/HLTriggerOffline/Higgs/interface/HLTHiggsPlotter.h b/HLTriggerOffline/Higgs/plugins/HLTHiggsPlotter.h similarity index 98% rename from HLTriggerOffline/Higgs/interface/HLTHiggsPlotter.h rename to HLTriggerOffline/Higgs/plugins/HLTHiggsPlotter.h index b9ee5d42e2d3f..b46d634fb0bfb 100644 --- a/HLTriggerOffline/Higgs/interface/HLTHiggsPlotter.h +++ b/HLTriggerOffline/Higgs/plugins/HLTHiggsPlotter.h @@ -32,7 +32,7 @@ #include "DQMServices/Core/interface/DQMStore.h" -#include "HLTriggerOffline/Higgs/src/MatchStruct.cc" +#include "MatchStruct.h" #include #include diff --git a/HLTriggerOffline/Higgs/src/HLTHiggsSubAnalysis.cc b/HLTriggerOffline/Higgs/plugins/HLTHiggsSubAnalysis.cc similarity index 99% rename from HLTriggerOffline/Higgs/src/HLTHiggsSubAnalysis.cc rename to HLTriggerOffline/Higgs/plugins/HLTHiggsSubAnalysis.cc index 5acef2d146a8f..a1b999bb128ed 100644 --- a/HLTriggerOffline/Higgs/src/HLTHiggsSubAnalysis.cc +++ b/HLTriggerOffline/Higgs/plugins/HLTHiggsSubAnalysis.cc @@ -7,9 +7,9 @@ #include "DataFormats/Common/interface/Handle.h" -#include "HLTriggerOffline/Higgs/interface/HLTHiggsSubAnalysis.h" -#include "HLTriggerOffline/Higgs/src/EVTColContainer.cc" -#include "HLTriggerOffline/Higgs/src/MatchStruct.cc" +#include "HLTHiggsSubAnalysis.h" +#include "EVTColContainer.h" +#include "MatchStruct.h" #include "FWCore/Common/interface/TriggerNames.h" @@ -19,9 +19,6 @@ #include "DataFormats/Common/interface/TriggerResults.h" #include "FWCore/Common/interface/TriggerNames.h" -#include "HLTriggerOffline/Higgs/interface/HLTHiggsSubAnalysis.h" -#include "HLTriggerOffline/Higgs/src/MatchStruct.cc" - #include "TPRegexp.h" #include "TRegexp.h" #include "TString.h" diff --git a/HLTriggerOffline/Higgs/interface/HLTHiggsSubAnalysis.h b/HLTriggerOffline/Higgs/plugins/HLTHiggsSubAnalysis.h similarity index 99% rename from HLTriggerOffline/Higgs/interface/HLTHiggsSubAnalysis.h rename to HLTriggerOffline/Higgs/plugins/HLTHiggsSubAnalysis.h index e8950e468d696..0ba7a84eee7c8 100644 --- a/HLTriggerOffline/Higgs/interface/HLTHiggsSubAnalysis.h +++ b/HLTriggerOffline/Higgs/plugins/HLTHiggsSubAnalysis.h @@ -47,7 +47,7 @@ #include "HLTrigger/HLTcore/interface/HLTConfigProvider.h" -#include "HLTriggerOffline/Higgs/interface/HLTHiggsPlotter.h" +#include "HLTHiggsPlotter.h" #include #include diff --git a/HLTriggerOffline/Higgs/src/HLTHiggsValidator.cc b/HLTriggerOffline/Higgs/plugins/HLTHiggsValidator.cc similarity index 94% rename from HLTriggerOffline/Higgs/src/HLTHiggsValidator.cc rename to HLTriggerOffline/Higgs/plugins/HLTHiggsValidator.cc index 5f0cbc88a7b25..f456647e124fb 100644 --- a/HLTriggerOffline/Higgs/src/HLTHiggsValidator.cc +++ b/HLTriggerOffline/Higgs/plugins/HLTHiggsValidator.cc @@ -16,8 +16,8 @@ //#include "FWCore/Framework/interface/MakerMacros.h" -#include "HLTriggerOffline/Higgs/interface/HLTHiggsValidator.h" -#include "HLTriggerOffline/Higgs/src/EVTColContainer.cc" +#include "HLTHiggsValidator.h" +#include "EVTColContainer.h" //////// Class Methods /////////////////////////////////////////////////////// // Constructor diff --git a/HLTriggerOffline/Higgs/interface/HLTHiggsValidator.h b/HLTriggerOffline/Higgs/plugins/HLTHiggsValidator.h similarity index 96% rename from HLTriggerOffline/Higgs/interface/HLTHiggsValidator.h rename to HLTriggerOffline/Higgs/plugins/HLTHiggsValidator.h index 207b3831a0bdd..208b240274a59 100644 --- a/HLTriggerOffline/Higgs/interface/HLTHiggsValidator.h +++ b/HLTriggerOffline/Higgs/plugins/HLTHiggsValidator.h @@ -21,7 +21,7 @@ #include "DQMServices/Core/interface/DQMStore.h" -#include "HLTriggerOffline/Higgs/interface/HLTHiggsSubAnalysis.h" +#include "HLTHiggsSubAnalysis.h" #include #include diff --git a/HLTriggerOffline/Higgs/src/MatchStruct.cc b/HLTriggerOffline/Higgs/plugins/MatchStruct.h similarity index 100% rename from HLTriggerOffline/Higgs/src/MatchStruct.cc rename to HLTriggerOffline/Higgs/plugins/MatchStruct.h diff --git a/HLTriggerOffline/Higgs/src/SealModules.cc b/HLTriggerOffline/Higgs/plugins/SealModules.cc similarity index 69% rename from HLTriggerOffline/Higgs/src/SealModules.cc rename to HLTriggerOffline/Higgs/plugins/SealModules.cc index 17c6f67a91a0a..8a9da5d613fe5 100644 --- a/HLTriggerOffline/Higgs/src/SealModules.cc +++ b/HLTriggerOffline/Higgs/plugins/SealModules.cc @@ -2,6 +2,6 @@ #include "FWCore/PluginManager/interface/ModuleDef.h" #include "FWCore/Framework/interface/MakerMacros.h" -#include "HLTriggerOffline/Higgs/interface/HLTHiggsValidator.h" +#include "HLTHiggsValidator.h" DEFINE_FWK_MODULE(HLTHiggsValidator); diff --git a/HeavyFlavorAnalysis/SpecificDecay/interface/BPHMuonChargeSelect.h b/HeavyFlavorAnalysis/SpecificDecay/interface/BPHMuonChargeSelect.h deleted file mode 100644 index 3f7d574ed79fc..0000000000000 --- a/HeavyFlavorAnalysis/SpecificDecay/interface/BPHMuonChargeSelect.h +++ /dev/null @@ -1,54 +0,0 @@ -#ifndef HeavyFlavorAnalysis_SpecificDecay_BPHMuonChargeSelect_h -#define HeavyFlavorAnalysis_SpecificDecay_BPHMuonChargeSelect_h -/** \class BPHMuonChargeSelect - * - * Description: - * Class for muon selection by charge - * - * \author Paolo Ronchese INFN Padova - * - */ - -//---------------------- -// Base Class Headers -- -//---------------------- -#include "HeavyFlavorAnalysis/SpecificDecay/interface/BPHParticleChargeSelect.h" - -//------------------------------------ -// Collaborating Class Declarations -- -//------------------------------------ -#include "DataFormats/PatCandidates/interface/Muon.h" - -//--------------- -// C++ Headers -- -//--------------- - -// --------------------- -// -- Class Interface -- -// --------------------- - -class BPHMuonChargeSelect : public BPHParticleChargeSelect { -public: - /** Constructor - */ - BPHMuonChargeSelect(int c) : BPHParticleChargeSelect(c) {} - - // deleted copy constructor and assignment operator - BPHMuonChargeSelect(const BPHMuonChargeSelect& x) = delete; - BPHMuonChargeSelect& operator=(const BPHMuonChargeSelect& x) = delete; - - /** Destructor - */ - ~BPHMuonChargeSelect() override {} - - /** Operations - */ - /// select muon - bool accept(const reco::Candidate& cand) const override { - if (dynamic_cast(&cand) == nullptr) - return false; - return BPHParticleChargeSelect::accept(cand); - }; -}; - -#endif diff --git a/HeavyFlavorAnalysis/SpecificDecay/interface/BPHParticleChargeSelect.h b/HeavyFlavorAnalysis/SpecificDecay/interface/BPHParticleChargeSelect.h deleted file mode 100644 index e85f05677bad2..0000000000000 --- a/HeavyFlavorAnalysis/SpecificDecay/interface/BPHParticleChargeSelect.h +++ /dev/null @@ -1,73 +0,0 @@ -#ifndef HeavyFlavorAnalysis_SpecificDecay_BPHParticleChargeSelect_h -#define HeavyFlavorAnalysis_SpecificDecay_BPHParticleChargeSelect_h -/** \class BPHParticleChargeSelect - * - * Description: - * Class for particle selection by charge - * - * \author Paolo Ronchese INFN Padova - * - */ - -//---------------------- -// Base Class Headers -- -//---------------------- -#include "HeavyFlavorAnalysis/RecoDecay/interface/BPHRecoSelect.h" - -//------------------------------------ -// Collaborating Class Declarations -- -//------------------------------------ -#include "DataFormats/RecoCandidate/interface/RecoCandidate.h" - -//--------------- -// C++ Headers -- -//--------------- - -// --------------------- -// -- Class Interface -- -// --------------------- - -class BPHParticleChargeSelect : public BPHRecoSelect { -public: - /** Constructor - */ - BPHParticleChargeSelect(int c) : charge(c ? (c > 0 ? 1 : -1) : 0) {} - - // deleted copy constructor and assignment operator - BPHParticleChargeSelect(const BPHParticleChargeSelect& x) = delete; - BPHParticleChargeSelect& operator=(const BPHParticleChargeSelect& x) = delete; - - /** Destructor - */ - ~BPHParticleChargeSelect() override {} - - /** Operations - */ - /// select particle - bool accept(const reco::Candidate& cand) const override { - switch (charge) { - default: - case 0: - return (cand.charge() != 0); - case 1: - return (cand.charge() > 0); - case -1: - return (cand.charge() < 0); - } - return true; - }; - - /// set selection charge - void setCharge(int c) { - charge = (c ? (c > 0 ? 1 : -1) : 0); - return; - } - - /// get selection charge - double getCharge() const { return charge; } - -private: - int charge; -}; - -#endif diff --git a/HeterogeneousCore/CUDACore/interface/ESProduct.h b/HeterogeneousCore/CUDACore/interface/ESProduct.h index 676d3e9d1c0d9..fbe1825b0fa4d 100644 --- a/HeterogeneousCore/CUDACore/interface/ESProduct.h +++ b/HeterogeneousCore/CUDACore/interface/ESProduct.h @@ -9,6 +9,7 @@ #include "FWCore/Utilities/interface/thread_safety_macros.h" #include "HeterogeneousCore/CUDAServices/interface/numberOfDevices.h" #include "HeterogeneousCore/CUDAUtilities/interface/EventCache.h" +#include "HeterogeneousCore/CUDAUtilities/interface/ScopedSetDevice.h" #include "HeterogeneousCore/CUDAUtilities/interface/cudaCheck.h" #include "HeterogeneousCore/CUDAUtilities/interface/currentDevice.h" #include "HeterogeneousCore/CUDAUtilities/interface/eventWorkHasCompleted.h" @@ -19,10 +20,15 @@ namespace cms { class ESProduct { public: ESProduct() : gpuDataPerDevice_(numberOfDevices()) { - for (size_t i = 0; i < gpuDataPerDevice_.size(); ++i) { - gpuDataPerDevice_[i].m_event = getEventCache().get(); + if (not gpuDataPerDevice_.empty()) { + cms::cuda::ScopedSetDevice scopedDevice; + for (size_t i = 0; i < gpuDataPerDevice_.size(); ++i) { + scopedDevice.set(i); + gpuDataPerDevice_[i].m_event = getEventCache().get(); + } } } + ~ESProduct() = default; // transferAsync should be a function of (T&, cudaStream_t) @@ -30,12 +36,10 @@ namespace cms { // to the CUDA stream template const T& dataForCurrentDeviceAsync(cudaStream_t cudaStream, F transferAsync) const { - auto device = currentDevice(); - + int device = currentDevice(); auto& data = gpuDataPerDevice_[device]; - // If GPU data has already been filled, we can return it - // immediately + // If the GPU data has already been filled, we can return it immediately if (not data.m_filled.load()) { // It wasn't, so need to fill it std::scoped_lock lk{data.m_mutex}; @@ -103,4 +107,4 @@ namespace cms { } // namespace cuda } // namespace cms -#endif +#endif // HeterogeneousCore_CUDACore_ESProduct_h diff --git a/HeterogeneousCore/CUDAServices/BuildFile.xml b/HeterogeneousCore/CUDAServices/BuildFile.xml index 5fcaf5e5527b0..a48e1c639eaf3 100644 --- a/HeterogeneousCore/CUDAServices/BuildFile.xml +++ b/HeterogeneousCore/CUDAServices/BuildFile.xml @@ -5,6 +5,7 @@ + diff --git a/HeterogeneousCore/CUDAServices/interface/CUDAService.h b/HeterogeneousCore/CUDAServices/interface/CUDAService.h index 5295af75513b0..d24571b8e48ce 100644 --- a/HeterogeneousCore/CUDAServices/interface/CUDAService.h +++ b/HeterogeneousCore/CUDAServices/interface/CUDAService.h @@ -33,6 +33,7 @@ class CUDAService { int numberOfDevices_ = 0; std::vector> computeCapabilities_; bool enabled_ = false; + bool verbose_ = false; }; #endif diff --git a/HeterogeneousCore/CUDAServices/src/CUDAService.cc b/HeterogeneousCore/CUDAServices/src/CUDAService.cc index 5d1bd30264186..346c81267ec49 100644 --- a/HeterogeneousCore/CUDAServices/src/CUDAService.cc +++ b/HeterogeneousCore/CUDAServices/src/CUDAService.cc @@ -3,6 +3,8 @@ #include #include +#include +#include #include "FWCore/MessageLogger/interface/MessageLogger.h" #include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" @@ -10,14 +12,14 @@ #include "FWCore/ParameterSet/interface/ParameterSetDescription.h" #include "FWCore/Utilities/interface/ReusableObjectHolder.h" #include "HeterogeneousCore/CUDAServices/interface/CUDAService.h" -#include "HeterogeneousCore/CUDAUtilities/interface/cudaCheck.h" #include "HeterogeneousCore/CUDAUtilities/interface/EventCache.h" #include "HeterogeneousCore/CUDAUtilities/interface/StreamCache.h" +#include "HeterogeneousCore/CUDAUtilities/interface/cachingAllocators.h" +#include "HeterogeneousCore/CUDAUtilities/interface/cudaCheck.h" +#include "HeterogeneousCore/CUDAUtilities/interface/currentDevice.h" #include "HeterogeneousCore/CUDAUtilities/interface/device_unique_ptr.h" #include "HeterogeneousCore/CUDAUtilities/interface/host_unique_ptr.h" -#include "HeterogeneousCore/CUDAUtilities/interface/currentDevice.h" -#include "HeterogeneousCore/CUDAUtilities/src/getCachingDeviceAllocator.h" -#include "HeterogeneousCore/CUDAUtilities/src/getCachingHostAllocator.h" +#include "HeterogeneousCore/CUDAUtilities/interface/nvmlCheck.h" void setCudaLimit(cudaLimit limit, const char* name, size_t request) { // read the current device @@ -31,7 +33,7 @@ void setCudaLimit(cudaLimit limit, const char* name, size_t request) { } // read back the limit value size_t value; - cudaCheck(cudaDeviceGetLimit(&value, limit)); + result = cudaDeviceGetLimit(&value, limit); if (cudaSuccess != result) { edm::LogWarning("CUDAService") << "CUDA device " << device << ": failed to set limit \"" << name << "\" to " << request << ", current value is " << value; @@ -78,12 +80,22 @@ constexpr unsigned int getCudaCoresPerSM(unsigned int major, unsigned int minor) case 75: // SM 7.5: TU10x class return 64; + // Ampere architecture + case 80: // SM 8.0: GA100 class + return 64; + case 86: // SM 8.6: GA10x class + return 128; + // unknown architecture, return a default value default: return 64; } } +std::string decodeVersion(int version) { + return std::to_string(version / 1000) + '.' + std::to_string(version % 1000 / 10); +} + namespace { template