diff --git a/Control/CalypsoExample/SimHitExample/src/SimHitAlg.cxx b/Control/CalypsoExample/SimHitExample/src/SimHitAlg.cxx index 82fec214f001911871bd1060de37b79b3f5213fb..9a7180228e31e5fd4b424b1b08d6fa228aa56b75 100644 --- a/Control/CalypsoExample/SimHitExample/src/SimHitAlg.cxx +++ b/Control/CalypsoExample/SimHitExample/src/SimHitAlg.cxx @@ -18,7 +18,7 @@ StatusCode SimHitAlg::initialize() ATH_CHECK(histSvc()->regHist("/HIST/modulesSide1", m_moduleSide1)); ATH_CHECK(histSvc()->regHist("/HIST/modulesSide2", m_moduleSide2)); - m_plate = new TH2D("plate", "Scint Hit Plate", 3, -1.5, 1.5, 4, -0.5, 3.5 ); + m_plate = new TH2D("plate", "Scint Hit Plate", 3, -1, 1, 4, 0, 1 ); ATH_CHECK(histSvc()->regHist("/HIST/plates", m_plate)); // initialize data handle keys @@ -54,11 +54,11 @@ StatusCode SimHitAlg::execute() ATH_MSG_INFO("Read FaserSiHitCollection with " << h_siHits->size() << " hits"); SG::ReadHandle<ScintHitCollection> h_preshowerHits(m_preshowerHitKey); - ATH_MSG_INFO("Read ScintHitCollection with " << h_preshowerHits->size() << " hits"); + ATH_MSG_INFO("Read ScintHitCollection/Preshower with " << h_preshowerHits->size() << " hits"); SG::ReadHandle<ScintHitCollection> h_triggerHits(m_triggerHitKey); - ATH_MSG_INFO("Read ScintHitCollection with " << h_triggerHits->size() << " hits"); + ATH_MSG_INFO("Read ScintHitCollection/Trigger with " << h_triggerHits->size() << " hits"); SG::ReadHandle<ScintHitCollection> h_vetoHits(m_vetoHitKey); - ATH_MSG_INFO("Read ScintHitCollection with " << h_vetoHits->size() << " hits"); + ATH_MSG_INFO("Read ScintHitCollectionVeto with " << h_vetoHits->size() << " hits"); // Since we have no pile-up, there should always be a single GenEvent in the container @@ -71,8 +71,9 @@ StatusCode SimHitAlg::execute() ATH_MSG_INFO("Event contains " << ev->particles_size() << " truth particles" ); // The hit container might be empty because particles missed the wafers - if (h_siHits->size() == 0) return StatusCode::SUCCESS; - else{ + //if (h_siHits->size() == 0) return StatusCode::SUCCESS; + + if (h_siHits->size()!=0){ // Loop over all hits; print and fill histogram for (const FaserSiHit& hit : *h_siHits) { @@ -94,31 +95,33 @@ StatusCode SimHitAlg::execute() if (h_preshowerHits->size()!=0){ for (const ScintHit& hit : *h_preshowerHits) { + hit.print(); m_hist->Fill(hit.energyLoss()); m_plate->Fill(hit.getStation(),hit.getPlate()); } } - + if (h_triggerHits->size()!=0){ + for (const ScintHit& hit : *h_triggerHits) + { + hit.print(); + m_hist->Fill(hit.energyLoss()); + m_plate->Fill(hit.getStation(),hit.getPlate()); - /*if (h_scintHits->size()!=0){ - for (const ScintHit& hit : *h_scintHits) + } + } + + if (h_vetoHits->size()!=0){ + for (const ScintHit& hit : *h_vetoHits) { hit.print(); - m_hist->Fill( hit.energyLoss() ); - m_plate->Fill( hit.getStation(), hit.getPlate() ); - /*if (hit.getSensor() == 0) - { - m_moduleSide1->Fill( hit.getModule(), hit.getRow()); - } - else - { - m_moduleSide2->Fill( hit.getModule(), hit.getRow()); - }// + m_hist->Fill(hit.energyLoss()); + m_plate->Fill(hit.getStation(),hit.getPlate()); } - }*/ + } + return StatusCode::SUCCESS; }