Commit 2d355b5a authored by Riccardo Longo's avatar Riccardo Longo
Browse files

Included preliminary SetBranches function in detector class

parent 267ff071
......@@ -12,6 +12,7 @@
#include "Containers.h"
#include <iostream>
#include <vector>
class Channel {
......@@ -44,7 +45,7 @@ class Channel {
/** Operating voltage of the channel**/
int Vop;
/** Raw waveform for a particular event **/
//std::vector < Channel > WF;
std::vector < float > WF;
};
......
......@@ -15,6 +15,7 @@
#include <string>
#include "Containers.h"
#include "TTree.h"
class Detector{
......@@ -33,6 +34,8 @@ class Detector{
virtual void SetElement ( Channel* _entry) { m_Element.push_back(_entry); }
virtual void SetPosition (double x, double y, double z) { m_Position[0] = x; m_Position[1] = y; m_Position[2] = z; }
virtual void SetAngle (double _cosx = 0, double _cosy = 0, double _cosz = 0) { m_Angle[0] = _cosx; m_Angle[1] = _cosy; m_Angle[2] = _cosz; }
virtual void SetBranches ( TTree* _dataTree );
virtual void PrintMap ( ) = 0;
private:
......
......@@ -11,6 +11,7 @@
#include "Detector.h"
#include "Containers.h"
#include <vector>
/** @brief Default Constructor for Detector.
......@@ -61,6 +62,18 @@ Channel* Detector::GetElement(std::string _name){
}
void Detector::SetBranches( TTree *_dataTree ){
std::vector< std::vector< float >* > pvWF;
pvWF.resize(m_Element.size());
for( uint ch = 0; ch < m_Element.size(); ch++ ){
pvWF[ ch ] = &m_Element[ch]->WF;
_dataTree->SetBranchAddress( ("Raw" + m_Element.at(ch)->name).c_str(), &pvWF[ ch ] );
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment