33{
35 if (!idhelper)
36 return;
37
38 Identifier
id =
m_csc->identify();
39
40 SoSeparator * errDetailed = new SoSeparator;
41 SoSeparator * errSimple = new SoSeparator;
42 shape_simple = errSimple;
43
44 double striplength =
m_csc->detectorElement()->stripLength(
id );
46 striplength += 300.0;
48 errSimple->addChild(line);
49 errSimple->addChild(
common()->nodeManager()->getShapeNode_Cross(10));
50 const double maxCharge = 1e5;
51
52
53
54
55
56
57
58
59 const double stripHeight = 1*CLHEP::mm;
60
61 const std::vector< float > charges =
m_csc->sampleCharges();
62 if (charges.size() == 0 )
63 {
64
65 errDetailed->addChild(
common()->nodeManager()->getShapeNode_Strip(striplength,
68 } else {
69 SoSeparator * rdos = new SoSeparator;
70
72
73
74
75
76 double chargeLength=striplength/static_cast<double>(charges.size());
77
79 double ypos=(chargeLength-striplength)/2.0;
80 std::vector<float>::const_iterator
st = charges.begin();
81 std::vector<float>::const_iterator
en = charges.end();
83 SoTranslation * localtrans = new SoTranslation;
84 localtrans->translation.setValue(0.0,ypos,0.0);
85 rdos->addChild(localtrans);
86
87 for( std::vector<float>::const_iterator it = st;
it!=
en; ++
it, ++
i){
88
89 float charge = std::max(1.0f,(*it));
90 const double stripHeightCharge = (1.0 + 4*sqrt(
charge/maxCharge))*CLHEP::mm;
91
92 rdos->addChild(
common()->nodeManager()->getShapeNode_Strip(chargeLength, stripPitch, stripHeightCharge));
93
94 SoTranslation * localtrans2 = new SoTranslation;
95 localtrans2->translation.setValue(0.0,chargeLength,0.0);
96 rdos->addChild(localtrans2);
97
98 }
99 errDetailed->addChild(rdos);
100 }
101 SoMaterial *
mat =
new SoMaterial;
102 mat->diffuseColor.setValue(1.0,0,0);
103 errDetailed->addChild(mat);
104 errDetailed->addChild(
common()->nodeManager()->getShapeNode_Cross(10));
105
106 shape_detailed = errDetailed;
107}
double charge(const T &p)
T_ResultType project(ParameterMapping::type< N > parameter_map, const T_Matrix &matrix)
int chamberLayer(const Identifier &id) const
bool measuresPhi(const Identifier &id) const override
SoNode * getShapeNode_Strip(double length, double width=0, double depth=0)
PRDSysCommonData * common() const
PRDCollHandleBase * collHandle() const
HitsSoNodeManager * nodeManager() const
static const CscIdHelper * cscIDHelper()
Eigen::Matrix< double, 2, 1 > Vector2D