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 BmnVSPStation)\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 BmnVSPStation::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) {
204 if( strcmp(attr->GetName(),
"rotAngleDeg") == 0 ) {
207 if( strcmp(attr->GetName(),
"rotCenterX") == 0 ) {
210 if( strcmp(attr->GetName(),
"rotCenterY") == 0 ) {
216 node = node->GetChildren();
217 Int_t currentModuleNum = 0;
219 if( strcmp(node->GetNodeName(),
"Module") == 0 ) {
220 Bool_t parse_status = ParseModule(node, currentModuleNum);
221 if(!parse_status)
return false;
224 node = node->GetNextNode();
230Int_t BmnVSPStation::CountNumberOfModules(TXMLNode *node) {
231 Int_t module_cnt = 0;
232 node = node->GetChildren();
234 if( strcmp(node->GetNodeName(),
"Module") == 0 ) {
237 node = node->GetNextNode();
242Bool_t BmnVSPStation::ParseModule(TXMLNode *node, Int_t iModule) {
244 if( node->HasAttributes() ) {
245 TList *attrList = node->GetAttributes();
247 TIter next(attrList);
249 while ((attr = (TXMLAttr*)next()) !=
nullptr) {
250 if( strcmp(attr->GetName(),
"xShift") == 0 ) {
253 if( strcmp(attr->GetName(),
"yShift") == 0 ) {
256 if( strcmp(attr->GetName(),
"zShift") == 0 ) {
266 node = node->GetChildren();
267 Int_t currentLayerNum = 0;
269 if( strcmp(node->GetNodeName(),
"Layer") == 0 ) {
273 node = node->GetNextNode();
279BmnVSPLayer BmnVSPStation::ParseLayer(TXMLNode *node, Int_t iLayer, Int_t iModule) {
282 Int_t first_strip_number;
285 Double_t xsize, ysize, xorig, yorig;
287 Double_t lx_border, ly_border;
288 Double_t rx_border, ry_border;
290 if( node->HasAttributes() ) {
291 TList *attrList = node->GetAttributes();
293 TIter next(attrList);
295 while ((attr = (TXMLAttr*)next()) !=
nullptr) {
296 if( strcmp(attr->GetName(),
"zoneID") == 0 ) {
297 zone_id = atoi(attr->GetValue());
299 if( strcmp(attr->GetName(),
"type") == 0 ) {
300 if( strcmp(attr->GetValue(),
"lower") == 0 ) {
303 if( strcmp(attr->GetValue(),
"upper") == 0 ) {
307 if( strcmp(attr->GetName(),
"firstStripNumber") == 0 ) {
308 first_strip_number = atoi(attr->GetValue());
310 if( strcmp(attr->GetName(),
"stripAngle") == 0 ) {
311 adeg = atof(attr->GetValue());
313 if( strcmp(attr->GetName(),
"pitch") == 0 ) {
314 pitch = atof(attr->GetValue());
316 if( strcmp(attr->GetName(),
"xorig") == 0 ) {
317 xorig = -atof(attr->GetValue());
319 if( strcmp(attr->GetName(),
"yorig") == 0 ) {
320 yorig = atof(attr->GetValue());
322 if( strcmp(attr->GetName(),
"xsize") == 0 ) {
323 xsize = atof(attr->GetValue());
325 if( strcmp(attr->GetName(),
"ysize") == 0 ) {
326 ysize = atof(attr->GetValue());
328 if( strcmp(attr->GetName(),
"stripDirection") == 0 ) {
329 if( strcmp(attr->GetValue(),
"LeftToRight") == 0 ) {
332 if( strcmp(attr->GetValue(),
"RightToLeft") == 0 ) {
336 if( strcmp(attr->GetName(),
"lxborder") == 0 ) {
337 lx_border = -atof(attr->GetValue());
339 if( strcmp(attr->GetName(),
"lyborder") == 0 ) {
340 ly_border = atof(attr->GetValue());
342 if( strcmp(attr->GetName(),
"rxborder") == 0 ) {
343 rx_border = -atof(attr->GetValue());
345 if( strcmp(attr->GetName(),
"ryborder") == 0 ) {
346 ry_border = atof(attr->GetValue());
351 BmnVSPLayer layer(zone_id, layer_type, first_strip_number,
356 layer.SetStripNumberingOrder(strip_direction);
364 node = node->GetChildren();
365 Int_t currentDeadZoneNum = 0;
367 if( strcmp(node->GetNodeName(),
"DeadZone") == 0 ) {
368 layer.AddDeadZone(ParseDeadZone(node, iModule));
369 currentDeadZoneNum++;
371 node = node->GetNextNode();
380 Int_t n_dead_points = CountDeadZonePoints(node);
381 Double_t *xpoints =
new Double_t[n_dead_points];
382 Double_t *ypoints =
new Double_t[n_dead_points];
385 node = node->GetChildren();
386 Int_t currentDeadPointNum = 0;
388 if( strcmp(node->GetNodeName(),
"DeadPoint") == 0 ) {
390 if( node->HasAttributes() ) {
391 TList *attrList = node->GetAttributes();
393 TIter next(attrList);
395 while ((attr = (TXMLAttr*)next()) !=
nullptr)
397 if( strcmp(attr->GetName(),
"x") == 0 ) {
400 if( strcmp(attr->GetName(),
"y") == 0 ) {
406 currentDeadPointNum++;
408 node = node->GetNextNode();
411 dead_zone.
SetDeadZone(n_dead_points, xpoints, ypoints);
419Int_t BmnVSPStation::CountDeadZonePoints(TXMLNode *node) {
420 Int_t dead_point_cnt = 0;
421 node = node->GetChildren();
423 if( strcmp(node->GetNodeName(),
"DeadPoint") == 0 ) {
426 node = node->GetNextNode();
428 return dead_point_cnt;
Bool_t SetModuleRotation(Double_t angleDeg, Double_t rot_center_x, Double_t rot_center_y)
Int_t GetNIntersectionPoints()
void CalculateStripHitIntersectionPoints()
Double_t GetModuleThickness()
Double_t GetZStartModulePosition()
void AddStripLayer(BmnVSPLayer strip_layer)
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)
Double_t RotationAngleDeg
void DefineStationBorders()
Double_t GetXShiftOfModule(Int_t module_num)
Double_t * ZShiftOfModules
Double_t * YShiftOfModules
Double_t GetZShiftOfModule(Int_t module_num)
Int_t CountNAddedToStationPoints()
BmnVSPModule * GetModule(Int_t module_num)
Int_t CountNProcessedPointInStation()
Double_t GetYShiftOfModule(Int_t module_num)
Int_t GetPointModuleOwnership(Double_t xcoord, Double_t ycoord, Double_t zcoord)
Double_t * XShiftOfModules
void ProcessPointsInStation()
Bool_t SetDeadZone(Int_t n_points, Double_t *xpoints, Double_t *ypoints)