From cfc9cbe5fc256fde47495b911847e43800f3e50c Mon Sep 17 00:00:00 2001 From: William Tanenbaum Date: Thu, 3 Jan 2013 23:56:03 +0000 Subject: [PATCH] Pass a TrackerTopology pointer, rather than a handle --- .../test/RecoAnalyzerRecHits.cc | 9 +- .../LaserDQM/plugins/LaserDQMStatistics.cc | 9 +- .../test/TrackInfoAnalyzer.cc | 6 +- .../src/SiPixelTrackResidualSource.cc | 7 +- .../SiStripBadComponentsDQMServiceReader.cc | 8 +- .../SiStripBadComponentsDQMServiceReader.h | 2 +- .../src/ClusterMTCCFilter.cc | 6 +- .../test/ModuleNumbering.cc | 5 +- .../test/TrackerTopologyAnalyzer.cc | 5 +- HLTrigger/special/src/HLTTrackerHaloFilter.cc | 6 +- .../RecoUtils/interface/CheckHitPattern.h | 2 +- PhysicsTools/RecoUtils/src/CheckHitPattern.cc | 8 +- .../ChargedHadronSpectra/interface/HitInfo.h | 8 +- .../interface/PlotRecTracks.h | 4 +- .../ChargedHadronSpectra/src/HitInfo.cc | 8 +- .../ChargedHadronSpectra/src/PlotRecTracks.cc | 10 +- .../ChargedHadronSpectra/src/PlotSimTracks.cc | 6 +- .../test/QCDTrackAnalyzer.cc | 14 +- .../Geometry/test/FastsimHitNtuplizer.cc | 5 +- .../Geometry/test/ModuleInfo_Phase2.cc | 2099 +++++++++-------- .../Geometry/test/StdHitNtuplizer.cc | 5 +- .../GlobalDigis/src/GlobalDigisAnalyzer.cc | 9 +- .../GlobalDigis/src/GlobalDigisProducer.cc | 9 +- .../src/GlobalRecHitsAnalyzer.cc | 9 +- .../src/GlobalRecHitsProducer.cc | 9 +- .../TrackerDigis/plugins/SiPixelDigiValid.cc | 5 +- .../TrackerDigis/plugins/SiStripDigiValid.cc | 5 +- 27 files changed, 1154 insertions(+), 1124 deletions(-) diff --git a/Alignment/LaserAlignment/test/RecoAnalyzerRecHits.cc b/Alignment/LaserAlignment/test/RecoAnalyzerRecHits.cc index 063fc62c42f78..b2661ef425dc2 100644 --- a/Alignment/LaserAlignment/test/RecoAnalyzerRecHits.cc +++ b/Alignment/LaserAlignment/test/RecoAnalyzerRecHits.cc @@ -1,8 +1,8 @@ /** \file RecoAnalyzerRecHits.cc * plots for RecHits * - * $Date: 2008/11/07 11:04:19 $ - * $Revision: 1.10 $ + * $Date: 2012/12/26 20:35:50 $ + * $Revision: 1.11 $ * \author Maarten Thomas */ @@ -22,8 +22,9 @@ void RecoAnalyzer::trackerRecHits(edm::Event const& theEvent, edm::EventSetup const& theSetup) { //Retrieve tracker topology from geometry - edm::ESHandle tTopo; - #include.get().get(tTopo); + edm::ESHandle tTopoHandle; + theSetup.get().get(tTopoHandle); + const TrackerTopology* const tTopo = tTopoHandle.product(); // access the Tracker diff --git a/Alignment/LaserDQM/plugins/LaserDQMStatistics.cc b/Alignment/LaserDQM/plugins/LaserDQMStatistics.cc index fe6b96ce28f17..a40f89666b83d 100644 --- a/Alignment/LaserDQM/plugins/LaserDQMStatistics.cc +++ b/Alignment/LaserDQM/plugins/LaserDQMStatistics.cc @@ -1,8 +1,8 @@ /** \file LaserDQMStatistics.cc * Fill the DQM Monitors * - * $Date: 2007/12/04 23:54:44 $ - * $Revision: 1.5 $ + * $Date: 2012/12/26 20:38:59 $ + * $Revision: 1.6 $ * \author Maarten Thomas */ @@ -26,8 +26,9 @@ void LaserDQM::trackerStatistics(edm::Event const& theEvent,edm::EventSetup const& theSetup) { //Retrieve tracker topology from geometry - edm::ESHandle tTopo; - theSetup.get().get(tTopo); + edm::ESHandle tTopoHandle; + theSetup.get().get(tTopoHandle); + const TrackerTopology* const tTopo = tTopoHandle.product(); // access the tracker diff --git a/AnalysisAlgos/TrackInfoProducer/test/TrackInfoAnalyzer.cc b/AnalysisAlgos/TrackInfoProducer/test/TrackInfoAnalyzer.cc index a373a391ddcf3..a5f69a5d8ce5f 100644 --- a/AnalysisAlgos/TrackInfoProducer/test/TrackInfoAnalyzer.cc +++ b/AnalysisAlgos/TrackInfoProducer/test/TrackInfoAnalyzer.cc @@ -51,8 +51,10 @@ class TrackInfoAnalyzer : public edm::EDAnalyzer { using namespace reco; - edm::ESHandle tTopo; - setup.get().get(tTopo); + //Retrieve tracker topology from geometry + edm::ESHandle tTopoHandle; + setup.get().get(tTopoHandle); + const TrackerTopology* const tTopo = tTopoHandle.product(); //std::cout << "\nEvent ID = "<< event.id() << std::endl ; edm::InputTag TkTag = conf_.getParameter("TrackInfo"); diff --git a/DQM/SiPixelMonitorTrack/src/SiPixelTrackResidualSource.cc b/DQM/SiPixelMonitorTrack/src/SiPixelTrackResidualSource.cc index ef3931582f1e9..b5456f47d6b83 100644 --- a/DQM/SiPixelMonitorTrack/src/SiPixelTrackResidualSource.cc +++ b/DQM/SiPixelMonitorTrack/src/SiPixelTrackResidualSource.cc @@ -10,7 +10,7 @@ // Original Author: Shan-Huei Chuang // Created: Fri Mar 23 18:41:42 CET 2007 // Updated by Lukas Wehrli (plots for clusters on/off track added) -// $Id: SiPixelTrackResidualSource.cc,v 1.25 2012/09/11 09:37:41 clseitz Exp $ +// $Id: SiPixelTrackResidualSource.cc,v 1.26 2012/12/26 21:07:10 wmtan Exp $ #include @@ -514,8 +514,9 @@ void SiPixelTrackResidualSource::endJob(void) { void SiPixelTrackResidualSource::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) { //Retrieve tracker topology from geometry - edm::ESHandle tTopo; - iSetup.get().get(tTopo); + edm::ESHandle tTopoHandle; + iSetup.get().get(tTopoHandle); + const TrackerTopology* const tTopo = tTopoHandle.product(); diff --git a/DQMOffline/CalibTracker/plugins/SiStripBadComponentsDQMServiceReader.cc b/DQMOffline/CalibTracker/plugins/SiStripBadComponentsDQMServiceReader.cc index 5a7fac91da0c1..0ea52b7a724b1 100755 --- a/DQMOffline/CalibTracker/plugins/SiStripBadComponentsDQMServiceReader.cc +++ b/DQMOffline/CalibTracker/plugins/SiStripBadComponentsDQMServiceReader.cc @@ -21,8 +21,10 @@ SiStripBadComponentsDQMServiceReader::~SiStripBadComponentsDQMServiceReader(){} void SiStripBadComponentsDQMServiceReader::analyze( const edm::Event& e, const edm::EventSetup& iSetup) { - edm::ESHandle tTopo; - iSetup.get().get(tTopo); + //Retrieve tracker topology from geometry + edm::ESHandle tTopoHandle; + iSetup.get().get(tTopoHandle); + const TrackerTopology* const tTopo = tTopoHandle.product(); uint32_t FedErrorMask = 1; // bit 0 uint32_t DigiErrorMask = 2; // bit 1 @@ -77,7 +79,7 @@ void SiStripBadComponentsDQMServiceReader::printError( std::stringstream & ss, c } } -string SiStripBadComponentsDQMServiceReader::detIdToString(const DetId & detid, edm::ESHandle& tTopo) +string SiStripBadComponentsDQMServiceReader::detIdToString(const DetId & detid, const TrackerTopology* tTopo) { std::string detector; int layer = 0; diff --git a/DQMOffline/CalibTracker/plugins/SiStripBadComponentsDQMServiceReader.h b/DQMOffline/CalibTracker/plugins/SiStripBadComponentsDQMServiceReader.h index cf5ef4daea978..814eeb37faaa1 100755 --- a/DQMOffline/CalibTracker/plugins/SiStripBadComponentsDQMServiceReader.h +++ b/DQMOffline/CalibTracker/plugins/SiStripBadComponentsDQMServiceReader.h @@ -31,7 +31,7 @@ class SiStripBadComponentsDQMServiceReader : public edm::EDAnalyzer { void printError( std::stringstream & ss, const bool error, const std::string & errorText ); - std::string detIdToString(const DetId & detid, edm::ESHandle& tTopo); + std::string detIdToString(const DetId & detid, const TrackerTopology* tTopo); private: bool printdebug_; diff --git a/EventFilter/SiStripChannelChargeFilter/src/ClusterMTCCFilter.cc b/EventFilter/SiStripChannelChargeFilter/src/ClusterMTCCFilter.cc index fd35ab36d5d33..03f29c1bd96b7 100644 --- a/EventFilter/SiStripChannelChargeFilter/src/ClusterMTCCFilter.cc +++ b/EventFilter/SiStripChannelChargeFilter/src/ClusterMTCCFilter.cc @@ -43,8 +43,10 @@ ClusterMTCCFilter::ClusterMTCCFilter(const edm::ParameterSet& ps){ bool ClusterMTCCFilter::filter(edm::Event & e, edm::EventSetup const& c) { - edm::ESHandle tTopo; - c.get().get(tTopo); + //Retrieve tracker topology from geometry + edm::ESHandle tTopoHandle; + c.get().get(tTopoHandle); + const TrackerTopology* const tTopo = tTopoHandle.product(); //get SiStripCluster edm::Handle< edm::DetSetVector > h; diff --git a/Geometry/TrackerNumberingBuilder/test/ModuleNumbering.cc b/Geometry/TrackerNumberingBuilder/test/ModuleNumbering.cc index 6764324347773..11ce963184d12 100644 --- a/Geometry/TrackerNumberingBuilder/test/ModuleNumbering.cc +++ b/Geometry/TrackerNumberingBuilder/test/ModuleNumbering.cc @@ -166,8 +166,9 @@ void ModuleNumbering::analyze( const edm::Event& iEvent, const edm::EventSetup& iSetup ) { //Retrieve tracker topology from geometry - edm::ESHandle tTopo; - iSetup.get().get(tTopo); + edm::ESHandle tTopoHandle; + iSetup.get().get(tTopoHandle); + const TrackerTopology* const tTopo = tTopoHandle.product(); diff --git a/Geometry/TrackerNumberingBuilder/test/TrackerTopologyAnalyzer.cc b/Geometry/TrackerNumberingBuilder/test/TrackerTopologyAnalyzer.cc index eb9b1e5298892..c70ea207a733c 100644 --- a/Geometry/TrackerNumberingBuilder/test/TrackerTopologyAnalyzer.cc +++ b/Geometry/TrackerNumberingBuilder/test/TrackerTopologyAnalyzer.cc @@ -27,8 +27,9 @@ class TrackerTopologyAnalyzer : public edm::EDAnalyzer { void TrackerTopologyAnalyzer::analyze( const edm::Event &iEvent, const edm::EventSetup& iSetup) { //Retrieve tracker topology from geometry - edm::ESHandle tTopo; - iSetup.get().get(tTopo); + edm::ESHandle tTopoHandle; + iSetup.get().get(tTopoHandle); + const TrackerTopology* const tTopo = tTopoHandle.product(); typedef std::vector DetIdContainer; diff --git a/HLTrigger/special/src/HLTTrackerHaloFilter.cc b/HLTrigger/special/src/HLTTrackerHaloFilter.cc index 14b955acf4cdb..afeefaff81a4b 100644 --- a/HLTrigger/special/src/HLTTrackerHaloFilter.cc +++ b/HLTrigger/special/src/HLTTrackerHaloFilter.cc @@ -41,8 +41,10 @@ HLTTrackerHaloFilter::~HLTTrackerHaloFilter() bool HLTTrackerHaloFilter::hltFilter(edm::Event& event, const edm::EventSetup& iSetup, trigger::TriggerFilterObjectWithRefs & filterproduct) { - edm::ESHandle tTopo; - iSetup.get().get(tTopo); + //Retrieve tracker topology from geometry + edm::ESHandle tTopoHandle; + iSetup.get().get(tTopoHandle); + const TrackerTopology* const tTopo = tTopoHandle.product(); // All HLT filters must create and fill an HLT filter object, // recording any reconstructed physics objects satisfying (or not) diff --git a/PhysicsTools/RecoUtils/interface/CheckHitPattern.h b/PhysicsTools/RecoUtils/interface/CheckHitPattern.h index 93aca3e46942d..b298247117281 100644 --- a/PhysicsTools/RecoUtils/interface/CheckHitPattern.h +++ b/PhysicsTools/RecoUtils/interface/CheckHitPattern.h @@ -61,7 +61,7 @@ class CheckHitPattern { // Return a pair consisting of the numbers used by HitPattern to // identify subdetector and layer number respectively. typedef std::pair DetInfo; - static DetInfo interpretDetId(DetId detId, edm::ESHandle& tTopo); + static DetInfo interpretDetId(DetId detId, const TrackerTopology* tTopo); // Return a bool indicating if a given subdetector is in the barrel. static bool barrel(uint32_t subDet); diff --git a/PhysicsTools/RecoUtils/src/CheckHitPattern.cc b/PhysicsTools/RecoUtils/src/CheckHitPattern.cc index 7d002bd801aed..f83a3214f3077 100644 --- a/PhysicsTools/RecoUtils/src/CheckHitPattern.cc +++ b/PhysicsTools/RecoUtils/src/CheckHitPattern.cc @@ -24,8 +24,10 @@ CheckHitPattern::RZrangeMap CheckHitPattern::rangeRorZ_; void CheckHitPattern::init(const edm::EventSetup& iSetup) { - edm::ESHandle tTopo; - iSetup.get().get(tTopo); + //Retrieve tracker topology from geometry + edm::ESHandle tTopoHandle; + iSetup.get().get(tTopoHandle); + const TrackerTopology* const tTopo = tTopoHandle.product(); // // Note min/max radius (z) of each barrel layer (endcap disk). @@ -78,7 +80,7 @@ void CheckHitPattern::init(const edm::EventSetup& iSetup) { #endif } -CheckHitPattern::DetInfo CheckHitPattern::interpretDetId(DetId detId, edm::ESHandle& tTopo) { +CheckHitPattern::DetInfo CheckHitPattern::interpretDetId(DetId detId, const TrackerTopology* tTopo) { // Convert detId to a pair consisting of the numbers used by HitPattern // to identify subdetector and layer number respectively. if (detId.subdetId() == StripSubdetector::TIB) { diff --git a/QCDAnalysis/ChargedHadronSpectra/interface/HitInfo.h b/QCDAnalysis/ChargedHadronSpectra/interface/HitInfo.h index bb61dedc288a5..3ff86bd3befb8 100644 --- a/QCDAnalysis/ChargedHadronSpectra/interface/HitInfo.h +++ b/QCDAnalysis/ChargedHadronSpectra/interface/HitInfo.h @@ -17,10 +17,10 @@ class HitInfo HitInfo(); ~HitInfo(); - static std::string getInfo(const DetId & id, edm::ESHandle& tTopo); - static std::string getInfo(const TrackingRecHit & recHit, edm::ESHandle& tTopo); - static std::string getInfo(std::vector recHits, edm::ESHandle& tTopo); - static std::string getInfo(const PSimHit & simHit, edm::ESHandle& tTopo); + static std::string getInfo(const DetId & id, const TrackerTopology* tTopo); + static std::string getInfo(const TrackingRecHit & recHit, const TrackerTopology* tTopo); + static std::string getInfo(std::vector recHits, const TrackerTopology* tTopo); + static std::string getInfo(const PSimHit & simHit, const TrackerTopology* tTopo); }; #endif diff --git a/QCDAnalysis/ChargedHadronSpectra/interface/PlotRecTracks.h b/QCDAnalysis/ChargedHadronSpectra/interface/PlotRecTracks.h index 2a3760edde299..0b32675879a95 100644 --- a/QCDAnalysis/ChargedHadronSpectra/interface/PlotRecTracks.h +++ b/QCDAnalysis/ChargedHadronSpectra/interface/PlotRecTracks.h @@ -29,11 +29,11 @@ class PlotRecTracks private: std::string getPixelInfo(const TrackingRecHit* recHit, - edm::ESHandle& tTopo, + const TrackerTopology* tTopo, const std::ostringstream& o, const std::ostringstream& d); std::string getStripInfo(const TrackingRecHit* recHit, - edm::ESHandle& tTopo, + const TrackerTopology* tTopo, const std::ostringstream& o, const std::ostringstream& d); FreeTrajectoryState getTrajectoryAtOuterPoint(const reco::Track& track); diff --git a/QCDAnalysis/ChargedHadronSpectra/src/HitInfo.cc b/QCDAnalysis/ChargedHadronSpectra/src/HitInfo.cc index ef05523c36b83..e0cbb8b723997 100644 --- a/QCDAnalysis/ChargedHadronSpectra/src/HitInfo.cc +++ b/QCDAnalysis/ChargedHadronSpectra/src/HitInfo.cc @@ -22,7 +22,7 @@ HitInfo::~HitInfo() } /*****************************************************************************/ -string HitInfo::getInfo(const DetId & id, edm::ESHandle& tTopo) +string HitInfo::getInfo(const DetId & id, const TrackerTopology* tTopo) { std::string info; @@ -50,7 +50,7 @@ string HitInfo::getInfo(const DetId & id, edm::ESHandle& tTopo) } /*****************************************************************************/ -string HitInfo::getInfo(const TrackingRecHit & recHit, edm::ESHandle& tTopo) +string HitInfo::getInfo(const TrackingRecHit & recHit, const TrackerTopology* tTopo) { DetId id(recHit.geographicalId()); @@ -58,7 +58,7 @@ string HitInfo::getInfo(const TrackingRecHit & recHit, edm::ESHandle recHits, edm::ESHandle& tTopo) +string HitInfo::getInfo(std::vector recHits, const TrackerTopology* tTopo) { std::string info; @@ -71,7 +71,7 @@ string HitInfo::getInfo(std::vector recHits, edm::ESHand } /*****************************************************************************/ -string HitInfo::getInfo(const PSimHit & simHit, edm::ESHandle& tTopo) +string HitInfo::getInfo(const PSimHit & simHit, const TrackerTopology* tTopo) { std::string info; diff --git a/QCDAnalysis/ChargedHadronSpectra/src/PlotRecTracks.cc b/QCDAnalysis/ChargedHadronSpectra/src/PlotRecTracks.cc index 8666202dd0d57..4701b7eeb8a96 100644 --- a/QCDAnalysis/ChargedHadronSpectra/src/PlotRecTracks.cc +++ b/QCDAnalysis/ChargedHadronSpectra/src/PlotRecTracks.cc @@ -75,7 +75,7 @@ PlotRecTracks::~PlotRecTracks() } /*****************************************************************************/ -string PlotRecTracks::getPixelInfo(const TrackingRecHit* recHit, edm::ESHandle& tTopo, const ostringstream& o, const ostringstream& d) +string PlotRecTracks::getPixelInfo(const TrackingRecHit* recHit, const TrackerTopology* tTopo, const ostringstream& o, const ostringstream& d) { const SiPixelRecHit* pixelRecHit = dynamic_cast(recHit); @@ -125,7 +125,7 @@ string PlotRecTracks::getPixelInfo(const TrackingRecHit* recHit, edm::ESHandle& tTopo, const ostringstream& o, const ostringstream& d) + (const TrackingRecHit* recHit, const TrackerTopology* tTopo, const ostringstream& o, const ostringstream& d) { DetId id = recHit->geographicalId(); LocalPoint lpos = recHit->localPosition(); @@ -198,8 +198,10 @@ FreeTrajectoryState PlotRecTracks::getTrajectoryAtOuterPoint /*****************************************************************************/ void PlotRecTracks::printRecTracks(const edm::Event& ev, const edm::EventSetup& es) { - edm::ESHandle tTopo; - es.get().get(tTopo); + //Retrieve tracker topology from geometry + edm::ESHandle tTopoHandle; + es.get().get(tTopoHandle); + const TrackerTopology* const tTopo = tTopoHandle.product(); theHitAssociator = new TrackerHitAssociator(ev); diff --git a/QCDAnalysis/ChargedHadronSpectra/src/PlotSimTracks.cc b/QCDAnalysis/ChargedHadronSpectra/src/PlotSimTracks.cc index 7ed58c502d4aa..cd055bf591ea8 100644 --- a/QCDAnalysis/ChargedHadronSpectra/src/PlotSimTracks.cc +++ b/QCDAnalysis/ChargedHadronSpectra/src/PlotSimTracks.cc @@ -74,8 +74,10 @@ PlotSimTracks::~PlotSimTracks() /*****************************************************************************/ void PlotSimTracks::printSimTracks(const edm::Event& ev, const edm::EventSetup& es) { - edm::ESHandle tTopo; - es.get().get(tTopo); + //Retrieve tracker topology from geometry + edm::ESHandle tTopoHandle; + es.get().get(tTopoHandle); + const TrackerTopology* const tTopo = tTopoHandle.product(); // Tracker edm::Handle simTrackHandle; diff --git a/QCDAnalysis/ChargedHadronSpectra/test/QCDTrackAnalyzer.cc b/QCDAnalysis/ChargedHadronSpectra/test/QCDTrackAnalyzer.cc index 397eea1a6bf7a..7ed51cc941bbc 100644 --- a/QCDAnalysis/ChargedHadronSpectra/test/QCDTrackAnalyzer.cc +++ b/QCDAnalysis/ChargedHadronSpectra/test/QCDTrackAnalyzer.cc @@ -89,8 +89,8 @@ class QCDTrackAnalyzer : public edm::EDAnalyzer virtual void endJob(); private: - int getDetLayerId(const PSimHit& simHit, edm::ESHandle& tTopo); - bool isAccepted(const TrackingParticle& simTrack, edm::ESHandle& tTopo); + int getDetLayerId(const PSimHit& simHit, const TrackerTopology* tTopo); + bool isAccepted(const TrackingParticle& simTrack, const TrackerTopology* tTopo); bool isPrimary(const edm::RefToBase & recTrack); edm::RefToBase getAssociatedRecTrack @@ -207,7 +207,7 @@ void QCDTrackAnalyzer::endJob() } /*****************************************************************************/ -int QCDTrackAnalyzer::getDetLayerId(const PSimHit& simHit, edm::ESHandle& tTopo) +int QCDTrackAnalyzer::getDetLayerId(const PSimHit& simHit, const TrackerTopology* tTopo) { int layerId; @@ -229,7 +229,7 @@ int QCDTrackAnalyzer::getDetLayerId(const PSimHit& simHit, edm::ESHandle& tTopo) +bool QCDTrackAnalyzer::isAccepted(const TrackingParticle& simTrack_, const TrackerTopology* tTopo) { TrackingParticle * simTrack = const_cast(&simTrack_); @@ -466,8 +466,10 @@ float QCDTrackAnalyzer::refitWithVertex /*****************************************************************************/ int QCDTrackAnalyzer::processSimTracks(const edm::EventSetup& es) { - edm::ESHandle tTopo; - es.get().get(tTopo); + //Retrieve tracker topology from geometry + edm::ESHandle tTopoHandle; + es.get().get(tTopoHandle); + const TrackerTopology* const tTopo = tTopoHandle.product(); int ntrk = 0; diff --git a/SLHCUpgradeSimulations/Geometry/test/FastsimHitNtuplizer.cc b/SLHCUpgradeSimulations/Geometry/test/FastsimHitNtuplizer.cc index 3af2e61043f23..f9f55ad384577 100644 --- a/SLHCUpgradeSimulations/Geometry/test/FastsimHitNtuplizer.cc +++ b/SLHCUpgradeSimulations/Geometry/test/FastsimHitNtuplizer.cc @@ -105,8 +105,9 @@ void FastsimHitNtuplizer::beginJob(const edm::EventSetup& es) void FastsimHitNtuplizer::analyze(const edm::Event& e, const edm::EventSetup& es) { //Retrieve tracker topology from geometry - edm::ESHandle tTopo; - es.get().get(tTopo); + //edm::ESHandle tTopoHandle; + //es.get().get(tTopoHandle); + //const TrackerTopology* const tTopo = tTopoHandle.product(); edm::Handle theGSRecHits; diff --git a/SLHCUpgradeSimulations/Geometry/test/ModuleInfo_Phase2.cc b/SLHCUpgradeSimulations/Geometry/test/ModuleInfo_Phase2.cc index 30f3c86c4db3e..94052f38299bf 100644 --- a/SLHCUpgradeSimulations/Geometry/test/ModuleInfo_Phase2.cc +++ b/SLHCUpgradeSimulations/Geometry/test/ModuleInfo_Phase2.cc @@ -1,1054 +1,1055 @@ -// -*- C++ -*- -// -/* - Description: - - Implementation: - -*/ - -// -// Original Author: Riccardo Ranieri -// Created: Wed May 3 10:30:00 CEST 2006 -// Modified for Hybrid & LB: Fri July 31 by E. Brownson -// - -// system include files -#include - -// user include files -#include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/EDAnalyzer.h" - -#include "FWCore/Framework/interface/Event.h" -#include "FWCore/Framework/interface/EventSetup.h" -#include "FWCore/Framework/interface/ESHandle.h" -#include "FWCore/Framework/interface/MakerMacros.h" -//#include "FWCore/Utilities/interface/Exception.h" - -#include "FWCore/ParameterSet/interface/ParameterSet.h" -#include "Geometry/CommonDetUnit/interface/TrackingGeometry.h" -#include "Geometry/Records/interface/TrackerDigiGeometryRecord.h" -#include "Geometry/TrackerNumberingBuilder/interface/GeometricDet.h" -#include "Geometry/CommonTopologies/interface/PixelTopology.h" -#include "Geometry/CommonTopologies/interface/StripTopology.h" -#include "Geometry/TrackerGeometryBuilder/interface/PixelGeomDetType.h" -#include "Geometry/TrackerGeometryBuilder/interface/StripGeomDetType.h" -//#include "Geometry/TrackerGeometryBuilder/interface/RectangularPixelTopology.h" -#include "Geometry/CommonTopologies/interface/PixelTopology.h" -#include "Geometry/CommonTopologies/interface/Topology.h" - -#include "Geometry/TrackerGeometryBuilder/interface/PixelGeomDetUnit.h" -#include "DataFormats/GeometrySurface/interface/BoundSurface.h" -#include "FWCore/MessageLogger/interface/MessageLogger.h" - -#include "Geometry/TrackerNumberingBuilder/interface/CmsTrackerDebugNavigator.h" -#include "DataFormats/SiStripDetId/interface/StripSubdetector.h" +// -*- C++ -*- +// +/* + Description: + + Implementation: + +*/ + +// +// Original Author: Riccardo Ranieri +// Created: Wed May 3 10:30:00 CEST 2006 +// Modified for Hybrid & LB: Fri July 31 by E. Brownson +// + +// system include files +#include + +// user include files +#include "FWCore/Framework/interface/Frameworkfwd.h" +#include "FWCore/Framework/interface/EDAnalyzer.h" + +#include "FWCore/Framework/interface/Event.h" +#include "FWCore/Framework/interface/EventSetup.h" +#include "FWCore/Framework/interface/ESHandle.h" +#include "FWCore/Framework/interface/MakerMacros.h" +//#include "FWCore/Utilities/interface/Exception.h" + +#include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "Geometry/CommonDetUnit/interface/TrackingGeometry.h" +#include "Geometry/Records/interface/TrackerDigiGeometryRecord.h" +#include "Geometry/TrackerNumberingBuilder/interface/GeometricDet.h" +#include "Geometry/CommonTopologies/interface/PixelTopology.h" +#include "Geometry/CommonTopologies/interface/StripTopology.h" +#include "Geometry/TrackerGeometryBuilder/interface/PixelGeomDetType.h" +#include "Geometry/TrackerGeometryBuilder/interface/StripGeomDetType.h" +//#include "Geometry/TrackerGeometryBuilder/interface/RectangularPixelTopology.h" +#include "Geometry/CommonTopologies/interface/PixelTopology.h" +#include "Geometry/CommonTopologies/interface/Topology.h" + +#include "Geometry/TrackerGeometryBuilder/interface/PixelGeomDetUnit.h" +#include "DataFormats/GeometrySurface/interface/BoundSurface.h" +#include "FWCore/MessageLogger/interface/MessageLogger.h" + +#include "Geometry/TrackerNumberingBuilder/interface/CmsTrackerDebugNavigator.h" +#include "DataFormats/SiStripDetId/interface/StripSubdetector.h" #include "DataFormats/TrackerCommon/interface/TrackerTopology.h" #include "Geometry/Records/interface/IdealGeometryRecord.h" -#include "Geometry/TrackerNumberingBuilder/interface/CmsTrackerStringToEnum.h" -#include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h" -#include "DetectorDescription/Core/interface/DDRoot.h" -#include "DetectorDescription/Core/interface/DDExpandedView.h" -#include "DetectorDescription/Core/interface/DDFilter.h" -#include "DetectorDescription/Core/interface/DDFilteredView.h" -#include "DetectorDescription/Core/interface/DDCompactView.h" -#include "DetectorDescription/Core/interface/DDMaterial.h" - -// output -#include -#include -#include -#include -#include - -// -// -// class decleration -// - -class ModuleInfo_Phase2 : public edm::EDAnalyzer { -public: - explicit ModuleInfo_Phase2( const edm::ParameterSet& ); - ~ModuleInfo_Phase2(); - - - virtual void analyze( const edm::Event&, const edm::EventSetup& ); -private: - // ----------member data --------------------------- - bool fromDDD_; - bool printDDD_; -}; - -// -// constants, enums and typedefs -// - -// -// static data member definitions -// - static const double density_units = 6.24151e+18; - -// -// constructors and destructor -// -ModuleInfo_Phase2::ModuleInfo_Phase2( const edm::ParameterSet& ps ) -{ - fromDDD_ = ps.getParameter("fromDDD"); - printDDD_ = ps.getUntrackedParameter("printDDD", true); - //now do what ever initialization is needed - -} - - -ModuleInfo_Phase2::~ModuleInfo_Phase2() -{ - - // do anything here that needs to be done at desctruction time - // (e.g. close files, deallocate resources etc.) - -} - - -// -// member functions -// - -// ------------ method called to produce the data ------------ -void -ModuleInfo_Phase2::analyze( const edm::Event& iEvent, const edm::EventSetup& iSetup ) +#include "Geometry/TrackerNumberingBuilder/interface/CmsTrackerStringToEnum.h" +#include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h" +#include "DetectorDescription/Core/interface/DDRoot.h" +#include "DetectorDescription/Core/interface/DDExpandedView.h" +#include "DetectorDescription/Core/interface/DDFilter.h" +#include "DetectorDescription/Core/interface/DDFilteredView.h" +#include "DetectorDescription/Core/interface/DDCompactView.h" +#include "DetectorDescription/Core/interface/DDMaterial.h" + +// output +#include +#include +#include +#include +#include + +// +// +// class decleration +// + +class ModuleInfo_Phase2 : public edm::EDAnalyzer { +public: + explicit ModuleInfo_Phase2( const edm::ParameterSet& ); + ~ModuleInfo_Phase2(); + + + virtual void analyze( const edm::Event&, const edm::EventSetup& ); +private: + // ----------member data --------------------------- + bool fromDDD_; + bool printDDD_; +}; + +// +// constants, enums and typedefs +// + +// +// static data member definitions +// + static const double density_units = 6.24151e+18; + +// +// constructors and destructor +// +ModuleInfo_Phase2::ModuleInfo_Phase2( const edm::ParameterSet& ps ) +{ + fromDDD_ = ps.getParameter("fromDDD"); + printDDD_ = ps.getUntrackedParameter("printDDD", true); + //now do what ever initialization is needed + +} + + +ModuleInfo_Phase2::~ModuleInfo_Phase2() +{ + + // do anything here that needs to be done at desctruction time + // (e.g. close files, deallocate resources etc.) + +} + + +// +// member functions +// + +// ------------ method called to produce the data ------------ +void +ModuleInfo_Phase2::analyze( const edm::Event& iEvent, const edm::EventSetup& iSetup ) { //Retrieve tracker topology from geometry - edm::ESHandle tTopo; - iSetup.get().get(tTopo); + edm::ESHandle tTopoHandle; + iSetup.get().get(tTopoHandle); + const TrackerTopology* const tTopo = tTopoHandle.product(); + + + edm::LogInfo("ModuleInfo_Phase2") << "begins"; + + // output file + std::ofstream Output("ModuleInfo_Phase2.log",std::ios::out); + // TEC output as Martin Weber's + std::ofstream TECOutput("TECLayout_CMSSW.dat",std::ios::out); + // Numbering Scheme + std::ofstream NumberingOutput("ModuleNumbering.dat",std::ios::out); + // Geometry summaries + std::ofstream GeometryOutput("GeometrySummary.log",std::ios::out); + std::ofstream GeometryXLS("GeometryXLS.log",std::ios::out); + // + + // + // get the GeometricDet + // + edm::ESHandle rDD; + edm::ESHandle > rDDE; + //if (fromDDD_) { + iSetup.get().get( rDD ); + iSetup.get().get( rDDE ); + //} else { + // iSetup.get().get( rDD ); + //} + edm::LogInfo("ModuleInfo_Phase2") << " Top node is " << rDD.product() << " " << rDD.product()->name().name() << std::endl; + edm::LogInfo("ModuleInfo_Phase2") << " And Contains Daughters: " << rDD.product()->deepComponents().size() << std::endl; + CmsTrackerDebugNavigator nav(*rDDE.product()); + nav.dump(*rDD.product(), *rDDE.product()); + // + //first instance tracking geometry + edm::ESHandle pDD; + iSetup.get ().get (pDD); + // + + // counters + //unsigned int MAXPXBLAY = 8; + unsigned int pxbN = 0; + unsigned int pxb_fullN = 0; + unsigned int pxb_halfN = 0; + unsigned int pxb_stackN = 0; + //unsigned int pxb_full_strx12N = 0; + //unsigned int pxb_half_strx12N = 0; + //unsigned int pxb_full_strx34N = 0; + //unsigned int pxb_half_strx34N = 0; + unsigned int pxb_full_L[16]= { 0 }; + unsigned int pxb_half_L[16]= { 0 }; + unsigned int pxb_stack[16]= { 0 }; + double psi_pxb_L[16]= { 0 }; + double psi_pxb[16] = { 0 }; + double psi_pxb_strx12[16] = { 0 }; + double psi_pxb_strx34[16] = { 0 }; + double pxbR_L[16] = { 0.0 }; + double pxbZ_L[16] = { 0.0 }; + double pxbpitchx[16] = { 0.0 }; + double pxbpitchy[16] = { 0.0 }; + unsigned int pxfN = 0; + unsigned int pxf_D_N = 0; + unsigned int pxf_1x2N = 0; + unsigned int pxf_1x5N = 0; + unsigned int pxf_2x3N = 0; + unsigned int pxf_2x4N = 0; + unsigned int pxf_2x5N = 0; + unsigned int pxf_D[6] = { 0 }; + unsigned int pxf_1x2_D[6] = { 0 }; + unsigned int pxf_1x5_D[6] = { 0 }; + unsigned int pxf_2x3_D[6] = { 0 }; + unsigned int pxf_2x4_D[6] = { 0 }; + unsigned int pxf_2x5_D[6] = { 0 }; + double pxfpitchx[6] = { 0 }; + double pxfpitchy[6] = { 0 }; + double psi_pxf_D[6]= { 0 }; + double psi_pxf[16] = { 0 }; + double pxfR_min_D[6] = { 9999.0 , 9999.0 , 9999.0 }; + double pxfR_max_D[6] = { 0.0 }; + double pxfZ_D[6] = { 0.0 }; + unsigned int tibN = 0; + unsigned int tib_L12_rphiN = 0; + unsigned int tib_L12_sterN = 0; + unsigned int tib_L34_rphiN = 0; + unsigned int tib_L12_rphi_L[6] = { 0 }; + unsigned int tib_L12_ster_L[6] = { 0 }; + unsigned int tib_L34_rphi_L[6] = { 0 }; + double tib_apv_L[6] = { 0 }; + double apv_tib = 0; + double tibR_L[6] = { 0.0 }; + double tibZ_L[6] = { 0.0 }; + unsigned int tidN = 0; + unsigned int tid_r1_rphiN = 0; + unsigned int tid_r1_sterN = 0; + unsigned int tid_r2_rphiN = 0; + unsigned int tid_r2_sterN = 0; + unsigned int tid_r3_rphiN = 0; + unsigned int tid_r1_rphi_D[3] = { 0 }; + unsigned int tid_r1_ster_D[3] = { 0 }; + unsigned int tid_r2_rphi_D[3] = { 0 }; + unsigned int tid_r2_ster_D[3] = { 0 }; + unsigned int tid_r3_rphi_D[3] = { 0 }; + double tid_apv_D[3] = { 0 }; + double apv_tid =0; + double tidR_min_D[3] = { 9999.0 , 9999.0 , 9999.0 }; + double tidR_max_D[3] = { 0.0 }; + double tidZ_D[3] = { 0.0 }; + unsigned int tobN = 0; + unsigned int tob_L12_rphiN = 0; + unsigned int tob_L12_sterN = 0; + unsigned int tob_L34_rphiN = 0; + unsigned int tob_L56_rphiN = 0; + unsigned int tob_L12_rphi_L[6] = { 0 }; + unsigned int tob_L12_ster_L[6] = { 0 }; + unsigned int tob_L34_rphi_L[6] = { 0 }; + unsigned int tob_L56_rphi_L[6] = { 0 }; + double tob_apv_L[6] = { 0 }; + double apv_tob = 0; + double tobR_L[6] = { 0.0 }; + double tobZ_L[6] = { 0.0 }; + unsigned int tecN = 0; + unsigned int tec_r1_rphiN = 0; + unsigned int tec_r1_sterN = 0; + unsigned int tec_r2_rphiN = 0; + unsigned int tec_r2_sterN = 0; + unsigned int tec_r3_rphiN = 0; + unsigned int tec_r4_rphiN = 0; + unsigned int tec_r5_rphiN = 0; + unsigned int tec_r5_sterN = 0; + unsigned int tec_r6_rphiN = 0; + unsigned int tec_r7_rphiN = 0; + unsigned int tec_r1_rphi_D[9] = { 0 }; + unsigned int tec_r1_ster_D[9] = { 0 }; + unsigned int tec_r2_rphi_D[9] = { 0 }; + unsigned int tec_r2_ster_D[9] = { 0 }; + unsigned int tec_r3_rphi_D[9] = { 0 }; + unsigned int tec_r4_rphi_D[9] = { 0 }; + unsigned int tec_r5_rphi_D[9] = { 0 }; + unsigned int tec_r5_ster_D[9] = { 0 }; + unsigned int tec_r6_rphi_D[9] = { 0 }; + unsigned int tec_r7_rphi_D[9] = { 0 }; + double tec_apv_D[9] = { 0 }; + double apv_tec =0; + double tecR_min_D[9] = { 9999.0 , 9999.0 , 9999.0 , 9999.0 , 9999.0 , 9999.0 , 9999.0 , 9999.0 , 9999.0 }; + double tecR_max_D[9] = { 0.0 }; + double tecZ_D[9] = { 0.0 }; + double thepixROCRowsB[16] = {0.0}; + double thepixROCColsB[16] = {0.0}; + double thepixROCRowsD[16] = {0.0}; + double thepixROCColsD[16] = {0.0}; + // + double volume_total = 0.0; + double weight_total = 0.0; + double activeSurface_total = 0.0; + double volume_pxb = 0.0; + double weight_pxb = 0.0; + double activeSurface_pxb = 0.0; + double activeSurface_pxb_L[16] = {0.0}; + double volume_pxf = 0.0; + double weight_pxf = 0.0; + double activeSurface_pxf = 0.0; + double activeSurface_pxf_D[6] = {0.0}; + double volume_tib = 0.0; + double weight_tib = 0.0; + double activeSurface_tib = 0.0; + double activeSurface_tib_L[4] = {0.0}; + double volume_tid = 0.0; + double weight_tid = 0.0; + double activeSurface_tid = 0.0; + double activeSurface_tid_D[3] = {0.0}; + double volume_tob = 0.0; + double weight_tob = 0.0; + double activeSurface_tob = 0.0; + double activeSurface_tob_L[6] = {0.0}; + double volume_tec = 0.0; + double weight_tec = 0.0; + double activeSurface_tec = 0.0; + double activeSurface_tec_D[9] = {0.0}; + // + unsigned int nlayersPXB = 0; // number of layers + unsigned int nlayersTIB = 0; // number of layers + unsigned int nlayersTOB = 0; // number of layers + unsigned int ndisksPXF = 0; + unsigned int ndisksTID = 0; + unsigned int nwheelsTEC = 0; + + std::vector modules = (*rDD).deepComponents(); + Output << "************************ List of modules with positions ************************" << std::endl; + // MEC: 2010-04-13: need to find corresponding GeometricDetExtra. + std::vector::const_iterator gdei(rDDE->begin()), gdeEnd(rDDE->end()); + for(unsigned int i=0; igeographicalID().rawId(); + gdei = rDDE->begin(); + for (; gdei != gdeEnd; ++gdei) { + if (gdei->geographicalId() == modules[i]->geographicalId()) break; + } + + if (gdei == gdeEnd) throw cms::Exception("ModuleInfo") << "THERE IS NO MATCHING DetId in the GeometricDetExtra"; //THIS never happens! + + GeometricDet::nav_type detNavType = modules[i]->navType(); + Output << std::fixed << std::setprecision(6); // set as default 6 decimal digits + std::bitset<32> binary_rawid(rawid); + Output << " ******** raw Id = " << rawid << " (" << binary_rawid << ") "; + + // if ( fromDDD_ && printDDD_ ) { + // Output << "\t nav type = " << detNavType; + // } + //nav_type typedef changed in 3_6_2; comment out for now. idr 10/6/10 + + Output << std::endl; + int subdetid = modules[i]->geographicalID().subdetId(); + double volume = gdei->volume() / 1000; // mm3->cm3 + double density = gdei->density() / density_units; + double weight = gdei->weight() / density_units / 1000.; // [kg], hence the factor 1000; + double thickness = modules[i]->bounds()->thickness() * 10000; // cm-->um + double length = (modules[i]->bounds()->length()); // already in cm + //double width = (modules[i]->bounds()->width()); // already in cm + double activeSurface = volume / ( thickness / 10000 ); // cm2 (thickness in um) + double polarRadius = std::sqrt(modules[i]->translation().X()*modules[i]->translation().X()+modules[i]->translation().Y()*modules[i]->translation().Y()); + double positionZ = std::abs(modules[i]->translation().Z())/10.; //cm + volume_total+=volume; + weight_total+=weight; + activeSurface_total+=activeSurface; + + switch (subdetid) { + + // PXB + case 1: + { + pxbN++; + volume_pxb+=volume; + weight_pxb+=weight; + activeSurface_pxb+=activeSurface; + std::string name = modules[i]->name().name(); + if(name == "PixelBarrelActiveFull" || name == "PixelBarrelActiveFull0" || name == "PixelBarrelActiveFull1" || + name == "PixelBarrelActiveFull2" || name == "PixelBarrelActiveFull3" + ) pxb_fullN++; + if(name == "PixelBarrelActiveHalf" || name == "PixelBarrelActiveHalf1") pxb_halfN++; + if(name == "PixelBarrelActiveStack0" || name == "PixelBarrelActiveStack1" || name == "PixelBarrelActiveStack2" || name == "PixelBarrelActiveStack3" || + name == "PixelBarrelActiveStack4" || name == "PixelBarrelActiveStack5" || name == "PixelBarrelActiveStack6" || name == "PixelBarrelActiveStack7" || + name == "PixelBarrelActiveStack8" || name == "PixelBarrelActiveStack9" ) pxb_stackN++; + //if(name == "PixelBarrelActiveFull2") pxb_full_strx12N++; // Outdated ? + //if(name == "PixelBarrelActiveHalf2") pxb_half_strx12N++; + //if(name == "PixelBarrelActiveFull3") pxb_full_strx34N++; + //if(name == "PixelBarrelActiveHalf3") pxb_half_strx34N++; + + unsigned int theLayer = tTopo->pxbLayer(rawid); + unsigned int theLadder = tTopo->pxbLadder(rawid); + unsigned int theModule = tTopo->pxbModule(rawid); + thepixROCRowsB[theLayer-1] = modules[i]->pixROCRows(); + thepixROCColsB[theLayer-1] = modules[i]->pixROCCols(); + { + const DetId& detid =modules[i]->geographicalID(); + DetId detIdObject( detid ); + const GeomDetUnit * genericDet = pDD->idToDetUnit( detIdObject ); + const PixelGeomDetUnit * pixDet = dynamic_cast(genericDet); + //std::cout << " "<<__LINE__<<" PixelGeomDetUnit "<surface().position().perp()<<" , "<surface().position().z()<<"\n"; + const PixelTopology * theTopol = &(pixDet->specificTopology()); + std::pair pitchxy = theTopol->pitch(); + pxbpitchx[theLayer-1] = double(int(0.5+(10000*pitchxy.first ))); + pxbpitchy[theLayer-1] = double(int(0.5+(10000*pitchxy.second))); + //std::cout<<" "<<" BPix Layer "<< theLayer << " with Pitch = " << pxbpitchx[theLayer-1]<<" , "< nlayersPXB) nlayersPXB=theLayer; + // The following sums will need to be verified... + if(name == "PixelBarrelActiveFull" || name == "PixelBarrelActiveFull0" || name == "PixelBarrelActiveFull1" || name == "PixelBarrelActiveFull2" || name == "PixelBarrelActiveFull3" ) pxb_full_L[theLayer-1]++; + if(name == "PixelBarrelActiveHalf" || name == "PixelBarrelActiveHalf1" || name == "PixelBarrelActiveHalf2" || name == "PixelBarrelActiveHalf3" ) pxb_half_L[theLayer-1]++; + if(name == "PixelBarrelActiveStack0" || name == "PixelBarrelActiveStack1" || name == "PixelBarrelActiveStack2" || name == "PixelBarrelActiveStack3" || + name == "PixelBarrelActiveStack4" || name == "PixelBarrelActiveStack5" || name == "PixelBarrelActiveStack6" || name == "PixelBarrelActiveStack7" || + name == "PixelBarrelActiveStack8" || name == "PixelBarrelActiveStack9" ) pxb_stack[theLayer-1]++; + if(name == "PixelBarrelActiveFull" || name == "PixelBarrelActiveHalf" || name == "PixelBarrelActiveFull0" || + name == "PixelBarrelActiveFull1" || name == "PixelBarrelActiveHalf1" || + name == "PixelBarrelActiveStack0" || name == "PixelBarrelActiveStack1" || name == "PixelBarrelActiveStack2" || name == "PixelBarrelActiveStack3" || + name == "PixelBarrelActiveStack4" || name == "PixelBarrelActiveStack5" || name == "PixelBarrelActiveStack6" || name == "PixelBarrelActiveStack7" || + name == "PixelBarrelActiveStack8" || name == "PixelBarrelActiveStack9" ) psi_pxb[theLayer-1] += modules[i]->pixROCx()*modules[i]->pixROCy(); + + + + if(name == "PixelBarrelActiveFull2" || name == "PixelBarrelActiveHalf2" )psi_pxb_strx12[theLayer-1] += modules[i]->pixROCx()*modules[i]->pixROCy(); + if(name == "PixelBarrelActiveFull3" || name == "PixelBarrelActiveHalf3" )psi_pxb_strx34[theLayer-1] += modules[i]->pixROCx()*modules[i]->pixROCy(); + + // Make sure there are no new names we didn't know about. + if((name == "PixelBarrelActiveStack0" || name == "PixelBarrelActiveStack1" || name == "PixelBarrelActiveStack2" || name == "PixelBarrelActiveStack3" || + name == "PixelBarrelActiveStack4" || name == "PixelBarrelActiveStack5" || name == "PixelBarrelActiveStack6" || name == "PixelBarrelActiveStack7" || + name == "PixelBarrelActiveStack8" || name == "PixelBarrelActiveStack9" || name == "PixelBarrelActiveFull" || name == "PixelBarrelActiveFull1" || + name == "PixelBarrelActiveHalf" || name == "PixelBarrelActiveHalf1" || name == "PixelBarrelActiveFull2" || name == "PixelBarrelActiveHalf2" || + name == "PixelBarrelActiveFull3" || name == "PixelBarrelActiveHalf3" || name == "PixelBarrelActiveFull0" )==0) std::cout <<"\nYou have added PXB layers that are not taken into account! \ti.e. "<pixROCx()*modules[i]->pixROCy(); + + if(pxbZ_L[theLayer-1] < positionZ+length/2)pxbZ_L[theLayer-1]=positionZ+length/2; + pxbR_L[theLayer-1] += polarRadius/10; // cm + Output << " PXB" << "\t" << "Layer " << theLayer << " Ladder " << theLadder + << "\t" << " module " << theModule << " " << name << "\t"; + if ( fromDDD_ && printDDD_ ) { + Output << "son of " << gdei->parents()[gdei->parents().size()-3].logicalPart().name() << std::endl; + } else { + Output << " NO DDD Hierarchy available " << std::endl; + } + break; + } + + // PXF + case 2: + { + pxfN++; + volume_pxf+=volume; + weight_pxf+=weight; + activeSurface_pxf+=activeSurface; + std::string name = modules[i]->name().name(); + if(name == "PixelForwardSensor" || + name == "PixelForwardSensor1"|| name == "PixelForwardSensor2"|| name == "PixelForwardSensor3" + ) pxf_D_N++; + if(name == "PixelForwardActive1x2") pxf_1x2N++; + if(name == "PixelForwardActive1x5") pxf_1x5N++; + if(name == "PixelForwardActive2x3") pxf_2x3N++; + if(name == "PixelForwardActive2x4") pxf_2x4N++; + if(name == "PixelForwardActive2x5") pxf_2x5N++; + + unsigned int thePanel = tTopo->pxfPanel(rawid); + unsigned int theDisk = tTopo->pxfDisk(rawid); + unsigned int theBlade = tTopo->pxfBlade(rawid); + unsigned int theModule = tTopo->pxfModule(rawid); + thepixROCRowsD[theDisk-1] = modules[i]->pixROCRows(); + thepixROCColsD[theDisk-1] = modules[i]->pixROCCols(); + { + const DetId& detid =modules[i]->geographicalID(); + DetId detIdObject( detid ); + const GeomDetUnit * genericDet = pDD->idToDetUnit( detIdObject ); + const PixelGeomDetUnit * pixDet = dynamic_cast(genericDet); + const PixelTopology * theTopol = &(pixDet->specificTopology()); + std::pair pitchxy = theTopol->pitch(); + pxfpitchx[theDisk-1] = double(int(0.5+(10000*pitchxy.first ))); + pxfpitchy[theDisk-1] = double(int(0.5+(10000*pitchxy.second))); + } // Discard some transitional variables. + if(theDisk > ndisksPXF) ndisksPXF=theDisk; + if(name == "PixelForwardSensor" || + name == "PixelForwardSensor1"|| name == "PixelForwardSensor2"|| name == "PixelForwardSensor3" + ) pxf_D[theDisk-1]++; + if(name == "PixelForwardActive1x2") pxf_1x2_D[theDisk-1]++; + if(name == "PixelForwardActive1x5") pxf_1x5_D[theDisk-1]++; + if(name == "PixelForwardActive2x3") pxf_2x3_D[theDisk-1]++; + if(name == "PixelForwardActive2x4") pxf_2x4_D[theDisk-1]++; + if(name == "PixelForwardActive2x5") pxf_2x5_D[theDisk-1]++; + // Make sure there are no new names we didn't know about. + if((name == "PixelForwardSensor" || name == "PixelForwardActive1x2" || name == "PixelForwardActive1x5" || + name == "PixelForwardActive2x3" || name == "PixelForwardActive2x4" || name == "PixelForwardActive2x5" || + name == "PixelForwardSensor1"|| name == "PixelForwardSensor2"|| name == "PixelForwardSensor3" + )==0) std::cout <<"\nYou have added PXF layers that are not taken into account! \ti.e. "<pixROCx()*modules[i]->pixROCy(); + psi_pxf[theDisk-1] += modules[i]->pixROCx()*modules[i]->pixROCy(); + pxfZ_D[theDisk-1] += positionZ; + polarRadius=polarRadius/10.; + if(pxfR_min_D[theDisk-1] > polarRadius-length/2)pxfR_min_D[theDisk-1] = polarRadius-length/2; + if(pxfR_max_D[theDisk-1] < polarRadius+length/2)pxfR_max_D[theDisk-1] = polarRadius+length/2; + std::string side; + side = (tTopo->pxfSide(rawid) == 1 ) ? "-" : "+"; + Output << " PXF" << side << "\t" << "Disk " << theDisk << " Blade " << theBlade << " Panel " << thePanel + << "\t" << " module " << theModule << "\t" << name << "\t"; + if ( fromDDD_ && printDDD_ ) { + Output << "son of " << gdei->parents()[gdei->parents().size()-3].logicalPart().name() << std::endl; + } else { + Output << " NO DDD Hierarchy available " << std::endl; + } + break; + } + + // TIB + case 3: + { + tibN++; + volume_tib+=volume; + weight_tib+=weight; + activeSurface_tib+=activeSurface; + std::string name = modules[i]->name().name(); + if(name == "TIBActiveRphi0") tib_L12_rphiN++; + if(name == "TIBActiveSter0") tib_L12_sterN++; + if(name == "TIBActiveRphi2") tib_L34_rphiN++; + + unsigned int theLayer = tTopo->tibLayer(rawid); + std::vector theString = tTopo->tibStringInfo(rawid); + unsigned int theModule = tTopo->tibModule(rawid); + if(theLayer > nlayersTIB) nlayersTIB=theLayer; + if(name == "TIBActiveRphi0") tib_L12_rphi_L[theLayer-1]++; + if(name == "TIBActiveSter0") tib_L12_ster_L[theLayer-1]++; + if(name == "TIBActiveRphi2") tib_L34_rphi_L[theLayer-1]++; + if((name == "TIBActiveRphi0" || name == "TIBActiveSter0" || name == "TIBActiveRphi2" )==0) std::cout <<"\nYou have added TIB layers that are not taken into account!\n\n"; + if (6siliconAPVNum(); + apv_tib += modules[i]->siliconAPVNum(); + if(tibZ_L[theLayer-1] < positionZ+length/2)tibZ_L[theLayer-1]=positionZ+length/2; + tibR_L[theLayer-1] += polarRadius/10; // cm + std::string side; + std::string part; + side = (theString[0] == 1 ) ? "-" : "+"; + part = (theString[1] == 1 ) ? "int" : "ext"; + + Output << " TIB" << side << "\t" << "Layer " << theLayer << " " << part + << "\t" << "string " << theString[2] << "\t" << " module " << theModule << " " << name << "\t"; + if ( fromDDD_ && printDDD_ ) { + Output << "son of " << gdei->parents()[gdei->parents().size()-3].logicalPart().name(); + } else { + Output << " NO DDD Hierarchy available "; + } + Output << " " << modules[i]->translation().X() << " \t" << modules[i]->translation().Y() << " \t" << modules[i]->translation().Z() << std::endl; + break; + } + + // TID + case 4: + { + tidN++; + volume_tid+=volume; + weight_tid+=weight; + activeSurface_tid+=activeSurface; + std::string name = modules[i]->name().name(); + if(name == "TIDModule0RphiActive") tid_r1_rphiN++; + if(name == "TIDModule0StereoActive") tid_r1_sterN++; + if(name == "TIDModule1RphiActive") tid_r2_rphiN++; + if(name == "TIDModule1StereoActive") tid_r2_sterN++; + if(name == "TIDModule2RphiActive") tid_r3_rphiN++; + + unsigned int theDisk = tTopo->tidWheel(rawid); + unsigned int theRing = tTopo->tidRing(rawid); + std::vector theModule = tTopo->tidModuleInfo(rawid); + if(theDisk > ndisksTID) ndisksTID=theDisk; + if(name == "TIDModule0RphiActive") tid_r1_rphi_D[theDisk-1]++; + if(name == "TIDModule0StereoActive") tid_r1_ster_D[theDisk-1]++; + if(name == "TIDModule1RphiActive") tid_r2_rphi_D[theDisk-1]++; + if(name == "TIDModule1StereoActive") tid_r2_ster_D[theDisk-1]++; + if(name == "TIDModule2RphiActive") tid_r3_rphi_D[theDisk-1]++; + if((name == "TIDModule0RphiActive" || name == "TIDModule0StereoActive" || name == "TIDModule1RphiActive" || + name == "TIDModule1StereoActive" || name == "TIDModule2RphiActive" )==0) std::cout <<"\nYou have added TID layers that are not taken into account!\n\n"; + if (3siliconAPVNum(); + apv_tid += modules[i]->siliconAPVNum(); + tidZ_D[theDisk-1] += positionZ; + polarRadius=polarRadius/10.; + if(tidR_min_D[theDisk-1] > polarRadius-length/2)tidR_min_D[theDisk-1] = polarRadius-length/2; + if(tidR_max_D[theDisk-1] < polarRadius+length/2)tidR_max_D[theDisk-1] = polarRadius+length/2; + std::string side; + std::string part; + side = (tTopo->tidSide(rawid) == 1 ) ? "-" : "+"; + part = (theModule[0] == 1 ) ? "back" : "front"; + Output << " TID" << side << "\t" << "Disk " << theDisk << " Ring " << theRing << " " << part + << "\t" << " module " << theModule[1] << "\t" << name << "\t"; + if ( fromDDD_ && printDDD_ ) { + Output << "son of " << gdei->parents()[gdei->parents().size()-3].logicalPart().name(); + } else { + Output << " NO DDD Hierarchy available "; + } + Output << " " << modules[i]->translation().X() << " \t" << modules[i]->translation().Y() << " \t" << modules[i]->translation().Z() << std::endl; + break; + } + + // TOB + case 5: + { + tobN++; + volume_tob+=volume; + weight_tob+=weight; + activeSurface_tob+=activeSurface; + std::string name = modules[i]->name().name(); + if(name == "TOBActiveRphi0") tob_L12_rphiN++; + if(name == "TOBActiveSter0") tob_L12_sterN++; + if(name == "TOBActiveRphi2") tob_L34_rphiN++; + if(name == "TOBActiveRphi4") tob_L56_rphiN++; + + unsigned int theLayer = tTopo->tobLayer(rawid); + std::vector theRod = tTopo->tobRodInfo(rawid); + unsigned int theModule = tTopo->tobModule(rawid); + if(theLayer > nlayersTOB) nlayersTOB=theLayer; + if(name == "TOBActiveRphi0") tob_L12_rphi_L[theLayer-1]++; + if(name == "TOBActiveSter0") tob_L12_ster_L[theLayer-1]++; + if(name == "TOBActiveRphi2") tob_L34_rphi_L[theLayer-1]++; + if(name == "TOBActiveRphi4") tob_L56_rphi_L[theLayer-1]++; + if((name == "TOBActiveRphi0" || name == "TOBActiveSter0" || + name == "TOBActiveRphi2" || name == "TOBActiveRphi4" )==0) std::cout <<"\nYou have added TOB layers that are not taken into account!\n\n"; + if (6siliconAPVNum(); + apv_tob += modules[i]->siliconAPVNum(); + if(tobZ_L[theLayer-1] < positionZ+length/2)tobZ_L[theLayer-1]=positionZ+length/2; + tobR_L[theLayer-1] += polarRadius/10; // cm + std::string side; + std::string part; + side = (theRod[0] == 1 ) ? "-" : "+"; + Output << " TOB" << side << "\t" << "Layer " << theLayer + << "\t" << "rod " << theRod[1] << " module " << theModule << "\t" << name << "\t" ; + if ( fromDDD_ && printDDD_ ) { + Output << "son of " << gdei->parents()[gdei->parents().size()-3].logicalPart().name(); + } else { + Output << " NO DDD Hierarchy available "; + } + Output << " " << modules[i]->translation().X() << " \t" << modules[i]->translation().Y() << " \t" << modules[i]->translation().Z() << std::endl; + break; + } + + // TEC + case 6: + { + tecN++; + volume_tec+=volume; + weight_tec+=weight; + activeSurface_tec+=activeSurface; + std::string name = modules[i]->name().name(); + if(name == "TECModule0RphiActive") tec_r1_rphiN++; + if(name == "TECModule0StereoActive") tec_r1_sterN++; + if(name == "TECModule1RphiActive") tec_r2_rphiN++; + if(name == "TECModule1StereoActive") tec_r2_sterN++; + if(name == "TECModule2RphiActive") tec_r3_rphiN++; + if(name == "TECModule3RphiActive") tec_r4_rphiN++; + if(name == "TECModule4RphiActive") tec_r5_rphiN++; + if(name == "TECModule4StereoActive") tec_r5_sterN++; + if(name == "TECModule5RphiActive") tec_r6_rphiN++; + if(name == "TECModule6RphiActive") tec_r7_rphiN++; + + unsigned int theWheel = tTopo->tecWheel(rawid); + unsigned int theModule = tTopo->tecModule(rawid); + std::vector thePetal = tTopo->tecPetalInfo(rawid); + unsigned int theRing = tTopo->tecRing(rawid); + if(theWheel > nwheelsTEC) nwheelsTEC=theWheel; + if(name == "TECModule0RphiActive") tec_r1_rphi_D[theWheel-1]++; + if(name == "TECModule0StereoActive") tec_r1_ster_D[theWheel-1]++; + if(name == "TECModule1RphiActive") tec_r2_rphi_D[theWheel-1]++; + if(name == "TECModule1StereoActive") tec_r2_ster_D[theWheel-1]++; + if(name == "TECModule2RphiActive") tec_r3_rphi_D[theWheel-1]++; + if(name == "TECModule3RphiActive") tec_r4_rphi_D[theWheel-1]++; + if(name == "TECModule4RphiActive") tec_r5_rphi_D[theWheel-1]++; + if(name == "TECModule4StereoActive") tec_r5_ster_D[theWheel-1]++; + if(name == "TECModule5RphiActive") tec_r6_rphi_D[theWheel-1]++; + if(name == "TECModule6RphiActive") tec_r7_rphi_D[theWheel-1]++; + if((name == "TECModule0RphiActive" || name == "TECModule0StereoActive" || name == "TECModule1RphiActive" || name == "TECModule1StereoActive" || name == "TECModule2RphiActive" || + name == "TECModule3RphiActive" || name == "TECModule4RphiActive" || name == "TECModule4StereoActive" || name == "TECModule5RphiActive" || name == "TECModule6RphiActive" )==0) + std::cout <<"\nYou have added TOB layers that are not taken into account!,\t"<siliconAPVNum(); + apv_tec += modules[i]->siliconAPVNum(); + tecZ_D[theWheel-1] += positionZ; + polarRadius=polarRadius/10.; + if(tecR_min_D[theWheel-1] > polarRadius-length/2)tecR_min_D[theWheel-1] = polarRadius-length/2; + if(tecR_max_D[theWheel-1] < polarRadius+length/2)tecR_max_D[theWheel-1] = polarRadius+length/2; + std::string side; + std::string petal; + side = (tTopo->tecSide(rawid) == 1 ) ? "-" : "+"; + petal = (thePetal[0] == 1 ) ? "back" : "front"; + Output << " TEC" << side << "\t" << "Wheel " << theWheel << " Petal " << thePetal[1] << " " << petal << " Ring " << theRing << "\t" + << "\t" << " module " << theModule << "\t" << name << "\t"; + if ( fromDDD_ && printDDD_ ) { + Output << "son of " << gdei->parents()[gdei->parents().size()-3].logicalPart().name(); + } else { + Output << " NO DDD Hierarchy available "; + } + Output << " " << modules[i]->translation().X() << " \t" << modules[i]->translation().Y() << " \t" << modules[i]->translation().Z() << std::endl; + + // TEC output as Martin Weber's + int out_side = (tTopo->tecSide(rawid) == 1 ) ? -1 : 1; + unsigned int out_disk = tTopo->tecWheel(rawid); + unsigned int out_sector = thePetal[1]; + int out_petal = (thePetal[0] == 1 ) ? 1 : -1; + // swap sector numbers for TEC- + if (out_side == -1) { + // fine for back petals, substract 1 for front petals + if (out_petal == -1) { + out_sector = (out_sector+6) % 8 + 1; + } + } + unsigned int out_ring = tTopo->tecRing(rawid); + int out_sensor = 0; + if(name == "TECModule0RphiActive") out_sensor = -1; + if(name == "TECModule0StereoActive") out_sensor = 1; + if(name == "TECModule1RphiActive") out_sensor = -1; + if(name == "TECModule1StereoActive") out_sensor = 1; + if(name == "TECModule2RphiActive") out_sensor = -1; + if(name == "TECModule3RphiActive") out_sensor = -1; + if(name == "TECModule4RphiActive") out_sensor = -1; + if(name == "TECModule4StereoActive") out_sensor = 1; + if(name == "TECModule5RphiActive") out_sensor = -1; + if(name == "TECModule6RphiActive") out_sensor = -1; + unsigned int out_module; + if (out_ring == 1 || out_ring == 2 || out_ring == 5) { + // rings with stereo modules + // create number odd by default + out_module = 2*(tTopo->tecModule(rawid)-1)+1; + if (out_sensor == 1) { + // in even rings, stereo modules are the even ones + if (out_ring == 2) + out_module += 1; + } + else + // in odd rings, stereo modules are the odd ones + if (out_ring != 2) + out_module += 1; + } + else { + out_module = tTopo->tecModule(rawid); + } + double out_x = modules[i]->translation().X(); + double out_y = modules[i]->translation().Y(); + double out_z = modules[i]->translation().Z(); + double out_r = sqrt(modules[i]->translation().X()*modules[i]->translation().X() + + modules[i]->translation().Y()*modules[i]->translation().Y()); + double out_phi_rad = atan2(modules[i]->translation().Y(),modules[i]->translation().X()); + TECOutput << out_side << " " << out_disk << " " << out_sector << " " << out_petal + << " " << out_ring << " " << out_module << " " << out_sensor + << " " << out_x << " " << out_y << " " << out_z << " " << out_r << " " << out_phi_rad << std::endl; + // + break; + } + default: + Output << " WARNING no Silicon Strip detector, I got a " << rawid << std::endl;; + } + + // Local axes from Reco + const GeomDet* geomdet = pDD->idToDet(modules[i]->geographicalID()); + // Global Coordinates (i,j,k) + LocalVector xLocal(1,0,0); + LocalVector yLocal(0,1,0); + LocalVector zLocal(0,0,1); + // Versor components + GlobalVector xGlobal = (geomdet->surface()).toGlobal(xLocal); + GlobalVector yGlobal = (geomdet->surface()).toGlobal(yLocal); + GlobalVector zGlobal = (geomdet->surface()).toGlobal(zLocal); + // + + // Output: set as default 4 decimal digits (0.1 um or 0.1 deg/rad) + // active area center + Output << "\t" << "volume " << std::fixed << std::setprecision(3) << volume << " cm3 \t" + << "density " << std::fixed << std::setprecision(3) << density << " g/cm3 \t" + << "weight " << std::fixed << std::setprecision(6) << weight << " kg \t" + << "thickness " << std::fixed << std::setprecision(0) << thickness << " um \t" + << " active area " << std::fixed << std::setprecision(2) << activeSurface << " cm2" << std::endl; + Output << "\tActive Area Center" << std::endl; + Output << "\t O = (" << std::fixed << std::setprecision(4) << modules[i]->translation().X() + << "," << std::fixed << std::setprecision(4) << modules[i]->translation().Y() + << "," << std::fixed << std::setprecision(4) << modules[i]->translation().Z() + << ")" << std::endl; + // + //double polarRadius = std::sqrt(modules[i]->translation().X()*modules[i]->translation().X()+modules[i]->translation().Y()*modules[i]->translation().Y()); + double phiDeg = atan2(modules[i]->translation().Y(),modules[i]->translation().X()) * 360. / 6.283185307; + double phiRad = atan2(modules[i]->translation().Y(),modules[i]->translation().X()); + // + Output << "\t\t polar radius " + << std::fixed << std::setprecision(4) << polarRadius + << "\t" << "phi [deg] " + << std::fixed << std::setprecision(4) << phiDeg + << "\t" << "phi [rad] " + << std::fixed << std::setprecision(4) << phiRad + << std::endl; + // active area versors (rotation matrix) + DD3Vector x,y,z; + modules[i]->rotation().GetComponents(x,y,z); + Output << "\tActive Area Rotation Matrix" << std::endl; + Output << "\t z = n = (" << std::fixed << std::setprecision(4) << z.X() + << "," << std::fixed << std::setprecision(4) << z.Y() + << "," << std::fixed << std::setprecision(4) << z.Z() + << ")" << std::endl + << "\t [Rec] = (" << std::fixed << std::setprecision(4) << zGlobal.x() + << "," << std::fixed << std::setprecision(4) << zGlobal.y() + << "," << std::fixed << std::setprecision(4) << zGlobal.z() + << ")" << std::endl + << "\t x = t = (" << std::fixed << std::setprecision(4) << x.X() + << "," << std::fixed << std::setprecision(4) << x.Y() + << "," << std::fixed << std::setprecision(4) << x.Z() + << ")" << std::endl + << "\t [Rec] = (" << std::fixed << std::setprecision(4) << xGlobal.x() + << "," << std::fixed << std::setprecision(4) << xGlobal.y() + << "," << std::fixed << std::setprecision(4) << xGlobal.z() + << ")" << std::endl + << "\t y = k = (" << std::fixed << std::setprecision(4) << y.X() + << "," << std::fixed << std::setprecision(4) << y.Y() + << "," << std::fixed << std::setprecision(4) << y.Z() + << ")" << std::endl + << "\t [Rec] = (" << std::fixed << std::setprecision(4) << yGlobal.x() + << "," << std::fixed << std::setprecision(4) << yGlobal.y() + << "," << std::fixed << std::setprecision(4) << yGlobal.z() + << ")" << std::endl; + + // NumberingScheme + NumberingOutput << rawid; + + // if ( fromDDD_ && printDDD_ ) { + // NumberingOutput << " " << detNavType; + // } + //nav_type typedef changed in 3_6_2; comment out for now. idr 10/6/10 + + NumberingOutput << " " + << std::fixed << std::setprecision(4) << modules[i]->translation().X() << " " + << std::fixed << std::setprecision(4) << modules[i]->translation().Y() << " " + << std::fixed << std::setprecision(4) << modules[i]->translation().Z() << " " + << std::endl; + // + } + + // params + // Pixel + unsigned int chan_per_psiB[16] = {0},chan_per_psiD[16] = {0}; + double chan_pxb = 0.0; + double chan_strx12 = 0.0; + double chan_strx34 = 0.0; + double chan_pxf = 0.0; + unsigned int psi_pxbN=0, psi_pxb_strx12N=0, psi_pxb_strx34N=0, psi_pxfN=0; + for (int i=0;i<16;i++){ + chan_per_psiB[i] = (unsigned int)(thepixROCRowsB[i]*thepixROCColsB[i]); + chan_per_psiD[i] = (unsigned int)(thepixROCRowsD[i]*thepixROCColsD[i]); + chan_pxb += psi_pxb[i] *chan_per_psiB[i]; + chan_strx12 += psi_pxb_strx12[i]*chan_per_psiB[i]; + chan_strx34 += psi_pxb_strx34[i]*chan_per_psiB[i]; + chan_pxf += psi_pxf[i] *chan_per_psiD[i]; + psi_pxbN += (unsigned int)psi_pxb[i]; + psi_pxb_strx12N+= (unsigned int)psi_pxb_strx12[i]; + psi_pxb_strx34N+= (unsigned int)psi_pxb_strx34[i]; + psi_pxfN += (unsigned int)psi_pxf[i]; + } + + // Strip + unsigned int chan_per_apv = 128; + double chan_tib = apv_tib*chan_per_apv; + double chan_tid = apv_tid*chan_per_apv; + double chan_tob = apv_tob*chan_per_apv; + double chan_tec = apv_tec*chan_per_apv; + double psi_tot = psi_pxbN + psi_pxb_strx12N + psi_pxb_strx34N + psi_pxfN; + double apv_tot = apv_tib + apv_tid + apv_tob + apv_tec; + double chan_pixel = chan_pxb + chan_strx12 + chan_strx34 + chan_pxf; + double chan_strip = chan_tib + chan_tid + chan_tob + chan_tec; + double chan_tot = chan_pixel + chan_strip; + // + + // summary + Output << "---------------------" << std::endl; + Output << " Counters " << std::endl; + Output << "---------------------" << std::endl; + Output << " Total number of PXB layers = " << nlayersPXB << std::endl; + Output << " PXB Total = " << pxbN << std::endl; + Output << " Inner: Full = " << pxb_fullN << std::endl; + Output << " Inner: Half = " << pxb_halfN << std::endl; + Output << " Stacks = " << pxb_stackN << std::endl; + //Output << " Strx12: Full = " << pxb_full_strx12N << std::endl; + //Output << " Strx12: Half = " << pxb_half_strx12N << std::endl; + //Output << " Strx34: Full = " << pxb_full_strx34N << std::endl; + //Output << " Strx34: Half = " << pxb_half_strx34N << std::endl; + Output << " Active Silicon Detectors" << std::endl; + Output << " Weight = " << weight_pxb << " kg" << std::endl; + Output << " Volume = " << volume_pxb << " cm3" << std::endl; + Output << " Surface = " << activeSurface_pxb << " cm2" << std::endl; + Output << " NEED TO VERIFY THE NEXT 6 LINES!!!!!!!!!!!!!!!!! "<< std::endl; + Output << " PSI46s Inner = " << (int)psi_pxbN << std::endl; + Output << " PSI46s Strx12 = " << (int)psi_pxb_strx12N << std::endl; + Output << " PSI46s Strx34 = " << (int)psi_pxb_strx34N << std::endl; + Output << " channels Inner = " << (int)chan_pxb << std::endl; + Output << " channels Strx12 = " << (int)chan_strx12 << std::endl; + Output << " channels Strx34 = " << (int)chan_strx34 << std::endl; + Output << " PXF = " << pxfN << std::endl; + Output << " PH1 = " << pxf_D_N << std::endl; + Output << " 1x2 = " << pxf_1x2N << std::endl; + Output << " 1x5 = " << pxf_1x5N << std::endl; + Output << " 2x3 = " << pxf_2x3N << std::endl; + Output << " 2x4 = " << pxf_2x4N << std::endl; + Output << " 2x5 = " << pxf_2x5N << std::endl; + Output << " Active Silicon Detectors" << std::endl; + Output << " Weight = " << weight_pxf << " kg" << std::endl; + Output << " Volume = " << volume_pxf << " cm3" << std::endl; + Output << " Surface = " << activeSurface_pxf << " cm2" << std::endl; + Output << " PSI46s = " << (int)psi_pxfN << std::endl; + Output << " channels = " << (int)chan_pxf << std::endl; + Output << " TIB = " << tibN << std::endl; + Output << " L12 rphi = " << tib_L12_rphiN << std::endl; + Output << " L12 stereo = " << tib_L12_sterN << std::endl; + Output << " L34 = " << tib_L34_rphiN << std::endl; + Output << " Active Silicon Detectors" << std::endl; + Output << " Weight = " << weight_tib << " kg" << std::endl; + Output << " Volume = " << volume_tib << " cm3" << std::endl; + Output << " Surface = " << activeSurface_tib << " cm2" << std::endl; + Output << " APV25s = " << (int)apv_tib << std::endl; + Output << " channels = " << (int)chan_tib << std::endl; + Output << " TID = " << tidN << std::endl; + Output << " r1 rphi = " << tid_r1_rphiN << std::endl; + Output << " r1 stereo = " << tid_r1_sterN << std::endl; + Output << " r2 rphi = " << tid_r2_rphiN << std::endl; + Output << " r2 stereo = " << tid_r2_sterN << std::endl; + Output << " r3 rphi = " << tid_r3_rphiN << std::endl; + Output << " Active Silicon Detectors" << std::endl; + Output << " Weight = " << weight_tid << " kg" << std::endl; + Output << " Volume = " << volume_tid << " cm3" << std::endl;; + Output << " Surface = " << activeSurface_tid << " cm2" << std::endl; + Output << " APV25s = " << (int)apv_tid << std::endl; + Output << " channels = " << (int)chan_tid << std::endl; + Output << " TOB = " << tobN << std::endl; + Output << " L12 rphi = " << tob_L12_rphiN << std::endl; + Output << " L12 stereo = " << tob_L12_sterN << std::endl; + Output << " L34 = " << tob_L34_rphiN << std::endl; + Output << " L56 = " << tob_L56_rphiN << std::endl; + Output << " Active Silicon Detectors" << std::endl; + Output << " Weight = " << weight_tob << " kg" << std::endl; + Output << " Volume = " << volume_tob << " cm3" << std::endl; + Output << " Surface = " << activeSurface_tob << " cm2" << std::endl; + Output << " APV25s = " << (int)apv_tob << std::endl; + Output << " channels = " << (int)chan_tob << std::endl; + Output << " TEC = " << tecN << std::endl; + Output << " r1 rphi = " << tec_r1_rphiN << std::endl; + Output << " r1 stereo = " << tec_r1_sterN << std::endl; + Output << " r2 rphi = " << tec_r2_rphiN << std::endl; + Output << " r2 stereo = " << tec_r2_sterN << std::endl; + Output << " r3 rphi = " << tec_r3_rphiN << std::endl; + Output << " r4 rphi = " << tec_r4_rphiN << std::endl; + Output << " r5 rphi = " << tec_r5_rphiN << std::endl; + Output << " r5 stereo = " << tec_r5_sterN << std::endl; + Output << " r6 rphi = " << tec_r6_rphiN << std::endl; + Output << " r7 rphi = " << tec_r7_rphiN << std::endl; + Output << " Active Silicon Detectors" << std::endl; + Output << " Weight = " << weight_tec << " kg" << std::endl; + Output << " Volume = " << volume_tec << " cm3" << std::endl; + Output << " Surface = " << activeSurface_tec << " cm2" << std::endl; + Output << " APV25s = " << (int)apv_tec << std::endl; + Output << " channels = " << (int)chan_tec << std::endl; + Output << "---------------------" << std::endl; + Output << " Total Weight = " << weight_total << " kg" << std::endl; + Output << " Total Volume = " << volume_total << " cm3" << std::endl; + Output << " Total Active Area = " << activeSurface_total << " cm2" << std::endl; + Output << " PSI46s = " << (int)psi_tot << std::endl; + Output << " APV25s = " << (int)apv_tot << std::endl; + Output << " pixel channels = " << (int)chan_pixel << std::endl; + Output << " strip channels = " << (int)chan_strip << std::endl; + Output << " total channels = " << (int)chan_tot << std::endl; + // + for(unsigned int i=0; i rDD; - edm::ESHandle > rDDE; - //if (fromDDD_) { - iSetup.get().get( rDD ); - iSetup.get().get( rDDE ); - //} else { - // iSetup.get().get( rDD ); - //} - edm::LogInfo("ModuleInfo_Phase2") << " Top node is " << rDD.product() << " " << rDD.product()->name().name() << std::endl; - edm::LogInfo("ModuleInfo_Phase2") << " And Contains Daughters: " << rDD.product()->deepComponents().size() << std::endl; - CmsTrackerDebugNavigator nav(*rDDE.product()); - nav.dump(*rDD.product(), *rDDE.product()); - // - //first instance tracking geometry - edm::ESHandle pDD; - iSetup.get ().get (pDD); - // - - // counters - //unsigned int MAXPXBLAY = 8; - unsigned int pxbN = 0; - unsigned int pxb_fullN = 0; - unsigned int pxb_halfN = 0; - unsigned int pxb_stackN = 0; - //unsigned int pxb_full_strx12N = 0; - //unsigned int pxb_half_strx12N = 0; - //unsigned int pxb_full_strx34N = 0; - //unsigned int pxb_half_strx34N = 0; - unsigned int pxb_full_L[16]= { 0 }; - unsigned int pxb_half_L[16]= { 0 }; - unsigned int pxb_stack[16]= { 0 }; - double psi_pxb_L[16]= { 0 }; - double psi_pxb[16] = { 0 }; - double psi_pxb_strx12[16] = { 0 }; - double psi_pxb_strx34[16] = { 0 }; - double pxbR_L[16] = { 0.0 }; - double pxbZ_L[16] = { 0.0 }; - double pxbpitchx[16] = { 0.0 }; - double pxbpitchy[16] = { 0.0 }; - unsigned int pxfN = 0; - unsigned int pxf_D_N = 0; - unsigned int pxf_1x2N = 0; - unsigned int pxf_1x5N = 0; - unsigned int pxf_2x3N = 0; - unsigned int pxf_2x4N = 0; - unsigned int pxf_2x5N = 0; - unsigned int pxf_D[6] = { 0 }; - unsigned int pxf_1x2_D[6] = { 0 }; - unsigned int pxf_1x5_D[6] = { 0 }; - unsigned int pxf_2x3_D[6] = { 0 }; - unsigned int pxf_2x4_D[6] = { 0 }; - unsigned int pxf_2x5_D[6] = { 0 }; - double pxfpitchx[6] = { 0 }; - double pxfpitchy[6] = { 0 }; - double psi_pxf_D[6]= { 0 }; - double psi_pxf[16] = { 0 }; - double pxfR_min_D[6] = { 9999.0 , 9999.0 , 9999.0 }; - double pxfR_max_D[6] = { 0.0 }; - double pxfZ_D[6] = { 0.0 }; - unsigned int tibN = 0; - unsigned int tib_L12_rphiN = 0; - unsigned int tib_L12_sterN = 0; - unsigned int tib_L34_rphiN = 0; - unsigned int tib_L12_rphi_L[6] = { 0 }; - unsigned int tib_L12_ster_L[6] = { 0 }; - unsigned int tib_L34_rphi_L[6] = { 0 }; - double tib_apv_L[6] = { 0 }; - double apv_tib = 0; - double tibR_L[6] = { 0.0 }; - double tibZ_L[6] = { 0.0 }; - unsigned int tidN = 0; - unsigned int tid_r1_rphiN = 0; - unsigned int tid_r1_sterN = 0; - unsigned int tid_r2_rphiN = 0; - unsigned int tid_r2_sterN = 0; - unsigned int tid_r3_rphiN = 0; - unsigned int tid_r1_rphi_D[3] = { 0 }; - unsigned int tid_r1_ster_D[3] = { 0 }; - unsigned int tid_r2_rphi_D[3] = { 0 }; - unsigned int tid_r2_ster_D[3] = { 0 }; - unsigned int tid_r3_rphi_D[3] = { 0 }; - double tid_apv_D[3] = { 0 }; - double apv_tid =0; - double tidR_min_D[3] = { 9999.0 , 9999.0 , 9999.0 }; - double tidR_max_D[3] = { 0.0 }; - double tidZ_D[3] = { 0.0 }; - unsigned int tobN = 0; - unsigned int tob_L12_rphiN = 0; - unsigned int tob_L12_sterN = 0; - unsigned int tob_L34_rphiN = 0; - unsigned int tob_L56_rphiN = 0; - unsigned int tob_L12_rphi_L[6] = { 0 }; - unsigned int tob_L12_ster_L[6] = { 0 }; - unsigned int tob_L34_rphi_L[6] = { 0 }; - unsigned int tob_L56_rphi_L[6] = { 0 }; - double tob_apv_L[6] = { 0 }; - double apv_tob = 0; - double tobR_L[6] = { 0.0 }; - double tobZ_L[6] = { 0.0 }; - unsigned int tecN = 0; - unsigned int tec_r1_rphiN = 0; - unsigned int tec_r1_sterN = 0; - unsigned int tec_r2_rphiN = 0; - unsigned int tec_r2_sterN = 0; - unsigned int tec_r3_rphiN = 0; - unsigned int tec_r4_rphiN = 0; - unsigned int tec_r5_rphiN = 0; - unsigned int tec_r5_sterN = 0; - unsigned int tec_r6_rphiN = 0; - unsigned int tec_r7_rphiN = 0; - unsigned int tec_r1_rphi_D[9] = { 0 }; - unsigned int tec_r1_ster_D[9] = { 0 }; - unsigned int tec_r2_rphi_D[9] = { 0 }; - unsigned int tec_r2_ster_D[9] = { 0 }; - unsigned int tec_r3_rphi_D[9] = { 0 }; - unsigned int tec_r4_rphi_D[9] = { 0 }; - unsigned int tec_r5_rphi_D[9] = { 0 }; - unsigned int tec_r5_ster_D[9] = { 0 }; - unsigned int tec_r6_rphi_D[9] = { 0 }; - unsigned int tec_r7_rphi_D[9] = { 0 }; - double tec_apv_D[9] = { 0 }; - double apv_tec =0; - double tecR_min_D[9] = { 9999.0 , 9999.0 , 9999.0 , 9999.0 , 9999.0 , 9999.0 , 9999.0 , 9999.0 , 9999.0 }; - double tecR_max_D[9] = { 0.0 }; - double tecZ_D[9] = { 0.0 }; - double thepixROCRowsB[16] = {0.0}; - double thepixROCColsB[16] = {0.0}; - double thepixROCRowsD[16] = {0.0}; - double thepixROCColsD[16] = {0.0}; - // - double volume_total = 0.0; - double weight_total = 0.0; - double activeSurface_total = 0.0; - double volume_pxb = 0.0; - double weight_pxb = 0.0; - double activeSurface_pxb = 0.0; - double activeSurface_pxb_L[16] = {0.0}; - double volume_pxf = 0.0; - double weight_pxf = 0.0; - double activeSurface_pxf = 0.0; - double activeSurface_pxf_D[6] = {0.0}; - double volume_tib = 0.0; - double weight_tib = 0.0; - double activeSurface_tib = 0.0; - double activeSurface_tib_L[4] = {0.0}; - double volume_tid = 0.0; - double weight_tid = 0.0; - double activeSurface_tid = 0.0; - double activeSurface_tid_D[3] = {0.0}; - double volume_tob = 0.0; - double weight_tob = 0.0; - double activeSurface_tob = 0.0; - double activeSurface_tob_L[6] = {0.0}; - double volume_tec = 0.0; - double weight_tec = 0.0; - double activeSurface_tec = 0.0; - double activeSurface_tec_D[9] = {0.0}; - // - unsigned int nlayersPXB = 0; // number of layers - unsigned int nlayersTIB = 0; // number of layers - unsigned int nlayersTOB = 0; // number of layers - unsigned int ndisksPXF = 0; - unsigned int ndisksTID = 0; - unsigned int nwheelsTEC = 0; - - std::vector modules = (*rDD).deepComponents(); - Output << "************************ List of modules with positions ************************" << std::endl; - // MEC: 2010-04-13: need to find corresponding GeometricDetExtra. - std::vector::const_iterator gdei(rDDE->begin()), gdeEnd(rDDE->end()); - for(unsigned int i=0; igeographicalID().rawId(); - gdei = rDDE->begin(); - for (; gdei != gdeEnd; ++gdei) { - if (gdei->geographicalId() == modules[i]->geographicalId()) break; - } - - if (gdei == gdeEnd) throw cms::Exception("ModuleInfo") << "THERE IS NO MATCHING DetId in the GeometricDetExtra"; //THIS never happens! - - GeometricDet::nav_type detNavType = modules[i]->navType(); - Output << std::fixed << std::setprecision(6); // set as default 6 decimal digits - std::bitset<32> binary_rawid(rawid); - Output << " ******** raw Id = " << rawid << " (" << binary_rawid << ") "; - - // if ( fromDDD_ && printDDD_ ) { - // Output << "\t nav type = " << detNavType; - // } - //nav_type typedef changed in 3_6_2; comment out for now. idr 10/6/10 - - Output << std::endl; - int subdetid = modules[i]->geographicalID().subdetId(); - double volume = gdei->volume() / 1000; // mm3->cm3 - double density = gdei->density() / density_units; - double weight = gdei->weight() / density_units / 1000.; // [kg], hence the factor 1000; - double thickness = modules[i]->bounds()->thickness() * 10000; // cm-->um - double length = (modules[i]->bounds()->length()); // already in cm - //double width = (modules[i]->bounds()->width()); // already in cm - double activeSurface = volume / ( thickness / 10000 ); // cm2 (thickness in um) - double polarRadius = std::sqrt(modules[i]->translation().X()*modules[i]->translation().X()+modules[i]->translation().Y()*modules[i]->translation().Y()); - double positionZ = std::abs(modules[i]->translation().Z())/10.; //cm - volume_total+=volume; - weight_total+=weight; - activeSurface_total+=activeSurface; - - switch (subdetid) { - - // PXB - case 1: - { - pxbN++; - volume_pxb+=volume; - weight_pxb+=weight; - activeSurface_pxb+=activeSurface; - std::string name = modules[i]->name().name(); - if(name == "PixelBarrelActiveFull" || name == "PixelBarrelActiveFull0" || name == "PixelBarrelActiveFull1" || - name == "PixelBarrelActiveFull2" || name == "PixelBarrelActiveFull3" - ) pxb_fullN++; - if(name == "PixelBarrelActiveHalf" || name == "PixelBarrelActiveHalf1") pxb_halfN++; - if(name == "PixelBarrelActiveStack0" || name == "PixelBarrelActiveStack1" || name == "PixelBarrelActiveStack2" || name == "PixelBarrelActiveStack3" || - name == "PixelBarrelActiveStack4" || name == "PixelBarrelActiveStack5" || name == "PixelBarrelActiveStack6" || name == "PixelBarrelActiveStack7" || - name == "PixelBarrelActiveStack8" || name == "PixelBarrelActiveStack9" ) pxb_stackN++; - //if(name == "PixelBarrelActiveFull2") pxb_full_strx12N++; // Outdated ? - //if(name == "PixelBarrelActiveHalf2") pxb_half_strx12N++; - //if(name == "PixelBarrelActiveFull3") pxb_full_strx34N++; - //if(name == "PixelBarrelActiveHalf3") pxb_half_strx34N++; - - unsigned int theLayer = tTopo->pxbLayer(rawid); - unsigned int theLadder = tTopo->pxbLadder(rawid); - unsigned int theModule = tTopo->pxbModule(rawid); - thepixROCRowsB[theLayer-1] = modules[i]->pixROCRows(); - thepixROCColsB[theLayer-1] = modules[i]->pixROCCols(); - { - const DetId& detid =modules[i]->geographicalID(); - DetId detIdObject( detid ); - const GeomDetUnit * genericDet = pDD->idToDetUnit( detIdObject ); - const PixelGeomDetUnit * pixDet = dynamic_cast(genericDet); - //std::cout << " "<<__LINE__<<" PixelGeomDetUnit "<surface().position().perp()<<" , "<surface().position().z()<<"\n"; - const PixelTopology * theTopol = &(pixDet->specificTopology()); - std::pair pitchxy = theTopol->pitch(); - pxbpitchx[theLayer-1] = double(int(0.5+(10000*pitchxy.first ))); - pxbpitchy[theLayer-1] = double(int(0.5+(10000*pitchxy.second))); - //std::cout<<" "<<" BPix Layer "<< theLayer << " with Pitch = " << pxbpitchx[theLayer-1]<<" , "< nlayersPXB) nlayersPXB=theLayer; - // The following sums will need to be verified... - if(name == "PixelBarrelActiveFull" || name == "PixelBarrelActiveFull0" || name == "PixelBarrelActiveFull1" || name == "PixelBarrelActiveFull2" || name == "PixelBarrelActiveFull3" ) pxb_full_L[theLayer-1]++; - if(name == "PixelBarrelActiveHalf" || name == "PixelBarrelActiveHalf1" || name == "PixelBarrelActiveHalf2" || name == "PixelBarrelActiveHalf3" ) pxb_half_L[theLayer-1]++; - if(name == "PixelBarrelActiveStack0" || name == "PixelBarrelActiveStack1" || name == "PixelBarrelActiveStack2" || name == "PixelBarrelActiveStack3" || - name == "PixelBarrelActiveStack4" || name == "PixelBarrelActiveStack5" || name == "PixelBarrelActiveStack6" || name == "PixelBarrelActiveStack7" || - name == "PixelBarrelActiveStack8" || name == "PixelBarrelActiveStack9" ) pxb_stack[theLayer-1]++; - if(name == "PixelBarrelActiveFull" || name == "PixelBarrelActiveHalf" || name == "PixelBarrelActiveFull0" || - name == "PixelBarrelActiveFull1" || name == "PixelBarrelActiveHalf1" || - name == "PixelBarrelActiveStack0" || name == "PixelBarrelActiveStack1" || name == "PixelBarrelActiveStack2" || name == "PixelBarrelActiveStack3" || - name == "PixelBarrelActiveStack4" || name == "PixelBarrelActiveStack5" || name == "PixelBarrelActiveStack6" || name == "PixelBarrelActiveStack7" || - name == "PixelBarrelActiveStack8" || name == "PixelBarrelActiveStack9" ) psi_pxb[theLayer-1] += modules[i]->pixROCx()*modules[i]->pixROCy(); - - - - if(name == "PixelBarrelActiveFull2" || name == "PixelBarrelActiveHalf2" )psi_pxb_strx12[theLayer-1] += modules[i]->pixROCx()*modules[i]->pixROCy(); - if(name == "PixelBarrelActiveFull3" || name == "PixelBarrelActiveHalf3" )psi_pxb_strx34[theLayer-1] += modules[i]->pixROCx()*modules[i]->pixROCy(); - - // Make sure there are no new names we didn't know about. - if((name == "PixelBarrelActiveStack0" || name == "PixelBarrelActiveStack1" || name == "PixelBarrelActiveStack2" || name == "PixelBarrelActiveStack3" || - name == "PixelBarrelActiveStack4" || name == "PixelBarrelActiveStack5" || name == "PixelBarrelActiveStack6" || name == "PixelBarrelActiveStack7" || - name == "PixelBarrelActiveStack8" || name == "PixelBarrelActiveStack9" || name == "PixelBarrelActiveFull" || name == "PixelBarrelActiveFull1" || - name == "PixelBarrelActiveHalf" || name == "PixelBarrelActiveHalf1" || name == "PixelBarrelActiveFull2" || name == "PixelBarrelActiveHalf2" || - name == "PixelBarrelActiveFull3" || name == "PixelBarrelActiveHalf3" || name == "PixelBarrelActiveFull0" )==0) std::cout <<"\nYou have added PXB layers that are not taken into account! \ti.e. "<pixROCx()*modules[i]->pixROCy(); - - if(pxbZ_L[theLayer-1] < positionZ+length/2)pxbZ_L[theLayer-1]=positionZ+length/2; - pxbR_L[theLayer-1] += polarRadius/10; // cm - Output << " PXB" << "\t" << "Layer " << theLayer << " Ladder " << theLadder - << "\t" << " module " << theModule << " " << name << "\t"; - if ( fromDDD_ && printDDD_ ) { - Output << "son of " << gdei->parents()[gdei->parents().size()-3].logicalPart().name() << std::endl; - } else { - Output << " NO DDD Hierarchy available " << std::endl; - } - break; - } - - // PXF - case 2: - { - pxfN++; - volume_pxf+=volume; - weight_pxf+=weight; - activeSurface_pxf+=activeSurface; - std::string name = modules[i]->name().name(); - if(name == "PixelForwardSensor" || - name == "PixelForwardSensor1"|| name == "PixelForwardSensor2"|| name == "PixelForwardSensor3" - ) pxf_D_N++; - if(name == "PixelForwardActive1x2") pxf_1x2N++; - if(name == "PixelForwardActive1x5") pxf_1x5N++; - if(name == "PixelForwardActive2x3") pxf_2x3N++; - if(name == "PixelForwardActive2x4") pxf_2x4N++; - if(name == "PixelForwardActive2x5") pxf_2x5N++; - - unsigned int thePanel = tTopo->pxfPanel(rawid); - unsigned int theDisk = tTopo->pxfDisk(rawid); - unsigned int theBlade = tTopo->pxfBlade(rawid); - unsigned int theModule = tTopo->pxfModule(rawid); - thepixROCRowsD[theDisk-1] = modules[i]->pixROCRows(); - thepixROCColsD[theDisk-1] = modules[i]->pixROCCols(); - { - const DetId& detid =modules[i]->geographicalID(); - DetId detIdObject( detid ); - const GeomDetUnit * genericDet = pDD->idToDetUnit( detIdObject ); - const PixelGeomDetUnit * pixDet = dynamic_cast(genericDet); - const PixelTopology * theTopol = &(pixDet->specificTopology()); - std::pair pitchxy = theTopol->pitch(); - pxfpitchx[theDisk-1] = double(int(0.5+(10000*pitchxy.first ))); - pxfpitchy[theDisk-1] = double(int(0.5+(10000*pitchxy.second))); - } // Discard some transitional variables. - if(theDisk > ndisksPXF) ndisksPXF=theDisk; - if(name == "PixelForwardSensor" || - name == "PixelForwardSensor1"|| name == "PixelForwardSensor2"|| name == "PixelForwardSensor3" - ) pxf_D[theDisk-1]++; - if(name == "PixelForwardActive1x2") pxf_1x2_D[theDisk-1]++; - if(name == "PixelForwardActive1x5") pxf_1x5_D[theDisk-1]++; - if(name == "PixelForwardActive2x3") pxf_2x3_D[theDisk-1]++; - if(name == "PixelForwardActive2x4") pxf_2x4_D[theDisk-1]++; - if(name == "PixelForwardActive2x5") pxf_2x5_D[theDisk-1]++; - // Make sure there are no new names we didn't know about. - if((name == "PixelForwardSensor" || name == "PixelForwardActive1x2" || name == "PixelForwardActive1x5" || - name == "PixelForwardActive2x3" || name == "PixelForwardActive2x4" || name == "PixelForwardActive2x5" || - name == "PixelForwardSensor1"|| name == "PixelForwardSensor2"|| name == "PixelForwardSensor3" - )==0) std::cout <<"\nYou have added PXF layers that are not taken into account! \ti.e. "<pixROCx()*modules[i]->pixROCy(); - psi_pxf[theDisk-1] += modules[i]->pixROCx()*modules[i]->pixROCy(); - pxfZ_D[theDisk-1] += positionZ; - polarRadius=polarRadius/10.; - if(pxfR_min_D[theDisk-1] > polarRadius-length/2)pxfR_min_D[theDisk-1] = polarRadius-length/2; - if(pxfR_max_D[theDisk-1] < polarRadius+length/2)pxfR_max_D[theDisk-1] = polarRadius+length/2; - std::string side; - side = (tTopo->pxfSide(rawid) == 1 ) ? "-" : "+"; - Output << " PXF" << side << "\t" << "Disk " << theDisk << " Blade " << theBlade << " Panel " << thePanel - << "\t" << " module " << theModule << "\t" << name << "\t"; - if ( fromDDD_ && printDDD_ ) { - Output << "son of " << gdei->parents()[gdei->parents().size()-3].logicalPart().name() << std::endl; - } else { - Output << " NO DDD Hierarchy available " << std::endl; - } - break; - } - - // TIB - case 3: - { - tibN++; - volume_tib+=volume; - weight_tib+=weight; - activeSurface_tib+=activeSurface; - std::string name = modules[i]->name().name(); - if(name == "TIBActiveRphi0") tib_L12_rphiN++; - if(name == "TIBActiveSter0") tib_L12_sterN++; - if(name == "TIBActiveRphi2") tib_L34_rphiN++; - - unsigned int theLayer = tTopo->tibLayer(rawid); - std::vector theString = tTopo->tibStringInfo(rawid); - unsigned int theModule = tTopo->tibModule(rawid); - if(theLayer > nlayersTIB) nlayersTIB=theLayer; - if(name == "TIBActiveRphi0") tib_L12_rphi_L[theLayer-1]++; - if(name == "TIBActiveSter0") tib_L12_ster_L[theLayer-1]++; - if(name == "TIBActiveRphi2") tib_L34_rphi_L[theLayer-1]++; - if((name == "TIBActiveRphi0" || name == "TIBActiveSter0" || name == "TIBActiveRphi2" )==0) std::cout <<"\nYou have added TIB layers that are not taken into account!\n\n"; - if (6siliconAPVNum(); - apv_tib += modules[i]->siliconAPVNum(); - if(tibZ_L[theLayer-1] < positionZ+length/2)tibZ_L[theLayer-1]=positionZ+length/2; - tibR_L[theLayer-1] += polarRadius/10; // cm - std::string side; - std::string part; - side = (theString[0] == 1 ) ? "-" : "+"; - part = (theString[1] == 1 ) ? "int" : "ext"; - - Output << " TIB" << side << "\t" << "Layer " << theLayer << " " << part - << "\t" << "string " << theString[2] << "\t" << " module " << theModule << " " << name << "\t"; - if ( fromDDD_ && printDDD_ ) { - Output << "son of " << gdei->parents()[gdei->parents().size()-3].logicalPart().name(); - } else { - Output << " NO DDD Hierarchy available "; - } - Output << " " << modules[i]->translation().X() << " \t" << modules[i]->translation().Y() << " \t" << modules[i]->translation().Z() << std::endl; - break; - } - - // TID - case 4: - { - tidN++; - volume_tid+=volume; - weight_tid+=weight; - activeSurface_tid+=activeSurface; - std::string name = modules[i]->name().name(); - if(name == "TIDModule0RphiActive") tid_r1_rphiN++; - if(name == "TIDModule0StereoActive") tid_r1_sterN++; - if(name == "TIDModule1RphiActive") tid_r2_rphiN++; - if(name == "TIDModule1StereoActive") tid_r2_sterN++; - if(name == "TIDModule2RphiActive") tid_r3_rphiN++; - - unsigned int theDisk = tTopo->tidWheel(rawid); - unsigned int theRing = tTopo->tidRing(rawid); - std::vector theModule = tTopo->tidModuleInfo(rawid); - if(theDisk > ndisksTID) ndisksTID=theDisk; - if(name == "TIDModule0RphiActive") tid_r1_rphi_D[theDisk-1]++; - if(name == "TIDModule0StereoActive") tid_r1_ster_D[theDisk-1]++; - if(name == "TIDModule1RphiActive") tid_r2_rphi_D[theDisk-1]++; - if(name == "TIDModule1StereoActive") tid_r2_ster_D[theDisk-1]++; - if(name == "TIDModule2RphiActive") tid_r3_rphi_D[theDisk-1]++; - if((name == "TIDModule0RphiActive" || name == "TIDModule0StereoActive" || name == "TIDModule1RphiActive" || - name == "TIDModule1StereoActive" || name == "TIDModule2RphiActive" )==0) std::cout <<"\nYou have added TID layers that are not taken into account!\n\n"; - if (3siliconAPVNum(); - apv_tid += modules[i]->siliconAPVNum(); - tidZ_D[theDisk-1] += positionZ; - polarRadius=polarRadius/10.; - if(tidR_min_D[theDisk-1] > polarRadius-length/2)tidR_min_D[theDisk-1] = polarRadius-length/2; - if(tidR_max_D[theDisk-1] < polarRadius+length/2)tidR_max_D[theDisk-1] = polarRadius+length/2; - std::string side; - std::string part; - side = (tTopo->tidSide(rawid) == 1 ) ? "-" : "+"; - part = (theModule[0] == 1 ) ? "back" : "front"; - Output << " TID" << side << "\t" << "Disk " << theDisk << " Ring " << theRing << " " << part - << "\t" << " module " << theModule[1] << "\t" << name << "\t"; - if ( fromDDD_ && printDDD_ ) { - Output << "son of " << gdei->parents()[gdei->parents().size()-3].logicalPart().name(); - } else { - Output << " NO DDD Hierarchy available "; - } - Output << " " << modules[i]->translation().X() << " \t" << modules[i]->translation().Y() << " \t" << modules[i]->translation().Z() << std::endl; - break; - } - - // TOB - case 5: - { - tobN++; - volume_tob+=volume; - weight_tob+=weight; - activeSurface_tob+=activeSurface; - std::string name = modules[i]->name().name(); - if(name == "TOBActiveRphi0") tob_L12_rphiN++; - if(name == "TOBActiveSter0") tob_L12_sterN++; - if(name == "TOBActiveRphi2") tob_L34_rphiN++; - if(name == "TOBActiveRphi4") tob_L56_rphiN++; - - unsigned int theLayer = tTopo->tobLayer(rawid); - std::vector theRod = tTopo->tobRodInfo(rawid); - unsigned int theModule = tTopo->tobModule(rawid); - if(theLayer > nlayersTOB) nlayersTOB=theLayer; - if(name == "TOBActiveRphi0") tob_L12_rphi_L[theLayer-1]++; - if(name == "TOBActiveSter0") tob_L12_ster_L[theLayer-1]++; - if(name == "TOBActiveRphi2") tob_L34_rphi_L[theLayer-1]++; - if(name == "TOBActiveRphi4") tob_L56_rphi_L[theLayer-1]++; - if((name == "TOBActiveRphi0" || name == "TOBActiveSter0" || - name == "TOBActiveRphi2" || name == "TOBActiveRphi4" )==0) std::cout <<"\nYou have added TOB layers that are not taken into account!\n\n"; - if (6siliconAPVNum(); - apv_tob += modules[i]->siliconAPVNum(); - if(tobZ_L[theLayer-1] < positionZ+length/2)tobZ_L[theLayer-1]=positionZ+length/2; - tobR_L[theLayer-1] += polarRadius/10; // cm - std::string side; - std::string part; - side = (theRod[0] == 1 ) ? "-" : "+"; - Output << " TOB" << side << "\t" << "Layer " << theLayer - << "\t" << "rod " << theRod[1] << " module " << theModule << "\t" << name << "\t" ; - if ( fromDDD_ && printDDD_ ) { - Output << "son of " << gdei->parents()[gdei->parents().size()-3].logicalPart().name(); - } else { - Output << " NO DDD Hierarchy available "; - } - Output << " " << modules[i]->translation().X() << " \t" << modules[i]->translation().Y() << " \t" << modules[i]->translation().Z() << std::endl; - break; - } - - // TEC - case 6: - { - tecN++; - volume_tec+=volume; - weight_tec+=weight; - activeSurface_tec+=activeSurface; - std::string name = modules[i]->name().name(); - if(name == "TECModule0RphiActive") tec_r1_rphiN++; - if(name == "TECModule0StereoActive") tec_r1_sterN++; - if(name == "TECModule1RphiActive") tec_r2_rphiN++; - if(name == "TECModule1StereoActive") tec_r2_sterN++; - if(name == "TECModule2RphiActive") tec_r3_rphiN++; - if(name == "TECModule3RphiActive") tec_r4_rphiN++; - if(name == "TECModule4RphiActive") tec_r5_rphiN++; - if(name == "TECModule4StereoActive") tec_r5_sterN++; - if(name == "TECModule5RphiActive") tec_r6_rphiN++; - if(name == "TECModule6RphiActive") tec_r7_rphiN++; - - unsigned int theWheel = tTopo->tecWheel(rawid); - unsigned int theModule = tTopo->tecModule(rawid); - std::vector thePetal = tTopo->tecPetalInfo(rawid); - unsigned int theRing = tTopo->tecRing(rawid); - if(theWheel > nwheelsTEC) nwheelsTEC=theWheel; - if(name == "TECModule0RphiActive") tec_r1_rphi_D[theWheel-1]++; - if(name == "TECModule0StereoActive") tec_r1_ster_D[theWheel-1]++; - if(name == "TECModule1RphiActive") tec_r2_rphi_D[theWheel-1]++; - if(name == "TECModule1StereoActive") tec_r2_ster_D[theWheel-1]++; - if(name == "TECModule2RphiActive") tec_r3_rphi_D[theWheel-1]++; - if(name == "TECModule3RphiActive") tec_r4_rphi_D[theWheel-1]++; - if(name == "TECModule4RphiActive") tec_r5_rphi_D[theWheel-1]++; - if(name == "TECModule4StereoActive") tec_r5_ster_D[theWheel-1]++; - if(name == "TECModule5RphiActive") tec_r6_rphi_D[theWheel-1]++; - if(name == "TECModule6RphiActive") tec_r7_rphi_D[theWheel-1]++; - if((name == "TECModule0RphiActive" || name == "TECModule0StereoActive" || name == "TECModule1RphiActive" || name == "TECModule1StereoActive" || name == "TECModule2RphiActive" || - name == "TECModule3RphiActive" || name == "TECModule4RphiActive" || name == "TECModule4StereoActive" || name == "TECModule5RphiActive" || name == "TECModule6RphiActive" )==0) - std::cout <<"\nYou have added TOB layers that are not taken into account!,\t"<siliconAPVNum(); - apv_tec += modules[i]->siliconAPVNum(); - tecZ_D[theWheel-1] += positionZ; - polarRadius=polarRadius/10.; - if(tecR_min_D[theWheel-1] > polarRadius-length/2)tecR_min_D[theWheel-1] = polarRadius-length/2; - if(tecR_max_D[theWheel-1] < polarRadius+length/2)tecR_max_D[theWheel-1] = polarRadius+length/2; - std::string side; - std::string petal; - side = (tTopo->tecSide(rawid) == 1 ) ? "-" : "+"; - petal = (thePetal[0] == 1 ) ? "back" : "front"; - Output << " TEC" << side << "\t" << "Wheel " << theWheel << " Petal " << thePetal[1] << " " << petal << " Ring " << theRing << "\t" - << "\t" << " module " << theModule << "\t" << name << "\t"; - if ( fromDDD_ && printDDD_ ) { - Output << "son of " << gdei->parents()[gdei->parents().size()-3].logicalPart().name(); - } else { - Output << " NO DDD Hierarchy available "; - } - Output << " " << modules[i]->translation().X() << " \t" << modules[i]->translation().Y() << " \t" << modules[i]->translation().Z() << std::endl; - - // TEC output as Martin Weber's - int out_side = (tTopo->tecSide(rawid) == 1 ) ? -1 : 1; - unsigned int out_disk = tTopo->tecWheel(rawid); - unsigned int out_sector = thePetal[1]; - int out_petal = (thePetal[0] == 1 ) ? 1 : -1; - // swap sector numbers for TEC- - if (out_side == -1) { - // fine for back petals, substract 1 for front petals - if (out_petal == -1) { - out_sector = (out_sector+6) % 8 + 1; - } - } - unsigned int out_ring = tTopo->tecRing(rawid); - int out_sensor = 0; - if(name == "TECModule0RphiActive") out_sensor = -1; - if(name == "TECModule0StereoActive") out_sensor = 1; - if(name == "TECModule1RphiActive") out_sensor = -1; - if(name == "TECModule1StereoActive") out_sensor = 1; - if(name == "TECModule2RphiActive") out_sensor = -1; - if(name == "TECModule3RphiActive") out_sensor = -1; - if(name == "TECModule4RphiActive") out_sensor = -1; - if(name == "TECModule4StereoActive") out_sensor = 1; - if(name == "TECModule5RphiActive") out_sensor = -1; - if(name == "TECModule6RphiActive") out_sensor = -1; - unsigned int out_module; - if (out_ring == 1 || out_ring == 2 || out_ring == 5) { - // rings with stereo modules - // create number odd by default - out_module = 2*(tTopo->tecModule(rawid)-1)+1; - if (out_sensor == 1) { - // in even rings, stereo modules are the even ones - if (out_ring == 2) - out_module += 1; - } - else - // in odd rings, stereo modules are the odd ones - if (out_ring != 2) - out_module += 1; - } - else { - out_module = tTopo->tecModule(rawid); - } - double out_x = modules[i]->translation().X(); - double out_y = modules[i]->translation().Y(); - double out_z = modules[i]->translation().Z(); - double out_r = sqrt(modules[i]->translation().X()*modules[i]->translation().X() + - modules[i]->translation().Y()*modules[i]->translation().Y()); - double out_phi_rad = atan2(modules[i]->translation().Y(),modules[i]->translation().X()); - TECOutput << out_side << " " << out_disk << " " << out_sector << " " << out_petal - << " " << out_ring << " " << out_module << " " << out_sensor - << " " << out_x << " " << out_y << " " << out_z << " " << out_r << " " << out_phi_rad << std::endl; - // - break; - } - default: - Output << " WARNING no Silicon Strip detector, I got a " << rawid << std::endl;; - } - - // Local axes from Reco - const GeomDet* geomdet = pDD->idToDet(modules[i]->geographicalID()); - // Global Coordinates (i,j,k) - LocalVector xLocal(1,0,0); - LocalVector yLocal(0,1,0); - LocalVector zLocal(0,0,1); - // Versor components - GlobalVector xGlobal = (geomdet->surface()).toGlobal(xLocal); - GlobalVector yGlobal = (geomdet->surface()).toGlobal(yLocal); - GlobalVector zGlobal = (geomdet->surface()).toGlobal(zLocal); - // - - // Output: set as default 4 decimal digits (0.1 um or 0.1 deg/rad) - // active area center - Output << "\t" << "volume " << std::fixed << std::setprecision(3) << volume << " cm3 \t" - << "density " << std::fixed << std::setprecision(3) << density << " g/cm3 \t" - << "weight " << std::fixed << std::setprecision(6) << weight << " kg \t" - << "thickness " << std::fixed << std::setprecision(0) << thickness << " um \t" - << " active area " << std::fixed << std::setprecision(2) << activeSurface << " cm2" << std::endl; - Output << "\tActive Area Center" << std::endl; - Output << "\t O = (" << std::fixed << std::setprecision(4) << modules[i]->translation().X() - << "," << std::fixed << std::setprecision(4) << modules[i]->translation().Y() - << "," << std::fixed << std::setprecision(4) << modules[i]->translation().Z() - << ")" << std::endl; - // - //double polarRadius = std::sqrt(modules[i]->translation().X()*modules[i]->translation().X()+modules[i]->translation().Y()*modules[i]->translation().Y()); - double phiDeg = atan2(modules[i]->translation().Y(),modules[i]->translation().X()) * 360. / 6.283185307; - double phiRad = atan2(modules[i]->translation().Y(),modules[i]->translation().X()); - // - Output << "\t\t polar radius " - << std::fixed << std::setprecision(4) << polarRadius - << "\t" << "phi [deg] " - << std::fixed << std::setprecision(4) << phiDeg - << "\t" << "phi [rad] " - << std::fixed << std::setprecision(4) << phiRad - << std::endl; - // active area versors (rotation matrix) - DD3Vector x,y,z; - modules[i]->rotation().GetComponents(x,y,z); - Output << "\tActive Area Rotation Matrix" << std::endl; - Output << "\t z = n = (" << std::fixed << std::setprecision(4) << z.X() - << "," << std::fixed << std::setprecision(4) << z.Y() - << "," << std::fixed << std::setprecision(4) << z.Z() - << ")" << std::endl - << "\t [Rec] = (" << std::fixed << std::setprecision(4) << zGlobal.x() - << "," << std::fixed << std::setprecision(4) << zGlobal.y() - << "," << std::fixed << std::setprecision(4) << zGlobal.z() - << ")" << std::endl - << "\t x = t = (" << std::fixed << std::setprecision(4) << x.X() - << "," << std::fixed << std::setprecision(4) << x.Y() - << "," << std::fixed << std::setprecision(4) << x.Z() - << ")" << std::endl - << "\t [Rec] = (" << std::fixed << std::setprecision(4) << xGlobal.x() - << "," << std::fixed << std::setprecision(4) << xGlobal.y() - << "," << std::fixed << std::setprecision(4) << xGlobal.z() - << ")" << std::endl - << "\t y = k = (" << std::fixed << std::setprecision(4) << y.X() - << "," << std::fixed << std::setprecision(4) << y.Y() - << "," << std::fixed << std::setprecision(4) << y.Z() - << ")" << std::endl - << "\t [Rec] = (" << std::fixed << std::setprecision(4) << yGlobal.x() - << "," << std::fixed << std::setprecision(4) << yGlobal.y() - << "," << std::fixed << std::setprecision(4) << yGlobal.z() - << ")" << std::endl; - - // NumberingScheme - NumberingOutput << rawid; - - // if ( fromDDD_ && printDDD_ ) { - // NumberingOutput << " " << detNavType; - // } - //nav_type typedef changed in 3_6_2; comment out for now. idr 10/6/10 - - NumberingOutput << " " - << std::fixed << std::setprecision(4) << modules[i]->translation().X() << " " - << std::fixed << std::setprecision(4) << modules[i]->translation().Y() << " " - << std::fixed << std::setprecision(4) << modules[i]->translation().Z() << " " - << std::endl; - // - } - - // params - // Pixel - unsigned int chan_per_psiB[16] = {0},chan_per_psiD[16] = {0}; - double chan_pxb = 0.0; - double chan_strx12 = 0.0; - double chan_strx34 = 0.0; - double chan_pxf = 0.0; - unsigned int psi_pxbN=0, psi_pxb_strx12N=0, psi_pxb_strx34N=0, psi_pxfN=0; - for (int i=0;i<16;i++){ - chan_per_psiB[i] = (unsigned int)(thepixROCRowsB[i]*thepixROCColsB[i]); - chan_per_psiD[i] = (unsigned int)(thepixROCRowsD[i]*thepixROCColsD[i]); - chan_pxb += psi_pxb[i] *chan_per_psiB[i]; - chan_strx12 += psi_pxb_strx12[i]*chan_per_psiB[i]; - chan_strx34 += psi_pxb_strx34[i]*chan_per_psiB[i]; - chan_pxf += psi_pxf[i] *chan_per_psiD[i]; - psi_pxbN += (unsigned int)psi_pxb[i]; - psi_pxb_strx12N+= (unsigned int)psi_pxb_strx12[i]; - psi_pxb_strx34N+= (unsigned int)psi_pxb_strx34[i]; - psi_pxfN += (unsigned int)psi_pxf[i]; - } - - // Strip - unsigned int chan_per_apv = 128; - double chan_tib = apv_tib*chan_per_apv; - double chan_tid = apv_tid*chan_per_apv; - double chan_tob = apv_tob*chan_per_apv; - double chan_tec = apv_tec*chan_per_apv; - double psi_tot = psi_pxbN + psi_pxb_strx12N + psi_pxb_strx34N + psi_pxfN; - double apv_tot = apv_tib + apv_tid + apv_tob + apv_tec; - double chan_pixel = chan_pxb + chan_strx12 + chan_strx34 + chan_pxf; - double chan_strip = chan_tib + chan_tid + chan_tob + chan_tec; - double chan_tot = chan_pixel + chan_strip; - // - - // summary - Output << "---------------------" << std::endl; - Output << " Counters " << std::endl; - Output << "---------------------" << std::endl; - Output << " Total number of PXB layers = " << nlayersPXB << std::endl; - Output << " PXB Total = " << pxbN << std::endl; - Output << " Inner: Full = " << pxb_fullN << std::endl; - Output << " Inner: Half = " << pxb_halfN << std::endl; - Output << " Stacks = " << pxb_stackN << std::endl; - //Output << " Strx12: Full = " << pxb_full_strx12N << std::endl; - //Output << " Strx12: Half = " << pxb_half_strx12N << std::endl; - //Output << " Strx34: Full = " << pxb_full_strx34N << std::endl; - //Output << " Strx34: Half = " << pxb_half_strx34N << std::endl; - Output << " Active Silicon Detectors" << std::endl; - Output << " Weight = " << weight_pxb << " kg" << std::endl; - Output << " Volume = " << volume_pxb << " cm3" << std::endl; - Output << " Surface = " << activeSurface_pxb << " cm2" << std::endl; - Output << " NEED TO VERIFY THE NEXT 6 LINES!!!!!!!!!!!!!!!!! "<< std::endl; - Output << " PSI46s Inner = " << (int)psi_pxbN << std::endl; - Output << " PSI46s Strx12 = " << (int)psi_pxb_strx12N << std::endl; - Output << " PSI46s Strx34 = " << (int)psi_pxb_strx34N << std::endl; - Output << " channels Inner = " << (int)chan_pxb << std::endl; - Output << " channels Strx12 = " << (int)chan_strx12 << std::endl; - Output << " channels Strx34 = " << (int)chan_strx34 << std::endl; - Output << " PXF = " << pxfN << std::endl; - Output << " PH1 = " << pxf_D_N << std::endl; - Output << " 1x2 = " << pxf_1x2N << std::endl; - Output << " 1x5 = " << pxf_1x5N << std::endl; - Output << " 2x3 = " << pxf_2x3N << std::endl; - Output << " 2x4 = " << pxf_2x4N << std::endl; - Output << " 2x5 = " << pxf_2x5N << std::endl; - Output << " Active Silicon Detectors" << std::endl; - Output << " Weight = " << weight_pxf << " kg" << std::endl; - Output << " Volume = " << volume_pxf << " cm3" << std::endl; - Output << " Surface = " << activeSurface_pxf << " cm2" << std::endl; - Output << " PSI46s = " << (int)psi_pxfN << std::endl; - Output << " channels = " << (int)chan_pxf << std::endl; - Output << " TIB = " << tibN << std::endl; - Output << " L12 rphi = " << tib_L12_rphiN << std::endl; - Output << " L12 stereo = " << tib_L12_sterN << std::endl; - Output << " L34 = " << tib_L34_rphiN << std::endl; - Output << " Active Silicon Detectors" << std::endl; - Output << " Weight = " << weight_tib << " kg" << std::endl; - Output << " Volume = " << volume_tib << " cm3" << std::endl; - Output << " Surface = " << activeSurface_tib << " cm2" << std::endl; - Output << " APV25s = " << (int)apv_tib << std::endl; - Output << " channels = " << (int)chan_tib << std::endl; - Output << " TID = " << tidN << std::endl; - Output << " r1 rphi = " << tid_r1_rphiN << std::endl; - Output << " r1 stereo = " << tid_r1_sterN << std::endl; - Output << " r2 rphi = " << tid_r2_rphiN << std::endl; - Output << " r2 stereo = " << tid_r2_sterN << std::endl; - Output << " r3 rphi = " << tid_r3_rphiN << std::endl; - Output << " Active Silicon Detectors" << std::endl; - Output << " Weight = " << weight_tid << " kg" << std::endl; - Output << " Volume = " << volume_tid << " cm3" << std::endl;; - Output << " Surface = " << activeSurface_tid << " cm2" << std::endl; - Output << " APV25s = " << (int)apv_tid << std::endl; - Output << " channels = " << (int)chan_tid << std::endl; - Output << " TOB = " << tobN << std::endl; - Output << " L12 rphi = " << tob_L12_rphiN << std::endl; - Output << " L12 stereo = " << tob_L12_sterN << std::endl; - Output << " L34 = " << tob_L34_rphiN << std::endl; - Output << " L56 = " << tob_L56_rphiN << std::endl; - Output << " Active Silicon Detectors" << std::endl; - Output << " Weight = " << weight_tob << " kg" << std::endl; - Output << " Volume = " << volume_tob << " cm3" << std::endl; - Output << " Surface = " << activeSurface_tob << " cm2" << std::endl; - Output << " APV25s = " << (int)apv_tob << std::endl; - Output << " channels = " << (int)chan_tob << std::endl; - Output << " TEC = " << tecN << std::endl; - Output << " r1 rphi = " << tec_r1_rphiN << std::endl; - Output << " r1 stereo = " << tec_r1_sterN << std::endl; - Output << " r2 rphi = " << tec_r2_rphiN << std::endl; - Output << " r2 stereo = " << tec_r2_sterN << std::endl; - Output << " r3 rphi = " << tec_r3_rphiN << std::endl; - Output << " r4 rphi = " << tec_r4_rphiN << std::endl; - Output << " r5 rphi = " << tec_r5_rphiN << std::endl; - Output << " r5 stereo = " << tec_r5_sterN << std::endl; - Output << " r6 rphi = " << tec_r6_rphiN << std::endl; - Output << " r7 rphi = " << tec_r7_rphiN << std::endl; - Output << " Active Silicon Detectors" << std::endl; - Output << " Weight = " << weight_tec << " kg" << std::endl; - Output << " Volume = " << volume_tec << " cm3" << std::endl; - Output << " Surface = " << activeSurface_tec << " cm2" << std::endl; - Output << " APV25s = " << (int)apv_tec << std::endl; - Output << " channels = " << (int)chan_tec << std::endl; - Output << "---------------------" << std::endl; - Output << " Total Weight = " << weight_total << " kg" << std::endl; - Output << " Total Volume = " << volume_total << " cm3" << std::endl; - Output << " Total Active Area = " << activeSurface_total << " cm2" << std::endl; - Output << " PSI46s = " << (int)psi_tot << std::endl; - Output << " APV25s = " << (int)apv_tot << std::endl; - Output << " pixel channels = " << (int)chan_pixel << std::endl; - Output << " strip channels = " << (int)chan_strip << std::endl; - Output << " total channels = " << (int)chan_tot << std::endl; - // - for(unsigned int i=0; i tTopo; - es.get().get(tTopo); + edm::ESHandle tTopoHandle; + es.get().get(tTopoHandle); + const TrackerTopology* const tTopo = tTopoHandle.product(); // geometry setup diff --git a/Validation/GlobalDigis/src/GlobalDigisAnalyzer.cc b/Validation/GlobalDigis/src/GlobalDigisAnalyzer.cc index 7fc8281f1522f..887eb27aec763 100644 --- a/Validation/GlobalDigis/src/GlobalDigisAnalyzer.cc +++ b/Validation/GlobalDigis/src/GlobalDigisAnalyzer.cc @@ -2,8 +2,8 @@ * * See header file for description of class * - * $Date: 2012/11/02 14:17:28 $ - * $Revision: 1.20 $ + * $Date: 2012/12/26 22:47:50 $ + * $Revision: 1.21 $ * \author M. Strang SUNY-Buffalo */ @@ -1167,8 +1167,9 @@ void GlobalDigisAnalyzer::fillTrk(const edm::Event& iEvent, const edm::EventSetup& iSetup) { //Retrieve tracker topology from geometry - edm::ESHandle tTopo; - iSetup.get().get(tTopo); + edm::ESHandle tTopoHandle; + iSetup.get().get(tTopoHandle); + const TrackerTopology* const tTopo = tTopoHandle.product(); std::string MsgLoggerCat = "GlobalDigisAnalyzer_fillTrk"; diff --git a/Validation/GlobalDigis/src/GlobalDigisProducer.cc b/Validation/GlobalDigis/src/GlobalDigisProducer.cc index 79b033dabf06b..db5a8fe4ec720 100644 --- a/Validation/GlobalDigis/src/GlobalDigisProducer.cc +++ b/Validation/GlobalDigis/src/GlobalDigisProducer.cc @@ -2,8 +2,8 @@ * * See header file for description of class * - * $Date: 2012/11/02 14:17:23 $ - * $Revision: 1.16 $ + * $Date: 2012/12/26 22:47:50 $ + * $Revision: 1.17 $ * \author M. Strang SUNY-Buffalo */ @@ -945,8 +945,9 @@ void GlobalDigisProducer::fillTrk(edm::Event& iEvent, const edm::EventSetup& iSetup) { //Retrieve tracker topology from geometry - edm::ESHandle tTopo; - iSetup.get().get(tTopo); + edm::ESHandle tTopoHandle; + iSetup.get().get(tTopoHandle); + const TrackerTopology* const tTopo = tTopoHandle.product(); std::string MsgLoggerCat = "GlobalDigisProducer_fillTrk"; diff --git a/Validation/GlobalRecHits/src/GlobalRecHitsAnalyzer.cc b/Validation/GlobalRecHits/src/GlobalRecHitsAnalyzer.cc index 3202cb9c42472..968f72c326989 100644 --- a/Validation/GlobalRecHits/src/GlobalRecHitsAnalyzer.cc +++ b/Validation/GlobalRecHits/src/GlobalRecHitsAnalyzer.cc @@ -2,8 +2,8 @@ * * See header file for description of class * - * $Date: 2012/02/01 16:27:22 $ - * $Revision: 1.18 $ + * $Date: 2012/12/26 22:56:50 $ + * $Revision: 1.19 $ * \author M. Strang SUNY-Buffalo * Testing by Ken Smith */ @@ -902,8 +902,9 @@ void GlobalRecHitsAnalyzer::fillTrk(const edm::Event& iEvent, const edm::EventSetup& iSetup) { //Retrieve tracker topology from geometry - edm::ESHandle tTopo; - iSetup.get().get(tTopo); + edm::ESHandle tTopoHandle; + iSetup.get().get(tTopoHandle); + const TrackerTopology* const tTopo = tTopoHandle.product(); std::string MsgLoggerCat = "GlobalRecHitsAnalyzer_fillTrk"; diff --git a/Validation/GlobalRecHits/src/GlobalRecHitsProducer.cc b/Validation/GlobalRecHits/src/GlobalRecHitsProducer.cc index bc58dc94bb0cd..430b2ca6ae2b3 100644 --- a/Validation/GlobalRecHits/src/GlobalRecHitsProducer.cc +++ b/Validation/GlobalRecHits/src/GlobalRecHitsProducer.cc @@ -2,8 +2,8 @@ * * See header file for description of class * - * $Date: 2012/02/01 16:27:22 $ - * $Revision: 1.16 $ + * $Date: 2012/12/26 22:56:50 $ + * $Revision: 1.17 $ * \author M. Strang SUNY-Buffalo */ @@ -856,8 +856,9 @@ void GlobalRecHitsProducer::fillTrk(edm::Event& iEvent, const edm::EventSetup& iSetup) { //Retrieve tracker topology from geometry - edm::ESHandle tTopo; - iSetup.get().get(tTopo); + edm::ESHandle tTopoHandle; + iSetup.get().get(tTopoHandle); + const TrackerTopology* const tTopo = tTopoHandle.product(); std::string MsgLoggerCat = "GlobalRecHitsProducer_fillTrk"; diff --git a/Validation/TrackerDigis/plugins/SiPixelDigiValid.cc b/Validation/TrackerDigis/plugins/SiPixelDigiValid.cc index 0f3817b76feb2..f9a49bb5b10ff 100644 --- a/Validation/TrackerDigis/plugins/SiPixelDigiValid.cc +++ b/Validation/TrackerDigis/plugins/SiPixelDigiValid.cc @@ -274,8 +274,9 @@ void SiPixelDigiValid::endJob() { void SiPixelDigiValid::analyze(const Event& e, const EventSetup& c){ //Retrieve tracker topology from geometry - edm::ESHandle tTopo; - c.get().get(tTopo); + edm::ESHandle tTopoHandle; + c.get().get(tTopoHandle); + const TrackerTopology* const tTopo = tTopoHandle.product(); diff --git a/Validation/TrackerDigis/plugins/SiStripDigiValid.cc b/Validation/TrackerDigis/plugins/SiStripDigiValid.cc index 1c81764a04bbc..ca018f8b03df3 100644 --- a/Validation/TrackerDigis/plugins/SiStripDigiValid.cc +++ b/Validation/TrackerDigis/plugins/SiStripDigiValid.cc @@ -338,8 +338,9 @@ void SiStripDigiValid::endJob() { void SiStripDigiValid::analyze(const Event& e, const EventSetup& c){ //Retrieve tracker topology from geometry - edm::ESHandle tTopo; - c.get().get(tTopo); + edm::ESHandle tTopoHandle; + c.get().get(tTopoHandle); + const TrackerTopology* const tTopo = tTopoHandle.product();