Skip to content

Commit

Permalink
Merge pull request #37823 from CMSTrackerDPG/additionalDigiInfo_from-…
Browse files Browse the repository at this point in the history
…CMSSW_12_4_0_pre1

Modifications of the Pixel Charge Reweighting for RunDependent MC
  • Loading branch information
cmsbuild committed Jun 2, 2022
2 parents 566498e + ea77c7a commit 4e30acd
Show file tree
Hide file tree
Showing 20 changed files with 846 additions and 67 deletions.
@@ -0,0 +1,2 @@
import FWCore.ParameterSet.Config as cms
runDependentForPixel = cms.Modifier()
1 change: 1 addition & 0 deletions Configuration/PyReleaseValidation/python/relval_premix.py
Expand Up @@ -49,6 +49,7 @@
workflows[250202.181]=['',['TTbar_13UP18','PREMIXUP18_PU25','DIGIPRMXLOCALUP18_PU25','RECOPRMXUP18_PU25','HARVESTUP18_PU25']]
workflows[250202.182]=['',['TTbar_13UP18_RD','DIGIPRMXUP18_PU25_RD','RECOPRMXUP18_PU25_RD','HARVESTUP18_PU25_RD']]
workflows[250202.183]=['',['TTbar_13UP18_RD_IB','DIGIPRMXUP18_PU25_RD_IB','RECOPRMXUP18_PU25_RD','HARVESTUP18_PU25_RD']]
workflows[250202.184]=['',['TTbar_13UP18','PREMIXUP18_PU25_RDPix','DIGIPRMXLOCALUP18_PU25_RDPix','RECOPRMXUP18_PU25','HARVESTUP18_PU25']]
workflows[250203.18]=['',['H125GGgluonfusion_13UP18','DIGIPRMXUP18_PU25','RECOPRMXUP18_PU25','HARVESTUP18_PU25']]
workflows[250204.18]=['',['QQH1352T_13UP18','DIGIPRMXUP18_PU25','RECOPRMXUP18_PU25','HARVESTUP18_PU25']]
workflows[250205.18]=['',['ZTT_13UP18','DIGIPRMXUP18_PU25','RECOPRMXUP18_PU25','HARVESTUP18_PU25']]
Expand Down
8 changes: 8 additions & 0 deletions Configuration/PyReleaseValidation/python/relval_steps.py
Expand Up @@ -1771,10 +1771,16 @@ def lhegensim2018ml(fragment,howMuch):
{'--era':'Run2_2018'},
premixUp2015Defaults])

premixUp2018_RDPix = merge([{'--conditions':'auto:phase1_2018_realistic_rd'},
{'--era':'Run2_2018'},
{'--procModifiers':'premix_stage1,runDependentForPixel'},
premixUp2015Defaults])

steps['PREMIXUP15_PU25']=merge([PU25,Kby(100,100),premixUp2015Defaults])
steps['PREMIXUP15_PU50']=merge([PU50,Kby(100,100),premixUp2015Defaults50ns])
steps['PREMIXUP17_PU25']=merge([PU25UP17,Kby(100,100),premixUp2017Defaults])
steps['PREMIXUP18_PU25']=merge([PU25UP18,Kby(100,100),premixUp2018Defaults])
steps['PREMIXUP18_PU25_RDPix']=merge([PU25UP18,Kby(100,100),premixUp2018_RDPix])

