Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Phase-2 Inner Tracker: combined backport of 33495 and 33508 #33792

Merged
merged 6 commits into from
May 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions Configuration/AlCa/python/autoCondPhase2.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,16 +65,18 @@
'T15' : ( ','.join( [ 'SiPixelGenErrorDBObject_phase2_IT_v6.1.5_25x100_v3_mc',SiPixelGenErrorRecord,connectionString, "", "2021-01-27 10:00:00"] ), ), # cell is 25um (local-x) x 100um (local-y) , VBias=350V
'T21' : ( ','.join( [ 'SiPixelGenErrorDBObject_phase2_IT_v6.1.5_25x100_v3_mc',SiPixelGenErrorRecord,connectionString, "", "2021-01-27 10:00:00"] ), ), # cell is 25um (local-x) x 100um (local-y) , VBias=350V
'T22' : ( ','.join( [ 'SiPixelGenErrorDBObject_phase2_IT_v6.1.5_50x50_v5_mc' ,SiPixelGenErrorRecord,connectionString, "", "2021-01-27 10:00:00"] ), ), # cell is 50um (local-x) x 50um (local-y) , VBias=350V
'T25' : ( ','.join( [ 'SiPixelGenErrorDBObject_phase2_IT_v7.0.2_25x100_v1_mc' ,SiPixelGenErrorRecord,connectionString, "", "2021-03-17 20:00:00"] ), ), # cell is 25um (local-x) x 100um (local-y) , VBias=350V, 3D pixels in TBPX L1
'T26' : ( ','.join( [ 'SiPixelGenErrorDBObject_phase2_IT_v7.0.3_mixed_v1_mc' ,SiPixelGenErrorRecord,connectionString, "", "2021-03-17 20:00:00"] ), ), # TBPX cells are 25um (local-x) x 100um (local-y), TFPX TEPX 50 um x 50 um , VBias=350V, 3D pixels in TBPX L1
'T23' : ( ','.join( [ 'SiPixelGenErrorDBObject_phase2_IT_v7.0.0_25x100_v2_mc' ,SiPixelGenErrorRecord,connectionString, "", "2021-04-17 20:00:00"] ), ), # cell is 25um (local-x) x 100um (local-y) , VBias=350V, 3D pixels in TBPX L1+L2 and TFPX R1
'T25' : ( ','.join( [ 'SiPixelGenErrorDBObject_phase2_IT_v7.0.2_25x100_v2_mc' ,SiPixelGenErrorRecord,connectionString, "", "2021-04-17 20:00:00"] ), ), # cell is 25um (local-x) x 100um (local-y) , VBias=350V, 3D pixels in TBPX L1
'T26' : ( ','.join( [ 'SiPixelGenErrorDBObject_phase2_IT_v7.0.3_mixed_v2_mc' ,SiPixelGenErrorRecord,connectionString, "", "2021-04-17 20:00:00"] ), ), # TBPX cells are 25um (local-x) x 100um (local-y), TFPX TEPX 50 um x 50 um , VBias=350V, 3D pixels in TBPX L1
}

