Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pending items to be addressed after the integration of the first part of the MTD tracking/geometry PR in CMSSW #24452

Closed
perrotta opened this issue Sep 4, 2018 · 23 comments

Comments

@perrotta
Copy link
Contributor

perrotta commented Sep 4, 2018

The following issues raised during the review of #24285 were not addressed in that PR. The idea is to integrate now the large changes included in that pull request, so that development can continue more easily in the IBs. All the issue found need to be fixed after that PR get merged in the CMSSW release, however.

@lgray @kpedro88 @VinInn @slava77 @ianna

@perrotta
Copy link
Contributor Author

perrotta commented Sep 4, 2018

assign reconstruction, geometry

@cmsbuild
Copy link
Contributor

cmsbuild commented Sep 4, 2018

New categories assigned: geometry,reconstruction

@Dr15Jones,@cvuosalo,@mdhildreth,@slava77,@perrotta,@ianna,@civanch you have been requested to review this Pull request/Issue and eventually sign? Thanks

@cmsbuild
Copy link
Contributor

cmsbuild commented Sep 4, 2018

A new Issue was created by @perrotta .

@davidlange6, @Dr15Jones, @smuzaffar, @fabiocos, @kpedro88 can you please review it and eventually sign/assign? Thanks.

cms-bot commands are listed here

@kpedro88
Copy link
Contributor

kpedro88 commented Sep 4, 2018

assign upgrade

@cmsbuild
Copy link
Contributor

cmsbuild commented Sep 4, 2018

New categories assigned: upgrade

@kpedro88 you have been requested to review this Pull request/Issue and eventually sign? Thanks

@kpedro88
Copy link
Contributor

We might consider downgrading the warnings here to LogInfo, otherwise they will be printed in every pre-Phase2 workflow for the next N years:

try {
edm::ESHandle<MTDGeometry> mtdH;
record.getRecord<MTDDigiGeometryRecord>().get(mtdH);
if(mtdH.isValid()) {
mtd = mtdH.product();
} else {
LogWarning("GeometryGlobalTrackingGeometryBuilder") << "No MTD geometry is available.";
}
} catch (edm::eventsetup::NoRecordException<MTDDigiGeometryRecord>& e){
LogWarning("GeometryGlobalTrackingGeometryBuilder") << "No MTDDigiGeometryRecord is available.";
}

@kpedro88
Copy link
Contributor

kpedro88 commented Nov 1, 2018

loginfo and RTTI items addressed by #25063

others remain to be addressed later

@kpedro88
Copy link
Contributor

kpedro88 commented Feb 5, 2019

Here is the list of outstanding comments on #25063:
https://github.com/cms-sw/cmssw/pull/25063/files#r243429181
https://github.com/cms-sw/cmssw/pull/25063/files#r243420792
https://github.com/cms-sw/cmssw/pull/25063/files#r230146631
https://github.com/cms-sw/cmssw/pull/25063/files#r242384007
https://github.com/cms-sw/cmssw/pull/25063/files#r243436615
https://github.com/cms-sw/cmssw/pull/25063/files#r243435845
https://github.com/cms-sw/cmssw/pull/25063/files#r243436122
https://github.com/cms-sw/cmssw/pull/25063/files#r243436467
https://github.com/cms-sw/cmssw/pull/25063/files#r242387338
https://github.com/cms-sw/cmssw/pull/25063/files#r243436720
https://github.com/cms-sw/cmssw/pull/25063/files#r243437311
https://github.com/cms-sw/cmssw/pull/25063/files#r242416025
https://github.com/cms-sw/cmssw/pull/25063/files#r242416086
https://github.com/cms-sw/cmssw/pull/25063/files#r242418364
https://github.com/cms-sw/cmssw/pull/25063/files#r242418557
https://github.com/cms-sw/cmssw/pull/25063/files#r242423109
https://github.com/cms-sw/cmssw/pull/25063/files#r242420995
https://github.com/cms-sw/cmssw/pull/25063/files#r242423228
https://github.com/cms-sw/cmssw/pull/25063/files#r242423371
https://github.com/cms-sw/cmssw/pull/25063/files#r242423425
https://github.com/cms-sw/cmssw/pull/25063/files#r242423521
https://github.com/cms-sw/cmssw/pull/25063/files#r230149264
https://github.com/cms-sw/cmssw/pull/25063/files#r230150828
https://github.com/cms-sw/cmssw/pull/25063/files#r230149631
https://github.com/cms-sw/cmssw/pull/25063/files#r242424500
https://github.com/cms-sw/cmssw/pull/25063/files#r242673018
https://github.com/cms-sw/cmssw/pull/25063/files#r242679599
https://github.com/cms-sw/cmssw/pull/25063/files#r242750118
https://github.com/cms-sw/cmssw/pull/25063/files#r242368551
https://github.com/cms-sw/cmssw/pull/25063/files#r243138435
https://github.com/cms-sw/cmssw/pull/25063/files#r242371358

@ianna
Copy link
Contributor

ianna commented Oct 22, 2020

@fabiocos - please, check if there are any outstanding issues. Thanks!

@fabiocos
Copy link
Contributor

