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 XShiftOfModules(NULL), YShiftOfModules(NULL), ZShiftOfModules(NULL),
11 ThicknessOfModules(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 XShiftOfModules(NULL), YShiftOfModules(NULL), ZShiftOfModules(NULL),
25 ThicknessOfModules(NULL),
28 Bool_t create_status = CreateConfigurationFromXMLNode(stationNode);
30 std::cerr <<
"Error: There are problems with creation of the configuration from XML node (in BmnCSCStation)\n";
119 for(Int_t imodule = 0; imodule <
NModules; ++imodule) {
125 Double_t px, Double_t py, Double_t pz,
126 Double_t dEloss, Int_t refID) {
128 Int_t
module = GetPointModuleOwnership(xcoord, ycoord, zcoord);
131 if(
Modules[module]->AddRealPointFullOne(xcoord, ycoord, zcoord, px, py, pz, dEloss, refID)) {
144 Int_t points_sum = 0;
145 for(Int_t iModule = 0; iModule <
NModules; iModule++) {
152 for(Int_t iModule = 0; iModule <
NModules; iModule++) {
158 Int_t points_sum = 0;
159 for(Int_t iModule = 0; iModule <
NModules; iModule++) {
166 for(Int_t imodule = 0; imodule <
NModules; ++imodule) {
167 if(
Modules[imodule]->IsPointInsideModule(xcoord, ycoord, zcoord) )
return imodule;
194Bool_t BmnCSCStation::CreateConfigurationFromXMLNode(TXMLNode *node) {
195 NModules = CountNumberOfModules(node);
214 node = node->GetChildren();
215 Int_t currentModuleNum = 0;
217 if( strcmp(node->GetNodeName(),
"Module") == 0 ) {
218 Bool_t parse_status = ParseModule(node, currentModuleNum);
219 if(!parse_status)
return false;
222 node = node->GetNextNode();
228Int_t BmnCSCStation::CountNumberOfModules(TXMLNode *node) {
229 Int_t module_cnt = 0;
230 node = node->GetChildren();
232 if( strcmp(node->GetNodeName(),
"Module") == 0 ) {
235 node = node->GetNextNode();
240Bool_t BmnCSCStation::ParseModule(TXMLNode *node, Int_t iModule) {
242 if( node->HasAttributes() ) {
243 TList *attrList = node->GetAttributes();
245 TIter next(attrList);
247 while ((attr = (TXMLAttr*)next()) !=
nullptr)
249 if( strcmp(attr->GetName(),
"xShift") == 0 ) {
252 if( strcmp(attr->GetName(),
"yShift") == 0 ) {
255 if( strcmp(attr->GetName(),
"zShift") == 0 ) {
259 if( strcmp(attr->GetName(),
"thickness") == 0 ) {
268 node = node->GetChildren();
269 Int_t currentLayerNum = 0;
271 if( strcmp(node->GetNodeName(),
"Layer") == 0 ) {
275 node = node->GetNextNode();
281BmnCSCLayer BmnCSCStation::ParseLayer(TXMLNode *node, Int_t iLayer, Int_t iModule) {
286 Double_t xsize, ysize, xorig, yorig;
288 Double_t lx_border, ly_border;
289 Double_t rx_border, ry_border;
291 if( node->HasAttributes() ) {
292 TList *attrList = node->GetAttributes();
294 TIter next(attrList);
296 while ((attr = (TXMLAttr*)next()) !=
nullptr)
298 if( strcmp(attr->GetName(),
"zoneNumber") == 0 ) {
299 zone_number = atoi(attr->GetValue());
301 if( strcmp(attr->GetName(),
"type") == 0 ) {
302 if( strcmp(attr->GetValue(),
"lower") == 0 ) {
305 if( strcmp(attr->GetValue(),
"upper") == 0 ) {
309 if( strcmp(attr->GetName(),
"stripAngle") == 0 ) {
310 adeg = atof(attr->GetValue());
312 if( strcmp(attr->GetName(),
"pitch") == 0 ) {
313 pitch = atof(attr->GetValue());
315 if( strcmp(attr->GetName(),
"xorig") == 0 ) {
316 xorig = -atof(attr->GetValue());
318 if( strcmp(attr->GetName(),
"yorig") == 0 ) {
319 yorig = atof(attr->GetValue());
321 if( strcmp(attr->GetName(),
"xsize") == 0 ) {
322 xsize = atof(attr->GetValue());
324 if( strcmp(attr->GetName(),
"ysize") == 0 ) {
325 ysize = atof(attr->GetValue());
327 if( strcmp(attr->GetName(),
"stripDirection") == 0 ) {
328 if( strcmp(attr->GetValue(),
"LeftToRight") == 0 ) {
331 if( strcmp(attr->GetValue(),
"RightToLeft") == 0 ) {
335 if( strcmp(attr->GetName(),
"lxborder") == 0 ) {
336 lx_border = -atof(attr->GetValue());
338 if( strcmp(attr->GetName(),
"lyborder") == 0 ) {
339 ly_border = atof(attr->GetValue());
341 if( strcmp(attr->GetName(),
"rxborder") == 0 ) {
342 rx_border = -atof(attr->GetValue());
344 if( strcmp(attr->GetName(),
"ryborder") == 0 ) {
345 ry_border = atof(attr->GetValue());
355 layer.SetStripNumberingOrder(strip_direction);
363 node = node->GetChildren();
364 Int_t currentDeadZoneNum = 0;
366 if( strcmp(node->GetNodeName(),
"DeadZone") == 0 ) {
367 layer.AddDeadZone(ParseDeadZone(node, iModule));
368 currentDeadZoneNum++;
370 node = node->GetNextNode();
379 Int_t n_dead_points = CountDeadZonePoints(node);
380 Double_t *xpoints =
new Double_t[n_dead_points];
381 Double_t *ypoints =
new Double_t[n_dead_points];
384 node = node->GetChildren();
385 Int_t currentDeadPointNum = 0;
387 if( strcmp(node->GetNodeName(),
"DeadPoint") == 0 ) {
389 if( node->HasAttributes() ) {
390 TList *attrList = node->GetAttributes();
392 TIter next(attrList);
394 while ((attr = (TXMLAttr*)next()) !=
nullptr)
396 if( strcmp(attr->GetName(),
"x") == 0 ) {
399 if( strcmp(attr->GetName(),
"y") == 0 ) {
405 currentDeadPointNum++;
407 node = node->GetNextNode();
410 dead_zone.
SetDeadZone(n_dead_points, xpoints, ypoints);
418Int_t BmnCSCStation::CountDeadZonePoints(TXMLNode *node) {
419 Int_t dead_point_cnt = 0;
420 node = node->GetChildren();
422 if( strcmp(node->GetNodeName(),
"DeadPoint") == 0 ) {
425 node = node->GetNextNode();
427 return dead_point_cnt;
void CalculateStripHitIntersectionPoints()
Double_t GetModuleThickness()
Int_t GetNIntersectionPoints()
void AddStripLayer(BmnCSCLayer strip_layer)
Double_t GetZStartModulePosition()
Double_t * YShiftOfModules
Double_t GetZShiftOfModule(Int_t module_num)
Double_t GetYShiftOfModule(Int_t module_num)
Double_t * ZShiftOfModules
Int_t CountNAddedToStationPoints()
Int_t CountNProcessedPointInStation()
void ProcessPointsInStation()
Double_t GetXShiftOfModule(Int_t module_num)
Double_t GetThicknessOfModule(Int_t module_num)
Double_t * ThicknessOfModules
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)
Int_t GetPointModuleOwnership(Double_t xcoord, Double_t ycoord, Double_t zcoord)
BmnCSCModule * GetModule(Int_t module_num)
Double_t * XShiftOfModules
void DefineStationBorders()
Bool_t SetDeadZone(Int_t n_points, Double_t *xpoints, Double_t *ypoints)