allTags["Template"] = {
'T15' : ( ','.join( [ 'SiPixelTemplateDBObject_phase2_IT_v6.1.5_25x100_v3_mc',SiPixelTemplatesRecord,connectionString, "", "2021-01-27 10:00:00"] ), ), # cell is 25um (local-x) x 100um (local-y) , VBias=350V
'T21' : ( ','.join( [ 'SiPixelTemplateDBObject_phase2_IT_v6.1.5_25x100_v3_mc',SiPixelTemplatesRecord,connectionString, "", "2021-01-27 10:00:00"] ), ), # cell is 25um (local-x) x 100um (local-y) , VBias=350V
'T22' : ( ','.join( [ 'SiPixelTemplateDBObject_phase2_IT_v6.1.5_50x50_v5_mc' ,SiPixelTemplatesRecord,connectionString, "", "2021-01-27 10:00:00"] ), ), # cell is 50um (local-x) x 50um (local-y) , VBias=350V
'T25' : ( ','.join( [ 'SiPixelTemplateDBObject_phase2_IT_v7.0.2_25x100_v1_mc' ,SiPixelTemplatesRecord,connectionString, "", "2021-03-17 20:00:00"] ), ), # cell is 25um (local-x) x 100um (local-y) , VBias=350V, 3D pixels in TBPX L1
'T26' : ( ','.join( [ 'SiPixelTemplateDBObject_phase2_IT_v7.0.3_mixed_v1_mc' ,SiPixelTemplatesRecord,connectionString, "", "2021-03-17 20:00:00"] ), ), # TBPX cells are 25um (local-x) x 100um (local-y), TFPX TEPX 50 um x 50 um , VBias=350V, 3D pixels in TBPX L1
'T23' : ( ','.join( [ 'SiPixelTemplateDBObject_phase2_IT_v7.0.0_25x100_v2_mc' ,SiPixelTemplatesRecord,connectionString, "", "2021-04-17 20:00:00"] ), ), # cell is 25um (local-x) x 100um (local-y) , VBias=350V, 3D pixels in TBPX L1+L2 and TFPX R1
'T25' : ( ','.join( [ 'SiPixelTemplateDBObject_phase2_IT_v7.0.2_25x100_v2_mc' ,SiPixelTemplatesRecord,connectionString, "", "2021-04-17 20:00:00"] ), ), # cell is 25um (local-x) x 100um (local-y) , VBias=350V, 3D pixels in TBPX L1
'T26' : ( ','.join( [ 'SiPixelTemplateDBObject_phase2_IT_v7.0.3_mixed_v2_mc' ,SiPixelTemplatesRecord,connectionString, "", "2021-04-17 20:00:00"] ), ), # TBPX cells are 25um (local-x) x 100um (local-y), TFPX TEPX 50 um x 50 um , VBias=350V, 3D pixels in TBPX L1
}

