Skip to content
Snippets Groups Projects
Commit 2881639e authored by Theodore Efremov's avatar Theodore Efremov :hibiscus:
Browse files

Added class to hold time information

parent ebebf8d7
No related branches found
No related tags found
1 merge request!27Draft: [Epic] Preparation of the environement for the new GaseousDetectorScorers...
Pipeline #370452 passed
/*****************************************************************************
* Copyright (C) 2009-2020 this file is part of the NPTool Project *
* *
* For the licensing terms see $NPTOOL/Licence/NPTool_Licence *
* For the list of contributors see $NPTOOL/Licence/Contributors *
*****************************************************************************/
/*****************************************************************************
* Original Author: Théodore Efremov contact address: theodore.efremov@cea.fr
* *
* Creation Date : Nov 2024 *
* Last update : *
*---------------------------------------------------------------------------*
* Decription: *
* This class hold Time Raw data *
* *
*---------------------------------------------------------------------------*
* Comment: *
* *
* *
*****************************************************************************/
#include "TTimeData.h"
#include <iostream>
#include <fstream>
#include <sstream>
#include <string>
using namespace std;
ClassImp(TTimeData)
//////////////////////////////////////////////////////////////////////
TTimeData::TTimeData() {
}
//////////////////////////////////////////////////////////////////////
TTimeData::~TTimeData() {
}
//////////////////////////////////////////////////////////////////////
void TTimeData::Clear() {
fTimeMWPC13.clear();
fTimeMWPC14.clear();
fTimeMWPC23.clear();
fTimeMWPC24.clear();
}
//////////////////////////////////////////////////////////////////////
void TTimeData::Dump() const {
// This method is very useful for debuging and worth the dev.
cout << "XXXXXXXXXXXXXXXXXXXXXXXX New Event [TTimeData::Dump()] XXXXXXXXXXXXXXXXX" << endl;
size_t mysize = fTimeMWPC13.size();
cout << "MWPC_Mult: " << mysize << endl;
for(unsigned int i=0; i<mysize; i++){
cout << "Time 13 mult " << i+1 << " / T= " << fTimeMWPC13[i] << endl;
cout << "Time 14 mult " << i+1 << " / T= " << fTimeMWPC14[i] << endl;
cout << "Time 23 mult " << i+1 << " / T= " << fTimeMWPC23[i] << endl;
cout << "Time 24 mult " << i+1 << " / T= " << fTimeMWPC24[i] << endl;
}
}
#ifndef __TIMEDATA__
#define __TIMEDATA__
/*****************************************************************************
* Copyright (C) 2009-2020 this file is part of the NPTool Project *
* *
* For the licensing terms see $NPTOOL/Licence/NPTool_Licence *
* For the list of contributors see $NPTOOL/Licence/Contributors *
*****************************************************************************/
/*****************************************************************************
* Original Author: Théodore Efremov contact address: theodore.efremov@cea.fr *
* *
* Creation Date : Oct 2023 *
* Last update : *
*---------------------------------------------------------------------------*
* Decription: *
* This class hold Time Raw data *
* *
*---------------------------------------------------------------------------*
* Comment: *
* *
* *
*****************************************************************************/
// STL
#include <vector>
using namespace std;
// ROOT
#include "TObject.h"
class TTimeData : public TObject {
//////////////////////////////////////////////////////////////
// data members are hold into vectors in order
// to allow multiplicity treatment
private:
vector<long> fTimeMWPC13;
vector<long> fTimeMWPC14;
vector<long> fTimeMWPC23;
vector<long> fTimeMWPC24;
//////////////////////////////////////////////////////////////
// Constructor and destructor
public:
TTimeData();
~TTimeData();
//////////////////////////////////////////////////////////////
// Inherited from TObject and overriden to avoid warnings
public:
void Clear();
void Clear(const Option_t*) {};
void Dump() const;
//////////////////////////////////////////////////////////////
// Getters and Setters
// Prefer inline declaration to avoid unnecessary called of
// frequently used methods
// add //! to avoid ROOT creating dictionnary for the methods
public:
////////////////////// SETTERS ////////////////////////
// X setters
inline void SetTime_MWPC13(long time ){fTimeMWPC13.push_back(time);};//!
inline void SetTime_MWPC14(long time ){fTimeMWPC14.push_back(time);};//!
inline void SetTime_MWPC23(long time ){fTimeMWPC23.push_back(time);};//!
inline void SetTime_MWPC24(long time ){fTimeMWPC24.push_back(time);};//!
////////////////////// GETTERS ////////////////////////
inline UShort_t GetTimeMWPC13(const unsigned int &i) const
{return fTimeMWPC13.at(i) ;}//!
inline UShort_t GetTimeMWPC14(const unsigned int &i) const
{return fTimeMWPC14.at(i) ;}//!
inline UShort_t GetTimeMWPC23(const unsigned int &i) const
{return fTimeMWPC23.at(i) ;}//!
inline UShort_t GetTimeMWPC24(const unsigned int &i) const
{return fTimeMWPC24.at(i) ;}//!
inline UShort_t GetMWPCMult() const
{return fTimeMWPC13.size();}
//////////////////////////////////////////////////////////////
// Required for ROOT dictionnary
ClassDef(TTimeData,1) // TimeData structure
};
#endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment