Skip to content

Commit

Permalink
Merge pull request #376 from JeffersonLab/doc_factoryObjectsRegeneratio
Browse files Browse the repository at this point in the history
Added Subsection on Forcing Object Regeneration in JFactory Documentation
  • Loading branch information
nathanwbrei authored Oct 29, 2024
2 parents ba511e3 + b3ff218 commit b08acbb
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions docs/jana1to2/developers-transition-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -686,6 +686,26 @@ for (auto hit: results){
Set(results)
```
### Forcing Factory to Regenerate Objects
##### **JANA1**
In JANA1, adding `use_factory` in the constructor forces the factory to regenerate objects, regardless of whether they already exist in the input file. This prevents JANA from searching the input file for those objects. For example:
```cpp
DEventWriterROOT_factory_ReactionEfficiency() {
use_factory = 1; // prevents JANA from searching the input file for these objects
};
```

##### **JANA2**
In JANA2, the `use_factory` flag is no longer used. To achieve the same functionality, the `SetRegenerateFlag` function must be called with `true` as the parameter. This will prevent JANA from searching the input file for these objects, similar to the behavior in JANA1. For example:

```cpp
DEventWriterROOT_factory_ReactionEfficiency() {
SetRegenerateFlag(true); // prevents JANA from searching the input file for these objects
};
```

## JEvent
### Transition from JEventLoop to JEvent
##### **JANA1**
Expand Down

0 comments on commit b08acbb

Please sign in to comment.