digiPremixUp2015Defaults25ns = {
'--conditions' : 'auto:run2_mc',
Expand Down Expand Up @@ -1847,6 +1853,8 @@ def lhegensim2018ml(fragment,howMuch):
# configuration to simulate cross run number boundary in IB, given 5 events per lumi
steps['DIGIPRMXUP18_PU25_RD_IB']=merge([{'--conditions':'auto:phase1_2018_realistic_rd', '--customise_commands':"\"process.source.setRunNumberForEachLumi = cms.untracked.vuint32(315257,316083) \"", '--procModifiers':'premix_stage2,runDependent'}, digiPremixRD2018, digiPremixUp2018Defaults25ns])

steps['DIGIPRMXLOCALUP18_PU25_RDPix']=merge([{'--conditions':'auto:phase1_2018_realistic_rd', '--procModifiers':'premix_stage2,runDependentForPixel'}, digiPremixLocalPileupUp2018Defaults25ns])

premixProd25ns = {'-s' : 'DIGI,DATAMIX,L1,DIGI2RAW,HLT:@relval2016',
'--eventcontent' : 'PREMIXRAW',
'--datatier' : 'PREMIXRAW'}
Expand Down
1 change: 1 addition & 0 deletions SimDataFormats/TrackerDigiSimLink/BuildFile.xml
@@ -1,6 +1,7 @@
<use name="DataFormats/Common"/>
<use name="SimDataFormats/EncodedEventId"/>
<use name="boost"/>
<use name="DataFormats/GeometryVector"/>
<export>
<lib name="1"/>
</export>
43 changes: 43 additions & 0 deletions SimDataFormats/TrackerDigiSimLink/interface/PixelSimHitExtraInfo.h
@@ -0,0 +1,43 @@
#ifndef PixelSimHitExtraInfo_h
#define PixelSimHitExtraInfo_h

#include "DataFormats/GeometryVector/interface/LocalPoint.h"
#include <vector>
#include <cstdint>

class PixelSimHitExtraInfo {
public:
PixelSimHitExtraInfo(size_t Hindex, const Local3DPoint& entryP, const Local3DPoint& exitP, unsigned int ch) {
index_ = Hindex;
theEntryPoint_ = entryP;
theExitPoint_ = exitP;
chan_.push_back(ch);
};
PixelSimHitExtraInfo() = default;
~PixelSimHitExtraInfo() = default;
size_t hitIndex() const { return index_; };
const Local3DPoint& entryPoint() const { return theEntryPoint_; };
const Local3DPoint& exitPoint() const { return theExitPoint_; }
const std::vector<unsigned int>& channel() const { return chan_; };

inline bool operator<(const PixelSimHitExtraInfo& other) const { return hitIndex() < other.hitIndex(); }

void addDigiInfo(unsigned int theDigiChannel) { chan_.push_back(theDigiChannel); }
bool isInTheList(unsigned int channelToCheck) {
bool result_in_the_list = false;
for (unsigned int icheck = 0; icheck < chan_.size(); icheck++) {
if (channelToCheck == chan_[icheck]) {
result_in_the_list = true;
break;
}
}
return result_in_the_list;
}

private:
size_t index_;
Local3DPoint theEntryPoint_;
Local3DPoint theExitPoint_;
std::vector<unsigned int> chan_;
};
#endif
1 change: 1 addition & 0 deletions SimDataFormats/TrackerDigiSimLink/src/classes.h
Expand Up @@ -8,5 +8,6 @@
#include "SimDataFormats/TrackerDigiSimLink/interface/PixelDigiSimLink.h"
#include "SimDataFormats/TrackerDigiSimLink/interface/StripDigiSimLink.h"
#include "SimDataFormats/TrackerDigiSimLink/interface/StripCompactDigiSimLinks.h"
#include "SimDataFormats/TrackerDigiSimLink/interface/PixelSimHitExtraInfo.h"

#endif // TRACKERDIGISIMLINK_CLASSES_H
12 changes: 12 additions & 0 deletions SimDataFormats/TrackerDigiSimLink/src/classes_def.xml
Expand Up @@ -35,4 +35,16 @@
-->
<class name="edm::Wrapper< StripCompactDigiSimLinks >" />

<class name="PixelSimHitExtraInfo" ClassVersion="3">
<version ClassVersion="3" checksum="2247287056"/>
</class>
<class name="edm::DetSet<PixelSimHitExtraInfo>"/>
<class name="std::vector<PixelSimHitExtraInfo>"/>
<class name="edm::DetSetVector<PixelSimHitExtraInfo>"/>
<class name="std::vector<edm::DetSet<PixelSimHitExtraInfo> >"/>
<class name="edm::Wrapper< edm::DetSet<PixelSimHitExtraInfo> >" splitLevel="0" />
<class name="edm::Wrapper< std::vector<edm::DetSet<PixelSimHitExtraInfo> > >" splitLevel="0" />
<class name="edm::Wrapper< edm::DetSetVector<PixelSimHitExtraInfo> >" splitLevel="0" />


</lcgdict>
4 changes: 4 additions & 0 deletions SimGeneral/MixingModule/python/SiPixelSimParameters_cfi.py
Expand Up @@ -49,6 +49,8 @@ def _modifyPixelDigitizerForRun3( digitizer ):
SiPixelQualityLabel = cms.string(''),
KillBadFEDChannels = cms.bool(False),
UseReweighting = cms.bool(False),
applyLateReweighting = cms.bool(False),
store_SimHitEntryExitPoints = cms.bool(False),
PrintClusters = cms.bool(False),
PrintTemplates = cms.bool(False),
DoPixelAging = cms.bool(False),
Expand All @@ -71,6 +73,7 @@ def _modifyPixelDigitizerForRun3( digitizer ):
ThresholdSmearing_BPix_L2 = cms.double(245.0),
NoiseInElectrons = cms.double(175.0),
MissCalibrate = cms.bool(True),
MissCalInLateCR = cms.bool(True),
FPix_SignalResponse_p0 = cms.double(0.0043),
FPix_SignalResponse_p1 = cms.double(1.31),
FPix_SignalResponse_p2 = cms.double(93.6),
Expand All @@ -86,6 +89,7 @@ def _modifyPixelDigitizerForRun3( digitizer ):
ElectronPerAdc = cms.double(135.0),
TofUpperCut = cms.double(12.5),
AdcFullScale = cms.int32(255),
AdcFullScLateCR = cms.int32(255),
TofLowerCut = cms.double(-12.5),
TanLorentzAnglePerTesla_FPix = cms.double(0.106),
TanLorentzAnglePerTesla_BPix = cms.double(0.106),
Expand Down
6 changes: 5 additions & 1 deletion SimGeneral/MixingModule/python/aliases_cfi.py
Expand Up @@ -33,8 +33,9 @@
)
_pixelCommon = cms.VPSet(
cms.PSet(type = cms.string('PixelDigiedmDetSetVector')),
cms.PSet(type = cms.string('PixelDigiSimLinkedmDetSetVector'))
cms.PSet(type = cms.string('PixelDigiSimLinkedmDetSetVector')),
)

