-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
365 additions
and
255 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,36 @@ | ||
#ifndef EventIII_h | ||
#define EventIII_h | ||
|
||
#include <fstream> | ||
#include <TObject.h> | ||
#include <TClonesArray.h> | ||
#include "TDCChannel.h" | ||
#include <iostream> | ||
#include <TClonesArray.h> | ||
#include <TObject.h> | ||
#include <TTree.h> | ||
|
||
#include <fstream> | ||
#include <iostream> | ||
|
||
class TDCChannel; | ||
|
||
class EventIII : public TNamed { | ||
|
||
class EventIII : public TNamed | ||
{ | ||
|
||
private: | ||
Int_t totalNTDCChannels; | ||
|
||
public: | ||
TClonesArray* TDCChannels; | ||
|
||
EventIII(); | ||
virtual ~EventIII() { Clear(); } | ||
|
||
TDCChannel* AddTDCChannel(int channel); | ||
|
||
Int_t GetTotalNTDCChannels() { return totalNTDCChannels; } | ||
|
||
TClonesArray* GetTDCChannelsArray() { return TDCChannels; } | ||
|
||
void Clear(void); | ||
|
||
ClassDef(EventIII,1); | ||
|
||
}; | ||
|
||
ClassDef(EventIII, 1); | ||
}; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,56 @@ | ||
#ifndef TDCChannel_h | ||
#define TDCChannel_h | ||
|
||
#include <fstream> | ||
#include <TObject.h> | ||
#include <TClonesArray.h> | ||
#include <TObject.h> | ||
#include <fstream> | ||
#include <iostream> | ||
#include <vector> | ||
|
||
class TDCChannel : public TObject { | ||
class TDCChannel : public TObject | ||
{ | ||
|
||
protected: | ||
Int_t channel; | ||
|
||
std::vector<double> leadTimes; | ||
std::vector<double> trailTimes; | ||
|
||
public: | ||
|
||
public: | ||
TDCChannel(); | ||
~TDCChannel(); | ||
|
||
void SetChannel(Int_t channel) { this->channel = channel; } | ||
int GetChannel() { return channel; } | ||
int GetLeadHitsNum() { return leadTimes.size(); } | ||
int GetTrailHitsNum() { return trailTimes.size(); } | ||
|
||
void AddLead(double lead); | ||
void AddTrail(double trail); | ||
|
||
double GetLeadTime(unsigned int mult) { | ||
if( mult >= leadTimes.size() ){ | ||
std::cout<<"asked for lead time out of range."<<std::endl; | ||
double GetLeadTime(unsigned int mult) | ||
{ | ||
if (mult >= leadTimes.size()) | ||
{ | ||
std::cout << "asked for lead time out of range." << std::endl; | ||
return 0.; | ||
} | ||
return leadTimes[mult]; | ||
} | ||
|
||
double GetTrailTime(unsigned int mult) { | ||
if( mult >= trailTimes.size() ){ | ||
std::cout<<"asked for trail time out of range."<<std::endl; | ||
double GetTrailTime(unsigned int mult) | ||
{ | ||
if (mult >= trailTimes.size()) | ||
{ | ||
std::cout << "asked for trail time out of range." << std::endl; | ||
return 0.; | ||
} | ||
return trailTimes[mult]; | ||
} | ||
|
||
void Clear(Option_t * opt); | ||
ClassDef(TDCChannel,2); | ||
void Clear(Option_t* opt); | ||
|
||
ClassDef(TDCChannel, 2); | ||
}; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,36 @@ | ||
#include <Rtypes.h> | ||
#include <sstream> | ||
#include <iomanip> | ||
#include <sstream> | ||
|
||
namespace TimeDateDecoder | ||
{ | ||
static unsigned int day(UInt_t x) { return (x & 0x00FF); } | ||
|
||
static unsigned int sec(UInt_t x) { return (x & 0x00FF); } | ||
|
||
static unsigned int month(UInt_t x) { return ((x & 0x0F00) >> 8) + 1; } | ||
|
||
namespace TimeDateDecoder{ | ||
static unsigned int day(UInt_t x){ | ||
return (x & 0x00FF); | ||
} | ||
|
||
static unsigned int sec(UInt_t x){ | ||
return (x & 0x00FF); | ||
} | ||
|
||
static unsigned int month(UInt_t x){ | ||
return ((x & 0x0F00)>>8) + 1; | ||
} | ||
|
||
static unsigned int min(UInt_t x){ | ||
return (x & 0xFF00)>>8; | ||
} | ||
|
||
static unsigned int hour(UInt_t x){ | ||
return (x & 0x00FF0000)>>16; | ||
} | ||
|
||
static unsigned int year(UInt_t x){ | ||
return ((x & 0xFFFF0000)>>16) - 100; | ||
} | ||
|
||
static std::string formatTimeString(UInt_t date_encoded, UInt_t time_encoded){ | ||
std::stringstream ss; | ||
ss << std::setfill('0') << std::setw(2) << year(date_encoded); | ||
ss << "-"; | ||
ss << std::setfill('0') << std::setw(2) << month(date_encoded); | ||
ss << "-"; | ||
ss << std::setfill('0') << std::setw(2) << day(date_encoded); | ||
ss << " "; | ||
ss << std::setfill('0') << std::setw(2) << hour(time_encoded); | ||
ss << ":"; | ||
ss << std::setfill('0') << std::setw(2) << min(time_encoded); | ||
ss << ":"; | ||
ss << std::setfill('0') << std::setw(2) << sec(time_encoded); | ||
return ss.str(); | ||
} | ||
|
||
static unsigned int min(UInt_t x) { return (x & 0xFF00) >> 8; } | ||
|
||
static unsigned int hour(UInt_t x) { return (x & 0x00FF0000) >> 16; } | ||
|
||
static unsigned int year(UInt_t x) { return ((x & 0xFFFF0000) >> 16) - 100; } | ||
|
||
static std::string formatTimeString(UInt_t date_encoded, UInt_t time_encoded) | ||
{ | ||
std::stringstream ss; | ||
ss << std::setfill('0') << std::setw(2) << year(date_encoded); | ||
ss << "-"; | ||
ss << std::setfill('0') << std::setw(2) << month(date_encoded); | ||
ss << "-"; | ||
ss << std::setfill('0') << std::setw(2) << day(date_encoded); | ||
ss << " "; | ||
ss << std::setfill('0') << std::setw(2) << hour(time_encoded); | ||
ss << ":"; | ||
ss << std::setfill('0') << std::setw(2) << min(time_encoded); | ||
ss << ":"; | ||
ss << std::setfill('0') << std::setw(2) << sec(time_encoded); | ||
return ss.str(); | ||
} | ||
|
||
} // namespace TimeDateDecoder |
Oops, something went wrong.