Skip to content
This repository has been archived by the owner on May 9, 2024. It is now read-only.

Commit

Permalink
Merge pull request #2 from LDMX-Software/iss644
Browse files Browse the repository at this point in the history
Iss644 - Project structure changes.
  • Loading branch information
omar-moreno authored Dec 18, 2020
2 parents cfc55f7 + 1465d72 commit a06877e
Show file tree
Hide file tree
Showing 9 changed files with 251 additions and 8 deletions.
22 changes: 18 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,24 @@ project(Hcal VERSION 2.1.0
# Search and configure ROOT
find_package(ROOT CONFIG REQUIRED)

setup_library(name Hcal
option(BUILD_EVENT_ONLY "Build the event library." ON)
if(BUILD_EVENT_ONLY)

register_event_object( module_path "Hcal/Event" namespace "ldmx" class "HcalVetoResult" )
register_event_object( module_path "Hcal/Event" namespace "ldmx" class "HcalHit" type "collection")

# Generate the files needed to build the event classes.
setup_library(module Hcal
name Event
dependencies ROOT::Core Recon::Event
register_target)
return()

endif()

setup_library(module Hcal
dependencies ROOT::Physics
DARK::Framework DARK::Event DARK::Tools DARK::DetDescr
python_install_path ${PYTHON_INSTALL_PREFIX}
Framework::Framework Recon::Event Tools::Tools DetDescr::DetDescr
)

setup_test(dependencies DARK::Hcal)
setup_python(package_name ${PYTHON_PACKAGE_NAME}/Hcal)
97 changes: 97 additions & 0 deletions include/Hcal/Event/HcalHit.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
/**
* @file HcalHit.h
* @brief Class that stores Stores reconstructed hit information from the HCAL
* @author Jeremy Mans, University of Minnesota
*/

#ifndef HCAL_EVENT_HCALHIT_H_
#define HCAL_EVENT_HCALHIT_H_

// LDMX
#include "Recon/Event/CalorimeterHit.h"

namespace ldmx {

/**
* @class HcalHit
* @brief Stores reconstructed hit information from the HCAL
*
* @note This class represents the reconstructed hit information
* from the HCAL, providing particular information for the HCAL,
* above and beyond what is available in the CalorimeterHit.
*/
class HcalHit : public CalorimeterHit {

public:

/**
* Class constructor.
*/
HcalHit() {
}

/**
* Class destructor.
*/
virtual ~HcalHit() {
}

/**
* Clear the data in the object.
*/
void Clear();

/**
* Print out the object.
*/
void Print() const;

/**
* Get the number of photoelectrons estimated for this hit.
* @return Number of photoelectrons, including noise which affects the estimate.
*/
float getPE() const {
return pe_;
}

/**
* Get the minimum number of photoelectrons estimated for this hit if two sided readout.
* @return Minimum number of photoelectrons, including noise which affects the estimate.
*/
float getMinPE() const {
return minpe_;
}

/**
* Set the number of photoelectrons estimated for this hit.
* @param pe Number of photoelectrons, including noise which affects the estimate.
*/
void setPE(float pe) {
pe_ = pe;
}

/**
* Set the minimum number of photoelectrons estimated for this hit.
* @param pe Minimum number of photoelectrons, including noise which affects the estimate.
*/
void setMinPE(float minpe) {
minpe_ = minpe;
}

private:

/** The number of PE estimated for this hit. */
float pe_{0};

/** The minimum number of PE estimated for this hit, different from pe_ when you have two ended readout */
float minpe_{-99};

/**
* The ROOT class definition.
*/
ClassDef(HcalHit, 2);
};

}

#endif /* HCAL_EVENT_HCALHIT_H_ */
73 changes: 73 additions & 0 deletions include/Hcal/Event/HcalVetoResult.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
/**
* @file HcalVetoResult.h
* @brief Class used to encapsulate the results obtained from
* HcalVetoProcessor.
* @author Omar Moreno, SLAC National Accelerator Laboratory
*/

#ifndef HCAL_EVENT_HCALVETORESULT_H_
#define HCAL_EVENT_HCALVETORESULT_H_

//----------//
// ROOT //
//----------//
#include "TObject.h" //For ClassDef

//----------//
// LDMX //
//----------//
#include "Hcal/Event/HcalHit.h"

namespace ldmx {

class HcalVetoResult {

public:

/** Constructor */
HcalVetoResult();

/** Destructor */
~HcalVetoResult();

/** Reset the object. */
void Clear();

/** Print out the object */
void Print() const;

/** Checks if the event passes the Hcal veto. */
bool passesVeto() const { return passesVeto_; };

/** @return The maximum PE HcalHit. */
inline HcalHit getMaxPEHit() const { return maxPEHit_; }

/**
* Sets whether the Hcal veto was passed or not.
*
* @param passesVeto Veto result.
*/
inline void setVetoResult(const bool& passesVeto = true) { passesVeto_ = passesVeto; }

/**
* Set the maximum PE hit.
*
* @param maxPEHit The maximum PE HcalHit
*/
inline void setMaxPEHit(const HcalHit maxPEHit) { maxPEHit_ = maxPEHit; }

private:

/** Reference to max PE hit. */
HcalHit maxPEHit_;

/** Flag indicating whether the event passes the Hcal veto. */
bool passesVeto_{false};

ClassDef(HcalVetoResult, 2);

}; // HcalVetoResult
}


#endif // HCAL_EVENT_HCALVETORESULT_H_
4 changes: 2 additions & 2 deletions include/Hcal/HcalDigiProducer.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
// LDMX
#include "DetDescr/DetectorID.h"
#include "DetDescr/HcalID.h"
#include "Event/EventDef.h"
#include "Framework/EventDef.h"
#include "Framework/EventProcessor.h"
#include "Tools/NoiseGenerator.h"
#include "Framework/Parameters.h"
#include "Framework/Configure/Parameters.h"

namespace ldmx {

Expand Down
2 changes: 1 addition & 1 deletion include/Hcal/HcalVetoProcessor.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include "Event/HcalVetoResult.h"
#include "Event/HcalHit.h"
#include "Framework/EventProcessor.h"
#include "Framework/Parameters.h"
#include "Framework/Configure/Parameters.h"

namespace ldmx {

Expand Down
22 changes: 22 additions & 0 deletions src/Hcal/Event/HcalHit.cxx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#include "Hcal/Event/HcalHit.h"

// STL
#include <iostream>

ClassImp(ldmx::HcalHit)

namespace ldmx {

void HcalHit::Clear() {
CalorimeterHit::Clear();
pe_ = 0;
minpe_ = -99;
}

void HcalHit::Print() const {
std::cout << "HcalHit { " << "id: " << std::hex << getID() << std::dec
<< ", energy: " << getEnergy() << "MeV, time: " << getTime()
<< "ns, amplitude: " << getAmplitude() << ", pe: " << getPE() << "}" << std::endl;

}
}
37 changes: 37 additions & 0 deletions src/Hcal/Event/HcalVetoResult.cxx
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/**
* @file HcalVetoResult.h
* @brief Class used to encapsulate the results obtained from
* HcalVetoProcessor.
* @author Omar Moreno, SLAC National Accelerator Laboratory
*/

#include "Hcal/Event/HcalVetoResult.h"

//----------------//
// C++ StdLib //
//----------------//
#include <iostream>

//-------------//
// ldmx-sw //
//-------------//
#include "Hcal/Event/HcalHit.h"

ClassImp(ldmx::HcalVetoResult)

namespace ldmx {

HcalVetoResult::HcalVetoResult() {}

HcalVetoResult::~HcalVetoResult() {}

void HcalVetoResult::Clear() {
passesVeto_ = false;
}

void HcalVetoResult::Print() const {
std::cout << "[ HcalVetoResult ]: Passes veto : "
<< " Passes veto: " << passesVeto_ << std::endl;
maxPEHit_.Print();
}
}
2 changes: 1 addition & 1 deletion src/HcalDigiProducer.cxx → src/Hcal/HcalDigiProducer.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include "TTree.h"

#include "Hcal/HcalDigiProducer.h"
#include "Framework/Exception.h"
#include "Framework/Exception/Exception.h"
#include "Framework/RandomNumberSeedService.h"

#include <iostream>
Expand Down
File renamed without changes.

0 comments on commit a06877e

Please sign in to comment.