simSiPixelDigis = cms.EDAlias(
mix = _pixelCommon
)
Expand Down Expand Up @@ -94,12 +95,15 @@
2 : dict(type = "PHGCSimAccumulator"),
}
)
from Configuration.ProcessModifiers.runDependentForPixel_cff import runDependentForPixel
(runDependentForPixel).toModify(simSiPixelDigis, mix = _pixelCommon + [cms.PSet(type = cms.string('PixelSimHitExtraInfoedmDetSetVector'))])

from Configuration.Eras.Modifier_phase2_hfnose_cff import phase2_hfnose
(~phase2_hfnose).toModify(simHFNoseUnsuppressedDigis, mix = None)

from Configuration.Eras.Modifier_phase1Pixel_cff import phase1Pixel
phase1Pixel.toModify(simSiPixelDigis, mix = _pixelCommon + [cms.PSet(type = cms.string('PixelFEDChanneledmNewDetSetVector'))])
(phase1Pixel & runDependentForPixel).toModify(simSiPixelDigis, mix = _pixelCommon + [cms.PSet(type = cms.string('PixelSimHitExtraInfoedmDetSetVector'))] + [cms.PSet(type = cms.string('PixelFEDChanneledmNewDetSetVector'))])

from Configuration.Eras.Modifier_phase2_tracker_cff import phase2_tracker
phase2_tracker.toModify(simSiStripDigis, mix = None)
Expand Down
11 changes: 11 additions & 0 deletions SimGeneral/MixingModule/python/pixelDigitizer_cfi.py
Expand Up @@ -29,3 +29,14 @@
# is needed there in stage2.
(premix_stage2 & phase2_tracker).toModify(pixelDigitizer, **_premixStage1ModifyDict)
from CalibTracker.SiPixelESProducers.PixelFEDChannelCollectionProducer_cfi import *

# Run-dependent MC
from Configuration.ProcessModifiers.runDependentForPixel_cff import runDependentForPixel
(runDependentForPixel & premix_stage1).toModify(pixelDigitizer,
UseReweighting = False,
applyLateReweighting = False,
store_SimHitEntryExitPoints = True,
AdcFullScale = 1023,
MissCalibrate = False
)