##
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1148,7 +1148,6 @@ def condition(self, fragment, stepList, key, hasHarvest):
'Geom' : 'Extended2026D79', # N.B.: Geometry with 3D pixels in the Inner Tracker.
'HLTmenu': '@fake2',
'GT' : 'auto:phase2_realistic_T23',
'ProcessModifier': 'PixelCPEGeneric', # This swaps template reco CPE for generic reco CPE
'Era' : 'Phase2C11I13T23M9', # customizes for 3D Pixels and Muon M9
'ScenToRun' : ['GenSimHLBeamSpot','DigiTrigger','RecoGlobal', 'HARVESTGlobal'],
},
Expand Down
4 changes: 3 additions & 1 deletion RecoLocalTracker/SiPixelRecHits/interface/PixelCPEBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,9 @@ class PixelCPEBase : public PixelClusterParameterEstimator {
const SiPixelTemplateDBObject* templateDBobject_;
bool alpha2Order; // switch on/off E.B effect.

bool DoLorentz_;
bool useLAFromDB_; //Use LA value from the database (used for generic CPE or in template CPE if an error)

bool doLorentzFromAlignment_;
bool LoadTemplatesFromDB_;

//errors for template reco for edge hits, based on observed residuals from
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,17 @@ class PixelCPEClusterRepairESProducer : public edm::ESProducer {
edm::ESGetToken<SiPixel2DTemplateDBObject, SiPixel2DTemplateDBObjectESProducerRcd> templateDBobject2DToken_;

edm::ParameterSet pset_;
bool DoLorentz_;
bool doLorentzFromAlignment_;
bool useLAFromDB_;
};

using namespace edm;

PixelCPEClusterRepairESProducer::PixelCPEClusterRepairESProducer(const edm::ParameterSet& p) {
std::string myname = p.getParameter<std::string>("ComponentName");

//DoLorentz_ = p.getParameter<bool>("DoLorentz"); // True when LA from alignment is used
DoLorentz_ = p.getParameter<bool>("DoLorentz");
useLAFromDB_ = p.getParameter<bool>("useLAFromDB");
doLorentzFromAlignment_ = p.getParameter<bool>("doLorentzFromAlignment");

pset_ = p;
auto c = setWhatProduced(this, myname);
Expand All @@ -52,11 +53,10 @@ PixelCPEClusterRepairESProducer::PixelCPEClusterRepairESProducer(const edm::Para
hTTToken_ = c.consumes();
templateDBobjectToken_ = c.consumes();
templateDBobject2DToken_ = c.consumes();
if (DoLorentz_) {
lorentzAngleToken_ = c.consumes(edm::ESInputTag("", "fromAlignment"));
if (useLAFromDB_ || doLorentzFromAlignment_) {
char const* laLabel = doLorentzFromAlignment_ ? "fromAlignment" : "";
lorentzAngleToken_ = c.consumes(edm::ESInputTag("", laLabel));
}

//std::cout<<" from ES Producer Templates "<<myname<<" "<<DoLorentz_<<std::endl; //dk
}

PixelCPEClusterRepairESProducer::~PixelCPEClusterRepairESProducer() {}
Expand All @@ -73,16 +73,16 @@ void PixelCPEClusterRepairESProducer::fillDescriptions(edm::ConfigurationDescrip
PixelCPEClusterRepair::fillPSetDescription(desc);

// specific to PixelCPEClusterRepairESProducer
desc.add<bool>("DoLorentz", true);
descriptions.add("_templates2_default", desc);
}

std::unique_ptr<PixelClusterParameterEstimator> PixelCPEClusterRepairESProducer::produce(
const TkPixelCPERecord& iRecord) {
// Normal, default LA actually is NOT needed
// null is ok becuse LA is not use by templates in this mode
// Normal, default LA is used in case of template failure, load it unless
// turned off
// if turned off, null is ok, becomes zero
const SiPixelLorentzAngle* lorentzAngleProduct = nullptr;
if (DoLorentz_) { // LA correction from alignment
if (useLAFromDB_ || doLorentzFromAlignment_) {
lorentzAngleProduct = &iRecord.get(lorentzAngleToken_);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ void PixelCPEFastESProducer::fillDescriptions(edm::ConfigurationDescriptions& de
// specific to PixelCPEFastESProducer
desc.add<std::string>("ComponentName", "PixelCPEFast");
desc.add<edm::ESInputTag>("MagneticFieldRecord", edm::ESInputTag());
desc.add<bool>("useLAAlignmentOffsets", false);
desc.add<bool>("DoLorentz", false);
desc.addOptional<bool>("useLAAlignmentOffsets", false)->setComment("deprecated");
desc.addOptional<bool>("DoLorentz", false)->setComment("deprecated");

descriptions.add("PixelCPEFastESProducer", desc);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ PixelCPEGenericESProducer::PixelCPEGenericESProducer(const edm::ParameterSet& p)
// Use LA-width from DB. If both (upper and this) are false LA-width is calcuated from LA-offset
useLAWidthFromDB_ = p.getParameter<bool>("useLAWidthFromDB");
// Use Alignment LA-offset
const bool useLAAlignmentOffsets = p.getParameter<bool>("useLAAlignmentOffsets");
const bool doLorentzFromAlignment = p.getParameter<bool>("doLorentzFromAlignment");
char const* laLabel = ""; // standard LA, from calibration, label=""
if (useLAAlignmentOffsets) {
if (doLorentzFromAlignment) {
laLabel = "fromAlignment";
}

Expand All @@ -66,9 +66,6 @@ PixelCPEGenericESProducer::PixelCPEGenericESProducer(const edm::ParameterSet& p)
if (UseErrorsFromTemplates_) {
genErrorDBObjectToken_ = c.consumes();
}

//std::cout<<" ESProducer "<<myname<<" "<<useLAWidthFromDB_<<" "<<useLAAlignmentOffsets_<<" "
// <<UseErrorsFromTemplates_<<std::endl; //dk
}

std::unique_ptr<PixelClusterParameterEstimator> PixelCPEGenericESProducer::produce(const TkPixelCPERecord& iRecord) {
Expand Down Expand Up @@ -108,8 +105,8 @@ void PixelCPEGenericESProducer::fillDescriptions(edm::ConfigurationDescriptions&
// specific to PixelCPEGenericESProducer
desc.add<std::string>("ComponentName", "PixelCPEGeneric");
desc.add<edm::ESInputTag>("MagneticFieldRecord", edm::ESInputTag(""));
desc.add<bool>("useLAAlignmentOffsets", false);
desc.add<bool>("DoLorentz", false);
desc.addOptional<bool>("useLAAlignmentOffsets", false)->setComment("deprecated");
desc.addOptional<bool>("DoLorentz", false)->setComment("deprecated");
descriptions.add("_generic_default", desc);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,35 +30,37 @@ class PixelCPETemplateRecoESProducer : public edm::ESProducer {
edm::ESGetToken<SiPixelTemplateDBObject, SiPixelTemplateDBObjectESProducerRcd> templateDBobjectToken_;

edm::ParameterSet pset_;
bool DoLorentz_;
bool doLorentzFromAlignment_;
bool useLAFromDB_;
};

using namespace edm;

PixelCPETemplateRecoESProducer::PixelCPETemplateRecoESProducer(const edm::ParameterSet& p) {
std::string myname = p.getParameter<std::string>("ComponentName");

//DoLorentz_ = p.getParameter<bool>("DoLorentz"); // True when LA from alignment is used
DoLorentz_ = p.getParameter<bool>("DoLorentz");
useLAFromDB_ = p.getParameter<bool>("useLAFromDB");
doLorentzFromAlignment_ = p.getParameter<bool>("doLorentzFromAlignment");

pset_ = p;
auto c = setWhatProduced(this, myname);
magfieldToken_ = c.consumes();
pDDToken_ = c.consumes();
hTTToken_ = c.consumes();
templateDBobjectToken_ = c.consumes();
if (DoLorentz_) {
lorentzAngleToken_ = c.consumes(edm::ESInputTag("", "fromAlignment"));
if (useLAFromDB_ || doLorentzFromAlignment_) {
char const* laLabel = doLorentzFromAlignment_ ? "fromAlignment" : "";
lorentzAngleToken_ = c.consumes(edm::ESInputTag("", laLabel));
}
//std::cout<<" from ES Producer Templates "<<myname<<" "<<DoLorentz_<<std::endl; //dk
}

std::unique_ptr<PixelClusterParameterEstimator> PixelCPETemplateRecoESProducer::produce(
const TkPixelCPERecord& iRecord) {
// Normal, deafult LA actually is NOT needed
// null is ok becuse LA is not use by templates in this mode
// Normal, default LA is used in case of template failure, load it unless
// turned off
// if turned off, null is ok, becomes zero
const SiPixelLorentzAngle* lorentzAngleProduct = nullptr;
if (DoLorentz_) { // LA correction from alignment
if (useLAFromDB_ || doLorentzFromAlignment_) {
lorentzAngleProduct = &iRecord.get(lorentzAngleToken_);
}

Expand All @@ -81,7 +83,7 @@ void PixelCPETemplateRecoESProducer::fillDescriptions(edm::ConfigurationDescript

// specific to PixelCPETemplateRecoESProducer
desc.add<std::string>("ComponentName", "PixelCPETemplateReco");
desc.add<bool>("DoLorentz", true);
desc.addOptional<bool>("DoLorentz", true)->setComment("deprecated");
descriptions.add("_templates_default", desc);
}

Expand Down
8 changes: 6 additions & 2 deletions RecoLocalTracker/SiPixelRecHits/src/PixelCPEBase.cc
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ PixelCPEBase::PixelCPEBase(edm::ParameterSet const& conf,

// For Templates only
// Compute the Lorentz shifts for this detector element for templates (from Alignment)
DoLorentz_ = conf.getParameter<bool>("DoLorentz");
doLorentzFromAlignment_ = conf.getParameter<bool>("doLorentzFromAlignment");
useLAFromDB_ = conf.getParameter<bool>("useLAFromDB");

LogDebug("PixelCPEBase") << " LA constants - " << lAOffset_ << " " << lAWidthBPix_ << " " << lAWidthFPix_
<< endl; //dk
Expand Down Expand Up @@ -194,7 +195,8 @@ void PixelCPEBase::fillDetParams() {
p.bx = Bfield.x();

//--- Compute the Lorentz shifts for this detector element
if ((theFlag_ == 0) || DoLorentz_) { // do always for generic and if(DOLorentz) for templates
if ((theFlag_ == 0) || useLAFromDB_ ||
doLorentzFromAlignment_) { // do always for generic and if using LA from DB or alignment for templates
p.driftDirection = driftDirection(p, Bfield);
computeLorentzShifts(p);
}
Expand Down Expand Up @@ -470,4 +472,6 @@ void PixelCPEBase::fillPSetDescription(edm::ParameterSetDescription& desc) {
desc.add<double>("lAOffset", 0.0);
desc.add<double>("lAWidthBPix", 0.0);
desc.add<double>("lAWidthFPix", 0.0);
desc.add<bool>("doLorentzFromAlignment", false);
desc.add<bool>("useLAFromDB", true);
}
55 changes: 26 additions & 29 deletions RecoLocalTracker/SiPixelRecHits/src/PixelCPEClusterRepair.cc
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,11 @@ void PixelCPEClusterRepair::callTempReco1D(DetParam const& theDetParam,
// We have a boolean denoting whether the reco failed or not
theClusterParam.hasFilledProb_ = false;

// In case of template reco failure, these are the lorentz drift corrections
// to be applied
float lorentzshiftX = 0.5f * theDetParam.lorentzShiftInCmX;
float lorentzshiftY = 0.5f * theDetParam.lorentzShiftInCmY;

// ******************************************************************
//--- Call normal TemplateReco
//
Expand Down Expand Up @@ -363,30 +368,22 @@ void PixelCPEClusterRepair::callTempReco1D(DetParam const& theDetParam,

theClusterParam.probabilityX_ = theClusterParam.probabilityY_ = theClusterParam.probabilityQ_ = 0.f;
theClusterParam.qBin_ = 0;
//
// Template reco has failed, compute position estimates based on cluster center of gravity + Lorentz drift
// Future improvement would be to call generic reco instead

// Gavril: what do we do in this case ? For now, just return the cluster center of gravity in microns
// In the x case, apply a rough Lorentz drift average correction
// To do: call PixelCPEGeneric whenever PixelTempReco1D fails
float lorentz_drift = -999.9;
if (!GeomDetEnumerators::isEndcap(theDetParam.thePart))
lorentz_drift = 60.0f; // in microns
else
lorentz_drift = 10.0f; // in microns
// GG: trk angles needed to correct for bows/kinks
if (theClusterParam.with_track_angle) {
theClusterParam.templXrec_ =
theDetParam.theTopol->localX(theClusterParam.theCluster->x(), theClusterParam.loc_trk_pred) -
lorentz_drift * micronsToCm; // rough Lorentz drift correction
theDetParam.theTopol->localX(theClusterParam.theCluster->x(), theClusterParam.loc_trk_pred) + lorentzshiftX;
theClusterParam.templYrec_ =
theDetParam.theTopol->localY(theClusterParam.theCluster->y(), theClusterParam.loc_trk_pred);
theDetParam.theTopol->localY(theClusterParam.theCluster->y(), theClusterParam.loc_trk_pred) + lorentzshiftY;
} else {
edm::LogError("PixelCPEClusterRepair") << "@SUB = PixelCPEClusterRepair::localPosition"
<< "Should never be here. PixelCPEClusterRepair should always be called "
"with track angles. This is a bad error !!! ";

theClusterParam.templXrec_ = theDetParam.theTopol->localX(theClusterParam.theCluster->x()) -
lorentz_drift * micronsToCm; // rough Lorentz drift correction
theClusterParam.templYrec_ = theDetParam.theTopol->localY(theClusterParam.theCluster->y());
theClusterParam.templXrec_ = theDetParam.theTopol->localX(theClusterParam.theCluster->x()) + lorentzshiftX;
theClusterParam.templYrec_ = theDetParam.theTopol->localY(theClusterParam.theCluster->y()) + lorentzshiftY;
}
} else {
//--- Template Reco succeeded. The probabilities are filled.
Expand Down Expand Up @@ -423,6 +420,11 @@ void PixelCPEClusterRepair::callTempReco2D(DetParam const& theDetParam,
// We have a boolean denoting whether the reco failed or not
theClusterParam.hasFilledProb_ = false;

// In case of template reco failure, these are the lorentz drift corrections
// to be applied
float lorentzshiftX = 0.5f * theDetParam.lorentzShiftInCmX;
float lorentzshiftY = 0.5f * theDetParam.lorentzShiftInCmY;

// ******************************************************************
//--- Call 2D TemplateReco
//
Expand Down Expand Up @@ -482,29 +484,24 @@ void PixelCPEClusterRepair::callTempReco2D(DetParam const& theDetParam,

theClusterParam.probabilityX_ = theClusterParam.probabilityY_ = theClusterParam.probabilityQ_ = 0.f;
theClusterParam.qBin_ = 0;
// GG: what do we do in this case? For now, just return the cluster center of gravity in microns
// In the x case, apply a rough Lorentz drift average correction
float lorentz_drift = -999.9;
if (!GeomDetEnumerators::isEndcap(theDetParam.thePart))
lorentz_drift = 60.0f; // in microns // &&& replace with a constant (globally)
else
lorentz_drift = 10.0f; // in microns
// GG: trk angles needed to correct for bows/kinks

// 2D Template reco has failed, compute position estimates based on cluster center of gravity + Lorentz drift
// Future improvement would be to call generic reco instead

if (theClusterParam.with_track_angle) {
theClusterParam.templXrec_ =
theDetParam.theTopol->localX(theClusterParam.theCluster->x(), theClusterParam.loc_trk_pred) -
lorentz_drift * micronsToCm; // rough Lorentz drift correction
theDetParam.theTopol->localX(theClusterParam.theCluster->x(), theClusterParam.loc_trk_pred) + lorentzshiftX;
theClusterParam.templYrec_ =
theDetParam.theTopol->localY(theClusterParam.theCluster->y(), theClusterParam.loc_trk_pred);
theDetParam.theTopol->localY(theClusterParam.theCluster->y(), theClusterParam.loc_trk_pred) + lorentzshiftY;
} else {
edm::LogError("PixelCPEClusterRepair") << "@SUB = PixelCPEClusterRepair::localPosition"
<< "Should never be here. PixelCPEClusterRepair should always be called "
"with track angles. This is a bad error !!! ";

theClusterParam.templXrec_ = theDetParam.theTopol->localX(theClusterParam.theCluster->x()) -
lorentz_drift * micronsToCm; // rough Lorentz drift correction
theClusterParam.templYrec_ = theDetParam.theTopol->localY(theClusterParam.theCluster->y());
theClusterParam.templXrec_ = theDetParam.theTopol->localX(theClusterParam.theCluster->x()) + lorentzshiftX;
theClusterParam.templYrec_ = theDetParam.theTopol->localY(theClusterParam.theCluster->y()) + lorentzshiftY;
}

} else {
//--- Template Reco succeeded.
theClusterParam.hasFilledProb_ = true;
Expand Down
Loading