Skip to content

Commit

Permalink
Merge pull request #5 from dildick/gem-csc-bending-bit-format
Browse files Browse the repository at this point in the history
Gem csc bending bit format
  • Loading branch information
Sven Dildick committed Jan 16, 2014
2 parents 3d6554f + 2f1bdff commit 8a83655
Show file tree
Hide file tree
Showing 922 changed files with 269,911 additions and 82,924 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
__init__.py
__init__.*
*.pyc
*.log
19 changes: 11 additions & 8 deletions Alignment/CommonAlignmentAlgorithm/src/TkModuleGroupSelector.cc
Original file line number Diff line number Diff line change
Expand Up @@ -270,17 +270,20 @@ int TkModuleGroupSelector::getParameterIndexFromDetId(unsigned int detId,
const std::vector<edm::RunNumber_t> &runs = runRange_.at(iAlignableGroup);
const unsigned int id0 = firstId_.at(iAlignableGroup);
const edm::RunNumber_t refrun = referenceRun_.at(iAlignableGroup);
// assuming runs is never empty (checked in createModuleGroups(..))
if (runs[0] > run) {
throw cms::Exception("BadConfig")
<< "@SUB=TkModuleGroupSelector::getParameterIndexFromDetId:\n"
<< "Run " << run << " not foreseen for detid ('"<< detId <<"')"
<< " in module group " << iAlignableGroup << ".";
}


unsigned int iovNum = 0;
for ( ; iovNum < runs.size(); ++iovNum) {
if (run >= runs[iovNum]) break;
if (runs[iovNum] > run) break;
}
if (iovNum == 0) {
throw cms::Exception("BadConfig") << "@SUB=TkModuleGroupSelector::getParameterIndexFromDetId:\n"
<< "Run " << run << " not foreseen for detid '"<< detId <<"'"
<< " in module group " << iAlignableGroup << ".";
} else {
--iovNum;
}

//test whether the iov contains the reference run
if(refrun > 0) { //if > 0 a reference run number has been provided
if(iovNum+1 == runs.size()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ class AlignmentTrackSelector
const int minHitsinENDCAP_, minHitsinENDCAPplus_, minHitsinENDCAPminus_;
const double maxHitDiffEndcaps_;
const double nLostHitMax_;
std::vector<double> RorZofFirstHitMin_;
std::vector<double> RorZofFirstHitMax_;
std::vector<double> RorZofLastHitMin_;
std::vector<double> RorZofLastHitMax_;

const edm::InputTag clusterValueMapTag_; // ValueMap containing association cluster - flag
const int minPrescaledHits_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@
nHitMax = cms.double(999.0),
nLostHitMax = cms.double(999.0),
nHitMin2D = cms.uint32(0),
RorZofFirstHitMin = cms.vdouble(0.0,0.0),
RorZofFirstHitMax = cms.vdouble(999.0,999.0),
RorZofLastHitMin = cms.vdouble(0.0,0.0),
RorZofLastHitMax = cms.vdouble(999.0,999.0),
countStereoHitAs2D = cms.bool(True),
minHitsPerSubDet = cms.PSet(
inTEC = cms.int32(0),
Expand Down
87 changes: 85 additions & 2 deletions Alignment/CommonAlignmentProducer/src/AlignmentTrackSelector.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
#include "DataFormats/SiPixelDetId/interface/PixelSubdetector.h"
#include "DataFormats/TrackerCommon/interface/TrackerTopology.h"
#include "Geometry/Records/interface/IdealGeometryRecord.h"

#include <cmath>

const int kBPIX = PixelSubdetector::PixelBarrel;
const int kFPIX = PixelSubdetector::PixelEndcap;

Expand Down Expand Up @@ -81,6 +84,10 @@ AlignmentTrackSelector::AlignmentTrackSelector(const edm::ParameterSet & cfg) :
minHitsinENDCAPminus_ (cfg.getParameter<edm::ParameterSet>( "minHitsPerSubDet" ).getParameter<int>( "inENDCAPminus" ) ),
maxHitDiffEndcaps_( cfg.getParameter<double>( "maxHitDiffEndcaps" ) ),
nLostHitMax_( cfg.getParameter<double>( "nLostHitMax" ) ),
RorZofFirstHitMin_( cfg.getParameter<std::vector<double> >( "RorZofFirstHitMin" ) ),
RorZofFirstHitMax_( cfg.getParameter<std::vector<double> >( "RorZofFirstHitMax" ) ),
RorZofLastHitMin_( cfg.getParameter<std::vector<double> >( "RorZofLastHitMin" ) ),
RorZofLastHitMax_( cfg.getParameter<std::vector<double> >( "RorZofLastHitMax" ) ),
clusterValueMapTag_(cfg.getParameter<edm::InputTag>("hitPrescaleMapTag")),
minPrescaledHits_( cfg.getParameter<int>("minPrescaledHits")),
applyPrescaledHitsFilter_(clusterValueMapTag_.encode().size() && minPrescaledHits_ > 0)
Expand Down Expand Up @@ -173,6 +180,47 @@ AlignmentTrackSelector::AlignmentTrackSelector(const edm::ParameterSet & cfg) :

}

// Checking whether cuts on positions of first and last track hits are defined properly
if(RorZofFirstHitMin_.size() != 2){
throw cms::Exception("BadConfig") << "@SUB=AlignmentTrackSelector::AlignmentTrackSelector"
<< "Wrong configuration of 'RorZofFirstHitMin'."
<< " Must have exactly 2 values instead of configured " << RorZofFirstHitMin_.size() << ")";
} else {
RorZofFirstHitMin_.at(0)=std::fabs(RorZofFirstHitMin_.at(0));
RorZofFirstHitMin_.at(1)=std::fabs(RorZofFirstHitMin_.at(1));
}
if(RorZofFirstHitMax_.size() != 2){
throw cms::Exception("BadConfig") << "@SUB=AlignmentTrackSelector::AlignmentTrackSelector"
<< "Wrong configuration of 'RorZofFirstHitMax'."
<< " Must have exactly 2 values instead of configured " << RorZofFirstHitMax_.size() << ")";
} else {
RorZofFirstHitMax_.at(0) = std::fabs(RorZofFirstHitMax_.at(0));
RorZofFirstHitMax_.at(1) = std::fabs(RorZofFirstHitMax_.at(1));
}
if(RorZofLastHitMin_.size() != 2){
throw cms::Exception("BadConfig") << "@SUB=AlignmentTrackSelector::AlignmentTrackSelector"
<< "Wrong configuration of 'RorZofLastHitMin'."
<< " Must have exactly 2 values instead of configured " << RorZofLastHitMin_.size() << ")";
} else {
RorZofLastHitMin_.at(0) = std::fabs(RorZofLastHitMin_.at(0));
RorZofLastHitMin_.at(1) = std::fabs(RorZofLastHitMin_.at(1));
}
if(RorZofLastHitMax_.size() != 2){
throw cms::Exception("BadConfig") << "@SUB=AlignmentTrackSelector::AlignmentTrackSelector"
<< "Wrong configuration of 'RorZofLastHitMax'."
<< " Must have exactly 2 values instead of configured " << RorZofLastHitMax_.size() << ")";
} else {
RorZofLastHitMax_.at(0) = std::fabs(RorZofLastHitMax_.at(0));
RorZofLastHitMax_.at(1) = std::fabs(RorZofLastHitMax_.at(1));
}
// If first hit set to be at larger distance then the last hit
if(RorZofFirstHitMin_.at(0) > RorZofLastHitMax_.at(0) && RorZofFirstHitMin_.at(1) > RorZofLastHitMax_.at(1)){
throw cms::Exception("BadConfig") << "@SUB=AlignmentTrackSelector::AlignmentTrackSelector"
<< "Position of the first hit is set to larger distance than the last hit:."
<< " First hit(min): [" << RorZofFirstHitMin_.at(0) << ", " << RorZofFirstHitMin_.at(1) << "]; Last hit(max): ["
<< RorZofLastHitMax_.at(0) << ", " << RorZofLastHitMax_.at(1) << "];";
}

}

// destructor -----------------------------------------------------------------
Expand Down Expand Up @@ -294,7 +342,8 @@ bool AlignmentTrackSelector::detailedHitsCheck(const reco::Track *trackp, const
|| minHitsinFPIXplus_ || minHitsinFPIXminus_
|| minHitsinTECplus_ || minHitsinTECminus_
|| minHitsinFPIX_ || minHitsinBPIX_ || minHitsinPIX_ ||nHitMin2D_ || chargeCheck_
|| applyIsolation_ || (seedOnlyFromAbove_ == 1 || seedOnlyFromAbove_ == 2)) {
|| applyIsolation_ || (seedOnlyFromAbove_ == 1 || seedOnlyFromAbove_ == 2)
|| RorZofFirstHitMin_.size() > 0 || RorZofFirstHitMax_.size() > 0 || RorZofLastHitMin_.size() > 0 || RorZofLastHitMax_.size() > 0 ) {
// any detailed hit cut is active, so have to check

int nhitinTIB = 0, nhitinTOB = 0, nhitinTID = 0;
Expand Down Expand Up @@ -372,6 +421,40 @@ bool AlignmentTrackSelector::detailedHitsCheck(const reco::Track *trackp, const
// Do not call isHit2D(..) if already enough 2D hits for performance reason:
if (nHit2D < nHitMin2D_ && this->isHit2D(**iHit)) ++nHit2D;
} // end loop on hits


// Checking whether the track satisfies requirement of the first and last hit positions
bool passedLastHitPositionR = true;
bool passedLastHitPositionZ = true;
bool passedFirstHitPositionR = true;
bool passedFirstHitPositionZ = true;

if( RorZofFirstHitMin_.at(0) != 0.0 || RorZofFirstHitMin_.at(1) != 0.0
|| RorZofFirstHitMax_.at(0) != 999.0 || RorZofFirstHitMax_.at(1) != 999.0 ) {

const reco::TrackBase::Point firstPoint(trackp->innerPosition());

if( (std::fabs(firstPoint.R()) < RorZofFirstHitMin_.at(0) )) passedFirstHitPositionR = false;
if( (std::fabs(firstPoint.R()) > RorZofFirstHitMax_.at(0) )) passedFirstHitPositionR = false;
if( (std::fabs(firstPoint.Z()) < RorZofFirstHitMin_.at(1) )) passedFirstHitPositionZ = false;
if( (std::fabs(firstPoint.Z()) > RorZofFirstHitMax_.at(1) )) passedFirstHitPositionZ = false;
}

if( RorZofLastHitMin_.at(0) != 0.0 || RorZofLastHitMin_.at(1) != 0.0
|| RorZofLastHitMax_.at(0) != 999.0 || RorZofLastHitMax_.at(1) != 999.0 ) {

const reco::TrackBase::Point lastPoint(trackp->outerPosition());

if( (std::fabs(lastPoint.R()) < RorZofLastHitMin_.at(0) )) passedLastHitPositionR = false;
if( (std::fabs(lastPoint.R()) > RorZofLastHitMax_.at(0) )) passedLastHitPositionR = false;
if( (std::fabs(lastPoint.Z()) < RorZofLastHitMin_.at(1) )) passedLastHitPositionZ = false;
if( (std::fabs(lastPoint.Z()) > RorZofLastHitMax_.at(1) )) passedLastHitPositionZ = false;
}

bool passedFirstHitPosition = passedFirstHitPositionR || passedFirstHitPositionZ;
bool passedLastHitPosition = passedLastHitPositionR || passedLastHitPositionZ;



return (nhitinTIB >= minHitsinTIB_ && nhitinTOB >= minHitsinTOB_
&& nhitinTID >= minHitsinTID_ && nhitinTEC >= minHitsinTEC_
Expand All @@ -382,7 +465,7 @@ bool AlignmentTrackSelector::detailedHitsCheck(const reco::Track *trackp, const
&& nhitinTECplus >= minHitsinTECplus_ && nhitinTECminus >= minHitsinTECminus_
&& nhitinBPIX >= minHitsinBPIX_
&& nhitinFPIX >= minHitsinFPIX_ && nhitinPIXEL>=minHitsinPIX_
&& nHit2D >= nHitMin2D_);
&& nHit2D >= nHitMin2D_ && passedFirstHitPosition && passedLastHitPosition);
} else { // no cuts set, so we are just fine and can avoid loop on hits
return true;
}
Expand Down
14 changes: 7 additions & 7 deletions Alignment/OfflineValidation/macros/PlotAlignmentValidation.C
Original file line number Diff line number Diff line change
Expand Up @@ -440,8 +440,8 @@ void PlotAlignmentValidation::plotSS( const std::string& options, const std::str

TString subDetName;
switch (iSubDet) {
case 1: subDetName = "TPB"; break;
case 2: subDetName = "TPE"; break;
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;
Expand Down Expand Up @@ -696,8 +696,8 @@ void PlotAlignmentValidation::plotDMR(const std::string& variable, Int_t minHits
else if (variable=="rmsNormY") plotName << "rmsNYR_";

switch (i) {
case 1: plotName << "TPB"; break;
case 2: plotName << "TPE"; break;
case 1: plotName << "BPIX"; break;
case 2: plotName << "FPIX"; break;
case 3: plotName << "TIB"; break;
case 4: plotName << "TID"; break;
case 5: plotName << "TOB"; break;
Expand Down Expand Up @@ -902,7 +902,7 @@ void PlotAlignmentValidation::setCanvasStyle( TCanvas& canv )
canv.SetLeftMargin ( 0.15 );
canv.SetRightMargin ( 0.05 );
canv.SetBottomMargin( 0.15 );
canv.SetTopMargin ( 0.10 );
canv.SetTopMargin ( 0.12 );
}

//------------------------------------------------------------------------------
Expand Down Expand Up @@ -972,8 +972,8 @@ void PlotAlignmentValidation::setTitleStyle( TNamed &hist,const char* titleX, c
if (titelXAxis.Contains("rmsX")) histTitel="Distribution of the rms of the residuals in ";

switch (subDetId) {
case 1: histTitel+="TPB";break;
case 2: histTitel+="TPE";break;
case 1: histTitel+="BPIX";break;
case 2: histTitel+="FPIX";break;
case 3: histTitel+="TIB";break;
case 4: histTitel+="TID";break;
case 5: histTitel+="TOB";break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -967,7 +967,7 @@
#bit xy for muons trigger
process.triggerSelection=cms.Sequence(process.bptxAnd)
#process.triggerSelection=cms.Sequence(process.bptxAnd)
Expand Down Expand Up @@ -1415,6 +1415,6 @@
#bit xy for muons trigger
process.triggerSelection=cms.Sequence(process.bptxAnd)
#process.triggerSelection=cms.Sequence(process.bptxAnd)
"""
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@ def __setitem__(self, key, value, dict_setitem=dict.__setitem__):
- `dict_item`: method which is used for finally setting the item
"""

if "__name__" in self and self["__name__"]=="validation" and key in self:
the_value = self[key]+self.getSep()+value
if "__name__" in self and self["__name__"]=="validation" \
and key in self and value!=self[key][0]:
the_value = [self[key][0]+self.getSep()+value[0]]
else:
the_value = value
dict_setitem(self, key, the_value)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ def createScript(self, path):
"fi\n")
repMap["runComparisonScripts"] += \
("rfcp .oO[CMSSW_BASE]Oo./src/Alignment"
"/OfflineValidation/scripts/makeArrowPlots "
"/OfflineValidation/scripts/makeArrowPlots.C "
"$CWD/TkAllInOneTool\n"
"root -b -q 'makeArrowPlots.C(\""
".oO[name]Oo..Comparison_common"+name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
#Good Bunch Crossings
process.bptxAnd = process.hltLevel1GTSeed.clone(L1TechTriggerSeeding = cms.bool(True), L1SeedsLogicalExpression = cms.string('0'))
#BSCNOBEAMHALO
process.bit40 = process.hltLevel1GTSeed.clone(L1TechTriggerSeeding = cms.bool(True), L1SeedsLogicalExpression = cms.string('(40 OR 41) AND NOT (36 OR 37 OR 38 OR 39) AND NOT ((42 AND NOT 43) OR (43 AND NOT 42))'))
#process.bit40 = process.hltLevel1GTSeed.clone(L1TechTriggerSeeding = cms.bool(True), L1SeedsLogicalExpression = cms.string('(40 OR 41) AND NOT (36 OR 37 OR 38 OR 39) AND NOT ((42 AND NOT 43) OR (43 AND NOT 42))'))
#Physics declared
process.load('HLTrigger.special.hltPhysicsDeclared_cfi')
Expand Down Expand Up @@ -189,7 +189,7 @@
## PATH
##
process.p = cms.Path(
process.triggerSelection*
#process.triggerSelection*
process.offlineBeamSpot*process.HighPuritySelector*process.TrackRefitter1*process.TrackerTrackHitFilter*process.HitFilteredTracks
*process.AlignmentTrackSelector*process.TrackRefitter2*process.seqTrackerOfflineValidation.oO[offlineValidationMode]Oo.)
Expand Down Expand Up @@ -244,7 +244,7 @@
#Good Bunch Crossings
process.bptxAnd = process.hltLevel1GTSeed.clone(L1TechTriggerSeeding = cms.bool(True), L1SeedsLogicalExpression = cms.string('0'))
#BSCNOBEAMHALO
process.bit40 = process.hltLevel1GTSeed.clone(L1TechTriggerSeeding = cms.bool(True), L1SeedsLogicalExpression = cms.string('(40 OR 41) AND NOT (36 OR 37 OR 38 OR 39) AND NOT ((42 AND NOT 43) OR (43 AND NOT 42))'))
#process.bit40 = process.hltLevel1GTSeed.clone(L1TechTriggerSeeding = cms.bool(True), L1SeedsLogicalExpression = cms.string('(40 OR 41) AND NOT (36 OR 37 OR 38 OR 39) AND NOT ((42 AND NOT 43) OR (43 AND NOT 42))'))
#Physics declared
process.load('HLTrigger.special.hltPhysicsDeclared_cfi')
Expand Down Expand Up @@ -390,7 +390,7 @@
## PATH
##
process.p = cms.Path(
process.triggerSelection*
#process.triggerSelection*
process.offlineBeamSpot*process.HighPuritySelector*process.TrackRefitter1*process.TrackerTrackHitFilter*process.HitFilteredTracks
*process.AlignmentTrackSelector*process.TrackRefitter2*process.seqTrackerOfflineValidation.oO[offlineValidationMode]Oo.)
Expand Down Expand Up @@ -533,7 +533,7 @@
#no triger on bunch crossing bit 0
process.triggerSelection=cms.Sequence(process.bit40)
# process.triggerSelection=cms.Sequence(process.bit40)
"""

Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
0 0 0 -0.034223 -0.28593 -0.017563
0 0 0 0.0039431 -0.31206 0.011618
0 0 0 0.044774 -0.40944 -0.041151
0 0 0 -0.038121 -0.42382 -0.054346
0 0 0 0.020883 -0.52338 -0.066333
0 0 0 -0.049104 -0.56342 -0.056034
0 0 0 0.028633 -0.45665 -0.081459
0 0 0 0.002744 -0.33699 -0.032223
0 0 0 0.03076 -0.31652 -0.070976
0 0 0 -0.11627 -0.2518 -0.12576
0 0 0 0.080911 -0.24423 -0.094434
0 0 0 0.12307 -0.13983 -0.0054441
0 0 0 0.042039 -0.058385 0.054147
0 0 0 -0.037558 -0.093878 0.04518
0 0 0 -0.12737 -0.058186 0.020768
0 0 0 -0.07848 -0.058563 0.033196
0 0 0 -0.19003 -0.1753 0.012549
0 0 0 -0.13311 -0.19829 -0.031179
0 0 0 -0.17706 -0.20923 -0.064801
0 0 0 -0.15267 -0.258 -0.17314
0 0 0 -0.15557 -0.34763 -0.19438
0 0 0 -0.099019 -0.37587 -0.19039
0 0 0 -0.060424 -0.4266 -0.12047
0 0 0 -0.0063939 -0.36387 -0.17126
0 0 0 0.069456 -0.30895 -0.12583
0 0 0 0.026041 -0.23906 -0.16838
0 0 0 0.0011744 -0.19449 -0.12895
0 0 0 0.04594 -0.20264 -0.096879
0 0 0 0.14654 -0.15102 -0.076089
0 0 0 0.10405 -0.11861 -0.062105
0 0 0 0.074751 -0.055344 -0.053866
0 0 0 0.010904 -0.069639 -0.043928
0 0 0 0.039073 -0.28638 -0.11031
0 0 0 -0.078325 -0.099408 -0.030385
0 0 0 -0.14247 -0.14605 -0.063662
0 0 0 -0.17623 -0.18718 -0.11225
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
0.00027874 0 0.00027874 -0.12024 -0.72268 -0.35605
0.0002287 0 0.0002287 -0.13751 -0.83893 -0.21114
4.6334e-05 0 4.6334e-05 0.53451 -0.87586 0.1509
-0.00015961 0 -0.00015961 0.55501 -0.95568 0.13822
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
from DQMServices.Components.EDMtoMEConverter_cfi import *

EDMtoMEConvertSiStrip = EDMtoMEConverter.clone()
#EDMtoMEConvertSiStrip
EDMtoMEConvertSiStrip.lumiInputTag = cms.InputTag("MEtoEDMConvertSiStrip","MEtoEDMConverterLumi")
EDMtoMEConvertSiStrip.runInputTag = cms.InputTag("MEtoEDMConvertSiStrip","MEtoEDMConverterRun")

DQMStore = cms.Service("DQMStore")

Expand Down
5 changes: 5 additions & 0 deletions CommonTools/ParticleFlow/python/EITopPAG_EventContent_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@
'keep *_pfIsolatedMuonsEI_*_*',
# jets
'keep recoPFJets_pfJetsEI_*_*',
# btags
'keep *_pfJetTrackAssociatorEI_*_*',
'keep *_impactParameterTagInfosEI_*_*',
'keep *_secondaryVertexTagInfosEI_*_*',
'keep *_combinedSecondaryVertexBJetTagsEI_*_*',
# taus
'keep recoPFTaus_pfTausEI_*_*',
'keep recoPFTauDiscriminator_pfTausDiscrimination*_*_*',
Expand Down
Loading

0 comments on commit 8a83655

Please sign in to comment.