Reimplemented from edm::EDAnalyzer.
Definition at line 254 of file AlignmentStats.cc.
References DEFINE_FWK_MODULE, PV3DBase< T, PVType, FrameType >::eta(), hitmap_, hitsTreeName_, triggerObjects_cff::id, fastTrackerRecHitType::is2D(), nhits, outtree_, overlapmap_, PV3DBase< T, PVType, FrameType >::perp(), PV3DBase< T, PVType, FrameType >::phi(), PixelSubdetector::PixelBarrel, PixelSubdetector::PixelEndcap, RecoTauValidation_cfi::posX, RecoTauValidation_cfi::posY, TrackerTopology::pxbLayer(), TrackerTopology::pxfDisk(), DetId::subdetId(), SiStripDetId::TEC, TrackerTopology::tecIsDoubleSide(), TrackerTopology::tecIsStereo(), TrackerTopology::tecWheel(), SiStripDetId::TIB, TrackerTopology::tibIsDoubleSide(), TrackerTopology::tibIsStereo(), TrackerTopology::tibLayer(), SiStripDetId::TID, TrackerTopology::tidIsDoubleSide(), TrackerTopology::tidIsStereo(), TrackerTopology::tidWheel(), SiStripDetId::TOB, TrackerTopology::tobIsDoubleSide(), TrackerTopology::tobIsStereo(), TrackerTopology::tobLayer(), trackerTopology_, and treefile_.
Referenced by o2olib.O2ORunMgr::executeJob().
256 edm::LogInfo(
"AlignmentStats") <<
"Writing out the TrackStatistics in " << gDirectory->GetPath() << std::endl;
262 TFile *hitsfile =
new TFile(
hitsTreeName_.c_str(),
"RECREATE");
264 TTree *hitstree =
new TTree(
"AlignmentHitMap",
"Maps of Hits used for Alignment");
266 unsigned int id = 0,
nhits = 0, noverlaps = 0;
267 float posX(-99999.0),
posY(-77777.0), posZ(-88888.0);
268 float posEta(-6666.0), posPhi(-5555.0), posR(-4444.0);
270 unsigned int layer = 0;
271 bool is2D =
false, isStereo =
false;
272 hitstree->Branch(
"DetId", &
id,
"DetId/i");
273 hitstree->Branch(
"Nhits", &
nhits,
"Nhits/i");
274 hitstree->Branch(
"Noverlaps", &noverlaps,
"Noverlaps/i");
275 hitstree->Branch(
"SubDet", &subdet,
"SubDet/I");
276 hitstree->Branch(
"Layer", &layer,
"Layer/i");
277 hitstree->Branch(
"is2D", &is2D,
"is2D/B");
278 hitstree->Branch(
"isStereo", &isStereo,
"isStereo/B");
279 hitstree->Branch(
"posX", &
posX,
"posX/F");
280 hitstree->Branch(
"posY", &
posY,
"posY/F");
281 hitstree->Branch(
"posZ", &posZ,
"posZ/F");
282 hitstree->Branch(
"posR", &posR,
"posR/F");
283 hitstree->Branch(
"posEta", &posEta,
"posEta/F");
284 hitstree->Branch(
"posPhi", &posPhi,
"posPhi/F");
302 std::unique_ptr<AlignableTracker> theAliTracker =
304 const auto &Detunitslist = theAliTracker->deepComponents();
305 int ndetunits = Detunitslist.size();
306 edm::LogInfo(
"AlignmentStats") <<
"Number of DetUnits in the AlignableTracker: " << ndetunits << std::endl;
308 for (
int det_cnt = 0; det_cnt < ndetunits; ++det_cnt) {
326 id =
static_cast<uint32_t
>(Detunitslist[det_cnt]->id());
333 hitmap_.insert(pair<uint32_t, uint32_t>(
id, 0));
342 overlapmap_.insert(pair<uint32_t, uint32_t>(
id, 0));
346 posX = Detunitslist[det_cnt]->globalPosition().x();
347 posY = Detunitslist[det_cnt]->globalPosition().y();
348 posZ = Detunitslist[det_cnt]->globalPosition().z();
357 subdet = detid.subdetId();
386 edm::LogError(
"AlignmentStats") <<
"Detector not belonging neither to pixels nor to strips! Skipping it. SubDet= "
bool tecIsDoubleSide(const DetId &id) const
bool tobIsDoubleSide(const DetId &id) const
bool tibIsDoubleSide(const DetId &id) const
unsigned int tibLayer(const DetId &id) const
bool tobIsStereo(const DetId &id) const
static constexpr auto TID
unsigned int pxfDisk(const DetId &id) const
const TrackerTopology * trackerTopology_
unsigned int tidWheel(const DetId &id) const
bool tidIsStereo(const DetId &id) const
bool tecIsStereo(const DetId &id) const
bool is2D(HitType hitType)
static constexpr auto TOB
unsigned int pxbLayer(const DetId &id) const
bool tibIsStereo(const DetId &id) const
bool tidIsDoubleSide(const DetId &id) const
static constexpr auto TIB
std::string hitsTreeName_
unsigned int tecWheel(const DetId &id) const
static constexpr auto TEC
unsigned int tobLayer(const DetId &id) const