@ianna @kpedro88 yes, I had kept this link in my folder to have a look at it, I will check for a cleaning when the basics of the ongoing PR are done

@fabiocos
Copy link
Contributor

fabiocos commented Nov 4, 2020

#32026 addresses some of the comments listed by @perrotta at the beginning of this issue in the Geometry and RecoMTD/DetLayers domains. There are two other issues there not managed for the time being:

  • the refactorization of compatibleDets in the MTDRingForwardDoubleLayer class, with the problem being the same in the newly introduced MTDSectorForwardDoubleLayer class. Here honestly I wonder whether it is worthwhile to spend effort just to avoid having in two or three classes a similar loop of just a few lines, based on the example provided in the base class (but with a dummy implementation of groupedCompatibleDetsV). One could think to move all the relevant code for the derived class method inside a derived implementation of the dummy method, but I doubt this is really clean;

  • I am not sure which kind of modernization of ReferenceCountingPointer is desired, may be getting rid of boost? In any case this goes well beyond MTD code, and it is a project in itself, unless I am misinterpreting the point.

Furthermore @ianna was suggesting to replace within MTDDetId data format enum with enum class. This can be done, but it requires updates in a number of different places around the code, and the way I see it it would imply using static_cast within the boolean bit operations with masks, and as far as I can see there is no other such case within CMSSW. Before proposing such an update I'd like to be sure this is ok for other experts (@makortel any comment?)

@makortel
Copy link
Contributor

makortel commented Nov 4, 2020

In my opinion if the use of enum class leads to substantial use of static_cast to access the numerical value, it could be easier to stay with plain enum.

@perrotta
Copy link
Contributor Author

perrotta commented Nov 4, 2020

Thank you @fabiocos,
Since in this issue there is also an action which relates to the RecoMuon code, before forgetting about it I provided a (trivial) fix with #32029

@fabiocos
Copy link
Contributor

fabiocos commented Nov 5, 2020

@makortel thanks for the comment, in operations like those implied by https://github.com/cms-sw/cmssw/blob/master/DataFormats/ForwardDetId/interface/BTLDetId.h#L76 an explicit type cast is required il enum class is needed as far as I can see, just make a trivial test

12:37 mb-fc-03 534> cat testEnum.cpp 
#include <iostream>

int main() {

  enum pippo { aa = 1, bb = 2, cc = 3 };
  enum class ciccio : uint32_t { AA = 1, BB = 2, CC = 3 };

  const uint32_t mask = 0x2;

  std::cout << "Plain enum operation: " << (pippo::aa & mask) << " " << (pippo::bb & mask) << " " << (pippo::cc & mask) << std::endl;

  std::cout << "Class enum operation: " << (static_cast<uint32_t>(ciccio::AA) & mask) << " " << ((uint32_t)ciccio::BB & mask) << " " << (ciccio::CC & mask) << std::endl;

  return 0;

}

giving (on Mac with clang 11, but this is irrelevant here I believe)

12:41 mb-fc-03 535> g++ -std=c++11 testEnum.cpp 
testEnum.cpp:12:149: error: invalid operands to binary expression ('ciccio' and 'const uint32_t' (aka 'const unsigned int'))
  std::cout << "Class enum operation: " << (static_cast<uint32_t>(ciccio::AA) & mask) << " " << ((uint32_t)ciccio::BB & mask) << " " << (ciccio::CC & mask) << std::endl;
                                                                                                                                         ~~~~~~~~~~ ^ ~~~~
1 error generated.

@srimanob
Copy link
Contributor

Hi @fabiocos
Would you mind summarising what still need to follow up with this ticket? Thanks very much.

@fabiocos
Copy link
Contributor

@srimanob this issue is always in my inbox since 2018, I need to review with calm what possibly still applies as there were so many updates over time.

@fabiocos
Copy link
Contributor

fabiocos commented May 10, 2021

Pending list by @kpedro88 , partly addressed in #33680

@fabiocos
Copy link
Contributor

@srimanob as far as I can see, all the issues in the list by Kevin are addressed in #33680 .

@srimanob
Copy link
Contributor

Thanks very much, @fabiocos
When #33680 is merged, this issue can be closed.

@fabiocos
Copy link
Contributor

@perrotta I believe that most of the original items of yours were already addressed, and for the few remaining #24452 (comment) I already commented.

@perrotta
Copy link
Contributor Author

@perrotta I believe that most of the original items of yours were already addressed, and for the few remaining #24452 (comment) I already commented.

Ok, thank you Fabio.

About "modernization of ReferenceCountingPointer", this was proposed by @lgray in the comment at L74 of RecoMTD/DetLayers/src/MTDRingForwardDoubleLayer.cc in #24285: I agree that this goes beyond the MTD domain, since it touches all tracking geometries in CMSSW.

cmsbuild added a commit that referenced this issue May 17, 2021
MTD reconstruction: code cleaning for old comments (issue #24452)
@fabiocos
Copy link
Contributor

Now that #33680 has been merged, I would consider this issue as basically solved, accounting for the comments above.

@perrotta
Copy link
Contributor Author

+reconstruction

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants