diff --git a/[refs] b/[refs] index be758025f9cc7..f46ccf7fe0848 100644 --- a/[refs] +++ b/[refs] @@ -2,4 +2,4 @@ "refs/heads/hi_d20131223": d7335b053d7fe03e98f9f59af6a20004362628e8 refs/heads/gh-pages: a3d9046c56a3ca3dc64ad63f7295276c81ac876a "refs/heads/analysis_53X_01": 3019419e9784b2b092fc6b5c503b2e0177cbe926 -"refs/heads/CMSSW_7_0_X": 23dfb3d5518e5ca67f2197eb36f2c49cd9431dd2 +"refs/heads/CMSSW_7_0_X": 135ccfa9caba01d74e29bd90bacb737e285c071b diff --git a/trunk/SimTracker/SiPixelDigitizer/python/PixelDigi_cfi.py b/trunk/SimTracker/SiPixelDigitizer/python/PixelDigi_cfi.py index eb320d21a2d36..01b7313b1bee8 100644 --- a/trunk/SimTracker/SiPixelDigitizer/python/PixelDigi_cfi.py +++ b/trunk/SimTracker/SiPixelDigitizer/python/PixelDigi_cfi.py @@ -1 +1,217 @@ -raise RuntimeError, "Do not import obsolete file PixelDigi_cfi.py. If you need parameters, use 'from SimGeneral.MixingModule.pixelDigitizer_cfi import *'" +import FWCore.ParameterSet.Config as cms + +simSiPixelDigis = cms.EDProducer("SiPixelDigitizer", + ReadoutNoiseInElec=cms.double(350.0), + DeltaProductionCut=cms.double(0.03), + ROUList=cms.vstring('g4SimHitsTrackerHitsPixelBarrelLowTof', + 'g4SimHitsTrackerHitsPixelBarrelHighTof', + 'g4SimHitsTrackerHitsPixelEndcapLowTof', + 'g4SimHitsTrackerHitsPixelEndcapHighTof'), + OffsetSmearing=cms.double(0.0), + ThresholdInElectrons_FPix=cms.double(3000.0), + ThresholdInElectrons_BPix=cms.double(3500.0), + AddThresholdSmearing=cms.bool(True), + ThresholdSmearing_FPix=cms.double(210.0), + ThresholdSmearing_BPix=cms.double(245.0), + NoiseInElectrons=cms.double(175.0), + MissCalibrate=cms.bool(True), + FPix_SignalResponse_p0=cms.double(0.0043), + FPix_SignalResponse_p1=cms.double(1.31), + FPix_SignalResponse_p2=cms.double(93.6), + FPix_SignalResponse_p3=cms.double(134.6), + BPix_SignalResponse_p0=cms.double(0.0035), + BPix_SignalResponse_p1=cms.double(1.23), + BPix_SignalResponse_p2=cms.double(97.4), + BPix_SignalResponse_p3=cms.double(126.5), + ElectronsPerVcal=cms.double(65.5), + ElectronsPerVcal_Offset=cms.double(-414.0), + ElectronPerAdc=cms.double(135.0), + TofUpperCut=cms.double(12.5), + AdcFullScale=cms.int32(255), + TofLowerCut=cms.double(-12.5), + TanLorentzAnglePerTesla_FPix=cms.double(0.106), + TanLorentzAnglePerTesla_BPix=cms.double(0.106), + AddNoisyPixels=cms.bool(True), + Alpha2Order=cms.bool(True), + AddPixelInefficiency=cms.int32(0), + AddNoise=cms.bool(True), + ChargeVCALSmearing=cms.bool(True), + GainSmearing=cms.double(0.0), + GeometryType=cms.string('idealForDigi'), + useDB=cms.bool(True), + LorentzAngle_DB=cms.bool(True), +## DeadModules_DB = cms.bool(True), +## killModules = cms.bool(False), + DeadModules_DB=cms.bool(False), + killModules=cms.bool(True), +DeadModules=cms.VPSet( + cms.PSet(Dead_detID=cms.int32(302055940), Module=cms.string("tbmB"), Dead_RocID=cms.int32(-1)) +## -Z: Rows >= 80 //BadRocs=ff00 ROC= 8 9 10 11 12 13 14 15 +, cms.PSet(Dead_detID=cms.int32(302059800), Module=cms.string("whole"), Dead_RocID=cms.int32(-1)) +, cms.PSet(Dead_detID=cms.int32(302121992), Module=cms.string("whole"), Dead_RocID=cms.int32(-1)) +, cms.PSet(Dead_detID=cms.int32(302123296), Module=cms.string("whole"), Dead_RocID=cms.int32(-1)) +, cms.PSet(Dead_detID=cms.int32(302125060), Module=cms.string("tbmA"), Dead_RocID=cms.int32(7)) +## -Z: Rows < 80 //BadRocs=0080 (col 0-51) ROC= 7 +, cms.PSet(Dead_detID=cms.int32(302125076), Module=cms.string("tbmA"), Dead_RocID=cms.int32(3)) +## +Z: Rows >= 80 //BadRocs=0008 (col 156-207) ROC= 3 +, cms.PSet(Dead_detID=cms.int32(302126364), Module=cms.string("tbmB"), Dead_RocID=cms.int32(-1)) +## +Z: Rows < 80 //BadRocs=ff00 ROC= 8 9 10 11 12 13 14 15 +, cms.PSet(Dead_detID=cms.int32(302126596), Module=cms.string("whole"), Dead_RocID=cms.int32(-1)) +, cms.PSet(Dead_detID=cms.int32(302127136), Module=cms.string("whole"), Dead_RocID=cms.int32(-1)) +, cms.PSet(Dead_detID=cms.int32(302188552), Module=cms.string("whole"), Dead_RocID=cms.int32(-1)) +, cms.PSet(Dead_detID=cms.int32(302188824), Module=cms.string("whole"), Dead_RocID=cms.int32(-1)) +, cms.PSet(Dead_detID=cms.int32(302194200), Module=cms.string("whole"), Dead_RocID=cms.int32(-1)) +, cms.PSet(Dead_detID=cms.int32(302195232), Module=cms.string("whole"), Dead_RocID=cms.int32(-1)) +, cms.PSet(Dead_detID=cms.int32(302197252), Module=cms.string("whole"), Dead_RocID=cms.int32(-1)) +, cms.PSet(Dead_detID=cms.int32(302197784), Module=cms.string("whole"), Dead_RocID=cms.int32(-1)) +#forward +, cms.PSet(Dead_detID=cms.int32(352453892), Module=cms.string("whole"), Dead_RocID=cms.int32(-1)) +, cms.PSet(Dead_detID=cms.int32(352453896), Module=cms.string("whole"), Dead_RocID=cms.int32(-1)) +, cms.PSet(Dead_detID=cms.int32(352453900), Module=cms.string("whole"), Dead_RocID=cms.int32(-1)) +, cms.PSet(Dead_detID=cms.int32(352453904), Module=cms.string("whole"), Dead_RocID=cms.int32(-1)) +, cms.PSet(Dead_detID=cms.int32(352454916), Module=cms.string("whole"), Dead_RocID=cms.int32(-1)) +, cms.PSet(Dead_detID=cms.int32(352454920), Module=cms.string("whole"), Dead_RocID=cms.int32(-1)) +, cms.PSet(Dead_detID=cms.int32(352454924), Module=cms.string("whole"), Dead_RocID=cms.int32(-1)) +, cms.PSet(Dead_detID=cms.int32(352454928), Module=cms.string("whole"), Dead_RocID=cms.int32(-1)) +, cms.PSet(Dead_detID=cms.int32(352455940), Module=cms.string("whole"), Dead_RocID=cms.int32(-1)) +, cms.PSet(Dead_detID=cms.int32(352455944), Module=cms.string("whole"), Dead_RocID=cms.int32(-1)) +, cms.PSet(Dead_detID=cms.int32(352455948), Module=cms.string("whole"), Dead_RocID=cms.int32(-1)) +, cms.PSet(Dead_detID=cms.int32(352455952), Module=cms.string("whole"), Dead_RocID=cms.int32(-1)) +, cms.PSet(Dead_detID=cms.int32(352454148), Module=cms.string("whole"), Dead_RocID=cms.int32(-1)) +, cms.PSet(Dead_detID=cms.int32(352454152), Module=cms.string("whole"), Dead_RocID=cms.int32(-1)) +, cms.PSet(Dead_detID=cms.int32(352454156), Module=cms.string("whole"), Dead_RocID=cms.int32(-1)) +, cms.PSet(Dead_detID=cms.int32(352455172), Module=cms.string("whole"), Dead_RocID=cms.int32(-1)) +, cms.PSet(Dead_detID=cms.int32(352455176), Module=cms.string("whole"), Dead_RocID=cms.int32(-1)) +, cms.PSet(Dead_detID=cms.int32(352455180), Module=cms.string("whole"), Dead_RocID=cms.int32(-1)) +, cms.PSet(Dead_detID=cms.int32(352456196), Module=cms.string("whole"), Dead_RocID=cms.int32(-1)) +, cms.PSet(Dead_detID=cms.int32(352456200), Module=cms.string("whole"), Dead_RocID=cms.int32(-1)) +, cms.PSet(Dead_detID=cms.int32(352456204), Module=cms.string("whole"), Dead_RocID=cms.int32(-1)) +, cms.PSet(Dead_detID=cms.int32(343999748), Module=cms.string("whole"), Dead_RocID=cms.int32(-1)) +, cms.PSet(Dead_detID=cms.int32(343999752), Module=cms.string("whole"), Dead_RocID=cms.int32(-1)) +, cms.PSet(Dead_detID=cms.int32(343999756), Module=cms.string("whole"), Dead_RocID=cms.int32(-1)) +, cms.PSet(Dead_detID=cms.int32(343999760), Module=cms.string("whole"), Dead_RocID=cms.int32(-1)) +, cms.PSet(Dead_detID=cms.int32(344014340), Module=cms.string("whole"), Dead_RocID=cms.int32(-1)) +, cms.PSet(Dead_detID=cms.int32(344014344), Module=cms.string("whole"), Dead_RocID=cms.int32(-1)) +, cms.PSet(Dead_detID=cms.int32(344014348), Module=cms.string("whole"), Dead_RocID=cms.int32(-1)) +, cms.PSet(Dead_detID=cms.int32(344019464), Module=cms.string("none"), Dead_RocID=cms.int32(6)) +# -Z: Rows >= 80 //BadRocs=40 (col 104-155) ROC= 6 Blade 11, panel 2, Module 2 +, cms.PSet(Dead_detID=cms.int32(344077572), Module=cms.string("whole"), Dead_RocID=cms.int32(-1)) +, cms.PSet(Dead_detID=cms.int32(344077576), Module=cms.string("whole"), Dead_RocID=cms.int32(-1)) +, cms.PSet(Dead_detID=cms.int32(344077580), Module=cms.string("whole"), Dead_RocID=cms.int32(-1)) +, cms.PSet(Dead_detID=cms.int32(344077584), Module=cms.string("whole"), Dead_RocID=cms.int32(-1)) +, cms.PSet(Dead_detID=cms.int32(344078596), Module=cms.string("whole"), Dead_RocID=cms.int32(-1)) +, cms.PSet(Dead_detID=cms.int32(344078600), Module=cms.string("whole"), Dead_RocID=cms.int32(-1)) +, cms.PSet(Dead_detID=cms.int32(344078604), Module=cms.string("whole"), Dead_RocID=cms.int32(-1)) +, cms.PSet(Dead_detID=cms.int32(344078608), Module=cms.string("whole"), Dead_RocID=cms.int32(-1)) +, cms.PSet(Dead_detID=cms.int32(344079620), Module=cms.string("whole"), Dead_RocID=cms.int32(-1)) +, cms.PSet(Dead_detID=cms.int32(344079624), Module=cms.string("whole"), Dead_RocID=cms.int32(-1)) +, cms.PSet(Dead_detID=cms.int32(344079628), Module=cms.string("whole"), Dead_RocID=cms.int32(-1)) +, cms.PSet(Dead_detID=cms.int32(344079632), Module=cms.string("whole"), Dead_RocID=cms.int32(-1)) +, cms.PSet(Dead_detID=cms.int32(344078852), Module=cms.string("whole"), Dead_RocID=cms.int32(-1)) +, cms.PSet(Dead_detID=cms.int32(344078856), Module=cms.string("whole"), Dead_RocID=cms.int32(-1)) +, cms.PSet(Dead_detID=cms.int32(344078860), Module=cms.string("whole"), Dead_RocID=cms.int32(-1)) +#######Added for test +### Barrel Not there any more: end 2011 +#,cms.PSet(Dead_detID = cms.int32( 302187268 ), Module = cms.string( "none" ) , Dead_RocID = cms.int32( 6 )) +### -Z: Rows < 80 //BadRocs=0080 (col 51-103) ROC= 6 +#,cms.PSet(Dead_detID = cms.int32( 302195472 ), Module = cms.string( "none" ) , Dead_RocID = cms.int32( 0 )) +### -Z: Rows < 80 //BadRocs=0080 (col 364-416) ROC= 0 +#,cms.PSet(Dead_detID = cms.int32( 302128136 ), Module = cms.string( "none" ) , Dead_RocID = cms.int32( 3 )) +### -Z: Rows < 80 //BadRocs=0080 (col 156-207) ROC= 3 +#,cms.PSet(Dead_detID = cms.int32( 344019460 ), Module = cms.string( "none" ) , Dead_RocID = cms.int32( 4 )) +#,cms.PSet(Dead_detID = cms.int32( 344019464 ), Module = cms.string( "none" ) , Dead_RocID = cms.int32( 4 )) +#,cms.PSet(Dead_detID = cms.int32( 344019468 ), Module = cms.string( "none" ) , Dead_RocID = cms.int32( 4 )) +#302187268, "none" (ROC 6) +##302195472, "none" (ROC 0) +##302128136, "none" (ROC 3) +) +### DeadModules = cms.VPSet() +) + +# Threshold in electrons are the Official CRAFT09 numbers: +# FPix(smearing)/BPix(smearing) = 2480(160)/2730(200) + +#DEAD MODULES LIST: NEW LIST AFTER 2009 PIXEL REPAIRS +# https://twiki.cern.ch/twiki/bin/view/CMS/SiPixelQualityHistory + +######Barrel +#Bad Module: 302055940 errorType 2 BadRocs=ff00 +#Bad Module: 302059800 errorType 0 BadRocs=ffff +#Bad Module: 302121992 errorType 0 BadRocs=ffff +#BmI_SEC3_LYR2_LDR5F_MOD3 -- 302121992, "TBM-A" +#Bad Module: 302123296 errorType 0 BadRocs=ffff +#BpO_SEC1_LYR2_LDR1H_MOD4 -- 302123296, "whole" +#Bad Module: 302125060 errorType 1 BadRocs=ff +#Bad Module: 302125076 errorType 1 BadRocs=ff +#BpO_SEC4_LYR2_LDR8F_MOD1 -- 302125076, "TBM-A" +#Bad Module: 302126364 errorType 2 BadRocs=ff00 +#BpO_SEC7_LYR2_LDR13F_MOD3 -- 302126364, "TBM-B" +#Bad Module: 302126596 errorType 0 BadRocs=ffff +#BmO_SEC7_LYR2_LDR14F_MOD4 -- 302126596, "whole" +#Bad Module: 302127136 errorType 0 BadRocs=ffff +#BpO_SEC8_LYR2_LDR16H_MOD4 -- 302127136, "whole" +#Bad Module: 302188552 errorType 0 BadRocs=ffff +#BmI_SEC2_LYR3_LDR4F_MOD3 -- 302188552, "whole" +#Bad Module: 302188824 errorType 0 BadRocs=ffff +#Bad Module: 302194200 errorType 0 BadRocs=ffff +#Bad Module: 302195232 errorType 0 BadRocs=ffff +#BpI_SEC8_LYR3_LDR22H_MOD4 -- 302195232, "whole" +#Bad Module: 302197252 errorType 0 BadRocs=ffff +#Bad Module: 302197784 errorType 0 BadRocs=ffff +#BpI_SEC5_LYR3_LDR12F_MOD2 -- 302197784, "whole" + +#####Forward +#Bad Module: 352453892 errorType 0 BadRocs=ffff +#Bad Module: 352453896 errorType 0 BadRocs=ffff +#Bad Module: 352453900 errorType 0 BadRocs=ffff +#Bad Module: 352453904 errorType 0 BadRocs=ffff +#Bad Module: 352454916 errorType 0 BadRocs=ffff +#Bad Module: 352454920 errorType 0 BadRocs=ffff +#Bad Module: 352454924 errorType 0 BadRocs=ffff +#Bad Module: 352454928 errorType 0 BadRocs=ffff +#Bad Module: 352455940 errorType 0 BadRocs=ffff +#Bad Module: 352455944 errorType 0 BadRocs=ffff +#Bad Module: 352455948 errorType 0 BadRocs=ffff +#Bad Module: 352455952 errorType 0 BadRocs=ffff +#Bad Module: 352454148 errorType 0 BadRocs=ffff +#Bad Module: 352454152 errorType 0 BadRocs=ffff +#Bad Module: 352454156 errorType 0 BadRocs=ffff +#Bad Module: 352455172 errorType 0 BadRocs=ffff +#Bad Module: 352455176 errorType 0 BadRocs=ffff +#Bad Module: 352455180 errorType 0 BadRocs=ffff +#Bad Module: 352456196 errorType 0 BadRocs=ffff +#Bad Module: 352456200 errorType 0 BadRocs=ffff +#Bad Module: 352456204 errorType 0 BadRocs=ffff +#Bad Module: 343999748 errorType 0 BadRocs=ffff +#Bad Module: 343999752 errorType 0 BadRocs=ffff +#Bad Module: 343999756 errorType 0 BadRocs=ffff +#Bad Module: 343999760 errorType 0 BadRocs=ffff +#Bad Module: 344014340 errorType 0 BadRocs=ffff +#Bad Module: 344014344 errorType 0 BadRocs=ffff +#Bad Module: 344014348 errorType 0 BadRocs=ffff +#BmO_DISK1_BLD9_PNL2 -- 344014340, 344014344, 344014348 +#Bad Module: 344019460 errorType 0 BadRocs=ffff //Not there any more: end 2011 +#Bad Module: 344019464 errorType 3 BadRocs=40 +#Bad Module: 344019468 errorType 0 BadRocs=ffff //Not there any more: end 2011 +#BmI_DISK1_BLD11_PNL2 -- 344019460, 344019464, 344019468 +#Bad Module: 344077572 errorType 0 BadRocs=ffff +#Bad Module: 344077576 errorType 0 BadRocs=ffff +#Bad Module: 344077580 errorType 0 BadRocs=ffff +#Bad Module: 344077584 errorType 0 BadRocs=ffff +#Bad Module: 344078596 errorType 0 BadRocs=ffff +#Bad Module: 344078600 errorType 0 BadRocs=ffff +#Bad Module: 344078604 errorType 0 BadRocs=ffff +#Bad Module: 344078608 errorType 0 BadRocs=ffff +#Bad Module: 344079620 errorType 0 BadRocs=ffff +#Bad Module: 344079624 errorType 0 BadRocs=ffff +#Bad Module: 344079628 errorType 0 BadRocs=ffff +#Bad Module: 344079632 errorType 0 BadRocs=ffff +#Bad Module: 344078852 errorType 0 BadRocs=ffff +#Bad Module: 344078856 errorType 0 BadRocs=ffff +#Bad Module: 344078860 errorType 0 BadRocs=ffff + +# Barrel Not there any more: end 2011 +#302187268, "none" (ROC 6) +#302195472, "none" (ROC 0) +#302128136, "none" (ROC 3) + diff --git a/trunk/SimTracker/SiPixelDigitizer/src/SiPixelDigitizerAlgorithm.cc b/trunk/SimTracker/SiPixelDigitizer/src/SiPixelDigitizerAlgorithm.cc index aa5df6a1bfc9e..881ce9ec63ce7 100644 --- a/trunk/SimTracker/SiPixelDigitizer/src/SiPixelDigitizerAlgorithm.cc +++ b/trunk/SimTracker/SiPixelDigitizer/src/SiPixelDigitizerAlgorithm.cc @@ -39,14 +39,11 @@ // November, 2010: Bug fix in removing TBMB/A half-modules (V. Cuplov) // February, 2011: Time improvement in DriftDirection() (J. Bashir Butt) // June, 2011: Bug Fix for pixels on ROC edges in module_killing_DB() (J. Bashir Butt) +#include #include -#include "SimGeneral/NoiseGenerators/interface/GaussianTailNoiseGenerator.h" - #include "DataFormats/SiPixelDigi/interface/PixelDigi.h" -#include "SimDataFormats/TrackerDigiSimLink/interface/PixelDigiSimLink.h" #include "SimDataFormats/TrackingHit/interface/PSimHitContainer.h" -#include "SimTracker/Common/interface/SiG4UniversalFluctuation.h" #include "SimTracker/SiPixelDigitizer/interface/SiPixelDigitizerAlgorithm.h" #include @@ -59,7 +56,6 @@ #include "DataFormats/SiPixelDetId/interface/PXBDetId.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" -#include "FWCore/ParameterSet/interface/ParameterSet.h" #include "FWCore/ServiceRegistry/interface/Service.h" #include "FWCore/Utilities/interface/Exception.h" #include "CalibTracker/SiPixelESProducers/interface/SiPixelGainCalibrationOfflineSimService.h" @@ -68,16 +64,11 @@ #include "DataFormats/DetId/interface/DetId.h" #include "CondFormats/SiPixelObjects/interface/GlobalPixel.h" - -#include "CondFormats/DataRecord/interface/SiPixelQualityRcd.h" +#include "FWCore/Framework/interface/ESHandle.h" #include "CondFormats/DataRecord/interface/SiPixelFedCablingMapRcd.h" -#include "CondFormats/DataRecord/interface/SiPixelLorentzAngleSimRcd.h" #include "CondFormats/SiPixelObjects/interface/SiPixelFedCablingMap.h" #include "CondFormats/SiPixelObjects/interface/SiPixelFedCablingTree.h" #include "CondFormats/SiPixelObjects/interface/SiPixelFedCabling.h" -#include "CondFormats/SiPixelObjects/interface/PixelIndices.h" -#include "CondFormats/SiPixelObjects/interface/SiPixelLorentzAngle.h" -#include "CondFormats/SiPixelObjects/interface/SiPixelQuality.h" #include "CondFormats/SiPixelObjects/interface/PixelROC.h" #include "CondFormats/SiPixelObjects/interface/LocalPixel.h" #include "CondFormats/SiPixelObjects/interface/CablingPathToDetUnit.h" @@ -97,293 +88,170 @@ #include "CondFormats/SiPixelObjects/interface/PixelROC.h" +using namespace std; using namespace edm; using namespace sipixelobjects; #define TP_DEBUG // protect all LogDebug with ifdef. Takes too much CPU - -void SiPixelDigitizerAlgorithm::init(const edm::EventSetup& es) { +void SiPixelDigitizerAlgorithm::init(const edm::EventSetup& es){ if(use_ineff_from_db_){// load gain calibration service fromdb... + theSiPixelGainCalibrationService_= new SiPixelGainCalibrationOfflineSimService(conf_); theSiPixelGainCalibrationService_->setESObjects( es ); } - if(use_deadmodule_DB_) { + + fillDeadModules(es); // gets the dead module from config file or DB. + fillLorentzAngle(es); // gets the Lorentz angle from the config file or DB. + fillMapandGeom(es); //gets the map and geometry from the DB (to kill ROCs) +} + +//========================================================================= + +void SiPixelDigitizerAlgorithm::fillDeadModules(const edm::EventSetup& es){ + if(!use_deadmodule_DB_){ + DeadModules = conf_.getParameter("DeadModules"); // get dead module from cfg file + } + else{ // Get dead module from DB record + // ESHandle was defined in the header file edm::ESHandle SiPixelBadModule_; es.get().get(SiPixelBadModule_); } - if(use_LorentzAngle_DB_) { +} + +void SiPixelDigitizerAlgorithm::fillLorentzAngle(const edm::EventSetup& es){ + if(!use_LorentzAngle_DB_){ + // Get the Lorentz angle from the cfg file: + tanLorentzAnglePerTesla_FPix=conf_.getParameter("TanLorentzAnglePerTesla_FPix"); + tanLorentzAnglePerTesla_BPix=conf_.getParameter("TanLorentzAnglePerTesla_BPix"); + } + else { // Get Lorentz angle from DB record + // ESHandle was defined in the header file edm::ESHandle SiPixelLorentzAngle_; es.get().get(SiPixelLorentzAngle_); } - //gets the map and geometry from the DB (to kill ROCs) - es.get().get(map_); - es.get().get(geom_); +} + +// For ROC killing: +void SiPixelDigitizerAlgorithm::fillMapandGeom(const edm::EventSetup& es){ + es.get().get(map_); + es.get().get(geom_); } //========================================================================= SiPixelDigitizerAlgorithm::SiPixelDigitizerAlgorithm(const edm::ParameterSet& conf, CLHEP::HepRandomEngine& eng) : - - _signal(), - makeDigiSimLinks_(conf.getUntrackedParameter("makeDigiSimLinks", true)), - use_ineff_from_db_(conf.getParameter("useDB")), - use_module_killing_(conf.getParameter("killModules")), // boolean to kill or not modules - use_deadmodule_DB_(conf.getParameter("DeadModules_DB")), // boolean to access dead modules from DB - use_LorentzAngle_DB_(conf.getParameter("LorentzAngle_DB")), // boolean to access Lorentz angle from DB - - DeadModules(use_deadmodule_DB_ ? Parameters() : conf.getParameter("DeadModules")), // get dead module from cfg file + conf_(conf) , fluctuate(0), theNoiser(0), pIndexConverter(0), + use_ineff_from_db_(conf_.getParameter("useDB")), + use_module_killing_(conf_.getParameter("killModules")), // boolean to kill or not modules + use_deadmodule_DB_(conf_.getParameter("DeadModules_DB")), // boolean to access dead modules from DB + use_LorentzAngle_DB_(conf_.getParameter("LorentzAngle_DB")), // boolean to access Lorentz angle from DB + theSiPixelGainCalibrationService_(0),rndEngine(eng) +{ + using std::cout; + using std::endl; // Common pixel parameters // These are parameters which are not likely to be changed - GeVperElectron(3.61E-09), // 1 electron(3.61eV, 1keV(277e, mod 9/06 d.k. - Sigma0(0.00037), // Charge diffusion constant 7->3.7 - Dist300(0.0300), // normalized to 300micron Silicon - alpha2Order(conf.getParameter("Alpha2Order")), // switch on/off of E.B effect - ClusterWidth(3.), // Charge integration spread on the collection plane + NumberOfSegments = 20; // Default number of track segment divisions + ClusterWidth = 3.; // Charge integration spread on the collection plane + GeVperElectron = 3.61E-09; // 1 electron =3.61eV, 1keV=277e, mod 9/06 d.k. + Sigma0 = 0.00037; // Charge diffusion constant 7->3.7 + Dist300 = 0.0300; // normalized to 300micron Silicon - // get external parameters: - // To account for upgrade geometries do not assume the number - // of layers or disks. - NumberOfBarrelLayers(conf.exists("NumPixelBarrel")?conf.getParameter("NumPixelBarrel"):3), - NumberOfEndcapDisks(conf.exists("NumPixelEndcap")?conf.getParameter("NumPixelEndcap"):2), + alpha2Order = conf_.getParameter("Alpha2Order"); // switch on/off of E.B effect - // ADC calibration 1adc count(135e. - // Corresponds to 2adc/kev, 270[e/kev]/135[e/adc](2[adc/kev] + // get external parameters: + // ADC calibration 1adc count = 135e. + // Corresponds to 2adc/kev, 270[e/kev]/135[e/adc]=2[adc/kev] // Be carefull, this parameter is also used in SiPixelDet.cc to // calculate the noise in adc counts from noise in electrons. // Both defaults should be the same. - theElectronPerADC(conf.getParameter("ElectronPerAdc")), - - // ADC saturation value, 255(8bit adc. - //theAdcFullScale(conf.getUntrackedParameter("AdcFullScale",255)), - theAdcFullScale(conf.getParameter("AdcFullScale")), - theAdcFullScaleStack(conf.exists("AdcFullScaleStack")?conf.getParameter("AdcFullScaleStack"):255), - theFirstStackLayer(conf.exists("FirstStackLayer")?conf.getParameter("FirstStackLayer"):5), + theElectronPerADC=conf_.getParameter("ElectronPerAdc"); - // Noise in electrons: - // Pixel cell noise, relevant for generating noisy pixels - theNoiseInElectrons(conf.getParameter("NoiseInElectrons")), - - // Fill readout noise, including all readout chain, relevant for smearing - //theReadoutNoise(conf.getUntrackedParameter("ReadoutNoiseInElec",500.)), - theReadoutNoise(conf.getParameter("ReadoutNoiseInElec")), + // ADC saturation value, 255=8bit adc. + //theAdcFullScale=conf_.getUntrackedParameter("AdcFullScale",255); + theAdcFullScale=conf_.getParameter("AdcFullScale"); // Pixel threshold in units of noise: - // thePixelThreshold(conf.getParameter("ThresholdInNoiseUnits")), + // thePixelThreshold=conf_.getParameter("ThresholdInNoiseUnits"); // Pixel threshold in electron units. - theThresholdInE_FPix(conf.getParameter("ThresholdInElectrons_FPix")), - theThresholdInE_BPix(conf.getParameter("ThresholdInElectrons_BPix")), - theThresholdInE_BPix_L1(conf.exists("ThresholdInElectrons_BPix_L1")?conf.getParameter("ThresholdInElectrons_BPix_L1"):theThresholdInE_BPix), + theThresholdInE_FPix=conf_.getParameter("ThresholdInElectrons_FPix"); + theThresholdInE_BPix=conf_.getParameter("ThresholdInElectrons_BPix"); // Add threshold gaussian smearing: - theThresholdSmearing_FPix(conf.getParameter("ThresholdSmearing_FPix")), - theThresholdSmearing_BPix(conf.getParameter("ThresholdSmearing_BPix")), - theThresholdSmearing_BPix_L1(conf.exists("ThresholdSmearing_BPix_L1")?conf.getParameter("ThresholdSmearing_BPix_L1"):theThresholdSmearing_BPix), - - // electrons to VCAL conversion needed in misscalibrate() - electronsPerVCAL(conf.getParameter("ElectronsPerVcal")), - electronsPerVCAL_Offset(conf.getParameter("ElectronsPerVcal_Offset")), - - //theTofCut 12.5, cut in particle TOD +/- 12.5ns - //theTofCut(conf.getUntrackedParameter("TofCut",12.5)), - theTofLowerCut(conf.getParameter("TofLowerCut")), - theTofUpperCut(conf.getParameter("TofUpperCut")), - - // Get the Lorentz angle from the cfg file: - tanLorentzAnglePerTesla_FPix(use_LorentzAngle_DB_ ? 0.0 : conf.getParameter("TanLorentzAnglePerTesla_FPix")), - tanLorentzAnglePerTesla_BPix(use_LorentzAngle_DB_ ? 0.0 : conf.getParameter("TanLorentzAnglePerTesla_BPix")), + addThresholdSmearing = conf_.getParameter("AddThresholdSmearing"); + theThresholdSmearing_FPix = conf_.getParameter("ThresholdSmearing_FPix"); + theThresholdSmearing_BPix = conf_.getParameter("ThresholdSmearing_BPix"); // signal response new parameterization: split Fpix and BPix - FPix_p0(conf.getParameter("FPix_SignalResponse_p0")), - FPix_p1(conf.getParameter("FPix_SignalResponse_p1")), - FPix_p2(conf.getParameter("FPix_SignalResponse_p2")), - FPix_p3(conf.getParameter("FPix_SignalResponse_p3")), + FPix_p0 = conf_.getParameter("FPix_SignalResponse_p0"); + FPix_p1 = conf_.getParameter("FPix_SignalResponse_p1"); + FPix_p2 = conf_.getParameter("FPix_SignalResponse_p2"); + FPix_p3 = conf_.getParameter("FPix_SignalResponse_p3"); + + BPix_p0 = conf_.getParameter("BPix_SignalResponse_p0"); + BPix_p1 = conf_.getParameter("BPix_SignalResponse_p1"); + BPix_p2 = conf_.getParameter("BPix_SignalResponse_p2"); + BPix_p3 = conf_.getParameter("BPix_SignalResponse_p3"); - BPix_p0(conf.getParameter("BPix_SignalResponse_p0")), - BPix_p1(conf.getParameter("BPix_SignalResponse_p1")), - BPix_p2(conf.getParameter("BPix_SignalResponse_p2")), - BPix_p3(conf.getParameter("BPix_SignalResponse_p3")), + // electrons to VCAL conversion needed in misscalibrate() + electronsPerVCAL = conf_.getParameter("ElectronsPerVcal"); + electronsPerVCAL_Offset = conf_.getParameter("ElectronsPerVcal_Offset"); // Add noise - addNoise(conf.getParameter("AddNoise")), + addNoise=conf_.getParameter("AddNoise"); // Smear the pixel charge with a gaussian which RMS is a function of the // pixel charge (Danek's study) - addChargeVCALSmearing(conf.getParameter("ChargeVCALSmearing")), + addChargeVCALSmearing=conf_.getParameter("ChargeVCALSmearing"); // Add noisy pixels - addNoisyPixels(conf.getParameter("AddNoisyPixels")), + addNoisyPixels=conf_.getParameter("AddNoisyPixels"); + // Noise in electrons: + // Pixel cell noise, relevant for generating noisy pixels + theNoiseInElectrons=conf_.getParameter("NoiseInElectrons"); + // Fill readout noise, including all readout chain, relevant for smearing + //theReadoutNoise=conf_.getUntrackedParameter("ReadoutNoiseInElec",500.); + theReadoutNoise=conf_.getParameter("ReadoutNoiseInElec"); + + //theTofCut 12.5, cut in particle TOD +/- 12.5ns + //theTofCut=conf_.getUntrackedParameter("TofCut",12.5); + theTofLowerCut=conf_.getParameter("TofLowerCut"); + theTofUpperCut=conf_.getParameter("TofUpperCut"); // Fluctuate charge in track subsegments - fluctuateCharge(conf.getUntrackedParameter("FluctuateCharge",true)), + fluctuateCharge=conf_.getUntrackedParameter("FluctuateCharge",true); - // Control the pixel inefficiency - thePixelLuminosity(conf.getParameter("AddPixelInefficiency")), + // delta cutoff in MeV, has to be same as in OSCAR=0.030/cmsim=1.0 MeV + //tMax = 0.030; // In MeV. + //tMax =conf_.getUntrackedParameter("DeltaProductionCut",0.030); + tMax =conf_.getParameter("DeltaProductionCut"); - // Add threshold gaussian smearing: - addThresholdSmearing(conf.getParameter("AddThresholdSmearing")), + // Control the pixel inefficiency + thePixelLuminosity=conf_.getParameter("AddPixelInefficiency"); // Get the constants for the miss-calibration studies - doMissCalibrate(conf.getParameter("MissCalibrate")), // Enable miss-calibration - theGainSmearing(conf.getParameter("GainSmearing")), // sigma of the gain smearing - theOffsetSmearing(conf.getParameter("OffsetSmearing")), //sigma of the offset smearing - - // delta cutoff in MeV, has to be same as in OSCAR(0.030/cmsim=1.0 MeV - //tMax(0.030), // In MeV. - //tMax(conf.getUntrackedParameter("DeltaProductionCut",0.030)), - tMax(conf.getParameter("DeltaProductionCut")), - - fluctuate(fluctuateCharge ? new SiG4UniversalFluctuation(eng) : 0), - theNoiser(addNoise ? new GaussianTailNoiseGenerator(eng) : 0), - calmap(doMissCalibrate ? initCal() : std::map >()), - theSiPixelGainCalibrationService_(use_ineff_from_db_ ? new SiPixelGainCalibrationOfflineSimService(conf) : 0), - pixelEfficiencies_(conf, thePixelLuminosity,NumberOfBarrelLayers,NumberOfEndcapDisks), - flatDistribution_((addNoise || thePixelLuminosity || fluctuateCharge || addThresholdSmearing) ? new CLHEP::RandFlat(eng, 0., 1.) : 0), - gaussDistribution_((addNoise || thePixelLuminosity || fluctuateCharge || addThresholdSmearing) ? new CLHEP::RandGaussQ(eng, 0., theReadoutNoise) : 0), - gaussDistributionVCALNoise_((addNoise || thePixelLuminosity || fluctuateCharge || addThresholdSmearing) ? new CLHEP::RandGaussQ(eng, 0., 1.) : 0), - // Threshold smearing with gaussian distribution: - smearedThreshold_FPix_(addThresholdSmearing ? new CLHEP::RandGaussQ(eng, theThresholdInE_FPix , theThresholdSmearing_FPix) : 0), - smearedThreshold_BPix_(addThresholdSmearing ? new CLHEP::RandGaussQ(eng, theThresholdInE_BPix , theThresholdSmearing_BPix) : 0), - smearedThreshold_BPix_L1_(addThresholdSmearing ? new CLHEP::RandGaussQ(eng, theThresholdInE_BPix_L1 , theThresholdSmearing_BPix_L1) : 0) -{ - LogInfo ("PixelDigitizer ") <<"SiPixelDigitizerAlgorithm constructed" - <<"Configuration parameters:" - << "Threshold/Gain = " - << "threshold in electron FPix = " - << theThresholdInE_FPix - << "threshold in electron BPix = " - << theThresholdInE_BPix - << "threshold in electron BPix Layer1 = " - << theThresholdInE_BPix_L1 - <<" " << theElectronPerADC << " " << theAdcFullScale - << " The delta cut-off is set to " << tMax - << " pix-inefficiency "< > -SiPixelDigitizerAlgorithm::initCal() const { - - using std::cerr; - using std::cout; - using std::endl; - - std::map > calmap; - // Prepare for the analog amplitude miss-calibration - LogDebug ("PixelDigitizer ") - << " miss-calibrate the pixel amplitude "; - - const bool ReadCalParameters = false; - if(ReadCalParameters) { // Read the calibration files from file - // read the calibration constants from a file (testing only) - std::ifstream in_file; // data file pointer - char filename[80] = "phCalibrationFit_C0.dat"; - - in_file.open(filename, std::ios::in ); // in C++ - if(in_file.bad()) { - cout << " File not found " << endl; - return calmap; // signal error - } - cout << " file opened : " << filename << endl; - - char line[500]; - for (int i = 0; i < 3; i++) { - in_file.getline(line, 500,'\n'); - cout<> par0 >> par1 >> par2 >> par3 >> name >> colid >> rowid; - if(in_file.bad()) { // check for errors - cerr << "Cannot read data file" << endl; - return calmap; - } - if( in_file.eof() != 0 ) { - cerr << in_file.eof() << " " << in_file.gcount() << " " - << in_file.fail() << " " << in_file.good() << " end of file " - << endl; - return calmap; - } - - //cout << " line " << i << " " <("MissCalibrate"); // Enable miss-calibration + theGainSmearing=conf_.getParameter("GainSmearing"); // sigma of the gain smearing + theOffsetSmearing=conf_.getParameter("OffsetSmearing"); //sigma of the offset smearing - // Convert ROC pixel index to channel - int chan = PixelIndices::pixelToChannelROC(rowid,colid); - calmap.insert(std::pair(chan,onePix)); - - // Testing the index conversion, can be skipped - std::pair p = PixelIndices::channelToPixelROC(chan); - if(rowid!=p.first) cout<<" wrong channel row "< >::iterator ix,it; -// map >::const_iterator ip; -// for (ix = calmap.begin(); ix != calmap.end(); ++ix) { -// int i = (*ix).first; -// std::pair p = channelToPixelROC(i); -// it = calmap.find(i); -// CalParameters y = (*it).second; -// CalParameters z = (*ix).second; -// cout << i <<" "<>dummy; -// } - - } // end if readparameters - return calmap; -} // end initCal() - -//========================================================================= -SiPixelDigitizerAlgorithm::~SiPixelDigitizerAlgorithm() { - LogDebug ("PixelDigitizer")<<"SiPixelDigitizerAlgorithm deleted"; -} - -SiPixelDigitizerAlgorithm::PixelEfficiencies::PixelEfficiencies(const edm::ParameterSet& conf, int thePixelLuminosity, int NumberOfBarrelLayers, int NumberOfEndcapDisks) { //pixel inefficiency - int NumberOfTotLayers = NumberOfBarrelLayers + NumberOfEndcapDisks; - FPixIndex=NumberOfBarrelLayers; - if (thePixelLuminosity==-20){ - int i=0; - thePixelColEfficiency[i++] = conf.getParameter("thePixelColEfficiency_BPix1"); - thePixelColEfficiency[i++] = conf.getParameter("thePixelColEfficiency_BPix2"); - thePixelColEfficiency[i++] = conf.getParameter("thePixelColEfficiency_BPix3"); - // Only try to read in 4th barrel layer if there are 4 or more of them - if (NumberOfBarrelLayers>=4){thePixelColEfficiency[i++] = conf.getParameter("thePixelColEfficiency_BPix4");} - thePixelColEfficiency[FPixIndex] = conf.getParameter("thePixelColEfficiency_FPix1"); - //thePixelColEfficiency[FPixIndex+1] = conf.getParameter("thePixelColEfficiency_FPix2"); // Not used, but leave it in in case we want use it to later - //thePixelColEfficiency[FPixIndex+2] = conf.getParameter("thePixelColEfficiency_FPix3"); // Not used, but leave it in in case we want use it to later - //std::cout<<"\nReading in custom Pixel efficiencies "<("thePixelColEfficiency_BPix1"); + thePixelColEfficiency[1] = conf_.getParameter("thePixelColEfficiency_BPix2"); + thePixelColEfficiency[2] = conf_.getParameter("thePixelColEfficiency_BPix3"); + thePixelColEfficiency[3] = conf_.getParameter("thePixelColEfficiency_FPix1"); + thePixelColEfficiency[4] = conf_.getParameter("thePixelColEfficiency_FPix2"); // Not used, but leave it in in case we want use it to later + cout<<"\nReading in custom Pixel efficiencies "<0) { // Include effciency + pixelInefficiency=true; // Default efficiencies - for (int i=0; i> par0 >> par1 >> par2 >> par3 >> name >> colid + >> rowid; + if(in_file.bad()) { // check for errors + cerr << "Cannot read data file" << endl; + return; + } + if( in_file.eof() != 0 ) { + cerr << in_file.eof() << " " << in_file.gcount() << " " + << in_file.fail() << " " << in_file.good() << " end of file " + << endl; + return; + } + + //cout << " line " << i << " " <(chan,onePix)); + + // Testing the index conversion, can be skipped + pair p = PixelIndices::channelToPixelROC(chan); + if(rowid!=p.first) cout<<" wrong channel row "< >::iterator ix,it; +// map >::const_iterator ip; +// for (ix = calmap.begin(); ix != calmap.end(); ++ix) { +// int i = (*ix).first; +// pair p = channelToPixelROC(i); +// it = calmap.find(i); +// CalParameters y = (*it).second; +// CalParameters z = (*ix).second; +// cout << i <<" "<>dummy; +// } + + } // end if readparameters + } // end if missCalibration + + LogInfo ("PixelDigitizer ") <<"SiPixelDigitizerAlgorithm constructed" + <<"Configuration parameters:" + << "Threshold/Gain = " + << "threshold in electron FPix = " + << theThresholdInE_FPix + << "threshold in electron BPix = " + << theThresholdInE_BPix + <<" " << theElectronPerADC << " " << theAdcFullScale + << " The delta cut-off is set to " << tMax + << " pix-inefficiency "<::const_iterator inputBegin, - std::vector::const_iterator inputEnd, - const PixelGeomDetUnit* pixdet, - const GlobalVector& bfield) { - // produce SignalPoint's for all SimHit's in detector - // Loop over hits +edm::DetSet::collection_type +SiPixelDigitizerAlgorithm::run( + const std::vector &input, + PixelGeomDetUnit *pixdet, + GlobalVector bfield) { - uint32_t detId = pixdet->geographicalId().rawId(); - for (std::vector::const_iterator ssbegin = inputBegin; ssbegin != inputEnd; ++ssbegin) { - // skip hits not in this detector. - if((*ssbegin).detUnitId() != detId) { - continue; - } + _detp = pixdet; //cache the PixGeomDetUnit + _PixelHits=input; //cache the SimHit + _bfield=bfield; //cache the drift direction -#ifdef TP_DEBUG - LogDebug ("Pixel Digitizer") - << (*ssbegin).particleType() << " " << (*ssbegin).pabs() << " " - << (*ssbegin).energyLoss() << " " << (*ssbegin).tof() << " " - << (*ssbegin).trackId() << " " << (*ssbegin).processType() << " " - << (*ssbegin).detUnitId() - << (*ssbegin).entryPoint() << " " << (*ssbegin).exitPoint() ; -#endif + // Pixel Efficiency moved from the constructor to the method run because + // the information of the det are not available in the constructor + // Effciency parameters. 0 - no inefficiency, 1-low lumi, 10-high lumi - - std::vector ionization_points; - std::vector collection_points; + detID= _detp->geographicalId().rawId(); - // fill collection_points for this SimHit, indpendent of topology - // Check the TOF cut - //if(std::abs( (*ssbegin).tof() )= theTofLowerCut) && ((*ssbegin).tof() <= theTofUpperCut) ) { - primary_ionization(*ssbegin, ionization_points); // fills _ionization_points - drift(*ssbegin, pixdet, bfield, ionization_points, collection_points); // transforms _ionization_points to collection_points - // compute induced signal on readout elements and add to _signal - induce_signal(*ssbegin, pixdet, collection_points); // *ihit needed only for SimHit<-->Digi link - } // end if - } // end for + _signal.clear(); + + // initalization of pixeldigisimlinks + link_coll.clear(); + + //Digitization of the SimHits of a given pixdet + vector collector =digitize(pixdet); + + // edm::DetSet collector; + +#ifdef TP_DEBUG + LogDebug ("PixelDigitizer") << "[SiPixelDigitizerAlgorithm] converted " << collector.size() << " PixelDigis in DetUnit" << detID; +#endif + return collector; } //============================================================================ -void SiPixelDigitizerAlgorithm::digitize(const PixelGeomDetUnit* pixdet, - std::vector& digis, - std::vector& simlinks) { +vector SiPixelDigitizerAlgorithm::digitize(PixelGeomDetUnit *det){ - // Pixel Efficiency moved from the constructor to this method because - // the information of the det are not available in the constructor - // Effciency parameters. 0 - no inefficiency, 1-low lumi, 10-high lumi + if( _PixelHits.size() > 0 || addNoisyPixels) { - uint32_t detID = pixdet->geographicalId().rawId(); - const signal_map_type& theSignal = _signal[detID]; + topol=&det->specificTopology(); // cache topology + numColumns = topol->ncolumns(); // det module number of cols&rows + numRows = topol->nrows(); - const PixelTopology* topol=&pixdet->specificTopology(); - int numColumns = topol->ncolumns(); // det module number of cols&rows - int numRows = topol->nrows(); + // full detector thickness + moduleThickness = det->specificSurface().bounds().thickness(); + + // The index converter is only needed when inefficiencies or misscalibration + // are simulated. + if((pixelInefficiency>0) || doMissCalibrate ) { // Init pixel indices + pIndexConverter = new PixelIndices(numColumns,numRows); + } // Noise already defined in electrons //thePixelThresholdInE = thePixelThreshold * theNoiseInElectrons ; @@ -508,71 +514,92 @@ void SiPixelDigitizerAlgorithm::digitize(const PixelGeomDetUnit* pixdet, unsigned int Sub_detid=DetId(detID).subdetId(); - float thePixelThresholdInE = 0.; - if(theNoiseInElectrons>0.){ if(Sub_detid == PixelSubdetector::PixelBarrel){ // Barrel modules - int lay = PXBDetId(detID).layer(); if(addThresholdSmearing) { - if(lay==1) { - thePixelThresholdInE = smearedThreshold_BPix_L1_->fire(); // gaussian smearing - } else { - thePixelThresholdInE = smearedThreshold_BPix_->fire(); // gaussian smearing - } + thePixelThresholdInE = smearedThreshold_BPix_->fire(); // gaussian smearing } else { - if(lay==1) { - thePixelThresholdInE = theThresholdInE_BPix_L1; - } else { - thePixelThresholdInE = theThresholdInE_BPix; // no smearing - } + thePixelThresholdInE = theThresholdInE_BPix; // no smearing } + + thePixelThreshold = thePixelThresholdInE/theNoiseInElectrons; + } else { // Forward disks modules if(addThresholdSmearing) { thePixelThresholdInE = smearedThreshold_FPix_->fire(); // gaussian smearing } else { thePixelThresholdInE = theThresholdInE_FPix; // no smearing } + + thePixelThreshold = thePixelThresholdInE/theNoiseInElectrons; + } + } else { + thePixelThreshold = 0.; } #ifdef TP_DEBUG - // full detector thickness - float moduleThickness = pixdet->specificSurface().bounds().thickness(); LogDebug ("PixelDigitizer") << " PixelDigitizer " << numColumns << " " << numRows << " " << moduleThickness; #endif - if(addNoise) add_noise(pixdet, thePixelThresholdInE/theNoiseInElectrons); // generate noise + // produce SignalPoint's for all SimHit's in detector + // Loop over hits + + vector::const_iterator ssbegin; + for (ssbegin= _PixelHits.begin();ssbegin !=_PixelHits.end(); ++ssbegin) { + +#ifdef TP_DEBUG + LogDebug ("Pixel Digitizer") + << (*ssbegin).particleType() << " " << (*ssbegin).pabs() << " " + << (*ssbegin).energyLoss() << " " << (*ssbegin).tof() << " " + << (*ssbegin).trackId() << " " << (*ssbegin).processType() << " " + << (*ssbegin).detUnitId() + << (*ssbegin).entryPoint() << " " << (*ssbegin).exitPoint() ; +#endif + + _collection_points.clear(); // Clear the container + // fill _collection_points for this SimHit, indpendent of topology + // Check the TOF cut + //if(std::abs( (*ssbegin).tof() )= theTofLowerCut) && ((*ssbegin).tof() <= theTofUpperCut) ) { + primary_ionization(*ssbegin); // fills _ionization_points + drift(*ssbegin); // transforms _ionization_points to _collection_points + // compute induced signal on readout elements and add to _signal + induce_signal(*ssbegin); // *ihit needed only for SimHit<-->Digi link + } // end if + } // end for + if(addNoise) add_noise(); // generate noise // Do only if needed - if(((thePixelLuminosity>=0)||(thePixelLuminosity==-20)) && (theSignal.size()>0)) - pixel_inefficiency(pixelEfficiencies_, pixdet); // Kill some pixels + if((pixelInefficiency>0) && (_signal.size()>0)) + pixel_inefficiency(); // Kill some pixels - if(use_ineff_from_db_ && (theSignal.size()>0)) - pixel_inefficiency_db(detID); + if(use_ineff_from_db_ && (_signal.size()>0)) + pixel_inefficiency_db(); - if(use_module_killing_) { - if (use_deadmodule_DB_) { // remove dead modules using DB - module_killing_DB(detID); - } else { // remove dead modules using the list in cfg file - module_killing_conf(detID); - } - } + delete pIndexConverter; - make_digis(thePixelThresholdInE, detID, digis, simlinks); + if(use_module_killing_ && use_deadmodule_DB_) // remove dead modules using DB + module_killing_DB(); -#ifdef TP_DEBUG - LogDebug ("PixelDigitizer") << "[SiPixelDigitizerAlgorithm] converted " << digis.size() << " PixelDigis in DetUnit" << detID; -#endif + if(use_module_killing_ && !use_deadmodule_DB_) // remove dead modules using the list in cfg file + module_killing_conf(); + + } + + make_digis(); + + return internal_coll; } //***********************************************************************/ // Generate primary ionization along the track segment. // Divide the track into small sub-segments -void SiPixelDigitizerAlgorithm::primary_ionization(const PSimHit& hit, std::vector& ionization_points) const { +void SiPixelDigitizerAlgorithm::primary_ionization(const PSimHit& hit) { // Straight line approximation for trajectory inside active media @@ -585,7 +612,7 @@ void SiPixelDigitizerAlgorithm::primary_ionization(const PSimHit& hit, std::vect float eLoss = hit.energyLoss(); // Eloss in GeV float length = direction.mag(); // Track length in Silicon - int NumberOfSegments = int ( length / SegmentLength); // Number of segments + NumberOfSegments = int ( length / SegmentLength); // Number of segments if(NumberOfSegments < 1) NumberOfSegments = 1; #ifdef TP_DEBUG @@ -611,7 +638,7 @@ void SiPixelDigitizerAlgorithm::primary_ionization(const PSimHit& hit, std::vect elossVector); } - ionization_points.resize( NumberOfSegments); // set size + _ionization_points.resize( NumberOfSegments); // set size // loop over segments for ( int i = 0; i != NumberOfSegments; i++) { @@ -625,14 +652,14 @@ void SiPixelDigitizerAlgorithm::primary_ionization(const PSimHit& hit, std::vect energy = hit.energyLoss()/GeVperElectron/float(NumberOfSegments); EnergyDepositUnit edu( energy, point); //define position,energy point - ionization_points[i] = edu; // save + _ionization_points[i] = edu; // save #ifdef TP_DEBUG LogDebug ("Pixel Digitizer") - << i << " " << ionization_points[i].x() << " " - << ionization_points[i].y() << " " - << ionization_points[i].z() << " " - << ionization_points[i].energy(); + << i << " " << _ionization_points[i].x() << " " + << _ionization_points[i].y() << " " + << _ionization_points[i].z() << " " + << _ionization_points[i].energy(); #endif } // end for loop @@ -646,7 +673,7 @@ void SiPixelDigitizerAlgorithm::primary_ionization(const PSimHit& hit, std::vect // Use the G4 routine. For mip pions for the moment. void SiPixelDigitizerAlgorithm::fluctuateEloss(int pid, float particleMomentum, float eloss, float length, - int NumberOfSegs,float elossVector[]) const { + int NumberOfSegs,float elossVector[]) { // Get dedx for this track //float dedx; @@ -654,7 +681,7 @@ void SiPixelDigitizerAlgorithm::fluctuateEloss(int pid, float particleMomentum, //else dedx = eloss; double particleMass = 139.6; // Mass in MeV, Assume pion - pid = std::abs(pid); + pid = abs(pid); if(pid!=211) { // Mass in MeV if(pid==11) particleMass = 0.511; else if(pid==13) particleMass = 105.7; @@ -699,19 +726,22 @@ void SiPixelDigitizerAlgorithm::fluctuateEloss(int pid, float particleMomentum, //******************************************************************************* // Drift the charge segments to the sensor surface (collection plane) // Include the effect of E-field and B-field -void SiPixelDigitizerAlgorithm::drift(const PSimHit& hit, - const PixelGeomDetUnit* pixdet, - const GlobalVector& bfield, - const std::vector& ionization_points, - std::vector& collection_points) const { +void SiPixelDigitizerAlgorithm::drift(const PSimHit& hit){ + #ifdef TP_DEBUG LogDebug ("Pixel Digitizer") << " enter drift " ; #endif - collection_points.resize(ionization_points.size()); // set size + _collection_points.resize( _ionization_points.size()); // set size - LocalVector driftDir=DriftDirection(pixdet, bfield, hit.detUnitId()); // get the charge drift direction + if(use_LorentzAngle_DB_){ + //float LorentzAng = SiPixelLorentzAngle_->getLorentzAngle(hit.detUnitId()); + lorentzAngle = SiPixelLorentzAngle_->getLorentzAngle(hit.detUnitId()); + } + + //LocalVector driftDir=DriftDirection(LorentzAng); // get the charge drift direction + LocalVector driftDir=DriftDirection(); // get the charge drift direction if(driftDir.z() ==0.) { LogWarning("Magnetic field") << " pxlx: drift in z is zero "; return; @@ -740,7 +770,7 @@ void SiPixelDigitizerAlgorithm::drift(const PSimHit& hit, CosLorenzAngleY = 1.; } - float moduleThickness = pixdet->specificSurface().bounds().thickness(); + #ifdef TP_DEBUG LogDebug ("Pixel Digitizer") << " Lorentz Tan " << TanLorenzAngleX << " " << TanLorenzAngleY <<" " @@ -755,12 +785,12 @@ void SiPixelDigitizerAlgorithm::drift(const PSimHit& hit, float Sigma; - for (unsigned int i = 0; i != ionization_points.size(); i++) { + for (unsigned int i = 0; i != _ionization_points.size(); i++) { float SegX, SegY, SegZ; // position - SegX = ionization_points[i].x(); - SegY = ionization_points[i].y(); - SegZ = ionization_points[i].z(); + SegX = _ionization_points[i].x(); + SegY = _ionization_points[i].y(); + SegZ = _ionization_points[i].z(); // Distance from the collection plane //DriftDistance = (moduleThickness/2. + SegZ); // Drift to -z @@ -770,10 +800,10 @@ void SiPixelDigitizerAlgorithm::drift(const PSimHit& hit, //if( DriftDistance <= 0.) //cout<<" <=0 "<& collection_points) { +void SiPixelDigitizerAlgorithm::induce_signal( const PSimHit& hit) { // X - Rows, Left-Right, 160, (1.6cm) for barrel // Y - Columns, Down-Up, 416, (6.4cm) - const PixelTopology* topol=&pixdet->specificTopology(); - uint32_t detID= pixdet->geographicalId().rawId(); - signal_map_type& theSignal = _signal[detID]; - #ifdef TP_DEBUG LogDebug ("Pixel Digitizer") << " enter induce_signal, " @@ -830,17 +854,17 @@ void SiPixelDigitizerAlgorithm::induce_signal(const PSimHit& hit, #endif // local map to store pixels hit by 1 Hit. - typedef std::map< int, float, std::less > hit_map_type; + typedef map< int, float, less > hit_map_type; hit_map_type hit_signal; // map to store pixel integrals in the x and in the y directions - std::map > x,y; + map > x,y; // Assign signals to readout channels and store sorted by channel number // Iterate over collection points on the collection plane - for ( std::vector::const_iterator i=collection_points.begin(); - i != collection_points.end(); ++i) { + for ( vector::const_iterator i=_collection_points.begin(); + i != _collection_points.end(); i++) { float CloudCenterX = i->position().x(); // Charge position in x float CloudCenterY = i->position().y(); // in y @@ -852,7 +876,7 @@ void SiPixelDigitizerAlgorithm::induce_signal(const PSimHit& hit, //if(SigmaX==0 || SigmaY==0) { //cout<position().x() << " " << i->position().y() << " " - // << i->sigma_x() << " " << i->sigma_y() << " " << i->amplitude()<sigma_x() << " " << i->sigma_y() << " " << i->amplitude()<ncolumns(); // det module number of cols&rows - int numRows = topol->nrows(); - IPixRightUpX = numRows>IPixRightUpX ? IPixRightUpX : numRows-1 ; IPixRightUpY = numColumns>IPixRightUpY ? IPixRightUpY : numColumns-1 ; IPixLeftDownX = 0measurementPosition( i->position() ); //OK // LocalPoint lp = topol->localPosition(mp); //OK - // std::pair p = topol->pixel( i->position() ); //OK + // pair p = topol->pixel( i->position() ); //OK // chan = PixelDigi::pixelToChannel( int(p.first), int(p.second)); - // std::pair ip = PixelDigi::channelToPixel(chan); + // pair ip = PixelDigi::channelToPixel(chan); // MeasurementPoint mp1 = MeasurementPoint( float(ip.first), // float(ip.second) ); // LogDebug ("Pixel Digitizer") << " Test "<< mp.x() << " " << mp.y() @@ -1041,16 +1062,16 @@ void SiPixelDigitizerAlgorithm::induce_signal(const PSimHit& hit, // Fill the global map with all hit pixels from this event for ( hit_map_type::const_iterator im = hit_signal.begin(); - im != hit_signal.end(); ++im) { - int chan = (*im).first; - theSignal[chan] += (makeDigiSimLinks_ ? Amplitude( (*im).second, &hit, (*im).second) : Amplitude( (*im).second, (*im).second) ) ; + im != hit_signal.end(); im++) { + _signal[(*im).first] += Amplitude( (*im).second, &hit, (*im).second); + int chan = (*im).first; + pair ip = PixelDigi::channelToPixel(chan); #ifdef TP_DEBUG - std::pair ip = PixelDigi::channelToPixel(chan); LogDebug ("Pixel Digitizer") << " pixel " << ip.first << " " << ip.second << " " - << theSignal[chan]; + << _signal[(*im).first]; #endif } @@ -1059,65 +1080,43 @@ void SiPixelDigitizerAlgorithm::induce_signal(const PSimHit& hit, /***********************************************************************/ // Build pixels, check threshold, add misscalibration, ... -void SiPixelDigitizerAlgorithm::make_digis(float thePixelThresholdInE, - uint32_t detID, - std::vector& digis, - std::vector& simlinks) const { +void SiPixelDigitizerAlgorithm::make_digis() { + internal_coll.reserve(50); internal_coll.clear(); #ifdef TP_DEBUG LogDebug ("Pixel Digitizer") << " make digis "<<" " << " pixel threshold FPix" << theThresholdInE_FPix << " " << " pixel threshold BPix" << theThresholdInE_BPix << " " - << " pixel threshold BPix Layer1" << theThresholdInE_BPix_L1 << " " << " List pixels passing threshold "; #endif // Loop over hit pixels - signalMaps::const_iterator it = _signal.find(detID); - if (it == _signal.end()) { - return; - } - - const signal_map_type& theSignal = (*it).second; - - for (signal_map_const_iterator i = theSignal.begin(); i != theSignal.end(); ++i) { + for ( signal_map_iterator i = _signal.begin(); i != _signal.end(); i++) { - float signalInElectrons = (*i).second ; // signal in electrons + float signalInElectrons = (*i).second ; // signal in electrons // Do the miss calibration for calibration studies only. //if(doMissCalibrate) signalInElectrons = missCalibrate(signalInElectrons) // Do only for pixels above threshold - if( signalInElectrons >= thePixelThresholdInE) { // check threshold + if( signalInElectrons >= thePixelThresholdInE) { // check threshold int chan = (*i).first; // channel number - std::pair ip = PixelDigi::channelToPixel(chan); + pair ip = PixelDigi::channelToPixel(chan); int adc=0; // ADC count as integer // Do the miss calibration for calibration studies only. if(doMissCalibrate) { int row = ip.first; // X in row int col = ip.second; // Y is in col - adc = int(missCalibrate(detID, col, row, signalInElectrons)); //full misscalib. + adc = int(missCalibrate(col,row,signalInElectrons)); //full misscalib. } else { // Just do a simple electron->adc conversion adc = int( signalInElectrons / theElectronPerADC ); // calibrate gain } - adc = std::min(adc, theAdcFullScale); // Check maximum value -// Calculate layerIndex - if (theAdcFullScale!=theAdcFullScaleStack){ - unsigned int Sub_detid=DetId(detID).subdetId(); - if(Sub_detid == PixelSubdetector::PixelBarrel){ // Barrel modules - int lay = PXBDetId(detID).layer(); - if (lay>=theFirstStackLayer) { - // Set to 1 if over the threshold - if (theAdcFullScaleStack==1) {adc=1;} - // Make it a linear fit to the full scale of the normal adc count. Start new adc from 1 not zero. - if (theAdcFullScaleStack!=1&&theAdcFullScaleStack!=theAdcFullScale) {adc = int (1 + adc * (theAdcFullScaleStack-1)/float(theAdcFullScale) );} - } - } - } // Only enter this if the Adc changes for the outer layers + adc = min(adc, theAdcFullScale); // Check maximum value + #ifdef TP_DEBUG LogDebug ("Pixel Digitizer") << (*i).first << " " << (*i).second << " " << signalInElectrons @@ -1125,56 +1124,50 @@ void SiPixelDigitizerAlgorithm::make_digis(float thePixelThresholdInE, #endif // Load digis - digis.emplace_back(ip.first, ip.second, adc); - - if (makeDigiSimLinks_) { - //digilink - if((*i).second.trackIds().size()>0){ - simlink_map simi; - unsigned int il=0; - for( std::vector::const_iterator itid = (*i).second.trackIds().begin(); - itid != (*i).second.trackIds().end(); ++itid) { - simi[*itid].push_back((*i).second.individualampl()[il]); - il++; - } + internal_coll.push_back( PixelDigi( ip.first, ip.second, adc)); + + //digilink + if((*i).second.hits().size()>0){ + simi.clear(); + unsigned int il=0; + for( vector::const_iterator ihit = (*i).second.hits().begin(); + ihit != (*i).second.hits().end(); ihit++) { + simi[(**ihit).trackId()].push_back((*i).second.individualampl()[il]); + il++; + } - //sum the contribution of the same trackid - for( simlink_map::iterator simiiter=simi.begin(); - simiiter!=simi.end(); - simiiter++){ + //sum the contribution of the same trackid + for( simlink_map::iterator simiiter=simi.begin(); + simiiter!=simi.end(); + simiiter++){ - float sum_samechannel=0; - for (unsigned int iii=0;iii<(*simiiter).second.size();iii++){ - sum_samechannel+=(*simiiter).second[iii]; - } - float fraction=sum_samechannel/(*i).second; - if(fraction>1.) fraction=1.; - simlinks.emplace_back((*i).first, (*simiiter).first, (*i).second.eventId(), fraction); + float sum_samechannel=0; + for (unsigned int iii=0;iii<(*simiiter).second.size();iii++){ + sum_samechannel+=(*simiiter).second[iii]; } - } + float fraction=sum_samechannel/(*i).second; + if(fraction>1.) fraction=1.; + link_coll.push_back(PixelDigiSimLink((*i).first,(*simiiter).first,((*i).second.hits().front())->eventId(),fraction)); + } + } } + } } /***********************************************************************/ // Add electronic noise to pixel charge -void SiPixelDigitizerAlgorithm::add_noise(const PixelGeomDetUnit* pixdet, - float thePixelThreshold) { +void SiPixelDigitizerAlgorithm::add_noise() { #ifdef TP_DEBUG LogDebug ("Pixel Digitizer") << " enter add_noise " << theNoiseInElectrons; #endif - uint32_t detID= pixdet->geographicalId().rawId(); - signal_map_type& theSignal = _signal[detID]; - - // First add noise to hit pixels - float theSmearedChargeRMS = 0.0; - for ( signal_map_iterator i = theSignal.begin(); i != theSignal.end(); i++) { + for ( signal_map_iterator i = _signal.begin(); i != _signal.end(); i++) { if(addChargeVCALSmearing) { @@ -1192,10 +1185,10 @@ void SiPixelDigitizerAlgorithm::add_noise(const PixelGeomDetUnit* pixdet, // Noise from full readout: float noise = gaussDistribution_->fire() ; - if(((*i).second + Amplitude(noise+noise_ChargeVCALSmearing, -1.)) < 0. ) { + if(((*i).second + Amplitude(noise+noise_ChargeVCALSmearing,0,-1.)) < 0. ) { (*i).second.set(0);} else{ - (*i).second +=Amplitude(noise+noise_ChargeVCALSmearing, -1.); + (*i).second +=Amplitude(noise+noise_ChargeVCALSmearing,0,-1.); } } // End if addChargeVCalSmearing @@ -1205,10 +1198,10 @@ void SiPixelDigitizerAlgorithm::add_noise(const PixelGeomDetUnit* pixdet, // Use here the FULL readout noise, including TBM,ALT,AOH,OPT-REC. float noise = gaussDistribution_->fire() ; - if(((*i).second + Amplitude(noise, -1.)) < 0. ) { + if(((*i).second + Amplitude(noise,0,-1.)) < 0. ) { (*i).second.set(0);} else{ - (*i).second +=Amplitude(noise, -1.); + (*i).second +=Amplitude(noise,0,-1.); } } // end if only Noise from full readout @@ -1217,15 +1210,11 @@ void SiPixelDigitizerAlgorithm::add_noise(const PixelGeomDetUnit* pixdet, if(!addNoisyPixels) // Option to skip noise in non-hit pixels return; - const PixelTopology* topol=&pixdet->specificTopology(); - int numColumns = topol->ncolumns(); // det module number of cols&rows - int numRows = topol->nrows(); - // Add noise on non-hit pixels // Use here the pixel noise int numberOfPixels = (numRows * numColumns); - std::map > otherPixels; - std::map >::iterator mapI; + map > otherPixels; + map >::iterator mapI; theNoiser->generate(numberOfPixels, thePixelThreshold, //thr. in un. of nois @@ -1259,28 +1248,21 @@ void SiPixelDigitizerAlgorithm::add_noise(const PixelGeomDetUnit* pixdet, << " " << ix << " " << iy << " " << chan ; #endif - if(theSignal[chan] == 0){ + if(_signal[chan] == 0){ // float noise = float( (*mapI).second ); int noise=int( (*mapI).second ); - theSignal[chan] = Amplitude (noise, -1.); + _signal[chan] = Amplitude (noise, 0,-1.); } } + } /***********************************************************************/ // Simulate the readout inefficiencies. // Delete a selected number of single pixels, dcols and rocs. -void SiPixelDigitizerAlgorithm::pixel_inefficiency(const PixelEfficiencies& eff, - const PixelGeomDetUnit* pixdet) { +void SiPixelDigitizerAlgorithm::pixel_inefficiency() { - uint32_t detID= pixdet->geographicalId().rawId(); - - signal_map_type& theSignal = _signal[detID]; - - const PixelTopology* topol=&pixdet->specificTopology(); - int numColumns = topol->ncolumns(); // det module number of cols&rows - int numRows = topol->nrows(); // Predefined efficiencies float pixelEfficiency = 1.0; @@ -1291,30 +1273,27 @@ void SiPixelDigitizerAlgorithm::pixel_inefficiency(const PixelEfficiencies& eff, unsigned int Subid=DetId(detID).subdetId(); if (Subid== PixelSubdetector::PixelBarrel){// barrel layers int layerIndex=PXBDetId(detID).layer(); - pixelEfficiency = eff.thePixelEfficiency[layerIndex-1]; - columnEfficiency = eff.thePixelColEfficiency[layerIndex-1]; - chipEfficiency = eff.thePixelChipEfficiency[layerIndex-1]; - - // This should never happen, but only check if it is not an upgrade geometry - if (NumberOfBarrelLayers==3){ - if(numColumns>416) LogWarning ("Pixel Geometry") <<" wrong columns in barrel "<160) LogWarning ("Pixel Geometry") <<" wrong rows in barrel "<416) LogWarning ("Pixel Geometry") <<" wrong columns in barrel "<160) LogWarning ("Pixel Geometry") <<" wrong rows in barrel "<260 || numRows>160) { - if(numColumns>260) LogWarning ("Pixel Geometry") <<" wrong columns in endcaps "<160) LogWarning ("Pixel Geometry") <<" wrong rows in endcaps "<260 || numRows>160) { + if(numColumns>260) LogWarning ("Pixel Geometry") <<" wrong columns in endcaps "<160) LogWarning ("Pixel Geometry") <<" wrong rows in endcaps "< pIndexConverter(new PixelIndices(numColumns,numRows)); - int chipIndex = 0; int rowROC = 0; int colROC = 0; - std::map >chips, columns; - std::map >::iterator iter; + map >chips, columns; + map >::iterator iter; // Find out the number of columns and rocs hits // Loop over hit pixels, amplitude in electrons, channel = coded row,col - for (signal_map_const_iterator i = theSignal.begin(); i != theSignal.end(); ++i) { + for (signal_map_iterator i = _signal.begin();i != _signal.end();i++) { int chan = i->first; - std::pair ip = PixelDigi::channelToPixel(chan); + pair ip = PixelDigi::channelToPixel(chan); int row = ip.first; // X in row int col = ip.second; // Y is in col //transform to ROC index coordinates @@ -1367,10 +1344,10 @@ void SiPixelDigitizerAlgorithm::pixel_inefficiency(const PixelEfficiencies& eff, // Now loop again over pixels to kill some of them. // Loop over hit pixels, amplitude in electrons, channel = coded row,col - for(signal_map_iterator i = theSignal.begin();i != theSignal.end(); ++i) { + for(signal_map_iterator i = _signal.begin();i != _signal.end(); i++) { // int chan = i->first; - std::pair ip = PixelDigi::channelToPixel(i->first);//get pixel pos + pair ip = PixelDigi::channelToPixel(i->first);//get pixel pos int row = ip.first; // X in row int col = ip.second; // Y is in col //transform to ROC index coordinates @@ -1401,8 +1378,9 @@ void SiPixelDigitizerAlgorithm::pixel_inefficiency(const PixelEfficiencies& eff, //float offset = RandGaussQ::shoot(0.,theOffsetSmearing); //float newAmp = amp * gain + offset; // More complex misscalibration -float SiPixelDigitizerAlgorithm::missCalibrate(uint32_t detID, int col,int row, +float SiPixelDigitizerAlgorithm::missCalibrate(int col,int row, const float signalInElectrons) const { + // Central values //const float p0=0.00352, p1=0.868, p2=112., p3=113.; // pix(0,0,0) // const float p0=0.00382, p1=0.886, p2=112.7, p3=113.0; // average roc=0 @@ -1446,13 +1424,12 @@ float SiPixelDigitizerAlgorithm::missCalibrate(uint32_t detID, int col,int row, // Use the pixel-by-pixel calibrations //transform to ROC index coordinates //int chipIndex=0, colROC=0, rowROC=0; - //std::auto_ptr pIndexConverter(new PixelIndices(numColumns,numRows)); //pIndexConverter->transformToROC(col,row,chipIndex,colROC,rowROC); // Use calibration from a file //int chanROC = PixelIndices::pixelToChannelROC(rowROC,colROC); // use ROC coordinates //float pp0=0, pp1=0,pp2=0,pp3=0; - //map >::const_iterator it=calmap.find(chanROC); + //map >::const_iterator it=calmap.find(chanROC); //CalParameters y = (*it).second; //pp0 = y.p0; //pp1 = y.p1; @@ -1471,7 +1448,7 @@ float SiPixelDigitizerAlgorithm::missCalibrate(uint32_t detID, int col,int row, //cout<<" misscalibrate "<surface().position(),pixdet->surface().rotation()); - LocalVector Bfield=detFrame.toLocal(bfield); +//LocalVector SiPixelDigitizerAlgorithm::DriftDirection(float LoAng){ +LocalVector SiPixelDigitizerAlgorithm::DriftDirection(){ + Frame detFrame(_detp->surface().position(),_detp->surface().rotation()); + LocalVector Bfield=detFrame.toLocal(_bfield); float alpha2_FPix; float alpha2_BPix; @@ -1504,8 +1480,6 @@ LocalVector SiPixelDigitizerAlgorithm::DriftDirection(const PixelGeomDetUnit* pi float dir_z = 0.0; float scale = 0.0; - uint32_t detID= pixdet->geographicalId().rawId(); - unsigned int Sub_detid=DetId(detID).subdetId(); // Read Lorentz angle from cfg file:************************************************************** @@ -1532,13 +1506,12 @@ LocalVector SiPixelDigitizerAlgorithm::DriftDirection(const PixelGeomDetUnit* pi dir_z = -(1 + alpha2_FPix* Bfield.z()*Bfield.z() ); scale = (1 + alpha2_FPix* Bfield.z()*Bfield.z() ); } - } // end: Read LA from cfg file. + } // end: Read LA from cfg file. //Read Lorentz angle from DB:******************************************************************** if(use_LorentzAngle_DB_){ - float lorentzAngle = SiPixelLorentzAngle_->getLorentzAngle(detId); alpha2 = lorentzAngle * lorentzAngle; - //std::cout << "detID is: "<< it->first <<"The LA per tesla is: "<< it->second << std::std::endl; + //std::cout << "detID is: "<< it->first <<"The LA per tesla is: "<< it->second << std::endl; dir_x = -( lorentzAngle * Bfield.y() + alpha2 * Bfield.z()* Bfield.x() ); dir_y = +( lorentzAngle * Bfield.x() - alpha2 * Bfield.z()* Bfield.y() ); dir_z = -(1 + alpha2 * Bfield.z()*Bfield.z() ); @@ -1557,22 +1530,21 @@ LocalVector SiPixelDigitizerAlgorithm::DriftDirection(const PixelGeomDetUnit* pi //**************************************************************************************************** -void SiPixelDigitizerAlgorithm::pixel_inefficiency_db(uint32_t detID) { +void SiPixelDigitizerAlgorithm::pixel_inefficiency_db(void){ if(!use_ineff_from_db_) return; - signal_map_type& theSignal = _signal[detID]; - // Loop over hit pixels, amplitude in electrons, channel = coded row,col - for(signal_map_iterator i = theSignal.begin();i != theSignal.end(); ++i) { + for(signal_map_iterator i = _signal.begin();i != _signal.end(); i++) { // int chan = i->first; - std::pair ip = PixelDigi::channelToPixel(i->first);//get pixel pos + pair ip = PixelDigi::channelToPixel(i->first);//get pixel pos int row = ip.first; // X in row int col = ip.second; // Y is in col + uint32_t detid = detID; //transform to ROC index coordinates - if(theSiPixelGainCalibrationService_->isDead(detID, col, row)){ - // std::cout << "now in isdead check, row " << detID << " " << col << "," << row << std::std::endl; + if(theSiPixelGainCalibrationService_->isDead(detid, col, row)){ + // std::cout << "now in isdead check, row " << detid << " " << col << "," << row << std::endl; // make pixel amplitude =0, pixel will be lost at clusterization i->second.set(0.); // reset amplitude, } // end if @@ -1582,18 +1554,39 @@ void SiPixelDigitizerAlgorithm::pixel_inefficiency_db(uint32_t detID) { //**************************************************************************************************** -void SiPixelDigitizerAlgorithm::module_killing_conf(uint32_t detID) { +void SiPixelDigitizerAlgorithm::module_killing_conf(void){ if(!use_module_killing_) return; - bool isbad=false; + int detid = detID; + + ////////split fpix and bpix + DetId detId = DetId(detid); // Get the Detid object + //unsigned int detType=detId.det(); // det type, pixel=1 + unsigned int subid=detId.subdetId(); //subdetector type, barrel=1, forward=2 + //////fpix + PXFDetId pdetIdf = PXFDetId(detid); + unsigned int disk=pdetIdf.disk(); //1,2,3 + unsigned int blade=pdetIdf.blade(); //1-24 + int zindexF=pdetIdf.module(); // + unsigned int side=pdetIdf.side(); //size=1 for -z, 2 for +z + unsigned int panel=pdetIdf.panel(); //panel=1 + //////bpix + PXBDetId pdetId = PXBDetId(detid); // + //unsigned int detTypeP=pdetId.det(); // pix det identification + //unsigned int subidP=pdetId.subdetId(); // sub det id + // Barell layer = 1,2,3 + int layerC=pdetId.layer(); + // Barrel ladder id 1-20,32,44. + int ladderC=pdetId.ladder(); + // Barrel Z-index=1,8 + int zindex=pdetId.module(); - Parameters::const_iterator itDeadModules=DeadModules.begin(); + Parameters::iterator itDeadModules=DeadModules.begin(); - int detid = detID; for(; itDeadModules != DeadModules.end(); ++itDeadModules){ int Dead_detID = itDeadModules->getParameter("Dead_detID"); - if(detid == Dead_detID){ + if(detid==Dead_detID){ isbad=true; break; } @@ -1601,36 +1594,326 @@ void SiPixelDigitizerAlgorithm::module_killing_conf(uint32_t detID) { if(!isbad) return; - - signal_map_type& theSignal = _signal[detID]; + std::vector badrocpositions (0); + + //cout<<"Hit in: "<< detid <<" "<<((detid & 0x3F)>>2)<getParameter("Module"); + int Dead_RocID = itDeadModules->getParameter("Dead_RocID"); + int Dead_RocID2, quartLdr; + if (layerC==1){quartLdr=5;} + if (layerC==2){quartLdr=8;} + if (layerC==3){quartLdr=11;} if(Module=="whole"){ - for(signal_map_iterator i = theSignal.begin();i != theSignal.end(); ++i) { + for(signal_map_iterator i = _signal.begin();i != _signal.end(); i++) { i->second.set(0.); // reset amplitude } } - for(signal_map_iterator i = theSignal.begin();i != theSignal.end(); ++i) { - std::pair ip = PixelDigi::channelToPixel(i->first);//get pixel pos - - if(Module=="tbmA" && ip.first>=80 && ip.first<=159){ - i->second.set(0.); - } + for(signal_map_iterator i = _signal.begin();i != _signal.end(); i++) { + pair ip = PixelDigi::channelToPixel(i->first);//get pixel pos + int drId; + if (subid==1){ //Barrel Mask //Used as mentioned in http://cmslxr.fnal.gov/lxr/source/DataFormats/DetId/interface/DetId.h + if(zindex <= 4){ //cout << " -Z ===="<second.set(0.);} + else { + for(drId =0; drId < 8; drId++){ + if(Dead_RocID==drId && ip.second <= (416-52*drId) && ip.second > (416-52*(drId+1))){ + //cout <second.set(0.);//cout<second.set(0.);} + else { + for(drId =0; drId < 8; drId++){ + if(Dead_RocID==drId && ip.second <= (416-52*drId) && ip.second > (416-52*(drId+1))){ + i->second.set(0.); + } + } + } + }//end < 80 + else if((Module=="tbmB"||Module=="none") && ip.first >= 80){ + if (Dead_RocID==-1) {i->second.set(0.);} + else {Dead_RocID2=Dead_RocID%8; + for(drId =0; drId < 8; drId++){ + if(Dead_RocID2==drId && ip.second >= 52*drId && ip.second < 52*(drId+1)){ + i->second.set(0.); + } + } + } + }//end rows>=80 Z<0 + }//end full module Z<0 + }// end -Z + if(zindex > 4){ //cout << " +Z ===="<second.set(0.);} + else { + for(drId =0; drId < 8; drId++){ + if(Dead_RocID==drId && ip.second >= 52*drId && ip.second < 52*(drId+1)){ + i->second.set(0.); + } + } + } + } + }//end half modules Z>0 + else {// full modules + if((Module=="tbmB"||Module=="none") && ip.first < 80){ + if (Dead_RocID==-1) {i->second.set(0.);} + else { Dead_RocID2=Dead_RocID%8; + for(drId =0; drId < 8; drId++){ + if(Dead_RocID2==drId && ip.second <= (416-52*drId) && ip.second > (416-52*(drId+1))){ + i->second.set(0.); + } + } + } + }//end rows<80 Z>0 + else if((Module=="tbmA"||Module=="none") && ip.first >= 80){ + if (Dead_RocID==-1) {i->second.set(0.);} + else { + for(drId =0; drId < 8; drId++){ + if(Dead_RocID==drId && ip.second >= 52*drId && ip.second < 52*(drId+1)){ + i->second.set(0.); + } + } + } + }//end rows>=80 Z>0 + }//end full modules Z>0 + }//end +Z + }//barrel mask ends - if( Module=="tbmB" && ip.first<=79){ - i->second.set(0.); - } - } + + else if (subid==2){ //Endcap Mask + if(side==1 && (disk==1 || disk==2)) {//-zD1 -zD2 + if(panel==1){//Panel 1 with 4 plaquettes + if (blade==1 || blade==6 || blade==13 || blade==18){//Left Panels + for (int modRocs=2; modRocs <6; modRocs++){//modRocs=1X(2,3,4,5) + if(zindexF != modRocs-1) continue; + if((Module=="none") && ip.first < 80){ + if (Dead_RocID==-1) {i->second.set(0.);} + else{Dead_RocID2=Dead_RocID%modRocs; + for(drId =0; drId < modRocs; drId++){ + if(Dead_RocID2==drId && ip.second <= 52*(modRocs-drId) && ip.second > 52*(modRocs-(drId+1))){ + i->second.set(0.); + } + } + } + }// <80 + else if((Module=="none") && ip.first >= 80 && (modRocs==3 || modRocs==4)){//modRocs=2X(3,4) + if (Dead_RocID==-1) {i->second.set(0.);} + else{ + for(drId =0; drId < modRocs; drId++){ + if(Dead_RocID==drId && ip.second >= 52*drId && ip.second < 52*(drId+1)){ + i->second.set(0.); + } + } + } + } // >=80 + }//loop on mods + }// PL4 ends + else{//Right panels + for (int modRocs=2; modRocs <6; modRocs++){//modRocs=1X(2,3,4,5) + if(zindexF != modRocs-1) continue; + if((Module=="none") && ip.first < 80){ + if (Dead_RocID==-1) {i->second.set(0.);} + else{Dead_RocID2=Dead_RocID%modRocs; + for(drId =0; drId < modRocs; drId++){ + if(Dead_RocID2==drId && ip.second <= 52*(modRocs-drId) && ip.second > 52*(modRocs-(drId+1))){ + i->second.set(0.); + } + } + } + }// <80 + else if((Module=="none") && ip.first >= 80 && (modRocs==3 || modRocs==4)){//modRocs=2X(3,4) + if (Dead_RocID==-1) {i->second.set(0.);} + else{ + for(drId =0; drId < modRocs; drId++){ + if(Dead_RocID==drId && ip.second >= 52*drId && ip.second < 52*(drId+1)){ + i->second.set(0.); + } + } + } + } // >=80 + }//loop on mods + }// PR4 ends + }// panel 1 ends + if(panel==2){//Panel 2 with 3 plaquettes + if (blade==1 || blade==7 || blade==12 || blade==13 || blade==19 || blade==24){//Left Panels + for (int modRocs=3; modRocs <6; modRocs++){//modRocs=2X(3,4,5) + if(zindexF != modRocs-2) continue; + if((Module=="none") && ip.first < 80){ + if (Dead_RocID==-1) {i->second.set(0.);} + else{Dead_RocID2=Dead_RocID%modRocs; + for(drId =0; drId < modRocs; drId++){ + if(Dead_RocID2==drId && ip.second <= 52*(modRocs-drId) && ip.second > 52*(modRocs-(drId+1))){ + i->second.set(0.); + } + } + } + }// <80 + else if((Module=="none") && ip.first >= 80){ + if (Dead_RocID==-1) {i->second.set(0.);} + else{ + for(drId =0; drId < modRocs; drId++){ + if(Dead_RocID==drId && ip.second >= 52*drId && ip.second < 52*(drId+1)){ + i->second.set(0.); + } + } + } + } // >=80 + }//loop on mods + }// PL3 ends + else{//Right panels + for (int modRocs=3; modRocs <6; modRocs++){//modRocs=2X(3,4,5) + if(zindexF != modRocs-2) continue; + if((Module=="none") && ip.first < 80){ + if (Dead_RocID==-1) {i->second.set(0.);} + else{ + for(drId =0; drId < modRocs; drId++){ + if(Dead_RocID==drId && ip.second <= 52*(modRocs-drId) && ip.second > 52*(modRocs-(drId+1))){ + i->second.set(0.); + } + } + } // <80 + } + else if((Module=="none") && ip.first >= 80){ + if (Dead_RocID==-1) {i->second.set(0.);} + else{Dead_RocID2=Dead_RocID%modRocs; + for(drId =0; drId < modRocs; drId++){ + if(Dead_RocID2==drId && ip.second >= 52*drId && ip.second < 52*(drId+1)){ + i->second.set(0.); + } + } + } + } // >=80 + }//loop on mods + }// PR3 ends + }// panel 2 ends + }//Side (1,1) and (1,2) ends + else if(side==2 && (disk==1 || disk==2)) {//+zD1 +zD2 + if(panel==1){//Panel 1 with 4 plaquettes + if (blade==1 || blade==6 || blade==13 || blade==18){//Right Panels + for (int modRocs=2; modRocs <6; modRocs++){//modRocs=1X(2,3,4,5) + if(zindexF != modRocs-1) continue; + if((Module=="none") && ip.first < 80){ + if (Dead_RocID==-1) {i->second.set(0.);} + else{Dead_RocID2=Dead_RocID%modRocs; + for(drId =0; drId < modRocs; drId++){ + if(Dead_RocID2==drId && ip.second <= 52*(modRocs-drId) && ip.second > 52*(modRocs-(drId+1))){ + i->second.set(0.); + } + } + } + }// <80 + else if((Module=="none") && ip.first >= 80 && (modRocs==3 || modRocs==4)){//modRocs=2X(3,4) + if (Dead_RocID==-1) {i->second.set(0.);} + else{ + for(drId =0; drId < modRocs; drId++){ + if(Dead_RocID==drId && ip.second >= 52*drId && ip.second < 52*(drId+1)){ + i->second.set(0.); + } + } + } + } // >=80 + }//loop on mods + }// PR4 ends + else{//Left panels + for (int modRocs=2; modRocs <6; modRocs++){//modRocs=1X(2,3,4,5) + if(zindexF != modRocs-1) continue; + if((Module=="none") && ip.first < 80){ + if (Dead_RocID==-1) {i->second.set(0.);} + else{Dead_RocID2=Dead_RocID%modRocs; + for(drId =0; drId < modRocs; drId++){ + if(Dead_RocID2==drId && ip.second <= 52*(modRocs-drId) && ip.second > 52*(modRocs-(drId+1))){ + i->second.set(0.); + } + } + } // <80 + } + else if((Module=="none") && ip.first >= 80 && (modRocs==3 || modRocs==4)){//modRocs=2X(3,4) + if (Dead_RocID==-1) {i->second.set(0.);} + else{ + for(drId =0; drId < modRocs; drId++){ + if(Dead_RocID==drId && ip.second >= 52*drId && ip.second < 52*(drId+1)){ + i->second.set(0.); + } + } + } + } // >=80 + }//loop on mods + }// PL4 ends + }// panel 1 ends + if(panel==2){//Panel 2 with 3 plaquettes + if (blade==1 || blade==7 || blade==12 || blade==13 || blade==19 || blade==24){//Right Panels + for (int modRocs=3; modRocs <6; modRocs++){//modRocs=2X(3,4,5) + if(zindexF != modRocs-2) continue; + if((Module=="none") && ip.first < 80){ + if (Dead_RocID==-1) {i->second.set(0.);} + else{Dead_RocID2=Dead_RocID%modRocs; + for(drId =0; drId < modRocs; drId++){ + if(Dead_RocID2==drId && ip.second <= 52*(modRocs-drId) && ip.second > 52*(modRocs-(drId+1))){ + i->second.set(0.); + } + } + } + }// <80 + else if((Module=="none") && ip.first >= 80){ + if (Dead_RocID==-1) {i->second.set(0.);} + else{ + for(drId =0; drId < modRocs; drId++){ + if(Dead_RocID==drId && ip.second >= 52*drId && ip.second < 52*(drId+1)){ + i->second.set(0.); + } + } + } + } // >=80 + }//loop on mods + }// PR3 ends + else{//Left panels + for (int modRocs=3; modRocs <6; modRocs++){//modRocs=2X(3,4,5) + if(zindexF != modRocs-2) continue; + if((Module=="none") && ip.first < 80){ + if (Dead_RocID==-1) {i->second.set(0.);} + else{ + for(drId =0; drId < modRocs; drId++){ + if(Dead_RocID==drId && ip.second >= 52*drId && ip.second < 52*(drId+1)){ + i->second.set(0.); + } + } + } // <80 + } + else if((Module=="none") && ip.first >= 80){ + if (Dead_RocID==-1) {i->second.set(0.);} + else{Dead_RocID2=Dead_RocID%modRocs; + for(drId =0; drId < modRocs; drId++){ + if(Dead_RocID2==drId && ip.second <= 52*(modRocs-drId) && ip.second > 52*(modRocs-(drId+1))){ + i->second.set(0.); + } + } + } + } // >=80 + }//loop on mods + }// PL3 ends + }// panel 2 ends + } + }//endcap mask ends + }//end signal_map_iterator } //**************************************************************************************************** -void SiPixelDigitizerAlgorithm::module_killing_DB(uint32_t detID) { -// Not SLHC safe for now +void SiPixelDigitizerAlgorithm::module_killing_DB(void){ if(!use_module_killing_) return; bool isbad=false; + uint32_t detid = detID; std::vectordisabledModules = SiPixelBadModule_->getBadComponentList(); @@ -1638,7 +1921,7 @@ void SiPixelDigitizerAlgorithm::module_killing_DB(uint32_t detID) { for (size_t id=0;id>2)<second.set(0.); // reset amplitude } } else { // all other module types: half-modules and single ROCs. - // Get Bad ROC position: + //cout<<"Hit in: "<< detid <<" errorType "<< badmodule.errorType<<" BadRocs="<getBadRocs(detid) + // <<" "<>2)< badrocpositions (0); for(unsigned int j = 0; j < 16; j++){ - if(SiPixelBadModule_->IsRocBad(detID, j) == true){ - - std::vector path = map_.product()->pathToDetUnit(detID); + if(SiPixelBadModule_->IsRocBad(detid, j) == true){ + //cout << "ROC # = " << j< path = map_.product()->pathToDetUnit(detid); typedef std::vector::const_iterator IT; for (IT it = path.begin(); it != path.end(); ++it) { const PixelROC* myroc = map_.product()->findItem(*it); @@ -1679,22 +1963,24 @@ void SiPixelDigitizerAlgorithm::module_killing_DB(uint32_t detID) { }// end of getBadRocPositions - for(signal_map_iterator i = theSignal.begin();i != theSignal.end(); ++i) { - std::pair ip = PixelDigi::channelToPixel(i->first);//get pixel pos + for(signal_map_iterator i = _signal.begin();i != _signal.end(); i++) { + pair ip = PixelDigi::channelToPixel(i->first);//get pixel pos for(std::vector::const_iterator it = badrocpositions.begin(); it != badrocpositions.end(); ++it){ if(it->row >= 80 && ip.first >= 80 ){ + //cout << "row >= 80 detid "<< detid <<" col= "<col) < 26) ) {i->second.set(0.);} else if(it->row==120 && ip.second-it->col==26){i->second.set(0.);} else if(it->row==119 && it->col-ip.second==26){i->second.set(0.);} - } + } //end of rows >= 80 else if(it->row < 80 && ip.first < 80 ){ + //cout << "row < 80 detid "<< detid <<" col= "<col) < 26) ){i->second.set(0.);} else if(it->row==40 && ip.second-it->col==26){i->second.set(0.);} else if(it->row==39 && it->col-ip.second==26){i->second.set(0.);} - } - } - } + } //end of rows <80 + } //end of loop on badrocpositions + } // end of signal_map_iterator loop } } diff --git a/trunk/SimTracker/SiPixelDigitizer/test/testPixelDigitizer.py b/trunk/SimTracker/SiPixelDigitizer/test/testPixelDigitizer.py index e5837c93470de..c86161e48a872 100644 --- a/trunk/SimTracker/SiPixelDigitizer/test/testPixelDigitizer.py +++ b/trunk/SimTracker/SiPixelDigitizer/test/testPixelDigitizer.py @@ -45,23 +45,23 @@ input = cms.untracked.int32(-1) ) -process.MessageLogger = cms.Service("MessageLogger", - debugModules = cms.untracked.vstring('SiPixelDigitizer'), - destinations = cms.untracked.vstring('cout'), -# destinations = cms.untracked.vstring("log","cout"), - cout = cms.untracked.PSet( -# threshold = cms.untracked.string('INFO') -# threshold = cms.untracked.string('ERROR') - threshold = cms.untracked.string('WARNING') - ) -# log = cms.untracked.PSet( -# threshold = cms.untracked.string('DEBUG') -# ) -) -# get the files from DBS: -#process.source = cms.Source("PoolSource", -# fileNames = cms.untracked.vstring('/store/relval/CMSSW_3_1_0_pre9/RelValSingleMuPt10/GEN-SIM-RECO/IDEAL_31X_v1/0007/B41EF45B-D14E-DE11-BC68-001D09F24600.root','/store/relval/CMSSW_3_1_0_pre9/RelValSingleMuPt10/GEN-SIM-RECO/IDEAL_31X_v1/0007/682FF80C-524F-DE11-9159-001D09F2543D.root','/store/relval/CMSSW_3_1_0_pre9/RelValSingleMuPt10/GEN-SIM-RECO/IDEAL_31X_v1/0007/0E9B84FD-D24E-DE11-94D9-001617C3B70E.root') -#) +##process.MessageLogger = cms.Service("MessageLogger", +## debugModules = cms.untracked.vstring('SiPixelDigitizer'), +## destinations = cms.untracked.vstring('cout'), +### destinations = cms.untracked.vstring("log","cout"), +## cout = cms.untracked.PSet( +### threshold = cms.untracked.string('INFO') +### threshold = cms.untracked.string('ERROR') +## threshold = cms.untracked.string('WARNING') +## ) +### log = cms.untracked.PSet( +### threshold = cms.untracked.string('DEBUG') +### ) +##) +### get the files from DBS: +###process.source = cms.Source("PoolSource", +### fileNames = cms.untracked.vstring('/store/relval/CMSSW_3_1_0_pre9/RelValSingleMuPt10/GEN-SIM-RECO/IDEAL_31X_v1/0007/B41EF45B-D14E-DE11-BC68-001D09F24600.root','/store/relval/CMSSW_3_1_0_pre9/RelValSingleMuPt10/GEN-SIM-RECO/IDEAL_31X_v1/0007/682FF80C-524F-DE11-9159-001D09F2543D.root','/store/relval/CMSSW_3_1_0_pre9/RelValSingleMuPt10/GEN-SIM-RECO/IDEAL_31X_v1/0007/0E9B84FD-D24E-DE11-94D9-001617C3B70E.root') +###) readFiles = cms.untracked.vstring() secFiles = cms.untracked.vstring() @@ -70,63 +70,62 @@ readFiles.extend( [ ###Muons ls -ltr /scratch/jbutt/MuPt100/* | awk '{print ",\x27 file:" $9 "\x27 "}' -# 'file:/scratch/jbutt/MuPt100/9889CC05-8261-E011-94F7-001A92811738.root ' -#,'file:/scratch/jbutt/MuPt100/00AEB646-AD60-E011-A906-00261894394D.root ' +# 'file:/scratch/jbutt/MuPt100/3C1F82E7-6605-E111-B612-002354EF3BE2.root' +# ,'file:/scratch/jbutt/MuPt100/82C9F14B-B402-E111-87ED-002618943821.root' ###QCD ls -ltr /scratch/jbutt/QCD80120/* | awk '{print ",\x27 file:" $9 "\x27 "}' -# ' file:/scratch/jbutt/QCD80120/F8DCFBB7-4261-E011-B677-0026189438A9.root' -# ,' file:/scratch/jbutt/QCD80120/0A209954-B460-E011-AD7D-002618943870.root' -# ,' file:/scratch/jbutt/QCD80120/CC353A09-9B60-E011-B000-0026189438AA.root' -# ,' file:/scratch/jbutt/QCD80120/7CF0CF1A-9D60-E011-9BEF-002618943884.root' -# ,' file:/scratch/jbutt/QCD80120/70890C93-A160-E011-BFF6-003048678B5E.root' -###TTbar ls -ltr /scratch/jbutt/TTbar/* | awk '{print ",\x27 file:" $9 "\x27 "}' - ' file:/scratch/jbutt/TTbar/52278ED2-4161-E011-9FDE-002618943934.root' -,' file:/scratch/jbutt/TTbar/D863DB68-BA60-E011-9121-0018F3D09702.root' -,' file:/scratch/jbutt/TTbar/984417B1-A960-E011-98A2-001A92811736.root' -,' file:/scratch/jbutt/TTbar/DEA836EC-9060-E011-A388-003048678D52.root' -#,' file:/scratch/jbutt/TTbar/8294BF95-9260-E011-B485-002354EF3BD2.root' -#,' file:/scratch/jbutt/TTbar/169EAF9F-8C60-E011-82B6-00248C0BE005.root' + ' file:/scratch/jbutt/QCD80120/16B15CEC-6605-E111-91B4-002618FDA204.root' + ,' file:/scratch/jbutt/QCD80120/423FA9C8-E606-E111-937B-002354EF3BE1.root' + ,' file:/scratch/jbutt/QCD80120/C2ACFE6C-2603-E111-B58F-001A9281173E.root' + ,' file:/scratch/jbutt/QCD80120/8C340B79-8002-E111-89EE-002354EF3BE0.root' + ,' file:/scratch/jbutt/QCD80120/7441D424-1702-E111-A600-0018F3D09696.root' + ,' file:/scratch/jbutt/QCD80120/B08F23A4-6901-E111-AA0C-002618943898.root' +####TTbar ls -ltr /scratch/jbutt/TTbar/* | awk '{print ",\x27 file:" $9 "\x27 "}' +# ' file:/scratch/jbutt/TTbar/1676ABF5-9004-E111-9B9B-002618FDA208.root' +#,' file:/scratch/jbutt/TTbar/5C73216C-2603-E111-AB90-002618FDA279.root' +#,' file:/scratch/jbutt/TTbar/F44EC1F2-6605-E111-85FF-003048678FDE.root' +#,' file:/scratch/jbutt/TTbar/C24DF25A-B302-E111-8AC4-001A92971BCA.root' +#,' file:/scratch/jbutt/TTbar/16DA979B-1A02-E111-9C54-0018F3D095F2.root' +#,' file:/scratch/jbutt/TTbar/34C0859D-1702-E111-835F-00304867BEDE.root' +#,' file:/scratch/jbutt/TTbar/2E90C1B8-6501-E111-8C4F-001A92971B08.root' +#,' file:/scratch/jbutt/TTbar/B4E41354-6601-E111-8D1B-00304867BED8.root' ] ); secFiles.extend( [ ####Muons -# 'file:/scratch/jbutt/MuPt100/CA754A24-6361-E011-9CC8-00304867923E.root ' -#,'file:/scratch/jbutt/MuPt100/D6CFE91F-A460-E011-A535-0018F3D096BC.root ' -#,'file:/scratch/jbutt/MuPt100/666B6830-A360-E011-9A15-0018F3D0961A.root ' +# 'file:/scratch/jbutt/MuPt100/FE1E1645-B602-E111-9729-003048679168.root' +# ,'file:/scratch/jbutt/MuPt100/C6C414E9-6605-E111-854B-002618FDA21D.root' +# ,'file:/scratch/jbutt/MuPt100/B2649223-1702-E111-8399-001A9281174A.root' +# ,'file:/scratch/jbutt/MuPt100/3CFBFCFE-7E01-E111-B24B-0018F3D095FA.root' ###QCD -# ' file:/scratch/jbutt/QCD80120/90D1BF5E-8261-E011-90FF-001A92810AA4.root' -# ,' file:/scratch/jbutt/QCD80120/B66E35F6-B760-E011-8374-00304867924E.root' -# ,' file:/scratch/jbutt/QCD80120/EAD73409-9F60-E011-AF29-0026189438FD.root' -# ,' file:/scratch/jbutt/QCD80120/D820C5B6-A260-E011-A96A-002618FDA262.root' -# ,' file:/scratch/jbutt/QCD80120/D2BDC039-A160-E011-B201-003048678E24.root' -# ,' file:/scratch/jbutt/QCD80120/CC774519-9D60-E011-8618-002618943970.root' -# ,' file:/scratch/jbutt/QCD80120/AC090BAB-A660-E011-826E-001A9281172C.root' -# ,' file:/scratch/jbutt/QCD80120/8C1F0E90-9B60-E011-B8D7-001A92971B5E.root' -# ,' file:/scratch/jbutt/QCD80120/7E592C4A-B060-E011-8FE0-00261894391C.root' -# ,' file:/scratch/jbutt/QCD80120/749CCA7F-9960-E011-9D50-003048679166.root' -# ,' file:/scratch/jbutt/QCD80120/6A5B1394-A060-E011-AC40-00304867906C.root' -# ,' file:/scratch/jbutt/QCD80120/526CEC1F-9D60-E011-8286-001A92971B74.root' -# ,' file:/scratch/jbutt/QCD80120/4EA249A0-9C60-E011-B0E0-002618943945.root' -# ,' file:/scratch/jbutt/QCD80120/3252A9B3-9A60-E011-A3C7-00261894386C.root' -# ,' file:/scratch/jbutt/QCD80120/1CCA2929-9D60-E011-BD31-0026189438E4.root' + ' file:/scratch/jbutt/QCD80120/1228DEDC-2403-E111-914A-002618943896.root' + ,' file:/scratch/jbutt/QCD80120/182CF366-2603-E111-9F72-003048D42D92.root' + ,' file:/scratch/jbutt/QCD80120/72EE3DEF-6605-E111-8301-002618FDA248.root' + ,' file:/scratch/jbutt/QCD80120/DC1E3FC3-E606-E111-9C3E-00304867BEE4.root' + ,' file:/scratch/jbutt/QCD80120/EE35547C-8002-E111-A832-001A92810AAA.root' + ,' file:/scratch/jbutt/QCD80120/94B72EB2-1602-E111-8B8A-001A92810AE4.root' + ,' file:/scratch/jbutt/QCD80120/9C0615B6-1602-E111-B893-001A928116E0.root' + ,' file:/scratch/jbutt/QCD80120/E45BE72A-1902-E111-9BDE-00261894389E.root' + ,' file:/scratch/jbutt/QCD80120/4C14BA8B-6601-E111-8D01-001A92971BB8.root' + ,' file:/scratch/jbutt/QCD80120/625F1E38-6801-E111-A244-0030486792AC.root' + ,' file:/scratch/jbutt/QCD80120/849BD437-6801-E111-B8F1-002618943950.root' ###TTbar - ' file:/scratch/jbutt/TTbar/FCB768B7-4261-E011-B6A9-00261894396D.root' -,' file:/scratch/jbutt/TTbar/FED391BB-BB60-E011-B5E7-0018F3D09670.root' -,' file:/scratch/jbutt/TTbar/8E1219D2-B360-E011-AEC0-0018F3D0962E.root' -,' file:/scratch/jbutt/TTbar/8C5378DD-BE60-E011-BCEF-001A92810AE2.root' -,' file:/scratch/jbutt/TTbar/FA891A2E-A060-E011-B60E-00304867906C.root' -,' file:/scratch/jbutt/TTbar/CC2DC499-A160-E011-98B2-002618943862.root' -,' file:/scratch/jbutt/TTbar/BADE8A9F-9A60-E011-8DC6-001BFCDBD176.root' -,' file:/scratch/jbutt/TTbar/9885A433-9560-E011-862D-0026189438A5.root' -,' file:/scratch/jbutt/TTbar/8A62C3C1-9B60-E011-B4D3-001A92810AEE.root' -,' file:/scratch/jbutt/TTbar/8A00EDE3-B160-E011-A4BA-0018F3D0968C.root' -,' file:/scratch/jbutt/TTbar/762DC67E-9D60-E011-96D3-0026189438E8.root' -,' file:/scratch/jbutt/TTbar/6A5F5891-A060-E011-B3AC-003048679150.root' -,' file:/scratch/jbutt/TTbar/2E43CDFD-9960-E011-A5E1-00261894392C.root' -,' file:/scratch/jbutt/TTbar/2A3EAE9F-A760-E011-AC4A-003048678B06.root' -,' file:/scratch/jbutt/TTbar/2493B4C4-9660-E011-A92F-00304867BFAA.root' -,' file:/scratch/jbutt/TTbar/1A057A0C-9A60-E011-8A9B-002618943986.root' -,' file:/scratch/jbutt/TTbar/10656835-9B60-E011-8A77-0018F3D0964A.root' -,' file:/scratch/jbutt/TTbar/084C200A-9960-E011-83F6-00261894386E.root' +# ' file:/scratch/jbutt/TTbar/4C4CEEEC-9004-E111-81CB-0026189438E4.root' +#,' file:/scratch/jbutt/TTbar/6851646C-2603-E111-A121-001BFCDBD11E.root' +#,' file:/scratch/jbutt/TTbar/8A6EC4EE-6605-E111-BAEB-0026189438A0.root' +#,' file:/scratch/jbutt/TTbar/86C08ADC-9E02-E111-BF3E-002618943916.root' +#,' file:/scratch/jbutt/TTbar/306D3C24-1802-E111-BB8C-002618943935.root' +#,' file:/scratch/jbutt/TTbar/628DBD21-1A02-E111-A5AE-0018F3D096F8.root' +#,' file:/scratch/jbutt/TTbar/D44E792A-1802-E111-BC00-001A92971B74.root' +#,' file:/scratch/jbutt/TTbar/E05D2324-1802-E111-8B0A-00248C0BE014.root' +#,' file:/scratch/jbutt/TTbar/12938537-6401-E111-A1BB-0018F3D096EE.root' +#,' file:/scratch/jbutt/TTbar/2A2223CF-6401-E111-8DAA-001A928116FA.root' +#,' file:/scratch/jbutt/TTbar/568D9338-6201-E111-9748-001A92810AEA.root' +#,' file:/scratch/jbutt/TTbar/6C1A3035-6701-E111-A24A-002618943807.root' +#,' file:/scratch/jbutt/TTbar/6CF830DB-6E01-E111-8E98-001A92810AD2.root' +#,' file:/scratch/jbutt/TTbar/B2972B10-6401-E111-AE9C-0018F3D09634.root' +#,' file:/scratch/jbutt/TTbar/C0A60C2F-6501-E111-932F-001A92810ADE.root' +#,' file:/scratch/jbutt/TTbar/CC654D60-6401-E111-8A27-00261894385A.root' +#,' file:/scratch/jbutt/TTbar/D0FCC289-6B01-E111-8AEB-001BFCDBD15E.root' ] ) @@ -148,7 +147,7 @@ # Choose the global tag here: #process.GlobalTag.globaltag = 'MC_38Y_V8::All' -process.GlobalTag.globaltag = 'MC_42_V11::All' +process.GlobalTag.globaltag = 'MC_50_V0::All' process.load("CondCore.DBCommon.CondDBSetup_cfi") @@ -163,9 +162,9 @@ fileName = cms.untracked.string('file:dummy.root') ) -process.Timing = cms.Service("Timing") +#process.Timing = cms.Service("Timing") -process.SimpleMemoryCheck = cms.Service("SimpleMemoryCheck") +#process.SimpleMemoryCheck = cms.Service("SimpleMemoryCheck") # Simulation of hits in the Tracker: #process.simhits = cms.Sequence(process.g4SimHits*process.trackerHitsValidation) @@ -187,7 +186,7 @@ #process.p1 = cms.Path(process.mix*process.digis*process.siPixelRawData*process.siPixelDigis*process.pixeltrackerlocalreco) #This process to get events to be used to make DQM occupancy maps (cmsRun DQM_Pixel_digi.py after you ran testPixelDigitizer.py): -#process.p1 = cms.Path(process.mix*process.simSiPixelDigis*process.siPixelRawData*process.siPixelDigis) +process.p1 = cms.Path(process.mix*process.simSiPixelDigis*process.siPixelRawData*process.siPixelDigis) # Look at cluster charge: #process.p1 = cms.Path(process.mix*process.digis*process.siPixelRawData*process.siPixelDigis*process.pixeltrackerlocalreco) @@ -196,7 +195,7 @@ #process.p1 = cms.Path(process.mix*process.simSiPixelDigis*process.pixelDigisValid) #This process is to run the digitizer: -process.p1 = cms.Path(process.mix*process.simSiPixelDigis) +#process.p1 = cms.Path(process.mix*process.simSiPixelDigis) process.outpath = cms.EndPath(process.o1) process.g4SimHits.Generator.HepMCProductLabel = 'source'