|
ATLAS Offline Software
|
Go to the documentation of this file.
17 #include "GaudiKernel/IToolSvc.h"
18 #include "GaudiKernel/ITHistSvc.h"
21 #include "CaloDetDescr/CaloDetDescrElement.h"
25 #include "Identifier/Identifier.h"
44 #include "CLHEP/Vector/LorentzVector.h"
45 #include "CLHEP/Vector/ThreeVector.h"
46 #include "CLHEP/Geometry/Point3D.h"
54 m_calibrationRun(false),
55 m_cx1(0.0), m_cx2(0.0), m_cx3(0.0),
56 m_cy1(0.0), m_cy2(0.0), m_cy3(0.0)
89 throw GaudiException(
"Invalid LAr FCAL ID helper",
"LArHitAnalysis", StatusCode::FAILURE);
95 throw GaudiException(
"Invalid Calo Cell ID helper",
"LArHitAnalysis", StatusCode::FAILURE);
123 m_tree_AS =
new TTree(
"tree_AS",
"TTree of AnalysisSkleton");
202 throw GaudiException(
"Invalid Calo DM ID helper",
"LArFCalTB_MC_CBNT_AA", StatusCode::FAILURE);
260 return StatusCode::SUCCESS;
270 return StatusCode::SUCCESS;
406 return StatusCode::SUCCESS;
421 for (
const LArHit* hit : *container) {
429 double energy = hit->energy();
431 int module_index = caloDDE->
getLayer();
433 double x = caloDDE->
x();
434 double y = caloDDE->
y();
437 if (module_index == 1) {
445 else if (module_index == 2) {
453 else if (module_index == 3) {
472 float xNumer1 = 0.0, xNumer2 = 0.0, xNumer3 = 0.0;
473 float yNumer1 = 0.0, yNumer2 = 0.0, yNumer3 = 0.0;
474 float Denom1 = 0.0, Denom2 = 0.0, Denom3 = 0.0;
476 double subClusterSize = 30.0;
477 double thisCG_R = 0.0;
480 for (
const LArHit* hit : *container) {
488 double energy = hit->energy();
490 int module_index = caloDDE->
getLayer();
492 double x = caloDDE->
x();
493 double y = caloDDE->
y();
497 if (module_index == 1) {
499 double x_subcheck1 =
m_cx1 -
x;
500 double y_subcheck1 =
m_cy1 -
y;
501 thisCG_R = sqrt(x_subcheck1 * x_subcheck1 + y_subcheck1 * y_subcheck1);
503 if (thisCG_R <= subClusterSize) {
509 else if (module_index == 2) {
511 double x_subcheck2 =
m_cx2 -
x;
512 double y_subcheck2 =
m_cy2 -
y;
513 thisCG_R = sqrt(x_subcheck2 * x_subcheck2 + y_subcheck2 * y_subcheck2);
515 if (thisCG_R <= subClusterSize) {
521 else if (module_index == 3) {
523 double x_subcheck3 =
m_cx3 -
x;
524 double y_subcheck3 =
m_cy3 -
y;
525 thisCG_R = sqrt(x_subcheck3 * x_subcheck3 + y_subcheck3 * y_subcheck3);
527 if (thisCG_R <= subClusterSize) {
536 if (fabs(Denom1) > 0.0) {
541 if (fabs(Denom2) > 0.0) {
546 if (fabs(Denom3) > 0.0) {
565 std::string
name = kv.first;
569 if (
sc.isFailure() || container == 0) {
576 return StatusCode::FAILURE;
579 ATH_MSG_DEBUG(
"CaloCalibrationHit container successfully retrieved");
581 kv.second = container;
614 std::string
name = kv.first;
625 double energy = calibhit->energyTotal();
636 if (
name ==
"LArCalibrationHitActive")
639 if (
name ==
"LArCalibrationHitInactive")
642 if (
name ==
"LArCalibrationHitDeadMaterial") {
703 if (
name ==
"LArCalibrationHitActive") {
720 if (
name ==
"LArCalibrationHitInactive") {
740 for (
const auto& theParticle: *
e)
745 const HepMC::FourVector& HMCmom = theParticle->momentum();
746 CLHEP::HepLorentzVector
momentum(CLHEP::Hep3Vector(HMCmom.px(), HMCmom.py(), HMCmom.pz()), HMCmom.e());
748 HepMC::FourVector HMC3vec(0.0,0.0,0.0,0.0);
749 if (theParticle->production_vertex()) HMC3vec = theParticle->production_vertex()->position();
750 HepGeom::Point3D<double> origin = HepGeom::Point3D<double>(HMC3vec.x(), HMC3vec.y(), HMC3vec.z());
767 m_vertx = theParticle->production_vertex()->position().x();
768 m_verty = theParticle->production_vertex()->position().y();
769 m_vertz = theParticle->production_vertex()->position().z();
776 std::string nickname;
784 double shift2 = sinangle * (5128.3 - 4668.5) *
CLHEP::mm;
785 double shift3 = sinangle * (5602.8 - 4668.5) *
CLHEP::mm;
824 sc =
evtStore()->retrieve(mcEventCollection,
"TruthEvent");
826 if (
sc.isSuccess()) {
829 for (
const HepMC::GenEvent * mcEvent : *mcEventCollection) {
835 <<
": could not fetch MC event collection");
840 std::string FCalContainerName =
"LArHitFCAL";
842 sc =
evtStore()->retrieve(container, FCalContainerName);
844 if (
sc.isFailure() || container == 0) {
847 return StatusCode::FAILURE;
850 ATH_MSG_DEBUG(
"LArHitFCAL container successfully retrieved");
868 for (
const LArHit* hit : *container) {
872 sc =
evtStore()->retrieve(mcEventCollection,
"TruthEvent");
874 if (
sc.isSuccess()) {
878 for (
const HepMC::GenEvent * mcEvent : *mcEventCollection)
881 for (
auto theParticle: *mcEvent)
883 m_pdg_id->push_back(theParticle->pdg_id());
895 double energy = hit->energy();
896 int module_index = caloDDE->
getLayer();
899 if (module_index == 1) {
903 else if (module_index == 2) {
907 else if (module_index == 3) {
919 return StatusCode::SUCCESS;
927 std::vector<double> *hit_x, std::vector<double> *hit_y,
928 std::vector<double> *hit_ieta, std::vector<double> *hit_iphi,
931 const double hitx = caloDDE->
x();
932 const double hity = caloDDE->
y();
933 const double hiteta = 7;
934 const double hitphi = 7;
940 if ((hitx == hit_x->at(
icell)) && (hity == hit_y->at(
icell))) {
949 cell_E->push_back(
energy);
950 hit_x->push_back(hitx);
951 hit_y->push_back(hity);
952 hit_ieta->push_back(hiteta);
953 hit_iphi->push_back(hitphi);
978 if (
sc.isFailure()) {
980 return StatusCode::SUCCESS;
985 return StatusCode::SUCCESS;
1009 return StatusCode::SUCCESS;
const LArFCAL_ID * m_larFCalID
def retrieve(aClass, aKey=None)
virtual StatusCode execute() override
Execute (event by event)
SG::ReadCondHandleKey< CaloDetDescrManager > m_caloMgrKey
double m_totalDeadMaterialEnergy
int dmat(const Identifier &id) const
return DMtype according to :
Const iterator class for DataVector/DataList.
std::vector< double > * m_hit_y2
double energyNonEM() const
uint64_t eventNumber() const
The current event's event number.
bool is_lar_fcal(Identifier id) const
std::vector< double > * m_hit_ieta2
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
double m_totalInvisibleEnergy
This class groups all DetDescr information related to a CaloCell. Provides a generic interface for al...
const CaloDetDescrElement * get_element(const Identifier &cellId) const
get element by its identifier
StatusCode doFCal()
The main FCal analysis method.
void FCalCalibAnalysis(const std::string &name, const CaloCalibrationHit *CalibHit)
FCal Analysis with Calibration Hits on Added by JPA, June 2005.
int module(const Identifier id) const
module [1,3]
const CaloDM_ID * getDM_ID(void) const
double energyTotal() const
LArFCalSamplingFraction(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
void TruthImpactPosition(const HepMC::GenEvent *e)
Calculate truth impact position.
uint32_t runNumber() const
The current event's run number.
std::vector< double > * m_hit_x1
~LArFCalSamplingFraction()
Destructor.
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
std::vector< double > * m_hit_y1
void FCalClusterCenter(const LArHitContainer *container, const CaloDetDescrManager *caloMgr)
Calculate FCal cluster center.
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode initialize() override
Initialize.
double m_totalFCal2CalibrationEnergy
double m_totalFCalCalibrationEnergy
void FillCellInfo(const CaloDetDescrElement *caloDDE, double energy, std::vector< double > *cell_E, std::vector< double > *hit_x, std::vector< double > *hit_y, std::vector< double > *hit_ieta, std::vector< double > *hit_iphi, int &NCell)
Fill FCal cell information.
This class initializes the Calo (LAr and Tile) offline identifiers.
std::vector< double > * m_hit_x3
::StatusCode StatusCode
StatusCode definition for legacy code.
std::vector< double > * m_cell1_E
double m_totalInactiveEnergy
const LArFCAL_ID * getFCAL_ID(void) const
StatusCode addEventInfo()
methods called by execute()
const CaloCell_ID * m_caloCellID
bool is_lar(const Identifier &zoneId) const
to disentangle between LAr and Tile dead material
std::vector< double > * m_hit_iphi3
double energyInvisible() const
#define CHECK(...)
Evaluate an expression and check for errors.
double m_totalNonEmEnergy
double m_totalFCal3CalibrationEnergy
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
This defines the McEventCollection, which is really just an ObjectVector of McEvent objects.
bool is_lar_fcal() const
cell belongs to FCAL
uint32_t lumiBlock() const
The current event's luminosity block number.
Identifier cellID() const
virtual bool isValid() override final
Can the handle be successfully dereferenced?
unsigned int m_eventNumber
std::vector< double > * m_hit_ieta3
Class to store calorimeter calibration hit.
double m_FCalActiveEscaped
const CaloCell_ID * getCaloCell_ID(void) const
Access to IdHelper.
void FCalHitCenter(const LArHitContainer *container, const CaloDetDescrManager *caloMgr)
Calculate FCal hit center.
StatusCode initialize(bool used=true)
int sampling(const Identifier &id) const
return sampling according to :
Class to store hit energy and time in LAr cell from G4 simulation.
virtual StatusCode finalize() override
Finalize.
virtual StatusCode initEvent()
Init event.
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoKey
virtual int getLayer() const
cell layer
std::vector< double > * m_hit_ieta1
This class provides the client interface for accessing the detector description information common to...
std::vector< double > * m_hit_y3
StatusCode doCalib()
Calibration hit analysis.
std::vector< double > * m_hit_iphi2
#define ATH_MSG_WARNING(x)
double m_totalFCal1CalibrationEnergy
const CaloDM_ID * m_caloDmID
double m_totalEscapedEnergy
std::vector< double > * m_hit_iphi1
uint32_t timeStamp() const
POSIX time in seconds from 1970. January 1st.
std::vector< int > * m_pdg_id
float mcEventWeight(size_t i=0) const
The weight of one specific MC event used in the simulation.
double m_FCalActiveInvisible
std::vector< double > * m_hit_x2
double m_totalActiveEnergy
uint32_t bcid() const
The bunch crossing ID of the event.
double m_totalCalibrationEnergy
std::vector< double > * m_cell3_E
m_calibHitMap_t m_calibHitMap
double energyEscaped() const
TTree * m_tree_AS
Athena-Aware Ntuple (AAN) variables - branches of the AAN TTree.
std::vector< double > * m_cell2_E