8 changes: 8 additions & 0 deletions SimGeneral/PreMixingModule/python/mixOne_premix_on_sim_cfi.py
Expand Up @@ -57,6 +57,7 @@
workerType = cms.string("PreMixingSiPixelWorker"),
pixeldigiCollectionSig = cms.InputTag("simSiPixelDigis"),
pixeldigiCollectionPile = cms.InputTag("simSiPixelDigis"),
pixeldigiExtraCollectionPile = cms.InputTag("simSiPixelDigis"),
PixelDigiCollectionDM = cms.string('siPixelDigisDM'),
),
strip = cms.PSet(
Expand Down Expand Up @@ -318,3 +319,10 @@
# Run-dependent MC
from Configuration.ProcessModifiers.runDependent_cff import runDependent
runDependent.toModify(mixData.workers.ecal, timeDependent=True)
from Configuration.ProcessModifiers.runDependentForPixel_cff import runDependentForPixel
from Configuration.ProcessModifiers.premix_stage2_cff import premix_stage2
(runDependentForPixel & premix_stage2).toModify(mixData.workers.pixel,
UseReweighting=False,
applyLateReweighting=True,
store_SimHitEntryExitPoints=False
)
19 changes: 14 additions & 5 deletions SimTracker/Common/interface/SimHitInfoForLinks.h
Expand Up @@ -11,20 +11,29 @@

class SimHitInfoForLinks {
public:
explicit SimHitInfoForLinks(PSimHit const *hitp, size_t hitindex, unsigned int tofbin)
: eventId_(hitp->eventId()), trackIds_(1, hitp->trackId()), hitIndex_(hitindex), tofBin_(tofbin) {}
explicit SimHitInfoForLinks(PSimHit const *hitp, size_t hitindex, unsigned int tofbin, size_t hitInd4CR, float amp)
: eventId_(hitp->eventId()),
trackIds_(1, hitp->trackId()),
hitIndex_(hitindex),
tofBin_(tofbin),
hitInd4CR_(hitInd4CR),
ampl_(amp) {}

const EncodedEventId &eventId() const { return eventId_; }
const std::vector<unsigned int> &trackIds() const { return trackIds_; }
std::vector<unsigned int> &trackIds() { return trackIds_; } // needed ATM in phase2 digitizer
unsigned int trackId() const { return trackIds_[0]; }
size_t hitIndex() const { return hitIndex_; }
unsigned int tofBin() const { return tofBin_; }
const unsigned int trackId() const { return trackIds_[0]; }
const size_t hitIndex() const { return hitIndex_; }
const unsigned int tofBin() const { return tofBin_; }
const size_t hitIndex4ChargeRew() const { return hitInd4CR_; }
const float getAmpl() const { return ampl_; }

private:
EncodedEventId eventId_;
std::vector<unsigned int> trackIds_;
size_t hitIndex_;
unsigned int tofBin_;
size_t hitInd4CR_;
float ampl_;
};
#endif
49 changes: 49 additions & 0 deletions SimTracker/SiPixelDigitizer/plugins/PixelDigiAddTempInfo.h
@@ -0,0 +1,49 @@
#ifndef PixelDigiAddTempInfo_h
#define PixelDigiAddTempInfo_h

#include "DataFormats/GeometryVector/interface/LocalPoint.h"

class PixelDigiAddTempInfo {
public:
PixelDigiAddTempInfo(unsigned int ch,
size_t Hindex,
const Local3DPoint& entryP,
const Local3DPoint& exitP,
int PType,
int PartID,
uint32_t detID,
float InitCharge) {
chan_ = ch;
index_ = Hindex;
theEntryPoint_ = entryP;
theExitPoint_ = exitP;
theProcessType_ = PType;
thePartID_ = PartID;
detectorID_ = detID;
charge_ = InitCharge;
};
PixelDigiAddTempInfo() = default;
~PixelDigiAddTempInfo() = default;
const unsigned int channel() const { return chan_; };
const size_t hitIndex() const { return index_; };
const Local3DPoint& entryPoint() const { return theEntryPoint_; };
const Local3DPoint& exitPoint() const { return theExitPoint_; }
const int processType() const { return theProcessType_; };
const int trackID() const { return thePartID_; };
const uint32_t detID() const { return detectorID_; };
const float getCharge() const { return charge_; };
void addCharge(float charge_to_be_added) { charge_ += charge_to_be_added; };

inline bool operator<(const PixelDigiAddTempInfo& other) const { return channel() < other.channel(); }

private:
unsigned int chan_;
size_t index_;
Local3DPoint theEntryPoint_;
Local3DPoint theExitPoint_;
int theProcessType_;
int thePartID_;
uint32_t detectorID_;
float charge_;
};
#endif

0 comments on commit 4e30acd

Please sign in to comment.