4: StationNumber(0), NModules(0),
5 XMinStation(0.0), XMaxStation(0.0),
6 YMinStation(0.0), YMaxStation(0.0),
7 ZMinStation(0.0), ZMaxStation(0.0),
8 XSize(0.0), YSize(0.0), ZSize(0.0),
9 XPosition(0.0), YPosition(0.0), ZPosition(0.0),
10 RotationAngleDeg(0.0), RotationCenterX(0.0), RotationCenterY(0.0),
11 XShiftOfModules(NULL), YShiftOfModules(NULL), ZShiftOfModules(NULL),
16 Double_t xpos_station, Double_t ypos_station, Double_t zpos_station)
18: StationNumber(iStation), NModules(0),
19 XMinStation(0.0), XMaxStation(0.0),
20 YMinStation(0.0), YMaxStation(0.0),
21 ZMinStation(0.0), ZMaxStation(0.0),
22 XSize(0.0), YSize(0.0), ZSize(0.0),
23 XPosition(xpos_station), YPosition(ypos_station), ZPosition(zpos_station),
24 RotationAngleDeg(0.0), RotationCenterX(0.0), RotationCenterY(0.0),
25 XShiftOfModules(NULL), YShiftOfModules(NULL), ZShiftOfModules(NULL),
28 Bool_t create_status = CreateConfigurationFromXMLNode(stationNode);
30 std::cerr <<
"Error: There are problems with creation of the configuration from XML node (in BmnSiliconStation)\n";
106 for(Int_t imodule = 0; imodule <
NModules; ++imodule) {
112 Double_t px, Double_t py, Double_t pz,
113 Double_t dEloss, Int_t refID) {
115 Int_t
module = GetPointModuleOwnership(xcoord, ycoord, zcoord);
121 if(
Modules[module]->AddRealPointFull(xcoord, ycoord, zcoord, px, py, pz, dEloss, refID)) {
132 Int_t points_sum = 0;
133 for(Int_t iModule = 0; iModule <
NModules; iModule++) {
140 for(Int_t iModule = 0; iModule <
NModules; iModule++) {
146 Int_t points_sum = 0;
147 for(Int_t iModule = 0; iModule <
NModules; iModule++) {
154 for(Int_t imodule = 0; imodule <
NModules; ++imodule) {
155 if(
Modules[imodule]->IsPointInsideModule(xcoord, ycoord, zcoord,
false) )
return imodule;
181Bool_t BmnSiliconStation::CreateConfigurationFromXMLNode(TXMLNode *node) {
182 NModules = CountNumberOfModules(node);
198 if( node->HasAttributes() ) {
199 TList *attrList = node->GetAttributes();
201 TIter next(attrList);
203 while ((attr = (TXMLAttr*)next()) !=
nullptr)
205 if( strcmp(attr->GetName(),
"rotAngleDeg") == 0 ) {
208 if( strcmp(attr->GetName(),
"rotCenterX") == 0 ) {
211 if( strcmp(attr->GetName(),
"rotCenterY") == 0 ) {
217 node = node->GetChildren();
218 Int_t currentModuleNum = 0;
220 if( strcmp(node->GetNodeName(),
"Module") == 0 ) {
221 Bool_t parse_status = ParseModule(node, currentModuleNum);
222 if(!parse_status)
return false;
225 node = node->GetNextNode();
231Int_t BmnSiliconStation::CountNumberOfModules(TXMLNode *node) {
232 Int_t module_cnt = 0;
233 node = node->GetChildren();
235 if( strcmp(node->GetNodeName(),
"Module") == 0 ) {
238 node = node->GetNextNode();
243Bool_t BmnSiliconStation::ParseModule(TXMLNode *node, Int_t iModule) {
245 if( node->HasAttributes() ) {
246 TList *attrList = node->GetAttributes();
248 TIter next(attrList);
250 while ((attr = (TXMLAttr*)next()) !=
nullptr)
252 if( strcmp(attr->GetName(),
"xShift") == 0 ) {
255 if( strcmp(attr->GetName(),
"yShift") == 0 ) {
258 if( strcmp(attr->GetName(),
"zShift") == 0 ) {
268 node = node->GetChildren();
269 Int_t currentLayerNum = 0;
271 if( strcmp(node->GetNodeName(),
"Layer") == 0 ) {
275 node = node->GetNextNode();
281BmnSiliconLayer BmnSiliconStation::ParseLayer(TXMLNode *node, Int_t iLayer, Int_t iModule) {
284 Int_t first_strip_number;
287 Double_t xsize, ysize, xorig, yorig;
289 Double_t lx_border, ly_border;
290 Double_t rx_border, ry_border;
292 if( node->HasAttributes() ) {
293 TList *attrList = node->GetAttributes();
295 TIter next(attrList);
297 while ((attr = (TXMLAttr*)next()) !=
nullptr)
299 if( strcmp(attr->GetName(),
"zoneID") == 0 ) {
300 zone_id = atoi(attr->GetValue());
302 if( strcmp(attr->GetName(),
"type") == 0 ) {
303 if( strcmp(attr->GetValue(),
"lower") == 0 ) {
306 if( strcmp(attr->GetValue(),
"upper") == 0 ) {
310 if( strcmp(attr->GetName(),
"firstStripNumber") == 0 ) {
311 first_strip_number = atoi(attr->GetValue());
313 if( strcmp(attr->GetName(),
"stripAngle") == 0 ) {
314 adeg = atof(attr->GetValue());
316 if( strcmp(attr->GetName(),
"pitch") == 0 ) {
317 pitch = atof(attr->GetValue());
319 if( strcmp(attr->GetName(),
"xorig") == 0 ) {
320 xorig = -atof(attr->GetValue());
322 if( strcmp(attr->GetName(),
"yorig") == 0 ) {
323 yorig = atof(attr->GetValue());
325 if( strcmp(attr->GetName(),
"xsize") == 0 ) {
326 xsize = atof(attr->GetValue());
328 if( strcmp(attr->GetName(),
"ysize") == 0 ) {
329 ysize = atof(attr->GetValue());
331 if( strcmp(attr->GetName(),
"stripDirection") == 0 ) {
332 if( strcmp(attr->GetValue(),
"LeftToRight") == 0 ) {
335 if( strcmp(attr->GetValue(),
"RightToLeft") == 0 ) {
339 if( strcmp(attr->GetName(),
"lxborder") == 0 ) {
340 lx_border = -atof(attr->GetValue());
342 if( strcmp(attr->GetName(),
"lyborder") == 0 ) {
343 ly_border = atof(attr->GetValue());
345 if( strcmp(attr->GetName(),
"rxborder") == 0 ) {
346 rx_border = -atof(attr->GetValue());
348 if( strcmp(attr->GetName(),
"ryborder") == 0 ) {
349 ry_border = atof(attr->GetValue());
359 layer.SetStripNumberingOrder(strip_direction);
367 node = node->GetChildren();
368 Int_t currentDeadZoneNum = 0;
370 if( strcmp(node->GetNodeName(),
"DeadZone") == 0 ) {
371 layer.AddDeadZone(ParseDeadZone(node, iModule));
372 currentDeadZoneNum++;
374 node = node->GetNextNode();
383 Int_t n_dead_points = CountDeadZonePoints(node);
384 Double_t *xpoints =
new Double_t[n_dead_points];
385 Double_t *ypoints =
new Double_t[n_dead_points];
388 node = node->GetChildren();
389 Int_t currentDeadPointNum = 0;
391 if( strcmp(node->GetNodeName(),
"DeadPoint") == 0 ) {
393 if( node->HasAttributes() ) {
394 TList *attrList = node->GetAttributes();
396 TIter next(attrList);
398 while ((attr = (TXMLAttr*)next()) !=
nullptr)
400 if( strcmp(attr->GetName(),
"x") == 0 ) {
403 if( strcmp(attr->GetName(),
"y") == 0 ) {
409 currentDeadPointNum++;
411 node = node->GetNextNode();
414 dead_zone.
SetDeadZone(n_dead_points, xpoints, ypoints);
422Int_t BmnSiliconStation::CountDeadZonePoints(TXMLNode *node) {
423 Int_t dead_point_cnt = 0;
424 node = node->GetChildren();
426 if( strcmp(node->GetNodeName(),
"DeadPoint") == 0 ) {
429 node = node->GetNextNode();
431 return dead_point_cnt;
Double_t GetZStartModulePosition()
void AddStripLayer(BmnSiliconLayer strip_layer)
Bool_t SetModuleRotation(Double_t angleDeg, Double_t rot_center_x, Double_t rot_center_y)
Int_t GetNIntersectionPoints()
void CalculateStripHitIntersectionPoints()
Double_t GetModuleThickness()
Int_t GetPointModuleOwnership(Double_t xcoord, Double_t ycoord, Double_t zcoord)
Double_t GetZShiftOfModule(Int_t module_num)
void ProcessPointsInStation()
Double_t GetXShiftOfModule(Int_t module_num)
Double_t GetYShiftOfModule(Int_t module_num)
Int_t AddPointToStation(Double_t xcoord, Double_t ycoord, Double_t zcoord, Double_t px, Double_t py, Double_t pz, Double_t dEloss, Int_t refID)
virtual ~BmnSiliconStation()
Int_t CountNAddedToStationPoints()
Double_t RotationAngleDeg
Double_t * ZShiftOfModules
BmnSiliconModule ** Modules
void DefineStationBorders()
Int_t CountNProcessedPointInStation()
BmnSiliconModule * GetModule(Int_t module_num)
Double_t * YShiftOfModules
Double_t * XShiftOfModules
Bool_t SetDeadZone(Int_t n_points, Double_t *xpoints, Double_t *ypoints)