Skip to content
Snippets Groups Projects
Commit c3ec2727 authored by Graeme Stewart's avatar Graeme Stewart
Browse files

Trigger/TrigCost/TrigCostData deleted from 20.1

parent e7981c57
No related branches found
No related tags found
No related merge requests found
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#ifndef ANP_EVENTMBTS_H
#define ANP_EVENTMBTS_H
/**********************************************************************************
* @Package: TrigCostRate
* @Class : EventMBTS
* @Author : Josh Kunkle
*
* @Brief : MBTS data for 32 pads for one event
*
**********************************************************************************/
// C/C++
#include <vector>
namespace Anp
{
class EventMBTS {
public:
EventMBTS();
~EventMBTS() {}
private:
std::vector<float> fChargeVec;
std::vector<float> fTimeVec;
private :
int GetIndex(int type, int chan, int module) const;
int GetType(int index) const;
int GetChannel(int index) const;
int GetModule(int index) const;
public :
void SetCharge(int type, int chan, int mod, float charge);
void SetTime(int type, int chan, int mod, float time);
// GetCharge(type) -> Get charge sum for side A or C
// GetCharge(type, channel) -> Get charge sum over 8 modules in type, channel
// GetCharge(type, channel, module)->Get charge for single module
float GetCharge(int tp, int ch = -1, int mod = -1) const;
float GetChargeCut(float cut, int tp, int ch = -1, int mod = -1) const;
// GetTime(type) -> Get average time for side A or C
// GetTime(type, channel) -> get average time over 8 modules in type, channel
// GetTime(type, channel, module)->Get time for single module
float GetTime(int tp, int ch = -1, int mod = -1) const;
// same scheme as above, but time is weighted by charge
float GetWeightedTime(int tp, int ch = -1, int mod = -1) const;
};
}
#endif
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#ifndef TRIGCOSTDATA_DICT_H
#define TRIGCOSTDATA_DICT_H
#include <vector>
#include "TrigCostData/EventMBTS.h"
#include "TrigCostData/Vertex.h"
#ifdef __GCCXML__
template class std::vector<Trig::Vertex>;
#endif
#endif
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#ifndef TRIG_VERTEX_H
#define TRIG_VERTEX_H
/**********************************************************************************
* @Package: TrigCostRate
* @Class : Vertex
* @Author : Stephen Sekula, Rustem Ospanov
*
* @Brief : Vertex information obtained for multiple interaction/collision study
*
**********************************************************************************/
namespace Trig
{
class Vertex {
public:
Vertex();
~Vertex() {}
private:
float fVertexNTracks;
float fVertexChi2;
float fVertexChi2Prob;
float fVertexX;
float fVertexY;
float fVertexZ;
float fVertexXerr;
float fVertexYerr;
float fVertexZerr;
public :
void SetVertexNTracks(float ntracks);
void SetVertexQuality(float chi2, float chi2prob);
void SetVertexPosition(float x, float y, float z);
void SetVertexError(float errx, float erry, float errz);
float GetVertexXerr() const { return fVertexXerr; }
float GetVertexYerr() const { return fVertexYerr; }
float GetVertexZerr() const { return fVertexZerr; }
float GetVertexX() const { return fVertexX; }
float GetVertexY() const { return fVertexY; }
float GetVertexZ() const { return fVertexZ; }
float GetVertexNTracks() const { return fVertexNTracks; }
float GetVertexChi2() const { return fVertexChi2; }
float GetVertexChi2Prob() const { return fVertexChi2Prob; }
};
}
#endif
<lcgdict>
<class name="Anp::EventMBTS" />
<class name="Trig::Vertex" />
<class name="std::vector<Trig::Vertex>" />
</lcgdict>
\ No newline at end of file
package TrigCostData
use AtlasPolicy AtlasPolicy-*
use AtlasReflex AtlasReflex-* External -no_auto_import
library TrigCostData *.cxx
apply_pattern installed_library
private
apply_pattern lcgdict dict=TrigCostData \
selectionfile=selection.xml \
headerfiles="../TrigCostData/TrigCostDataDict.h"
#macro cppdebugflags '$(cppdebugflags_s)'
end_private
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
// C/C++
#include <cstdlib>
#include <fstream>
#include <sstream>
#include <string>
#include <iostream>
#include <iomanip>
// Local
#include "TrigCostData/EventMBTS.h"
using namespace std;
//----------------------------------------------------------------------------------
Anp::EventMBTS::EventMBTS() : fChargeVec(32, 0.0),
fTimeVec(32, 0.0)
{
}
//----------------------------------------------------------------------------------
int Anp::EventMBTS::GetIndex(int type, int ch, int mod) const
{
if(std::abs(type) != 1) {
cout << "WARNING EventMBTS::GetIndex - Failed id check" << endl;
cout << type << endl;
return 0;
}
if(ch < 0 || ch > 1) {
cout << "WARNING EventMBTS::GetIndex - Failed id check" << endl;
cout << ch << endl;
return 0;
}
if(mod < 0 || mod > 7) {
cout << "WARNING EventMBTS::GetIndex - Failed id check" << endl;
cout << mod << endl;
return 0;
}
// if type == 0 && ch == 0, index = 0-7
// if type == 0 && ch == 1, index = 8-15
// if type == 1 && ch == 0 , index = 16-23
// if type == 1 && ch == 1 , index = 24-31
//int index = type*16 + ch*8 + mod;
int index = (type + ch + 1)*8 + mod;
if(index < 0 || index > 31) {
cout << "WARNING EventMBTS::GetIndex - Computed Index is out of range" << endl;
return 0;
}
return index;
}
//----------------------------------------------------------------------------------
int Anp::EventMBTS::GetType(int index) const
{
if(index < 0 || index > 31) {
cout << "WARNING EventMBTS::GetType - Index is out of range" << endl;
return 0;
}
return index < 16 ? -1 : 1;
}
//----------------------------------------------------------------------------------
int Anp::EventMBTS::GetChannel(int index) const
{
if(index < 0 || index > 31) {
cout << "WARNING EventMBTS::GetChannel - Index is out of range" << endl;
return 0;
}
return (index/8)%2;
}
//----------------------------------------------------------------------------------
int Anp::EventMBTS::GetModule(int index) const
{
if(index < 0 || index > 31) {
cout << "WARNING EventMBTS::GetModule - Index is out of range" << endl;
return 0;
}
return index%8;
}
//----------------------------------------------------------------------------------
void Anp::EventMBTS::SetCharge(int type, int ch, int mod, float charge)
{
fChargeVec[GetIndex(type, ch, mod)] = charge;
}
//----------------------------------------------------------------------------------
void Anp::EventMBTS::SetTime(int type, int ch, int mod, float time)
{
fTimeVec[GetIndex(type, ch, mod)] = time;
}
//----------------------------------------------------------------------------------
float Anp::EventMBTS::GetCharge(int type, int ch, int mod) const
{
if(ch == -1 && mod == -1) {
float accum_charge = 0.0;
for(int i = 0; i < 2; ++i) {
for(int j = 0; j < 8; ++j) {
accum_charge += fChargeVec[GetIndex(type, i, j)];
}
}
return accum_charge;
}
else if(mod == -1) {
float accum_charge = 0.0;
for(unsigned int i = 0; i < 8; ++i) {
accum_charge += fChargeVec[GetIndex(type, ch, i)];
}
return accum_charge;
}
else {
return fChargeVec[GetIndex(type, ch, mod)];
}
}
//----------------------------------------------------------------------------------
float Anp::EventMBTS::GetChargeCut(float cut, int type, int ch, int mod) const
{
if(ch == -1 && mod == -1) {
float accum_charge = 0.0;
for(int i = 0; i < 2; ++i) {
for(int j = 0; j < 8; ++j) {
float charge = fChargeVec[GetIndex(type, i, j)];
if(charge >= cut) {
accum_charge += charge;
}
}
}
return accum_charge;
}
else if(mod == -1) {
float accum_charge = 0.0;
for(unsigned int i = 0; i < 8; ++i) {
float charge = fChargeVec[GetIndex(type, ch, i)];
if(charge >= cut) {
accum_charge += charge;
}
}
return accum_charge;
}
else {
if(fChargeVec[GetIndex(type, ch, mod)] >= cut) {
return fChargeVec[GetIndex(type, ch, mod)];
}
else {
return 0.0;
}
}
}
//----------------------------------------------------------------------------------
float Anp::EventMBTS::GetTime(int type, int ch, int mod) const
{
if(ch == -1 && mod == -1) {
float accum_time = 0.0;
int count = 0;
for(int i = 0; i < 2; ++i) {
for(int j = 0; j < 8; ++j) {
accum_time += fTimeVec[GetIndex(type, i, j)];
if (fTimeVec[GetIndex(type, i, j)] > 0.0) {
count++;
}
}
}
if( count > 0 ) return accum_time/count;
else return 0.0;
}
else if(mod == -1) {
float accum_time = 0.0;
int count = 0;
for(unsigned int i = 0; i < 8; ++i) {
accum_time += fTimeVec[GetIndex(type, ch, i)];
if (fTimeVec[GetIndex(type, ch, i)] > 0.0) {
count++;
}
}
if( count > 0 ) return accum_time/count;
else return 0.0;
}
else {
return fTimeVec[GetIndex(type, ch, mod)];
}
}
//----------------------------------------------------------------------------------
float Anp::EventMBTS::GetWeightedTime(int type, int ch, int mod) const
{
if(ch == -1 && mod == -1) {
float accum_time_w = 0.0;
for(int i = 0; i < 2; ++i) {
for(int j = 0; j < 8; ++j) {
int index = GetIndex(type, i, j);
accum_time_w += fTimeVec[index]*fChargeVec[index];
}
}
float charge = GetCharge(type, ch, mod);
if( charge > 0.0 ) return accum_time_w/charge;
else return 0.0;
}
else if(mod == -1) {
float accum_time_w = 0.0;
for(unsigned int i = 0; i < 8; ++i) {
int index = GetIndex(type, ch, i);
accum_time_w += fTimeVec[index]*fChargeVec[index];
}
float charge = GetCharge(type, ch, mod);
if( charge > 0.0 ) return accum_time_w/charge;
else return 0.0;
}
else {
int index = GetIndex(type, ch, mod);
return fTimeVec[index];
}
}
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
// Local
#include "TrigCostData/Vertex.h"
using namespace std;
//----------------------------------------------------------------------------------
Trig::Vertex::Vertex() :
fVertexNTracks(0),
fVertexChi2(0),
fVertexChi2Prob(0),
fVertexX(0),
fVertexY(0),
fVertexZ(0),
fVertexXerr(0),
fVertexYerr(0),
fVertexZerr(0)
{
}
//----------------------------------------------------------------------------------
void Trig::Vertex::SetVertexNTracks(float ntracks)
{
fVertexNTracks = ntracks ;
}
//----------------------------------------------------------------------------------
void Trig::Vertex::SetVertexQuality(float chi2, float chi2prob)
{
fVertexChi2 = chi2;
fVertexChi2Prob = chi2prob;
}
//----------------------------------------------------------------------------------
void Trig::Vertex::SetVertexPosition(float x, float y, float z)
{
fVertexX = x;
fVertexY = y;
fVertexZ = z;
}
//----------------------------------------------------------------------------------
void Trig::Vertex::SetVertexError(float errx, float erry, float errz)
{
fVertexXerr = errx;
fVertexYerr = erry;
fVertexZerr = errz;
}
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