Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
nptool
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
np
nptool
Commits
a6910c08
Commit
a6910c08
authored
11 years ago
by
de Séréville Nicolas
Browse files
Options
Downloads
Patches
Plain Diff
+ Add Spectra support for Tiara/Hyball
parent
863d3289
Loading
Loading
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
NPLib/Tiara/Makefile
+4
-6
4 additions, 6 deletions
NPLib/Tiara/Makefile
NPLib/Tiara/TTiaraHyballSpectra.cxx
+392
-0
392 additions, 0 deletions
NPLib/Tiara/TTiaraHyballSpectra.cxx
NPLib/Tiara/TTiaraHyballSpectra.h
+84
-0
84 additions, 0 deletions
NPLib/Tiara/TTiaraHyballSpectra.h
with
480 additions
and
6 deletions
NPLib/Tiara/Makefile
+
4
−
6
View file @
a6910c08
...
...
@@ -9,8 +9,7 @@ all: $(SHARELIB)
############### Detector ##############
## Sharc ##
libTiara.so
:
TTiaraBarrelData.o TTiaraBarrelDataDict.o TTiaraHyballData.o TTiaraHyballDataDict.o
libTiara.so
:
TTiaraBarrelData.o TTiaraBarrelDataDict.o TTiaraHyballData.o TTiaraHyballDataDict.o TTiaraHyballSpectra.o
$(
LD
)
$(
SOFLAGS
)
$^
$(
OutPutOpt
)
$@
TTiaraBarrelDataDict.cxx
:
TTiaraBarrelData.h
...
...
@@ -20,8 +19,9 @@ TTiaraHyballDataDict.cxx: TTiaraHyballData.h
rootcint
-f
$@
-c
$^
# dependances
TTiaraBarrelData.o
:
TTiaraBarrelData.cxx TTiaraBarrelData.h
TTiaraHyballData.o
:
TTiaraHyballData.cxx TTiaraHyballData.h
TTiaraBarrelData.o
:
TTiaraBarrelData.cxx TTiaraBarrelData.h
TTiaraHyballData.o
:
TTiaraHyballData.cxx TTiaraHyballData.h
TTiaraHyballSpectra.o
:
TTiaraHyballSpectra.cxx TTiaraHyballSpectra.h
#######################################
...
...
@@ -38,5 +38,3 @@ distclean:
.$(SrcSuf).$(ObjSuf)
:
$(
CXX
)
$(
CXXFLAGS
)
$(
INCLUDE
)
-c
$<
This diff is collapsed.
Click to expand it.
NPLib/Tiara/TTiaraHyballSpectra.cxx
0 → 100644
+
392
−
0
View file @
a6910c08
/*****************************************************************************
* Copyright (C) 2009-2013 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: N. de Sereville contact address: deserevi@ipno.in2p3.fr *
* *
* Creation Date : dec 2013 *
* Last update : *
*---------------------------------------------------------------------------*
* Decription: *
* This class holds all the online spectra needed for Tiara/Hyball *
* *
*---------------------------------------------------------------------------*
* Comment: *
* + first version (not complete yet) *
* *
* *
*****************************************************************************/
// NPL
#include
"TTiaraHyballSpectra.h"
#include
"NPOptionManager.h"
#include
"NPGlobalSystemOfUnits.h"
#include
"NPPhysicalConstants.h"
#ifdef NP_SYSTEM_OF_UNITS_H
using
namespace
NPUNITS
;
#endif
// ROOT
#include
"TString.h"
#include
"TDirectory.h"
#include
"TFile.h"
////////////////////////////////////////////////////////////////////////////////
TTiaraHyballSpectra
::
TTiaraHyballSpectra
()
{
if
(
NPOptionManager
::
getInstance
()
->
GetVerboseLevel
()
>
0
)
{
cout
<<
"************************************************"
<<
endl
;
cout
<<
"TTiaraHyballSpectra: Initalising control spectra"
<<
endl
;
cout
<<
"************************************************"
<<
endl
;
}
fRingsNumber
=
16
;
fSectorsNumber
=
8
;
fWedgesNumber
=
6
;
InitRawSpectra
();
InitPreTreatedSpectra
();
InitPhysicsSpectra
();
}
////////////////////////////////////////////////////////////////////////////////
TTiaraHyballSpectra
::~
TTiaraHyballSpectra
()
{
}
////////////////////////////////////////////////////////////////////////////////
void
TTiaraHyballSpectra
::
InitRawSpectra
()
{
TString
name
;
// HIT_RING_RAW
name
=
"HYB_HIT_RING_RAW"
;
AddHisto1D
(
name
,
name
,
fWedgesNumber
*
fRingsNumber
,
0
,
fWedgesNumber
*
fRingsNumber
,
"TIARA/HYBALL/RAW/HIT"
);
// HIT_SECTOR_RAW
name
=
"HYB_HIT_SECT_RAW"
;
AddHisto1D
(
name
,
name
,
fWedgesNumber
*
fRingsNumber
,
0
,
fWedgesNumber
*
fRingsNumber
,
"TIARA/HYBALL/RAW/HIT"
);
// RING_E_RAW
name
=
"HYB_RING_E_RAW"
;
AddHisto2D
(
name
,
name
,
fWedgesNumber
*
fRingsNumber
,
0
,
fWedgesNumber
*
fRingsNumber
,
512
,
0
,
8192
,
"TIARA/HYBALL/RAW/ENERGY"
);
// SECTOR_E_RAW
name
=
"HYB_SECT_E_RAW"
;
AddHisto2D
(
name
,
name
,
fWedgesNumber
*
fSectorsNumber
,
0
,
fWedgesNumber
*
fSectorsNumber
,
512
,
0
,
8192
,
"TIARA/HYBALL/RAW/ENERGY"
);
// RING_RAW_MULT
name
=
"HYB_RING_E_RAW_MULT"
;
AddHisto1D
(
name
,
name
,
fWedgesNumber
*
fRingsNumber
,
1
,
fWedgesNumber
*
fRingsNumber
+
1
,
"TIARA/HYBALL/RAW/MULT"
);
// SECTOR_RAW_MULT
name
=
"HYB_SECT_E_RAW_MULT"
;
AddHisto1D
(
name
,
name
,
fWedgesNumber
*
fSectorsNumber
,
1
,
fWedgesNumber
*
fSectorsNumber
+
1
,
"TIARA/HYBALL/RAW/MULT"
);
}
////////////////////////////////////////////////////////////////////////////////
void
TTiaraHyballSpectra
::
InitPreTreatedSpectra
()
{
TString
name
;
// HIT_RING_CAL
name
=
"HYB_HIT_RING_CAL"
;
AddHisto1D
(
name
,
name
,
fWedgesNumber
*
fRingsNumber
,
0
,
fWedgesNumber
*
fRingsNumber
,
"TIARA/HYBALL/CAL/HIT"
);
// HIT_SECTOR_CAL
name
=
"HYB_HIT_SECT_CAL"
;
AddHisto1D
(
name
,
name
,
fWedgesNumber
*
fRingsNumber
,
0
,
fWedgesNumber
*
fRingsNumber
,
"TIARA/HYBALL/CAL/HIT"
);
// RING_E_CAL
name
=
"HYB_RING_E_CAL"
;
AddHisto2D
(
name
,
name
,
fWedgesNumber
*
fRingsNumber
,
0
,
fWedgesNumber
*
fRingsNumber
,
500
,
0
,
50
,
"TIARA/HYBALL/CAL/ENERGY"
);
// SECTOR_E_CAL
name
=
"HYB_SECT_E_CAL"
;
AddHisto2D
(
name
,
name
,
fWedgesNumber
*
fSectorsNumber
,
0
,
fWedgesNumber
*
fSectorsNumber
,
500
,
0
,
50
,
"TIARA/HYBALL/CAL/ENERGY"
);
// RING_CAL_MULT
name
=
"HYB_RING_E_CAL_MULT"
;
AddHisto1D
(
name
,
name
,
fWedgesNumber
*
fRingsNumber
,
1
,
fWedgesNumber
*
fRingsNumber
+
1
,
"TIARA/HYBALL/CAL/MULT"
);
// SECTOR_CAL_MULT
name
=
"HYB_SECT_E_CAL_MULT"
;
AddHisto1D
(
name
,
name
,
fWedgesNumber
*
fSectorsNumber
,
1
,
fWedgesNumber
*
fSectorsNumber
+
1
,
"TIARA/HYBALL/CAL/MULT"
);
}
////////////////////////////////////////////////////////////////////////////////
void
TTiaraHyballSpectra
::
InitPhysicsSpectra
()
{
TString
name
;
// X-Y Impact Matrix
name
=
"HYB_IMPACT_MATRIX"
;
AddHisto2D
(
name
,
name
,
500
,
-
150
,
150
,
500
,
-
150
,
150
,
"TIARA/HYBALL/PHY"
);
// Kinematic line
name
=
"HYB_THETA_E"
;
AddHisto2D
(
name
,
name
,
360
,
0
,
180
,
500
,
0
,
50
,
"TIARA/HYBALL/PHY"
);
// Ring v.s. Sector Energy Correlation
// STRX_E_CAL
name
=
"HYB_XY_COR"
;
AddHisto2D
(
name
,
name
,
500
,
0
,
50
,
500
,
0
,
50
,
"TIARA/HYBALL/PHY"
);
}
////////////////////////////////////////////////////////////////////////////////
void
TTiaraHyballSpectra
::
FillRawSpectra
(
TTiaraHyballData
*
RawData
)
{
TString
name
;
TString
family
;
// HIT_RING_RAW
family
=
"TIARA/HYBALL/RAW/HIT"
;
name
=
"HYB_HIT_RING_RAW"
;
for
(
unsigned
int
i
=
0
;
i
<
RawData
->
GetRingEMult
();
i
++
)
{
unsigned
short
channel
=
RawData
->
GetRingEDetectorNbr
(
i
)
*
fRingsNumber
+
RawData
->
GetRingEStripNbr
(
i
);
GetHisto
(
family
,
name
)
->
Fill
(
channel
);
}
// HIT_SECT_RAW
family
=
"TIARA/HYBALL/RAW/HIT"
;
name
=
"HYB_HIT_SECT_RAW"
;
for
(
unsigned
int
i
=
0
;
i
<
RawData
->
GetSectorEMult
();
i
++
)
{
unsigned
short
channel
=
RawData
->
GetSectorEDetectorNbr
(
i
)
*
fSectorsNumber
+
RawData
->
GetSectorEStripNbr
(
i
);
GetHisto
(
family
,
name
)
->
Fill
(
channel
);
}
// RING_E_RAW
family
=
"TIARA/HYBALL/RAW/ENERGY"
;
name
=
"HYB_RING_E_RAW"
;
for
(
unsigned
int
i
=
0
;
i
<
RawData
->
GetRingEMult
();
i
++
)
{
unsigned
short
channel
=
RawData
->
GetRingEDetectorNbr
(
i
)
*
fRingsNumber
+
RawData
->
GetRingEStripNbr
(
i
);
GetHisto
(
family
,
name
)
->
Fill
(
channel
,
RawData
->
GetRingEEnergy
(
i
));
}
// SECTOR_E_RAW
family
=
"TIARA/HYBALL/RAW/ENERGY"
;
name
=
"HYB_SECT_E_RAW"
;
for
(
unsigned
int
i
=
0
;
i
<
RawData
->
GetRingEMult
();
i
++
)
{
unsigned
short
channel
=
RawData
->
GetRingEDetectorNbr
(
i
)
*
fSectorsNumber
+
RawData
->
GetSectorEStripNbr
(
i
);
GetHisto
(
family
,
name
)
->
Fill
(
channel
,
RawData
->
GetRingEEnergy
(
i
));
}
/*
// STRX MULT
int myMULT[fNumberOfTelescope];
for( unsigned int i = 0; i < fNumberOfTelescope; i++)
myMULT[i] = 0 ;
for(unsigned int i = 0 ; i < RawData->GetMMStripXEMult();i++){
myMULT[RawData->GetMMStripXEDetectorNbr(i)-1] += 1;
}
for( unsigned int i = 0; i < fNumberOfTelescope; i++){
name = Form("MM%d_STRX_RAW_MULT", i+1);
family= "TIARA/HYBALL/RAW/MULT";
GetHisto(family,name)
-> Fill(myMULT[i]);
}
// STRY MULT
for( unsigned int i = 0; i < fNumberOfTelescope; i++)
myMULT[i] = 0 ;
for(unsigned int i = 0 ; i < RawData->GetMMStripYEMult();i++){
myMULT[RawData->GetMMStripYEDetectorNbr(i)-1] += 1;
}
for( unsigned int i = 0; i < fNumberOfTelescope; i++){
name = Form("MM%d_STRY_RAW_MULT", i+1);
family= "TIARA/HYBALL/RAW/MULT";
GetHisto(family,name)
-> Fill(myMULT[i]);
}
*/
}
////////////////////////////////////////////////////////////////////////////////
void
TTiaraHyballSpectra
::
FillPreTreatedSpectra
(
TTiaraHyballData
*
PreTreatedData
)
{
TString
name
;
TString
family
;
// HIT_RING_CAL
family
=
"TIARA/HYBALL/CAL/HIT"
;
name
=
"HYB_HIT_RING_CAL"
;
for
(
unsigned
int
i
=
0
;
i
<
PreTreatedData
->
GetRingEMult
();
i
++
)
{
unsigned
short
channel
=
PreTreatedData
->
GetRingEDetectorNbr
(
i
)
*
fRingsNumber
+
PreTreatedData
->
GetRingEStripNbr
(
i
);
GetHisto
(
family
,
name
)
->
Fill
(
channel
);
}
// HIT_SECT_CAL
family
=
"TIARA/HYBALL/CAL/HIT"
;
name
=
"HYB_HIT_SECT_CAL"
;
for
(
unsigned
int
i
=
0
;
i
<
PreTreatedData
->
GetSectorEMult
();
i
++
)
{
unsigned
short
channel
=
PreTreatedData
->
GetSectorEDetectorNbr
(
i
)
*
fSectorsNumber
+
PreTreatedData
->
GetSectorEStripNbr
(
i
);
GetHisto
(
family
,
name
)
->
Fill
(
channel
);
}
// RING_E_CAL
family
=
"TIARA/HYBALL/CAL/ENERGY"
;
name
=
"HYB_RING_E_CAL"
;
for
(
unsigned
int
i
=
0
;
i
<
PreTreatedData
->
GetRingEMult
();
i
++
)
{
unsigned
short
channel
=
PreTreatedData
->
GetRingEDetectorNbr
(
i
)
*
fRingsNumber
+
PreTreatedData
->
GetRingEStripNbr
(
i
);
GetHisto
(
family
,
name
)
->
Fill
(
channel
,
PreTreatedData
->
GetRingEEnergy
(
i
));
}
// SECTOR_E_CAL
family
=
"TIARA/HYBALL/CAL/ENERGY"
;
name
=
"HYB_SECT_E_CAL"
;
for
(
unsigned
int
i
=
0
;
i
<
PreTreatedData
->
GetRingEMult
();
i
++
)
{
unsigned
short
channel
=
PreTreatedData
->
GetRingEDetectorNbr
(
i
)
*
fSectorsNumber
+
PreTreatedData
->
GetSectorEStripNbr
(
i
);
GetHisto
(
family
,
name
)
->
Fill
(
channel
,
PreTreatedData
->
GetRingEEnergy
(
i
));
}
/*
// STRX MULT
int myMULT[fNumberOfTelescope];
for( unsigned int i = 0; i < fNumberOfTelescope; i++)
myMULT[i] = 0 ;
for(unsigned int i = 0 ; i < PreTreatedData->GetMMStripXEMult();i++){
myMULT[PreTreatedData->GetMMStripXEDetectorNbr(i)-1] += 1;
}
for( unsigned int i = 0; i < fNumberOfTelescope; i++){
name = Form("MM%d_STRX_CAL_MULT", i+1);
family= "TIARA/HYBALL/CAL/MULT";
GetHisto(family,name)
-> Fill(myMULT[i]);
}
// STRY MULT
for( unsigned int i = 0; i < fNumberOfTelescope; i++)
myMULT[i] = 0 ;
for(unsigned int i = 0 ; i < PreTreatedData->GetMMStripYEMult();i++){
myMULT[PreTreatedData->GetMMStripYEDetectorNbr(i)-1] += 1;
}
for( unsigned int i = 0; i < fNumberOfTelescope; i++){
name = Form("MM%d_STRY_CAL_MULT", i+1);
family= "TIARA/HYBALL/CAL/MULT";
GetHisto(family,name)
-> Fill(myMULT[i]);
}
*/
}
/*
////////////////////////////////////////////////////////////////////////////////
void TTiaraHyballSpectra::FillPhysicsSpectra(TTiaraHyballPhysics* Physics)
{
TString name;
TString family= "TIARA/HYBALL/PHY";
// X-Y Impact Matrix
for(unsigned int i = 0 ; i < Physics->Si_E.size(); i++){
name = "MM_IMPACT_MATRIX";
double x = Physics->GetPositionOfInteraction(i).x();
double y = Physics->GetPositionOfInteraction(i).y();
GetHisto(family,name)-> Fill(x,y);
name = "MM_THETA_E";
double Theta = Physics->GetPositionOfInteraction(i).Angle(TVector3(0,0,1));
Theta = Theta/deg;
GetHisto(family,name)-> Fill(Theta,Physics->Si_E[i]);
// STRX_E_CAL
name = Form("MM%d_XY_COR", Physics->TelescopeNumber[i]);
GetHisto(family,name)-> Fill(Physics->Si_EX[i],Physics->Si_EY[i]);
}
}
*/
////////////////////////////////////////////////////////////////////////////////
TH1
*
TTiaraHyballSpectra
::
AddHisto1D
(
TString
name
,
TString
title
,
Int_t
nbinsx
,
Double_t
xlow
,
Double_t
xup
,
TString
family
)
{
// create histo
TH1
*
hist
=
new
TH1D
(
name
,
title
,
nbinsx
,
xlow
,
xup
);
vector
<
TString
>
index
;
index
.
push_back
(
family
);
index
.
push_back
(
name
);
// fill map
fMapHisto
[
index
]
=
hist
;
return
hist
;
}
////////////////////////////////////////////////////////////////////////////////
TH1
*
TTiaraHyballSpectra
::
AddHisto2D
(
TString
name
,
TString
title
,
Int_t
nbinsx
,
Double_t
xlow
,
Double_t
xup
,
Int_t
nbinsy
,
Double_t
ylow
,
Double_t
yup
,
TString
family
)
{
// create histo
TH1
*
hist
=
new
TH2D
(
name
,
title
,
nbinsx
,
xlow
,
xup
,
nbinsy
,
ylow
,
yup
);
vector
<
TString
>
index
;
index
.
push_back
(
family
);
index
.
push_back
(
name
);
// fill map
fMapHisto
[
index
]
=
hist
;
return
hist
;
}
////////////////////////////////////////////////////////////////////////////////
TH1
*
TTiaraHyballSpectra
::
GetHisto
(
TString
family
,
TString
name
)
{
vector
<
TString
>
index
;
index
.
push_back
(
family
);
index
.
push_back
(
name
);
return
fMapHisto
.
at
(
index
);
}
////////////////////////////////////////////////////////////////////////////////
void
TTiaraHyballSpectra
::
WriteHisto
(
TString
filename
)
{
TFile
*
f
=
NULL
;
if
(
filename
!=
"VOID"
)
{
f
=
new
TFile
(
filename
,
"RECREATE"
);
}
map
<
vector
<
TString
>
,
TH1
*
>::
iterator
it
;
for
(
it
=
fMapHisto
.
begin
();
it
!=
fMapHisto
.
end
();
++
it
)
{
it
->
second
->
Write
();
}
if
(
filename
!=
"VOID"
)
{
f
->
Close
();
delete
f
;
}
}
This diff is collapsed.
Click to expand it.
NPLib/Tiara/TTiaraHyballSpectra.h
0 → 100644
+
84
−
0
View file @
a6910c08
#ifndef TTIARAHYBALLSPECTRA_H
#define TTIARAHYBALLSPECTRA_H
/*****************************************************************************
* Copyright (C) 2009-2013 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: N. de Sereville contact address: deserevi@ipno.in2p3.fr *
* *
* Creation Date : dec 2013 *
* Last update : *
*---------------------------------------------------------------------------*
* Decription: *
* This class holds all the online spectra needed for Tiara/Hyball *
* *
*---------------------------------------------------------------------------*
* Comment: *
* + first version (not complete yet) *
* *
* *
*****************************************************************************/
// ROOT headers
#include
"TObject.h"
#include
<TH1.h>
#include
<TH2.h>
#include
<TString.h>
// NPLib headers
#include
"TTiaraHyballData.h"
//#include "TTiaraHyballPhysics.h"
// C++ STL headers
#include
<map>
using
namespace
std
;
// Forward Declaration
//class TTiaraHyballPhysics;
class
TTiaraHyballSpectra
{
public:
// constructor and destructor
TTiaraHyballSpectra
();
~
TTiaraHyballSpectra
();
private:
// Instantiate and register histo to maps
TH1
*
AddHisto1D
(
TString
name
,
TString
title
,
Int_t
nbinsx
,
Double_t
xlow
,
Double_t
xup
,
TString
family
);
TH1
*
AddHisto2D
(
TString
name
,
TString
title
,
Int_t
nbinsx
,
Double_t
xlow
,
Double_t
xup
,
Int_t
nbinsy
,
Double_t
ylow
,
Double_t
yup
,
TString
family
);
// Initialization methods
void
InitRawSpectra
();
void
InitPreTreatedSpectra
();
void
InitPhysicsSpectra
();
public:
// Filling methods
void
FillRawSpectra
(
TTiaraHyballData
*
);
void
FillPreTreatedSpectra
(
TTiaraHyballData
*
);
// void FillPhysicsSpectra(TTiaraHyballPhysics*);
public:
// get map histo which will be used for GSpectra in GUser
map
<
vector
<
TString
>
,
TH1
*
>
GetMapHisto
()
const
{
return
fMapHisto
;}
TH1
*
GetHisto
(
TString
family
,
TString
name
);
void
WriteHisto
(
TString
filename
=
"VOID"
);
private
:
// Information on MUST2
unsigned
int
fRingsNumber
;
unsigned
int
fSectorsNumber
;
unsigned
int
fWedgesNumber
;
private
:
// map holding histo pointers and their family names
map
<
vector
<
TString
>
,
TH1
*
>
fMapHisto
;
};
#endif
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment