8 #include "CaloDetDescr/CaloDetDescrElement.h"
12 #include "CoralBase/Blob.h"
13 #include "CoralBase/Attribute.h"
14 #include "CoralBase/AttributeList.h"
15 #include "CoralBase/AttributeListSpecification.h"
16 #include "CoolKernel/StorageType.h"
21 m_ttService(
"CaloTriggerTowerService")
41 return StatusCode::SUCCESS;
54 coral::AttributeListSpecification*
spec =
new coral::AttributeListSpecification();
56 spec->extend(
"costheta",
"blob");
57 spec->extend(
"sinthetacosphi",
"blob");
58 spec->extend(
"sinthetasinphi",
"blob");
59 spec->extend(
"offlineTTid",
"blob");
68 costhetaBlob.resize(hashMax*
sizeof(
float));
69 sinthetacosphiBlob.resize(hashMax*
sizeof(
float));
70 sinthetasinphiBlob.resize(hashMax*
sizeof(
float));
71 offlineTTidBlob.resize(hashMax*
sizeof(
uint32_t));
73 float* pcostheta=
static_cast<float*
>(costhetaBlob.startingAddress());
74 float* psinthetacosphi=
static_cast<float*
>(sinthetacosphiBlob.startingAddress());
75 float* psinthetasinphi=
static_cast<float*
>(sinthetasinphiBlob.startingAddress());
76 uint32_t* pofflineTTid=
static_cast<uint32_t*
>(offlineTTidBlob.startingAddress());
88 return StatusCode::FAILURE;
91 for (
unsigned hs=0;
hs<hashMax;++
hs) {
94 if(!
cabling->isOnlineConnected(chid)){
98 psinthetacosphi[
hs]=0.0;
99 psinthetasinphi[
hs]=0.0;
107 return StatusCode::FAILURE;
111 const float eta = caloDDE->
eta();
112 const float phi = caloDDE->
phi();
113 const float v = 1./cosh(
eta);
114 const float costheta=tanh(
eta);
115 const float sinthetacosphi=
v*
cos(
phi);
116 const float sinthetasinphi=
v*
sin(
phi);
118 pcostheta[
hs]=costheta;
119 psinthetacosphi[
hs]=sinthetacosphi;
120 psinthetasinphi[
hs]=sinthetasinphi;
121 pofflineTTid[
hs]=
m_ttService->whichTTID(
id).get_identifier32().get_compact();
137 const float* pcostheta=
static_cast<const float*
>(costhetaBlob.startingAddress());
138 const float* psinthetacosphi=
static_cast<const float*
>(sinthetacosphiBlob.startingAddress());
139 const float* psinthetasinphi=
static_cast<const float*
>(sinthetasinphiBlob.startingAddress());
140 const uint32_t* pofflineTTid=
static_cast<const uint32_t*
>(offlineTTidBlob.startingAddress());
143 std::ostream *
out = &(std::cout);
155 for (
unsigned hs=0;
hs<hashMax;++
hs) {
158 << pcostheta[
hs] <<
" " << psinthetacosphi[
hs] <<
" " << psinthetasinphi[
hs]
159 <<
" 0x"<< std::hex << pofflineTTid[
hs] << std::dec << std::endl;
167 return StatusCode::SUCCESS;